Scientific Calculation with long double

M

Miguel Morales

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...
 
D

Dan Pop

In said:
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
 
J

Julian V. Noble

Dan said:
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

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
(e-mail address removed)
^^^^^^^^^^^^^^^^^^
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".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top