Re: qfloat extended precision in Cephes library



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

.



Relevant Pages

  • Re: Ambiguous interfaces
    ... > I have a question about ambiguous interfaces. ... > subroutine DoSomething_DefaultInteger ... if you combine two or more specific routines ... default real precision and at double precision. ...
    (comp.lang.fortran)
  • Re: high-precision eigenvalue solver
    ... >> precision. ... Rather than hand-coding the routines, I would use a package like Gnu ... and recode the lapack routines to call the ... Since it's quadratically convergent, this isn't as ...
    (sci.math.num-analysis)
  • Re: Maples linear algebra routine and higher precision arithmetic
    ... precision results with results generated by increasing levels of precision. ... with linear algebra routines --- maybe by using NAG routines ... Digits. ... meaning that hardware is used if Digits <= evalhf(i.e. ...
    (sci.math.symbolic)
  • Re: Maples linear algebra routine and higher precision arithmetic
    ... precision results with results generated by increasing levels of precision. ... Sometime ago I recall hearing that Maple was changing that way it dealt ... with linear algebra routines --- maybe by using NAG routines ... Digits. ...
    (sci.math.symbolic)
  • Re: Numerical accuracy of C++ and Fortran programs on 32 bit machines
    ... >> void main{ ... >> versions of the mathematical functions in the library) ... > variable called precision and the default value is what you are using. ... > manipulator forms of the desired thingy. ...
    (comp.programming)