How to use multiprecision library (gmpy2) with chebpy library?

46 views Asked by At

I would like to use gmpy2 multi precision library and chebpy (https://github.com/chebpy/chebpy) together to find multiple roots of functions that contain exponential terms.

To sum up my problem, see this very simple example :

import gmpy2
from chebpy import chebfun
aaa = gmpy2.exp(1000)
x = chebfun('x', [900, 1100])

And my function is f(x)=exp(x)-aaa. The obvious root is 1000.

But with the following line :

f = gmpy2.exp(x) - aaa

this error is raised : `TypeError: exp() argument type not supported

And I could not use numpy because, as expected, 1000 is too large.

So, how could I use chebpy with multi precision function from gmpy2 library ?

0

There are 0 answers