Floating Point
F = { ± ( 1 + f ) ⋅ 2 e } , f = ∑ i = 1 d b i 2 − i = 2 − d z , b i ∈ { 0 , 1 } , z ∈ { 0 , 1 , … , 2 d − 1 } \mathbb{F} = \{ \pm (1 + f) \cdot 2^e \}, \qquad f = \sum_{i=1}^{d} b_i 2^{-i} = 2^{-d} z, \quad b_i \in \{0, 1\}, \; z \in \{0, 1, \ldots, 2^d - 1\} F = { ± ( 1 + f ) ⋅ 2 e } , f = i = 1 ∑ d b i 2 − i = 2 − d z , b i ∈ { 0 , 1 } , z ∈ { 0 , 1 , … , 2 d − 1 }
So [ 2 e , 2 e + 1 ) [2^e, 2^{e+1}) [ 2 e , 2 e + 1 ) contains 2 d 2^d 2 d evenly spaced numbers with spacing 2 e − d 2^{e-d} 2 e − d , and ε m a c h = 2 − d \varepsilon_{\mathrm{mach}} = 2^{-d} ε mach = 2 − d . Rounding to the nearest,
∣ f l ( x ) − x ∣ ∣ x ∣ ≤ 2 e − d − 1 2 e = 1 2 ε m a c h , f l ( x ) = x ( 1 + ϵ ) , ∣ ϵ ∣ ≤ 1 2 ε m a c h \frac{|fl(x) - x|}{|x|} \le \frac{2^{e-d-1}}{2^e} = \frac{1}{2}\varepsilon_{\mathrm{mach}}, \qquad fl(x) = x(1 + \epsilon), \; |\epsilon| \le \frac{1}{2}\varepsilon_{\mathrm{mach}} ∣ x ∣ ∣ f l ( x ) − x ∣ ≤ 2 e 2 e − d − 1 = 2 1 ε mach , f l ( x ) = x ( 1 + ϵ ) , ∣ ϵ ∣ ≤ 2 1 ε mach
IEEE 754 double precision: 1 sign bit, 11 exponent bits, d = 52 d = 52 d = 52 , − 1022 ≤ e ≤ 1023 -1022 \le e \le 1023 − 1022 ≤ e ≤ 1023 , ε m a c h = 2 − 52 \varepsilon_{\mathrm{mach}} = 2^{-52} ε mach = 2 − 52 .
Accuracy
Absolute error ∣ x ~ − x ∣ |\tilde{x} - x| ∣ x ~ − x ∣ , relative error ∣ x ~ − x ∣ ∣ x ∣ \frac{|\tilde{x} - x|}{|x|} ∣ x ∣ ∣ x ~ − x ∣ , and accurate digits − log 10 ∣ x ~ − x x ∣ -\log_{10} \Big| \frac{\tilde{x} - x}{x} \Big| − log 10 x x ~ − x .
Condition Number
The ratio of relative changes in the output and input,
∣ f ( x ) − f ( x ~ ) ∣ / ∣ f ( x ) ∣ ∣ x − x ~ ∣ / ∣ x ∣ ⟶ κ f ( x ) = ∣ x f ′ ( x ) f ( x ) ∣ \frac{|f(x) - f(\tilde{x})| \,/\, |f(x)|}{|x - \tilde{x}| \,/\, |x|} \;\longrightarrow\; \kappa_f(x) = \Big| \frac{x f'(x)}{f(x)} \Big| ∣ x − x ~ ∣ / ∣ x ∣ ∣ f ( x ) − f ( x ~ ) ∣ / ∣ f ( x ) ∣ ⟶ κ f ( x ) = f ( x ) x f ′ ( x )
as x ~ → x \tilde{x} \to x x ~ → x . The absolute condition number is ∣ f ′ ( x ) ∣ |f'(x)| ∣ f ′ ( x ) ∣ . For a composition h ( x ) = f ( g ( x ) ) h(x) = f(g(x)) h ( x ) = f ( g ( x )) , κ h ( x ) = κ f ( g ( x ) ) ⋅ κ g ( x ) \kappa_h(x) = \kappa_f(g(x)) \cdot \kappa_g(x) κ h ( x ) = κ f ( g ( x )) ⋅ κ g ( x ) .
If κ f ≈ 10 d \kappa_f \approx 10^d κ f ≈ 1 0 d , about d d d digits are lost, and if κ f ≈ 1 / ε m a c h \kappa_f \approx 1/\varepsilon_{\mathrm{mach}} κ f ≈ 1/ ε mach the result can be off by 100%. If the algorithm's error is larger than the error from conditioning, the algorithm is unstable.