Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[x \cdot y + \left(1.0 - x\right) \cdot z\]
\[1.0 \cdot \left(z - z \cdot x\right) + x \cdot y\]
x \cdot y + \left(1.0 - x\right) \cdot z
1.0 \cdot \left(z - z \cdot x\right) + x \cdot y
double f(double x, double y, double z) {
        double r10452165 = x;
        double r10452166 = y;
        double r10452167 = r10452165 * r10452166;
        double r10452168 = 1.0;
        double r10452169 = r10452168 - r10452165;
        double r10452170 = z;
        double r10452171 = r10452169 * r10452170;
        double r10452172 = r10452167 + r10452171;
        return r10452172;
}

double f(double x, double y, double z) {
        double r10452173 = 1.0;
        double r10452174 = z;
        double r10452175 = x;
        double r10452176 = r10452174 * r10452175;
        double r10452177 = r10452174 - r10452176;
        double r10452178 = r10452173 * r10452177;
        double r10452179 = y;
        double r10452180 = r10452175 * r10452179;
        double r10452181 = r10452178 + r10452180;
        return r10452181;
}

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.0 - x\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip3--11.6

    \[\leadsto x \cdot y + \color{blue}{\frac{{1.0}^{3} - {x}^{3}}{1.0 \cdot 1.0 + \left(x \cdot x + 1.0 \cdot x\right)}} \cdot z\]
  4. Applied associate-*l/13.5

    \[\leadsto x \cdot y + \color{blue}{\frac{\left({1.0}^{3} - {x}^{3}\right) \cdot z}{1.0 \cdot 1.0 + \left(x \cdot x + 1.0 \cdot x\right)}}\]
  5. Simplified13.5

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

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

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

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

Reproduce

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