Re: Efficiency of math.h

From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 02/25/04


Date: Wed, 25 Feb 2004 12:48:24 -0800

CBFalconer wrote:

> Peter Ammon wrote:
>
> ... snip ...
>
>>Why not get libm from GNU and find out? I wouldn't be surprised
>>if you could beat acos() with "good enough" precision over a
>>particular range (whatever you're interested in).
>>Try using a Taylor expansion.
>
> Not if you want speed you don't.
> With some slight trigonometry,
> you should be able to convert cos(angle) into tan(angle).
> Use this as input to an arctan(value) routine,
> which can in turn be built in various ways.
> One uses a leveled Tschebychev approximation over 0 to 1.

Not if you want speed you don't.

This method requires reading a bunch of high precision
floating-point numbers from system memory
which can actually require more time than computing
Taylor coefficients in registers on-the-fly.

You're out of your depth here Chuck.