Skip to content

Keep the small parts of a logarithm near 1, a root and Ci (#2677) - #2681

Open
Rafael-SOWNet wants to merge 3 commits into
masterfrom
fix-2677-tiny-parts-of-large-arguments
Open

Rafael-SOWNet wants to merge 3 commits into
masterfrom
fix-2677-tiny-parts-of-large-arguments

Conversation

@Rafael-SOWNet

@Rafael-SOWNet Rafael-SOWNet commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #2677

What was wrong

On master (e3b3a34, after #2676) a part of a value far smaller than the rest was dropped: arcoth(10^60) and arcsch(10^60) were 0 where they are 1E-60, arsech(10^50 * i) lost its real part 1E-50, (1 + 10^(-50) * i)^(1/2) was 1 where it is 1 + 5E-51i, and Ci(10^60 + i) lost its imaginary part -6.548E-61. In the same class: ln(1 + 10^(-60)) was 0, arsinh(-10^60 * i) and arcsch(10^(-60) * i) were -oo, and every root of 1 + 10^(-k) i had no imaginary part.

Causes, each confirmed before it was fixed

  1. A logarithm near 1 took its value for a residual. The area functions are expansions, arcoth(x) = 1/2 ln((x + 1)/(x - 1)) (Convenience/MathS.cs:2675 and its neighbours), so far out each is ln(1 + t) for a tiny t. Number.Ln makes a real logarithm at the scale of its argument (Core/Entity/Continuous/Number/Operators.cs:941 on master), and Real.CreateAtScale rounds a value below the tolerance times the scale onto 0 (Entity.Continuous.Real.Definition.cs:147). At a hundred digits the tolerance is 1E-50, so ln(1 + 2E-60) = 2E-60 was 0. The exact argument of arcoth and the inexact one of arcsch fail the same way, and so does ln(1 + 10^(-60)) written out.
  2. The root search read a phase of 10^(-60) as 0. 1 + 10^(-60) * i evaluates with a decimal imaginary part, so Keep every part of a complex value past 10^50 (#2675) #2676's guard for an exact imaginary part does not apply. FindGoodRoot (Operators.cs:772) went on to GetAllRoots, whose phase Ln(value / |value|) / i (Operators.cs:370) came out 0, which I measured as the roots returned and did not trace further, and IsZeroAtTheWorkingPrecision(Pow(rational, power) - base) (Operators.cs:460) accepted 1 as the root, because 1E-60 i is under 1E-50.
  3. Ci's branch constants were measured as terms of their own size. Past the series, Ci(z) = Chi(iz) - i pi/2, Chi adds +-pi/2, and Ei(z) and Ei(-z) add +-pi each (TrigonometricIntegrals.cs:194, 212; ExponentialIntegrals.cs:209). They cancel to -6.5E-61 i, and each was added to the imaginary scale at full size, so the scale was about 2 pi and the value was below the tolerance times it.

The fix

  1. Logf's numerical evaluation (Functions/Evaluation/Evaluation.Continuous/Evaluation.Continuous.Arithmetics.Classes.cs:600, NearOneWithMoreDigits at :673) evaluates the base and the antilogarithm again, with more digits, where the modulus of either is within 10^(-precision/4) of 1. It takes precision + k and 2k digits for a distance 10^(-k), so the value is above half of them and keeps all of its own. A rational's distance is exact. A decimal distance below the working digits is not known, so the digits are doubled, twice at most. A 0 that a sum other than exact arithmetic evaluated to is treated the same way: arsinh(-10^60 i) is ln(-10^60 i + sqrt(1 - 10^120)), whose argument cancels to -5E-61 i. The wider contexts are cached, since the constants are cached by context instance. A logarithm of a 1 that is a residual, such as ln(sqrt(2)^2/2) or ln(sin(3)^2 + cos(3)^2), stays a residual at more digits and is still 0. Where either argument has a decimal written in it, such as a root the solver wrote as ln(a + b i) / i, evaluating it again does not add digits: its distance from 1 is known to the working digits only, and below them it is the decimal's own rounding. The first version of this PR missed that. It read |a + b i| - 1 ~ 1e-101 as a value, and the real roots of cos(3x) = sin(2x) and sin(2x) = sin(3x) came back with imaginary parts near 1e-101, which trigcheck caught under scaling. This is the brief's "area function evaluated with log1p-style care", made at the logarithm, so it covers every spelling of ln(1 + t) and not only the six area functions. Keeping six new nodes would have meant teaching differentiation, simplification, integration, limits, the solver, the printers and the compilers about each one.
  2. FindGoodRoot returns no real root for a base with a decimal imaginary part other than 0 (Operators.cs:429), as Keep every part of a complex value past 10^50 (#2675) #2676 already did for an exact one. A number keeps such a part only when its own creation judged it no residual. The base goes to the polar form, which keeps the phase. GetAllRoots is unchanged: Keep every part of a complex value past 10^50 (#2675) #2676 measured that changing it mixed a complex principal root with a real sibling and gave -1.
  3. Each constant branch term counts against the scale only at its digits past the context's, pi * 10^(-guard) (ExponentialIntegrals.cs:218, TrigonometricIntegrals.cs:198, 219, 224). A constant cancels nothing, which is the same accounting as the series' ScaleByPowerOfTen(beyond).

Each fix links the v3 decision (#1019), since each answers a residual of the downcasting.

Sweep

(mpmath, dps 1200): every area function, arcsec, arccsc and arccot at x, x i and -x i for x in 10^10, 10^20, 10^60, 10^200 and 10^-60; sqrt, (1 + t)^(1/3), (1 + t)^(2/3), (1 + t)^(-1/2) and ln(1 + t) for t = +-10^(-k) and +-10^(-k) i, k in 10, 20, 60 and 200; and Ci, Si and Ei at x + i, x - i, 1 + x i and -1 + x i. That is 275 rows. Each part is held to a relative 1e-10, and a part that is 0 to exactly 0.

master → branch rows
right → right 201
wrong → right 43
wrong → wrong 31
right → wrong 0

The 43 rows that changed:

expression mpmath master branch
arsinh(-10^60 * i) -138.848 + -1.5708i -inf + 0.0i wrong re,im -138.848 + -1.5708i
arsinh(10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcosh(10^(-60) * i) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arcosh(-10^(-60) * i) 1.0e-60 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-60 + -1.5708i
artanh(10^60) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
artanh(10^200) 1.0e-200 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-200 + 1.5708i
artanh(10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcoth(10^60) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcoth(10^200) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
arcoth(10^(-60)) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arsech(10^60 * i) 1.0e-60 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-60 + -1.5708i
arsech(-10^60 * i) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arsech(10^200 * i) 1.0e-200 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-200 + -1.5708i
arsech(-10^200 * i) 1.0e-200 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-200 + 1.5708i
arcsch(10^60) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcsch(10^200) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
arcsch(10^(-60) * i) -138.848 + -1.5708i -inf + 0.0i wrong re,im -138.848 + -1.5708i
ln(1 + 10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
ln(1 + -10^(-60)) -1.0e-60 + 0.0i 0.0 + 0.0i wrong re -1.0e-60 + 0.0i
sqrt(1 + 10^(-60) * i) 1.0 + 5.0e-61i 1.0 + 0.0i wrong im 1.0 + 5.0e-61i
(1 + 10^(-60) * i)^(1/3) 1.0 + 3.33333e-61i 1.0 + 0.0i wrong im 1.0 + 3.33333e-61i
(1 + 10^(-60) * i)^(2/3) 1.0 + 6.66667e-61i 1.0 + 0.0i wrong im 1.0 + 6.66667e-61i
(1 + 10^(-60) * i)^(-1/2) 1.0 + -5.0e-61i 1.0 + 0.0i wrong im 1.0 + -5.0e-61i
ln(1 + 10^(-60) * i) 5.0e-121 + 1.0e-60i 0.0 + 1.0e-60i wrong re 5.0e-121 + 1.0e-60i
sqrt(1 + -10^(-60) * i) 1.0 + -5.0e-61i 1.0 + 0.0i wrong im 1.0 + -5.0e-61i
(1 + -10^(-60) * i)^(1/3) 1.0 + -3.33333e-61i 1.0 + 0.0i wrong im 1.0 + -3.33333e-61i
(1 + -10^(-60) * i)^(2/3) 1.0 + -6.66667e-61i 1.0 + 0.0i wrong im 1.0 + -6.66667e-61i
(1 + -10^(-60) * i)^(-1/2) 1.0 + 5.0e-61i 1.0 + 0.0i wrong im 1.0 + 5.0e-61i
ln(1 + -10^(-60) * i) 5.0e-121 + -1.0e-60i 0.0 + -1.0e-60i wrong re 5.0e-121 + -1.0e-60i
ln(1 + 10^(-200)) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
ln(1 + -10^(-200)) -1.0e-200 + 0.0i 0.0 + 0.0i wrong re -1.0e-200 + 0.0i
sqrt(1 + 10^(-200) * i) 1.0 + 5.0e-201i 1.0 + 0.0i wrong im 1.0 + 5.0e-201i
(1 + 10^(-200) * i)^(1/3) 1.0 + 3.33333e-201i 1.0 + 0.0i wrong im 1.0 + 3.33333e-201i
(1 + 10^(-200) * i)^(2/3) 1.0 + 6.66667e-201i 1.0 + 0.0i wrong im 1.0 + 6.66667e-201i
(1 + 10^(-200) * i)^(-1/2) 1.0 + -5.0e-201i 1.0 + 0.0i wrong im 1.0 + -5.0e-201i
ln(1 + 10^(-200) * i) 5.0e-401 + 1.0e-200i 0.0 + 1.0e-200i wrong re 5.0e-401 + 1.0e-200i
sqrt(1 + -10^(-200) * i) 1.0 + -5.0e-201i 1.0 + 0.0i wrong im 1.0 + -5.0e-201i
(1 + -10^(-200) * i)^(1/3) 1.0 + -3.33333e-201i 1.0 + 0.0i wrong im 1.0 + -3.33333e-201i
(1 + -10^(-200) * i)^(2/3) 1.0 + -6.66667e-201i 1.0 + 0.0i wrong im 1.0 + -6.66667e-201i
(1 + -10^(-200) * i)^(-1/2) 1.0 + 5.0e-201i 1.0 + 0.0i wrong im 1.0 + 5.0e-201i
ln(1 + -10^(-200) * i) 5.0e-401 + -1.0e-200i 0.0 + -1.0e-200i wrong re 5.0e-401 + -1.0e-200i
Ci(10^60 + i) 1.28136e-60 + -6.54802e-61i 1.28136e-60 + 0.0i wrong im 1.28136e-60 + -6.54802e-61i
Ci(10^60 - i) 1.28136e-60 + 6.54802e-61i 1.28136e-60 + 0.0i wrong im 1.28136e-60 + 6.54802e-61i

The 31 rows still wrong, unchanged from master:

All 275 rows
expression mpmath master branch
arsinh(10^10) 23.719 + 0.0i 23.719 + 0.0i 23.719 + 0.0i
arsinh(10^10 * i) 23.719 + 1.5708i 23.719 + 1.5708i 23.719 + 1.5708i
arsinh(-10^10 * i) -23.719 + -1.5708i -23.719 + -1.5708i -23.719 + -1.5708i
arsinh(10^20) 46.7448 + 0.0i 46.7448 + 0.0i 46.7448 + 0.0i
arsinh(10^20 * i) 46.7448 + 1.5708i 46.7448 + 1.5708i 46.7448 + 1.5708i
arsinh(-10^20 * i) -46.7448 + -1.5708i -46.7448 + -1.5708i -46.7448 + -1.5708i
arsinh(10^60) 138.848 + 0.0i 138.848 + 0.0i 138.848 + 0.0i
arsinh(10^60 * i) 138.848 + 1.5708i 138.848 + 1.5708i 138.848 + 1.5708i
arsinh(-10^60 * i) -138.848 + -1.5708i -inf + 0.0i wrong re,im -138.848 + -1.5708i
arsinh(10^200) 461.21 + 0.0i 461.21 + 0.0i 461.21 + 0.0i
arsinh(10^200 * i) 461.21 + 1.5708i 461.21 + 1.5708i 461.21 + 1.5708i
arsinh(-10^200 * i) -461.21 + -1.5708i -inf + 0.0i wrong re,im -inf + 0.0i wrong re,im
arsinh(10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arsinh(10^(-60) * i) 4.64162e-1202 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
arsinh(-10^(-60) * i) 4.64162e-1202 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arcosh(10^10) 23.719 + 0.0i 23.719 + 0.0i 23.719 + 0.0i
arcosh(10^10 * i) 23.719 + 1.5708i 23.719 + 1.5708i 23.719 + 1.5708i
arcosh(-10^10 * i) 23.719 + -1.5708i 23.719 + -1.5708i 23.719 + -1.5708i
arcosh(10^20) 46.7448 + 0.0i 46.7448 + 0.0i 46.7448 + 0.0i
arcosh(10^20 * i) 46.7448 + 1.5708i 46.7448 + 1.5708i 46.7448 + 1.5708i
arcosh(-10^20 * i) 46.7448 + -1.5708i 46.7448 + -1.5708i 46.7448 + -1.5708i
arcosh(10^60) 138.848 + 0.0i 138.848 + 0.0i 138.848 + 0.0i
arcosh(10^60 * i) 138.848 + 1.5708i 138.848 + 1.5708i 138.848 + 1.5708i
arcosh(-10^60 * i) 138.848 + -1.5708i 138.848 + -1.5708i 138.848 + -1.5708i
arcosh(10^200) 461.21 + 0.0i 461.21 + 0.0i 461.21 + 0.0i
arcosh(10^200 * i) 461.21 + 1.5708i 461.21 + 1.5708i 461.21 + 1.5708i
arcosh(-10^200 * i) 461.21 + -1.5708i 461.21 + -1.5708i 461.21 + -1.5708i
arcosh(10^(-60)) 1.24098e-1201 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arcosh(10^(-60) * i) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arcosh(-10^(-60) * i) 1.0e-60 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-60 + -1.5708i
artanh(10^10) 1.0e-10 + 1.5708i 1.0e-10 + 1.5708i 1.0e-10 + 1.5708i
artanh(10^10 * i) -9.58026e-1203 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
artanh(-10^10 * i) -9.58026e-1203 + -1.5708i 0.0 + -1.5708i 0.0 + -1.5708i
artanh(10^20) 1.0e-20 + 1.5708i 1.0e-20 + 1.5708i 1.0e-20 + 1.5708i
artanh(10^20 * i) 5.22281e-1203 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
artanh(-10^20 * i) 5.22281e-1203 + -1.5708i 0.0 + -1.5708i 0.0 + -1.5708i
artanh(10^60) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
artanh(10^60 * i) -7.52652e-1204 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
artanh(-10^60 * i) -7.52652e-1204 + -1.5708i 0.0 + -1.5708i 0.0 + -1.5708i
artanh(10^200) 1.0e-200 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-200 + 1.5708i
artanh(10^200 * i) -1.2623e-1202 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
artanh(-10^200 * i) -1.2623e-1202 + -1.5708i 0.0 + -1.5708i 0.0 + -1.5708i
artanh(10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
artanh(10^(-60) * i) -7.52652e-1204 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
artanh(-10^(-60) * i) -7.52652e-1204 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arcoth(10^10) 1.0e-10 + 0.0i 1.0e-10 + 0.0i 1.0e-10 + 0.0i
arcoth(10^10 * i) -9.58026e-1203 + -1.0e-10i 0.0 + -1.0e-10i 0.0 + -1.0e-10i
arcoth(-10^10 * i) -9.58026e-1203 + 1.0e-10i 0.0 + 1.0e-10i 0.0 + 1.0e-10i
arcoth(10^20) 1.0e-20 + 0.0i 1.0e-20 + 0.0i 1.0e-20 + 0.0i
arcoth(10^20 * i) 5.22281e-1203 + -1.0e-20i 0.0 + -1.0e-20i 0.0 + -1.0e-20i
arcoth(-10^20 * i) 5.22281e-1203 + 1.0e-20i 0.0 + 1.0e-20i 0.0 + 1.0e-20i
arcoth(10^60) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcoth(10^60 * i) -7.52652e-1204 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arcoth(-10^60 * i) -7.52652e-1204 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
arcoth(10^200) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
arcoth(10^200 * i) -1.2623e-1202 + -1.0e-200i 0.0 + -1.0e-200i 0.0 + -1.0e-200i
arcoth(-10^200 * i) -1.2623e-1202 + 1.0e-200i 0.0 + 1.0e-200i 0.0 + 1.0e-200i
arcoth(10^(-60)) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arcoth(10^(-60) * i) -7.52652e-1204 + -1.5708i 0.0 + -1.5708i 0.0 + -1.5708i
arcoth(-10^(-60) * i) -7.52652e-1204 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arsech(10^10) 1.27782e-1201 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arsech(10^10 * i) 1.0e-10 + -1.5708i 1.0e-10 + -1.5708i 1.0e-10 + -1.5708i
arsech(-10^10 * i) 1.0e-10 + 1.5708i 1.0e-10 + 1.5708i 1.0e-10 + 1.5708i
arsech(10^20) 4.89494e-1203 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arsech(10^20 * i) 1.0e-20 + -1.5708i 1.0e-20 + -1.5708i 1.0e-20 + -1.5708i
arsech(-10^20 * i) 1.0e-20 + 1.5708i 1.0e-20 + 1.5708i 1.0e-20 + 1.5708i
arsech(10^60) 1.24098e-1201 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arsech(10^60 * i) 1.0e-60 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-60 + -1.5708i
arsech(-10^60 * i) 1.0e-60 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-60 + 1.5708i
arsech(10^200) 3.42411e-1202 + 1.5708i 0.0 + 1.5708i 0.0 + 1.5708i
arsech(10^200 * i) 1.0e-200 + -1.5708i 0.0 + -1.5708i wrong re 1.0e-200 + -1.5708i
arsech(-10^200 * i) 1.0e-200 + 1.5708i 0.0 + 1.5708i wrong re 1.0e-200 + 1.5708i
arsech(10^(-60)) 138.848 + 0.0i 138.848 + 0.0i 138.848 + 0.0i
arsech(10^(-60) * i) 138.848 + -1.5708i 138.848 + -1.5708i 138.848 + -1.5708i
arsech(-10^(-60) * i) 138.848 + 1.5708i 138.848 + 1.5708i 138.848 + 1.5708i
arcsch(10^10) 1.0e-10 + 0.0i 1.0e-10 + 0.0i 1.0e-10 + 0.0i
arcsch(10^10 * i) -2.75808e-1202 + -1.0e-10i 0.0 + -1.0e-10i 0.0 + -1.0e-10i
arcsch(-10^10 * i) -2.75808e-1202 + 1.0e-10i 0.0 + 1.0e-10i 0.0 + 1.0e-10i
arcsch(10^20) 1.0e-20 + 0.0i 1.0e-20 + 0.0i 1.0e-20 + 0.0i
arcsch(10^20 * i) 4.89494e-1203 + -1.0e-20i 0.0 + -1.0e-20i 0.0 + -1.0e-20i
arcsch(-10^20 * i) 4.89494e-1203 + 1.0e-20i 0.0 + 1.0e-20i 0.0 + 1.0e-20i
arcsch(10^60) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
arcsch(10^60 * i) 4.64162e-1202 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arcsch(-10^60 * i) 4.64162e-1202 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
arcsch(10^200) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
arcsch(10^200 * i) 3.42411e-1202 + -1.0e-200i 0.0 + -1.0e-200i 0.0 + -1.0e-200i
arcsch(-10^200 * i) 3.42411e-1202 + 1.0e-200i 0.0 + 1.0e-200i 0.0 + 1.0e-200i
arcsch(10^(-60)) 138.848 + 0.0i 138.848 + 0.0i 138.848 + 0.0i
arcsch(10^(-60) * i) -138.848 + -1.5708i -inf + 0.0i wrong re,im -138.848 + -1.5708i
arcsch(-10^(-60) * i) 138.848 + 1.5708i 138.848 + 1.5708i 138.848 + 1.5708i
arcsec(10^10) 1.5708 + 0.0i 1.5708 + 0.0i 1.5708 + 0.0i
arcsec(10^10 * i) 1.5708 + 1.0e-10i 1.5708 + 1.0e-10i 1.5708 + 1.0e-10i
arcsec(-10^10 * i) 1.5708 + -1.0e-10i 1.5708 + -1.0e-10i 1.5708 + -1.0e-10i
arcsec(10^20) 1.5708 + 0.0i 1.5708 + 0.0i 1.5708 + 0.0i
arcsec(10^20 * i) 1.5708 + 1.0e-20i 1.5708 + 1.0e-20i 1.5708 + 1.0e-20i
arcsec(-10^20 * i) 1.5708 + -1.0e-20i 1.5708 + -1.0e-20i 1.5708 + -1.0e-20i
arcsec(10^60) 1.5708 + 0.0i 1.5708 + 0.0i 1.5708 + 0.0i
arcsec(10^60 * i) 1.5708 + 1.0e-60i 1.5708 + 1.0e-60i 1.5708 + 1.0e-60i
arcsec(-10^60 * i) 1.5708 + -1.0e-60i 1.5708 + -1.0e-60i 1.5708 + -1.0e-60i
arcsec(10^200) 1.5708 + 0.0i 1.5708 + 0.0i 1.5708 + 0.0i
arcsec(10^200 * i) 1.5708 + 1.0e-200i 1.5708 + 1.0e-200i 1.5708 + 1.0e-200i
arcsec(-10^200 * i) 1.5708 + -1.0e-200i 1.5708 + -1.0e-200i 1.5708 + -1.0e-200i
arcsec(10^(-60)) 0.0 + 138.848i 0.0 + 138.848i 0.0 + 138.848i
arcsec(10^(-60) * i) 1.5708 + 138.848i 1.5708 + 138.848i 1.5708 + 138.848i
arcsec(-10^(-60) * i) 1.5708 + -138.848i 1.5708 + -138.848i 1.5708 + -138.848i
arccsc(10^10) 1.0e-10 + 0.0i 1.0e-10 + 0.0i 1.0e-10 + 0.0i
arccsc(10^10 * i) 0.0 + -1.0e-10i 0.0 + -1.0e-10i 0.0 + -1.0e-10i
arccsc(-10^10 * i) 0.0 + 1.0e-10i 0.0 + 1.0e-10i 0.0 + 1.0e-10i
arccsc(10^20) 1.0e-20 + 0.0i 1.0e-20 + 0.0i 1.0e-20 + 0.0i
arccsc(10^20 * i) 0.0 + -1.0e-20i 0.0 + -1.0e-20i 0.0 + -1.0e-20i
arccsc(-10^20 * i) 0.0 + 1.0e-20i 0.0 + 1.0e-20i 0.0 + 1.0e-20i
arccsc(10^60) 1.0e-60 + 0.0i 1.0e-60 + 0.0i 1.0e-60 + 0.0i
arccsc(10^60 * i) 0.0 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arccsc(-10^60 * i) 0.0 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
arccsc(10^200) 1.0e-200 + 0.0i 1.0e-200 + 0.0i 1.0e-200 + 0.0i
arccsc(10^200 * i) 0.0 + -1.0e-200i 0.0 + -1.0e-200i 0.0 + -1.0e-200i
arccsc(-10^200 * i) 0.0 + 1.0e-200i 0.0 + 1.0e-200i 0.0 + 1.0e-200i
arccsc(10^(-60)) 1.5708 + -138.848i 1.5708 + -138.848i 1.5708 + -138.848i
arccsc(10^(-60) * i) 0.0 + -138.848i 0.0 + -138.848i 0.0 + -138.848i
arccsc(-10^(-60) * i) 0.0 + 138.848i 0.0 + 138.848i 0.0 + 138.848i
arccot(10^10) 1.0e-10 + 0.0i 1.0e-10 + 0.0i 1.0e-10 + 0.0i
arccot(10^10 * i) 0.0 + -1.0e-10i 0.0 + -1.0e-10i 0.0 + -1.0e-10i
arccot(-10^10 * i) 0.0 + 1.0e-10i 0.0 + 1.0e-10i 0.0 + 1.0e-10i
arccot(10^20) 1.0e-20 + 0.0i 1.0e-20 + 0.0i 1.0e-20 + 0.0i
arccot(10^20 * i) 0.0 + -1.0e-20i 0.0 + -1.0e-20i 0.0 + -1.0e-20i
arccot(-10^20 * i) 0.0 + 1.0e-20i 0.0 + 1.0e-20i 0.0 + 1.0e-20i
arccot(10^60) 1.0e-60 + 0.0i 1.0e-60 + 0.0i 1.0e-60 + 0.0i
arccot(10^60 * i) 0.0 + -1.0e-60i 0.0 + -1.0e-60i 0.0 + -1.0e-60i
arccot(-10^60 * i) 0.0 + 1.0e-60i 0.0 + 1.0e-60i 0.0 + 1.0e-60i
arccot(10^200) 1.0e-200 + 0.0i 1.0e-200 + 0.0i 1.0e-200 + 0.0i
arccot(10^200 * i) 0.0 + -1.0e-200i 0.0 + -1.0e-200i 0.0 + -1.0e-200i
arccot(-10^200 * i) 0.0 + 1.0e-200i 0.0 + 1.0e-200i 0.0 + 1.0e-200i
arccot(10^(-60)) 1.5708 + 0.0i 1.5708 + 0.0i 1.5708 + 0.0i
arccot(10^(-60) * i) -1.5708 + -1.0e-60i -1.5708 + -1.0e-60i -1.5708 + -1.0e-60i
arccot(-10^(-60) * i) 1.5708 + 1.0e-60i 1.5708 + 1.0e-60i 1.5708 + 1.0e-60i
sqrt(1 + 10^(-10)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-10))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-10))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-10))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + 10^(-10)) 1.0e-10 + 0.0i 1.0e-10 + 0.0i 1.0e-10 + 0.0i
sqrt(1 + -10^(-10)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-10))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-10))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-10))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + -10^(-10)) -1.0e-10 + 0.0i -1.0e-10 + 0.0i -1.0e-10 + 0.0i
sqrt(1 + 10^(-10) * i) 1.0 + 5.0e-11i 1.0 + 5.0e-11i 1.0 + 5.0e-11i
(1 + 10^(-10) * i)^(1/3) 1.0 + 3.33333e-11i 1.0 + 3.33333e-11i 1.0 + 3.33333e-11i
(1 + 10^(-10) * i)^(2/3) 1.0 + 6.66667e-11i 1.0 + 6.66667e-11i 1.0 + 6.66667e-11i
(1 + 10^(-10) * i)^(-1/2) 1.0 + -5.0e-11i 1.0 + -5.0e-11i 1.0 + -5.0e-11i
ln(1 + 10^(-10) * i) 5.0e-21 + 1.0e-10i 5.0e-21 + 1.0e-10i 5.0e-21 + 1.0e-10i
sqrt(1 + -10^(-10) * i) 1.0 + -5.0e-11i 1.0 + -5.0e-11i 1.0 + -5.0e-11i
(1 + -10^(-10) * i)^(1/3) 1.0 + -3.33333e-11i 1.0 + -3.33333e-11i 1.0 + -3.33333e-11i
(1 + -10^(-10) * i)^(2/3) 1.0 + -6.66667e-11i 1.0 + -6.66667e-11i 1.0 + -6.66667e-11i
(1 + -10^(-10) * i)^(-1/2) 1.0 + 5.0e-11i 1.0 + 5.0e-11i 1.0 + 5.0e-11i
ln(1 + -10^(-10) * i) 5.0e-21 + -1.0e-10i 5.0e-21 + -1.0e-10i 5.0e-21 + -1.0e-10i
sqrt(1 + 10^(-20)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-20))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-20))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-20))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + 10^(-20)) 1.0e-20 + 0.0i 1.0e-20 + 0.0i 1.0e-20 + 0.0i
sqrt(1 + -10^(-20)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-20))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-20))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-20))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + -10^(-20)) -1.0e-20 + 0.0i -1.0e-20 + 0.0i -1.0e-20 + 0.0i
sqrt(1 + 10^(-20) * i) 1.0 + 5.0e-21i 1.0 + 5.0e-21i 1.0 + 5.0e-21i
(1 + 10^(-20) * i)^(1/3) 1.0 + 3.33333e-21i 1.0 + 3.33333e-21i 1.0 + 3.33333e-21i
(1 + 10^(-20) * i)^(2/3) 1.0 + 6.66667e-21i 1.0 + 6.66667e-21i 1.0 + 6.66667e-21i
(1 + 10^(-20) * i)^(-1/2) 1.0 + -5.0e-21i 1.0 + -5.0e-21i 1.0 + -5.0e-21i
ln(1 + 10^(-20) * i) 5.0e-41 + 1.0e-20i 5.0e-41 + 1.0e-20i 5.0e-41 + 1.0e-20i
sqrt(1 + -10^(-20) * i) 1.0 + -5.0e-21i 1.0 + -5.0e-21i 1.0 + -5.0e-21i
(1 + -10^(-20) * i)^(1/3) 1.0 + -3.33333e-21i 1.0 + -3.33333e-21i 1.0 + -3.33333e-21i
(1 + -10^(-20) * i)^(2/3) 1.0 + -6.66667e-21i 1.0 + -6.66667e-21i 1.0 + -6.66667e-21i
(1 + -10^(-20) * i)^(-1/2) 1.0 + 5.0e-21i 1.0 + 5.0e-21i 1.0 + 5.0e-21i
ln(1 + -10^(-20) * i) 5.0e-41 + -1.0e-20i 5.0e-41 + -1.0e-20i 5.0e-41 + -1.0e-20i
sqrt(1 + 10^(-60)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-60))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-60))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-60))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + 10^(-60)) 1.0e-60 + 0.0i 0.0 + 0.0i wrong re 1.0e-60 + 0.0i
sqrt(1 + -10^(-60)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-60))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-60))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-60))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + -10^(-60)) -1.0e-60 + 0.0i 0.0 + 0.0i wrong re -1.0e-60 + 0.0i
sqrt(1 + 10^(-60) * i) 1.0 + 5.0e-61i 1.0 + 0.0i wrong im 1.0 + 5.0e-61i
(1 + 10^(-60) * i)^(1/3) 1.0 + 3.33333e-61i 1.0 + 0.0i wrong im 1.0 + 3.33333e-61i
(1 + 10^(-60) * i)^(2/3) 1.0 + 6.66667e-61i 1.0 + 0.0i wrong im 1.0 + 6.66667e-61i
(1 + 10^(-60) * i)^(-1/2) 1.0 + -5.0e-61i 1.0 + 0.0i wrong im 1.0 + -5.0e-61i
ln(1 + 10^(-60) * i) 5.0e-121 + 1.0e-60i 0.0 + 1.0e-60i wrong re 5.0e-121 + 1.0e-60i
sqrt(1 + -10^(-60) * i) 1.0 + -5.0e-61i 1.0 + 0.0i wrong im 1.0 + -5.0e-61i
(1 + -10^(-60) * i)^(1/3) 1.0 + -3.33333e-61i 1.0 + 0.0i wrong im 1.0 + -3.33333e-61i
(1 + -10^(-60) * i)^(2/3) 1.0 + -6.66667e-61i 1.0 + 0.0i wrong im 1.0 + -6.66667e-61i
(1 + -10^(-60) * i)^(-1/2) 1.0 + 5.0e-61i 1.0 + 0.0i wrong im 1.0 + 5.0e-61i
ln(1 + -10^(-60) * i) 5.0e-121 + -1.0e-60i 0.0 + -1.0e-60i wrong re 5.0e-121 + -1.0e-60i
sqrt(1 + 10^(-200)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-200))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-200))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + 10^(-200))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + 10^(-200)) 1.0e-200 + 0.0i 0.0 + 0.0i wrong re 1.0e-200 + 0.0i
sqrt(1 + -10^(-200)) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-200))^(1/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-200))^(2/3) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
(1 + -10^(-200))^(-1/2) 1.0 + 0.0i 1.0 + 0.0i 1.0 + 0.0i
ln(1 + -10^(-200)) -1.0e-200 + 0.0i 0.0 + 0.0i wrong re -1.0e-200 + 0.0i
sqrt(1 + 10^(-200) * i) 1.0 + 5.0e-201i 1.0 + 0.0i wrong im 1.0 + 5.0e-201i
(1 + 10^(-200) * i)^(1/3) 1.0 + 3.33333e-201i 1.0 + 0.0i wrong im 1.0 + 3.33333e-201i
(1 + 10^(-200) * i)^(2/3) 1.0 + 6.66667e-201i 1.0 + 0.0i wrong im 1.0 + 6.66667e-201i
(1 + 10^(-200) * i)^(-1/2) 1.0 + -5.0e-201i 1.0 + 0.0i wrong im 1.0 + -5.0e-201i
ln(1 + 10^(-200) * i) 5.0e-401 + 1.0e-200i 0.0 + 1.0e-200i wrong re 5.0e-401 + 1.0e-200i
sqrt(1 + -10^(-200) * i) 1.0 + -5.0e-201i 1.0 + 0.0i wrong im 1.0 + -5.0e-201i
(1 + -10^(-200) * i)^(1/3) 1.0 + -3.33333e-201i 1.0 + 0.0i wrong im 1.0 + -3.33333e-201i
(1 + -10^(-200) * i)^(2/3) 1.0 + -6.66667e-201i 1.0 + 0.0i wrong im 1.0 + -6.66667e-201i
(1 + -10^(-200) * i)^(-1/2) 1.0 + 5.0e-201i 1.0 + 0.0i wrong im 1.0 + 5.0e-201i
ln(1 + -10^(-200) * i) 5.0e-401 + -1.0e-200i 0.0 + -1.0e-200i wrong re 5.0e-401 + -1.0e-200i
Ci(10^10 + i) -7.52261e-11 + 1.02609e-10i -7.52261e-11 + 1.02609e-10i -7.52261e-11 + 1.02609e-10i
Ci(1 + 10^10 * i) 2.91156e+4342944808 + -4.53448e+4342944808i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^10 - i) -7.52261e-11 + -1.02609e-10i -7.52261e-11 + -1.02609e-10i -7.52261e-11 + -1.02609e-10i
Ci(-1 + 10^10 * i) 2.91156e+4342944808 + 4.53448e+4342944808i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^20 + i) -9.95675e-21 + 8.97819e-21i -9.95675e-21 + 8.97819e-21i -9.95675e-21 + 8.97819e-21i
Ci(1 + 10^20 * i) 3.50347e+43429448190325182744 + -5.45634e+43429448190325182744i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^20 - i) -9.95675e-21 + -8.97819e-21i -9.95675e-21 + -8.97819e-21i -9.95675e-21 + -8.97819e-21i
Ci(-1 + 10^20 * i) 3.50347e+43429448190325182744 + 5.45634e+43429448190325182744i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^60 + i) 1.28136e-60 + -6.54802e-61i 1.28136e-60 + 0.0i wrong im 1.28136e-60 + -6.54802e-61i
Ci(1 + 10^60 * i) 1.63973e+434294481903251827651128918916605082294397005803666566114393 + -2.55373e+434294481903251827651128918916605082294397005803666566114393i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^60 - i) 1.28136e-60 + 6.54802e-61i 1.28136e-60 + 0.0i wrong im 1.28136e-60 + 6.54802e-61i
Ci(-1 + 10^60 * i) 1.63973e+434294481903251827651128918916605082294397005803666566114393 + 2.55373e+434294481903251827651128918916605082294397005803666566114393i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^200 + i) 1.49551e-200 + -2.89555e-201i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(1 + 10^200 * i) 1.60493e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + -2.49953e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^200 - i) 1.49551e-200 + 2.89555e-201i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(-1 + 10^200 * i) 1.60493e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + 2.49953e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Ci(10^(-60) + i) 0.837867 + 1.5708i 0.837867 + 1.5708i 0.837867 + 1.5708i
Ci(1 + 10^(-60) * i) 0.337404 + 5.40302e-61i 0.337404 + 5.40302e-61i 0.337404 + 5.40302e-61i
Ci(10^(-60) - i) 0.837867 + -1.5708i 0.837867 + -1.5708i 0.837867 + -1.5708i
Ci(-1 + 10^(-60) * i) 0.337404 + 3.14159i 0.337404 + 3.14159i 0.337404 + 3.14159i
Si(10^10 + i) 1.5708 + -5.72918e-11i 1.5708 + -5.72918e-11i 1.5708 + -5.72918e-11i
Si(1 + 10^10 * i) 4.53448e+4342944808 + 2.91156e+4342944808i +inf + +infi wrong re,im +inf + +infi wrong re,im
Si(10^10 - i) 1.5708 + 5.72918e-11i 1.5708 + 5.72918e-11i 1.5708 + 5.72918e-11i
Si(-1 + 10^10 * i) -4.53448e+4342944808 + 2.91156e+4342944808i -inf + +infi wrong re,im -inf + +infi wrong re,im
Si(10^20 + i) 1.5708 + -7.583e-21i 1.5708 + -7.583e-21i 1.5708 + -7.583e-21i
Si(1 + 10^20 * i) 5.45634e+43429448190325182744 + 3.50347e+43429448190325182744i +inf + +infi wrong re,im +inf + +infi wrong re,im
Si(10^20 - i) 1.5708 + 7.583e-21i 1.5708 + 7.583e-21i 1.5708 + 7.583e-21i
Si(-1 + 10^20 * i) -5.45634e+43429448190325182744 + 3.50347e+43429448190325182744i -inf + +infi wrong re,im -inf + +infi wrong re,im
Si(10^60 + i) 1.5708 + 9.75875e-61i 1.5708 + 9.75875e-61i 1.5708 + 9.75875e-61i
Si(1 + 10^60 * i) 2.55373e+434294481903251827651128918916605082294397005803666566114393 + 1.63973e+434294481903251827651128918916605082294397005803666566114393i +inf + +infi wrong re,im +inf + +infi wrong re,im
Si(10^60 - i) 1.5708 + -9.75875e-61i 1.5708 + -9.75875e-61i 1.5708 + -9.75875e-61i
Si(-1 + 10^60 * i) -2.55373e+434294481903251827651128918916605082294397005803666566114393 + 1.63973e+434294481903251827651128918916605082294397005803666566114393i -inf + +infi wrong re,im -inf + +infi wrong re,im
Si(10^200 + i) 1.5708 + 1.13897e-200i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Si(1 + 10^200 * i) 2.49953e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + 1.60493e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i +inf + +infi wrong re,im +inf + +infi wrong re,im
Si(10^200 - i) 1.5708 + -1.13897e-200i nan + 0.0i wrong re,im nan + 0.0i wrong re,im
Si(-1 + 10^200 * i) -2.49953e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + 1.60493e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i -inf + +infi wrong re,im -inf + +infi wrong re,im
Si(10^(-60) + i) 1.1752e-60 + 1.05725i 1.1752e-60 + 1.05725i 1.1752e-60 + 1.05725i
Si(1 + 10^(-60) * i) 0.946083 + 8.41471e-61i 0.946083 + 8.41471e-61i 0.946083 + 8.41471e-61i
Si(10^(-60) - i) 1.1752e-60 + -1.05725i 1.1752e-60 + -1.05725i 1.1752e-60 + -1.05725i
Si(-1 + 10^(-60) * i) -0.946083 + 8.41471e-61i -0.946083 + 8.41471e-61i -0.946083 + 8.41471e-61i
Ei(10^10 + i) 5.82311e+4342944808 + 9.06896e+4342944808i +inf + +infi wrong re,im +inf + +infi wrong re,im
Ei(1 + 10^10 * i) -1.32518e-10 + 3.14159i -1.32518e-10 + 3.14159i -1.32518e-10 + 3.14159i
Ei(10^10 - i) 5.82311e+4342944808 + -9.06896e+4342944808i +inf + -infi wrong re,im +inf + -infi wrong re,im
Ei(-1 + 10^10 * i) -1.79343e-11 + 3.14159i -1.79343e-11 + 3.14159i -1.79343e-11 + 3.14159i
Ei(10^20 + i) 7.00695e+43429448190325182744 + 1.09127e+43429448190325182745i +inf + +infi wrong re,im +inf + +infi wrong re,im
Ei(1 + 10^20 * i) -1.75397e-20 + 3.14159i -1.75397e-20 + 3.14159i -1.75397e-20 + 3.14159i
Ei(10^20 - i) 7.00695e+43429448190325182744 + -1.09127e+43429448190325182745i +inf + -infi wrong re,im +inf + -infi wrong re,im
Ei(-1 + 10^20 * i) -2.37375e-21 + 3.14159i -2.37375e-21 + 3.14159i -2.37375e-21 + 3.14159i
Ei(10^60 + i) 3.27946e+434294481903251827651128918916605082294397005803666566114393 + 5.10746e+434294481903251827651128918916605082294397005803666566114393i +inf + +infi wrong re,im +inf + +infi wrong re,im
Ei(1 + 10^60 * i) 2.25723e-60 + 3.14159i 2.25723e-60 + 3.14159i 2.25723e-60 + 3.14159i
Ei(10^60 - i) 3.27946e+434294481903251827651128918916605082294397005803666566114393 + -5.10746e+434294481903251827651128918916605082294397005803666566114393i +inf + -infi wrong re,im +inf + -infi wrong re,im
Ei(-1 + 10^60 * i) 3.05483e-61 + 3.14159i 3.05483e-61 + 3.14159i 3.05483e-61 + 3.14159i
Ei(10^200 + i) 3.20986e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + 4.99906e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i +inf + +infi wrong re,im +inf + +infi wrong re,im
Ei(1 + 10^200 * i) 2.63448e-200 + 3.14159i 0.0 + 3.14159i wrong re 0.0 + 3.14159i wrong re
Ei(10^200 - i) 3.20986e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160 + -4.99906e+43429448190325182765112891891660508229439700580366656611445378316586464920887077472922494933843174831870610674476630373364167928715896390656922106466281226585212708656867032959337086965882668833116160i +inf + -infi wrong re,im +inf + -infi wrong re,im
Ei(-1 + 10^200 * i) 3.56538e-201 + 3.14159i 0.0 + 3.14159i wrong re 0.0 + 3.14159i wrong re
Ei(10^(-60) + i) 0.337404 + 2.51688i 0.337404 + 2.51688i 0.337404 + 2.51688i
Ei(1 + 10^(-60) * i) 1.89512 + 2.71828e-60i 1.89512 + 2.71828e-60i 1.89512 + 2.71828e-60i
Ei(10^(-60) - i) 0.337404 + -2.51688i 0.337404 + -2.51688i 0.337404 + -2.51688i
Ei(-1 + 10^(-60) * i) -0.219384 + 3.14159i -0.219384 + 3.14159i -0.219384 + 3.14159i

