Question: Optimization calls the function to be evaluated with a high Digits setting

I have a procedure, lfGn, with two or three real arguments, and I wish to find the maximum value of the procedure.  I was trying the Optimization package, and found this to be extremely slow.  Optimization was called with the following code: the first few lines just set some variables, for use in the last line, which does the call.

max2lfGn := proc (X::Vector) local a, d, e, f, H, m, s;
e := 10.^(1-floor((1/2)*Digits));
a:= Statistics:-Mean(X);
d := Statistics:-StandardDeviation(X);
f := (m, s, H) -> lfGn(X, m, s*s, H);
Optimization:-Maximize('f'(a, s, H), s = e .. 10000*d, H = e .. 1-e, initialpoint = {H = .75, s = d}, optimalitytolerance = 0.01, method = 'modifiednewton')
end proc;

It turns out that, with this code, lfGn is called while Digits = 26.  Thus lfGn is evaluated with software, instead of hardware, arithmetic, which is the reason for the slow speed.

Optimization sets Digits to 26 even on the first call to lfGn.  And this occurs even with optimalitytolerance= 0.01 (as shown here).  And with global Digits set to 10.

Does anyone have ideas as to why Optimization internally sets Digits to 26?

(Maple version is 15.01, running under Windows XP.)

Please Wait...