Average Error: 0.0 → 0.0
Time: 2.5s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[\left(x + z \cdot y\right) + y \cdot x\]
x + y \cdot \left(z + x\right)
\left(x + z \cdot y\right) + y \cdot x
double f(double x, double y, double z) {
        double r115794 = x;
        double r115795 = y;
        double r115796 = z;
        double r115797 = r115796 + r115794;
        double r115798 = r115795 * r115797;
        double r115799 = r115794 + r115798;
        return r115799;
}

double f(double x, double y, double z) {
        double r115800 = x;
        double r115801 = z;
        double r115802 = y;
        double r115803 = r115801 * r115802;
        double r115804 = r115800 + r115803;
        double r115805 = r115802 * r115800;
        double r115806 = r115804 + r115805;
        return r115806;
}

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 + y \cdot \left(z + x\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.0

    \[\leadsto x + \color{blue}{\left(y \cdot z + y \cdot x\right)}\]
  4. Applied associate-+r+0.0

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

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

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

Reproduce

herbie shell --seed 2020021 
(FPCore (x y z)
  :name "Main:bigenough2 from A"
  :precision binary64
  (+ x (* y (+ z x))))