[racket-dev] Sublinear functions of superfloat numbers

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Jul 2 05:11:07 EDT 2012

Is the following a fair summary?

The idea is to divide the real axis in three parts.
         x < y < z

Here x is a real (double), y is a slightly larger than +max.0,
and z is a very large.

Now sqrt(x) is just a real (double).

Let y be an exact integer only slightly larger than +max.0.
Even though y is larger than +max.0 the true sqrt of y is
actually smaller than +max.0 and thus representable as a float.
It is therefore possible to extend the standard sqrt function
to numbers slightly above +max.0.

For very large numbers z where sqrt(x) is larger than +max.0
return +inf.0 unless z happens to be a perfect square.


The sqrt function is a sublinear function. This extension is also
possible for other members of this class such as the logarithms.
How to extend the function depend on the function.


The other example, the periodic trigonometric functions is
slighly different.

Here the problem is that the argument must be reduced before
the actual computation can take place. The reduction is
simple in principle - just subtract the period repeatedly
until the argumet is so small the standard function works

However the period irrational, so in order to avoid loss of
precision, one must compute the period with an appropriate
number of decimals compared to the argument before the
reduction can take place.

/Jens Axel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120702/0b99e1fc/attachment.html>

Posted on the dev mailing list.