Average Error: 0.0 → 0.0
Time: 7.3s
Precision: 64
\[x + y \cdot \left(z + x\right)\]
\[x + \left(x + z\right) \cdot y\]
x + y \cdot \left(z + x\right)
x + \left(x + z\right) \cdot y
double f(double x, double y, double z) {
        double r99139 = x;
        double r99140 = y;
        double r99141 = z;
        double r99142 = r99141 + r99139;
        double r99143 = r99140 * r99142;
        double r99144 = r99139 + r99143;
        return r99144;
}

double f(double x, double y, double z) {
        double r99145 = x;
        double r99146 = z;
        double r99147 = r99145 + r99146;
        double r99148 = y;
        double r99149 = r99147 * r99148;
        double r99150 = r99145 + r99149;
        return r99150;
}

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(y \cdot z + x\right)} + y \cdot x\]
  6. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{x + \left(z \cdot y + x \cdot y\right)}\]
  7. Simplified0.0

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

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

Reproduce

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