The Museum of HP Calculators

HP Forum Archive 17

[ Return to Index | Top of Index ]

HP 35s trigonometric functions alternative
Message #1 Posted by Lyuka on 30 Aug 2007, 9:11 a.m.

To all who might be interested, here is another trigonometric program specially for the HP 35s.

HP 35s trigonometric functions (sin, cos and tan) alternative

Quote:
The HP 35s's built-in trigonometric functions seems to lose its accuracy around }/2, }/4, }3/2 and so on. In some case its accuracy goes down to seven digits or less which is not acceptable as the scientific calculator that features internal 15 digits precision. Anyway as it was necessary, I wrote the alternative trigonometric functions for the HP 35s. [Aug. 30, 2007]

Best regards,

Lyuka

      
Re: HP 35s trigonometric functions alternative
Message #2 Posted by Ed Look on 30 Aug 2007, 12:22 p.m.,
in response to message #1 by Lyuka

Impressive!

I applaud and appreciate your mathematical and coding passion.

      
Re: HP 35s trigonometric functions alternative
Message #3 Posted by Gerson W. Barbosa on 30 Aug 2007, 3:28 p.m.,
in response to message #1 by Lyuka

Congratulations!

Alternative trigonometric functions for the HP-35s are always welcome. Hopefully at least until the next ROM revision :-)

Saving the stack and the LastX register is nice. It's a pity the 35s is not as fast as the 33s. I'd like to know what your other references are, since you've used a different approach.

Best regards,

Gerson.

            
Re: HP 35s trigonometric functions alternative
Message #4 Posted by Lyuka on 31 Aug 2007, 4:41 a.m.,
in response to message #3 by Gerson W. Barbosa

Thanks.

I really want the bug-fixed version of the HP 35s.

By the way, I have no other reference since it is a kind of my original. Taylor series, the continued fraction, Chebyshev approximation, and Pade approximation itself are all well known mathematical method. However, I thought a method that optimise only the coefficients of the parts which have smaller computational error sensitivity, based on rational Chebyshev approximation.

'pi' in my program is coded as builtin PI (3.14159265359) - 2.06761537357E-13 this yields 25 digits pi approximation 3.141592653589793238462643.

Regards,

Lyuka

                  
Re: HP 35s trigonometric functions alternative
Message #5 Posted by Gerson W. Barbosa on 31 Aug 2007, 12:18 p.m.,
in response to message #4 by Lyuka

Quote:
'pi' in my program is coded as builtin PI (3.14159265359) - 2.06761537357E-13 this yields 25 digits pi approximation 3.141592653589793238462643.

Oops! I ought to have paid attention to the constant in line J078.

Thanks again for the very original contribution!

Gerson.

      
Re: HP 35s trigonometric functions alternative
Message #6 Posted by Gerson W. Barbosa on 30 Aug 2007, 10:01 p.m.,
in response to message #1 by Lyuka

Both your program and the built-in sine function give the same answer for

sin(3.1415926535)

-> 8.97932384626E-11

This means pi does not have to be hard-coded to 24 digits for this result to be possible, contrary to what I thought:

http://64.233.169.104/search?q=cache:FdTXWPVCnGIJ:www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/forum.cgi%3Fread%3D122855+site:hpmuseum.org+DLF&hl=en&ct=clnk&cd=2

The 2-second running time is very good. Too bad on the 35s at least THREE keystrokes are required before programs start running...

Regards,

Gerson.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall