Name:

isevaluable tests whether a function can be evaluated at a point

Usage:

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

Parameters:

Description:

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
See also: evaluate
Go back to the list of commands