Average Error: 0.0 → 0.0
Time: 3.1s
Precision: binary64
\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
\[0.5 \cdot \frac{x + y}{t} - \frac{z}{t \cdot 2} \]
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
(FPCore (x y z t)
 :precision binary64
 (- (* 0.5 (/ (+ x y) t)) (/ z (* t 2.0))))
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 * ((x + y) / t)) - (z / (t * 2.0));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x + y) - z) / (t * 2.0d0)
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (0.5d0 * ((x + y) / t)) - (z / (t * 2.0d0))
end function
public static double code(double x, double y, double z, double t) {
	return ((x + y) - z) / (t * 2.0);
}
public static double code(double x, double y, double z, double t) {
	return (0.5 * ((x + y) / t)) - (z / (t * 2.0));
}
def code(x, y, z, t):
	return ((x + y) - z) / (t * 2.0)
def code(x, y, z, t):
	return (0.5 * ((x + y) / t)) - (z / (t * 2.0))
function code(x, y, z, t)
	return Float64(Float64(Float64(x + y) - z) / Float64(t * 2.0))
end
function code(x, y, z, t)
	return Float64(Float64(0.5 * Float64(Float64(x + y) / t)) - Float64(z / Float64(t * 2.0)))
end
function tmp = code(x, y, z, t)
	tmp = ((x + y) - z) / (t * 2.0);
end
function tmp = code(x, y, z, t)
	tmp = (0.5 * ((x + y) / t)) - (z / (t * 2.0));
end
code[x_, y_, z_, t_] := N[(N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision] / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(N[(0.5 * N[(N[(x + y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(z / N[(t * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x + y\right) - z}{t \cdot 2}
0.5 \cdot \frac{x + y}{t} - \frac{z}{t \cdot 2}

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. Applied egg-rr0.0

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

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

Reproduce

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