From: Jakob Oestergaard <jakob@unthought.net>
To: linux-kernel@vger.kernel.org
Subject: Re: [BENCHMARK] AIM Independent Resource Benchmark results for kernel-2.5.44
Date: Tue, 29 Oct 2002 00:17:38 +0100 [thread overview]
Message-ID: <20021028231738.GC15779@unthought.net> (raw)
In-Reply-To: <20021028182839.GA2030@sgi.com>
On Mon, Oct 28, 2002 at 12:28:39PM -0600, Nathan Straz wrote:
> >
> > The AIM7/AIM9 new_raph is broken code. The convergence loop termination
> > conditional looks something like:
> > if (delta == 0) break;
> > for a type "double" delta. You ought to change that to be something
> > like:
> > if (delta <= 0.00000001L) break;
>
> I usually specify the compiler flag -ffloat-store and that fixes the
> issue for me.
Maybe that will work as a work-around. But it is nothing but a
work-around. The previous poster was right - the code is broken.
The "==" operator usually doesn't have any reasonable use on floating
point values (yes there are cases where it makes sense, but this is not
one of them).
A result from any computation on double values cannot be assumed to
"equal" anything in particular. Zero included.
The correct way to terminate that loop is, like was already suggested,
doing a comparison to see if the residual is "numerically zero" or
"sufficiently zero-ish for the given purpose". Eg. "delta < 1E-12" or
eventually "fabs(delta) < 1E-12".
Comparing to zero makes *no* sense. It's written by someone who has no
understanding of numerics (or perhaps just didn't think clearly at that
moment - /me trying not to insult more people than strictly necessary ;)
--
................................................................
: jakob@unthought.net : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob Østergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............:
next prev parent reply other threads:[~2002-10-28 23:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.d95885v.1d14t8c@ifi.uio.no>
2002-10-26 0:12 ` [BENCHMARK] AIM Independent Resource Benchmark results for kernel-2.5.44 John Hawkes
2002-10-28 18:28 ` Nathan Straz
2002-10-28 23:17 ` Jakob Oestergaard [this message]
2002-10-29 15:28 ` Nathan Straz
2002-10-29 16:24 ` Cliff White
[not found] <fa.e2emdkv.j1ksaf@ifi.uio.no>
[not found] ` <fa.f6uq3iv.232305@ifi.uio.no>
2002-10-29 20:06 ` John Hawkes
2002-10-29 20:46 ` Timothy D. Witham
2002-10-23 7:15 Siva Koti Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021028231738.GC15779@unthought.net \
--to=jakob@unthought.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox