Average Error: 0.0 → 0.0
Time: 13.9s
Precision: 64
\[x \cdot y + z \cdot \left(1.0 - y\right)\]
\[\left(-y\right) \cdot z + \left(1.0 \cdot z + x \cdot y\right)\]
x \cdot y + z \cdot \left(1.0 - y\right)
\left(-y\right) \cdot z + \left(1.0 \cdot z + x \cdot y\right)
double f(double x, double y, double z) {
        double r21941622 = x;
        double r21941623 = y;
        double r21941624 = r21941622 * r21941623;
        double r21941625 = z;
        double r21941626 = 1.0;
        double r21941627 = r21941626 - r21941623;
        double r21941628 = r21941625 * r21941627;
        double r21941629 = r21941624 + r21941628;
        return r21941629;
}

double f(double x, double y, double z) {
        double r21941630 = y;
        double r21941631 = -r21941630;
        double r21941632 = z;
        double r21941633 = r21941631 * r21941632;
        double r21941634 = 1.0;
        double r21941635 = r21941634 * r21941632;
        double r21941636 = x;
        double r21941637 = r21941636 * r21941630;
        double r21941638 = r21941635 + r21941637;
        double r21941639 = r21941633 + r21941638;
        return r21941639;
}

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.0 - y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

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

    \[\leadsto x \cdot y + \color{blue}{\left(1.0 \cdot z + \left(-y\right) \cdot z\right)}\]
  5. Applied associate-+r+0.0

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

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

Reproduce

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

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

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