From owner-freebsd-numerics@FreeBSD.ORG Fri Sep 12 22:52:13 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 C35BE5C4 for ; Fri, 12 Sep 2014 22:52:13 +0000 (UTC) Received: from mail-yk0-x230.google.com (mail-yk0-x230.google.com [IPv6:2607:f8b0:4002:c07::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7A478C for ; Fri, 12 Sep 2014 22:52:13 +0000 (UTC) Received: by mail-yk0-f176.google.com with SMTP id 131so797204ykp.7 for ; Fri, 12 Sep 2014 15:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=SBM9TEcw4kr5eGifVq7ae5LfltAR3pgwULdRUe9opAY=; b=bvhsDXjvusuKisBYeQvpCa/MHfy0vQSZVAFeZbYqZG3gG2qWl3KeRpT+pw5dRcGchp 9L23qf1oIuVk9y3XO6UusIcYlO+P2HGR1QbFOVa6+O1cBlMvsyP6/EU05lkABY9D53ty fPiLEO8kFZ6g5PK7ZthfKtxXujh9N6qAX7d6UqPNwNePouboCHvuvNuITzniL5SbZ0se o+qGPQSJ8T32IYhNctKLuxlqqZi3fWu/ba0ooWjV5D31WIsu3MOD/MjJbm7nIpsLzCTu NMgBHp/IthNPX8OghtIgU0BoRcDsu56/7GyzQVRt/3M6qsyUiaIa29kdslzfuqPBs3el lPjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=SBM9TEcw4kr5eGifVq7ae5LfltAR3pgwULdRUe9opAY=; b=I6Ne6dIItEqYl/NKzIA0aW2ItDESSEvvFYw9RPTePB7jb9GSrTX2a3rzDZApuT2tMI D8l+k9wFre50IuV3OGjWnwD31mhxI2Bv4qd8o6K5oLw/nD755ORlJmZr/Cp1Ye1ADURn n/Yv2nio+OT2enh64m6+b0tCg4TCiMvI2tycJqGe/vxPSJFGCm0Wp/uC1a8c9TA7xLas LA154Xlb98tqUNMyTdhhISjBwvojNDYFirCx4/wpUQAt8PHGomGhN6hJPuGenJms1VIo +hss3nZrxDWGLf+y5Cie0STwgFelNr9rKYiUhM6Mt4gLDV9d0/AQMGVaJzKwRe9HM06B 271w== X-Gm-Message-State: ALoCoQmKfCgU1Gm+fPsWymTx7k1l7Wi6NNIIBoEezzKJGWV/7/hjp/fD4lZFiz0KHcaCCNg6npAL X-Received: by 10.236.85.208 with SMTP id u56mr13686400yhe.48.1410562332361; Fri, 12 Sep 2014 15:52:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.147.69 with HTTP; Fri, 12 Sep 2014 15:51:52 -0700 (PDT) In-Reply-To: <20140912224112.GA97578@troutmask.apl.washington.edu> References: <20140912220544.GA96714@troutmask.apl.washington.edu> <20140912224112.GA97578@troutmask.apl.washington.edu> From: enh Date: Fri, 12 Sep 2014 15:51:52 -0700 Message-ID: Subject: Re: lgamma_r and lgammaf_r return the wrong sign for -0.f To: Steve Kargl Content-Type: text/plain; charset=UTF-8 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: Fri, 12 Sep 2014 22:52:14 -0000 On Fri, Sep 12, 2014 at 3:41 PM, Steve Kargl wrote: > On Fri, Sep 12, 2014 at 03:17:02PM -0700, enh via freebsd-numerics wrote: >> On Fri, Sep 12, 2014 at 3:05 PM, Steve Kargl >> > F.9.5.3 The lgamma functions >> > -- lgamma(1) returns +0. >> > -- lgamma(2) returns +0. >> > -- lgamma(x) returns +inf and raises the ``divide-by-zero'' floating-point >> > exception for x a negative integer or zero. >> > -- lgamma(-inf) returns +inf. >> > -- lgamma(+inf) returns +inf. >> > >> > See the 3rd bullet. -0 is 0 and -0 is a negative integer. > > Of course, neither POSIX nor ISO C specify lgamma_r() only lgamma. > I just spent too much time on the 'divide-by-zero' bug, and > conflated that with signgam. i think the reporter's feeling was that *signgamp should be -1 because as x approaches 0 from the negative side, Gamma(x) approaches -Infinity. (though i suspect they noticed this when porting code from glibc.) >> > POSIX appears to defer to ISO C. n1570.pdf (committe draft for C11) >> > has (almost?) identical text. >> > >> >> 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. >> > >> > I have a bigger patch coming with ld80 and ld128 version of lgammal >> > and lgammal_r. >> >> sorry, i haven't even looked at the *l variants. > > I only just finished writing the *l variants. It took me > a long time to unwind the comments in e_lgamma_r.c, > so that I could write the long double versions. is there a freebsd-numerics-commits or equivalent i could subscribe to?