?

Average Error: 0.0 → 0.1
Time: 1.3min
Precision: binary64
Cost: 832

?

\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
\[\frac{z - y}{-2 \cdot t} - \frac{x}{-2 \cdot t} \]
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0)))
(FPCore (x y z t)
 :precision binary64
 (- (/ (- z y) (* -2.0 t)) (/ x (* -2.0 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 ((z - y) / (-2.0 * t)) - (x / (-2.0 * t));
}
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 = ((z - y) / ((-2.0d0) * t)) - (x / ((-2.0d0) * t))
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 ((z - y) / (-2.0 * t)) - (x / (-2.0 * t));
}
def code(x, y, z, t):
	return ((x + y) - z) / (t * 2.0)
def code(x, y, z, t):
	return ((z - y) / (-2.0 * t)) - (x / (-2.0 * t))
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(Float64(z - y) / Float64(-2.0 * t)) - Float64(x / Float64(-2.0 * t)))
end
function tmp = code(x, y, z, t)
	tmp = ((x + y) - z) / (t * 2.0);
end
function tmp = code(x, y, z, t)
	tmp = ((z - y) / (-2.0 * t)) - (x / (-2.0 * t));
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[(N[(z - y), $MachinePrecision] / N[(-2.0 * t), $MachinePrecision]), $MachinePrecision] - N[(x / N[(-2.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x + y\right) - z}{t \cdot 2}
\frac{z - y}{-2 \cdot t} - \frac{x}{-2 \cdot t}

Error?

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

    \[\leadsto \color{blue}{\frac{z - y}{-2 \cdot t} - \frac{x}{-2 \cdot t}} \]

Alternatives

Alternative 1
Error29.8
Cost848
\[\begin{array}{l} t_1 := \frac{x}{2 \cdot t}\\ t_2 := \frac{z}{-2 \cdot t}\\ \mathbf{if}\;x \leq -28000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-293}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{2 \cdot t}\\ \mathbf{elif}\;x \leq 32000000000000:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error10.1
Cost844
\[\begin{array}{l} t_1 := \frac{z - x}{-2 \cdot t}\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-36}:\\ \;\;\;\;\frac{\frac{y - z}{2}}{t}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+140}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \end{array} \]
Alternative 3
Error13.1
Cost712
\[\begin{array}{l} t_1 := \frac{z}{-2 \cdot t}\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+158}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{+109}:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error10.2
Cost712
\[\begin{array}{l} t_1 := 0.5 \cdot \frac{y + x}{t}\\ \mathbf{if}\;y \leq -3.8 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{z - x}{-2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error30.7
Cost584
\[\begin{array}{l} t_1 := \frac{x}{2 \cdot t}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{-55}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-35}:\\ \;\;\;\;\frac{y}{2 \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error0.3
Cost576
\[\frac{0.5}{t} \cdot \left(\left(x + y\right) - z\right) \]
Alternative 7
Error0.0
Cost576
\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
Alternative 8
Error41.5
Cost320
\[\frac{x}{2 \cdot t} \]

Error

Reproduce?

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