Average Error: 0.0 → 0.0
Time: 26.6s
Precision: binary64
Cost: 320
\[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

Alternatives

Alternative 1
Error1.9
Cost520
\[\begin{array}{l} \mathbf{if}\;x \leq -1.0065751490311745 \lor \neg \left(x \leq 1.0188424201072874\right):\\ \;\;\;\;x \cdot x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 2
Error21.3
Cost64
\[x\]

Error

Derivation

  1. Initial program 0.0

    \[x + x \cdot x\]
  2. Using strategy rm
  3. Applied add-exp-log_binary64_386725.2

    \[\leadsto \color{blue}{e^{\log \left(x + x \cdot x\right)}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity_binary64_382925.2

    \[\leadsto e^{\log \left(\color{blue}{1 \cdot x} + x \cdot x\right)}\]
  6. Applied distribute-rgt-out_binary64_378225.2

    \[\leadsto e^{\log \color{blue}{\left(x \cdot \left(1 + x\right)\right)}}\]
  7. Applied log-prod_binary64_391535.1

    \[\leadsto e^{\color{blue}{\log x + \log \left(1 + x\right)}}\]
  8. Applied exp-sum_binary64_387535.0

    \[\leadsto \color{blue}{e^{\log x} \cdot e^{\log \left(1 + x\right)}}\]
  9. Simplified11.6

    \[\leadsto \color{blue}{x} \cdot e^{\log \left(1 + x\right)}\]
  10. Simplified0.0

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

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

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

Reproduce

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