interMath

Interval versions of standard math library functions

[ kepler | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

OVERVIEW TEXT
AUTHOR

Class Summary

class interMath
{

public:
static interval min(interval,interval);
static interval min(interval,interval,interval);
static interval min(interval,interval,interval,interval);
static interval max(interval,interval);
static interval max(interval,interval,interval);
static interval max(interval,interval,interval,interval);
static interval combine(interval,interval);
static interval sqrt(interval);
static interval atan(interval);
static interval pos(interval x);
static double sup(interval x);
static double inf(interval x);
static double abs(interval x);
static volatile void nearest();
static volatile void up();
static volatile void down();
static int boundedFromZero(const interval&);
static void selfTest();
protected:
}; // interMath

Back to the top of interMath


OVERVIEW TEXT

The functions up(), down(), nearest() set the rounding modes for arithmetic operations.

combine(interval,interval) gives the convex hull of two intervals abs(interval) is a double giving the maximum absolute value on the interval

Back to the top of interMath


AUTHOR

Thomas C. Hales

Back to the top of interMath


interval min(interval,interval);

the return value is an interval of width zero

	static interval min(interval,interval);  

Back to the top of interMath


interval min(interval,interval,interval);

the return value is an interval of width zero

	static interval min(interval,interval,interval);

Back to the top of interMath


interval min(interval,interval,interval,interval);

the return value is an interval of width zero

	static interval min(interval,interval,interval,interval);

Back to the top of interMath


interval max(interval,interval);

the return value is an interval of width zero

	static interval max(interval,interval);

Back to the top of interMath


interval max(interval,interval,interval);

the return value is an interval of width zero

	static interval max(interval,interval,interval);

Back to the top of interMath


interval max(interval,interval,interval,interval);

the return value is an interval of width zero

	static interval max(interval,interval,interval,interval);

Back to the top of interMath


interval combine(interval,interval);

the interval returned is the convex hull of the two that are given

	static interval combine(interval,interval); 

Back to the top of interMath


interval sqrt(interval);

an interval square root function. The square root function has been extended to return 0 for negative values in the domain, so that sqrt([-1,4]), for example, returns the interval [0,2]. The implementation makes use of the math.h sqrt library function. The IEEE standard requires the library function to return a correctly rounded result when the rounding modes are set.

	static interval sqrt(interval);  // negative values return 0

Back to the top of interMath


interval atan(interval);

An interval atan function. The IEEE standard does not specify the performance of the math.h atan library function. As a result, we have implemented our own from scratch. This implementation is based on an old book by John F. Hart, "Computer Approximations" page 125 (s=4). The rational approximation that we use is given on page 271, ArcTan 5032.

The routine uses the addition law for the arctangent to reduce the argument to the interval [0,tan(pi/16)]. A rational approximation to the arctangent is then used on the interval. Explicit error bounds are known for this rational approximation. The results of the rational approximation are padded with a much-to-generous error term so that the interval returned by the procedure is guaranteed to contain the arctangent of the argument.

The error term we have added is enormous (about 1.0e-10). It is far larger than what the error analysis requires, and the user of this function may wish to suppy a smaller error term.

	static interval atan(interval);

Back to the top of interMath


interval pos(interval x);

the function [x,y] -> [max(0,x),max(0,y)]. The positive part of an interval.

	static inline interval pos(interval x); 

Function is currently defined inline.


Back to the top of interMath


double sup(interval x);

the upper endpoint of an interval

	static inline double sup(interval x); // (hi)

Function is currently defined inline.


Back to the top of interMath


double inf(interval x);

the lower endpoint of an interval

	static inline double inf(interval x); // (lo)

Function is currently defined inline.


Back to the top of interMath


double abs(interval x);

the largest absolute value of any element in the interval

	static inline double abs(interval x); 

Function is currently defined inline.


Back to the top of interMath


volatile void nearest();

set the IEEE rounding mode to round-to-nearest. The mode remains in force until the next mode change.

	static volatile void nearest();

Back to the top of interMath


volatile void up();

set the IEEE rounding mode to round-up. The mode stays in effect until the next mode change.

	static volatile void up();

Back to the top of interMath


volatile void down();

Set the IEEE rounding mode to round-down. The mode stays in effect until the next mode change.

	static volatile void down();

Back to the top of interMath


int boundedFromZero(const interval&);

Check to see if the interval can be safely used as a denominator. This is the inline function called by the interval division operator to determine whether a division can be performed.

	static inline int boundedFromZero(const interval&);

Function is currently defined inline.


Back to the top of interMath


void selfTest();

Check that interval routines are running correctly.

	static void selfTest();

Back to the top of interMath


All Members

public:
static interval min(interval,interval);
static interval min(interval,interval,interval);
static interval min(interval,interval,interval,interval);
static interval max(interval,interval);
static interval max(interval,interval,interval);
static interval max(interval,interval,interval,interval);
static interval combine(interval,interval);
static interval sqrt(interval);
static interval atan(interval);
static interval pos(interval x);
static double sup(interval x);
static double inf(interval x);
static double abs(interval x);
static volatile void nearest();
static volatile void up();
static volatile void down();
static int boundedFromZero(const interval&);
static void selfTest();
protected:

Back to the top of interMath


Ancestors

Class does not inherit from any other class.

Back to the top of interMath


Descendants

Class is not inherited by any others.

Back to the top of interMath


Generated from source by the Cocoon utilities on Mon Dec 22 19:37:21 1997 .

Report problems to jkotula@unimax.com