## Name:

evaluate evaluates a function at a constant point or in a range

## Library name:

sollya_obj_t sollya_lib_evaluate(sollya_obj_t, sollya_obj_t)

## Usage:

evaluate(function, constant) : (function, constant) -> constant | range evaluate(function, range) : (function, range) -> range evaluate(function, function2) : (function, function) -> function

## Parameters:

• function represents a function
• constant represents a constant point
• range represents a range
• function2 represents a function that is not constant

## Description:

• If its second argument is a constant constant, evaluate evaluates its first argument function at the point indicated by constant. This evaluation is performed in a way that the result is a faithful rounding of the real value of the function at constant to the current global precision. If such a faithful rounding is not possible, evaluate returns a range surely encompassing the real value of the function function at constant. If even interval evaluation is not possible because the expression is undefined or numerically unstable, NaN will be produced.
• If its second argument is a range range, evaluate evaluates its first argument function by interval evaluation on this range range. This ensures that the image domain of the function function on the preimage domain range is surely enclosed in the returned range.
• In the case when the second argument is a range that is reduced to a single point (such that [1;1] for instance), the evaluation is performed in the same way as when the second argument is a constant but it produces a range as a result: evaluate automatically adjusts the precision of the intern computations and returns a range that contains at most three floating-point consecutive numbers in precision prec. This corresponds to the same accuracy as a faithful rounding of the actual result. If such a faithful rounding is not possible, evaluate has the same behavior as in the case when the second argument is a constant.
• If its second argument is a function function2 that is not a constant, evaluate replaces all occurrences of the free variable in function function by function function2.

## Example 1:

> midpointmode=on!;
> print(evaluate(sin(pi * x), 2.25));
0.70710678118654752440084436210484903928483593768847
> print(evaluate(sin(pi * x), [2.25; 2.25]));
0.707106781186547524400844362104849039284835937688~4/5~

## Example 2:

> print(evaluate(sin(pi * x), 2));
[-3.100365765139897619749121887390789523854170596558e-13490;5.3002401585857127605350842426029223241500776302528e-13489]

## Example 3:

> print(evaluate(sin(pi * x), [2, 2.25]));
[-5.143390272677254630046998919961912407349224165421e-50;0.70710678118654752440084436210484903928483593768866]

## Example 4:

> print(evaluate(sin(pi * x), 2 + 0.25 * x));
sin((pi) * 2 + x * (pi) * 0.25)

## Example 5:

> print(evaluate(sin(pi * 1/x), 0));
[-1;1]