Average Error: 0.0 → 0.0
Time: 5.2s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[\left(1 \cdot z + x \cdot y\right) + z \cdot \left(-y\right)\]
x \cdot y + z \cdot \left(1 - y\right)
\left(1 \cdot z + x \cdot y\right) + z \cdot \left(-y\right)
double f(double x, double y, double z) {
        double r442579 = x;
        double r442580 = y;
        double r442581 = r442579 * r442580;
        double r442582 = z;
        double r442583 = 1.0;
        double r442584 = r442583 - r442580;
        double r442585 = r442582 * r442584;
        double r442586 = r442581 + r442585;
        return r442586;
}

double f(double x, double y, double z) {
        double r442587 = 1.0;
        double r442588 = z;
        double r442589 = r442587 * r442588;
        double r442590 = x;
        double r442591 = y;
        double r442592 = r442590 * r442591;
        double r442593 = r442589 + r442592;
        double r442594 = -r442591;
        double r442595 = r442588 * r442594;
        double r442596 = r442593 + r442595;
        return r442596;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Applied associate-+r+0.0

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

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

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

Reproduce

herbie shell --seed 2019304 
(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 y))))