Post by Raymond Toy Post by Raymond Toy
On Sun, Jun 25, 2017 at 2:25 AM, Andreas Eder via Maxima-commits <
Date: Sun Jun 25 11:06:41 2017 +0200
replaced uses of the half macro with the variable 1//2.
had to adapt relative error bounds for the erf-inverse_erf tests
This makes no sense to me. Why should the results be different?
This needs some investigation. Is it because the defvar version wasn't
Andreas> No, it is simplified.
Andreas> The defvar is: (defvar 1//2 '((rat simp) 1 2))
Andreas> That is, as far as I can tell, simplified.
Andreas> What I suspect is a different order of evaluation. The macro version is
Andreas> expande into a literal at macroexpansion time, whereas the defvar
Andreas> generates a reference to the variable at compile time. The might lead
Andreas> different orders of evaluation. But I'm no expert in these matters.
Andreas> The difference is very small and I always expect such things when
Andreas> dealing with floating point.
Post by Raymond Toy
That might be true, but in the tests, there shouldn't be any
difference. The VALUE being used should be exactly the same in the
numeric tests as before.
Gunter> If the cause for the change is indeed the evaluation order my next
Gunter> question would be: Did the change increase the accuracy (after all there
Gunter> is no guarantee that the value originally contained in the testbench was
Gunter> even correct before the change)? And does it do so in the majority of cases?
Well, since the thresholds are upper bounds, if the error decreased,
you'd never know from the test. So changing the threshold meant the
error got worse.
I didn't check to see exactly what was changed, but I assume Andreas
just removed the macro for 1//2 so that the defvar was used. That
shouldn't change the order of evaluation of anything.
This really needs to be investigated. It could be something simple,
or perhaps something really bad---we just don't know.
As I said, I can't personally look for a couple of weeks.