A small set of useful numerical functions are provided:

public BOOLEAN numerically_close( Real n1, Real n2, Real threshold_ratio )

- Checks if the two numbers are within the given threshold ratio.
For instance,
returns`numerically_close( 4113.0, 4112.0, 0.001 )`, since the two numbers are with 0.1 percent of each other.`TRUE`

public Real get_good_round_value( Real value )

- Returns the largest power of 10 or five times a power of 10
which is less then the specified value. Useful for determining graph
axis positions.

public int solve_quadratic( Real a, Real b, Real c, Real *root1, Real *root2 )

- Finds the real roots of the equation .
Returns either 0, 1, or 2, indicating the number of unique real roots,
which are passed back either in the argument
, or in both arguments,`root1`and`root1`.`root2`

public int solve_cubic( Real a, Real b, Real c, Real d, Real roots[ 3 ] )

- Finds the real roots of the equation . Returns the number of unique real solutions, and passes them
back in the array
.`roots`

public Real evaluate_polynomial( int n, Real poly[], Real u )

- Efficiently evaluates a polynomial of the form , using Horner's rule.

Fri Feb 17 15:40:04 EST 1995