alternative cos(x) and tan(x) [HP-33S] - 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: alternative cos(x) and tan(x) [HP-33S] (/thread-118993.html) |
alternative cos(x) and tan(x) [HP-33S] - Gerson W. Barbosa - 07-23-2007 Each of the following programs takes up only one label and will always give at least 11 correct digits for arguments in degrees ( -999,999,999,909 <= x <= 999,999,999,999 ). Gerson.
L0001 LBL L Re: alternative cos(x) and tan(x) [HP-33S] - Les Wright - 07-23-2007 Thanks Gerson for sharing yet another version of your minimax polynomial approximations of some of the trigonometric functions. For fussbudgets like me, this will be very useful, and I will enter them in my HP35S (the porting should be easy) when I get it. I am actually more troubled by the persistence of the cosine bug than the inconvenient entry of hex numbers everyone seems so fussed about. The persistence of the digit loss for arguments approaching 90 degrees has accuracy implications for the sine of very small angles, the tangent function, complex number math, and of course rectangular-polar conversions. FWIW, can someone with a 35S compute the cosine for 89.99, 89.999, 89.9999, and 89.99999, etc., degrees and let us all know?
Les
Re: alternative cos(x) and tan(x) [HP-33S] - sjthomas - 07-23-2007
Quote: cos(89.99) = 1.74532924306 E-4 cos(89.999) = 1.74532925091 E-5 cos(89.9999) = 1.74532925 E-6 cos(89.99999) = 1.7453292 E-7 cos(89.999999) = 1.745329 E-8 cos(89.9999999) = 1.74532 E-9 cos(89.99999999) = 1.74532925199 E-10 cos(89.999999999) = 1.74532925199 E-11 cos(89.9999999999) = 1.74532925199 E-12 cos(89.99999999999) = 1.74532925199 E-12 cos(89.999999999999) = 1.74532925199 E-12 . . .
Edited: 23 July 2007, 11:14 p.m.
Re: alternative cos(x) and tan(x) [HP-33S] - Les Wright - 07-24-2007 Thanks! Yep, the cosine bug has survived unchanged. I am actually intrigued that when one gets to 89.99999999, full 12-digit accuracy in the result returns. Weird! I am sure someone once explained the cause of this bug.
Les Edited: 24 July 2007, 5:35 a.m.
Re: alternative cos(x) and tan(x) [HP-33S] - Gerson W. Barbosa - 07-24-2007 Quote: Hello Les, I think it will run with no modification on the HP-35s. But it will require three keystrokes to access the function, by what I've read: [XEQ] [L] [ENTER], for instance, instead of the more convenient [XEQ] [COS] on the HP-33s. Best regards, Gerson.
Re: alternative cos(x) and tan(x) [HP-33S] - Gene Wright - 07-24-2007 Hi Les (and all). The 35s review at the hpcc.org site stated that the COS bug was still there. This was available the day the 35s was announced. Re: alternative cos(x) and tan(x) [HP-33S] - Les Wright - 07-25-2007 Gerson, Your routines are very fast. Say what you like about the now obsolete 33S, but it does run keystroke programs with lightning quickness. I understand that in many cases the 35S may actually be slower! I also like how you preserve the contents of the Y register for subsequent calculations. Unfortunately the routines don't keep the entire stack in its original state, but this is a nice touch. One problem about RPN programs is they make a mess of the stack sometimes, unlike the internal routines. RPL programs tend not to do this, unless you want them too.
Les
Re: alternative cos(x) and tan(x) [HP-33S] - Gerson W. Barbosa - 07-27-2007 Hello Les,
Quote:
Too bad they don't run fast enough on the 35s: about 1.5 seconds. They appear to run 10 times faster on the 33s (no timing so far). Regards,
Gerson.
|