pow1pm1¶
- mpsci.fun.pow1pm1(x, y)¶
Compute \((1 + x)^y - 1\).
See also:
inv_pow1pm1()
Examples
>>> from mpsci.fun import pow1pm1 >>> from mpmath import mp >>> mp.dps = 25
>>> x = mp.mpf('3.5e-75') >>> y = mp.mpf('2.86e-8')
Naive calculation:
>>> (1 + x)**y - 1 mpf('0.0')
Using
pow1pm1
:>>> pow1pm1(x, y) mpf('1.001000000000000000000000001e-82')