Re: C99 float variants of math.h functions
- From: Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 02 Aug 2009 16:30:31 -0400
Tim Prince wrote:
superpollo wrote:Eric Sosman wrote:Gustavo Rondina wrote:...As to your speed test (code snipped; see up-thread), it
seems likely that the square root implementations on your system
use a hardware-provided instruction to compute the root, and
thus show little speed difference. Perhaps a more involved
function like arctangent, say, would show up differently. An
implementation for the coarser precision of float might use
fewer terms in a Taylor series
mmm... i do not think the libraries ever use taylor expansion, but i maybe wrong.
Loosely speaking, any polynomial expansion resembles a Taylor series. One would expect at least Chebyshev economization, so as to reduce the number of terms required to minimize error in a specified interval.
Lots and lots of techniques are used for evaluating
mathematical functions. I used "Taylor series" as a loose
and possibly familiar stand-in for the whole bag of methods:
Taylor polynomials, Chebyshev polynomials, continued fraction
expansions, rational function approximations, and so on. I
did not intend to suggest that "Taylor series" was the literal
be-all and end-all of approximation methods, and apologize if
anyone got that impression.
The point is that whatever method is used, the xxxf()
implementation may use a coarser variant than the corresponding
xxx() does, because the xxxf() version does not need (cannot
deliver) as much precision. It's possible, I suppose, that the
two versions could even use entirely different algorithms with
different error characteristics.
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: C99 float variants of math.h functions
- From: superpollo
- Re: C99 float variants of math.h functions
- References:
- C99 float variants of math.h functions
- From: Gustavo Rondina
- Re: C99 float variants of math.h functions
- From: Eric Sosman
- Re: C99 float variants of math.h functions
- From: superpollo
- Re: C99 float variants of math.h functions
- From: Tim Prince
- C99 float variants of math.h functions
- Prev by Date: Re: Zero terminated strings
- Next by Date: Re: C99 float variants of math.h functions
- Previous by thread: Re: C99 float variants of math.h functions
- Next by thread: Re: C99 float variants of math.h functions
- Index(es):
Relevant Pages
|
Loading