All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

The Step-Size Trap: How Numerical Differentiation Fails with Floating-Point Arithmetic

By

davedx

2mo ago· 16 min readenInsight

Summary

The article explores the mathematical and computational challenges of numerical differentiation, specifically the step-size trap in finite difference approximations. It explains how using floating-point arithmetic to compute derivatives by evaluating functions at nearby points works well with moderate step sizes but breaks down when step sizes become too small due to rounding errors and machine precision limitations. The content uses the example of sin(x) at x=1 to illustrate how derivative approximations improve then deteriorate as step size decreases, highlighting fundamental issues in numerical analysis and computational mathematics.

Key quotes

· 5 pulled
That's not a metaphor. That's literally what happens when you compute a derivative with floating point arithmetic
Pick a small h. Evaluate twice. Divide. It worked. Then I made h smaller and it worked better. Then I made h way smaller and it got worse.
You can measure a curve with a ruler. Lay it across two points, read the slope. Zoom in and the ruler shrinks — better approximation. Keep zooming and your hands start shaking.
At some point you're measuring the shake, not the curve.
The step-size trap
Snippet from the RSS feed
You can measure a curve with a ruler. Lay it across two points, read the slope. Zoom in and the ruler shrinks — better approximation. Keep zooming and your hand

You might also wanna read