public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: me22 <me22.ca@gmail.com>
To: NightStrike <nightstrike@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Floating point optimizations
Date: Sat, 05 Apr 2008 21:26:00 -0000	[thread overview]
Message-ID: <fa28b9250804051204u14c309bbpdae44db02a481d23@mail.gmail.com> (raw)
In-Reply-To: <b609cb3b0804050606q2035bbb5ye18b2c16ffaed9c9@mail.gmail.com>

On Sat, Apr 5, 2008 at 9:06 AM, NightStrike <nightstrike@gmail.com> wrote:
>  Wait, so are things like "c - (c - a)" optimized down to "a" or not?  I
>  use a lot of that in very time-intensive c++ code.
>

I think only if you tell it to be loose with requirements for applying
floating-point math optimizations (-ffast-math and related), since
DBL_MAX - (DBL_MAX-1) is, to the best of my knowledge, 0 --- not 1 ---
in IEEE math.

On the other hand, I managed to get >1 by adding DBL_EPSILON/10 to 1.0
repeatedly (though only on 1 of 4 computers on which I tried it) so my
intuitions could all be wrong.

      parent reply	other threads:[~2008-04-05 19:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 17:00 Christian Keil
2008-04-03 17:27 ` John Fine
2008-04-04 12:04   ` Christian Keil
2008-04-03 18:24 ` Alexander Monakov
2008-04-04 15:48   ` Christian Keil
2008-04-05  1:15   ` Tim Prince
2008-04-05 13:07     ` Andrew Haley
2008-04-05 13:32       ` NightStrike
2008-04-05 19:05         ` Tim Prince
2008-04-05 21:26         ` me22 [this message]

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=fa28b9250804051204u14c309bbpdae44db02a481d23@mail.gmail.com \
    --to=me22.ca@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=nightstrike@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).