\[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\]
↓
\[\begin{array}{l}
t_0 := \frac{x + 1}{e^{x}}\\
\frac{t_0 + t_0}{2}
\end{array}
\]
(FPCore (x eps)
:precision binary64
(/
(-
(* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x))))
(* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x)))))
2.0))
↓
(FPCore (x eps)
:precision binary64
(let* ((t_0 (/ (+ x 1.0) (exp x)))) (/ (+ t_0 t_0) 2.0)))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
↓
double code(double x, double eps) {
double t_0 = (x + 1.0) / exp(x);
return (t_0 + t_0) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
↓
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
t_0 = (x + 1.0d0) / exp(x)
code = (t_0 + t_0) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
↓
public static double code(double x, double eps) {
double t_0 = (x + 1.0) / Math.exp(x);
return (t_0 + t_0) / 2.0;
}
def code(x, eps):
return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
↓
def code(x, eps):
t_0 = (x + 1.0) / math.exp(x)
return (t_0 + t_0) / 2.0
function code(x, eps)
return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0)
end
↓
function code(x, eps)
t_0 = Float64(Float64(x + 1.0) / exp(x))
return Float64(Float64(t_0 + t_0) / 2.0)
end
function tmp = code(x, eps)
tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
end
↓
function tmp = code(x, eps)
t_0 = (x + 1.0) / exp(x);
tmp = (t_0 + t_0) / 2.0;
end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
↓
code[x_, eps_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]]
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
↓
\begin{array}{l}
t_0 := \frac{x + 1}{e^{x}}\\
\frac{t_0 + t_0}{2}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 8004 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 2.1:\\
\;\;\;\;\frac{\frac{x + 1}{e^{x}} + \left(1 + \left(x \cdot x\right) \cdot \left(x \cdot \left(0.3333333333333333 + x \cdot -0.125\right) + -0.5\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 7812 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 350:\\
\;\;\;\;\frac{\left(1 + \left(x \cdot x\right) \cdot \left(-0.5 - x \cdot -0.3333333333333333\right)\right) + \left(x + 1\right) \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 98.4% |
|---|
| Cost | 1732 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.6:\\
\;\;\;\;\frac{\left(1 + \left(x \cdot x\right) \cdot \left(x \cdot \left(0.3333333333333333 + x \cdot -0.125\right) + -0.5\right)\right) + \left(1 + \left(x \cdot x\right) \cdot -0.5\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 98.4% |
|---|
| Cost | 1220 |
|---|
\[\begin{array}{l}
t_0 := 1 + \left(x \cdot x\right) \cdot -0.5\\
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{t_0 + t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 98.3% |
|---|
| Cost | 708 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\frac{2 - \left(x \cdot x\right) \cdot 0.5}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 98.3% |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 360:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 27.1% |
|---|
| Cost | 64 |
|---|
\[0
\]