public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Toon Moene <toon@moene.org>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] [ranger] x == -0.0 does not mean we can replace x with -0.0
Date: Mon, 29 Aug 2022 21:04:44 +0200	[thread overview]
Message-ID: <a3323675-97c2-5bdb-5a4e-0db4017640b1@moene.org> (raw)
In-Reply-To: <21a88c69-eed3-7b1d-bbb7-15d37e5959fd@gmail.com>

On 8/29/22 19:07, Jeff Law via Gcc-patches wrote:

>> One of the more interesting ones is to try to limit the range of the 
>> input to the trigonometric functions - that way you could use ones 
>> without any argument reduction phase ...

> The difficult part is that most of the trig stuff is in libraries, so we 
> don't have visibility into the full range.
> 
> What we do sometimes have is knowledge that the special values are 
> already handled which allows us to do things like automatically 
> transform a division into estimation + NR correction steps (atan2).
> 
> I guess we could do specialization based on the input range.  So rather 
> than calling "sin" we could call a special one that didn't have the 
> reduction step when we know the input value is in a sensible range.

Exactly. It's probably not that hard to have sin/cos/tan with a special 
entry point that foregoes the whole argument reduction step.

In every weather forecast, you have to compute the local solar height 
(to get the effects of solar radiation correct) every time step, in 
every grid point.

You *know* that angle is between 0 and 90 degrees, as are all the angles 
that go into that computation (latitude, longitude (and time [hour of 
the day, day of the year]).

-- 
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands


  parent reply	other threads:[~2022-08-29 19:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 15:46 Aldy Hernandez
2022-08-26 16:40 ` Jakub Jelinek
2022-08-29 13:13   ` Aldy Hernandez
2022-08-29 13:21     ` Jakub Jelinek
2022-08-29 13:31       ` Aldy Hernandez
2022-08-29 14:20         ` Jeff Law
2022-08-29 14:26           ` Aldy Hernandez
2022-08-29 15:08             ` Jeff Law
2022-08-29 15:13               ` Toon Moene
2022-08-29 17:07                 ` Jeff Law
2022-08-29 17:37                   ` Koning, Paul
2022-08-29 19:04                   ` Toon Moene [this message]
2022-08-29 15:29               ` Aldy Hernandez
2022-08-31 10:08       ` Aldy Hernandez

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=a3323675-97c2-5bdb-5a4e-0db4017640b1@moene.org \
    --to=toon@moene.org \
    --cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).