Average Error: 0.0 → 0.0
Time: 2.9s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[y \cdot \left(z + x\right) + x\]
x + y \cdot \left(z + x\right)
y \cdot \left(z + x\right) + x
double f(double x, double y, double z) {
        double r115641 = x;
        double r115642 = y;
        double r115643 = z;
        double r115644 = r115643 + r115641;
        double r115645 = r115642 * r115644;
        double r115646 = r115641 + r115645;
        return r115646;
}

double f(double x, double y, double z) {
        double r115647 = y;
        double r115648 = z;
        double r115649 = x;
        double r115650 = r115648 + r115649;
        double r115651 = r115647 * r115650;
        double r115652 = r115651 + r115649;
        return r115652;
}

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 y \cdot \left(z + x\right) + x\]

Reproduce

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