From owner-freebsd-numerics@FreeBSD.ORG Wed Aug 15 15:58:23 2012 Return-Path: Delivered-To: freebsd-numerics@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F35F1065672 for ; Wed, 15 Aug 2012 15:58:23 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id D0D8C8FC0C for ; Wed, 15 Aug 2012 15:58:22 +0000 (UTC) Received: from [128.206.184.213] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.5/8.14.5) with ESMTP id q7FFwLbZ042742; Wed, 15 Aug 2012 10:58:21 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <502BC71D.4080401@missouri.edu> Date: Wed, 15 Aug 2012 10:58:21 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: Bruce Evans , freebsd-numerics@FreeBSD.org References: <5017111E.6060003@missouri.edu> <501C361D.4010807@missouri.edu> <20120804165555.X1231@besplex.bde.org> <501D51D7.1020101@missouri.edu> <20120805030609.R3101@besplex.bde.org> <501D9C36.2040207@missouri.edu> <20120805175106.X3574@besplex.bde.org> <501EC015.3000808@missouri.edu> <20120805191954.GA50379@troutmask.apl.washington.edu> <20120807205725.GA10572@server.rulingia.com> <20120809025220.N4114@besplex.bde.org> <5027F07E.9060409@missouri.edu> <20120814003614.H3692@besplex.bde.org> <50295887.2010608@missouri.edu> <20120814055931.Q4897@besplex.bde.org> <50297468.20902@missouri.edu> <20120814173931.V934@besplex.bde.org> <502A820C.6060804@missouri.edu> <20120816010912.Q1751@besplex.bde.org> In-Reply-To: <20120816010912.Q1751@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Complex arg-trig functions X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.5 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, 15 Aug 2012 15:58:23 -0000 On 08/15/12 10:19, Bruce Evans wrote: > Though sin() doesn't lose precision at large or not so large zeros, Bessel > functions probably do. I think no one knows where many of their zeros > near DBL_MAX are, since they are not evenly spaced like multiples of pi > are, so every one needs an individual calculation. pari become incredibly > slow at just finding them after the first few hundred, at least using the > following perhaps too simple script: > > for (i = 0, 999, print(solve(x=i*Pi, (i+1)*Pi, besselj(0,x)))) > > This gets slower and slower as i increases and takes about 1 second > per zero starting at i = 900. But after pari takes a few minutes to > generate 1000 zeros, FreeBSD libm j0 and j0f pass checks of them all > in 1.5 msec. The check is that there is a sign change on each side > of the supposed zero. So FreeBSD j0 and j0f get at least 1 bit right > (the sign bit) for the first 1000 zeros. There are asymptotic formulas for the Bessel Functions for large x. So surely one could get very accurate formulas for the large roots. My guess is that to machine precision, the roots are evenly spaced (pi apart) for roots larger than 1/EPSILON (since I am guessing that the error in the asymptotics is about 1/x^(3/2)). http://en.wikipedia.org/wiki/Bessel_function#Asymptotic_forms Mathematica finds the roots very fast: N[BesselJZero[1/10, 10000], 50] 31415.141141713507985336657384821650558701674510788 I did it for the Bessel function of order 1/10, just to make sure that it wasn't storing huge tables. I know Mathematica is produced by an evil corporation, but I am constantly impressed by how well it performs. Hey - I just performed this experiment: Table[N[BesselJZero[0/10, n] - BesselJZero[0/10, n - 1], 50], {n, 100000, 100100}] The asymptotics are much better than I supposed, since these are Pi to about 18 decimal digits.