* floating point problem
@ 2003-06-19 18:32 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-19 18:32 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Rigo Schultz <schultz@eva.mpg.de>
I try to run some simulations at different hardware architectures, ALPHA
EV6 and x86. Both runnig Linux.
But I get Floating Point Exceptions at the Alpha system. It seems that the
"float" and "double" range on EV6 are different to the x86 systems. Sorry,
I'm not familar with that stuff. Here is a short c-source, that shows the
difference. But I do'nt understand why the Alpha breaks too early.
Thanks Rigo
#include <stdio.h>
int main(void)
{
enum {N = 150};
int i;
float under = 1.0; /* for underflow */
float over = 1.0; /* for overflow */
printf ("sizeof(int) = %d\n", sizeof(int));
printf ("sizeof(float) = %d\n", sizeof(float));
printf ("sizeof(double) = %d\n", sizeof(double));
printf ("sizeof(long double) = %d\n", sizeof(long double));
printf ("\n\n");
printf("\t i under over \n");
printf("\t--------------------------------\n");
for (i = 1; i <= N; ++i) {
under /= 2.0;
over *= 2.0;
printf("\t %d %e %e\n", i, under, over);
}
return (0);
}
-+- 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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-24 3:23 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-24 3:23 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> -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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-24 3:23 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-24 3:23 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Rigo Schultz <schultz@eva.mpg.de>
Robert M. Riches Jr wrote:
> 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);
}
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-23 7:00 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-23 7:00 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Rigo Schultz <schultz@eva.mpg.de>
Robert M. Riches Jr wrote:
> 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);
}
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-23 7:00 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-23 7:00 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> -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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-21 9:31 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-21 9:31 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Rigo Schultz <schultz@eva.mpg.de>
Robert M. Riches Jr wrote:
> 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);
}
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-21 9:31 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-21 9:31 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> -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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-20 10:25 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-20 10:25 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Rigo Schultz" <rigo.schultz@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Rigo Schultz <schultz@eva.mpg.de>
Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>
>>-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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
@ 2003-06-20 10:25 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-20 10:25 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: Rigo Schultz <schultz@eva.mpg.de>
Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>
>>-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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
@ 2003-06-20 9:53 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-20 9:53 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> -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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-20 9:36 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-20 9:36 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: Rigo Schultz <schultz@eva.mpg.de>
Robert M. Riches Jr wrote:
> 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);
}
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-19 18:42 Robert M. Riches Jr
0 siblings, 0 replies; 22+ messages in thread
From: Robert M. Riches Jr @ 2003-06-19 18:42 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Robert M. Riches Jr" <robert.m..riches.jr@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
"Robert M. Riches Jr" <spamtrap42@verizon.net>
In article <874r2mkon5.fsf@student.uni-tuebingen.de>, Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>> It seems that the "float" and "double" range on EV6 are different to
>> the x86 systems. Sorry, I'm not familar with that stuff.
>
> x86 might use 80 bit for some double operation, since that is what the
> FPU provides.
>
>> Here is a short c-source, that shows the difference. But I do'nt
>> understand why the Alpha breaks too early.
>
> I don't quite understand your question... What's happening is that you
> do arithmetic with a denormalized number, which traps by default on
> Alpha, since it isn't 100% IEEE-compliant. Is that what you wanted to
> know?
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.
Good luck.
Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
-+- 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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
@ 2003-06-19 18:42 Robert M. Riches Jr
0 siblings, 0 replies; 22+ messages in thread
From: Robert M. Riches Jr @ 2003-06-19 18:42 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Robert M. Riches Jr" <spamtrap42@verizon.net>
In article <874r2mkon5.fsf@student.uni-tuebingen.de>, Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>> It seems that the "float" and "double" range on EV6 are different to
>> the x86 systems. Sorry, I'm not familar with that stuff.
>
> x86 might use 80 bit for some double operation, since that is what the
> FPU provides.
>
>> Here is a short c-source, that shows the difference. But I do'nt
>> understand why the Alpha breaks too early.
>
> I don't quite understand your question... What's happening is that you
> do arithmetic with a denormalized number, which traps by default on
> Alpha, since it isn't 100% IEEE-compliant. Is that what you wanted to
> know?
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.
Good luck.
Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
--- 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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
@ 2003-06-19 18:39 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-19 18:39 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> It seems that the "float" and "double" range on EV6 are different to
> the x86 systems. Sorry, I'm not familar with that stuff.
x86 might use 80 bit for some double operation, since that is what the FPU
provides.
> Here is a short c-source, that shows the difference. But I do'nt
> understand why the Alpha breaks too early.
I don't quite understand your question... What's happening is that you do
arithmetic with a denormalized number, which traps by default on Alpha, since
it isn't 100% IEEE-compliant. Is that what you wanted to know?
--
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
@ 2003-06-19 18:39 Falk Hueffner
0 siblings, 0 replies; 22+ messages in thread
From: Falk Hueffner @ 2003-06-19 18:39 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: "Falk Hueffner" <falk.hueffner@shurato.darktech.org>
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10) From:
Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Rigo Schultz <schultz@eva.mpg.de> writes:
> It seems that the "float" and "double" range on EV6 are different to
> the x86 systems. Sorry, I'm not familar with that stuff.
x86 might use 80 bit for some double operation, since that is what the FPU
provides.
> Here is a short c-source, that shows the difference. But I do'nt
> understand why the Alpha breaks too early.
I don't quite understand your question... What's happening is that you do
arithmetic with a denormalized number, which traps by default on Alpha, since
it isn't 100% IEEE-compliant. Is that what you wanted to know?
--
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
for abuse issues, please contact me at shurato@shurato.darktech.org Shurato:
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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* floating point problem
@ 2003-06-19 18:32 Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-19 18:32 UTC (permalink / raw)
(CHARSET: PC-8)
(PATH: 263/950 236/150 261/38 140/1 106/2000 123/500 3613/1275 134/10)
From: Rigo Schultz <schultz@eva.mpg.de>
I try to run some simulations at different hardware architectures, ALPHA
EV6 and x86. Both runnig Linux.
But I get Floating Point Exceptions at the Alpha system. It seems that the
"float" and "double" range on EV6 are different to the x86 systems. Sorry,
I'm not familar with that stuff. Here is a short c-source, that shows the
difference. But I do'nt understand why the Alpha breaks too early.
Thanks Rigo
#include <stdio.h>
int main(void)
{
enum {N = 150};
int i;
float under = 1.0; /* for underflow */
float over = 1.0; /* for overflow */
printf ("sizeof(int) = %d\n", sizeof(int));
printf ("sizeof(float) = %d\n", sizeof(float));
printf ("sizeof(double) = %d\n", sizeof(double));
printf ("sizeof(long double) = %d\n", sizeof(long double));
printf ("\n\n");
printf("\t i under over \n");
printf("\t--------------------------------\n");
for (i = 1; i <= N; ++i) {
under /= 2.0;
over *= 2.0;
printf("\t %d %e %e\n", i, under, over);
}
return (0);
}
--- 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
for abuse issues, please contact me at shurato@shurato.darktech.org
Shurato: Admin of SHS.
^ permalink raw reply [flat|nested] 22+ messages in thread* floating point problem
@ 2003-06-19 16:32 Rigo Schultz
2003-06-19 16:39 ` Falk Hueffner
0 siblings, 1 reply; 22+ messages in thread
From: Rigo Schultz @ 2003-06-19 16:32 UTC (permalink / raw)
I try to run some simulations at different hardware architectures, ALPHA
EV6 and x86. Both runnig Linux.
But I get Floating Point Exceptions at the Alpha system.
It seems that the "float" and "double" range on EV6 are different to the
x86 systems. Sorry, I'm not familar with that stuff.
Here is a short c-source, that shows the difference. But I do'nt
understand why the Alpha breaks too early.
Thanks Rigo
#include <stdio.h>
int main(void)
{
enum {N = 150};
int i;
float under = 1.0; /* for underflow */
float over = 1.0; /* for overflow */
printf ("sizeof(int) = %d\n", sizeof(int));
printf ("sizeof(float) = %d\n", sizeof(float));
printf ("sizeof(double) = %d\n", sizeof(double));
printf ("sizeof(long double) = %d\n", sizeof(long double));
printf ("\n\n");
printf("\t i under over \n");
printf("\t--------------------------------\n");
for (i = 1; i <= N; ++i) {
under /= 2.0;
over *= 2.0;
printf("\t %d %e %e\n", i, under, over);
}
return (0);
}
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
2003-06-19 16:32 Rigo Schultz
@ 2003-06-19 16:39 ` Falk Hueffner
2003-06-19 18:42 ` Robert M. Riches Jr
0 siblings, 1 reply; 22+ messages in thread
From: Falk Hueffner @ 2003-06-19 16:39 UTC (permalink / raw)
Rigo Schultz <schultz@eva.mpg.de> writes:
> It seems that the "float" and "double" range on EV6 are different to
> the x86 systems. Sorry, I'm not familar with that stuff.
x86 might use 80 bit for some double operation, since that is what the
FPU provides.
> Here is a short c-source, that shows the difference. But I do'nt
> understand why the Alpha breaks too early.
I don't quite understand your question... What's happening is that you
do arithmetic with a denormalized number, which traps by default on
Alpha, since it isn't 100% IEEE-compliant. Is that what you wanted to
know?
--
Falk
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
2003-06-19 16:39 ` Falk Hueffner
@ 2003-06-19 18:42 ` Robert M. Riches Jr
2003-06-20 7:36 ` Rigo Schultz
0 siblings, 1 reply; 22+ messages in thread
From: Robert M. Riches Jr @ 2003-06-19 18:42 UTC (permalink / raw)
In article <874r2mkon5.fsf@student.uni-tuebingen.de>, Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>> It seems that the "float" and "double" range on EV6 are different to
>> the x86 systems. Sorry, I'm not familar with that stuff.
>
> x86 might use 80 bit for some double operation, since that is what the
> FPU provides.
>
>> Here is a short c-source, that shows the difference. But I do'nt
>> understand why the Alpha breaks too early.
>
> I don't quite understand your question... What's happening is that you
> do arithmetic with a denormalized number, which traps by default on
> Alpha, since it isn't 100% IEEE-compliant. Is that what you wanted to
> know?
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.
Good luck.
Robert Riches
spamtrap42@verizon.net
(Yes, that is one of my email addresses.)
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
2003-06-19 18:42 ` Robert M. Riches Jr
@ 2003-06-20 7:36 ` Rigo Schultz
2003-06-20 7:53 ` Falk Hueffner
0 siblings, 1 reply; 22+ messages in thread
From: Rigo Schultz @ 2003-06-20 7:36 UTC (permalink / raw)
Robert M. Riches Jr wrote:
> 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);
}
on x86:>Check: 2.938736e-39
on alpha:>Check: 5.562685e-309
It's only a little bit different :o(
thanks
^ permalink raw reply [flat|nested] 22+ messages in thread* Re: floating point problem
2003-06-20 7:36 ` Rigo Schultz
@ 2003-06-20 7:53 ` Falk Hueffner
2003-06-20 8:25 ` Rigo Schultz
0 siblings, 1 reply; 22+ messages in thread
From: Falk Hueffner @ 2003-06-20 7:53 UTC (permalink / raw)
Rigo Schultz <schultz@eva.mpg.de> writes:
> -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
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: floating point problem
2003-06-20 7:53 ` Falk Hueffner
@ 2003-06-20 8:25 ` Rigo Schultz
0 siblings, 0 replies; 22+ messages in thread
From: Rigo Schultz @ 2003-06-20 8:25 UTC (permalink / raw)
Falk Hueffner wrote:
> Rigo Schultz <schultz@eva.mpg.de> writes:
>
>
>>-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.
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2003-06-24 3:23 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-19 18:32 floating point problem Rigo Schultz
-- strict thread matches above, loose matches on Subject: below --
2003-06-24 3:23 Falk Hueffner
2003-06-24 3:23 Rigo Schultz
2003-06-23 7:00 Rigo Schultz
2003-06-23 7:00 Falk Hueffner
2003-06-21 9:31 Rigo Schultz
2003-06-21 9:31 Falk Hueffner
2003-06-20 10:25 Rigo Schultz
2003-06-20 10:25 Rigo Schultz
2003-06-20 9:53 Falk Hueffner
2003-06-20 9:36 Rigo Schultz
2003-06-19 18:42 Robert M. Riches Jr
2003-06-19 18:42 Robert M. Riches Jr
2003-06-19 18:39 Falk Hueffner
2003-06-19 18:39 Falk Hueffner
2003-06-19 18:32 Rigo Schultz
2003-06-19 16:32 Rigo Schultz
2003-06-19 16:39 ` Falk Hueffner
2003-06-19 18:42 ` Robert M. Riches Jr
2003-06-20 7:36 ` Rigo Schultz
2003-06-20 7:53 ` Falk Hueffner
2003-06-20 8:25 ` Rigo Schultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox