[comp.lang.c] fast arc tangent routine availa

mccaugh@s.cs.uiuc.edu (10/04/89)

 I really don't mean to sound pedantic (after all, if I did mean to, I would
 go over to the numerical-analysis group to do so) but I fail to see the
 virtue of speed for only a few decimal places: it doesn't seem terribly
 profound to cough up the first few terms of a Taylor Series, factoring the
 powers to exploit Horner's Rule and exclaim: "well, here is such a fast
 ArcTan series it doesn't require a loop!" I.e., yes it's fast--but at the
 expense of what? ACCURACY. (But for all that, it may be the fastest 3-place
 ArcTan routine available: for that, I commend the author!)

 Scott McCaughrin
 (mccaugh@s.cs.uiuc.edu)

dik@cwi.nl (Dik T. Winter) (10/05/89)

(I did not find the parent article on our system, so I really do not know
what I am talking about.)

In article <207600047@s.cs.uiuc.edu> mccaugh@s.cs.uiuc.edu writes:
 > 
 >  I really don't mean to sound pedantic
Nor do I.
 >                                        (after all, if I did mean to, I would
 >  go over to the numerical-analysis group to do so)
I do so on occasion.
 >                                                    but I fail to see the
 >  virtue of speed for only a few decimal places:
Simply depends on what you want.
 >                                                 it doesn't seem terribly
 >  profound to cough up the first few terms of a Taylor Series, factoring the
 >  powers to exploit Horner's Rule and exclaim: "well, here is such a fast
 >  ArcTan series it doesn't require a loop!"
Any arctan routine worth its money does not require a loop.
 >                                            I.e., yes it's fast--but at the
 >  expense of what? ACCURACY. (But for all that, it may be the fastest 3-place
 >  ArcTan routine available: for that, I commend the author!)
Given the method you arrived at it, it may be, but it is certainly not the
fastest 3-place ArcTan routine possible.  In most cases, given a Taylor series
truncated to an order n polynomial there is a polynomial of lower order that
gives better accuracy.  (Keywords: telescoping Taylor series; Chebyshov
polynomials.)

-- 
dik t. winter, cwi, amsterdam, nederland
INTERNET   : dik@cwi.nl
BITNET/EARN: dik@mcvax