Average Error: 0 → 0
Time: 313.0ms
Precision: binary64
\[\left(x \cdot 2\right) \cdot x\]
\[x \cdot \left(x \cdot 2\right)\]
\left(x \cdot 2\right) \cdot x
x \cdot \left(x \cdot 2\right)
(FPCore (x) :precision binary64 (* (* x 2.0) x))
(FPCore (x) :precision binary64 (* x (* x 2.0)))
double code(double x) {
	return (x * 2.0) * x;
}
double code(double x) {
	return x * (x * 2.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0
Target0
Herbie0
\[\left(2 \cdot x\right) \cdot x\]

Derivation

  1. Initial program 0

    \[\left(x \cdot 2\right) \cdot x\]
  2. Final simplification0

    \[\leadsto x \cdot \left(x \cdot 2\right)\]

Reproduce

herbie shell --seed 2020232 
(FPCore (x)
  :name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, A"
  :precision binary64

  :herbie-target
  (* (* 2.0 x) x)

  (* (* x 2.0) x))