From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0F03D3858D28 for ; Tue, 10 Oct 2023 19:27:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F03D3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696966039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v5zFULVRdWQMC30439tpPkqozpjsTDGMNbKcx2NDa6Q=; b=RRiK6aH3czVRrLFJ7K8ZvTLtw5JptkRC1K9p6/yufBliQ8Hd2R/GA7SfYKOhaVSf+iaz2i fZNAkQ5rDqg+TF2cXw3DhiOiaICqz+HE7pS35Ne1lwxNevzceIrDBOMZe9nq5z0DOJFL7q 5qTQEOyNCcSc4qGj/dg4jdWpdaQ5970= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-fYS8CwwGMO6xGuewGvJqsQ-1; Tue, 10 Oct 2023 15:27:07 -0400 X-MC-Unique: fYS8CwwGMO6xGuewGvJqsQ-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-53d996a15e1so175517a12.0 for ; Tue, 10 Oct 2023 12:27:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696966026; x=1697570826; h=cc: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=v5zFULVRdWQMC30439tpPkqozpjsTDGMNbKcx2NDa6Q=; b=mdI4LNrT5gq+sJsWyAbZMDSepd8UqbTPg5FrFVt9i54CRwkT6IIkALdlwaXs+uD8HX RyLO3MEzjhOM1xijKK5K3b+hsHSTk7CzQy8eWu6XupYYuxz0uaADCn9qy/SFoyvra7ig v3wApitoA5+Qqb9K4o0T9OpwkiLeXokLCfLR+hGxHrKlVZdcEIDxYP4eOqpmW8sA6uWK kx/wNqieED/bOKspPxURZZT5c6NdKYgnheP94z5XqkZiYZwMPWM3zgoEuzBsmVioJopV NVmHbfJN7LoNeDYPrmCj63pC8PdLEYCv4BgIoaQOv5BYBv8OMrxh0nLwevWoFmdl/Rcc UfVQ== X-Gm-Message-State: AOJu0Yxclc4u622gHfth7JnT2F/YfJz42y1qCF172tiHigyfL5EPrbmq jt3IkgoDMNY+ykCKIAY8SPiXlbeQTzkFTzTgKYkgMFvRHhEPs6EIRi34Nzn1XUHmsziYrFF5VTy 657txGIBdsmEsr6NG8juAoS+66OpMhrSja2MmDwM= X-Received: by 2002:a05:6402:5113:b0:523:f69:9a0d with SMTP id m19-20020a056402511300b005230f699a0dmr16587100edd.4.1696966026100; Tue, 10 Oct 2023 12:27:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXb5hzo6rDQc6wxb41C8Zy1QNIkl58bSQCUGXMdyAPJkuBYUmyPNT/+3etQ18EZtghzebopHlSrQawVDdMS9I= X-Received: by 2002:a05:6402:5113:b0:523:f69:9a0d with SMTP id m19-20020a056402511300b005230f699a0dmr16587093edd.4.1696966025785; Tue, 10 Oct 2023 12:27:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Johnston Date: Tue, 10 Oct 2023 15:26:54 -0400 Message-ID: Subject: Re: [PATCH 1/1] newlib: libm: fix complex atan for +/- 1 + 0i To: Joseph Faulls Cc: "newlib@sourceware.org" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000029c375060761b104" X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000029c375060761b104 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Joseph, Sorry for the delay. I did a check and the current NetBSD sources still have that check in them and that was where this code was taken from. However, I created a test case and tried it with glibc and also tested with newlib versions of catan/catanf minus the checks. They match without the check so I pushed the change to all 3 of the catan functions. -- Jeff J. On Mon, Oct 9, 2023 at 6:47=E2=80=AFAM Joseph Faulls wrote: > Ping > > > > *From:* Joseph Faulls > *Sent:* Tuesday, September 26, 2023 12:07 PM > *To:* newlib@sourceware.org > *Subject:* [PATCH 1/1] newlib: libm: fix complex atan for +/- 1 + 0i > > > > Delete check which ensured atan2 was not called with x=3D0. This is not > > necessary as atan2 is defined for x=3D0 when y !=3D 0. The check incorrec= tly > > resulted in catan returning nan + inf i for when real part is +/- 1 and > > imaginary part is 0. > > > > The check could also have implications when called with imaginary number > > x + yi where x^2 + y^2 =3D=3D 1.0. Although this is unlikely due to float= ing > > point precision. > > --- > > newlib/libm/complex/catan.c | 2 -- > > 1 file changed, 2 deletions(-) > > > > diff --git a/newlib/libm/complex/catan.c b/newlib/libm/complex/catan.c > > index 77510ec2f..34d75b849 100644 > > --- a/newlib/libm/complex/catan.c > > +++ b/newlib/libm/complex/catan.c > > @@ -105,8 +105,6 @@ catan(double complex z) > > > > x2 =3D x * x; > > a =3D 1.0 - x2 - (y * y); > > - if (a =3D=3D 0.0) > > - goto ovrf; > > > > t =3D 0.5 * atan2(2.0 * x, a); > > w =3D _redupi(t); > > -- > > 2.34.1 > --00000000000029c375060761b104--