Example 1:
> procedure EXP(X,n,p) {
var res, oldPrec;
oldPrec = prec;
prec = p!;
res = exp(X);
prec = oldPrec!;
return res;
};
> f = function(EXP);
> f(1);
2.71828182845904523536028747135266249775724709369998
> exp(1);
2.71828182845904523536028747135266249775724709369998
> f(x + 3);
(function(proc(X, n, p)
{
var res, oldPrec;
oldPrec = prec;
prec = p!;
res = exp(X);
prec = oldPrec!;
return res;
}))(3 + x)
> diff(f);
diff(function(proc(X, n, p)
{
var res, oldPrec;
oldPrec = prec;
prec = p!;
res = exp(X);
prec = oldPrec!;
return res;
}))
> (diff(f))(0);
1
> g = f(sin(x));
> g(17);
0.382358169993866834026905546416556413595734583420876
> diff(g);
(diff(function(proc(X, n, p)
{
var res, oldPrec;
oldPrec = prec;
prec = p!;
res = exp(X);
prec = oldPrec!;
return res;
})))(sin(x)) * cos(x)
> (diff(g))(1);
1.25338076749344683697237458088447611474812675164344
> p = remez(f,3,[-1/2;1/2]);
> p;
0.99967120901420646830315493949039176881764871951832 + x * (0.99973702983571140134762682913614052309208076875596 + x * (0.510497293602826249216227216546435103583073053437 + x * 0.169814324607133287588897694747370380479108785868016))