The following warnings occurred:
Warning [2] Undefined array key 11602 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11613 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11615 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11616 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11619 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11622 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11627 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11630 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11632 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11659 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11673 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11619 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11632 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 11673 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP-12C trigonometrics



#8

Hi, I've recently got an HP-12C, and I'm trying to write
a program for it implementing all six trigonometric
functions that it lacks, namely sin, cos, tan, and their
inverses. Now, I'm pretty sure this must be old hat for
everyone, but I've never seen before such a program.
I would be grateful if someone could point me where to
find that program, so that I could compare with mine and
see how its author solved the many troubles I've suffered
while implementing it, namely extreme shortage of program
memory to implement all 6 functions at once at the
greatest possible accuracy (8 decimal places or better)
for all the range of input values.

My actual beta version implements everything except the
arc cosine function (no big deal, it can be easily
computed as pi/2-arc sine) with 8-10 decimal places
accuracy, and uses no numbered registers at all, but I
would love to see how other coped with this subject.


#9

Ex-PPC member (are you under-cover?):

Can you post the program? I would love to see it, as would others, I'm sure.

For the good of us all, maybe we'll start a sort of informal contest, where programs are presented for the 12C and 17BII to acomplish the trig. and inverse trig. functions. Seems reasonable to me---these two calculators are current, and both have advantages over the 32SII (the only current RPN scientific) excepting some key scientific functions. I would say that the 12C has a landscape-format advantage (for many people---I prefer the portrait format myself) and a number-display advantage, and the 17BII has numerous advantages over the 32SII (the 17BII is simply a much more powerful machine).

I recently submitted my solution for the 17BII, but I limited my solution to the region [0, PI/2]. I'm sure my program could be improved, but there doesn't seem to be an overwhelming interest...

Bruce.


#10

Thanks for your kind words. I don't know how to post the
program here, I guess a raw listing in a posted response
would get weirdly formatted, if at all.

The main difficulties I've found stem from the HP-12C's
extremely limited programming capabilities. You just have
to try and fit all 6 trig functions in 99 bytes ! That
wouldn't be so bad as it seems were it not for the fact
that you don't have labels, nor flags, only x<=y and
x=0 tests (which forces you to *substract* two values
and compare the result to zero, when you actually wanted
to compare one against the other), no indirect adressing, no increment/decrement instructions, and, most decisively,
you don't have subroutine capability (!!). That alone is
really the ultimate coup-de-grace to fit everything
accurately in so little memory. Matter of fact, I haven't
succeeded, I just can't find room enough to include
the arc cosine. Only the fact that it's easily computed
from the arc sine (pi/2-arcsin) saves the day. That's
why I'm so interested in looking at other people's
solutions to this particular programming issue. I'm sure
some must exist already.


#11

You can do it like:

[pre:
program line 1
program line 2
etc.
]
#12

If you can find a copy of the Collected Algorithms of the ACM (Association for Computing Machinery) from around 1976 +/- 3 years or so there is a "continued fraction" algorithm. As I rememeber it produces a couple of numbers that depending upon how you combine them gives you all the trig funcions, e^x, and hyperbolics. It has been a long time since I played with it but it was rather short, fast, and most interesting.


#13

Try:
M. Abramowitz and I. Stegun. Handbook of Mathematical Functions. Dover, 1972.

There you will find a lot of very useful approximations, easy to program for different levels of accuracy.

Jan


#14

I have once written a very short program for the HP38C that computed SIN, COS and TAN (no inverses), less than 15 steps. At that time I was studying for Electrical Eng. (long, long time ago...) and I have lost it. I remember computing Taylor series for sine and cosine (n! saved the day) and dividing both to compute tangent. It would fit perfectly in an HP12C.

I also remembered using TVM procedure to estimate energy consumption x production in a power plant. How many good stuff we had to do at that time...

Will anybody share the programs with us? I would if I had, I remember not even noting the steps, as the program was of no specific need of mine (only for that charming 19 Y.O. girl I cannot really forget the thankful face when my program ran smoothly on her HP38C).


#15

Luiz Claudio, if we put trigonometrics aside, it would be more interesting to know what happened later, with respect to that 19 Y.O. 8-) ?


#16

She got her Engineering graduation and... left many gratefull memories. I would like knowing where is she, right now. Just memories... Anyway, who does not have them?

|-(

(Hey, do you still need that material about the 41CX? Let me know...)

#17

All,

I have already posted the trig functions earlier here. See Forum Archive 6 entitled "Add trig functions on HP17BII, etc.? (You can)" for the source. I incorrectly stated that they were the Maclaughlin series--they're actually the Maclaurin series. They work quite well in both directions.

FYI and good luck,
M.


#18

Mike:

You seem to have missed the point. I, too, posted information on programming trig. functions into the HP-17BII, except my algorithms also include the INVERSE trig. functions, which is something that we are talking about here. I also included a full program listing. Look in the current forum page for:

Improved TRIG. and INVERSE TRIG. functions for the HP-17BII (Posted Sept. 26, 2001)

I actually had posted my first post on trig. functions for the 17BII on 7/31/2001 (horrible code---see the later post for details). I then followed it up on 9/26/2001 with a vastly superior implementation than the dumb one I first posted. Your article was posted on 9/3/2001. Please look at my 9/26/2001 post for an example of formatting that I think is acceptable for HP-17BII listings. As soon as you go into the Forum, there is a hyper-link to advanced formatting techniques.

The point here, is come up with code to fit these functions into a 12c. The 12c is a completely different programming beast than the 17BII, and is much more limited. That is what this thread is about.

If you are able to implement your algorithms on a 12c for all the trig. AND INVERSE TRIG. functions, please post a 12c listing!

Bruce.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP 12C, 12C Platinum & 15C iOS App Walter Lam 2 1,367 06-02-2011, 01:25 PM
Last Post: Andrés C. Rodríguez (Argentina)
  Trigonometrics on the 17bii+ Les Wright 8 2,129 03-04-2007, 09:44 PM
Last Post: Les Wright
  Trigonometrics for Really Big Input Les Wright 18 3,954 02-24-2007, 10:38 PM
Last Post: Massimo Gnerucci (Italy)
  12C vs 12C Platinum Cash Flows Katie Wasserman 10 2,791 12-28-2005, 10:12 PM
Last Post: tony(nz)
  12c/12c Platinum programming differences Don Shepherd 6 1,971 08-11-2003, 10:11 AM
Last Post: Gene
  Trigonometrics in financial applications Valentin Albillo 17 3,776 06-30-2003, 10:36 AM
Last Post: Thibaut
  12C or 12C Platinum...that is the question Joe 3 1,322 06-21-2003, 11:39 PM
Last Post: Don Nguyen
  What's CPU of HP 12C and HP 12C Platinum Luc Chanh Truong 3 1,417 06-11-2003, 01:49 AM
Last Post: Vieira, Luiz C. (Brazil)
  Hi !! Gene, HP 12C vs 12C Platinum Luc Chanh Truong 0 787 06-09-2003, 10:28 PM
Last Post: Luc Chanh Truong
  Re: Inconsistent results #1: 12c vs. 12c Platinum hugh 1 924 05-14-2003, 03:22 PM
Last Post: Gene

Forum Jump: