Complex arg-trig functions

Stephen Montgomery-Smith stephen at missouri.edu
Sun Sep 16 15:13:47 UTC 2012


On 09/16/2012 12:14 AM, Bruce Evans wrote:
> On Sat, 15 Sep 2012, Stephen Montgomery-Smith wrote:
>
>> One more thing I would like an opinion on.
>>
>> In my code I check for |z| being small, and then use the approximations:
>> casinh(z) = z
>> cacos(z) = Pi - z
>
> Actually Pi/2 - z.
>
>> catanh(z) = z
>>
>> However these approximations are not used in the papers by Hull et al,
>> and the code works just fine if I don't include these in the code.
>
> Probably a bug in the papers.

It is not a bug in the papers.  The algorithms they provide really do 
work when |z| is small.  In fact, you have to deal separately with the 
cases |x| is small and |y| is small (z=x+I*y), so dealing with both of 
them being small is not any additional problem.

And now I see your other post, that using PI/2 is problematic especially 
when rounding is not to nearest.  (Then the problem of rounding PI/2 
properly is relegated to the acos function, and so it is someone else's 
problem.)

So all things being said and done, I am going to remove the use of these 
approximations.

(And also, my comments describing them had a silly mistake in them as well.)


More information about the freebsd-numerics mailing list