By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,897 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,897 IT Pros & Developers. It's quick & easy.

Scientific Calculation with long double

P: n/a
Hello:
Currently, I am trying to solve a problem that requires the
calculation of Airy functions for big arguments. Because Airy
functions diverge rapidly for positive values, the results of the
calculation quickly produces overflow (or underflow depending on which
Airy function is used) for values of the argument greater than about
100 when using double. Because of this, I need to find a routine that
calculates Airy function producing results of type long double. Can
anyone make any suggestions??? I have tried GNU's GSL library, which
works with long doubles in most functions, but unfortunately, it
doesn't work with long doubles for special functions. Thanks...
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In <a7**************************@posting.google.com > an***********@hotmail.com (Miguel Morales) writes:
Currently, I am trying to solve a problem that requires the
calculation of Airy functions for big arguments. Because Airy
functions diverge rapidly for positive values, the results of the
calculation quickly produces overflow (or underflow depending on which
Airy function is used) for values of the argument greater than about
100 when using double. Because of this, I need to find a routine that
calculates Airy function producing results of type long double. Can
anyone make any suggestions??? I have tried GNU's GSL library, which
works with long doubles in most functions, but unfortunately, it
doesn't work with long doubles for special functions. Thanks...


Why not do the obvious: take your current implementation and replace
double by long double in a consistent manner?

You may also want to check whether long double provides an extended range
on your platform. Many implementations treat double and long double
identically (same range and same precision).

One word of caution: most of the time, throwing more precision/range
at a problem is not the right solution, unless you know what you're
doing.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #2

P: n/a
Dan Pop wrote:

In <a7**************************@posting.google.com > an***********@hotmail.com (Miguel Morales) writes:
Currently, I am trying to solve a problem that requires the
calculation of Airy functions for big arguments. Because Airy
functions diverge rapidly for positive values, the results of the
calculation quickly produces overflow (or underflow depending on which
Airy function is used) for values of the argument greater than about
100 when using double. Because of this, I need to find a routine that
calculates Airy function producing results of type long double. Can
anyone make any suggestions??? I have tried GNU's GSL library, which
works with long doubles in most functions, but unfortunately, it
doesn't work with long doubles for special functions. Thanks...


Why not do the obvious: take your current implementation and replace
double by long double in a consistent manner?

You may also want to check whether long double provides an extended range
on your platform. Many implementations treat double and long double
identically (same range and same precision).

One word of caution: most of the time, throwing more precision/range
at a problem is not the right solution, unless you know what you're
doing.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de


I suggest getting a library of high-precision fp subroutines. There are several
on the Web in various languages. See, e.g. D.M. Smith, "Using multiple-precision
arithmetic" in Computing in Science & Engineering, July-Aug. 2003. Smith uses
FORTRAN, but there are C libraries available.

--
Julian V. Noble
Professor Emeritus of Physics
jv*@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/

"God is not willing to do everything, and thereby take away that
share of glory that rightfully belongs to ourselves."

-- N. Machiavelli, "The Prince".
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.