|>

|> The latter is the point. When constrained to floating point you can *not*

|> come arbitrarily close to the 0.5 ulp rounding point. However it will

|> take a lot of time to find the closest function value for a transcendental

|> function. For algebraic functions (like square root and cube root) it

|> is easier because Liouville's theorem specifies lower bounds on the

|> closeness. Note however that with transcendental functions you will never

|> get the 0.5 ulp rounding point exactly (unless you have some special

|> argument). For instance, when x is a floating point number, sin(x) is

|> rational if and only if x == 0.

Yes and no. All of what you and Terje say is true, but it is possible

to do the same analyses for trigonometric functions with more effort,

and even log and exp. I am sure that you both know how, but here is

one method.

IEEE double floating point values can be expressed in terms of

a couple of thousand discrete uniform ranges (i.e. one for each

exponent).

pi has a known continued fraction with civilised properties,

so you can reduce those (purely algebraically) to known formulae

for the residual in the range 0-pi/2.

sin has a civilised Taylor series, so you can reduce that (again

purely algebraically) to a floating-point representation plus a

correction. Q.E.D.

This isn't pretty, but DOES enable a full analysis of the problem

cases, and is how the people (like Fred Gustafson) produced their

'perfect' implementations. While writing the algebra (even using

an advanced package like Axiom) would take skill and effort, I

doubt that it would need all that much computer time to do the

above.

It is clearly possible for power, but we are probably talking about

another order of magnitude complication again (i.e. as much harder

than sin as sin is than sqrt). I wouldn't know how to start with

erf and inverse erf short of brute force, which is way beyond

current technology.

I don't think that it is reasonable for a standard to require it

even for sin, let alone other functions. But it ISN'T impossible

at least for the trigonometric functions.

Regards,

Nick Maclaren.