From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43011 invoked by alias); 5 Jun 2015 07:30:55 -0000 Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org Received: (qmail 42997 invoked by uid 89); 5 Jun 2015 07:30:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f176.google.com Received: from mail-wi0-f176.google.com (HELO mail-wi0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 05 Jun 2015 07:30:52 +0000 Received: by wibut5 with SMTP id ut5so11832161wib.1 for ; Fri, 05 Jun 2015 00:30:49 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.78.110 with SMTP id a14mr3890529wjx.87.1433489449519; Fri, 05 Jun 2015 00:30:49 -0700 (PDT) Received: by 10.27.14.143 with HTTP; Fri, 5 Jun 2015 00:30:49 -0700 (PDT) Date: Fri, 05 Jun 2015 07:30:00 -0000 Message-ID: Subject: Why compute value for nmax+1 in bessel_Jn_array()? From: Ruslan Kabatsayev To: gsl-discuss@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-q2/txt/msg00001.txt.bz2 Hello, I'm looking into implementation of gsl_sf_bessel_Jn_array(). There stat_np1 is computed for nmax+1 and stat_n for nmax, so that later the backward recurrence relation is used to obtain values for nmin through nmax-1. It seems strange to me though that nmax+1 is used at all =E2=80=94 can't the function just go down from nmax and nmax-1 instead of nmax+1 and nmax? It seems currently it does one extra computation only to effectively throw away its result. This also becomes a problem e.g. when x=3D=3D0.7 and nmax=3D=3D141: the underflow error makes it fail, altho= ugh if the function started from nmax instead of nmax+1, it'd succeed as it currently does for nmax=3D=3D140. Could someone clarify this to me? Regards, Ruslan