Average Error: 0.1 → 0.0
Time: 7.6s
Precision: binary64
\[\frac{\left(x + y\right) - z}{t \cdot 2}\]
\[\left(0.5 \cdot \frac{y}{t} + 0.5 \cdot \frac{x}{t}\right) - 0.5 \cdot \frac{z}{t}\]
\frac{\left(x + y\right) - z}{t \cdot 2}
\left(0.5 \cdot \frac{y}{t} + 0.5 \cdot \frac{x}{t}\right) - 0.5 \cdot \frac{z}{t}
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
(FPCore (x y z t)
 :precision binary64
 (- (+ (* 0.5 (/ y t)) (* 0.5 (/ x t))) (* 0.5 (/ z 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 ((0.5 * (y / t)) + (0.5 * (x / t))) - (0.5 * (z / 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. Taylor expanded around 0 0.0

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

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

Reproduce

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