Average Error: 0.0 → 0.0
Time: 13.5s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[\left(1 \cdot z + x \cdot y\right) + \left(-y\right) \cdot z\]
x \cdot y + z \cdot \left(1 - y\right)
\left(1 \cdot z + x \cdot y\right) + \left(-y\right) \cdot z
double f(double x, double y, double z) {
        double r544834 = x;
        double r544835 = y;
        double r544836 = r544834 * r544835;
        double r544837 = z;
        double r544838 = 1.0;
        double r544839 = r544838 - r544835;
        double r544840 = r544837 * r544839;
        double r544841 = r544836 + r544840;
        return r544841;
}

double f(double x, double y, double z) {
        double r544842 = 1.0;
        double r544843 = z;
        double r544844 = r544842 * r544843;
        double r544845 = x;
        double r544846 = y;
        double r544847 = r544845 * r544846;
        double r544848 = r544844 + r544847;
        double r544849 = -r544846;
        double r544850 = r544849 * r544843;
        double r544851 = r544848 + r544850;
        return r544851;
}

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-rgt-in0.0

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

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

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

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

Reproduce

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