Re: C99 float variants of math.h functions



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
.



Relevant Pages

  • Re: C99 float variants of math.h functions
    ... seems likely that the square root implementations on your system ... thus show little speed difference. ... any polynomial expansion resembles a Taylor series. ...
    (comp.lang.c)
  • Re: C99 float variants of math.h functions
    ... seems likely that the square root implementations on your system ... thus show little speed difference. ... any polynomial expansion resembles a Taylor series. ...
    (comp.lang.c)
  • Re: C99 float variants of math.h functions
    ... seems likely that the square root implementations on your system ... thus show little speed difference. ... fewer terms in a Taylor series ...
    (comp.lang.c)
  • Re: tetration and logaritms
    ... and from looking at the first terms of this taylor series we see that we can get series reversion which of course gives exp- 1. ... finally 5/8 and 13/30 in the upper-left corner. ... to find the polynomials in h. ... We simply take the coefficients ...
    (sci.math)
  • Re: Polynomial series expansion
    ... Traditionally the drain current is expanded into Taylor series and only ... displacement from x is small so we can keep only the first 3 terms. ... I don't care if the expansion is done numerically or analytically but I ...
    (sci.math.num-analysis)

Loading