Average Error: 0.0 → 0.0
Time: 10.6s
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 r503179 = 1.0;
        double r503180 = x;
        double r503181 = r503179 - r503180;
        double r503182 = y;
        double r503183 = r503181 * r503182;
        double r503184 = z;
        double r503185 = r503180 * r503184;
        double r503186 = r503183 + r503185;
        return r503186;
}

double f(double x, double y, double z) {
        double r503187 = y;
        double r503188 = 1.0;
        double r503189 = r503187 * r503188;
        double r503190 = x;
        double r503191 = z;
        double r503192 = r503191 - r503187;
        double r503193 = r503190 * r503192;
        double r503194 = r503189 + r503193;
        return r503194;
}

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 2019304 
(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)))