Average Error: 0.0 → 0.0
Time: 1.1s
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 r122406 = x;
        double r122407 = y;
        double r122408 = z;
        double r122409 = r122408 + r122406;
        double r122410 = r122407 * r122409;
        double r122411 = r122406 + r122410;
        return r122411;
}

double f(double x, double y, double z) {
        double r122412 = x;
        double r122413 = z;
        double r122414 = y;
        double r122415 = r122413 * r122414;
        double r122416 = r122412 + r122415;
        double r122417 = r122414 * r122412;
        double r122418 = r122416 + r122417;
        return r122418;
}

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