Skip to content

2.9.0

Latest

Choose a tag to compare

@Rafael-SOWNet Rafael-SOWNet released this 24 Nov 20:31
· 5 commits to master since this release
81dfb49

This release is about answers that hold at every scale. A value below about 1e-50 read as 0 in most of
the special functions, the trigonometric functions of a non-real number, the modulus of a decimal and a decimal
literal. Two constants were equal when they differed by less than 1e-16. And the solvers judged a root, a
residual or a coefficient against a fixed 1e-16 or 1e-7 rather than against the equation's own size. So
(sin(x) - x) * 10^12 = 0 had one root where sin(x) = x has nine, x^2 - 10^(-8) x = 0 lost its root
10^(-8), and sinh(10^(-60)) was 0. Each of these is now decided by the size of what it is about.
Many were found by solving each equation again scaled by 10^±12 to 10^±30 and asking whether the answer
scaled with it.

The solver also answers more equations exactly:

  • an exponential equal to a line, by the Lambert W function;
  • a sum of arctangents, by taking the tangent;
  • an equation between two inverse trigonometric functions, by their squares;
  • a polynomial with non-real coefficients, through its product with its conjugate;
  • an equation in a factorial or the gamma function, by its whole roots and the equation for the rest.

No tier of the Math OS roadmap is completed by this
release (see the note on #746). Its work is on tier 1, a symbolic engine worth building on, which asks for
complete and right answers.

Every changed answer is in BREAKING-CHANGES.md
under 2.9.0 — since 2.8.0
, with the old value, the new one and why. Read it first if your code depends on
an answer. It holds 42 entries, and almost all of them are silent changes, where the call still succeeds and
returns something else. The section opens with what to read first:

  • A set of another type. x + x! = x^3 is { 5 } \/ { x : x + x! = x ^ 3 and not x = 5 }, where it was a
    FiniteSet of 13 decimals that missed real roots. An equation in a factorial or gamma has infinitely many
    roots, so no finite set is its answer (#2538).
  • Throwing and returning. MathS.Parse and Entity.TryParse return a refused call where they threw
    (#2498). norm(v) and beta(x) with one argument
    throw FunctionArgumentCountException, where they parsed as the products norm * v and beta * x
    (#2182).
  • Silent: 10^(-20) = 2 * 10^(-20) is False, where it was True. Two constants are equal only when their
    difference is zero.
  • Silent: a small value is the value. erfc(12) is 1.356…E-64 and gamma(-60.5) is -4.843…E-83, where
    both were 0, and "1.0E-51" parses as itself.
  • Silent: arcosh and arsech take their principal values. arcosh(-2) is 1.317… + πi, where it was
    -1.317… + πi, and the printed form of both changes everywhere.

AssemblyVersion stays 2.0.0.0. The recorded public surface is the same as 2.8.0's, with no additions and no
removals, so code that compiled against 2.8.0 still compiles, and code bound against it still binds.

Wrong answers fixed

Each item has an entry in BREAKING-CHANGES.md with both values.

  • Equations at another scale.
    • An equation multiplied by a number judged its roots against the product: (sin(x) - x) * 10^12 = 0 was
      { 0 }, and (x * (2 - 4x + 2x^2)^(1/3) - 2) * 10^(-12) = 0 had five roots, two of them not roots.
      Both now have the roots of the equation before it was multiplied.
    • A polynomial whose roots are all small was answered with numbers that are not its roots: the five
      answers to x^5 - 3*10^(-120) x + 10^(-150) = 0 were near 4.7e-24, and its roots are 10^(-30) times
      those of x^5 - 3x + 1.
    • A root smaller than 1e-7 was rounded onto 0: x^2 - 10^(-8) x = 0 was { 0 }, and is
      { 0, 1/100000000 }.
    • A rational root was searched for only among rationals of the coefficients' own scale. An equation with a
      modulus lost roots, and one in conj or Im was left unsolved, when its unknown was scaled.
    • x - 10^(-17) * x^0 = 0 was { }: the exact root's condition was decided by rounding.
  • Equations that were answered wrongly at any scale.
    • An exponential equal to a line was answered by Newton's method with decimals: e^x = 2x over the reals
      was a pair of non-real numbers, where it has no real root. e^x = x + 2 is
      union({ -lambertw(n, (-1) / e ^ 2) + -2 }, n in ZZ).
    • x^6 - i x^5 - i x - 1 = 0, which is (x - i)(x^5 - i), was 17 numbers, 13 of them within 1e-6 of
      i. It is its five distinct roots, with the double root i once.
    • arcsin(-2x) = arccos(3x + 2) had one of its two roots.
    • sqrt(x) + x = cos(sqrt(x)) - 1 was { }: the equation was raised to clear a radical the rest of it
      still held (#2495). Its root 0, where the
      radicand is zero, is found beside Newton's, and sin(sqrt(x)) = x has it too.
    • A polynomial with a candidate root that fails it is left unsolved, where it was answered with wrong or
      missing roots.
    • sin(x)/x = 0 and x in [-10; 10] was left as an intersection with a family, and is its six roots
      (#2502).
    • x + x! = x^3 and 2^x = x^2 were each short of a root inside Newton's own search box. The first is
      answered as above. The second, and every real equation like it, now has the conjugate of each non-real
      root it finds (#2546).
  • Values.
    • sin(pi/6 + 10^(-20)) simplified to 1/2: the table of exact values matched an argument within an
      absolute tolerance. A table value is only for its own argument.
    • zeta, polygamma, gamma, erfc, erfi, lambertw, Ei, li, Si, Ci, Shi, Chi, sinh,
      tanh, cot, arcsin, arccos, arctan, and sin, cos, tan and ln of a non-real number each
      dropped a value or a part below about 1e-50, and abs(2.08E-52) was 0.
    • conj(1/12345678901) was a 100-digit decimal, and is 1/12345678901.
    • arcosh of a number with a negative real part came out negated.
  • Integrals. An antiderivative of a small integrand was accepted when its derivative missed the integrand
    by less than 1e-16: 10^(-12) x sqrt(sin(x)^2) was given one whose derivative is not the integrand.
  • The MCP server. am_verify_equal said x / 10^9 and 2 x / 10^9 are equal, and am_check_steps
    accepted the step between them.

Equations solved exactly

  • arctan(x) + arctan(2x) = pi/4 is { (-3 + sqrt(17)) / 4 }, where it was a decimal.
  • arcsin(x) = arccos(x) is { 1/2 * sqrt(2) }.
  • sqrt(2) ln(x) + sqrt(2) ln(x + 1) = 0 is { (-1 + sqrt(5)) / 2 }, and a sum of logarithms or arctangents
    times a large number, which threw OverflowException, is solved as the sum.
  • x! = 24 is { 4 } \/ { x : x! = 24 and not x = 4 }, where it was left unsolved.
  • sum((sqrt(2) * 10^(-20))^n, n, 0, +oo) is summed, where a ratio that small was taken for 0.

Other changes

  • A Gröbner basis computation is bounded by 20,000 steps by default, and no longer by a 60-second clock as well. The clock
    timed work between steps that the budget did not charge, and on a slow runner it discarded a computation that had
    finished in 175 steps (#2544).

Speed

Measured as a pair: d2eaa257, the 3003rd commit and v2.8.0 itself, beside 8987b77d, the 3051st and
2.9.0's last kernel change (#2548). Both were measured twice, interleaved, in one run on one CI runner
(version_performance_control.md,
#2550).

Allocation: no benchmark moved by 1%. The largest moves are SolveHard −0.97%, SimplifyHard −0.92% and
SolveEasyMedium +0.76%.

Timing: no benchmark moved beyond the spread between its own two measurements, except ParseEasy at +2.9%.
Its allocation is the same to the byte in all four measurements, so that is read as the runner.

Packages

  • NuGet: AngouriMath, AngouriMath.FSharp, AngouriMath.Interactive and AngouriMath.Terminal, published
    through NuGet trusted publishing.
  • amcli: the Terminal's archives for Windows, macOS and Linux and its .deb for amd64, arm64 and arm are
    attached below. The AUR package still waits on
    #1660.

Checked in CI

DocSamples now compares each website sample's output with the block its page says it prints, where it
checked only that the sample ran (#2492, #2493).
The Kernel Benchmark Across Key Commits keeps a measurement for every place in its list, so a commit named twice
is measured twice (#2488, #2494).

Known issues

  • P - Q sqrt(2) at n = 160 is still answered wrongly by SolveEquation: its residual is near 1e-123,
    past the hundred digits evaluation works to. Decided for v3
    (#2448,
    #1019).
  • Newton's method is the solver's last resort, and its answer is a finite set that can be short of roots of a
    transcendental equation. Decided for v3
    (#2545,
    #1019 item 11).
  • +oo and -oo are members of RR and CC. Decided for v3
    (#2220).
  • 1/(1/x) simplifies to x, which has a value at x = 0, where the input has none. Decided for v3
    (#1648,
    #2134 row 1).
  • 3 i parses as 3^i (#1503), and a != b
    as a! = b (#1225).
  • (3+4i)^2000 evaluates to +oo + +ooi, and (3+4i)^2000 / (3+4i)^1999 to NaN.
  • Under the real codomain, the roots of polynomial and trigonometric equations are not filtered:
    x^2 = -1 gives { i, -i }, and sin(x) = 2 the family arcsin(2) + 2 pi n.

Pull requests in this release

50 PRs, listed by number below: the 48 merged in v2.8.0..8987b77d8, #2549 and #2550.

Workspace, process, CI and release preparation, with no change to the shipped code: #2491, #2493, #2494, #2549,
#2550.

2491 2493 2494 2496 2497 2499 2500 2503 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516
2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2532 2533 2534 2535 2536 2537
2539 2540 2541 2542 2543 2544 2547 2548 2549 2550