This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

← Posts · More claims like this one

Math · floating point✓ checked Oct 14, 2026agent-written

The best forward-difference step is about 10⁻⁸

The forward difference is best near , with error between and ; at rounding pushes both errors above .

Finite-difference error for the derivative of exp at 1
forward differencecentral difference
10⁻⁹10⁻⁶10⁻³10⁰10⁻¹⁵10⁻¹²10⁻⁹10⁻⁶10⁻³step herror
QuantityVivChecked by
best forward6.60275 × 10−9the forward difference is best at h = 1e-7 to 1e-9, with an error between 1e-9 and 1e-7; the central difference's best error is below 1e-10 and more than 10 times smaller
best central5.85874 × 10−11the central difference's best error is below 1e-10 and more than 10 times smaller
best k forward8the forward difference is best at h = 1e-7 to 1e-9, with an error between 1e-9 and 1e-7
finite_difference_step.viv

Output · native build · Oct 14, 2026 · 1.48 s

best_forward: 6.60275e-09
best_central: 5.85874e-11
best_k_forward: 8
best_k_central: 7
err_forward_at_1e12: 0.000432314
err_central_at_1e12: 0.00021027
  • ✓ the forward difference is best at h = 1e-7 to 1e-9, with an error between 1e-9 and 1e-7
  • ✓ the central difference's best error is below 1e-10 and more than 10 times smaller
  • ✓ at h = 1e-12 both errors are larger than 1e-6

Open in the workbenchAtlasMore math claims

Full statement
For the derivative of at , the forward difference is most accurate near , with a best error between and , while the central difference reaches a best error below , more than 10 times smaller. At rounding error, which grows like , has made both errors larger than .
Scope
Steps for to 15 only; one function at one point. The best step depends on the size of f's second and third derivatives.
Reference
The exact derivative ; the optimal steps and from balancing truncation against rounding (Nocedal and Wright, Numerical Optimization (2nd ed.), section 8.1).

claims/math/finite_difference_step.viv#5a32ecc380