Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

runtime error m6201 sqrt domain error

lseecon
Beginner
1,782 Views
I run a likelihood maximization programme using Nelder_Mead algorithm The programme aborted after 42 iterations and poped up this error message" runtime error m6201 sqrt domain error"It usually the case I tried to take "dsqrt" of a negative number if I run into an error message like that; but I am sure it is not this time. It is something squared plus 1 so there is no way it is negative. It must be bigger than 1.
I tried to run exactly the same code on my laptop. It worked. After repeated the same likelihood function value for several iterations, it moved on rather than aborted.
Do you know why? It take weeks for my algorithm to converge. I would really prefer to run it on a desktop in computer lab rather than on my laptop. Also it is killing me when I know the number I am taking dsqrt of is definitely positive. (I bet my life on it)
0 Kudos
4 Replies
anthonyrichards
New Contributor III
1,782 Views
We need more information. Are you using complex variables anywhere?
Is the '1' you refer to stored as a variable or is it an explicit constant like '1.0d+00'?
We need to see the code in all places leading up to where you explicitly call the SQRT function.
Plus, the SQRT function may be being used internally by another function, so there may be no alternative but to run in debug mode and see exactly where it falls over.

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,782 Views
It's not negative OK, but have you considered the possibility that it's Inf or NaN? "Something squared plus 1" implies that the intermediate result might easily overflow.

In any case, compile your code with /fpe:3 (raise floating-point exceptions) and run it through the debugger.

Since the code seems to work on the laptop, you might easily have uninitialized variable somewhere. Try to build ti with /check:all.
0 Kudos
TimP
Honored Contributor III
1,782 Views
Quoting - Jugoslav Dujic
It's not negative OK, but have you considered the possibility that it's Inf or NaN? "Something squared plus 1" implies that the intermediate result might easily overflow.

In any case, compile your code with /fpe:3 (raise floating-point exceptions) and run it through the debugger.

Since the code seems to work on the laptop, you might easily have uninitialized variable somewhere. Try to build ti with /check:all.
Overflow behavior within an expression will change entirely between x87 and SSE compilation.
0 Kudos
Steven_L_Intel1
Employee
1,782 Views
Also, which compiler and version are you using?
0 Kudos
Reply