Questions: Catastrophic Cancellation

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

Two floating-point numbers agree to their first 13 significant digits. You subtract them using a 15-significant-digit system. Approximately how many significant digits of accuracy does the result have?

A15 digits — subtraction does not affect the precision of either operand
B13 digits — precision is preserved because both inputs were accurate to 13 digits
CAbout 2 digits — the 13 shared leading digits cancel, leaving only the residual accuracy
DZero digits — the result is always exactly zero when numbers agree to this many digits
Question 2 Multiple Choice

You need to compute √(x² + 1) − √(x²) for x = 10⁷. The direct formula gives a result with almost no significant digits. What is the better approach?

AUse 128-bit floats to get more significant digits in the inputs
BMultiply and divide by the conjugate, rewriting as 1 / (√(x²+1) + √(x²))
CRound both square roots to fewer digits before subtracting to reduce cancellation
DCompute the two square roots separately and store them in distinct variables before subtracting
Question 3 True / False

Catastrophic cancellation can be eliminated by switching from 32-bit (single) to 64-bit (double) precision arithmetic.

TTrue
FFalse
Question 4 True / False

Catastrophic cancellation can occur when two nearly equal floating-point numbers are added if they have opposite signs.

TTrue
FFalse
Question 5 Short Answer

Why does algebraic reformulation fix catastrophic cancellation when simply using higher precision does not?

Think about your answer, then reveal below.