Repository navigation
Releases
3.8.3
Gathered for the next release; rename to its version before tagging. Everything on main
since 3.8.2 (which was cut from a maintenance branch and carried one fix) is here. MiMa finds no
binary change against 3.8.2 so far, so the number is decided at release time from its report.
New in the library and at the prompt
- Optimisation, a new package.
stationarylists every stationary point of a polynomial
objective (elimination with case splits, an exact Gröbner basis where that gives up) and the
REPL classifies each as a local minimum, maximum or saddle;convexproves or refutes
convexity;lagrangeandkkthandle equality and inequality constraints. Numerically:
minimize(gd,newton,bfgs,pbfgs, the method always named),qpfor convex
quadratic programs (positive definite or semidefinite),lsqfitfor nonlinear least squares and
curve fits,nlpfor constrained nonlinear programs (sqp,auglag), andlp, an exact linear
program solver. Every numeric answer is certified; an uncertified one is declined with the
reason as a note. - Control and MPC.
mpcMatrices(prediction matrices),linearize(a nonlinear model at an
operating point),arx/arx2tf/arx2ss(identification from data, several inputs, and
several coupled outputs),dlsim(discrete simulation),dare,dlqr,dlyap,kalmanGain,
kalmanStep(the stabilising solution only), and at the prompttfpoles,tfzeros,isStable,
isStableDiscrete,stateSpace,c2d(now alsofoh,impulse,matched,forward,
backward, and prewarped Tustin),controllable,observable,ctrb,obsv,routhTableand
acker. The browser draws a root locus (rlocus). - Matrices.
chol, block matrices (hcat,vcat,blkdiag,repmat,kron,ones,
submatrix),svd,pinv,rank,cond,nullspace,orth,norm(1, 2, inf,froor any
pfor a vector),dot,cross,traceandsize.eigennow answers random dense matrices
(a Francis double-shift QR iteration replaced one that declined most of them from 3×3 up). - Statistics and probability. Bayesian inference (
betadist,gammadist,bayes,
posterior), seeded sampling (draw, reproducible across the JVM and the browser) andprbs;
ridge and weighted regression; recursive least squares (rls);median,sortand sample
quantile; two-sample, proportion, variance and independence tests andanova; the
geometric, hypergeometric and F families;bincounts, andhistin the browser. - Calculus, equations and more.
odesolves linear systems by the matrix exponential and
integrates time-varying and nonlinear systems with a certified error, andodeStep/odeSolve
expose the integrator; Taylor coefficients come from power-series arithmetic (faster, and exact
on exact input);maximum,minimum,max,min,clamp,softplus; interval arithmetic
with rigorous bounds,[lo, hi];dft,idft,conv;cnf,dnfand the defuzzification
methods at the prompt;solveSystemwith more equations than unknowns, the equations also
written as a column[[eq1], [eq2]], every refusal with its reason. - Exact arithmetic reaches further. Calculus stays exact on exact input and on names bound to
exact values;lu(a singular matrix included),A^n,jordanwith rational eigenvalues,
Sylvester and Lyapunov equations,solveSystemandstationary's rational points are exact; in
exact mode two values are equal when they agree to the working precision, with a note saying so;
square roots stay exact surds, shown√13and typed back with√;rationalize(x)makes a
decimal exact on request, and the REPL offers it when an exact input came back as decimals that
look exact. - Library API. Every work and size budget is configurable through
Environment.limits
(env.withLimit(Limit.X, n)); the REPL and the browser keep the defaults.compiletakes
several variables or a whole matrix.cli.ShareEncoding, the run-link format, is public, and
Session.figuredraws the drawing commands as an SVG image. - REPL and browser. Under
pretty onanswers use the fewest brackets and a binary minus
(4 - k*k); a definition whose formula already computes echoes its current value on a= …
line, and an exact matrix assignment echoes the matrix; the browser addscurve,arrows,
polygonand layered figures (;), and enforces a Content-Security-Policy.
Answers that changed — re-check results that depended on these:
fourieris the two-sided transform and declines where the integral diverges
(fourier(exp(-t), t, w)declines; the old one-sided answer isfourierCausal).eigen,eigand the numericjordanlist eigenvalues by real part, then imaginary part.expandwrites a one-variable polynomial by descending degree and divides a sum by a numeric
divisor term by term.minimizeanswers only a minimiser, never a maximum or saddle;stationarycalls an extremum
local.- A numeric
limitthat only seemed to converge declines (limit(sin(x)/1e7, x, inf)). jacobianandhessianare Cartesian only, andgrad/hessianrefuse a vector argument;
eigrefuses a defective matrix instead of returning dependent eigenvectors.differentiable(step(x), x)isx != 0(it wasfalse).- A computed fraction, imaginary or negative number in a divisor or a power is printed bracketed,
so a printed answer types back as itself; exact square roots print√2where they printed
decimals (:savewrites them as(2^(1/2))), and(2^(1/2))^2 == 2is exactly true, so its
working-precision note no longer appears;rationalize(x)defaults to the digits that give the
small fraction; aqrof dependent columns says why it stays unevaluated. solveSystemdeclines an over-determined numeric system whose columns are nearly dependent.- Very large exact numbers are now held to measured budgets: an exact
+ − × ÷or matrix power
past them stays unevaluated instead of running for minutes — a quotient of two large integers
included, and the exactmean,variance,det,inv,luandsolveSystemover a long or
large-denominator input. A sum of two large integers, refused before, is now computed. limitlooks at the scales an expression is written with:limit(exp(-1e-20/x), x, 0, +)is0
(it was1.0), and limits whose two sides disagree below the old sample points, or whose value
shows only past the old samples at infinity, now decline instead of answering wrongly.minimizerefuses a maximum hidden below its old witness step, and answers steep, flat or shifted
objectives it declined (1e40*(x-1)^2,(x-1)^2 - 1e101). Alaurentexpansion no longer puts a
pole at a regular point;solveSystemsolves a system with two radicals in any units, and declines,
rather than fits untested, a large over-determined one whose rank it cannot test.- In exact mode
limitat a surd point, a limit that is a surd, sums and products of exact limits at
infinity, andlaplace/invlaplacewith a shifted step keep their exact answers. - In exact mode the working precision keeps its digits for a small value:
exp(-100)is
3.7201E-44(it was0) andln(1 + 10^-40)is1.0E-40. As a consequencesin(pi)shows the
sine ofpi's approximation, a number near10^-43, where it showed0;sin(pi) == 0is still
true, with its working-precision note.
Fixes. Dozens of thresholds that silently assumed unit-sized input are now relative to the
problem's own scale (rank, pivots, roots, degrees, certificates), so the same question in other
units gets the same answer. The 2026-10-23 audit's edge cases — wrong answers and wrong refusals
across limits, inequalities, transforms, statistics and the math editor — are fixed. :save and
share links write every value at full precision and reload it in its own tier. Named exact
matrices multiply exactly, and a matrix is never used as a scale factor. Nothing deeper than the
browser can walk is accepted or built. A large matrix literal parses several times faster.
hist on a sample spanning the whole number range draws its bins, or says why it cannot; the
browser's :save/:load answer when storage is blocked instead of failing silently.
Supply chain. MathLive is at 0.111.3, past 0.111.2's security release (the math editor's
virtual keyboard accepts messages from its own origin only), the floor its advisories require. The release
build overrides BouncyCastle to 1.86, clear of the 1.78.1 advisories. Workflows hold no more
permission or stored credential than their steps need. The architecture diagram is exported as
GraphML for Gephi and yEd under a standing check, and an eighth guard keeps the grammar's words
reserved; three guards were tightened where they could be passed (HTML case, titled links, string
literals).
3.8.2
A correctness fix. Upgrade.
- A leading minus now negates only the first term. Since the grammar's first release, a sign
at the start of an expression applied to the whole sum:-1 - 1evaluated to0,-x + yto
-(x + y), and-2*x - 3to-2x + 3. It now reads as written everywhere an expression is
parsed — the REPL, the browser,Parser.parse, function arguments, equations and inequalities.
solve(-x + 1 = 0, x)answersx = 1(it answeredx = -1), andsolve(-x^2 + 4 > 0, x)
answers-2 < x < 2(it answeredfalse). An expression with a single leading term —-x,
-3k,-(a + b),-2^2— parses exactly as before.
Saved sessions and share links can change meaning, and that includes ones Leonardo wrote.
A line such asf := -x + yin a:saved script or a shared link was evaluated wrongly by
every earlier release and is evaluated correctly by this one. The library's own output was
affected too: a sum beginning with a negative number — whichsimplify,consolidateand the
exact tier can produce — prints as(-3.0 + x), and earlier releases read that back as
-(3 + x). Re-check any result computed from such a line.
Binary compatibility. Both artifacts are binary-compatible with 3.8.1; MiMa finds no change.
3.8.1
3.8.0
On Maven Central. The browser release: Leonardo runs in a web page, renders LaTeX, and comes
with a course of lessons.
- Browser REPL — the library and the REPL are cross-built for Scala.js, and the full REPL
runs at/appwith nothing to install: plotting
(plot,points,bode,nyquist), shareable links that carry a whole session in the URL, a
settings panel, and:save/:loadbacked by browser storage. Every GitHub Release now
attaches the app asleonardo-app-<version>.zip, which runs from any folder. The Maven
artifacts remain JVM-only. - LaTeX — a new
latexpackage renders any expression as math-mode LaTeX (ToLatex). In the
REPL,latex onoffers each result's LaTeX on a second channel, which the browser typesets
beside the answer; the printed text itself never changes. - Visual math editor — in the browser, a formula can be entered in a math field. Integrals,
derivatives, limits, sums, products, binomials and|x|convert into the grammar, and anything
the grammar does not know is refused rather than guessed. - New in the language —
abs(absolute value and complex modulus, exact on exact input);
finitesum/product; integral anddefuzzlimits that accept any expression
(integral(sin(x), x, 0, 2*pi)used to be a parse error); andcontrol.frequencyResponse/
nyquistSweep, log-spaced sweeps with the phase unwrapped. - Lessons — twenty lessons in two branches, at the prompt and in your program, every
example executed when the site is built. Each transcript carries a link that opens the browser
REPL with that session already loaded. - Fixes. Saved sessions and share links now reproduce definitions exactly — a constant inside
a definition was written at five decimals, and a long exact rational as a decimal, so a
reloaded session could compute different numbers.simplifyandexpandreduce derivatives
and integrals, as plain evaluation always did. Session precision andprettynow reach
composite results, not only bare values, andprettyandlatexno longer hide each other. A
plot reports the samples it had to drop, and refuses a grid that would miss an expression
defined only at whole numbers.exact precisionis capped at 1000 digits. A call to a function
the grammar does not know, such assqrt(x), is now flagged instead of being read silently as
a product. - Supply chain and maintenance. Repository guards rewritten in Scala, plus a new one that
fails the build on a broken documentation link; JVM dependencies covered by security-advisory
alerts;scala-parser-combinatorsheld at 2.4.0, because 2.5.0 would raise the minimum JDK
from 8 to 17 for every consumer; Scala 3.3 LTS, JLine 3 and sbt 1 pinned against unreviewed
major upgrades.
Binary compatibility.
leonardois binary-compatible with 3.7.2 — MiMa finds no change. The
REPL artifactleonardo-replis not, in exactly one place: splitting its source for the
Scala.js build removed the compiler-generated classcli.Repl$package. No source change is
needed, but code compiled against 3.7.2's REPL artifact must be recompiled — which is why this
is 3.8.0 rather than 3.7.3, chosen from MiMa's report as 3.7.2's note promised.