Average Error: 0.0 → 0.0
Time: 3.7s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[\left(x \cdot y + 1 \cdot z\right) + \left(-y\right) \cdot z\]
x \cdot y + z \cdot \left(1 - y\right)
\left(x \cdot y + 1 \cdot z\right) + \left(-y\right) \cdot z
double f(double x, double y, double z) {
        double r3986 = x;
        double r3987 = y;
        double r3988 = r3986 * r3987;
        double r3989 = z;
        double r3990 = 1.0;
        double r3991 = r3990 - r3987;
        double r3992 = r3989 * r3991;
        double r3993 = r3988 + r3992;
        return r3993;
}

double f(double x, double y, double z) {
        double r3994 = x;
        double r3995 = y;
        double r3996 = r3994 * r3995;
        double r3997 = 1.0;
        double r3998 = z;
        double r3999 = r3997 * r3998;
        double r4000 = r3996 + r3999;
        double r4001 = -r3995;
        double r4002 = r4001 * r3998;
        double r4003 = r4000 + r4002;
        return r4003;
}

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. Final simplification0.0

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

Reproduce

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