comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Where I find Bessel function for Ada ?
Date: Wed, 26 Nov 2008 18:17:03 +0100
Date: 2008-11-26T18:17:06+01:00	[thread overview]
Message-ID: <5rukpfxv15it.17kah89egv5pw$.dlg@40tude.net> (raw)
In-Reply-To: 111195bd-6d60-42e6-8ce1-bf7c27a2f665@u14g2000yqg.googlegroups.com

On Wed, 26 Nov 2008 08:12:21 -0800 (PST), Ludovic Brenta wrote:

> On Nov 26, 4:09 pm, Ken Thomas <k...@ecs.soton.ac.uk> wrote:

>> As the code for bessj0 is very short, translation to Ada is a small
>> exercise. On the other hand, the code seems to deal with only single
>> precision arithmetic so does not promise high accuracy.
> 
> I suppose this is easy to fix by making the Ada implementation
> generic. The user then instantiates it for any floating-point type
> with the required accuracy.

An ability to do so depends on the accuracy of the constants used in the
implementation.

A good-designed library should have the accuracy of the result within n *
T'Model_Epsilon or, better, within the range f(x)'Pred..f(x)'Succ. It is
non-trivial to do for a generic package. Short types will suffer accuracy
losses due to insufficient precision. Long precision types will due to
inaccuracy of the coefficients. Most likely in a generic body you will need
some "carrier" type of the precision higher than of the argument type. In
some cases T'Base can help. In others it cannot...

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2008-11-26 17:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  8:40 Where I find Bessel function for Ada ? reinkor
2008-11-26 11:05 ` gautier_niouzes
2008-11-26 12:57   ` Dmitry A. Kazakov
2008-12-03  4:18     ` R. B. Love
2008-12-03 13:22       ` Dmitry A. Kazakov
2008-12-03 14:24         ` Hyman Rosen
2008-12-03 14:54           ` Dmitry A. Kazakov
2008-12-06 22:02       ` Nasser Abbasi
2008-12-06 22:37         ` Per Sandberg
2008-12-19 12:39         ` Colin Paul Gloster
2008-12-19 23:30           ` Jerry
2008-11-26 13:08   ` Paul Cole Gloster
2008-11-26 15:09     ` Ken Thomas
2008-11-26 16:12       ` Ludovic Brenta
2008-11-26 17:17         ` Dmitry A. Kazakov [this message]
2008-11-27  3:07 ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox