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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 69E66388A422 for ; Wed, 16 Dec 2020 20:32:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 69E66388A422 Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-125-wlxd0io1OsSCZqaDVfu6PQ-1; Wed, 16 Dec 2020 15:31:59 -0500 X-MC-Unique: wlxd0io1OsSCZqaDVfu6PQ-1 Received: by mail-pf1-f199.google.com with SMTP id 22so7807175pfv.22 for ; Wed, 16 Dec 2020 12:31:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3G/6eiCfUBOG1FP+GndwSNsMXlDI+v4jSgvSa14SzrM=; b=NPV1Zj3U1+fC4yPoqZZY9wyYA2ZRM3YyYaIgMeC5DUh381SJfhW7UbSZw3sm0vhZTd SWcr0vE0eRWaeejYPLnFAB6JSSHpf8WXsuSfbNVjTWieH5vS6q0Npr5MHj1Vp1GFikck 4gwsTTd39qk+coKSESj6ZUV4Gibh7y++EcQjxagHGgF+jBgDjqZd3a+z7pqhJCGZ7eP4 /oTlxPn6mO4HbIhFS89hPlw+n+NnBj+q859V64NVR7iDOCijZTyznwiOKF/fdBx9PO3x NeArBCLbPPELh49kJ8UEKpjtMDOfDaROe82NBD7BpINvKTvPoOk2QMVr/gaunNVtXp5N WJdA== X-Gm-Message-State: AOAM532yQ6wmyM3PgCQMJvJ10HOJA3Sdu1GgtGEovaJfStm7/L0yONrt z4dx3AmVLmUkP6v/gKQXXqYM901WFMHdVkmpUr4KlH9fZLGZO6F3v+dBXk9TT1ZJosUTSD/MNlV S8DEo43Jwm1wJl9NkVlzNw1vRAVzFD3A= X-Received: by 2002:a63:2045:: with SMTP id r5mr8215107pgm.6.1608150718195; Wed, 16 Dec 2020 12:31:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4f6owyooS6WcjYldHj+w2UDlMoKvlmrCTh59so8FnA2KUADTrAgOZymDGXNpwgJgxyKo17Ap7xlCLv6zYHWw= X-Received: by 2002:a63:2045:: with SMTP id r5mr8215092pgm.6.1608150717979; Wed, 16 Dec 2020 12:31:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jeff Johnston Date: Wed, 16 Dec 2020 15:31:47 -0500 Message-ID: Subject: Re: regression in tgamma? To: Paul Zimmermann Cc: Newlib X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, KAM_LINEPADDING, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 20:32:05 -0000 Hi Paul, I believe I found the problem. The __ieee754_tgamma functions are not declared in fdlibm.h so the calls in tgamma and tgammaf are using default parms and getting things wrong. My test calling __ieee754_tgamma directly only worked after I added a declaration to __ieee754_tgamma locally. I have pushed a change to master. Please try it out. -- Jeff J. On Wed, Dec 16, 2020 at 8:49 AM Paul Zimmermann wrote: > Hi, > > the regression I observed also concerns the binary32 code. > Consider the following code: > > $ cat /tmp/test_tgamma.c > #include > #include > > #ifdef NEWLIB > int errno; > int* __errno () { return &errno; } > #endif > > int main() > { > float x = -0.0f; > float y = tgammaf (x); > printf ("x=%a y=%a\n", x, y); > { > double x = -0x1.53f198fe3b278p+7, y; > y = tgamma (x); > printf ("x=%a y=%a\n", x, y); > } > } > > With commit a0d7982ff486292540078c0121a435013c5ee1ea it gives on > x86_64/linux > (Intel(R) Core(TM) i5-4590): > > $ gcc -no-pie -DNEWLIB /tmp/test_tgamma.c > build/x86_64/newlib/libm/tmp/libm.a > $ ./a.out > x=-0x0p+0 y=inf > x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015 > > and with commit 1f8e5847dff27e504949cd21bfeadb987d36ad19: > > $ gcc -no-pie -DNEWLIB /tmp/test_tgamma.c > build/x86_64/newlib/libm/tmp/libm.a > $ ./a.out > x=-0x0p+0 y=0x1p+0 > x=-0x1.53f198fe3b278p+7 y=0x1p+0 > > Paul > > > > > > > >