Average Error: 10.6 → 10.6
Time: 1.1s
Precision: binary64
\[\frac{\left(x + y\right) + n \cdot z}{n}\]
\[\frac{\left(x + y\right) + n \cdot z}{n}\]
\frac{\left(x + y\right) + n \cdot z}{n}
\frac{\left(x + y\right) + n \cdot z}{n}
double code(double x, double y, double n, double z) {
	return ((double) (((double) (((double) (x + y)) + ((double) (n * z)))) / n));
}
double code(double x, double y, double n, double z) {
	return ((double) (((double) (((double) (x + y)) + ((double) (n * z)))) / n));
}

Error

Bits error versus x

Bits error versus y

Bits error versus n

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 10.6

    \[\frac{\left(x + y\right) + n \cdot z}{n}\]
  2. Final simplification10.6

    \[\leadsto \frac{\left(x + y\right) + n \cdot z}{n}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x y n z)
  :name "(/ (+ (+ x y) (* n z)) n)"
  :precision binary64
  (/ (+ (+ x y) (* n z)) n))