Average Error: 0.0 → 0.0
Time: 4.6s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[x \cdot y + \left(z \cdot 1 + z \cdot \left(-y\right)\right)\]
x \cdot y + z \cdot \left(1 - y\right)
x \cdot y + \left(z \cdot 1 + z \cdot \left(-y\right)\right)
double f(double x, double y, double z) {
        double r433410 = x;
        double r433411 = y;
        double r433412 = r433410 * r433411;
        double r433413 = z;
        double r433414 = 1.0;
        double r433415 = r433414 - r433411;
        double r433416 = r433413 * r433415;
        double r433417 = r433412 + r433416;
        return r433417;
}

double f(double x, double y, double z) {
        double r433418 = x;
        double r433419 = y;
        double r433420 = r433418 * r433419;
        double r433421 = z;
        double r433422 = 1.0;
        double r433423 = r433421 * r433422;
        double r433424 = -r433419;
        double r433425 = r433421 * r433424;
        double r433426 = r433423 + r433425;
        double r433427 = r433420 + r433426;
        return r433427;
}

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

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

Reproduce

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