Average Error: 0.1 → 0.0
Time: 1.6s
Precision: 64
\[\frac{\left(x + y\right) - z}{t \cdot 2}\]
\[\frac{\frac{\left(x + y\right) - z}{2}}{t}\]
\frac{\left(x + y\right) - z}{t \cdot 2}
\frac{\frac{\left(x + y\right) - z}{2}}{t}
double code(double x, double y, double z, double t) {
	return (((x + y) - z) / (t * 2.0));
}
double code(double x, double y, double z, double t) {
	return ((((x + y) - z) / 2.0) / t);
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\frac{\left(x + y\right) - z}{t \cdot 2}\]
  2. Using strategy rm
  3. Applied *-commutative0.1

    \[\leadsto \frac{\left(x + y\right) - z}{\color{blue}{2 \cdot t}}\]
  4. Applied associate-/r*0.0

    \[\leadsto \color{blue}{\frac{\frac{\left(x + y\right) - z}{2}}{t}}\]
  5. Final simplification0.0

    \[\leadsto \frac{\frac{\left(x + y\right) - z}{2}}{t}\]

Reproduce

herbie shell --seed 2020078 +o rules:numerics
(FPCore (x y z t)
  :name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, B"
  :precision binary64
  (/ (- (+ x y) z) (* t 2)))