Skip to content

2.8.0

Latest

Choose a tag to compare

@Rafael-SOWNet Rafael-SOWNet released this 16 Nov 13:53
· 29 commits to master since this release

This release is about answers that are complete and answers that do not depend on where they were
asked
. Over the complex numbers an equation with infinitely many roots is now answered with all of them,
as a family indexed by the whole numbers: e^x = 2 was { ln(2) }, a finite set that claims to be every
root. Of 24 equations whose roots were listed and searched for numerically, 17 had incomplete answers on
master just before this change, and none do now
, with no point in any answer that is not a root
(#2319, #2481). That run was made on master,
not on the 2.7.0 package. The values in BREAKING-CHANGES.md's table for this change were measured on 2.7.0.

And a value no longer carries the settings it was first computed under. The parse cache and the caches on
a node, Evaled among them, kept the first answer and gave it back under any settings and on any thread,
so the same string or the same node answered differently depending on where it had been asked first
(#2478,
#2479). Outside a settings scope nothing moves.

The release also adds MathS.AreEqual, an equality question with three answers; systems from a
conjunction and with each parameter's set; a product over a set and a prime factorisation; the total and
the partial derivative in an unknown function; the zeta and beta functions, the p-norm, and the gradient,
divergence and curl; shader source; dimensional analysis of a formula; and Unicode output. A new corpus, Modenov's Problems in Geometry,
checks 642 computations from a book, with the book's own errata as rows the library must not confirm: 480
are solved, and none is wrong (#2472). 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
answers and a measured corpus. It also touches tier 4's budgets as values: a set MathS.Settings.Budget
now acts by the role of the site that reads it (#2475).

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

  • A family of roots is a set of another type. Solve answers e^x = 2, sin(x) = 1/2, tan(x) = 1,
    x mod 4 = 1 and x e^x = 2 with an indexed union, union({ ln(2) + 2 * pi * i * n }, n in ZZ), where it gave a
    FiniteSet, with a free n_1 for the periodic ones. Code that takes the answer apart as a FiniteSet gets
    another node. The n = 0 member of each family is the root the finite set held. Over the reals an
    exponential equation keeps its one root, and a family met with a bounded interval is listed:
    sin(x) = 1/2 and x in [0; 2pi] is { pi / 6, pi - pi / 6 } (#2481).
  • Names that read differently. factorization(…) and primefactors(…) are functions, where they were
    products. factorize(…), nextprime(…), divisors(…), φ(…) and ϕ(…) are refused by name, each with
    what to write instead, and so are the one-argument gradient(…), divergence(…) and curl(…), which
    now take the variables as their second argument. partialderivative(…) with one argument is an arity
    error. Each was a product on 2.7.0, and each name without a bracket is still a variable (#2453, #2471,
    #2476, #2477).
  • Silent: a value cached under one setting is no longer given back under another.
    (1/3 - 0.33333333333333333333).Evaled, asked first inside PrecisionErrorZeroRange.Set(1e-10), was 0
    at the defaults afterwards, and is 3.333…E-21. The same held for InnerSimplified, DomainCondition,
    a matrix's determinant, inverse and rank, an interval's ends, and a string parsed by FromString
    (#2480, #2483).
  • MathS.NumberTheory.Factorize throws InvalidNumberException for 0 and negative integers, where it
    answered the empty list (#2468).

zeta(…), beta(…) and norm(…, …) also parse now, where they were an error, and dot(a, b) and
cross(a, b) of names are nodes, where they were refused (#2455, #2476, #2486).

AssemblyVersion stays 2.0.0.0. The recorded public surface has 313 additions and no removals, so
code that compiled against 2.7.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.

  • Definite integrals.
    • An antiderivative that crosses a branch cut off the real line was not counted, so the integral was off
      by a multiple of pi: integral(1/(1+(t-3i)^2), t, -oo, +oo) was pi, where it is 0, and over
      [-2, 2] it was 2.8198, where it is -0.3218. A crossing that cannot be placed is now left as written
      (#2460, #2465).
    • integral(1/(t^2+y^2), t, -1, 1) was -2 for y = 0, a negative value for a positive integrand whose
      integral diverges. It is +oo there
      (#2461, #2465).
  • Equations and systems.
    • Two periodic unknowns of a system shared one parameter: sin(x) = 1/2, sin(y) = 1/2 was answered with
      x - y a whole number of periods, which leaves out (pi/6, 13 pi/6). Each independent parameter now has
      its own name (#212, #2473).
    • sin(e^x) = 0 had ln(0) among its roots, and over the reals the logarithms of negative numbers
      (#2319, #2481).
    • A rational guessed for a root was checked inside the 1e-7 zero range it was guessed under, so
      x^2 - 3x - 1e-24 was { 0, 3 }, where its roots are about -3.3e-25 and 3 + 3.3e-25.
      x^3 - x - 1e-20 was { -1, 1, 0 }, and the eigenvalues of [[1, 1], [1, 1.000000000000000000001]]
      were { 0, 2 }. The same check made sqrt(9 + 4/10^24) evaluate to 3. A guess is now kept only where
      it is a root at the working precision
      (#2482, #2485).
    • SolveEquation solved under a zero tolerance of 1e-12, so a coefficient that nearly cancels was read
      as zero. With P + Q sqrt(2) = (1 + sqrt(2))^70, x^2 + (P + Q sqrt(2)) x - 3 was { -2P }, which
      leaves -2. It solves at the library's tolerance now, and an exact root that an interval shows is not a
      root leaves the equation unsolved (part of
      #2448, #2456).
    • The system y^2 - 2, x^2 + (P - Q y) x - 3 was answered with the one row [-2P, -sqrt(2)], which is no
      solution, and its four solutions were lost. It is declined now, and for exponents 20 to 60 answered with
      its four rows (#2446, #2452, #2456).
  • A derivative over an expression, with a value put in. At x = 2, derivative(x^3, x^2) was 0,
    because the value went into x^3 and asked for derivative(8, x^2). It is 3, and integral(x, x^2) is
    16/3 + C, where it was C + 2x^2 (#230, #2477).
  • Values cached under other settings. A string parsed once came back from the cache under any later
    settings: "1e-20" parsed at the defaults stayed 1E-20 inside PrecisionErrorZeroRange.Set(1e-10),
    where a fresh parse gives 0 (#2478, #2480).
    Evaled and its sibling caches did the same on a node
    (#2479, #2483).
  • MathS.NumberTheory.Factorize answered 0, -1 and -12 with the empty list, the factorisation of 1. It
    throws InvalidNumberException now (#2466,
    #2468).
  • A bound index reported free. FreeVariables of union({2 pi k + y}, k in ZZ) listed k, and
    DomainCondition of a set builder named the internal %1
    (#2458, #2464).

Equations and systems

  • MathS.SolveSystem solves a conjunction of equations for several variables: x + y = 3 and x - y = 1
    is [[2, 1]]. A conjunct that is not an equation makes the call null, since solving the rest would
    answer another question (#2450, #2459).
    MathS.Equations reads such a conjunction as its equations, where it answered null (#2463).
  • SolveWithParameters and MathS.SolveSystemWithParameters answer the rows with each parameter and
    the set it ranges over: (n_1, ZZ) for a period, (t_1, [0, 1)) for a floor, (t_1, CC) for a free
    unknown (#212, #2473).
  • Families of roots for exponential, trigonometric, remainder and Lambert W equations, as indexed unions
    that bind their index and decide membership: 4 pi in union({ 2 pi n }, n in ZZ) is True.
    (-2)^x + 4^x = 0 is the exact family i pi (2n + 1) / (i pi - ln(2)), where 2.7.0 gave nine 64-digit
    decimals. Under forall, a whole number of periods comes out of an exponential as out of a sine
    (#2319, #2481).

Calculus

  • The total derivative in an unknown function. derivative(x * f, f), with f standing for
    apply(f, x), is f / f' + x, where it was left unevaluated
    (#230, #2477).
  • partialderivative(L, q), with the other slots held fixed, as in the Euler–Lagrange equation:
    partialderivative(f^2 + f'^2, f) is 2f. Over a variable it is derivative. MathS.PartialDerivative
    builds it (#2477).
  • A definite integral with a parameter takes the limit at an infinite bound:
    integral(e^(-(t-y)^2), t, -oo, +oo) is sqrt(pi), where it was a difference of erfs at infinities
    (#2451, #2462).
  • The gradient, divergence and curl: gradient(f, [x, y, z]), divergence(F, [x, y, z]) and
    curl(F, [x, y, z]) are computed into derivatives when parsed, with the variables given as jacobian
    takes them. curl is in three variables only. There is no grad or div
    (#2182, #2476).

New functions and nodes

Name PR
zeta(s), zeta(s, a) (riemannzeta, hurwitzzeta) the Riemann and Hurwitz zeta functions: exact at 0, at the even and the negative whole s, evaluated to the working precision elsewhere, real or complex #2476
beta(a, b) the beta function, exact at a whole argument and at two half-whole ones #2486
norm(v, p) the p-norm of a vector, p >= 1 or +oo; norm(v, 2) is abs(v) #2486
product(f, x in S) a product over a set, multiplied out where sum(f, x in S) adds up; MathS.Product(f, x, S) #2467
factorization(n), primefactors(n) the prime factorisation of a positive integer, as a map from prime to exponent, and its support; product(p ^ valuation(n, p), p in primefactors(n)) is n #2471
partialderivative(L, q) the partial derivative #2477
dot(a, b), cross(a, b) of names nodes, computed once both operands are vectors, and compiled over double[] and Complex[] #2455
gradient, divergence, curl see Calculus #2476

zeta(1/2 + 14.134725141734693790457251983562i) agrees with mpmath to 100 digits, and 300 random points
at 100 digits agree to a relative error of 4.9e-100 (#2476). The names the library has no node for yet are
refused with what to write instead (#2453).

Equality, output and compilation

  • MathS.AreEqual(a, b, budget) answers Equal, NotEqual or Unknown. NotEqual comes with a point
    where the two differ, and Unknown is never a negative. Equal comes from the e-graph, under the rules of
    the soundness you allow. On 83 true pairs from the simplification tests, 18 are proved with sound rules
    alone and 71 with rules sound under assumptions; the same pairs made false are 83 NotEqual. The MCP tool
    is am_are_equal (#1251, #2447).
  • MathS.Settings.UnicodeOutput, off by default, prints x² − 1 ≤ π, and the parser reads every glyph
    it prints. LaTeX and JSON do not change
    (#1242, #2469).
  • MathS.Shaders.Hlsl and Glsl print expressions as straight-line shader source, computing what
    Compile<double, …> computes, except at a zero divisor, where the shader gives ±inf. See
    Shaders.md
    (#2293, #2470).
  • MathS.Dimensions.Of(expr, dims) says whether a formula is dimensionally consistent, given the
    dimension of each variable: Consistent with the formula's dimension, Inconsistent with the
    subexpression and why, or Undetermined, never a guess. sqrt(2 g h) is L T^-1, and h + g t is
    inconsistent. DimensionlessGroups gives the Buckingham π groups: for a pipe's ρ, v, d and μ,
    mu / (rho * v * d). See
    Dimensions.md
    (#2292, #2490).
  • gcd, lcm and beta compile, gcd and lcm exactly at whole arguments and NaN at any other. A
    refused binder's message says to compile .Evaled or Simplify() instead (#2443, #2486).
  • A set MathS.Settings.Budget caps a budget passed as an argument, where it replaced it, and only tightens
    the perfect-square proof's own limit (#2454,
    #2475).
  • Real.CreateWithoutDowncasting makes a Real without a settings scope (#2457).

Speed

Measured as a pair: 842e8e95, the 2943rd commit and 2.7.0's last kernel change, beside 27aba15f, the
2997th and 2.8's (#2485), in one run on one CI runner
(version_performance_control.md,
#2489). The run's own control, each commit
measured twice, was lost: the second measurement overwrote the first
(#2488). Measured across runs instead, the
allocation of each column agrees within 0.1%. Dimensional analysis (#2490) came after the 2997th; on its own gate run
every benchmark's allocation is unchanged to within 0.1%, so the pair stands for the release commit.

Allocation, gated rows:

allocation 2943rd → 2997th moved by
SimplifyEasy −64.75% #2474 −63.6%, #2483 −3.4%
SimplifyHard −16.27% #2474 −11.7%, #2483 −5.2%
SolveEasy −8.30% #2456 −1.1%, #2474 −3.3%, #2483 +9.1%, #2485 −12.0%
SolveHard −4.53% #2456 −10.6%, #2474 −3.9%, #2481 +10.1%, #2483 +1.2%
SolveMediumHard +2.81%, the only gated row up #2456 −1.2%, #2457 −0.6%, #2474 −5.7%, #2481 +4.2%, #2483 +6.6%
Derivate −5.81% #2474 −1.5%, #2483 −4.1%
EvalPolynomialFresh −5.04% #2474 −1.5%, #2483 −3.5%

The rise in SolveMediumHard and the steps up in SolveHard and SolveEasy come from complete families
of roots (#2481) and a residual check that now really runs without downcasting (#2483). Walking an
expression's nodes without allocating per node (#2474) is most of the fall.

Timing has no in-run control, so it is recorded as questions. SimplifyEasy −41% and SimplifyHard
−13.5% moved with their allocation. SolveHard +17.1%, SolveMediumHard +10.5% and SolveMedium −12.0%
are not settled: separate runs put SolveHard the other way, at 118.3 ms on the 2943rd and 68.4 ms on the
2997th.

Packages

  • NuGet: AngouriMath, AngouriMath.FSharp, AngouriMath.Interactive and AngouriMath.Terminal, published
    through NuGet trusted publishing, with no stored key (#2444, #2445).
  • amcli: the Terminal's archives for Windows, macOS and Linux and its .deb for amd64, arm64 and arm are
    attached below, and the Nix flake moves to 2.8.0 with the pull request the release workflow opens for its release.json. The AUR package still waits on
    #1660.
  • The round trip of the new LaTeX through CSharpMath is owed for this release
    (#2484): \prod_{x \in S},
    \frac{\partial}{\partial q}, \operatorname{\zeta}, \operatorname{B}, \left\| v \right\|_{p} and a
    factorisation's product form, which reads back as the number by its notation.

Checked in CI

ModenovCorpus runs P. S. Modenov's Problems in Geometry (Mir, 1981) as 642 rows: each row's own claim is
checked at exact points first, and the run fails on a wrong answer, an erratum the library confirms, or any
change in the list of verdicts. On master e19802f45: 480 solved, 56 refused, 106 unsolved, 0 wrong
(#2153, #2472).

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).
  • Membership in a family is not always decided: 3 in union({1 + 3n}, n in ZZ) is left as written.
  • +oo and -oo are members of RR and CC. Decided for v3
    (#2220).
  • A quotient by a reciprocal, 1/(1/x), simplifies to an answer with 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).
  • 2 + 2^(-100) = 2 is True, because numbers are compared within a tolerance
    (#1376,
    #1019 §10).
  • With downcasting off, EvalNumerical loses values near the ends of the exponent range
    (#1498).
  • (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

34 PRs, listed by number below: the 32 merged in v2.7.0..333c213b2, #2489 and #2490.

Workspace, process, CI and release preparation, with no change to the shipped code: #2442, #2444, #2445,
#2472, #2487, #2489.

2442 2443 2444 2445 2447 2452 2453 2455 2456 2457 2459 2462 2463 2464 2465 2467 2468 2469 2470 2471
2472 2473 2474 2475 2476 2477 2480 2481 2483 2485 2486 2487 2489 2490