Name:

isevaluable tests whether a function can be evaluated at a point

Usage:

isevaluable(function, constant) : (function, constant) -> boolean

Parameters:

• function represents a function
• constant represents a constant point

Description:

• isevaluable applied to function function and a constant constant returns a boolean indicating whether or not a subsequent call to evaluate on the same function function and constant constant will produce a numerical result or NaN. This means isevaluable returns false iff evaluate will return NaN.
• The command isevaluable is now considered DEPRECATED in Sollya. As checks for NaNs are now possible in Sollya, the command isevaluable can be fully emulated with a call to evaluate and a couple of tests, as shown below in the last example.

Example 1:

> isevaluable(sin(pi * log(x)), 0.5);
true
> print(evaluate(sin(pi * log(x)), 0.5));
-0.82148283122563882875872566228649962370813607461095

Example 2:

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

Example 3:

> isevaluable(sin(pi * 1/x), 0.5);
true
> print(evaluate(sin(pi * 1/x), 0.5));
[-3.100365765139897619749121887390789523854170596558e-13490;5.3002401585857127605350842426029223241500776302528e-13489]

Example 4:

> procedure isEvaluableEmulation(f, c) {
return match evaluate(f, c) with
NaN : (false)
[NaN;NaN] : (false)
default : (true);
};
> isEvaluableEmulation(sin(pi * log(x)), 0.5);
true
> isEvaluableEmulation(sin(pi * log(x)), 0);
true
> isEvaluableEmulation(sin(pi * log(x)), -1);
false