Compare a numerical rule's estimate to the true integral and
report the absolute, relative, and percentage errors:
abs_err = |rule - true|
rel_err = abs_err / |true|
pct_err = 100 * rel_err.
Example: trap=1/2, true=1/3 gives abs=1/6≈0.166667,
rel=1/2=0.500000, pct=50.000000.
Example
Compute the absolute error and convert the relative error to a percent. This value is the absolute error measured against the known exact answer, not a proven upper bound, even where a step labels it an error bound.
highlighted = computed this step
Step 1 — Set up
Compare the trapezoid estimate with the true integral.
T=21I=31
Step 2 — Trapezoid error bound
Apply the trapezoid error bound.
B=121⋅12⋅2=61
Step 3 — Relative error
Divide absolute error by the true value.
rel=61÷31=21
Step 4 — Percent error
Convert relative error to a percent.
pct=21⋅100=50%
integration-errorThe absolute error is the magnitude of the difference between the numerical estimate and the true (exact) integral. The relative error normalises by the true value. Percentage error is relative error × 100.