Sergey B Kirpichev

Results 436 comments of Sergey B Kirpichev
trafficstars

Maybe it's safe to use just ```diff diff --git a/mpmath/functions/functions.py b/mpmath/functions/functions.py index 2bbb63d..b770e05 100644 --- a/mpmath/functions/functions.py +++ b/mpmath/functions/functions.py @@ -168,7 +168,7 @@ def log1p(ctx, x): return ctx.zero if ctx.mag(x) <...

Wouldn't be better using a Horner scheme ``c*(1. - 0.5*c)``?

> Using the original mag < -prec cutoff, that's gone through over 125 million cases with max total ULP error 0.5005. This run is using the "only one fat mpf...

I know few libraries, that provide complex variant of log1p. IIRC, julia just uses Kahan's trick. The MPC has no log1p (it's in TODO).

Perhaps, we could just increase working precision: ```diff diff --git a/mpmath/libmp/libmpc.py b/mpmath/libmp/libmpc.py index 2e22b22..b0893d4 100644 --- a/mpmath/libmp/libmpc.py +++ b/mpmath/libmp/libmpc.py @@ -609,7 +609,7 @@ def acos_asin(z, prec, rnd, n): and by...

Hmm, I forgot to add explicit test with zero for the mp context... Also note using ``mpf_ge()`` to correctly handle unsigned zeros. But we have in Mathematica: ``` In[7]:= ArcSin[Infinity...

Well, we have a disgrepancy for diofant/sympy evaluation rules and mpmath already in v1.3.0: ``` In [1]: asin(oo, evaluate=False).evalf() # in sympy 1.13.dev Out[1]: 1.5707963267949 - ∞⋅ⅈ In [2]: import...

> According to https://en.cppreference.com/w/cpp/numeric/complex/asin special cases I think, these are taken into account correctly. > While the special cases do not specify the case where x is 0 In fact,...

Draft PR for the Diofant to fix evaluation rules: https://github.com/diofant/diofant/pull/1396 I think, that the SymPy should implement something like that. Current evaluation rules could be broken also by rewrite rules,...

> I have contemplated whether this should be changed so that there is only directed infinity and complex infinity. Yes, maybe that should be changed that way. Pros: this will...