You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A compiled zero imaginary part keeps its sign and crosses a branch cut: ln(cos(x)) at 2 is the conjugate #2236
A compiled real number can carry -0 as its imaginary part, and that puts a logarithm or a root on the wrong side of its branch cut. The value comes out as the conjugate of evaluation's.
Complex.Cos((2, 0)) is (cos 2, -sin 2 · sinh 0), which is (-0.416, -0). Complex.Conjugate((-2, 0)) is (-2, -0). Complex.Log and Complex.Sqrt read the -0 as below the negative real axis. The library has no signed zero, so evaluation takes the principal value, +pi i. ln(-x) is right only because #2226 gives a real product a +0.
A branch-cut function compiled over Complex should read a zero part as +0. That covers ln, log, a power that is not whole, sqrt, arcsin, arccos, arctan and the rest of the inverses, and lambertw.
Activity
A compiled function takes the side of its branch cut evaluation takes (…