Average Error: 1.5 → 3.3
Time: 6.9m
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|\frac{\left(4 + x\right) - z \cdot x}{y}\right|\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 1.5

    \[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
  2. Using strategy rm
  3. Applied associate-*l/3.3

    \[\leadsto \left|\frac{x + 4}{y} - \color{blue}{\frac{x \cdot z}{y}}\right|\]
  4. Applied sub-div3.3

    \[\leadsto \left|\color{blue}{\frac{\left(x + 4\right) - x \cdot z}{y}}\right|\]
  5. Final simplification3.3

    \[\leadsto \left|\frac{\left(4 + x\right) - z \cdot x}{y}\right|\]

Reproduce

herbie shell --seed 2019094 +o rules:numerics
(FPCore (x y z)
  :name "fabs fraction 1"
  (fabs (- (/ (+ x 4) y) (* (/ x y) z))))