Skip to content

Releases

3.8.3

Choose a tag to compare

@github-actions github-actions released this 01 Nov 23:24

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. stationary lists 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; convex proves or refutes
    convexity; lagrange and kkt handle equality and inequality constraints. Numerically:
    minimize (gd, newton, bfgs, pbfgs, the method always named), qp for convex
    quadratic programs (positive definite or semidefinite), lsqfit for nonlinear least squares and
    curve fits, nlp for constrained nonlinear programs (sqp, auglag), and lp, 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 prompt tfpoles, tfzeros, isStable,
    isStableDiscrete, stateSpace, c2d (now also foh, impulse, matched, forward,
    backward, and prewarped Tustin), controllable, observable, ctrb, obsv, routhTable and
    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, fro or any
    p for a vector), dot, cross, trace and size. eigen now 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) and prbs;
    ridge and weighted regression; recursive least squares (rls); median, sort and sample
    quantile; two-sample, proportion, variance and independence tests and anova; the
    geometric, hypergeometric and F families; bincounts, and hist in the browser.
  • Calculus, equations and more. ode solves linear systems by the matrix exponential and
    integrates time-varying and nonlinear systems with a certified error, and odeStep / 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, dnf and the defuzzification
    methods at the prompt; solveSystem with 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, jordan with rational eigenvalues,
    Sylvester and Lyapunov equations, solveSystem and stationary'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 √13 and 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. compile takes
    several variables or a whole matrix. cli.ShareEncoding, the run-link format, is public, and
    Session.figure draws the drawing commands as an SVG image.
  • REPL and browser. Under pretty on answers 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 adds curve, arrows,
    polygon and layered figures (;), and enforces a Content-Security-Policy.

Answers that changed — re-check results that depended on these:

  • fourier is the two-sided transform and declines where the integral diverges
    (fourier(exp(-t), t, w) declines; the old one-sided answer is fourierCausal).
  • eigen, eig and the numeric jordan list eigenvalues by real part, then imaginary part.
  • expand writes a one-variable polynomial by descending degree and divides a sum by a numeric
    divisor term by term.
  • minimize answers only a minimiser, never a maximum or saddle; stationary calls an extremum
    local.
  • A numeric limit that only seemed to converge declines (limit(sin(x)/1e7, x, inf)).
  • jacobian and hessian are Cartesian only, and grad/hessian refuse a vector argument;
    eig refuses a defective matrix instead of returning dependent eigenvectors.
  • differentiable(step(x), x) is x != 0 (it was false).
  • 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 √2 where they printed
    decimals (:save writes them as (2^(1/2))), and (2^(1/2))^2 == 2 is exactly true, so its
    working-precision note no longer appears; rationalize(x) defaults to the digits that give the
    small fraction; a qr of dependent columns says why it stays unevaluated.
  • solveSystem declines 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 exact mean, variance, det, inv, lu and solveSystem over a long or
    large-denominator input. A sum of two large integers, refused before, is now computed.
  • limit looks at the scales an expression is written with: limit(exp(-1e-20/x), x, 0, +) is 0
    (it was 1.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.
  • minimize refuses 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). A laurent expansion no longer puts a
    pole at a regular point; solveSystem solves 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 limit at a surd point, a limit that is a surd, sums and products of exact limits at
    infinity, and laplace/invlaplace with 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 was 0) and ln(1 + 10^-40) is 1.0E-40. As a consequence sin(pi) shows the
    sine of pi's approximation, a number near 10^-43, where it showed 0; sin(pi) == 0 is 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

Choose a tag to compare

@github-actions github-actions released this 06 Oct 09:28

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 - 1 evaluated to 0, -x + y to
    -(x + y), and -2*x - 3 to -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) answers x = 1 (it answered x = -1), and solve(-x^2 + 4 > 0, x)
    answers -2 < x < 2 (it answered false). 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 as f := -x + y in 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 — which simplify, consolidate and 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

Choose a tag to compare

@github-actions github-actions released this 02 Oct 19:16

Full Changelog: 3.8.0...3.8.1

3.8.0

Choose a tag to compare

@github-actions github-actions released this 02 Oct 12:08

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 /app with nothing to install: plotting
    (plot, points, bode, nyquist), shareable links that carry a whole session in the URL, a
    settings panel, and :save / :load backed by browser storage. Every GitHub Release now
    attaches the app as leonardo-app-<version>.zip, which runs from any folder. The Maven
    artifacts remain JVM-only.
  • LaTeX — a new latex package renders any expression as math-mode LaTeX (ToLatex). In the
    REPL, latex on offers 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);
    finite sum / product; integral and defuzz limits that accept any expression
    (integral(sin(x), x, 0, 2*pi) used to be a parse error); and control.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. simplify and expand reduce derivatives
    and integrals, as plain evaluation always did. Session precision and pretty now reach
    composite results, not only bare values, and pretty and latex no 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 precision is capped at 1000 digits. A call to a function
    the grammar does not know, such as sqrt(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-combinators held 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. leonardo is binary-compatible with 3.7.2 — MiMa finds no change. The
REPL artifact leonardo-repl is not, in exactly one place: splitting its source for the
Scala.js build removed the compiler-generated class cli.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.