Average Error: 0.0 → 0.0
Time: 10.2s
Precision: 64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[\left(z \cdot x - z\right) \cdot 1 + x \cdot y\]
x \cdot y + \left(x - 1\right) \cdot z
\left(z \cdot x - z\right) \cdot 1 + x \cdot y
double f(double x, double y, double z) {
        double r7784819 = x;
        double r7784820 = y;
        double r7784821 = r7784819 * r7784820;
        double r7784822 = 1.0;
        double r7784823 = r7784819 - r7784822;
        double r7784824 = z;
        double r7784825 = r7784823 * r7784824;
        double r7784826 = r7784821 + r7784825;
        return r7784826;
}

double f(double x, double y, double z) {
        double r7784827 = z;
        double r7784828 = x;
        double r7784829 = r7784827 * r7784828;
        double r7784830 = r7784829 - r7784827;
        double r7784831 = 1.0;
        double r7784832 = r7784830 * r7784831;
        double r7784833 = y;
        double r7784834 = r7784828 * r7784833;
        double r7784835 = r7784832 + r7784834;
        return r7784835;
}

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.5

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

    \[\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}{\left(x \cdot z - z\right) \cdot 1}\]
  7. Final simplification0.0

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

Reproduce

herbie shell --seed 2019172 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Drawing:drawTextsR from Chart-1.5.3"
  (+ (* x y) (* (- x 1.0) z)))