Re: qfloat extended precision in Cephes library
- From: "lcw1964" <leslie.wright@xxxxxxxxxxxxx>
- Date: 31 Aug 2006 14:12:53 -0700
Steven G. Kargl wrote:
See if you can track down a copy of Moshier's book, "Methods and Programs
for Mathematical Functions (Ellis Horwood Series in Mathematics and Its
Applications)," at a local library. It goes into lengthy detail about
the approximations.
I will definitely hunt that down.
Mr. Moshier himself was able to respond to me briefly, and it seems
like a managed to answer my own question. Turns out that a comment in
the code was out of sync with what I thought the code should do (and
was doing) base on my knowledge of the math.
Someone in an earlier thread a few weeks back encouraged me to
familiarize myself with Moshier's Cephes library and the qlib extended
precision offering in particular. I haven't quite graduated to an
arbitrary precision package--gmp is a little out of my skill range
now--but using the 384 bit qfloat type proved easier than I at first
thought it would be, and offers 100+ digits quite readily. Indeed, the
qfloat.h C++ wrapper makes it easier to write math code that looks like
math code (i.e z = x + y, as opposed to qadd(x,y,z)). I was grateful
for the advice to familiarize myself with the package.
To help answer my own question, I wrote the code as I would write it,
and, after precious little debugging, my own high precision gamma
routine does what Mr. Moshier's original does (perhaps not quite as
well), confirming that I understood more than I at first gave myself
credit for. Some of Mr. Moshier's built-in routines, such as the
incomplete gamma function and the error functions, don't converge to
full 100+ digit precision (the comments advise of this), but I have
found it a simple matter to spiff up some of my own routines here to
use Moshier's qfloat wrapper and get 100+ precision easily. And, even
better, I think the code should be portable. I have started using gcc
4.* under Cygwin, but there is way I am sure to compile Moshier's stuff
in , say MSVC, and code that links in the resulting library.
I wanted to thank whoever it was to encouraged me to familiarize myself
with gcc and with Moshier's work. I am a rank amateur, but I have
learned a lot quickly, and my sense of satisfaction and accomplishment
in math programming is great.
Les
.
- Next by Date: Re: low precision exponential function
- Next by thread: Re: low precision exponential function
- Index(es):
Relevant Pages
|