Average Error: 0.0 → 0.0
Time: 1.0s
Precision: binary64
\[a \cdot x + a \cdot y\]
\[a \cdot \left(x + y\right)\]
a \cdot x + a \cdot y
a \cdot \left(x + y\right)
double code(double a, double x, double y) {
	return ((double) (((double) (a * x)) + ((double) (a * y))));
}
double code(double a, double x, double y) {
	return ((double) (a * ((double) (x + y))));
}

Error

Bits error versus a

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[a \cdot x + a \cdot y\]
  2. Simplified0.0

    \[\leadsto \color{blue}{a \cdot \left(x + y\right)}\]
  3. Final simplification0.0

    \[\leadsto a \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2020153 
(FPCore (a x y)
  :name "(+ (* a x) (* a y))"
  :precision binary64
  (+ (* a x) (* a y)))