Average Error: 0.0 → 0.0
Time: 15.3s
Precision: 64
\[\left(1 - x\right) \cdot y + x \cdot z\]
\[1 \cdot \left(y - x \cdot y\right) + x \cdot z\]
\left(1 - x\right) \cdot y + x \cdot z
1 \cdot \left(y - x \cdot y\right) + x \cdot z
double f(double x, double y, double z) {
        double r563065 = 1.0;
        double r563066 = x;
        double r563067 = r563065 - r563066;
        double r563068 = y;
        double r563069 = r563067 * r563068;
        double r563070 = z;
        double r563071 = r563066 * r563070;
        double r563072 = r563069 + r563071;
        return r563072;
}

double f(double x, double y, double z) {
        double r563073 = 1.0;
        double r563074 = y;
        double r563075 = x;
        double r563076 = r563075 * r563074;
        double r563077 = r563074 - r563076;
        double r563078 = r563073 * r563077;
        double r563079 = z;
        double r563080 = r563075 * r563079;
        double r563081 = r563078 + r563080;
        return r563081;
}

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

    \[\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 - 1 \cdot \left(x \cdot y\right)\right)} + x \cdot z\]
  6. Simplified0.0

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

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

Reproduce

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