New Trigonometric Functions Program for the HP-12C - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: New Trigonometric Functions Program for the HP-12C (/thread-69811.html) |
New Trigonometric Functions Program for the HP-12C - GWB - 02-27-2005 Hi, I have submitted an article to the Articles Forum (Hyperbolic Approximations for Trigonometric Functions on the HP-12C). The 99-step program uses only the stack, leaving the financial registers and all the seven remaining registers free for the user. The average percent error is 0.05% never being greater than 0.10% all through the valid ranges, which is enough for practical purposes. Running times are about 4 to 5.5 seconds, depending on the function only, not on the arguments. All inputs and outputs are in degrees. For more details, those of you still interested please take a look at: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=470 Regards,
Gerson W. Barbosa Edited: 27 Feb 2005, 8:16 a.m.
Re: New Trigonometric Functions Program for the HP-12C - hugh steers - 02-27-2005 woot! the code makes good reading. i like the atan and the evalualtion cascade particularly without memories. pity about the ln(x). i think there are a couple of silly mistakes tho’ in your article. some of the expressions are missing a bracket and the arcos expression is missing the arctan. and should the 90- be a 90+ ?
good stuff. i just had to key it in!
Re: New Trigonometric Functions Program for the HP-12C - GWB - 02-27-2005 Thank you for having pointed me out the mistakes. I have corrected the expressions and double-checked them. Hugh Steers wrote:
Quote: I didn't like the ln(x) either, but this is the only way I found to recover x from the stack at that point. LN is a time consuming function I wanted to avoid. This causes the result to come out 500 to 600 ms later than it could, and this is a lot of time. That is, this instruction alone is responsible for about 10% of the total running time. Hugh Steer wrote:
Quote:
Actually there were more than a couple of silly mistakes (Having finished writing the article at 3:00 am last Friday might be an excuse).
All expressions may be copied and pasted to an equation plotter to graphically check the accuracy. Examples: a)Regards, Gerson
Edited: 27 Feb 2005, 5:01 p.m.
Re: New Trigonometric Functions Program for the HP-12C - hugh steers - 02-28-2005 great.
what i liked about your approach is that i'd never thought of approximating trigs with hyperbolics before. this is a good idea when you need to reduce the number of constants in the program (as these take up too many steps).
|