Average Error: 0.0 → 0.0
Time: 552.0ms
Precision: binary64
\[x + x \cdot x\]
\[x \cdot \left(x + 1\right)\]
x + x \cdot x
x \cdot \left(x + 1\right)
(FPCore (x) :precision binary64 (+ x (* x x)))
(FPCore (x) :precision binary64 (* x (+ x 1.0)))
double code(double x) {
	return x + (x * x);
}
double code(double x) {
	return x * (x + 1.0);
}

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-identity_binary640.0

    \[\leadsto \color{blue}{1 \cdot x} + x \cdot x\]
  4. Applied distribute-rgt-out_binary640.0

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

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

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

Reproduce

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