Average Error: 0.0 → 0.0
Time: 10.4s
Precision: 64
\[\left(1 - x\right) \cdot y + x \cdot z\]
\[1 \cdot y + x \cdot \left(z - 1 \cdot y\right)\]
\left(1 - x\right) \cdot y + x \cdot z
1 \cdot y + x \cdot \left(z - 1 \cdot y\right)
double f(double x, double y, double z) {
        double r35983414 = 1.0;
        double r35983415 = x;
        double r35983416 = r35983414 - r35983415;
        double r35983417 = y;
        double r35983418 = r35983416 * r35983417;
        double r35983419 = z;
        double r35983420 = r35983415 * r35983419;
        double r35983421 = r35983418 + r35983420;
        return r35983421;
}

double f(double x, double y, double z) {
        double r35983422 = 1.0;
        double r35983423 = y;
        double r35983424 = r35983422 * r35983423;
        double r35983425 = x;
        double r35983426 = z;
        double r35983427 = r35983426 - r35983424;
        double r35983428 = r35983425 * r35983427;
        double r35983429 = r35983424 + r35983428;
        return r35983429;
}

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

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

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

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

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

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

Reproduce

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

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

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