Average Error: 0 → 0
Time: 544.0ms
Precision: binary64
Cost: 192
\[\left(\left(\left(x + x\right) + x\right) + x\right) + x\]
\[x \cdot 5\]
\left(\left(\left(x + x\right) + x\right) + x\right) + x
x \cdot 5
(FPCore (x) :precision binary64 (+ (+ (+ (+ x x) x) x) x))
(FPCore (x) :precision binary64 (* x 5.0))
double code(double x) {
	return (((x + x) + x) + x) + x;
}
double code(double x) {
	return x * 5.0;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error60.6
Cost385
\[\begin{array}{l} \mathbf{if}\;x \leq -3.89140349991603 \cdot 10^{-310}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 2
Error61.6
Cost64
\[0\]
Alternative 3
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 0

    \[\left(\left(\left(x + x\right) + x\right) + x\right) + x\]
  2. Simplified0

    \[\leadsto \color{blue}{x \cdot 5}\]
  3. Simplified0

    \[\leadsto \color{blue}{x \cdot 5}\]
  4. Final simplification0

    \[\leadsto x \cdot 5\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x)
  :name "Main:i from "
  :precision binary64
  (+ (+ (+ (+ x x) x) x) x))