Average Error: 0.0 → 0.0
Time: 8.5s
Precision: 64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[x \cdot y + 1 \cdot \left(x \cdot z - z\right)\]
x \cdot y + \left(x - 1\right) \cdot z
x \cdot y + 1 \cdot \left(x \cdot z - z\right)
double f(double x, double y, double z) {
        double r171475 = x;
        double r171476 = y;
        double r171477 = r171475 * r171476;
        double r171478 = 1.0;
        double r171479 = r171475 - r171478;
        double r171480 = z;
        double r171481 = r171479 * r171480;
        double r171482 = r171477 + r171481;
        return r171482;
}

double f(double x, double y, double z) {
        double r171483 = x;
        double r171484 = y;
        double r171485 = r171483 * r171484;
        double r171486 = 1.0;
        double r171487 = z;
        double r171488 = r171483 * r171487;
        double r171489 = r171488 - r171487;
        double r171490 = r171486 * r171489;
        double r171491 = r171485 + r171490;
        return r171491;
}

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--7.8

    \[\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. Final simplification0.0

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

Reproduce

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