Average Error: 0.0 → 0.0
Time: 14.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 r608637 = 1.0;
        double r608638 = x;
        double r608639 = r608637 - r608638;
        double r608640 = y;
        double r608641 = r608639 * r608640;
        double r608642 = z;
        double r608643 = r608638 * r608642;
        double r608644 = r608641 + r608643;
        return r608644;
}

double f(double x, double y, double z) {
        double r608645 = y;
        double r608646 = 1.0;
        double r608647 = r608645 * r608646;
        double r608648 = x;
        double r608649 = z;
        double r608650 = r608649 - r608645;
        double r608651 = r608648 * r608650;
        double r608652 = r608647 + r608651;
        return r608652;
}

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