Average Error: 0.0 → 0.0
Time: 9.5s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[z \cdot 1 + y \cdot \left(x - z\right)\]
x \cdot y + z \cdot \left(1 - y\right)
z \cdot 1 + y \cdot \left(x - z\right)
double f(double x, double y, double z) {
        double r31627304 = x;
        double r31627305 = y;
        double r31627306 = r31627304 * r31627305;
        double r31627307 = z;
        double r31627308 = 1.0;
        double r31627309 = r31627308 - r31627305;
        double r31627310 = r31627307 * r31627309;
        double r31627311 = r31627306 + r31627310;
        return r31627311;
}

double f(double x, double y, double z) {
        double r31627312 = z;
        double r31627313 = 1.0;
        double r31627314 = r31627312 * r31627313;
        double r31627315 = y;
        double r31627316 = x;
        double r31627317 = r31627316 - r31627312;
        double r31627318 = r31627315 * r31627317;
        double r31627319 = r31627314 + r31627318;
        return r31627319;
}

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 flip--8.2

    \[\leadsto x \cdot y + z \cdot \color{blue}{\frac{1 \cdot 1 - y \cdot y}{1 + y}}\]
  4. Applied associate-*r/10.1

    \[\leadsto x \cdot y + \color{blue}{\frac{z \cdot \left(1 \cdot 1 - y \cdot y\right)}{1 + y}}\]
  5. Taylor expanded around inf 0.0

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

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

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

Reproduce

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