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.86602540378443864676372317075293618347140262690519

Example 2:

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

Example 3:

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

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