Average Error: 0.0 → 0.0
Time: 2.7s
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 r154977 = x;
        double r154978 = y;
        double r154979 = z;
        double r154980 = r154979 + r154977;
        double r154981 = r154978 * r154980;
        double r154982 = r154977 + r154981;
        return r154982;
}

double f(double x, double y, double z) {
        double r154983 = x;
        double r154984 = z;
        double r154985 = y;
        double r154986 = r154984 * r154985;
        double r154987 = r154983 + r154986;
        double r154988 = r154985 * r154983;
        double r154989 = r154987 + r154988;
        return r154989;
}

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 2020039 
(FPCore (x y z)
  :name "Main:bigenough2 from A"
  :precision binary64
  (+ x (* y (+ z x))))