\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{\left(x + y\right) - z}{t \cdot 2}
\]
↓
\[0.5 \cdot \left(\frac{y}{t} + \frac{x - z}{t}\right)
\]
(FPCore (x y z t) :precision binary64 (/ (- (+ x y) z) (* t 2.0))) ↓
(FPCore (x y z t) :precision binary64 (* 0.5 (+ (/ y t) (/ (- 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) + ((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) + ((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) + ((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) + ((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(0.5 * Float64(Float64(y / t) + 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) + ((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[(0.5 * N[(N[(y / t), $MachinePrecision] + N[(N[(x - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x + y\right) - z}{t \cdot 2}
↓
0.5 \cdot \left(\frac{y}{t} + \frac{x - z}{t}\right)
Alternatives Alternative 1 Error 8.7 Cost 1236
\[\begin{array}{l}
t_1 := 0.5 \cdot \frac{x - z}{t}\\
\mathbf{if}\;y \leq 2.8 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-37}:\\
\;\;\;\;0.5 \cdot \frac{y - z}{t}\\
\mathbf{elif}\;y \leq 430000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+58}:\\
\;\;\;\;0.5 \cdot \frac{y + x}{t}\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\frac{y}{t} - \frac{z}{t}\right)\\
\end{array}
\]
Alternative 2 Error 8.8 Cost 1108
\[\begin{array}{l}
t_1 := 0.5 \cdot \frac{y - z}{t}\\
t_2 := 0.5 \cdot \frac{x - z}{t}\\
\mathbf{if}\;y \leq 3.15 \cdot 10^{-90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 500000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+55}:\\
\;\;\;\;0.5 \cdot \frac{y + x}{t}\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 3 Error 13.4 Cost 976
\[\begin{array}{l}
t_1 := \frac{z}{t} \cdot -0.5\\
t_2 := 0.5 \cdot \frac{y + x}{t}\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+131}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{+58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Error 26.5 Cost 848
\[\begin{array}{l}
t_1 := 0.5 \cdot \frac{y}{t}\\
t_2 := \frac{-0.5}{t} \cdot z\\
\mathbf{if}\;x \leq -3 \cdot 10^{+84}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-191}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-150}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 26.4 Cost 848
\[\begin{array}{l}
t_1 := 0.5 \cdot \frac{y}{t}\\
t_2 := \frac{z}{t} \cdot -0.5\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+84}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-192}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.62 \cdot 10^{-251}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-151}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 6 Error 9.7 Cost 844
\[\begin{array}{l}
t_1 := 0.5 \cdot \frac{y + x}{t}\\
t_2 := 0.5 \cdot \frac{x - z}{t}\\
\mathbf{if}\;y \leq 460000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+96}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 7 Error 0.3 Cost 576
\[\frac{0.5}{t} \cdot \left(x + \left(y - z\right)\right)
\]
Alternative 8 Error 0.1 Cost 576
\[\frac{\left(x + y\right) - z}{t \cdot 2}
\]
Alternative 9 Error 27.3 Cost 452
\[\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+14}:\\
\;\;\;\;0.5 \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{t}\\
\end{array}
\]
Alternative 10 Error 41.4 Cost 320
\[0.5 \cdot \frac{x}{t}
\]