Average Error: 10.1 → 0.3
Time: 2.6s
Precision: binary64
\[\]
\[\]
double code(double x, double y) {
	return ((double) (((double) (((double) (x * 3.0)) * x)) * y));
}
double code(double x, double y) {
	return ((double) (x * ((double) (((double) (x * 3.0)) * y))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.1
Target0.2
Herbie0.3
\[\]

Derivation

  1. Initial program 10.1

    \[\]
  2. Simplified0.3

    \[\leadsto \]
  3. Using strategy rm
  4. Applied associate-*r*0.3

    \[\leadsto \]
  5. Final simplification0.3

    \[\leadsto \]

Reproduce

herbie shell --seed 2020191 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :herbie-target
  (* (* x 3.0) (* x y))

  (* (* (* x 3.0) x) y))