Version française
Home     About     Download     Resources     Contact us    
Browse thread
RE: [Caml-list] Are you sure the new "=" of 3.08 is good ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Harrison, John R <johnh@i...>
Subject: RE: [Caml-list] Are you sure the new "=" of 3.08 is good ?
| But if x is the result of any computation (with rounding error), and x

| is huge, sin x may be any value between -1 and 1. So the best value
from 
| sin x is either 0 (your possible error is minimum) or nan.

The job of the library function should be to solve the simple
mathematical
task of returning an accurate sin, not indulge in a speculative critique
of
the user's error analysis.

Sure, the input is most likely either a previously rounded result or
some
inexact physical measurement. But it *might* be a precise value. Or the
result may be used in such a way that the error will not be an issue,
e.g.
if one subsequently does something like "1 + sin(x)/x". Returning NaN
would
force the user to indulge in many tedious checks instead of simply using
the straightforward algorithm.

John.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners