472,952 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

Scientific Calculation with long double

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
2 5369
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Miguel Morales | last post by:
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...
1
by: Nick | last post by:
Well, the project I am working on has now come to a screeching halt! I have been developing a program that heavily utilizes ADO.NET record sets. To generate reports, I convert the recordset to XML,...
5
by: Jeff | last post by:
Dim lngWeights as long, lngBuckets as Long Const STDWEIGHTS = 12 lngBuckets = 1000 lngWeights = lngBuckets * STDWEIGHTS This causes an Overflow error. For lower values it works. Obviously...
14
by: wane | last post by:
Hello, I have heard that one should avoid using float and double in monetary calculation because of the lack of preciseness. What is a good alternative? Thanks
2
by: Ryan Liu | last post by:
In C#, for a large float (9 digitals), how can I disable Scientific notation. When it auto convert to Scientific notation, I lost accuracy. Thanks a lot! Ryan
9
by: Joe Attardi | last post by:
Hi all, Math is not my strongest area so forgive me if I use some of the wrong terminology. It seems that scientific notation is immune to rounding errors. For example: (4.98 * 100) + 5.51 ...
8
by: GB | last post by:
Hello, How to calculate value for the following formula (I need C# code): res = (((m+1)(m+2)...(m+(k-1)))/1.2...(k-1)) or more generalized formula is: k-1 __ | | (m+i)
3
by: PengYu.UT | last post by:
Hi, I setprecision to be 100 for both cases. I'm wondering why the number of digits are different. Also, for a double number, I think any digits that are longer than 15 (or 16) are not...
3
by: mattmao | last post by:
Okay, I was asked by a friend about the result of this limit: http://bbs.newwise.com/attdata/forumid_14/20070922_fe7f77c81050413a20fbDWYOGm7zeRj3.jpg Not n->zero but n-> + infinite I really...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.