Average Error: 0.0 → 0.0
Time: 9.9s
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 r34361049 = 1.0;
        double r34361050 = x;
        double r34361051 = r34361049 - r34361050;
        double r34361052 = y;
        double r34361053 = r34361051 * r34361052;
        double r34361054 = z;
        double r34361055 = r34361050 * r34361054;
        double r34361056 = r34361053 + r34361055;
        return r34361056;
}

double f(double x, double y, double z) {
        double r34361057 = 1.0;
        double r34361058 = y;
        double r34361059 = r34361057 * r34361058;
        double r34361060 = x;
        double r34361061 = z;
        double r34361062 = r34361061 - r34361059;
        double r34361063 = r34361060 * r34361062;
        double r34361064 = r34361059 + r34361063;
        return r34361064;
}

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.2

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

    \[\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 2019170 
(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)))