Question: Does anyone can explain the evaluation rules for "evalf"?

Hi,

I am a little bit surprised by the result of the operation evalf[8](f(y)) in the piece of code that follows.
I was expected the answer to be 2.4494897, not 2.4494898.

Happily the sequence
res := f(y) ; evalf[8](res)
returns the expected result 2.4494897

I suspect the difference comes from some precedence of the operators (f and evalf) but I can't figure out what really happens

Could you enlight me please ?

Thanks in advance

 

restart:

interface(version);

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

Digits;

10

(2)

f := x -> sqrt(2.0)*x;

proc (x) options operator, arrow; sqrt(2.0)*x end proc

(3)

y := sqrt(3.0):

f(y);

2.449489743

(4)

evalf[9](f(y));  # right

2.44948974

(5)

evalf[8](f(y));  # ????

2.4494898

(6)

res := f(y);
evalf[8](res);  # right

2.449489743

 

2.4494897

(7)

 

 

 

Please Wait...