The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

28/48 used to validate scientific library
Message #1 Posted by Egan Ford on 23 June 2009, 11:08 a.m.

Last night I was helping an HPGCC user build GSL (GNU Scientific Library) for the 50g. After I got it compiled I needed to create a simple test case and opted for a complex square root. When I read the documentation (http://www.gnu.org/software/gsl/manual/html_node/Complex-Numbers.html) this gem was present:

Quote:
For multiple-valued functions the branch cuts have been chosen to follow the conventions of Abramowitz and Stegun in the Handbook of Mathematical Functions. The functions return principal values which are the same as those in GNU Calc, which in turn are the same as those in Common Lisp, The Language (Second Edition) and the HP-28/48 series of calculators.
The 28/48 was not the only source of validation, but interesting that it is mentioned and possibly implied as a trusted source.
      
Re: 28/48 used to validate scientific library
Message #2 Posted by Thomas Okken on 23 June 2009, 2:09 p.m.,
in response to message #1 by Egan Ford

That's interesting. When I implemented the complex functions in Free42, I simply went with whichever branch cut was easiest to implement, and there may well be discrepancies between that and what the real HP-42S does. I wonder if its complex functions have the same behavior as the 28/48 series?
I'll have to study this. Fortunately one can download Abramowitz & Stegun nowadays!

- Thomas

      
Re: 28/48 used to validate scientific library
Message #3 Posted by hugh steers on 23 June 2009, 2:24 p.m.,
in response to message #1 by Egan Ford

The complex numbers in Reckon and the uWatch take the branch cuts that agree with the hp15c (presumably the same as the 48).

the 15c manual claims these cuts were chosen so as to make the trigs and their inverses composed return the same original values.

            
Re: 28/48 used to validate scientific library
Message #4 Posted by Nigel J Dowrick on 24 June 2009, 3:47 a.m.,
in response to message #3 by hugh steers

Same with CasioRPN (another RPN calculator for the Casio FX-9860 series). I'm lucky enough to have a paper copy of the HP-42 manual; I checked it against the HP-28 manual on the museum disk and the cuts / branch points chosen appeared identical in each. From a programming point of view I don't recall that they were all the most natural; it's unlikely that simply choosing cuts / branch points as one goes along would lead to the same results.

Nigel

                  
Re: 28/48 used to validate scientific library
Message #5 Posted by Thomas Okken on 24 June 2009, 4:56 a.m.,
in response to message #4 by Nigel J Dowrick

Nigel, are you referring to chapter 6 of the HP-42S manual? Could you point me to any specific examples in the manual that would give a clue as to which branch cuts the 42S uses?
In my 42S simulator, I chose the cuts that seemed the most natural, and I believe that my implementation returns results that are mathematically correct, but I would like to make sure that my implementation is faithful to the original calculator as well.

- Thomas

                        
Re: 28/48 used to validate scientific library
Message #6 Posted by Nigel J Dowrick on 24 June 2009, 5:18 a.m.,
in response to message #5 by Thomas Okken

My memory must be going! You are quite correct - although I do own the HP-42S manual (and the calculator), the information about branch points / cuts is not in there. I actually used the information in the HP-15C "Advanced Functions" manual. Comparing this with my HP-42S showed that the same branch points / cuts were used by both calculators, and also by the HP-28S.

Sorry for any confusion.

Nigel

                              
Re: 28/48 used to validate scientific library
Message #7 Posted by Thomas Okken on 24 June 2009, 7:05 p.m.,
in response to message #6 by Nigel J Dowrick

Thanks for the information! I don't have any paper manuals for the 15C but the PDF versions on the Museum DVD will do. :-)
I guess it makes sense for complex math to be consistent between all complex-capable HP models, but it's good to have confirmation.

- Thomas


[ Return to Index | Top of Index ]

Go back to the main exhibit hall