From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 9F77527A3F for ; Thu, 15 Aug 2024 15:18:44 +0200 (CEST) Received: (qmail 3183 invoked by uid 550); 15 Aug 2024 13:18:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3150 invoked from network); 15 Aug 2024 13:18:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723727911; x=1724332711; darn=lists.openwall.com; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r2hIY8XGd0cVcxAR4T13kT2fHvpGDedSLUyCrF58RMs=; b=Ed4SUnzR9JWwVtdLNUYtqdYwHrFfMcQviZOe3+B5DZo3+ZNLVYanUh6FLZYj2T8tXY JbLunRjTiJK7ug5K0g4XViv5UE9K/s0i/5bjadI05Glgc2fMvTpaDz4jsE9OIhHnLFA2 ODdOdE1Da3SI+1vzwzs2PpYgYDicb/G+fyd3/QGA4OLPq3LY3EyZFmh8K/V0yVcHBQ6w MYanqeHx/07QaYTN7gYHwx9WtXGzDxU8vH2MNuuF1rJX/eg3VvsgoUE+ZhnrAVJTOv8u 4m7Ne/oAoOV3sKuEnNj49TUs0g0w3djnUGd86+xmiCsah2+KsmCSrrXt8eBrhe32075F cStA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723727911; x=1724332711; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r2hIY8XGd0cVcxAR4T13kT2fHvpGDedSLUyCrF58RMs=; b=iGljG5ep4Rn0iVrpsAPu6wNXbe8ua/TaIeIppQy53TVu51xkAHNnkF0NqL/xClU/jp HxvgR0KWkko/ApOF7foNRXdfP9Y9cUvK+Yj9K/M+h6CRch5sDoXGR8gLD5M1ltjFyRlY Z9jAEKu6s2ufY5eQPhLXaKr2nWGNMp0tLrUIlteUdv/bkoK2CcAjH/TS3urxBw/v//po y7j/+xwan9KeZ2XstZSReSoTe6tBD78kZqA1GrDpze1iAkvneoHLYmzWyuRdDMN5uxGX ZZs7Z/+2f3Nx9JFGLPqGEjW2SY3jUj4VkR2o9JMITF+ikm+iQHnfmVqdZndZTnGQcg/y sDyQ== X-Gm-Message-State: AOJu0YxT+kEOomQRZS1tuX1b03JtsHviLfF5JeEDFlEqH9N16hECtpue j6hAMqHmJMY9DbLJalPBCCTYV+6bygjbOaw7/fCBsGz89t+6ms8sWCD23uFETQeihoZNPz8A6zJ QEeQECiX9K8M2s1JyAsyoZFQqAlkk6zxp X-Google-Smtp-Source: AGHT+IGH1KgktF82y6j6CY3gtn/O7KoXCMVIVHjhxvXrmnVlIJ8ouiCme5uFQzqeEhlJmDKuZq0MUDStjo5Rq/5RPy4= X-Received: by 2002:a17:906:d25c:b0:a7a:9144:e23a with SMTP id a640c23a62f3a-a8366ff0256mr422528366b.43.1723727910524; Thu, 15 Aug 2024 06:18:30 -0700 (PDT) MIME-Version: 1.0 References: <21ca5c9-b1e-71b5-87b-a37f81f691ab@esi.com.au> <20240811200812.GZ3766212@port70.net> <7e9463-98a3-4b2-c10-e3fbf79a6b8@esi.com.au> <5918d2a7-7b3-932b-2b4-b24390832244@esi.com.au> In-Reply-To: <5918d2a7-7b3-932b-2b4-b24390832244@esi.com.au> From: Morten Welinder Date: Thu, 15 Aug 2024 09:18:19 -0400 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] catan(z) atan2 definitely isn't supposed to always output rational numbers on rational input. atan2(+0,-1) is Pi. atan2(-0,-1) is -Pi atan2(1,1) is Pi/4 -- clearly not a rational number. These aren't exactly rational results (unless you mean their floating-point approximations). M. On Sun, Aug 11, 2024 at 11:56=E2=80=AFPM Damian McGuckin wrote: > > On Mon, 12 Aug 2024, Damian McGuckin wrote: > > > There is some argument that if you handle the special cases at infinity > > separately (which I think MUSL should do but I do not have time at the > > moment), then one can assume that because pi/2 is irrational, then one > > should never have to deal with the end points in the chunk of code wher= e > > those two lines of code seen above should appear. I will have a chat > > sometime with the guy who wrote that logic in a WG14 paper when I get a > > really clear head and can line him up. > > Consider > > atan2(y, x) > > For any finite y and finite non-zero x floating point number arguments, > i.e. rational numbers, the result of atan2(y, x) must be rational and so > is never +/- pi (which is irrational and only occurs when the ration y/x > is a mathematical infinity, not an overflowing infinity). So, we can > ignore the endpoints as long as our special case handling takes care of > the case of zero x. > > I think that is correct .... or is my brain still not working properly > after too many late nights watching the Olympics. > > Thanks - Damian