Average Error: 0.0 → 0.0
Time: 2.6s
Precision: binary64
Cost: 448
\[d1 \cdot d2 + d1 \cdot d3\]
\[d1 \cdot d2 + d1 \cdot d3\]
d1 \cdot d2 + d1 \cdot d3
d1 \cdot d2 + d1 \cdot d3
(FPCore (d1 d2 d3) :precision binary64 (+ (* d1 d2) (* d1 d3)))
(FPCore (d1 d2 d3) :precision binary64 (+ (* d1 d2) (* d1 d3)))
double code(double d1, double d2, double d3) {
	return (d1 * d2) + (d1 * d3);
}
double code(double d1, double d2, double d3) {
	return (d1 * d2) + (d1 * d3);
}

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[d1 \cdot \left(d2 + d3\right)\]

Alternatives

Alternative 1
Error0.0
Cost320
\[d1 \cdot \left(d2 + d3\right)\]
Alternative 2
Error16.4
Cost520
\[\begin{array}{l} \mathbf{if}\;d3 \leq -6.949235449918628 \cdot 10^{+64} \lor \neg \left(d3 \leq 1.0651011586068433 \cdot 10^{-79}\right):\\ \;\;\;\;d1 \cdot d3\\ \mathbf{else}:\\ \;\;\;\;d1 \cdot d2\\ \end{array}\]
Alternative 3
Error30.5
Cost192
\[d1 \cdot d2\]
Alternative 4
Error58.8
Cost64
\[0\]
Alternative 5
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[d1 \cdot d2 + d1 \cdot d3\]
  2. Simplified0.0

    \[\leadsto \color{blue}{d1 \cdot d2 + d1 \cdot d3}\]
  3. Final simplification0.0

    \[\leadsto d1 \cdot d2 + d1 \cdot d3\]

Reproduce

herbie shell --seed 2021044 
(FPCore (d1 d2 d3)
  :name "FastMath dist"
  :precision binary64

  :herbie-target
  (* d1 (+ d2 d3))

  (+ (* d1 d2) (* d1 d3)))