Average Error: 0.2 → 0.2
Time: 2.0s
Precision: binary64
\[\left(x \cdot 3\right) \cdot x\]
\[x \cdot \left(x \cdot 3\right)\]
\left(x \cdot 3\right) \cdot x
x \cdot \left(x \cdot 3\right)
double code(double x) {
	return ((double) (((double) (x * 3.0)) * x));
}
double code(double x) {
	return ((double) (x * ((double) (x * 3.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.2

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

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

Reproduce

herbie shell --seed 2020196 
(FPCore (x)
  :name "Diagrams.Tangent:$catParam from diagrams-lib-1.3.0.3, F"
  :precision binary64
  (* (* x 3.0) x))