comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » better atan function?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
better atan function? [message #20238] Tue, 30 May 2000 00:00 Go to next message
R is currently offline  R
Messages: 4
Registered: May 2000
Junior Member
Greetings all,


I have found that the phase I get from the FFT has
a precision of only ~10e-8, and that the precision depends
on what value phase has.

I think I've traced this to the atan function, or perhaps the
division that takes place in the atan function.

Does anyone have a better atan function (more precise)?

Or is this merely the way it is when one is bumping up against
precision errors?

By comparison, my "simulation" does get the amplitudes
of the spectral components to a precision of ~10e-14 or so.
(as expected for double precision variables, and no noise)

cheers,
bob
stockwell (at) co-ra (dot) com
Re: better atan function? [message #20319 is a reply to message #20238] Thu, 01 June 2000 00:00 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
bjackel@phys.ucalgary.ca wrote:
>
> Hi Bob
>
> Hmm. A couple minutes playing with atan gives the following:
>
> IDL> help,atan(1.0d-12,1.0d0)
> <Expression> DOUBLE = 1.0000000e-012
>
> IDL> help,atan(1.0d-15,1.0d0)
> <Expression> DOUBLE = 1.0000000e-015
>
> IDL> help,!dpi/2.0d0 - atan(1.0d0,1.0d-12)
> <Expression> DOUBLE = 9.9986686e-013
>
> IDL> help,!dpi/2.0d0 - atan(1.0d0,1.0d-15)
> <Expression> DOUBLE = 8.8817842e-016
>
> So the small angle stuff is essentially perfect. The error
> at large angles is almost certainly due to subtracting two
> nearly equal quantities. This of course doesn't rule out
> something funny for moderate angles, but it'd be surprising.

Some interesting observations on computing elementary functions are
available at
http://math.nist.gov/javanumerics/reports/jgfnwg-02.html#App endix-3

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Math Libraries in PVWAVE
Next Topic: ANNOUNCE: spice-dlm, an IDL interface to the SPICE toolkit

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:20:59 PDT 2025

Total time taken to generate the page: 0.00513 seconds