I have the following code:
The advantage is that f(+infinity) is defined in this case whereas evalf(2/Pi*arccos((1-x*x)/(1+x*x))) is not for x:=+infinity. But, I would like to extend this procedure in such a way that f(1/0) or f(something) where something is infinity or a division by zero is defined and gives the same result as f(+infinity).
I added before the preocedure f above the following code:
NumericEventHandler( division_by_zero = proc() +infinity; end proc ):
But, it defines a global environment. I would like a local modification of the environment only inside the procedure for f.
How to solve this issue?