natural log with correct rounding

The documentation of the SE Math library is, thankfully, very transparent about rounding errors:

If a method always has an error less than 0.5 ulps, the method always returns the floating-point number nearest the exact result; such a method is correctly rounded. A correctly rounded method is generally the best a floating-point approximation can be; however, it is impractical for many floating-point methods to be correctly rounded. Instead, for the Math class, a larger error bound of 1 or 2 ulps is allowed for certain methods. Informally, with a 1 ulp error bound, when the exact result is a representable number, the exact result should be returned as the computed result; otherwise, either of the two floating-point values which bracket the exact result may be returned.

And every floating-point method mentions its error bounds in ulps. In particular, for Math.log() :

Returns the natural logarithm (base e) of a double value...The computed result must be within 1 ulp of the exact result

Therefore, Math.log() will possibly round to the nearest representable value in the wrong direction.

I need a correctly rounded implementation of base-e log. Where might I find one?

链接地址: http://www.djcxy.com/p/85616.html

上一篇: sin,cos,tan和舍入误差

下一篇: 正确舍入的自然记录