Re: [R] branch cuts of atan()

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon 16 May 2005 - 21:54:38 EST

On Mon, 16 May 2005, Robin Hankin wrote:

> Professor Ripley
>
> thanks for this. Always good to know that I'm not missing any documentation!
>
> The source is clear; formula 4.4.39 effectively has a branch cut at |z|=1.
> A 'n' S show the standard branch cuts in their figure 4.4, which are
> different (they
> were the ones I was expecting). Mathematica and Maple both have branch cuts
> matching ams-55.
>
> Should the the Trig.Rd manpage warn that the branch cuts are non-standard?
> Simple workarounds exist to shift them to the standard place.
>
> Is this type of concern worthy of a bug report?

If you have a suggestion and code to implement it, definitely.

> The archetype would be
>
> tan(atan(2))
> [1] 2
>> tan(atan(2+0i))
> [1] -0.5+0i
>>
>
>
>
> best wishes
>
> Robin
>
>
>
>
>
> On May 16, 2005, at 10:23 am, Prof Brian Ripley wrote:
>
>> On Mon, 16 May 2005, Robin Hankin wrote:
>>
>>> Hi
>>>
>>>> atan(1.0001+0i)
>>> [1] -0.7853482+0i
>>>> atan(0.9999+0i)
>>> [1] 0.7853482+0i
>>>>
>>>
>>>
>>>
>>> evidently atan()'s branch cuts aren't where I thought they were.
>>>
>>> Where do I look for documentation on this?
>>
>> In the sources. Specifically for complex atan() in src/main/complex.c
>>
>> /* Complex Arctangent Function */
>> /* Equation (4.4.39) Abramowitz and Stegun */
>>
>> static void z_atan(Rcomplex *r, Rcomplex *z)
>> ...

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon May 16 22:06:02 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST