Average Error: 0.0 → 0.0
Time: 8.3s
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 r147311 = x;
        double r147312 = y;
        double r147313 = r147311 * r147312;
        double r147314 = 1.0;
        double r147315 = r147311 - r147314;
        double r147316 = z;
        double r147317 = r147315 * r147316;
        double r147318 = r147313 + r147317;
        return r147318;
}

double f(double x, double y, double z) {
        double r147319 = x;
        double r147320 = y;
        double r147321 = r147319 * r147320;
        double r147322 = 1.0;
        double r147323 = z;
        double r147324 = r147319 * r147323;
        double r147325 = r147324 - r147323;
        double r147326 = r147322 * r147325;
        double r147327 = r147321 + r147326;
        return r147327;
}

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