math library

math library

I am using ifc on linux suse8.2 in my code, i get the following error while calculating log of a number (I checked, its non-zero). I am using the -r8 option while compiling. DOes anyone encounter similar problems or knows a solution? I tried a small test program with the log function and it works fine.

Program received signal SIGFPE, Arithmetic exception.
0x400edf1c in __ieee754_log () from /lib/libm.so.6

6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

I am also getting another similar error as shown below. It seems that the math library is not able to return a value of common sin, log etc functions in double precision. Does anyone know more about this?

Program received signal SIGFPE, Arithmetic exception.
0x0820bef0 in __libm_sin80 ()

Bild des Benutzers Steve Lionel (Intel)

Without a sample program, it's hard to be too helpful. Can you post or attach a short program that demonstrates the problem?

Steve

Steve

Here is a portion of the sample program. It exits at the line where it tries to calculate the sine. (and would do the same for cos as well as log, further down in the program). I have checked the values of the variables in prev lines (rps, pi2,thetr, eom etc) to make sure that they arent NaN or zero..and they arent.

if(ncyc.gt.0)then
zpold=zpistn
endif
eom=rps*pi2
thetr=eom*t+atdc*pio180

hrs=0.5*stroke*sin(thetr)
sqr=sqrt(conrod**2-hrs**2)
del=0.5*stroke*(1.0-cos(thetr))+conrod-sqr
zpistn=stroke-del+zpbot
wpistn=-hrs*(1.0+0.5*stroke*cos(thetr)/sqr)*eom
if(ncyc.gt.0) wpistn=(zpistn-zpold)*rdt
dtwp=dt*wpistn
crank=atdc+rps*t*360.0

Here is a portion of the sample program. It exits at the line where it tries to calculate the sine. (and would do the same for cos as well as log, further down in the program). I have checked the values of the variables in prev lines (rps, pi2,thetr, eom etc) to make sure that they arent NaN or zero..and they arent.

if(ncyc.gt.0)then
zpold=zpistn
endif
eom=rps*pi2
thetr=eom*t+atdc*pio180

hrs=0.5*stroke*sin(thetr)
sqr=sqrt(conrod**2-hrs**2)
del=0.5*stroke*(1.0-cos(thetr))+conrod-sqr
zpistn=stroke-del+zpbot
wpistn=-hrs*(1.0+0.5*stroke*cos(thetr)/sqr)*eom
if(ncyc.gt.0) wpistn=(zpistn-zpold)*rdt
dtwp=dt*wpistn
crank=atdc+rps*t*360.0

I havent been succesful in resolving this problem. Has any one encoutered something smilar?

Melden Sie sich an, um einen Kommentar zu hinterlassen.