Exponential of a mpf_t or mpf_class

Linas Vepstas linas at austin.ibm.com
Wed Aug 16 17:53:00 CEST 2006

On Wed, Aug 16, 2006 at 11:29:03AM -0400, Marc wrote:
> Hello,
> I've been using mpf_class and mpf_t in some numerical programs where the
> results do not fit into doubles. All was well until it was required to take
> the exponential of an mpf_t.
> Specifically, I've been using GNU GSL with GNU GMP. Calling gsl_sf_exp() on
> a mpf_t that has been converted to a double results in an overflow. I'd
> appreciate help in solving this problem. I looked to see if there was an
> arbitrary power function to a float for GMP, but didn't see one listed in
> the documentation.
> I'd appreciate any possible solutions for this problem. GMP has solved many
> of my large number problems, but this last issue remains.

I've been using a home-made implementation of exp by merely summing up
the plain-old power-series x^n/n! by brute force. For values of x < 10K
this will converge fairly rapidly (i.e. with order of 10K multiply-adds 
or less)


More information about the gmp-discuss mailing list