Bug in libm or libstdc++.
Joern Rennecke
amylaar@cygnus.co.uk
Wed Mar 31 23:46:00 GMT 1999
> Impossible, since I don't have the URL for any, and a Web search turned up
> dry. (Again.)
> Of course, printed, expensive ones are not a viable alternative, since I
> have insufficient funds, no access to any vendor of such a product, and
> moreover no information about how I would locate such a vendor given that I
> did have the access and the three-figure amount of spare cash. Also, egcs
> is a free software product run on an open development model, and so it is
> not possible for them to require/expect a contributor to obtain expensive
> items in order to contribute, without thereby violating their own charter.
Oh, I bought one for a sum that, expresed in US dollars, would be one-figure.
But never mind, you can go to one of these old-fashioned places called
'public libraries' or 'university libraries'.
> A sqrt can be implemented quickly with Newton's method, converging in
> O(log_2 # binary digits in mantissa) starting from a suitable guess. This
> is O(log n)... I doubt it can be bettered.
You have to keep in mind that multiplication itself is O(n^1.6). Moreover,
XFmode and TFmode can be expressed in a small number of 32 / 64 bit values,
so you have a lot of discretization noise in the actual precision - runtime
function. And sqrt is supposed to be rounded EXACTLY for IEEE, i.e. for
round to nearest, you should return that floating point value that most
accurately describes the actual square root.
> It's the trig, exponentials, and especially the logarithms that are the
> nontrivial ones. :-)
For these functions, the rounding requirements ar a lot more relaxed.
More information about the Gcc
mailing list