Average Error: 0.0 → 0.0
Time: 30.2s
Precision: 64
\[x + x \cdot x\]
\[\left(x + 1\right) \cdot x\]
x + x \cdot x
\left(x + 1\right) \cdot x
double f(double x) {
        double r7588317 = x;
        double r7588318 = r7588317 * r7588317;
        double r7588319 = r7588317 + r7588318;
        return r7588319;
}

double f(double x) {
        double r7588320 = x;
        double r7588321 = 1.0;
        double r7588322 = r7588320 + r7588321;
        double r7588323 = r7588322 * r7588320;
        return r7588323;
}

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 *-un-lft-identity0.0

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

    \[\leadsto x + \color{blue}{\left(x \cdot 1\right) \cdot x}\]
  5. Applied distribute-rgt1-in0.0

    \[\leadsto \color{blue}{\left(x \cdot 1 + 1\right) \cdot x}\]
  6. Simplified0.0

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

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

Reproduce

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