Average Error: 0.0 → 0.0
Time: 1.8s
Precision: 64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[x \cdot \left(1 \cdot z + y\right) + 1 \cdot \left(-z\right)\]
x \cdot y + \left(x - 1\right) \cdot z
x \cdot \left(1 \cdot z + y\right) + 1 \cdot \left(-z\right)
double f(double x, double y, double z) {
        double r155309 = x;
        double r155310 = y;
        double r155311 = r155309 * r155310;
        double r155312 = 1.0;
        double r155313 = r155309 - r155312;
        double r155314 = z;
        double r155315 = r155313 * r155314;
        double r155316 = r155311 + r155315;
        return r155316;
}

double f(double x, double y, double z) {
        double r155317 = x;
        double r155318 = 1.0;
        double r155319 = z;
        double r155320 = r155318 * r155319;
        double r155321 = y;
        double r155322 = r155320 + r155321;
        double r155323 = r155317 * r155322;
        double r155324 = -r155319;
        double r155325 = r155318 * r155324;
        double r155326 = r155323 + r155325;
        return r155326;
}

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(x - 1\right) \cdot z\]
  2. Using strategy rm
  3. Applied flip--8.1

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

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

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

    \[\leadsto x \cdot y + \color{blue}{1 \cdot \left(x \cdot z - z\right)}\]
  7. Using strategy rm
  8. Applied sub-neg0.0

    \[\leadsto x \cdot y + 1 \cdot \color{blue}{\left(x \cdot z + \left(-z\right)\right)}\]
  9. Applied distribute-lft-in0.0

    \[\leadsto x \cdot y + \color{blue}{\left(1 \cdot \left(x \cdot z\right) + 1 \cdot \left(-z\right)\right)}\]
  10. Applied associate-+r+0.0

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

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

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

Reproduce

herbie shell --seed 2020039 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
  :precision binary64
  (+ (* x y) (* (- x 1) z)))