Mail Archives: djgpp/1998/05/01/15:05:43
This is a multi-part message in MIME format.
--part0_894049409_boundary
Content-ID: <0_894049409 AT inet_out DOT mail DOT aol DOT com DOT 1>
Content-type: text/plain; charset=US-ASCII
There seems to be a problem with sinh(z) in the math library, libm.a,
for small values of z. For example, when z = 1.e-7, we should get
sinh(z) = 1.00000000000000168e-07. Actual results differ as shown
below.
I wrote a driver that produced the following printout:
l_sinh(9.99999999999999955e-08) = 9.99999999999633745e-08 (library version)
w_sinh(9.99999999999999955e-08) = 9.99999999999633745e-08 (from djlsr202.zip)
s_sinh(9.99999999999999955e-08) = 1.00000000000000168e-07 (series expansion)
c_sinh(9.99999999999999955e-08) = 1.00000000000000168e-07 (ix87 FPU function)
The first line shows the result of a call to sinh() in libm.a. The
second line shows the result of calling a version of sinh() that was
produced from source extracted from djlsr202.zip.
The third and fourth lines show the correct results. The series expansion
calculates sinh() from three terms, sinh(x) = x + x^3/6 + x^5/120. The
fourth result was obtained by taking sinh() from the FPU (via __math.h).
Regretfully, I am not familiar enough with the code used in the library
version to recommend a fix.
Source files for the driver and subordinate functions are attached in a
zip file, tstsinh.zip.
K.B. Williams
--part0_894049409_boundary--
- Raw text -