On 2012-02-10 17:41:49 +0000, Andrew Haley wrote:
> On 02/10/2012 05:31 PM, Paweł Sikora wrote:
> > it would be also nice to see functions for reducing argument range in 
> > public api.
> > finally the end-user can use e.g. sin(reduce(x)) to get the best precision
> > with some declared cpu overhead.
> 
> Hmm.  I'm not sure this is such a terrific idea: each function has its
> own argument reduction (e.g. to [0, pi/4], [0, pi/8] or even [0, some
> weird constant that looks arbitrary but just happens to be exactly
> representable in binary]).  You really don't want double rounding,
> which is what would happen with sin(reduce(x)).
I agree. Also, range reduction may also be completely different.
The general scheme is:

1. Reduce the argument x (for periodic function, it is an additive
   reduction, but for some other functions, it can be a multiplicative
   reduction).

2. Compute some alternate function(s) on the reduced argument.
   For the first range reduction of periodic functions, it is the
   same function, but in other cases, this may be other functions.

3. Reconstruct the final value. Nothing to do for the first range
   reduction of periodic functions, but again, this is not always
   the case.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to