Average Error: 0.0 → 0.0
Time: 3.3s
Precision: 64
\[x + x \cdot x\]
\[x \cdot \left(1 + x\right)\]
x + x \cdot x
x \cdot \left(1 + x\right)
double f(double x) {
        double r6072126 = x;
        double r6072127 = r6072126 * r6072126;
        double r6072128 = r6072126 + r6072127;
        return r6072128;
}

double f(double x) {
        double r6072129 = x;
        double r6072130 = 1.0;
        double r6072131 = r6072130 + r6072129;
        double r6072132 = r6072129 * r6072131;
        return r6072132;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x + x \cdot x\]
  2. Using strategy rm
  3. Applied distribute-rgt1-in0.0

    \[\leadsto \color{blue}{\left(x + 1\right) \cdot x}\]
  4. Final simplification0.0

    \[\leadsto x \cdot \left(1 + x\right)\]

Reproduce

herbie shell --seed 2019171 
(FPCore (x)
  :name "Main:bigenough1 from B"
  (+ x (* x x)))