Average Error: 0.0 → 0.0
Time: 24.0s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[\left(z \cdot y + x \cdot y\right) + x\]
x + y \cdot \left(z + x\right)
\left(z \cdot y + x \cdot y\right) + x
double f(double x, double y, double z) {
        double r4582870 = x;
        double r4582871 = y;
        double r4582872 = z;
        double r4582873 = r4582872 + r4582870;
        double r4582874 = r4582871 * r4582873;
        double r4582875 = r4582870 + r4582874;
        return r4582875;
}

double f(double x, double y, double z) {
        double r4582876 = z;
        double r4582877 = y;
        double r4582878 = r4582876 * r4582877;
        double r4582879 = x;
        double r4582880 = r4582879 * r4582877;
        double r4582881 = r4582878 + r4582880;
        double r4582882 = r4582881 + r4582879;
        return r4582882;
}

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. Final simplification0.0

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

Reproduce

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