Methodology
Mathematical Methodology & Engine Precision
Every number on GraphingCalc84 comes from documented, deterministic algorithms running in IEEE 754 double precision. This page lists the methods, their tolerances and where they can fail, so results can be checked rather than trusted blindly.
1. Number model
All arithmetic uses IEEE 754 binary64 (“double precision”) floating point, which carries about 15–17 significant decimal digits. Results are rounded only for display: up to 10 significant digits in the MultiView history, 6 in tables and readouts. Values smaller than in magnitude are shown as 0, and very large or small numbers switch to calculator-style E notation (for example 1.2E−7).
Exact fractions are recovered from decimals with continued fractions (denominators up to 999 in matrices, larger in the fraction converter), so is reported as only when the match holds to about 12 digits.
2. Parsing without eval
Expressions are tokenized and converted to postfix form with Dijkstra's shunting-yard algorithm, then evaluated on a small stack. JavaScript's eval and new Function are never used, so typed input cannot run code.
- Precedence: binds tighter than unary minus, so , matching classroom handhelds. Powers are right-associative: .
- Implicit multiplication:
2x,3(x+1)and2πare read as products. - Unclosed parentheses are closed at the end of the line, as on many handhelds.
- Real odd roots: returns instead of an error.
3. Graphing
Each function is sampled across the current window at a density tied to the canvas width and device pixel ratio. Between samples the plotter lifts the pen when a value is undefined or when consecutive points jump by more than the visible window height — this is how vertical asymptotes such as or are drawn without false connecting lines. The canvas keeps a safe inset (44 px top, 56 px right) so axis labels never hide under the function ribbon or zoom controls.
4. Zeros, intersections and extrema
Roots are bracketed by scanning the window for sign changes, then refined with Brent's method, which combines inverse quadratic interpolation, the secant step and bisection. It always converges once a sign change is bracketed and stops when the bracket is narrower than about . Intersections of and are roots of . Candidate roots where is not near zero are rejected, which filters out sign changes caused by asymptotes.
Local minima and maxima are located from sampled turning points and refined by golden-section search.
Limit: a root where the graph touches the axis without crossing it (for example at 0) has no sign change. Use the minimum/maximum tool to confirm such double roots.
5. Numerical derivative (nDeriv)
Derivatives use the five-point central difference, a Richardson-extrapolated formula with error of order :
This is more accurate than the two-point symmetric difference quotient that many handhelds use, but like any finite difference it can report a value at a corner such as at 0, where the true derivative does not exist.
6. Definite integrals (fnInt)
Integrals use adaptive Simpson quadrature. An interval is split in half until the two-half estimate agrees with the whole-interval estimate within tolerance, and the difference divided by 15 is added back as a Richardson correction:
The tolerance starts at and recursion depth is capped, so integrands with a vertical asymptote inside the bounds return a large or undefined value rather than a misleading finite answer.
7. Matrices
Reduced row echelon form uses Gauss-Jordan elimination with partial pivoting (the largest available pivot in each column), treating magnitudes below as zero. Every row swap, scaling and replacement is recorded, which is what the step list under the matrix editor shows. Determinants come from the same elimination: the product of pivots, with a sign flip for each row swap.
8. Statistics and distributions
- Regression: ordinary least squares in closed form, , , with correlation . Sample standard deviation divides by ; population σ divides by .
- Normal: , with erf evaluated through the regularized incomplete gamma function .
- Student t and chi-square: the regularized incomplete beta and gamma functions, evaluated by series and continued fractions with the log-gamma function from the Lanczos approximation.
- Binomial: exact sums of computed in log space to avoid overflow.
- Inverse normal (
invNorm): Peter Acklam's rational approximation, with relative error below across the whole range.
9. Spot checks against known values
| Calculation | GraphingCalc84 | Reference |
|---|---|---|
normalcdf(−1, 1, 0, 1) | 0.682689 | 0.6826894921… |
tcdf(−∞, −2.262, 9) | 0.0250064 | ≈ 0.025 (two-tailed 95% critical t, df = 9) |
χ²cdf(7.815, ∞, 3) | 0.0499939 | ≈ 0.05 (critical χ², df = 3) |
| 2 | 2 (exact) | |
| rref of | x = 2, y = 3, z = −1 | exact solution |
These are the same routines that produce the example output shown in each tool before the interactive engine loads.
10. References
- NIST Digital Library of Mathematical Functions — error function (§7), incomplete gamma (§8.2) and incomplete beta (§8.17) definitions.
- IEEE 754-2019 Standard for Floating-Point Arithmetic — the binary64 number format used for every calculation.
Spotted a result that disagrees with a trusted source? Please report it with the exact input — corrections are logged and fixed in the engine, not patched per page.