Measurements

  • dotnet test Sources/Tests/UnitTests -f net10.0: 22068 passed, 0 failed, 13 skipped. FSharpWrapperUnitTests: 135 passed. Then the two new solver rows, Issue2677_TheLogarithmOfAWrittenDecimalOnTheUnitCircleIsImaginary, were run with the other arcoth, arcsch, arsech, a square root and Ci drop a part much smaller than their input #2677 tests: 32 passed. Before the last commit their roots' logarithms had real parts near 1e-101.

  • trigcheck under scaling, at 10^-12, 10^12, 10^30 and 10^-30, for eqs1121, eqsexp1121 and eqsinv1121: 0 differ in each of the 12 runs.

  • The 275-row sweep has the same verdicts after the last commit: the 43 wrong → right rows hold.

  • One existing test changed. AComplexFunctionKeepsASmallPartTest pinned the real part of ln(1 + 10^(-60) * i) as 0. It is 5E-121, ln|1 + 10^(-60) i|. The answer got better, and the test now says so.

  • limitcheck, 600 expressions, same verdicts on both builds (compared 4872, 0 wrong). Timings alternate between the builds on one machine under the chain lock, user CPU in seconds:

    runs mean
    master 27.81, 28.28; after the last commit 28.88, 28.72 28.4
    branch 28.79, 29.19, 29.01, 29.52; after the last commit 29.14, 29.29 29.2

    Against the master runs alternated with it, the last commit costs about +1.4% (29.2 against 28.8). The first version also evaluated again every 1 that an inexact expression evaluated to, which was +17%. Ablation put that on the 1s: 32.0 s with them, 29.2 s with the 0s alone, 27.8 s with neither. The 1s were dropped. The cost of that is that ln(e^(10^(-60))) stays 0, because the downcasting rounds e^(10^(-60)) onto the integer 1 before the logarithm sees it.

  • The sweep's 275 rows took 0.84 s on master and 1.41 s on the branch. The difference is the rows that are now evaluated again, at up to 820 digits.

