Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Nov 2010 08:46:45 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Alexander Best <arundel@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ulrich Spoerlein <uqs@freebsd.org>
Subject:   Re: svn commit: r215237 - head/lib/msun/src
Message-ID:  <20101113164645.GB69612@troutmask.apl.washington.edu>
In-Reply-To: <20101113125648.GA25183@freebsd.org>
References:  <201011131054.oADAsA7I045096@svn.freebsd.org> <20101113125648.GA25183@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Nov 13, 2010 at 12:56:48PM +0000, Alexander Best wrote:
> On Sat Nov 13 10, Ulrich Spoerlein wrote:
> > Author: uqs
> > Date: Sat Nov 13 10:54:10 2010
> > New Revision: 215237
> > URL: http://svn.freebsd.org/changeset/base/215237
> > 
> > Log:
> >   Fix bug in jn(3) and jnf(3) that led to -inf results
> 
> thank you very much for fixing this long outstanding issue.
> you might want to have a look at [1], where two more issues have been reported.
> 
> cheers.
> alex
> 
> [1] http://mailman.oakapple.net/pipermail/numeric-interest/2010-September/thread.html
> 

Ulrich, thanks.  Of the two remaining issues, I can verify
one is indeed an issue.

laptop:kargl[204] cat mn.c
#include <stdio.h>
#include <math.h>

static const double z = 0.;

int
main(void)
{
   double x, y;
   x = -1. / z;
   y = exp( 0.5 * log(x));
   printf("pow(%f,  0.5) = %le, %le\n", x, pow(x,  0.5), y);
   y = exp(-0.5 * log(x));
   printf("pow(%f, -0.5) = %le, %le\n", x, pow(x, -0.5), y);
   return 0;
}

laptop:kargl[205] cc -o z mn.c -fno-builtin -lm && ./z
pow(-inf,  0.5) = inf, nan
pow(-inf, -0.5) = 0.000000e+00, nan

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101113164645.GB69612>