Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: math function accuracy -- was Re: text2interval again /



On Mar 9 2013, Richard Fateman wrote:
On 3/9/2013 6:49 AM, Vincent Lefevre wrote:

First, the C standard mentions the 1985 version. Moreover, even with
the 2008 version, the math functions are recommended, not required.
So, even though C provides math functions, they are not necessarily
correctly rounded. The error bound may not even be known, making all
IA implementation impossible from the std library version.

That is true, and isn't going to change in a hurry (if at all).  That
point is orthogonal to whether they could or should!

My current understanding is that:
All those functions (sin, cos, and many friends) are merely recommended in 754-2008.
Not required.
If they are included, they must be correctly rounded.

It's not that simple.  IEEE 754 2008 isn't usable on its own, and needs
a language binding.  It is very doubtful that languages will adher to
the strict letter of IEEE 754 2008, any more than they have done to
IEEE 754 1984.  Again, that is orthogonal to whether they claim to or
should.

So a reference implementation of intervals with tightest bounds
that would depend on such conforming 754-2008 implementations must first
write those 754-2008 scalar conforming implementations.

Right.

It would simplify a reference implementation to drop some of those
functions from "required" to "recommended".

(And it would even
more simplify an implementation to replace "required tightest"
with "required accurate, recommended tightest" for
ALL "tightest", since some systems without access to rounding modes
will have to work hard to get tightest, but can be accurate
extremely efficiently. )

Once you get beyond the trivial functions, that is the best that is
feasible.  As far as I know, there are no known algorithms for fast,
efficient implementation of even simple functions like pow(), let
alone erf() and worse.


Regards,
Nick Maclaren.