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

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 associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{\left(x + y\right) - z}{t}}{2}}\]
  4. Simplified0.1

    \[\leadsto \frac{\color{blue}{\frac{x + \left(y - z\right)}{t}}}{2}\]
  5. Using strategy rm
  6. Applied associate-+r-0.1

    \[\leadsto \frac{\frac{\color{blue}{\left(x + y\right) - z}}{t}}{2}\]
  7. Applied div-sub0.1

    \[\leadsto \frac{\color{blue}{\frac{x + y}{t} - \frac{z}{t}}}{2}\]
  8. Final simplification0.1

    \[\leadsto \frac{\frac{x + y}{t} - \frac{z}{t}}{2}\]

Reproduce

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