Changed answers

All are in BREAKING-CHANGES.md. Two of them are not dropped parts:

  • (-8 + 10^(-90) * i)^(1/3) is now the principal root 1 + 1.732i, where it was the real root -2. The base is not real, so the "odd roots of negative reals are real" convention does not reach it.
  • log(1 + 10^(-60), 2) gains digits in its last places: …680.36066… against master's …680.36524…. Its true value is ln 2 / 10^(-60).

🤖 Generated with Claude Code

Rafael-SOWNet and others added 2 commits December 1, 2026 20:55
A logarithm took ln(1 + t) for the residual of a cancellation against 1
below half the working digits, so ln(1 + 10^(-60)) was 0, and with it
arcoth, arcsch, artanh and arsech past 10^50, which are logarithms of
1 + 1/x. A logarithm whose argument's modulus is within 10^(-25) of 1,
or is a 0 or 1 an inexact expression evaluated to, now evaluates its
arguments again with the digits it cancels; a residual 1 stays 0.

A root of a number with a decimal imaginary part other than 0 is no
longer searched for among the reals, which read a phase of 10^(-60) as
0: sqrt(1 + 10^(-60) i) was 1.

Ci and Si past the series measured the constant pi/2 branch terms they
add and take away as terms of their own size, so Ci(10^60 + i) lost its
imaginary part; a constant is a residual only against its last digits.

