Error from replacing an exact operation by an approximate/finite one (e.g. cutting a Taylor series); exists even with infinite precision.
What is round-off error?
Error from storing numbers with finitely many digits (finite floating-point precision).
Order of forward-difference truncation error?
O(h), equal to −2hf′′(ξ).
Order of central-difference truncation error?
O(h2), equal to −6h2f′′′(ξ).
Why does central difference beat forward?
Symmetric subtraction cancels the f′′ term, leaving O(h2).
How does round-off error scale with h in forward difference?
≈εmach∣f∣/h, grows as h→0.
Optimal h for forward difference?
hopt=2εmach∣f∣/∣f′′∣∼εmach≈10−8 for doubles.
What is machine epsilon for IEEE double?
≈2.22×10−16.
What is catastrophic cancellation?
Loss of significant digits when subtracting two nearly equal numbers.
Test to tell the two errors apart?
Would the error vanish on a perfect-precision calculator? Yes → truncation, No → round-off.
Recall Feynman: explain to a 12-year-old
Imagine measuring a curved hill's steepness. You walk a step forward and divide height gained by step length. If your step is huge, you miss the curve's wiggle — that's truncation error (your "math shortcut" was too rough). If you take a tiny step, the two heights are almost the same, and your ruler can only read so many digits — the tiny difference gets lost in rounding — that's round-off error. So a medium step gives the best answer: not too big, not too small.
Dekho, jab bhi computer ya tum khud koi numerical method se answer nikalte ho, woh exact nahi hota. Do main wajah hoti hain. Pehli — truncation error: hum exact process ko beech mein hi kaat dete hain. Jaise derivative ki definition mein limit h→0 hoti hai, lekin practically hum chhota sa finite h le lete hain. Taylor series ka jo tail bachta hai, woh hi truncation error hai. Yeh error perfect calculator pe bhi rahega, kyunki yeh maths ka approximation hai.
Dusri wajah — round-off error: computer har number ko sirf kuch hi digits mein store karta hai (machine epsilon ≈10−16 doubles ke liye). Toh real numbers thoda sa round ho jaate hain. Yeh error tab khatarnaak banta hai jab tum do bahut paas-paas ke numbers ko subtract karte ho — important digits cancel ho jaate hain, sirf noise bachta hai. Isko catastrophic cancellation kehte hain.
Ab maza yahan hai: truncation error chhota hota hai jab h chhota karo, lekin round-off error bada hota hai jab h bahut chhota karo (kyunki 1/h bada ho jaata hai). Toh dono opposite directions mein khinchte hain. Best answer ek mediumh pe milta hai — jise hopt∼εmach≈10−8 kehte hain (forward difference ke liye). Isiliye "h jitna chhota, utna accurate" — yeh galat soch hai!
Yaad rakhne ka tarika: Truncate = jaldi trim kiya (bada h mein zyada error), Round = digits khatam (chhota h mein zyada error). Graph banao toh total error ki shape smiley jaisi U hoti hai — bottom pe sweet spot. Exam mein agar forward difference ka order poochhe toh O(h), central difference ka O(h2) — kyunki symmetric subtraction se f′′ term cancel ho jaata hai.