44
55from flint import arb , ctx
66
7- from scipy .special import erf , erfc
8-
97def assert_almost_equal (x , y , places = 7 ):
108 """Helper method for approximate comparisons."""
119 assert round (x - y , ndigits = places ) == 0
@@ -265,8 +263,8 @@ def test_arb_sgn():
265263
266264def test_arb_erfinv ():
267265 """`arb.erfinv` works as expected."""
268- midpoint = (erf (1 / 8 ) + erf (1 / 16 )) / 2
269- radius = midpoint - erf (1 / 16 )
266+ midpoint = (math . erf (1 / 8 ) + math . erf (1 / 16 )) / 2
267+ radius = midpoint - math . erf (1 / 16 )
270268 arb_val = arb (midpoint , radius )
271269 with ctx .workprec (100 ):
272270 actual = arb_val .erfinv ()
@@ -278,15 +276,21 @@ def test_arb_erf():
278276 arb_val = arb (2 , 1 )
279277 with ctx .workprec (100 ):
280278 actual = arb_val .erf ()
281- true_interval = arb ((erf (1 ) + erf (3 )) / 2 , (erf (1 ) + erf (3 )) / 2 - erf (1 ))
279+ true_interval = arb (
280+ (math .erf (1 ) + math .erf (3 )) / 2 ,
281+ (math .erf (1 ) + math .erf (3 )) / 2 - math .erf (1 )
282+ )
282283 assert true_interval in actual
283284
284285def test_arb_erfc ():
285286 """`arb.erfc` works as expected."""
286287 arb_val = arb (2 , 1 )
287288 with ctx .workprec (100 ):
288289 actual = arb_val .erfc ()
289- true_interval = arb ((erfc (1 ) + erfc (3 )) / 2 , (erfc (1 ) + erfc (3 )) / 2 - erfc (3 ))
290+ true_interval = arb (
291+ (math .erfc (1 ) + math .erfc (3 )) / 2 ,
292+ (math .erfc (1 ) + math .erfc (3 )) / 2 - math .erfc (3 )
293+ )
290294 assert true_interval in actual
291295
292296def test_arb_const_pi ():
0 commit comments