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.

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

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.

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

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

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

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