[Haskell-cafe] Re: rounding errors with real numbers.

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Tue Feb 28 09:31:10 EST 2006


Henning Thielemann wrote:
> Maybe you should use a kind of convex combination, that is
> 
> (x-oldLower)*a + (oldUpper-x)*b

Maybe lower*(1-z) + upper*z where z = (x-oldLower) / (oldUpper-oldLower). I 
think this will always map oldLower and oldUpper to lower and upper exactly, 
but I'm not sure it's monotonic.

-- Ben



More information about the Haskell-Cafe mailing list