Average Error: 0.0 → 0.0
Time: 2.3s
Precision: 64
\[x \cdot y + \left(x - 1\right) \cdot z\]
\[x \cdot \left(y + z\right) - z \cdot 1\]
x \cdot y + \left(x - 1\right) \cdot z
x \cdot \left(y + z\right) - z \cdot 1
double f(double x, double y, double z) {
        double r194116 = x;
        double r194117 = y;
        double r194118 = r194116 * r194117;
        double r194119 = 1.0;
        double r194120 = r194116 - r194119;
        double r194121 = z;
        double r194122 = r194120 * r194121;
        double r194123 = r194118 + r194122;
        return r194123;
}

double f(double x, double y, double z) {
        double r194124 = x;
        double r194125 = y;
        double r194126 = z;
        double r194127 = r194125 + r194126;
        double r194128 = r194124 * r194127;
        double r194129 = 1.0;
        double r194130 = r194126 * r194129;
        double r194131 = r194128 - r194130;
        return r194131;
}

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 add-sqr-sqrt0.0

    \[\leadsto x \cdot y + \left(x - \color{blue}{\sqrt{1} \cdot \sqrt{1}}\right) \cdot z\]
  4. Applied add-sqr-sqrt31.9

    \[\leadsto x \cdot y + \left(\color{blue}{\sqrt{x} \cdot \sqrt{x}} - \sqrt{1} \cdot \sqrt{1}\right) \cdot z\]
  5. Applied difference-of-squares31.9

    \[\leadsto x \cdot y + \color{blue}{\left(\left(\sqrt{x} + \sqrt{1}\right) \cdot \left(\sqrt{x} - \sqrt{1}\right)\right)} \cdot z\]
  6. Applied associate-*l*31.9

    \[\leadsto x \cdot y + \color{blue}{\left(\sqrt{x} + \sqrt{1}\right) \cdot \left(\left(\sqrt{x} - \sqrt{1}\right) \cdot z\right)}\]
  7. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{\left(x \cdot z + x \cdot y\right) - {\left(\sqrt{1}\right)}^{2} \cdot z}\]
  8. Simplified0.0

    \[\leadsto \color{blue}{x \cdot y + \left(x \cdot z - z \cdot 1\right)}\]
  9. Using strategy rm
  10. Applied associate-+r-0.0

    \[\leadsto \color{blue}{\left(x \cdot y + x \cdot z\right) - z \cdot 1}\]
  11. Simplified0.0

    \[\leadsto \color{blue}{x \cdot \left(y + z\right)} - z \cdot 1\]
  12. Final simplification0.0

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

Reproduce

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