# 前向误差

**前向误差**是数值计算产生的输出与被求解问题的精确输出之间的差值：对于一个建模为函数 \( f \)、输入为 \( x \) 的问题，前向误差为 \( \hat{f}(x) - f(x) \)，以绝对形式 \( |\hat{f}(x) - f(x)| \) 或相对形式 \( |\hat{f}(x) - f(x)|/|f(x)| \) 度量。<sup>[1](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)</sup> 它与后向误差形成对照，后者问的是输入数据需要改变多少，才能使计算输出恰好正确。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 前向误差为 \( \hat{f}(x) - f(x) \)，即计算输出与精确输出之间的差距；绝对形式为 \( |\hat{f}(x)-f(x)| \)，相对形式则除以 \( |f(x)| \)<sup>[1](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)</sup> |
| 控制界 | 相对前向误差 ≤ 条件数 × 相对后向误差（到一阶）<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> |
| 矩阵情形 | 对于 \( Ax = b \)，后向误差为残差 \( b - A\tilde{x} \)；条件数为 \( \kappa(A) = \|A\|\,\|A^{-1}\| \)<sup>[3](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)</sup><sup> • </sup><sup>[1](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)</sup> |
| 实用法则 | 对于后向稳定算法，条件数每增加一个数量级，大约损失一位精度<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> |
| 可测性 | 与前向误差不同，后向误差无需知道精确解即可评估<sup>[3](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)</sup> |
| 软件支持 | LAPACK 例程为计算解返回前向误差界（FERR）和后向误差界（BERR）<sup>[4](https://techpubs.jurassic.nl/library/manuals/4000/007-4325-001/sgi_html/ch03.html)</sup> |

## 定义与基本示例

假设任务是计算 \( y = f(x) \)，但算法返回了 \( \hat{y} \)。前向误差为 \( \Delta y = \hat{y} - y \)。<sup>[5](https://cse.engineering.nyu.edu/~mleung/CS4744/f04/Heath/chap01.pdf)</sup> 绝对误差带有答案的量纲，没有尺度参照便意义甚微：每秒一米的误差对于步行速度而言很显著，对于光速而言则可忽略不计，这正是相对形式 \( |\hat{y} - y|/|y| \) 通常更具信息量的原因。<sup>[1](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)</sup>

一个标准示例可以使这两种误差概念变得具体。用 1.4 近似 \( \sqrt{2} \)，得到的绝对前向误差约为 0.0142，相对而言约为百分之一。同一结果也可以从后向解释：由于 \( \sqrt{1.96} = 1.4 \)，计算值是输入略微不同（1.96 而非 2）时的精确答案，对应的绝对后向误差为 0.04，相对而言为百分之二。<sup>[5](https://cse.engineering.nyu.edu/~mleung/CS4744/f04/Heath/chap01.pdf)</sup>

## 与后向误差及条件性的关系

计算解 \( \tilde{y} \) 的后向误差是使 \( f(x + \Delta x) = \tilde{y} \) 成立的最小输入扰动 \( \Delta x \)；形式上，相对后向误差为 \( \min\{\epsilon : f(x + \Delta x) = \tilde{y},\ \|\Delta x\| \le \epsilon\|x\|\} \)。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> 若一个算法的后向误差被机器精度的小倍数所界定，则称该算法是后向稳定的。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup>

这两种误差通过条件数联系起来，条件数衡量精确问题对输入扰动的放大强度。对于可微的 \( f \)，相对条件数为 \( \kappa_{rel}(x) = \|f'(x)\|\,\|x\|/\|f(x)\| \)，且到一阶有

\[ \frac{\|\Delta f\|}{\|f\|} \le \kappa_{rel}(x) \cdot \frac{\|\Delta x\|}{\|x\|}, \]

即相对前向误差被条件数与相对后向误差的乘积所界定。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> 对于用扰动矩阵 \( A + E \) 计算的矩阵乘积 \( y = Ax \)，同样的推理给出相对输出误差至多为 \( \kappa(A)\,\|E\|/\|A\| \)，其中 \( \kappa(A) = \|A\|\,\|A^{-1}\| \)。<sup>[1](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)</sup>

这种乘积结构区分了两个常被混淆的问题。后向稳定算法将后向误差保持在不可避免的舍入水平，但如果问题本身高度敏感，前向误差仍会很大；反过来，只有当稳定性与良好条件性兼备时，才能保证较小的前向误差。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> 在双精度算术中，机器精度为 \( 2^{-p} \)，binary64 格式下 \( p = 53 \) 个有效位，条件数为 100 时大约损失两位精度，而条件数接近 \( \epsilon_{mach}^{-1} \) 时可能耗尽所有可用位数。<sup>[6](https://dlmf.nist.gov/3.1)</sup><sup> • </sup><sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup> 条件数是最坏情况界，因此实际前向误差可能小于其预测值。<sup>[2](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)</sup>

## 前向误差难以直接计算的原因

前向误差需要精确解 \( x \)，而精确解通常是未知的；实践中人们寻求的是上界而非误差本身。<sup>[3](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)</sup> 后向误差则具有相反的性质：对于 \( f(x) = 0 \)，它简单地就是 \( f(\tilde{x}) \)；对于线性方程组 \( Ax = b \)，它就是残差 \( b - A\tilde{x} \)，两者均可由手头数据计算。<sup>[3](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)</sup> 这种可计算性正是后向误差分析通常被优先用作验证计算结果之工具的原因之一，前向误差则通过条件数来恢复。<sup>[7](https://www.sciencedirect.com/topics/computer-science/backward-error)</sup>

还有一种停止规则的解读。如果已知输入数据的精确度仅在一个绝对误差 \( E \) 之内，那么任何绝对后向误差低于 \( E \) 的近似都可能是精确答案，因此追求更高精度毫无意义。<sup>[3](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)</sup>

## 作为方法的前向误差分析

在前向误差分析中，人们试图直接找出解的误差界，追踪每一步运算的舍入如何传播到最终结果；而在后向误差分析中，人们转而确定一组修改后的数据，使计算解对该数据是精确的，并对这一修改加以界定。<sup>[8](https://informatika.usk.ac.id/umam/numericalmethods.pdf)</sup> 朴素的前向分析往往产生保守的界，因为它在每一步都累积最坏情况的舍入。在一个有记载的案例中，某个计算量 \( p_i^k \) 的朴素界在 binary64 算术中按 \( 2^{k} \cdot 2^{-53} \) 增长，几步之后就会使计算失去意义；而计入补偿性舍入误差后，得到的可用界按 \( k^{2} \cdot 2^{-53} \) 增长。<sup>[9](https://www.sciencedirect.com/topics/mathematics/forward-error-analysis)</sup>

前向误差分析的系统框架建立线性先验与后验误差方程及其关联的条件数，这些条件数构成累积误差的最优界，并支撑稳定性与条件性的定量定义；该方法已被应用于包括高斯消元在内的算法。<sup>[10](https://doi.org/10.1090/S0025-5718-1981-0628707-8)</sup>

## 历史

后向误差分析由英国国家物理实验室的数值分析学家 J. H. Wilkinson 在 20 世纪 50 年代和 60 年代的研究论文中系统发展、运用并推广，该技术的起源可追溯到他 1960 年发表于《Numerische Mathematik》的论文《Error Analysis of Floating-point Computation》。<sup>[11](https://nzdr.ru/data/media/biblio/kolxoz/M/MN/Higham%20N.%20Accuracy%20and%20stability%20of%20numerical%20algorithms%20%28SIAM%2C%201996%29%28ISBN%200898713552%29%28718s%29_MN_.pdf)</sup><sup> • </sup><sup>[12](https://ndl.ethernet.edu.et/bitstream/123456789/63242/1/131.pdf)</sup><sup> • </sup><sup>[13](https://eudml.org/doc/131466)</sup> 在 1971 年《SIAM Review》的一篇综述中，Wilkinson 论证道，自觉采用后向误差分析并结合浮点计算，极大地简化了误差分析，揭示了在基于等价变换与相似变换的矩阵计算中控制“增长”的重要性，并促成了数值稳定性有保证的酉变换的使用。<sup>[14](https://epubs.siam.org/doi/abs/10.1137/1013095)</sup>

## 实践中的前向误差

生产级数值软件在报告后向误差的同时也报告前向误差估计。LAPACK 是稠密线性代数的标准库，旨在为其计算的大多数量提供误差界，其迭代精化例程返回数组 FERR 和 BERR，分别保存解的各列的前向误差界和后向误差界。<sup>[15](https://epubs.siam.org/doi/10.1137/1.9780898719604.ch4)</sup><sup> • </sup><sup>[4](https://techpubs.jurassic.nl/library/manuals/4000/007-4325-001/sgi_html/ch03.html)</sup> 在专家驱动例程中，估计的前向误差界被描述为“保证”在真实误差的 10 倍以内，前提是倒数条件数超过阈值 \( \sqrt{n} \cdot \epsilon \)。<sup>[16](https://www.mankier.com/3/herfsx)</sup>

前向误差也可以通过改变算法来与条件性解耦。迭代精化可以使线性方程组求解的前向误差独立于 \( \kappa(A) \)，前提是 \( \kappa(A) \) 足够小于 \( 1/\varepsilon_w \)（工作精度单位舍入误差的倒数），且残差以更高精度计算。<sup>[17](https://arxiv.org/abs/2303.04251)</sup> 在研究前沿，FBSMR 等方法将这一思想推广到同时稳定适定系统的前向与后向误差，即使使用低精度预条件子亦然。<sup>[17](https://arxiv.org/abs/2303.04251)</sup>

## References

1. [CS 4220 Lecture Notes: Forward and backward error and conditioning, Cornell University](https://www.cs.cornell.edu/courses/cs4220/2026sp/lec/2026-01-30.html)
2. [Timo Betcke, Principles of backward error analysis, MATH0058 Lecture Notes, University College London](https://tbetcke.github.io/math0058_lecture_notes/error_analysis.html)
3. [Measures of Error and Order of Convergence, Numerical Methods and Analysis with Python](https://lemesurierb.people.charleston.edu/numerical-methods-and-analysis-python/python-tutorial/main/error-measures-convergence-rates.html)
4. [Chapter 3, LAPACK, SGI documentation](https://techpubs.jurassic.nl/library/manuals/4000/007-4325-001/sgi_html/ch03.html)
5. [Michael Heath, Scientific Computing, Chapter 1 lecture notes, NYU](https://cse.engineering.nyu.edu/~mleung/CS4744/f04/Heath/chap01.pdf)
6. [DLMF §3.1 Arithmetics and Error Measures, NIST](https://dlmf.nist.gov/3.1)
7. [Backward Error, ScienceDirect Topics overview](https://www.sciencedirect.com/topics/computer-science/backward-error)
8. [Numerical Methods in Scientific Computing, Volume I](https://informatika.usk.ac.id/umam/numericalmethods.pdf)
9. [Forward Error Analysis, ScienceDirect Topics overview (Boldo & Melquiond, Floating-Point Algorithms and Formal Proofs)](https://www.sciencedirect.com/topics/mathematics/forward-error-analysis)
10. [Theoretical foundation of forward error analysis, Mathematics of Computation (1981)](https://doi.org/10.1090/S0025-5718-1981-0628707-8)
11. [Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms, SIAM 1996](https://nzdr.ru/data/media/biblio/kolxoz/M/MN/Higham%20N.%20Accuracy%20and%20stability%20of%20numerical%20algorithms%20%28SIAM%2C%201996%29%28ISBN%200898713552%29%28718s%29_MN_.pdf)
12. [Origin of backward error analysis, numerical ODE text](https://ndl.ethernet.edu.et/bitstream/123456789/63242/1/131.pdf)
13. [J. H. Wilkinson, Error Analysis of Floating-point Computation, Numerische Mathematik 2 (1960), EuDML](https://eudml.org/doc/131466)
14. [J. H. Wilkinson, Modern Error Analysis, SIAM Review 13(4), 1971](https://epubs.siam.org/doi/abs/10.1137/1013095)
15. [LAPACK Users' Guide, Chapter 4: Accuracy and Stability, SIAM](https://epubs.siam.org/doi/10.1137/1.9780898719604.ch4)
16. [herfsx: iterative refinement expert driver man page, LAPACK](https://www.mankier.com/3/herfsx)
17. [Xiangmin Jiao, Optimal Solutions of Well-Posed Linear Systems via Low-Precision Right-Preconditioned GMRES with Forward and Backward Stabilization, arXiv:2303.04251](https://arxiv.org/abs/2303.04251)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Numerical analysis and computation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/forward-error

English original: https://www.edgepedia.org/forward-error
