Mail Archives: djgpp/1998/05/12/10:05:36
Jens Bischoff wrote:
>
> sinh(x) = 1 + x^3/3! + x^5/5! + x^7/7! + ...
>
That is x+ x^3/3!+...
Such truncated Taylor series are not good approximations of functions. In
this specific case, note that the series always underestimate sinh(x).
If you want to find a polynomial approximation to sinh(x), a better
solution would be to use Chebyshev polynomials:
T_0(x)=1
T_1(x)=x
...
T_n+1(x)=2*x*T_n(x)-T_n-1(x)
Any function f(x) (with x between -1 to 1) can be approximated by a
linear combination of T_O, T_1 ... T_n with coefficients
c_i = 2/n Sum(from 0 to n-1) (f(cos(PI*(k-1/2)/N)) cos(PI(k-1/2)/N))
These polynomials provide much better approximations than Taylor series
(in most practical cases, you can get the same precision with a
polynomial one or two degrees lower).
Another solution for approximating sinh(x) would be to remember that
sinh(x) = exp(x)/2 - 1/(2*exp(x))
On machines with fast exponential functions, this implementation can be
fast enough.
Francois
- Raw text -