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

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.0

    \[\frac{\left(x + y\right) - z}{t \cdot 2}\]
  2. Taylor expanded around 0 0.1

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

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

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

Reproduce

herbie shell --seed 2020182 
(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)))