Average Error: 0.0 → 0.0
Time: 7.5s
Precision: 64
\[x \cdot y + z \cdot \left(1 - y\right)\]
\[y \cdot \left(x - z\right) + 1 \cdot z\]
x \cdot y + z \cdot \left(1 - y\right)
y \cdot \left(x - z\right) + 1 \cdot z
double f(double x, double y, double z) {
        double r525304 = x;
        double r525305 = y;
        double r525306 = r525304 * r525305;
        double r525307 = z;
        double r525308 = 1.0;
        double r525309 = r525308 - r525305;
        double r525310 = r525307 * r525309;
        double r525311 = r525306 + r525310;
        return r525311;
}

double f(double x, double y, double z) {
        double r525312 = y;
        double r525313 = x;
        double r525314 = z;
        double r525315 = r525313 - r525314;
        double r525316 = r525312 * r525315;
        double r525317 = 1.0;
        double r525318 = r525317 * r525314;
        double r525319 = r525316 + r525318;
        return r525319;
}

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 flip3-+40.7

    \[\leadsto \color{blue}{\frac{{\left(x \cdot y\right)}^{3} + {\left(z \cdot \left(1 - y\right)\right)}^{3}}{\left(x \cdot y\right) \cdot \left(x \cdot y\right) + \left(\left(z \cdot \left(1 - y\right)\right) \cdot \left(z \cdot \left(1 - y\right)\right) - \left(x \cdot y\right) \cdot \left(z \cdot \left(1 - y\right)\right)\right)}}\]
  4. Simplified40.7

    \[\leadsto \frac{{\left(x \cdot y\right)}^{3} + {\left(z \cdot \left(1 - y\right)\right)}^{3}}{\color{blue}{\left(x \cdot y\right) \cdot \left(x \cdot y\right) + \left(z \cdot \left(1 - y\right)\right) \cdot \left(z \cdot \left(1 - y\right) - x \cdot y\right)}}\]
  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}{y \cdot \left(x - z\right) + 1 \cdot z}\]
  7. Final simplification0.0

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

Reproduce

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