Average Error: 0.0 → 0.0
Time: 4.9s
Precision: binary64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[x \cdot y + \left(1 \cdot z + \left(-y\right) \cdot z\right)\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Target

Original0.0
Target0.0
Herbie0.0
\[z - \left(z - x\right) \cdot y\]

Derivation

  1. Initial program 0.0

    \[x \cdot y + z \cdot \left(1 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto x \cdot y + z \cdot \color{blue}{\left(1 + \left(-y\right)\right)}\]
  4. Applied distribute-lft-in0.0

    \[\leadsto x \cdot y + \color{blue}{\left(z \cdot 1 + z \cdot \left(-y\right)\right)}\]
  5. Simplified0.0

    \[\leadsto x \cdot y + \left(\color{blue}{1 \cdot z} + z \cdot \left(-y\right)\right)\]
  6. Simplified0.0

    \[\leadsto x \cdot y + \left(1 \cdot z + \color{blue}{\left(-y\right) \cdot z}\right)\]
  7. Final simplification0.0

    \[\leadsto x \cdot y + \left(1 \cdot z + \left(-y\right) \cdot z\right)\]

Reproduce

herbie shell --seed 2020182 
(FPCore (x y z)
  :name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
  :precision binary64

  :herbie-target
  (- z (* (- z x) y))

  (+ (* x y) (* z (- 1.0 y))))