Average Error: 23.4 → 23.4
Time: 8.9s
Precision: binary64
\[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
\[\frac{\left(x \cdot y + t \cdot z\right) + z \cdot \left(-a\right)}{y + z \cdot \left(b - y\right)}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Target

Original23.4
Target18.2
Herbie23.4
\[\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}\]

Derivation

  1. Initial program 23.4

    \[\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\]
  2. Using strategy rm
  3. Applied sub-neg23.4

    \[\leadsto \frac{x \cdot y + z \cdot \color{blue}{\left(t + \left(-a\right)\right)}}{y + z \cdot \left(b - y\right)}\]
  4. Applied distribute-lft-in23.4

    \[\leadsto \frac{x \cdot y + \color{blue}{\left(z \cdot t + z \cdot \left(-a\right)\right)}}{y + z \cdot \left(b - y\right)}\]
  5. Applied associate-+r+23.4

    \[\leadsto \frac{\color{blue}{\left(x \cdot y + z \cdot t\right) + z \cdot \left(-a\right)}}{y + z \cdot \left(b - y\right)}\]
  6. Simplified23.4

    \[\leadsto \frac{\color{blue}{\left(x \cdot y + t \cdot z\right)} + z \cdot \left(-a\right)}{y + z \cdot \left(b - y\right)}\]
  7. Final simplification23.4

    \[\leadsto \frac{\left(x \cdot y + t \cdot z\right) + z \cdot \left(-a\right)}{y + z \cdot \left(b - y\right)}\]

Reproduce

herbie shell --seed 2020171 
(FPCore (x y z t a b)
  :name "Development.Shake.Progress:decay from shake-0.15.5"
  :precision binary64

  :herbie-target
  (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))

  (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))