\[\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 | 13636 |
|---|
\[\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;x \leq 1.15:\\
\;\;\;\;\frac{\frac{x + 1}{e^{x}} + \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 - x \cdot \left(t_0 \cdot -2\right)}{2}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 97.2% |
|---|
| Cost | 13440 |
|---|
\[\frac{e^{-x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}
\]
| Alternative 3 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 7492 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.35:\\
\;\;\;\;\frac{\frac{x + 1}{e^{x}} + \left(1 + -0.5 \cdot \left(x \cdot x\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 \cdot e^{-x}\right)}{2}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 7300 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 2.4:\\
\;\;\;\;\frac{\left(2 - x \cdot x\right) + 0.3333333333333333 \cdot {x}^{3}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 \cdot e^{-x}\right)}{2}\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 98.5% |
|---|
| Cost | 7044 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.15:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(2 \cdot e^{-x}\right)}{2}\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 98.4% |
|---|
| Cost | 580 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 1.4:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 98.2% |
|---|
| Cost | 196 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq 360:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 28.1% |
|---|
| Cost | 64 |
|---|
\[0
\]