AComplexFunctionKeepsASmallPartTest pinned the real part of
ln(1 + 10^(-60) i) as 0; it is 5e-121, and the test now says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Evaluating again every logarithm of a 1 an inexact expression evaluated
to cost limitcheck 15% of its time, measured by ablation: 32.0 s with
the 1s, 29.2 s with the 0s alone, 27.8 s with neither. A 0 is now
evaluated again only where the argument is a sum, where a cancellation
can leave it. ln(e^(10^(-60))), whose argument the downcasting rounds
onto 1, stays 0, and its test row and table row go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.89189% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.65%. Comparing base (e3b3a34) to head (27da256).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 90.16% 3 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2681      +/-   ##
==========================================
+ Coverage   86.64%   86.65%   +0.01%     
==========================================
  Files         346      346              
  Lines       76166    76258      +92     
  Branches    22329    22357      +28     
==========================================
+ Hits        65991    66083      +92     
+ Misses       5503     5502       -1     
- Partials     4672     4673       +1     
Flag Coverage Δ
cpp 37.77% <ø> (ø)
fsharp 32.79% <ø> (ø)
interactive 40.09% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...e/Entity/Continuous/Number/ExponentialIntegrals.cs 93.91% <100.00%> (+0.10%) ⬆️
...uriMath/Core/Entity/Continuous/Number/Operators.cs 89.44% <100.00%> (+0.03%) ⬆️
...Entity/Continuous/Number/TrigonometricIntegrals.cs 93.81% <100.00%> (+0.19%) ⬆️
...nuous/Evaluation.Continuous.Arithmetics.Classes.cs 89.06% <90.16%> (+0.05%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…2677)

The solver writes a trigonometric root as ln(a + b i) / i, with a and b
decimals to the working digits and |a + b i| = 1 to within their
rounding, about 10^(-101). Evaluated again with more digits, a written
decimal is the same decimal, so that distance read as placed, and the
logarithm returned it: the real roots of cos(3x) = sin(2x) and
sin(2x) = sin(3x) came back with imaginary parts near 10^(-101), and
trigcheck dropped them under scaling. Where either argument has a
decimal in it, a distance is known to the working digits alone, and a 0
a sum left is not evaluated again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

arcoth, arcsch, arsech, a square root and Ci drop a part much smaller than their input

1 participant