Average Error: 0.3 → 0
Time: 339.0ms
Precision: 64
\[d \cdot 10 + d \cdot 20\]
\[d \cdot \left(10 + 20\right)\]
d \cdot 10 + d \cdot 20
d \cdot \left(10 + 20\right)
double code(double d) {
	return ((d * 10.0) + (d * 20.0));
}
double code(double d) {
	return (d * (10.0 + 20.0));
}

Error

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0
Herbie0
\[d \cdot 30\]

Derivation

  1. Initial program 0.3

    \[d \cdot 10 + d \cdot 20\]
  2. Simplified0

    \[\leadsto \color{blue}{d \cdot \left(10 + 20\right)}\]
  3. Final simplification0

    \[\leadsto d \cdot \left(10 + 20\right)\]

Reproduce

herbie shell --seed 2020106 
(FPCore (d)
  :name "FastMath test1"
  :precision binary64

  :herbie-target
  (* d 30)

  (+ (* d 10) (* d 20)))