473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 5390
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.