From owner-freebsd-numerics@FreeBSD.ORG Wed Sep 17 19:03:18 2014 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3054156 for ; Wed, 17 Sep 2014 19:03:18 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask.apl.washington.edu", Issuer "troutmask.apl.washington.edu" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BFC8DA1E for ; Wed, 17 Sep 2014 19:03:18 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id s8HJ3CXG073858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2014 12:03:12 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id s8HJ3CYR073857; Wed, 17 Sep 2014 12:03:12 -0700 (PDT) (envelope-from sgk) Date: Wed, 17 Sep 2014 12:03:12 -0700 From: Steve Kargl To: enh Subject: Re: lgamma_r and lgammaf_r return the wrong sign for -0.f Message-ID: <20140917190312.GA73699@troutmask.apl.washington.edu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: freebsd-numerics@freebsd.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2014 19:03:19 -0000 On Fri, Sep 12, 2014 at 02:15:37PM -0700, enh via freebsd-numerics wrote: > if I pass -0.f to lgammaf_r, the sign returned in *signgamp is 1. this > is incorrect --- it should be -1. > > both lgamma_r and lgammaf_r are affected, but the other special cases > in those functions look fine to me. > > this is fixed in OpenBSD and glibc, but FreeBSD and NetBSD both have > the same bug. > > patch below (whitespace mangled courtesy of gmail). i'd prefer to wait > for this to be fixed in FreeBSD and pull down the fix rather than just > fix it locally. > > btw, it looks like you're missing coshl/sinhl/tanhl for ld128 now? > (they've been removed from imprecise.c without having ld128 > implementations added afaics.) > > --elliott (Android libc maintainer) I committed your patch along with the necessary changes to the ld80/e_lgamma_r.c and ld128/e_lgamma_r.c. Thanks for bug report. -- Steve