#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 2::4.2.2 Accuracy of Floating Point Arithmetic
#columns:Front	Back	Tags
TAOCP §4.2.2 Accuracy of Floating Point Arithmetic: what does it cover?	Error analysis for floating point: which algebraic laws survive (commutativity does), which break (associativity, distributivity), and how to reason about the error of a sequence of operations.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::about
TAOCP §4.2.2: why does it matter?	This is the section that teaches you why summing an array in a different order changes the answer, and how to write numeric code that does not drift.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::why
TAOCP §4.2.2: what traps should you watch for?	<ul><li>Comparing floats with == in tests.</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::traps
TAOCP §4.2.2, exercise 4 (rated 10): what is it asking?	Can regrouping a product change whether it overflows?	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 3 (rated M20): what is it asking?	Find concrete numbers where floating multiplication is not associative.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 8 (rated 20, recommended): what is it asking?	Apply the approximate-equality relations to concrete pairs. Builds intuition for tolerance comparisons.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 25 (rated 15, recommended): what is it asking?	Why blaming cancellation is usually blaming the wrong step.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 15 (rated M24, recommended): what is it asking?	Does the computed midpoint of an interval always lie inside it? Classic binary-search trap.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 13 (rated M25, recommended): what is it asking?	Doing exact integer arithmetic on top of floating point and when it stays exact.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 23 (rated M26, recommended): what is it asking?	Check an identity about rounding down that looks obviously true.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2, exercise 19 (rated M30, recommended): what is it asking?	Error analysis of Kahan's compensated summation. The stretch, and worth implementing.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercise
TAOCP §4.2.2: how many exercises, and how are they rated?	31 exercises, rated 10 to M40.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::exercises
TAOCP §4.2.2: what should you be comfortable with first?	<ul><li>4.2.1 Single-Precision Calculations</li></ul>	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::prereqs
TAOCP §4.2.2: how should you work through it?	Write programs that demonstrate non-associativity and catastrophic cancellation. Implement Kahan compensated summation (widely documented) and compare to naive summation.	cracked.guide cracked.guide::phase::taocp-2 cracked.guide::section::4.2.2 cracked.guide::kind::approach
