?

Average Accuracy: 99.9% → 99.9%
Time: 8.0s
Precision: binary64
Cost: 832

?

\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\frac{\left(x + y\right) - z}{t \cdot 2} \]
\[0.5 \cdot \frac{y}{t} + 0.5 \cdot \frac{x - 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 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 - z) / 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 = (0.5d0 * (y / t)) + (0.5d0 * ((x - z) / 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 (0.5 * (y / t)) + (0.5 * ((x - z) / t));
}
def code(x, y, z, t):
	return ((x + y) - z) / (t * 2.0)
def code(x, y, z, t):
	return (0.5 * (y / t)) + (0.5 * ((x - z) / 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(0.5 * Float64(y / t)) + Float64(0.5 * Float64(Float64(x - z) / 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 = (0.5 * (y / t)) + (0.5 * ((x - z) / 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[(0.5 * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x + y\right) - z}{t \cdot 2}
0.5 \cdot \frac{y}{t} + 0.5 \cdot \frac{x - z}{t}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 99.9%

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

    \[\leadsto \color{blue}{0.5 \cdot \frac{y}{t} + 0.5 \cdot \frac{x - z}{t}} \]
  3. Final simplification99.9%

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

Alternatives

Alternative 1
Accuracy89.1%
Cost972
\[\begin{array}{l} t_1 := \frac{-0.5 \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;x \leq -1.4 \cdot 10^{+57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -0.052:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\frac{y}{t} - \frac{z}{t}\right)\\ \end{array} \]
Alternative 2
Accuracy89.0%
Cost844
\[\begin{array}{l} t_1 := \frac{-0.5 \cdot \left(z - x\right)}{t}\\ \mathbf{if}\;x \leq -1.76 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -0.03:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-45}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]
Alternative 3
Accuracy80.1%
Cost713
\[\begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+93} \lor \neg \left(z \leq 5.4 \cdot 10^{+103}\right):\\ \;\;\;\;\frac{z \cdot -0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \end{array} \]
Alternative 4
Accuracy58.2%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-146}:\\ \;\;\;\;\frac{x}{\frac{t}{0.5}}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{+77}:\\ \;\;\;\;\frac{z \cdot -0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]
Alternative 5
Accuracy85.9%
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-35}:\\ \;\;\;\;0.5 \cdot \frac{y + x}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y - z}{t}\\ \end{array} \]
Alternative 6
Accuracy99.6%
Cost576
\[\left(z - \left(y + x\right)\right) \cdot \frac{-0.5}{t} \]
Alternative 7
Accuracy99.9%
Cost576
\[\frac{\left(y + x\right) - z}{t \cdot 2} \]
Alternative 8
Accuracy55.9%
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{+34}:\\ \;\;\;\;x \cdot \frac{0.5}{t}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]
Alternative 9
Accuracy56.0%
Cost452
\[\begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{\frac{t}{0.5}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{y}{t}\\ \end{array} \]
Alternative 10
Accuracy35.9%
Cost320
\[0.5 \cdot \frac{y}{t} \]

Error

Reproduce?

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