Average Error: 0.0 → 0.0
Time: 6.3s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[x \cdot y + \left(1 \cdot z + \left(-y\right) \cdot z\right)\]
x \cdot y + z \cdot \left(1 - y\right)
x \cdot y + \left(1 \cdot z + \left(-y\right) \cdot z\right)
double f(double x, double y, double z) {
        double r354375 = x;
        double r354376 = y;
        double r354377 = r354375 * r354376;
        double r354378 = z;
        double r354379 = 1.0;
        double r354380 = r354379 - r354376;
        double r354381 = r354378 * r354380;
        double r354382 = r354377 + r354381;
        return r354382;
}

double f(double x, double y, double z) {
        double r354383 = x;
        double r354384 = y;
        double r354385 = r354383 * r354384;
        double r354386 = 1.0;
        double r354387 = z;
        double r354388 = r354386 * r354387;
        double r354389 = -r354384;
        double r354390 = r354389 * r354387;
        double r354391 = r354388 + r354390;
        double r354392 = r354385 + r354391;
        return r354392;
}

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. Simplified0.0

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

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

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

Reproduce

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