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 r7070792 = x;
        double r7070793 = y;
        double r7070794 = r7070792 * r7070793;
        double r7070795 = 1.0;
        double r7070796 = r7070792 - r7070795;
        double r7070797 = z;
        double r7070798 = r7070796 * r7070797;
        double r7070799 = r7070794 + r7070798;
        return r7070799;
}

double f(double x, double y, double z) {
        double r7070800 = z;
        double r7070801 = x;
        double r7070802 = r7070800 * r7070801;
        double r7070803 = r7070802 - r7070800;
        double r7070804 = 1.0;
        double r7070805 = r7070803 * r7070804;
        double r7070806 = y;
        double r7070807 = r7070801 * r7070806;
        double r7070808 = r7070805 + r7070807;
        return r7070808;
}

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