Average Error: 0.0 → 0.0
Time: 2.7s
Precision: 64
\[\left(1 - x\right) \cdot y + x \cdot z\]
\[1 \cdot \left(\left(x \cdot z + y\right) - x \cdot y\right)\]
\left(1 - x\right) \cdot y + x \cdot z
1 \cdot \left(\left(x \cdot z + y\right) - x \cdot y\right)
double f(double x, double y, double z) {
        double r746314 = 1.0;
        double r746315 = x;
        double r746316 = r746314 - r746315;
        double r746317 = y;
        double r746318 = r746316 * r746317;
        double r746319 = z;
        double r746320 = r746315 * r746319;
        double r746321 = r746318 + r746320;
        return r746321;
}

double f(double x, double y, double z) {
        double r746322 = 1.0;
        double r746323 = x;
        double r746324 = z;
        double r746325 = r746323 * r746324;
        double r746326 = y;
        double r746327 = r746325 + r746326;
        double r746328 = r746323 * r746326;
        double r746329 = r746327 - r746328;
        double r746330 = r746322 * r746329;
        return r746330;
}

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
\[y - x \cdot \left(y - z\right)\]

Derivation

  1. Initial program 0.0

    \[\left(1 - x\right) \cdot y + x \cdot z\]
  2. Using strategy rm
  3. Applied flip3-+40.3

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

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

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

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

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

Reproduce

herbie shell --seed 2019322 
(FPCore (x y z)
  :name "Diagrams.Color.HSV:lerp  from diagrams-contrib-1.3.0.5"
  :precision binary64

  :herbie-target
  (- y (* x (- y z)))

  (+ (* (- 1 x) y) (* x z)))