Ten bounded lessons replay retained numerical evidence. Every success and failure remains fully readable without JavaScript or animation.
roots · scalar_root
A sign change is evidence, not the answer
Brent rapidly solves cos(x)=x and a separate bisection run checks the candidate, while the same stopping rule is rejected on a discontinuity by independent residual validation.
Learning objectives
Read a shrinking bracket from retained solver evidence.
Separate a solver stopping status from independent mathematical validation.
Compare Brent and bisection using retained accuracy and work measurements.
Method assumptions
Brent requires a finite sign-changing bracket.
Bisection uses the same bracket assumptions but guarantees halving steps.
The bracket-to-root implication requires continuity.
Complete Sage.js example
import math
from sagejs.numerics import find_root
result = find_root(
lambda x: math.cos(x) - x,
0.0,
1.0,
method="brent",
trace="evaluations",
)
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Convergence of cos(x)=x
Where does cos(x) meet x on [0,1]?
The retained evaluations and brackets converge to 0.7390851332; independent residual and bracket checks pass. A separately executed bisection solve agrees within the declared x-tolerance, with its full result retained below.
Independent reference-method comparison
Two independently executed bracketed methods return validated candidates that agree within the declared x-tolerance.
Two retained executions of the same numerical problem
Adaptive steps should preserve the mathematics you care about
A harmonic oscillator closes its phase curve and passes sampled invariant/reference checks; an explicit method honestly exhausts its budget on a stiff tracker.
Learning objectives
Relate adaptive trajectory points to independent invariant checks.
Recognize stiffness from repeated work and a bounded failure status.
Method assumptions
Local error estimates are not global error bounds.
Explicit RK methods can be inappropriate even for smooth stiff equations.
Complete Sage.js example
import math
from sagejs.numerics.ode import solve_ivp
def oscillator(_t, state):
return [state[1], -state[0]]
result = solve_ivp(
oscillator,
(0.0, 2.0 * math.pi),
[1.0, 0.0],
rtol=1e-8,
atol=1e-11,
trace="iterations",
)
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
One orbit of a harmonic oscillator
Does the adaptive trajectory return to its initial state without unacceptable invariant drift?
The retained phase trajectory closes after one period and the separately sampled squared-norm and reference checks pass.
2D plot with 2 layers: 1 line and 1 point. Bounds: x from -0.9997403289102852 to 1; y from -0.9999121595442336 to 0.9999729910974505. Source frontend: sagejs.numerics.ode.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
2D plot with 2 layers: 1 line and 1 point. Bounds: x from -0.9997403289102852 to 1; y from -0.9999121595442336 to 0.9999729910974505. Source frontend: sagejs.numerics.ode.
Structured numerical evidence for One orbit of a harmonic oscillator
Status
converged
Success
true
Method
rk45
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
87
Evaluations
524
Diagnostics
non_replayable_callback
failure
An explicit solver meets a stiff workload
What does bounded failure look like when RK45 is the wrong tool?
The solver returns maximum_evaluations without inventing a completed trajectory or a global-accuracy claim.
2D plot with 2 layers: 2 point layers. Bounds: x from 9.999999999999999e-05 to 9.999999999999999e-05; y from 9.999999999999999e-05 to 9.999999999999999e-05. Source frontend: sagejs.numerics.ode.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
2D plot with 2 layers: 2 point layers. Bounds: x from 9.999999999999999e-05 to 9.999999999999999e-05; y from 9.999999999999999e-05 to 9.999999999999999e-05. Source frontend: sagejs.numerics.ode.
Structured numerical evidence for An explicit solver meets a stiff workload
Status
maximum_evaluations
Success
false
Method
rk45
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
2
Evaluations
12
Diagnostics
non_replayable_callback, maximum_evaluations
linear_algebra · solve
A solution is credible only with a scale-aware residual
Iterative refinement records improving backward error, while a singular system produces an explicit diagnostic instead of a spurious vector.
Learning objectives
Read normwise backward error rather than raw residual alone.
Distinguish singularity from an ordinary convergence failure.
Method assumptions
Binary64 residuals must be interpreted relative to matrix and solution scale.
A singular coefficient matrix does not define a unique solution.
Complete Sage.js example
from sagejs.numerics.linear_algebra import solve
A = [
[2.7885359691576745, -9.49978489554666, -4.499413632617615],
[-5.5357852370235445, 4.729424283280249, 3.533989748458225],
[7.843591354096908, -8.261223347411677, -1.561563606294591],
]
b = [26.752113888947807, 25.823734998854537, -27.440931113276115]
result = solve(A, b, tolerance=2e-17, max_refinement=3, trace="iterations")
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Refinement improves backward error
Can a residual correction make a computed solve more trustworthy?
The retained refinement trace shows the final backward error below the initial backward error and validation passes.
Convergence progress after 2 retained steps. Values use one normalization across all frames.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Convergence progress after 2 retained steps. Values use one normalization across all frames.
Structured numerical evidence for Refinement improves backward error
Status
converged
Success
true
Method
partial_pivot_lu
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
2
Evaluations
0
Diagnostics
none
failure
No unique solution exists
What should solve return for linearly dependent equations?
The singularity diagnostic is preserved; no solution vector is invented.
Independent validation profile for linear solve. 1 checks are shown in order: operation_completed. Validation did not pass.
Independent validation profile for linear solve. 1 checks are shown in order: operation_completed. Validation did not pass.
Structured numerical evidence for No unique solution exists
Status
validation_failed
Success
false
Method
partial_pivot_lu
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
0
Evaluations
0
Diagnostics
ill_conditioned, validation_failed
integration · adaptive_quadrature
An error estimate is a budget allocation record
Adaptive Gauss-Kronrod exposes the retained interval partition and local error allocation; an evaluation ceiling suppresses an unvalidated partial estimate.
Learning objectives
See where an adaptive integrator spends its evaluations.
Understand why an incomplete partition is not a public integral value.
Method assumptions
The integrand must be finite on every evaluated point.
The reported error is an estimator under the method's smoothness assumptions.
Complete Sage.js example
import math
from sagejs.numerics.integration import integrate
result = integrate(
lambda x: math.exp(-x * x),
-2.0,
2.0,
absolute_tolerance=1e-10,
relative_tolerance=1e-10,
trace="iterations",
)
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Allocate work around a Gaussian peak
How does adaptive quadrature distribute error over [-2,2]?
The final interval partition and convergence frames come only from computed panels, and the independent validation pass is retained.
Adaptive quadrature refinement frame. Subdivision 1: replaced the largest-error parent by two computed children; 2 intervals were active afterward.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Adaptive quadrature refinement frame. Subdivision 1: replaced the largest-error parent by two computed children; 2 intervals were active afterward.
Structured numerical evidence for Allocate work around a Gaussian peak
Status
converged
Success
true
Method
adaptive_gauss_kronrod
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
1
Evaluations
95
Diagnostics
non_replayable_callback
failure
The evaluation budget ends first
What is returned when too few samples are allowed for a rapid oscillation?
The result records maximum_evaluations and suppresses an incomplete solver estimate rather than presenting it as the integral.
Adaptive quadrature evidence view. stopped before convergence: maximum evaluations.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Adaptive quadrature evidence view. stopped before convergence: maximum evaluations.
Structured numerical evidence for The evaluation budget ends first
Status
maximum_evaluations
Success
false
Method
adaptive_gauss_kronrod
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
0
Evaluations
15
Diagnostics
non_replayable_callback, maximum_evaluations
approximation · polynomial_approximation
Representation stability and approximation quality are different
Chebyshev nodes control Runge oscillation; equispaced interpolation can be represented stably and still be a poor approximation between nodes.
Learning objectives
Separate stable evaluation from a good approximation design.
Compare retained construction stages without inventing intermediate polynomials.
Method assumptions
Validation at construction nodes does not bound between-node error.
The deterministic grid metric is evidence, not a rigorous supremum norm.
Complete Sage.js example
from sagejs.numerics.approximation import chebyshev_approximation
def runge(x):
return 1.0 / (1.0 + 25.0 * x * x)
result = chebyshev_approximation(runge, [-1.0, 1.0], 16, trace="iterations")
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Chebyshev nodes tame endpoint oscillation
How should a degree-16 polynomial sample the Runge function?
The retained Chebyshev representation passes construction validation and its bounded animation reveals only computed construction stages.
polynomial approximation shown as chebyshev series with construction samples; animation stage coefficients 17/17
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
polynomial approximation shown as chebyshev series with construction samples; animation stage coefficients 17/17
Structured numerical evidence for Chebyshev nodes tame endpoint oscillation
Status
converged
Success
true
Method
chebyshev
Backend
ordinary-python
Validation
heuristic; passed=true
Iterations
17
Evaluations
52
Diagnostics
non_replayable_callback
failure
A stable formula cannot repair bad nodes
Does stable barycentric evaluation prevent the Runge phenomenon?
No. Construction and node reproduction validate, yet the independently sampled maximum error on [-1,1] is 14.3631. This is an approximation-design failure, not an arithmetic failure.
polynomial interpolation shown as barycentric polynomial with construction samples
polynomial interpolation shown as barycentric polynomial with construction samples
Structured numerical evidence for A stable formula cannot repair bad nodes
Status
converged
Success
true
Method
barycentric
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
17
Evaluations
0
Diagnostics
none
spectral · eigensystem
Eigenvalues can be available when an eigenbasis is not trustworthy
Hermitian Jacobi iterations expose decreasing off-diagonal mass; a nearly defective general matrix fails the eigenbasis conditioning gate.
Learning objectives
Read convergence evidence for a Hermitian eigensystem.
Recognize why a numerically singular eigenvector basis must be withheld.
Method assumptions
The successful path requires a finite Hermitian matrix.
A clustered nonnormal spectrum can make eigenvectors arbitrarily sensitive.
Complete Sage.js example
from sagejs.numerics.spectral import symmetric_eigen
A = [[4.0, 1.0, 0.0], [1.0, 3.0, 0.5], [0.0, 0.5, 1.0]]
result = symmetric_eigen(A, trace="iterations")
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Off-diagonal mass decreases
How does cyclic Jacobi expose convergence to a Hermitian eigensystem?
Each retained sweep reports convergence evidence, followed by independent eigenpair, orthogonality, and reconstruction checks.
Convergence evidence from 4 retained semantic trace events. Metrics and algorithm phases are attached to the layers; status converged.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Convergence evidence from 4 retained semantic trace events. Metrics and algorithm phases are attached to the layers; status converged.
Structured numerical evidence for Off-diagonal mass decreases
Status
converged
Success
true
Method
cyclic_jacobi
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
4
Evaluations
0
Diagnostics
none
failure
The eigenbasis is too ill-conditioned
Should a nearly defective matrix return a full eigenbasis?
No. The reciprocal-condition gate fails, so the public value is withheld and the conditioning evidence remains visible.
Eigenbasis conditioning witness. Reciprocal condition 1.7320508075694542e-12 must be at least 2.9802322387695312e-08. The check failed, so no eigensystem was returned.
Eigenbasis conditioning witness. Reciprocal condition 1.7320508075694542e-12 must be at least 2.9802322387695312e-08. The check failed, so no eigensystem was returned.
Structured numerical evidence for The eigenbasis is too ill-conditioned
Status
validation_failed
Success
false
Method
complex_shifted_qr
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
0
Evaluations
0
Diagnostics
ill_conditioned, validation_failed
optimization · minimize
A path explains both convergence and a budget stop
Nelder-Mead retains accepted simplex summaries on Rosenbrock's valley; the same problem with two iterations stops explicitly instead of claiming the best point is optimal.
Learning objectives
Follow a derivative-free path through a curved valley.
Distinguish a useful incumbent from a validated optimum.
Method assumptions
Nelder-Mead is local and supplies no global optimality proof.
A maximum-iteration status must not be relabeled as convergence.
Complete Sage.js example
from sagejs.numerics.optimization import minimize
def rosenbrock(point):
x, y = point
return (1.0 - x) ** 2 + 100.0 * (y - x * x) ** 2
result = minimize(
rosenbrock,
[-1.2, 1.0],
method="bfgs",
maxiter=200,
gtol=1e-5,
trace="iterations",
)
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Traverse Rosenbrock's curved valley
Can a derivative-free method reach the minimizer near (1,1)?
The retained parameter path reaches a point whose independent objective and local checks pass.
minimize parameter path with 128 retained states. Outcome: validated result. The latest retained Nelder-Mead simplex is shown.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
minimize parameter path with 128 retained states. Outcome: validated result. The latest retained Nelder-Mead simplex is shown.
Structured numerical evidence for Traverse Rosenbrock's curved valley
Status
converged
Success
true
Method
nelder-mead
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
157
Evaluations
315
Diagnostics
non_replayable_callback
failure
Two iterations are not enough
Is the best point after two iterations a solution?
It is only an incumbent. The result records maximum_iterations and validation does not promote it to success.
minimize parameter path with 4 retained states. Outcome: stopped: maximum iterations. The latest retained Nelder-Mead simplex is shown.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
minimize parameter path with 4 retained states. Outcome: stopped: maximum iterations. The latest retained Nelder-Mead simplex is shown.
Structured numerical evidence for Two iterations are not enough
Status
maximum_iterations
Success
false
Method
nelder-mead
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
2
Evaluations
24
Diagnostics
non_replayable_callback, maximum_iterations
statistics · regression
Robust fitting shows which observations lost influence
Huber regression retains weights and parameter progress for one outlier; a translated large-offset regression is rejected when independent validation cannot support its coefficients.
Learning objectives
Connect robust weights to visible outlier influence.
Treat a finite coefficient vector as provisional until scale-aware validation passes.
Method assumptions
Robust fitting changes the loss; it does not identify data errors automatically.
Binary64 regression with large offsets can lose information through cancellation.
Complete Sage.js example
from sagejs.numerics.statistics import huber_regression
x = list(range(8))
y = [1.0 + 2.0 * value for value in x]
y[-1] = 30.0
result = huber_regression(x, y, trace="iterations")
result
Open in Sage.js — starts a fresh browser worksheet containing this self-contained example.
success
Downweight one extreme observation
How does Huber regression limit one point's leverage?
The retained fit sequence converges while the final PlotSpec marks observations with weight below 0.8.
huber-irls line fit to 8 observed pairs. The fitted slope is 2.712178565679067 and intercept is -0.4243571313581338. 1 observations receive Huber weight below 0.8.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
huber-irls line fit to 8 observed pairs. The fitted slope is 2.712178565679067 and intercept is -0.4243571313581338. 1 observations receive Huber weight below 0.8.
Structured numerical evidence for Downweight one extreme observation
Status
converged
Success
true
Method
huber-irls
Backend
ordinary-python
Validation
validated_approximate; passed=true
Iterations
18
Evaluations
152
Diagnostics
none
failure
Finite coefficients can still fail validation
Should a large-offset regression be trusted because its coefficients are finite?
No. Independent validation detects the unstable translated geometry and returns validation_failed with a diagnostic plot.
ordinary-least-squares line fit to 11 observed pairs. The fitted slope is 1.9999999999999996 and intercept is -49999999999.99273.
ordinary-least-squares line fit to 11 observed pairs. The fitted slope is 1.9999999999999996 and intercept is -49999999999.99273.
Structured numerical evidence for Finite coefficients can still fail validation
Status
validation_failed
Success
false
Method
ordinary-least-squares
Backend
ordinary-python
Validation
indeterminate; passed=false
Iterations
0
Evaluations
22
Diagnostics
validation_failed
ode · parameter_sweep
A parameter sweep is evidence, not a smooth promise
Vary a decay rate, validate every completed ODE endpoint independently, and retain a bounded failure without manufacturing a missing curve point.
Learning objectives
Read a sweep as ordered item-level evidence with aggregate resource accounting.
Compare validated numerical endpoints with the analytic decay law.
Distinguish a missing failed result from an interpolated or fabricated value.
Use Play, Pause, Step, Restart, Speed, and the slider over exact retained prefixes.
Method assumptions
The scalar decay model y'=-rate*y has the analytic solution y(t)=exp(-rate*t).
Every successful nested ODE result must retain passing independent validation evidence.
Sweep ordering is input ordering; animation order does not imply adaptive sampling in parameter space.
Failures have no plot coordinate unless the failed result retained a validated numeric value.
Sweep success means every scheduled item completed; generic callback values have no implied mathematical validation.
The scheduler's memory and cancellation limits are cooperative inside live callbacks.
Presentation reads retained finite JSON only and cannot recover values suppressed by failed items.
Parameter sweep retained 5 successful numeric points from 5 processed items. 0 processed items failed and remain in the structured explanation, not as invented plot coordinates.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Parameter sweep retained 5 successful numeric points from 5 processed items. 0 processed items failed and remain in the structured explanation, not as invented plot coordinates.
Structured numerical evidence for A family of validated decay curves
Status
completed
Success
true
Method
bounded-batch-v1
Backend
portable-sequential
Validation
5 nested results passed; 0 did not pass
Items
5/5 processed
Evaluations
681
Diagnostics
none
failure
One parameter exhausts its local budget
What remains trustworthy when one nested ODE solve exhausts its evaluation budget?
Four validated terminal states remain visible. The rate-2 item has a retained callback_error and no fabricated coordinate.
Retained sweep explanation
5 of 5 planned items ran; 1 failed and 0 were skipped.
Sweep success means every scheduled item completed; generic callback values have no implied mathematical validation.
The scheduler's memory and cancellation limits are cooperative inside live callbacks.
Presentation reads retained finite JSON only and cannot recover values suppressed by failed items.
Parameter sweep retained 4 successful numeric points from 5 processed items. 1 processed item failed and remains in the structured explanation, not as invented plot coordinates.
Timed playback is disabled by your reduced-motion preference; Step, Restart, and Iteration remain available.
Parameter sweep retained 4 successful numeric points from 5 processed items. 1 processed item failed and remains in the structured explanation, not as invented plot coordinates.
Structured numerical evidence for One parameter exhausts its local budget