コード例 #1
0
 def test_sin(self):
     with mp.workdps(30):
         sincoeffs = mp.taylor(mp.sin, 0, 10)
         asincoeffs = mp.taylor(mp.asin, 0, 10)
         invsincoeffs = lagrange_inversion(sincoeffs)
         mp_assert_allclose(invsincoeffs, asincoeffs, atol=1e-30)
コード例 #2
0
 def test_log(self):
     with mp.workdps(30):
         logcoeffs = mp.taylor(lambda x: mp.log(1 + x), 0, 10)
         expcoeffs = mp.taylor(lambda x: mp.exp(x) - 1, 0, 10)
         invlogcoeffs = lagrange_inversion(logcoeffs)
         mp_assert_allclose(invlogcoeffs, expcoeffs)
コード例 #3
0
 def test_log(self):
     with mp.workdps(30):
         logcoeffs = mp.taylor(lambda x: mp.log(1 + x), 0, 10)
         expcoeffs = mp.taylor(lambda x: mp.exp(x) - 1, 0, 10)
         invlogcoeffs = lagrange_inversion(logcoeffs)
         mp_assert_allclose(invlogcoeffs, expcoeffs)
コード例 #4
0
 def test_sin(self):
     with mp.workdps(30):
         sincoeffs = mp.taylor(mp.sin, 0, 10)
         asincoeffs = mp.taylor(mp.asin, 0, 10)
         invsincoeffs = lagrange_inversion(sincoeffs)
         mp_assert_allclose(invsincoeffs, asincoeffs, atol=1e-30)
コード例 #5
0
def compute_alpha(n):
    """alpha_n from DLMF 8.12.13"""
    coeffs = mp.taylor(eta, 0, n - 1)
    return lagrange_inversion(coeffs)