Average Error: 0.0 → 0.0
Time: 9.9s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[\left(1 \cdot z + \left(-y\right) \cdot z\right) + x \cdot y\]
x \cdot y + z \cdot \left(1 - y\right)
\left(1 \cdot z + \left(-y\right) \cdot z\right) + x \cdot y
double f(double x, double y, double z) {
        double r33777462 = x;
        double r33777463 = y;
        double r33777464 = r33777462 * r33777463;
        double r33777465 = z;
        double r33777466 = 1.0;
        double r33777467 = r33777466 - r33777463;
        double r33777468 = r33777465 * r33777467;
        double r33777469 = r33777464 + r33777468;
        return r33777469;
}

double f(double x, double y, double z) {
        double r33777470 = 1.0;
        double r33777471 = z;
        double r33777472 = r33777470 * r33777471;
        double r33777473 = y;
        double r33777474 = -r33777473;
        double r33777475 = r33777474 * r33777471;
        double r33777476 = r33777472 + r33777475;
        double r33777477 = x;
        double r33777478 = r33777477 * r33777473;
        double r33777479 = r33777476 + r33777478;
        return r33777479;
}

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

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

Reproduce

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