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

Error

Bits error versus x

Bits error versus y

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x - 0.5 \cdot \left(y - 1\right)\right) \cdot a - b\]
  2. Final simplification0.0

    \[\leadsto \left(x - 0.5 \cdot \left(y - 1\right)\right) \cdot a - b\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x y a b)
  :name "(- (* (- x (* 0.5 (- y 1))) a) b)"
  :precision binary64
  (- (* (- x (* 0.5 (- y 1.0))) a) b))