* Problem with floating point exceptions
@ 1999-01-06 21:29 John Montgomery
1999-01-06 21:47 ` Greg Lindahl
1999-01-06 21:57 ` Adam C. Powell, IV
0 siblings, 2 replies; 10+ messages in thread
From: John Montgomery @ 1999-01-06 21:29 UTC (permalink / raw)
To: axp-list
[-- Attachment #1: math.txt --]
[-- Type: text/plain, Size: 755 bytes --]
I'm trying to port a large Fortran program to alpha Linux using f2c/gcc.
My system is a UDB running RedHat 5.1. I'm able to compile and run my
code, but I'm having some strange numerical problems. I get floating
point exceptions in sections of the code which evaluate exp(-x) for large
positive values of x. This is normal behavior and on other platforms
results in underflows, which are silently set to zero. Also, when I poke
around in core dumps with gdb I find numbers with exponents less than
-308, which seem like they should have overflowed already. Perhaps these
somehow got unnormalized?
I'd like to just have these cases underflow to zero without generating
exceptions, does anyone know how to make this happen?
Thanks,
John Montgomery
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problem with floating point exceptions
1999-01-06 21:29 Problem with floating point exceptions John Montgomery
@ 1999-01-06 21:47 ` Greg Lindahl
1999-01-06 23:23 ` Michal Jaegermann
1999-01-06 21:57 ` Adam C. Powell, IV
1 sibling, 1 reply; 10+ messages in thread
From: Greg Lindahl @ 1999-01-06 21:47 UTC (permalink / raw)
To: axp-list
> I'm trying to port a large Fortran program to alpha Linux using f2c/gcc.
> My system is a UDB running RedHat 5.1. I'm able to compile and run my
> code, but I'm having some strange numerical problems. I get floating
> point exceptions in sections of the code which evaluate exp(-x) for large
> positive values of x.
FAQ. You need to use the -mieee flag in order to use denormalized
numbers at all. Unfortunately, the current exp() and other routines
will crash otherwise; ideally they should underflow to zero if you do
not specify -mieee.
Note that -mieee will slow down your code by a factor of 2 or more.
> I'd like to just have these cases underflow to zero without generating
> exceptions, does anyone know how to make this happen?
As a workaround, you can figure out the smallest value for which exp()
does not crash, and explicitly test for it in your code.
-- g
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problem with floating point exceptions
1999-01-06 21:29 Problem with floating point exceptions John Montgomery
1999-01-06 21:47 ` Greg Lindahl
@ 1999-01-06 21:57 ` Adam C. Powell, IV
1999-01-07 1:06 ` Joachim Wesner
1999-01-07 15:54 ` Samba Izaak Bozof
1 sibling, 2 replies; 10+ messages in thread
From: Adam C. Powell, IV @ 1999-01-06 21:57 UTC (permalink / raw)
To: axp-list
John Montgomery wrote:
> I'm trying to port a large Fortran program to alpha Linux using f2c/gcc.
> My system is a UDB running RedHat 5.1. I'm able to compile and run my
> code, but I'm having some strange numerical problems. I get floating
> point exceptions in sections of the code which evaluate exp(-x) for large
> positive values of x. This is normal behavior and on other platforms
> results in underflows, which are silently set to zero. Also, when I poke
> around in core dumps with gdb I find numbers with exponents less than
> -308, which seem like they should have overflowed already. Perhaps these
> somehow got unnormalized?
>
> I'd like to just have these cases underflow to zero without generating
> exceptions, does anyone know how to make this happen?
I'm not positive, but I think libffm 0.28 gives the behavior you want, and
it is several times faster than libm, let alone with -mieee. Just download,
build, and link your code -lffm -lm.
http://people.frankfurt.netsurf.de/Joachim.Wesner/
Zeen,
-Adam `Cold Fusion' Powell, IV http://www.ctcms.nist.gov/~powell/ ____
USDoC, National Institute of Standards & Technology (NIST) |\ ||< |
Center for Theoretical and Computational Materials Science | \||_> |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problem with floating point exceptions
1999-01-06 21:47 ` Greg Lindahl
@ 1999-01-06 23:23 ` Michal Jaegermann
1999-01-07 10:19 ` John Connett
0 siblings, 1 reply; 10+ messages in thread
From: Michal Jaegermann @ 1999-01-06 23:23 UTC (permalink / raw)
To: axp-list
Greg Lindahl wrote:
>
> > I get floating
> > point exceptions in sections of the code which evaluate exp(-x) for large
> > positive values of x.
>
> FAQ. You need to use the -mieee flag in order to use denormalized
> numbers at all.
....
>
> Note that -mieee will slow down your code by a factor of 2 or more.
If you have only underflows and you want them silently converted
to zero you may install your private "do-nothing" signal handler
for FPE. Note that this act the same way for **all** floating point
exceptions and this may be not what you really want.
Michal
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problem with floating point exceptions
1999-01-06 21:57 ` Adam C. Powell, IV
@ 1999-01-07 1:06 ` Joachim Wesner
1999-01-07 15:54 ` Samba Izaak Bozof
1 sibling, 0 replies; 10+ messages in thread
From: Joachim Wesner @ 1999-01-07 1:06 UTC (permalink / raw)
To: axp-list
On Wed, 06 Jan 1999, Adam C. Powell, IV wrote:
>John Montgomery wrote:
>
>> II get floating
>> point exceptions in sections of the code which evaluate exp(-x) for large
>> positive values of x. This is normal behavior and on other platforms
>> results in underflows, which are silently set to zero.
>>
>> I'd like to just have these cases underflow to zero without generating
>> exceptions, does anyone know how to make this happen?
>
>I'm not positive, but I think libffm 0.28 gives the behavior you want, and
>it is several times faster than libm, let alone with -mieee. Just download,
>build, and link your code -lffm -lm.
>
Yes, libffm now works that way that it (should) never return denormalized
numbers as the result of calculation, HOWEVER, in the current implementation,
for the functions that are "identity" for very small args x, where sin(x) =
tan(x) = asin(x) = atan(x), also the same denormalized number is returned
that enters the routine.
Probably, in the next release I will add a compile time option to "fix" these
arguments by returning zero here instead, so libffm will do some "healing
action" on bad args.
Nevertheless, for exp, already in the current version, NO denorms are
returned for too negative args, 0 is returned instead.
Joachim Wesner
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problem with floating point exceptions
1999-01-06 23:23 ` Michal Jaegermann
@ 1999-01-07 10:19 ` John Connett
0 siblings, 0 replies; 10+ messages in thread
From: John Connett @ 1999-01-07 10:19 UTC (permalink / raw)
To: axp-list
Michal Jaegermann wrote:
>
> Greg Lindahl wrote:
> >
> > > I get floating
> > > point exceptions in sections of the code which evaluate exp(-x) for large
> > > positive values of x.
> >
> > FAQ. You need to use the -mieee flag in order to use denormalized
> > numbers at all.
> ....
> >
> > Note that -mieee will slow down your code by a factor of 2 or more.
>
> If you have only underflows and you want them silently converted
> to zero you may install your private "do-nothing" signal handler
> for FPE. Note that this act the same way for **all** floating point
> exceptions and this may be not what you really want.
>
> Michal
Another couple of things to be aware of:
1) Even if you install a "do-nothing" signal handler the kernel will
still do quite a bit of work when a SIGFPE occurs. In the Red Hat
version of 2.0.36 that includes a printk which writes a message to the
console. Running a simple program which has a tight loop generating
SIGFPEs is an easy way to make a denial of service attack! I have
commented out the offending message from my kernel builds. My opinion
is that a detectable error in a user process should definitely not
generate a console message.
2) Should you be tempted to try to block SIGFPEs using
sigprocmask(SIG_BLOCK, ...) you will find that it doesn't work. All
SIGFPEs are forced to raise the signal. I outlined a fix in a message
sent to this list on 12 Nov 1998 and asked for comments (I didn't
receive any).
I haven't looked at the 2.2.0pre? sources yet to see if these problems
are still present.
--
John Connett (jrc@art.co.uk)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Samba
1999-01-06 21:57 ` Adam C. Powell, IV
1999-01-07 1:06 ` Joachim Wesner
@ 1999-01-07 15:54 ` Izaak Bozof
1999-01-07 16:53 ` Samba feedback
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Izaak Bozof @ 1999-01-07 15:54 UTC (permalink / raw)
To: axp-list
Is samba available on Linux/axp? I checked www.samba.org and did not find
any linux/axp binaries or any other info on it. The /pub/Linux/*** tree
only contains x86 binaries.
thx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Samba
1999-01-07 15:54 ` Samba Izaak Bozof
@ 1999-01-07 16:53 ` feedback
1999-01-07 16:56 ` Samba Michal Jaegermann
1999-01-07 17:57 ` Samba Maurice Hilarius
2 siblings, 0 replies; 10+ messages in thread
From: feedback @ 1999-01-07 16:53 UTC (permalink / raw)
To: axp-list
If you are running Redhat, try ftp.redhat.com/pub. I am not exactly sure of
the exact directory, but just go to the version you are using. The RPM for
samba will be in the RedHat/RPMS directory. The newest version is in the
updates/5.2/RPMS directory.
Hope that helps...
On Thu, 07 Jan 1999, Izaak Bozof wrote:
>Is samba available on Linux/axp? I checked www.samba.org and did not find
>any linux/axp binaries or any other info on it. The /pub/Linux/*** tree
>only contains x86 binaries.
>
>thx
>
>--
>To unsubscribe: send e-mail to axp-list-request@redhat.com with
>'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Samba
1999-01-07 15:54 ` Samba Izaak Bozof
1999-01-07 16:53 ` Samba feedback
@ 1999-01-07 16:56 ` Michal Jaegermann
1999-01-07 17:57 ` Samba Maurice Hilarius
2 siblings, 0 replies; 10+ messages in thread
From: Michal Jaegermann @ 1999-01-07 16:56 UTC (permalink / raw)
To: axp-list
Izaak Bozof wrote:
>
> Is samba available on Linux/axp?
It even showed up in updates to RH 5.2 because of security problems. :-)
> I checked www.samba.org and did not find
> any linux/axp binaries or any other info on it. The /pub/Linux/*** tree
> only contains x86 binaries.
You can always type "./configure ; make". It is not much harder than
that. Samba distribution also contains spec file so you can easily
make your own rpm. But ready axp rpms are waiting....
--mj
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Samba
1999-01-07 15:54 ` Samba Izaak Bozof
1999-01-07 16:53 ` Samba feedback
1999-01-07 16:56 ` Samba Michal Jaegermann
@ 1999-01-07 17:57 ` Maurice Hilarius
2 siblings, 0 replies; 10+ messages in thread
From: Maurice Hilarius @ 1999-01-07 17:57 UTC (permalink / raw)
To: axp-list
With regards to your message at 10:54 AM 01-07-99 -0500, Izaak Bozof. Where
you stated:
>Is samba available on Linux/axp? I checked www.samba.org and did not find
>any linux/axp binaries or any other info on it. The /pub/Linux/*** tree
>only contains x86 binaries.
>
>thx
Ships on RedFat CDROM..
Best regards,
Maurice W. Hilarius Telephone: 01-403-414-9319
Hard Data Ltd. FAX: 01-403-456-1510
11060 - 166 Avenue email:maurice@harddata.com
Edmonton, AB, Canada - T5X 1Y3 http://www.harddata.com
NOTE: January 25, 1999, new telephone numbers _AND_ area code:
Telephone: 01-780-456-9771
FAX: 01-780-456-9772
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~1999-01-07 18:15 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-06 21:29 Problem with floating point exceptions John Montgomery
1999-01-06 21:47 ` Greg Lindahl
1999-01-06 23:23 ` Michal Jaegermann
1999-01-07 10:19 ` John Connett
1999-01-06 21:57 ` Adam C. Powell, IV
1999-01-07 1:06 ` Joachim Wesner
1999-01-07 15:54 ` Samba Izaak Bozof
1999-01-07 16:53 ` Samba feedback
1999-01-07 16:56 ` Samba Michal Jaegermann
1999-01-07 17:57 ` Samba Maurice Hilarius
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox