Monday, June 3, 2013

Table based interval sine and cosine

Last week Jan implemented lookup table based interval sine and cosine functions. The table is computed as a piecewise enclosure for cosine over [0,π/2] and symmetry and periodicity then give approximations over [0,2π]. Evenness and shifting of the argument interval into [0,2π] gives an approximation for the interval cosine function. Sine is obtained from it by shifting the argument by π/2. The two interval functions are lifted to enclosure functions by taking the range of the argument enclosure and wrapping the result interval in a constant enclosure. Because there is wrapping both of the input and output enclosures, the approach suffers from excessive information loss, but can be improved by using the interval functions to implement a fully enclosure based one. Below is a plot of Acumen using the sine implementation to compute a solution for x' = -sin(x) with x(0) = 1 over [0,4].