Average Error: 1.5 → 1.5
Time: 7.4m
Precision: 64
Internal Precision: 128
\[\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|\]
\[\left|(\left(4 + x\right) \cdot \left(\frac{1}{y}\right) + \left(\left(-\frac{x}{y}\right) \cdot z\right))_*\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 div-inv1.5

    \[\leadsto \left|\color{blue}{\left(x + 4\right) \cdot \frac{1}{y}} - \frac{x}{y} \cdot z\right|\]
  4. Applied fma-neg1.5

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

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

Reproduce

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