Home > Archive > Fortran > February 2008 > run-time error M6104 : Math
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
run-time error M6104 : Math
|
|
| RAMI Y. 2008-02-11, 10:19 pm |
| hello
i 'm kind of new at this Fortran i mean, i'm using microsoft
powerstation as my compiler on my fortran 90 program. i'm trying to
solve my mathematical model by using simulated annealing. however
after i finished my program everything check out and i execute
it ...the program was running as it should be for fair amount of
iteration before it just stopped and the massage came up
run-time error M6104 : Math
-floating point error : overflow
now i really don't know what happen. i should mention that my
objective function is rather complicated and it consists with lot of
factorial, exponential function and also summation function. my
program has the main program (SA program) and subroutine objective
function. i try to run my objective function seperately and it's all
right so i really have no idea why it's stop like that.
now can anyone help me with this, what i should do next, just opinions
or comments would be highly appreciated.
Thank you so much
| |
| Luka Djigas 2008-02-12, 4:31 am |
| On Mon, 11 Feb 2008 19:03:28 -0800 (PST), "RAMI Y."
<ramidayu@hotmail.com> wrote:
>
>run-time error M6104 : Math
>-floating point error : overflow
>
>now i really don't know what happen. i should mention that my
>objective function is rather complicated and it consists with lot of
>factorial, exponential function and also summation function. my
>program has the main program (SA program) and subroutine objective
>function. i try to run my objective function seperately and it's all
>right so i really have no idea why it's stop like that.
>
>now can anyone help me with this, what i should do next, just opinions
>or comments would be highly appreciated.
>
>Thank you so much
------------- copy/paste from an old post ----------
An overflow error occurs when the result of a floating point operation
is bigger in magnitude than the biggest number that can be expressed
in the relevant floating point format. This is often due to a bug or
an algorithm problem (e.g. the algorithm isn't stable for the set of
input parameters provided).
Does it a) only occur for certain input values but consistently for
those values or b) sometimes occur and sometimes not for the same set
of input values?
If b then a common cause would be that you implicitly assumed
somewhere that an uninitialised variable had the value 0. This is not
a valid assumption: usually uninitialised variables contain whatever
happened to be in that chunk of memory before. On a lot of systems
this is quite often 0 but not always which can lead to exactly this
sort of bug.
If a then it's quite likely to be a problem with the algorithm or with
how it's implemented.
-------------------------
pozdrav
dig
| |
| Ken Plotkin 2008-02-12, 4:31 am |
| On Mon, 11 Feb 2008 19:03:28 -0800 (PST), "RAMI Y."
<ramidayu@hotmail.com> wrote:
[snip]
>run-time error M6104 : Math
>-floating point error : overflow
>
>now i really don't know what happen. i should mention that my
[snip]
Enable line number traceback so you know exactly where the error
happened. Without that you won't have a clues as to what to do.
Whe you know where it blew, check the variables that were involved.
Then it's just a matter of digging to see what went wrong. Could be a
bug, could be that your algorithm did something you didn't anticipate.
It may be helpful to enable all run time checks.
Ken Plotkin
| |
| Ken.Fairfield@gmail.com 2008-02-12, 7:22 pm |
| On Feb 11, 7:03 pm, "RAMI Y." <ramid...@hotmail.com> wrote:
> hello
>
> i 'm kind of new at this Fortran i mean, i'm using microsoft
> powerstation as my compiler on my fortran 90 program. i'm trying to
> solve my mathematical model by using simulated annealing. however
> after i finished my program everything check out and i execute
> it ...the program was running as it should be for fair amount of
> iteration before it just stopped and the massage came up
>
> run-time error M6104 : Math
> -floating point error : overflow
As others already stated, this means you've attempted to
calculate/store a number that is larger than can be represented
in the floating-point (REAL or DOUBLE PRECISION) you're
using.
> now i really don't know what happen. i should mention that my
> objective function is rather complicated and it consists with lot of
> factorial, exponential function and also summation function. my
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Without seeing the actual code, I suspect this is your problem.
Factorials and exponentials can get very large very fast. If you
have ratios of factorials, don't attempt to calculate the two (or
more) factorials and then take the ratio, rather take the ratio
of the remaining factors only.
If you've already done that, then are you also using
DOUBLE PRECISION variables in the routine where the
error occurs?
> program has the main program (SA program) and subroutine objective
> function. i try to run my objective function seperately and it's all
> right so i really have no idea why it's stop like that.
>
> now can anyone help me with this, what i should do next, just opinions
> or comments would be highly appreciated.
If this doesn't help, you'll need to post the code
for further diagnosis...
-Ken
| |
| RAMI Y. 2008-02-13, 4:29 am |
| thank you for all the comment and response , i will start digging in,
will let you know how it is going. thanks so much
|
|
|
|
|