floating point problem

floating point problem

Post by Rigo Schult » Sun, 22 Jun 2003 18:31:00



(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


Quote:> For many of these problems, the solution is to add the
> -mieee option to the compile command.  This has made a big
> difference for me on several packages.

-mieee works quite good. but i get wrong results.

#include <stdio.h>

int main(void)
{
     float check;
     check = 5.877472e-39 / 2.0;
     printf("Check: %e \n", check);
     return (0);

Quote:}

on x86:>Check: 2.938736e-39
on alpha:>Check: 5.562685e-309

It's only a little bit different :o(

thanks

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Falk Hueffne » Sun, 22 Jun 2003 18:31:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


> -mieee works quite good. but i get wrong results.

>      check = 5.877472e-39 / 2.0;

> on x86:>Check: 2.938736e-39
> on alpha:>Check: 5.562685e-309

That's an underflow. On Alpha, FLT_MIN is 1.175494e-38, and DBL_MIN
2.225074e-308. So you should probably use double.

Note also that -mieee will incur a noticeable slowdown on models prior to EV6
(and a horrendous slowdown if denormals actually occur, since the kernel will
emulate them).

--
        Falk

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Rigo Schult » Sat, 21 Jun 2003 19:25:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:



>>-mieee works quite good. but i get wrong results.

>>     check = 5.877472e-39 / 2.0;

>>on x86:>Check: 2.938736e-39
>>on alpha:>Check: 5.562685e-309

> That's an underflow. On Alpha, FLT_MIN is 1.175494e-38, and DBL_MIN
> 2.225074e-308. So you should probably use double.

> Note also that -mieee will incur a noticeable slowdown on models prior
> to EV6 (and a horrendous slowdown if denormals actually occur, since
> the kernel will emulate them).

Thank you for your quick answer.
It's quiet sad thought alpha FPU is much better than x86 stuff.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Rigo Schult » Tue, 24 Jun 2003 16:00:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


Quote:> For many of these problems, the solution is to add the
> -mieee option to the compile command.  This has made a big
> difference for me on several packages.

-mieee works quite good. but i get wrong results.

#include <stdio.h>

int main(void)
{
     float check;
     check = 5.877472e-39 / 2.0;
     printf("Check: %e \n", check);
     return (0);

Quote:}

on x86:>Check: 2.938736e-39
on alpha:>Check: 5.562685e-309

It's only a little bit different :o(

thanks

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Falk Hueffne » Tue, 24 Jun 2003 16:00:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


> -mieee works quite good. but i get wrong results.

>      check = 5.877472e-39 / 2.0;

> on x86:>Check: 2.938736e-39
> on alpha:>Check: 5.562685e-309

That's an underflow. On Alpha, FLT_MIN is 1.175494e-38, and DBL_MIN
2.225074e-308. So you should probably use double.

Note also that -mieee will incur a noticeable slowdown on models prior to EV6
(and a horrendous slowdown if denormals actually occur, since the kernel will
emulate them).

--
        Falk

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Rigo Schult » Wed, 25 Jun 2003 12:23:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


Quote:> For many of these problems, the solution is to add the
> -mieee option to the compile command.  This has made a big
> difference for me on several packages.

-mieee works quite good. but i get wrong results.

#include <stdio.h>

int main(void)
{
     float check;
     check = 5.877472e-39 / 2.0;
     printf("Check: %e \n", check);
     return (0);

Quote:}

on x86:>Check: 2.938736e-39
on alpha:>Check: 5.562685e-309

It's only a little bit different :o(

thanks

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.

 
 
 

floating point problem

Post by Falk Hueffne » Wed, 25 Jun 2003 12:23:00


(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:

(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:


> -mieee works quite good. but i get wrong results.

>      check = 5.877472e-39 / 2.0;

> on x86:>Check: 2.938736e-39
> on alpha:>Check: 5.562685e-309

That's an underflow. On Alpha, FLT_MIN is 1.175494e-38, and DBL_MIN
2.225074e-308. So you should probably use double.

Note also that -mieee will incur a noticeable slowdown on models prior to EV6
(and a horrendous slowdown if denormals actually occur, since the kernel will
emulate them).

--
        Falk

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

-+- BBBS/NT v4.01 Flag-5
 + Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Admin of SHS.

--- BBBS/NT v4.01 Flag-5
 * Origin: TCOB1: A slice of life on your plate (2:263/950)

--
This message posted from Shurato's Heavenly Sphere Telnet BBS
telnet://shurato.darktech.org

Shurato:  Admin of SHS.