mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Damian McGuckin <damianm@esi.com.au>
Cc: MUSL <musl@lists.openwall.com>
Subject: Re: [musl] catan(z)
Date: Sun, 11 Aug 2024 22:08:12 +0200	[thread overview]
Message-ID: <20240811200812.GZ3766212@port70.net> (raw)
In-Reply-To: <21ca5c9-b1e-71b5-87b-a37f81f691ab@esi.com.au>

* Damian McGuckin <damianm@esi.com.au> [2024-08-12 00:01:01 +1000]:
> 
> In this routine, there are 2 lines of code
> 
>     t = 0.5 * atan2(2.0 * x, a);
>     w = _redupi(t);
> 
> The first computes atan2() which returns a number in the range [-pi,+pi]
> which means that t is a number in the range [-pi/2,+pi/2].
> 
> As far as I understand, the routine _redupi(t) accepts a argument and
> reduces it into the range [-pi, +pi]. Am I mistaken?

*reduces into [-pi/2, pi/2]

> 
> If I am not wrong, and 't' is already in the range that _redupi(t) will
> return, then _redupi() just returns its argument (within a rounding error).
> So it seems like a no-op to me.
> 
> Can anybody comment?

it only changes the endpoints (t=+-pi/2 case) otherwise no-op

i dont know if we care about the endpoints but even if we do
there are better ways to fix them up

i think _redupi can be removed, nice catch.

> 
> The routine is originally from Moshier's Cephes library. I have Moshier's
> book but I cannot find any hints there.
> 
> Thanks - Damian

  reply	other threads:[~2024-08-11 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-11 14:01 Damian McGuckin
2024-08-11 20:08 ` Szabolcs Nagy [this message]
2024-08-12  3:39   ` Damian McGuckin
2024-08-12  3:56     ` Damian McGuckin
2024-08-12  9:00       ` Szabolcs Nagy
2024-08-15  1:16         ` Rich Felker
2024-08-15  2:12           ` Damian McGuckin
2024-08-15 14:28             ` Rich Felker
2024-08-16  7:26               ` Szabolcs Nagy
2024-08-16  8:18               ` Eric Pruitt
2024-08-15 13:18       ` Morten Welinder
2024-08-15 13:44         ` Rich Felker
2024-08-16  1:47           ` Damian McGuckin

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=20240811200812.GZ3766212@port70.net \
    --to=nsz@port70.net \
    --cc=damianm@esi.com.au \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).