Average Error: 0.0 → 0.0
Time: 701.0ms
Precision: binary64
\[\mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1\]
\[\mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1\]
\mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1
\mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1
double code(double x, double y) {
	return ((double) (((double) trunc(((double) (((double) (x - 1.0)) / y)))) + 1.0));
}
double code(double x, double y) {
	return ((double) (((double) trunc(((double) (((double) (x - 1.0)) / y)))) + 1.0));
}

Error

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

    \[\mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1\]
  2. Final simplification0.0

    \[\leadsto \mathsf{trunc}\left(\frac{x - 1}{y}\right) + 1\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x y)
  :name "(+ (trunc (/ (- x 1) y)) 1)"
  :precision binary64
  (+ (trunc (/ (- x 1.0) y)) 1.0))