From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 26 04:15:34 2010 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07D7D106564A; Fri, 26 Feb 2010 04:15:34 +0000 (UTC) (envelope-from kargl@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.freebsd.org (Postfix) with ESMTP id C14A68FC08; Fri, 26 Feb 2010 04:15:33 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o1Q4FXnH029993; Thu, 25 Feb 2010 20:15:33 -0800 (PST) (envelope-from kargl@troutmask.apl.washington.edu) Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o1Q4FXC6029992; Thu, 25 Feb 2010 20:15:33 -0800 (PST) (envelope-from kargl) From: "Steven G. Kargl" Message-Id: <201002260415.o1Q4FXC6029992@troutmask.apl.washington.edu> In-Reply-To: <201002260020.o1Q0K40O036894@freefall.freebsd.org> To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Date: Thu, 25 Feb 2010 20:15:33 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL124d (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Cc: Subject: Re: bin/144306: Nasty bug in jn(3) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2010 04:15:34 -0000 This patch fixes the problem. Index: e_jn.c =================================================================== --- e_jn.c (revision 204219) +++ e_jn.c (working copy) @@ -200,7 +200,12 @@ } } } - b = (t*__ieee754_j0(x)/b); + z = __ieee754_j0(x); + w = __ieee754_j1(x); + if (fabs(z) >= fabs(w)) + b = (t*z/b); + else + b = (t*w/a); } } if(sgn==1) return -b; else return b; -- Steve http://troutmask.apl.washington.edu/~kargl/