On Wed, 14 Oct 2015, Sven Schreiber wrote:
Am 14.10.2015 um 18:08 schrieb Allin Cottrell:
> I think this is probably the same issue that's discussed in
>
http://lists.wfu.edu/pipermail/gretl-users/2015-September/011139.html
>
> I suspect that your code ends up squaring a very small number and hence
> producing a "subnormal" floating-point value (underflow). As noted in
> the post above, different C libraries can respond to this differently:
> some will set the variable errno to ERANGE in this case and some will not.
That "diagnosis from afar" seems to be correct: there is one value
4.9033e-310 in the vector which is going to be squared. Chapeau!
It's strange though where this number is coming from in the first place...
For investigating the ultimate cause and debugging on the local system (where
no error is thrown), is it possible to check (in hansl) for small numbers in
the standard way, like "if abs(x) < 1e-50", or are there further subtle
numerical and floating-point issues there?
That sort of inequality check should work OK even for subnormals.
Comparisons should "fail" only for NaNs (in the sense of producing a
zero answer for all comparisons, such that if y is NaN then x == y,
x > y and x < y are all "false" for all x).
Allin