Average Error: 0.0 → 0.0
Time: 9.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 r120833 = x;
        double r120834 = y;
        double r120835 = r120833 * r120834;
        double r120836 = 1.0;
        double r120837 = r120833 - r120836;
        double r120838 = z;
        double r120839 = r120837 * r120838;
        double r120840 = r120835 + r120839;
        return r120840;
}

double f(double x, double y, double z) {
        double r120841 = x;
        double r120842 = y;
        double r120843 = r120841 * r120842;
        double r120844 = 1.0;
        double r120845 = z;
        double r120846 = r120841 * r120845;
        double r120847 = r120846 - r120845;
        double r120848 = r120844 * r120847;
        double r120849 = r120843 + r120848;
        return r120849;
}

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