Average Error: 0.1 → 0.1
Time: 830.0ms
Precision: binary64
\[\frac{\left(x \cdot 1 + y \cdot 2\right) + z \cdot 3}{3}\]
\[\frac{\left(x \cdot 1 + y \cdot 2\right) + z \cdot 3}{3}\]
\frac{\left(x \cdot 1 + y \cdot 2\right) + z \cdot 3}{3}
\frac{\left(x \cdot 1 + y \cdot 2\right) + z \cdot 3}{3}
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (((double) (x * 1.0)) + ((double) (y * 2.0)))) + ((double) (z * 3.0)))) / 3.0));
}
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (((double) (x * 1.0)) + ((double) (y * 2.0)))) + ((double) (z * 3.0)))) / 3.0));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{\left(x \cdot 1 + y \cdot 2\right) + z \cdot 3}{3}\]
  2. Final simplification0.1

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

Reproduce

herbie shell --seed 2020152 
(FPCore (x y z)
  :name "(/ (+ (+ (* x 1) (* y 2)) (* z 3)) 3)"
  :precision binary64
  (/ (+ (+ (* x 1.0) (* y 2.0)) (* z 3.0)) 3.0))