Average Error: 0.0 → 0.0
Time: 3.0s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[\left(x + z \cdot y\right) + x \cdot y\]
x + y \cdot \left(z + x\right)
\left(x + z \cdot y\right) + x \cdot y
double f(double x, double y, double z) {
        double r124572 = x;
        double r124573 = y;
        double r124574 = z;
        double r124575 = r124574 + r124572;
        double r124576 = r124573 * r124575;
        double r124577 = r124572 + r124576;
        return r124577;
}

double f(double x, double y, double z) {
        double r124578 = x;
        double r124579 = z;
        double r124580 = y;
        double r124581 = r124579 * r124580;
        double r124582 = r124578 + r124581;
        double r124583 = r124578 * r124580;
        double r124584 = r124582 + r124583;
        return r124584;
}

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-rgt-in0.0

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

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

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

Reproduce

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