
This should be evaluated before using any of the following operations.



:: ufb  this parameter is not used except for type checking
 > ra   > (b, b)   Convert from the associated interval type to the base type.
(The types are determined by the given example function.)




:: ufb  this parameter is not used except for type checking
 > (b, b)   > ra   Convert from the base type to the associated interval type.
(The types are determined by the given example function.)




A linear ordering on basic functions, which can be syntactic and rather arbitrary.



:: Int  number of decimal digits to show
 > Bool  whether to show granularity
 > Bool  whether to show internal structure
 > ufb   > String  



Check internal consistency of the basic function, typically absence of NaN.



:: String  indentification of caller location for easier debugging
 > ufb   > ufb   Check internal consistency of the basic function and report problem if any.




Get the granularity of the coefficients inside this basic function.







Get the degree of this basic function.
If the function is a polynomial, this function should
return its degree.



Decrease the degree of a basic function, rounding pointwise upwards.



Get the term size of this basic function.
If the function is a polynomial, this function should
return the number of terms in the polynomial.



Decrease the size of this basic function, rounding pointwise upwards.


getVariables :: ufb > [varid]  Source 

Get a list of all variables featured in this basic function.



Construct a constant basic function.


constEncl :: (b, b) > (ufb, ufb)  Source 

Construct a constant basic enclosure (negated lower bound, upper bound).



:: b  value at 0
 > Map varid b  ascent of each base vector
 > ufb   Construct an affine basic function.




Find an upper bound of a basic function over [1,1]^n.



:: Int  max degree for result
 > Int  max approx size for result
 > ufb  f1  > ufb  f2  > ufb   Approximate the function max(f1,f2) from above.




:: Int  max degree for result
 > Int  max approx size for result
 > ufb  f1  > ufb  f2  > ufb   Approximate the function min(f1,f2) from above.




Pointwise exact negation of a basic function


scaleUp :: b > ufb > ufb  Source 

Multiply a basic function by a scalar, rounding upwards.



:: Int  maximum polynomial degree
 > Int  maximum term count
 > ra   > ufb   > ufb   Multiply a basic function by an approximation of a scalar,
rounding upwards.



(+^) :: ufb > ufb > ufb  Source 

Pointwise upwards rounded addition


(^) :: ufb > ufb > ufb  Source 

Pointwise upwards rounded subtraction


(*^) :: ufb > ufb > ufb  Source 

Pointwise upwards rounded multiplication



:: Int  maximum polynomial degree
 > Int  maximum term count
 > (ufb, ufb)   > (ufb, ufb)   > (ufb, ufb)   Enclosure multiplication
IMPORTANT: enclosure = (negated lower bound, upper bound)




Approximate the function 1/f from above, assuming
f does not hit zero in the unit domain.



:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex   > (ufb, ufb)  enclosure of f
 > (ufb, ufb)   Approximate the reciprocal of an enclosure, assuming
f does not hit zero in the unit domain.
IMPORTANT: enclosure = (negated lower bound, upper bound)



evalUp :: boxb > ufb > b  Source 

Evaluate a basic function at a point rounding upwards
using a basic number for both the point and the result.


evalApprox :: boxra > ufb > ra  Source 

Safely evaluate a basic function at a point using a real number approximation
for both the point and the result.


partialEvalApproxUp :: boxra > ufb > ufb  Source 

Partially evaluate a basic function at a lowerdimensional point
given using a real number approximation.
Approximate the resulting function from above.



:: Int  max degree for result
 > Int  max approx size for result
 > ufb  function f
 > varid  variable v to substitute in f
 > ufb  function f_v to substitute for v
that maps [1,1] into [1,1]
 > ufb  pointwise upper bound of f[v > f_v]
 Compose two basic functions, rounding downwards and upwards,
assuming f_v ranges within the domain [1,1].




:: Int  max degree for result
 > Int  max approx size for result
 > ufb  function f
 > varid  variable v to substitute in f
 > (ufb, ufb)  enclosure of a function f_v to substitute for v
that maps [1,1] into [1,1]
 > (ufb, ufb)  enclosure of f[v > f_v]
 Compose two basic functions, rounding downwards and upwards,
assuming f_v ranges within the domain [1,1].




:: Int  max degree for result
 > Int  max approx size for result
 > ufb  function f
 > Map varid ufb  variables to substitute and for each variable v,
function f_v to substitute for v
that maps [1,1] into [1,1]
 > ufb  pointwise upper bound of f[v > f_v]
 Substitute several variables in a basic function with other basic functions,
rounding downwards and upwards, assuming each f_v ranges
within the domain [1,1].




:: Int  max degree for result
 > Int  max approx size for result
 > ufb  function f
 > Map varid (ufb, ufb)  variables to substitute and for each variable v,
enclosure of a function f_v to substitute for v
that maps [1,1] into [1,1]
 > (ufb, ufb)  enclosure of f[v > f_v]
 Substitute several variables in a basic function with other basic functions,
rounding downwards and upwards, assuming each f_v ranges
within the domain [1,1].




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating exp as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate sqrt(f) for enclosures.




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating exp as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate exp(f) for enclosures.




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating log as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate log(f) for enclosures.




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating sin as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate sin(f) for enclosures,
assuming the range of f is within [pi2,pi2].




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating cos as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate cos(f) for enclosures,
assuming the range of f is within [pi2,pi2].




:: Int  max degree for result
 > Int  max approx size for result
 > EffortIndex  how hard to try when approximating cos as a polynomial
 > (ufb, ufb)  f  > (ufb, ufb)   Approximate atan(f) for enclosures.




:: varid  variable to integrate by
 > ufb  f  > (ufb, ufb)   Approximate the primitive function of f from below and from above.




:: [varid]  dimensions to include in the measuring domain;
have to include all those present in f
 > ufb  f  > b   Measure the volume between a function
and the zero hyperplane on the domain [1,1]^n.

