Repository navigation
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.
Solveanswerse^x = 2,sin(x) = 1/2,tan(x) = 1,
x mod 4 = 1andx e^x = 2with an indexed union,union({ ln(2) + 2 * pi * i * n }, n in ZZ), where it gave a
FiniteSet, with a freen_1for the periodic ones. Code that takes the answer apart as aFiniteSetgets
another node. Then = 0member 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(…)andprimefactors(…)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-argumentgradient(…),divergence(…)andcurl(…), 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 insidePrecisionErrorZeroRange.Set(1e-10), was0
at the defaults afterwards, and is3.333…E-21. The same held forInnerSimplified,DomainCondition,
a matrix's determinant, inverse and rank, an interval's ends, and a string parsed byFromString
(#2480, #2483). MathS.NumberTheory.FactorizethrowsInvalidNumberExceptionfor 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 ofpi:integral(1/(1+(t-3i)^2), t, -oo, +oo)waspi, where it is0, 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-2fory = 0, a negative value for a positive integrand whose
integral diverges. It is+oothere
(#2461, #2465).
- An antiderivative that crosses a branch cut off the real line was not counted, so the integral was off
- Equations and systems.
- Two periodic unknowns of a system shared one parameter:
sin(x) = 1/2, sin(y) = 1/2was answered with
x - ya 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) = 0hadln(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-7zero range it was guessed under, so
x^2 - 3x - 1e-24was{ 0, 3 }, where its roots are about-3.3e-25and3 + 3.3e-25.
x^3 - x - 1e-20was{ -1, 1, 0 }, and the eigenvalues of[[1, 1], [1, 1.000000000000000000001]]
were{ 0, 2 }. The same check madesqrt(9 + 4/10^24)evaluate to3. A guess is now kept only where
it is a root at the working precision
(#2482, #2485). SolveEquationsolved under a zero tolerance of1e-12, so a coefficient that nearly cancels was read
as zero. WithP + Q sqrt(2) = (1 + sqrt(2))^70,x^2 + (P + Q sqrt(2)) x - 3was{ -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 - 3was 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).
- Two periodic unknowns of a system shared one parameter:
- A derivative over an expression, with a value put in. At
x = 2,derivative(x^3, x^2)was0,
because the value went intox^3and asked forderivative(8, x^2). It is3, andintegral(x, x^2)is
16/3 + C, where it wasC + 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 stayed1E-20insidePrecisionErrorZeroRange.Set(1e-10),
where a fresh parse gives0(#2478, #2480).
Evaledand its sibling caches did the same on a node
(#2479, #2483). MathS.NumberTheory.Factorizeanswered 0, -1 and -12 with the empty list, the factorisation of 1. It
throwsInvalidNumberExceptionnow (#2466,
#2468).- A bound index reported free.
FreeVariablesofunion({2 pi k + y}, k in ZZ)listedk, and
DomainConditionof a set builder named the internal%1
(#2458, #2464).
Equations and systems
MathS.SolveSystemsolves 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 callnull, since solving the rest would
answer another question (#2450, #2459).
MathS.Equationsreads such a conjunction as its equations, where it answerednull(#2463).SolveWithParametersandMathS.SolveSystemWithParametersanswer the rows with each parameter and
the set it ranges over:(n_1, ZZ)for a period,(t_1, [0, 1))for afloor,(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)isTrue.
(-2)^x + 4^x = 0is the exact familyi pi (2n + 1) / (i pi - ln(2)), where 2.7.0 gave nine 64-digit
decimals. Underforall, 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), withfstanding for
apply(f, x), isf / 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)is2f. Over a variable it isderivative.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)issqrt(pi), where it was a difference oferfs 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 asjacobian
takes them.curlis in three variables only. There is nogradordiv
(#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)answersEqual,NotEqualorUnknown.NotEqualcomes with a point
where the two differ, andUnknownis never a negative.Equalcomes 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 83NotEqual. The MCP tool
isam_are_equal(#1251, #2447).MathS.Settings.UnicodeOutput, off by default, printsx² − 1 ≤ π, and the parser reads every glyph
it prints. LaTeX and JSON do not change
(#1242, #2469).MathS.Shaders.HlslandGlslprint 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:Consistentwith the formula's dimension,Inconsistentwith the
subexpression and why, orUndetermined, never a guess.sqrt(2 g h)is L T^-1, andh + g tis
inconsistent.DimensionlessGroupsgives the Buckingham π groups: for a pipe's ρ, v, d and μ,
mu / (rho * v * d). See
Dimensions.md
(#2292, #2490).gcd,lcmandbetacompile,gcdandlcmexactly at whole arguments andNaNat any other. A
refused binder's message says to compile.EvaledorSimplify()instead (#2443, #2486).- A set
MathS.Settings.Budgetcaps a budget passed as an argument, where it replaced it, and only tightens
the perfect-square proof's own limit (#2454,
#2475). Real.CreateWithoutDowncastingmakes aRealwithout 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.InteractiveandAngouriMath.Terminal, published
through NuGet trusted publishing, with no stored key (#2444, #2445). amcli: the Terminal's archives for Windows, macOS and Linux and its.debfor 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 itsrelease.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)atn = 160is still answered wrongly bySolveEquation: its residual is near1e-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. +ooand-ooare members ofRRandCC. Decided for v3
(#2220).- A quotient by a reciprocal,
1/(1/x), simplifies to an answer with a value atx = 0, where the input has
none. Decided for v3 (#1648,
#2134 row 1). 3 iparses as3^i(#1503), anda != b
asa! = b(#1225).2 + 2^(-100) = 2isTrue, because numbers are compared within a tolerance
(#1376,
#1019 §10).- With downcasting off,
EvalNumericalloses values near the ends of the exponent range
(#1498). (3+4i)^2000evaluates to+oo + +ooi, and(3+4i)^2000 / (3+4i)^1999toNaN.- Under the real codomain, the roots of polynomial and trigonometric equations are not filtered:
x^2 = -1gives{ i, -i }, andsin(x) = 2the familyarcsin(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