Average Error: 33.9 → 33.9
Time: 1.3s
Precision: binary64
\[\left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)\]
\[\left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)\]
\left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)
\left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)
double code(double x, double a, double b) {
	return ((double) (((double) (x + ((double) (a * b)))) - ((double) trunc(((double) (x + ((double) (a * b))))))));
}
double code(double x, double a, double b) {
	return ((double) (((double) (x + ((double) (a * b)))) - ((double) trunc(((double) (x + ((double) (a * b))))))));
}

Error

Bits error versus x

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 33.9

    \[\left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)\]
  2. Final simplification33.9

    \[\leadsto \left(x + a \cdot b\right) - \mathsf{trunc}\left(x + a \cdot b\right)\]

Reproduce

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