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 * 1/x), 0.75);
   true
   > print(evaluate(sin(pi * 1/x), 0.75));
   -0.86602540378443864676372317075293618347140262690518

Example 2:

   > isevaluable(sin(pi * 1/x), 0.5);
   true
   > print(evaluate(sin(pi * 1/x), 0.5));
   [-1.72986452514381269516508615031098129542836767991679e-12715;7.5941198201187963145069564314525661706039084390067e-12716]

Example 3:

   > isevaluable(sin(pi * 1/x), 0);
   false
   > print(evaluate(sin(pi * 1/x), 0));
   [@NaN@;@NaN@]

Example 4:

   > procedure isEvaluableEmulation(f, c) {
       return match evaluate(f, c) with
               NaN : (false)
            [NaN;NaN] : (false)
            default : (true);
     };
   > isEvaluableEmulation(sin(pi * 1/x), 0.75);
   true
   > isEvaluableEmulation(sin(pi * 1/x), 0.5);
   true
   > isEvaluableEmulation(sin(pi * 1/x), 0);
   false
See also: evaluate
Go back to the list of commands