Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[x \cdot y + \left(1 - x\right) \cdot z\]
\[1 \cdot z + 1 \cdot \left(x \cdot \left(y - z\right)\right)\]
x \cdot y + \left(1 - x\right) \cdot z
1 \cdot z + 1 \cdot \left(x \cdot \left(y - z\right)\right)
double f(double x, double y, double z) {
        double r187324 = x;
        double r187325 = y;
        double r187326 = r187324 * r187325;
        double r187327 = 1.0;
        double r187328 = r187327 - r187324;
        double r187329 = z;
        double r187330 = r187328 * r187329;
        double r187331 = r187326 + r187330;
        return r187331;
}

double f(double x, double y, double z) {
        double r187332 = 1.0;
        double r187333 = z;
        double r187334 = r187332 * r187333;
        double r187335 = x;
        double r187336 = y;
        double r187337 = r187336 - r187333;
        double r187338 = r187335 * r187337;
        double r187339 = r187332 * r187338;
        double r187340 = r187334 + r187339;
        return r187340;
}

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

Derivation

  1. Initial program 0.0

    \[x \cdot y + \left(1 - x\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip-+29.3

    \[\leadsto \color{blue}{\frac{\left(x \cdot y\right) \cdot \left(x \cdot y\right) - \left(\left(1 - x\right) \cdot z\right) \cdot \left(\left(1 - x\right) \cdot z\right)}{x \cdot y - \left(1 - x\right) \cdot z}}\]
  4. Taylor expanded around 0 0.0

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

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

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

Reproduce

herbie shell --seed 2019208 
(FPCore (x y z)
  :name "Diagrams.Backend.Rasterific:$crender from diagrams-rasterific-1.3.1.3"
  :precision binary64
  (+ (* x y) (* (- 1 x) z)))