[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] tanh in libm
From: |
René Liebscher |
Subject: |
[avr-libc-dev] tanh in libm |
Date: |
Wed, 15 Sep 2004 14:29:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040804 |
Hi,
I have question about the tanh function in libm.
As I can see in
http://savannah.nongnu.org/cgi-bin/viewcvs/avr-libc/avr-libc/libm/fplib/tanh.S?rev=1.2&content-type=text/vnd.viewcvs-markup
there are two ways to calculate the result.
The questions is why was sinh/cosh choosen. (The other way is commented
out.)
Comparing which functions are called to calculate tanh I find sinh/cosh
needs one call to exp, two calls to inverse and one call to ldexp more
than the other way. So I think the current solution is slower than the
other.
(And it takes more memory if you don't use sinh or cosh in your program.)
If the other solution brings also correct results and is faster, is
there a simple way to integrate it in my program without to recompile
the math library.
Kind regards
Rene Liebscher
- [avr-libc-dev] tanh in libm,
René Liebscher <=