Re: Circular functions are not as intractable as you may think...
On 2011-08-20 06:52:27 -0700, Dan Zuras Intervals wrote:
> > The main problem can be the performance on some functions, e.g. for
> > sin/cos/tan on large arguments. One solution would be to return [-1,1]
>
> Domain reduction for circular functions hasn't been a
> performance problem for 3 decades now. With O(emax)
> memory for tables, the operation can be performed in
> O(1) time.
But this is not possible in practice when emax can be very large (e.g.
around 2^64, and even 2^32 would often require too much memory).
[...]
> In single precision we have:
>
> maxpos1 = 2^128*(1-2^-24)
> sin(maxpos1) = -0.521877
> sin(maxpos1) contained in [-2188909/4194304,-8755635/16777216]
>
> In double precision:
>
> maxpos2 = 2^1024*(1-2^-53)
> sin(maxpos2) = 0.00496195478918406
> sin(maxpos2) contained in
> [2860372190668619/576460752303423488,
> 5720744381337239/1152921504606846976]
>
> In quad:
>
> maxpos3 = 2^16384*(1-2^-113)
> sin(maxpos3) = 0.951914854078820481136324892937573
> sin(maxpos3) contained in
> [4942624506426098432520117030049803/5192296858534827628530496329220096,
> 9885249012852196865040234060099607/10384593717069655257060992658440192]
>
> These things are just not that difficult to compute any more.
But this is with a small exponent range.
[...]
> For, indeed, if zero width intervals for unreasonably large
> arguments are themselves unreasonable, then one need only
> consider efficient domain reduction for the domain of a
> circular function for which an ULP is less than 2*pi.
Note that the context was zero-width intervals with large arguments.
As long as the standard allows them, they are not unreasonable, and
the standard must deal with them. This is a real problem in term of
security, for instance if interval arithmetic (with a format having
a large exponent range) is used in some client-server system. The
user mustn't have the possibility to DoS the server.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)