Average Error: 0.0 → 0.0
Time: 13.2s
Precision: 64
\[\left(1 - x\right) \cdot y + x \cdot z\]
\[y \cdot 1 + x \cdot \left(z - y\right)\]
\left(1 - x\right) \cdot y + x \cdot z
y \cdot 1 + x \cdot \left(z - y\right)
double f(double x, double y, double z) {
        double r479340 = 1.0;
        double r479341 = x;
        double r479342 = r479340 - r479341;
        double r479343 = y;
        double r479344 = r479342 * r479343;
        double r479345 = z;
        double r479346 = r479341 * r479345;
        double r479347 = r479344 + r479346;
        return r479347;
}

double f(double x, double y, double z) {
        double r479348 = y;
        double r479349 = 1.0;
        double r479350 = r479348 * r479349;
        double r479351 = x;
        double r479352 = z;
        double r479353 = r479352 - r479348;
        double r479354 = r479351 * r479353;
        double r479355 = r479350 + r479354;
        return r479355;
}

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. Taylor expanded around 0 0.0

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

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

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

Reproduce

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