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?


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, [EMAIL PROTECTED] 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


--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
 tel  023-8059-7743

______________________________________________
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

Reply via email to