From: Ruslan Kabatsayev <b7.10110111@gmail.com>
To: gsl-discuss@sourceware.org
Subject: Why compute value for nmax+1 in bessel_Jn_array()?
Date: Fri, 05 Jun 2015 07:30:00 -0000 [thread overview]
Message-ID: <CAHEcG954ZzYxniwb3MXbATP_E8hwc-YqJ2djeh0ph3bp9GRr4A@mail.gmail.com> (raw)
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 —
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==0.7 and nmax==141: the underflow error makes it fail, although
if the function started from nmax instead of nmax+1, it'd succeed as
it currently does for nmax==140.
Could someone clarify this to me?
Regards,
Ruslan
reply other threads:[~2015-06-05 7:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHEcG954ZzYxniwb3MXbATP_E8hwc-YqJ2djeh0ph3bp9GRr4A@mail.gmail.com \
--to=b7.10110111@gmail.com \
--cc=gsl-discuss@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).