## Re:Need fast replacement for cos()

In article <41v0fl$...@gyda.ifi.uio.no> lar...@ifi.uio.no (Lars Marius Garshol) writes:

##### Quote

>In article <41rtq3$...@rrzs3.uni-regensburg.de>, c4140@rphs45 (Hans

Trautenberg>t2466) writes:

>> I'm in need for a fast replacement for the cos-function in the

>> range from -pi/2 to pi/2. Accuracy is not so importrant, as long as

>> the error is less than 1% and the curve is smooth. I figured out

>> that a representation of the form

>> 1 - a * x**2 + b * x**4

>> is good.

>> Now I need a fast implementation for the above, usable with borland

>> pascal where x is single and no numeric coprocessor is required.

> Like this: 1-a*sqr(X)+b*sqr(sqr(x)) ?

or Y := sqr(X) ; Fn := 1 - (p-q*Y)*Y ; ?

--

John Stockton : mailto:J...@dclf.npl.co.uk from off-site. MIME. WP.

National Physical Laboratory, Teddington, Middlesex, TW11 0LW, UK

Direct Phone +44 181-943 6087, Nearby Fax +44 181-943 7138

Postings out, Email in/out are fast. Offshore news takes 0..10+

days to arrive; please mail me a copy of non-UK followups!

Regret system puts unzoned (UK civil) time on messages.