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

Error

Bits error versus a

Bits error versus x

Bits error versus y

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(a \cdot \left(x - y\right) + b \cdot \left(x - y\right)\right) + c \cdot \left(x - y\right)\]
  2. Simplified0.0

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

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

Reproduce

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