
(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))
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;
}
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
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;
}
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
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 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
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]
\begin{array}{l}
\\
\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}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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))
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;
}
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
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;
}
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
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 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
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]
\begin{array}{l}
\\
\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}
\end{array}
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (+ x 1.0) (exp (- x)))))
(if (<= eps 2e-13)
(/ (+ t_0 t_0) 2.0)
(/ (+ (exp (* x (+ eps -1.0))) (exp (+ (- 1.0 (* eps x)) -1.0))) 2.0))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = (x + 1.0) * exp(-x);
double tmp;
if (eps <= 2e-13) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (exp((x * (eps + -1.0))) + exp(((1.0 - (eps * x)) + -1.0))) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (x + 1.0d0) * exp(-x)
if (eps <= 2d-13) then
tmp = (t_0 + t_0) / 2.0d0
else
tmp = (exp((x * (eps + (-1.0d0)))) + exp(((1.0d0 - (eps * x)) + (-1.0d0)))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double t_0 = (x + 1.0) * Math.exp(-x);
double tmp;
if (eps <= 2e-13) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (Math.exp((x * (eps + -1.0))) + Math.exp(((1.0 - (eps * x)) + -1.0))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = (x + 1.0) * math.exp(-x) tmp = 0 if eps <= 2e-13: tmp = (t_0 + t_0) / 2.0 else: tmp = (math.exp((x * (eps + -1.0))) + math.exp(((1.0 - (eps * x)) + -1.0))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = Float64(Float64(x + 1.0) * exp(Float64(-x))) tmp = 0.0 if (eps <= 2e-13) tmp = Float64(Float64(t_0 + t_0) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps + -1.0))) + exp(Float64(Float64(1.0 - Float64(eps * x)) + -1.0))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) t_0 = (x + 1.0) * exp(-x); tmp = 0.0; if (eps <= 2e-13) tmp = (t_0 + t_0) / 2.0; else tmp = (exp((x * (eps + -1.0))) + exp(((1.0 - (eps * x)) + -1.0))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function
code[x_, eps_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, 2e-13], N[(N[(t$95$0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(N[(1.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
t_0 := \left(x + 1\right) \cdot e^{-x}\\
\mathbf{if}\;\varepsilon \leq 2 \cdot 10^{-13}:\\
\;\;\;\;\frac{t_0 + t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(\varepsilon + -1\right)} + e^{\left(1 - \varepsilon \cdot x\right) + -1}}{2}\\
\end{array}
\end{array}
if eps < 2.0000000000000001e-13Initial program 64.5%
div-sub64.5%
+-rgt-identity64.5%
div-sub64.5%
Simplified64.5%
Taylor expanded in eps around 0 66.0%
*-commutative66.0%
distribute-lft1-in66.0%
mul-1-neg66.0%
distribute-lft-out66.0%
mul-1-neg66.0%
*-commutative66.0%
distribute-lft1-in67.1%
mul-1-neg67.1%
Simplified67.1%
if 2.0000000000000001e-13 < eps Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
mul-1-neg100.0%
associate-*r*100.0%
+-commutative100.0%
associate-*r*100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
+-commutative100.0%
expm1-log1p-u64.4%
expm1-udef64.4%
log1p-udef64.4%
add-exp-log100.0%
unsub-neg100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 100.0%
Final simplification76.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (+ x 1.0) (exp (- x)))))
(if (<= eps 2e-13)
(/ (+ t_0 t_0) 2.0)
(/ (+ (exp (- (* eps x) x)) (exp (* x (- -1.0 eps)))) 2.0))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = (x + 1.0) * exp(-x);
double tmp;
if (eps <= 2e-13) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (exp(((eps * x) - x)) + exp((x * (-1.0 - eps)))) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (x + 1.0d0) * exp(-x)
if (eps <= 2d-13) then
tmp = (t_0 + t_0) / 2.0d0
else
tmp = (exp(((eps * x) - x)) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double t_0 = (x + 1.0) * Math.exp(-x);
double tmp;
if (eps <= 2e-13) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (Math.exp(((eps * x) - x)) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = (x + 1.0) * math.exp(-x) tmp = 0 if eps <= 2e-13: tmp = (t_0 + t_0) / 2.0 else: tmp = (math.exp(((eps * x) - x)) + math.exp((x * (-1.0 - eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = Float64(Float64(x + 1.0) * exp(Float64(-x))) tmp = 0.0 if (eps <= 2e-13) tmp = Float64(Float64(t_0 + t_0) / 2.0); else tmp = Float64(Float64(exp(Float64(Float64(eps * x) - x)) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) t_0 = (x + 1.0) * exp(-x); tmp = 0.0; if (eps <= 2e-13) tmp = (t_0 + t_0) / 2.0; else tmp = (exp(((eps * x) - x)) + exp((x * (-1.0 - eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function
code[x_, eps_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps, 2e-13], N[(N[(t$95$0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
t_0 := \left(x + 1\right) \cdot e^{-x}\\
\mathbf{if}\;\varepsilon \leq 2 \cdot 10^{-13}:\\
\;\;\;\;\frac{t_0 + t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x - x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\end{array}
\end{array}
if eps < 2.0000000000000001e-13Initial program 64.5%
div-sub64.5%
+-rgt-identity64.5%
div-sub64.5%
Simplified64.5%
Taylor expanded in eps around 0 66.0%
*-commutative66.0%
distribute-lft1-in66.0%
mul-1-neg66.0%
distribute-lft-out66.0%
mul-1-neg66.0%
*-commutative66.0%
distribute-lft1-in67.1%
mul-1-neg67.1%
Simplified67.1%
if 2.0000000000000001e-13 < eps Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
mul-1-neg100.0%
associate-*r*100.0%
+-commutative100.0%
associate-*r*100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
+-commutative100.0%
expm1-log1p-u64.4%
expm1-udef64.4%
log1p-udef64.4%
add-exp-log100.0%
unsub-neg100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
distribute-neg-in100.0%
neg-mul-1100.0%
+-commutative100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
Simplified100.0%
Final simplification76.5%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (/ (+ (exp (- (* eps x) x)) (exp (* x (- -1.0 eps)))) 2.0))
eps = abs(eps);
double code(double x, double eps) {
return (exp(((eps * x) - x)) + exp((x * (-1.0 - eps)))) / 2.0;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (exp(((eps * x) - x)) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
return (Math.exp(((eps * x) - x)) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
eps = abs(eps) def code(x, eps): return (math.exp(((eps * x) - x)) + math.exp((x * (-1.0 - eps)))) / 2.0
eps = abs(eps) function code(x, eps) return Float64(Float64(exp(Float64(Float64(eps * x) - x)) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0) end
eps = abs(eps) function tmp = code(x, eps) tmp = (exp(((eps * x) - x)) + exp((x * (-1.0 - eps)))) / 2.0; end
NOTE: eps should be positive before calling this function code[x_, eps_] := N[(N[(N[Exp[N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps = |eps|\\
\\
\frac{e^{\varepsilon \cdot x - x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}
\end{array}
Initial program 74.6%
div-sub74.6%
+-rgt-identity74.6%
div-sub74.6%
Simplified74.6%
Taylor expanded in eps around inf 98.1%
mul-1-neg98.1%
*-commutative98.1%
mul-1-neg98.1%
associate-*r*98.1%
+-commutative98.1%
associate-*r*98.1%
mul-1-neg98.1%
*-commutative98.1%
distribute-rgt-neg-in98.1%
+-commutative98.1%
Simplified98.1%
distribute-rgt-neg-out98.1%
+-commutative98.1%
expm1-log1p-u60.2%
expm1-udef60.2%
log1p-udef60.2%
add-exp-log98.1%
unsub-neg98.1%
distribute-rgt-in98.1%
*-un-lft-identity98.1%
Applied egg-rr98.1%
Taylor expanded in x around inf 98.1%
+-commutative98.1%
distribute-neg-in98.1%
neg-mul-198.1%
+-commutative98.1%
sub-neg98.1%
distribute-rgt-out--98.1%
Simplified98.1%
Final simplification98.1%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -1e-250)
(/ (+ 1.0 (exp (* x (- -1.0 eps)))) 2.0)
(if (or (<= x 3.5e+100)
(and (not (<= x 5.8e+141))
(or (<= x 1e+253) (not (<= x 3.8e+283)))))
(/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0)
(/ (/ 2.0 (exp x)) 2.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -1e-250) {
tmp = (1.0 + exp((x * (-1.0 - eps)))) / 2.0;
} else if ((x <= 3.5e+100) || (!(x <= 5.8e+141) && ((x <= 1e+253) || !(x <= 3.8e+283)))) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = (2.0 / exp(x)) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-1d-250)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps)))) / 2.0d0
else if ((x <= 3.5d+100) .or. (.not. (x <= 5.8d+141)) .and. (x <= 1d+253) .or. (.not. (x <= 3.8d+283))) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
else
tmp = (2.0d0 / exp(x)) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= -1e-250) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps)))) / 2.0;
} else if ((x <= 3.5e+100) || (!(x <= 5.8e+141) && ((x <= 1e+253) || !(x <= 3.8e+283)))) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = (2.0 / Math.exp(x)) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -1e-250: tmp = (1.0 + math.exp((x * (-1.0 - eps)))) / 2.0 elif (x <= 3.5e+100) or (not (x <= 5.8e+141) and ((x <= 1e+253) or not (x <= 3.8e+283))): tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = (2.0 / math.exp(x)) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -1e-250) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0); elseif ((x <= 3.5e+100) || (!(x <= 5.8e+141) && ((x <= 1e+253) || !(x <= 3.8e+283)))) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = Float64(Float64(2.0 / exp(x)) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1e-250) tmp = (1.0 + exp((x * (-1.0 - eps)))) / 2.0; elseif ((x <= 3.5e+100) || (~((x <= 5.8e+141)) && ((x <= 1e+253) || ~((x <= 3.8e+283))))) tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; else tmp = (2.0 / exp(x)) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, -1e-250], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 3.5e+100], And[N[Not[LessEqual[x, 5.8e+141]], $MachinePrecision], Or[LessEqual[x, 1e+253], N[Not[LessEqual[x, 3.8e+283]], $MachinePrecision]]]], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-250}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+100} \lor \neg \left(x \leq 5.8 \cdot 10^{+141}\right) \land \left(x \leq 10^{+253} \lor \neg \left(x \leq 3.8 \cdot 10^{+283}\right)\right):\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{e^{x}}}{2}\\
\end{array}
\end{array}
if x < -1.0000000000000001e-250Initial program 76.0%
div-sub76.0%
+-rgt-identity76.0%
div-sub76.0%
Simplified76.0%
Taylor expanded in x around 0 41.0%
Taylor expanded in eps around inf 60.4%
cancel-sign-sub-inv60.4%
metadata-eval60.4%
*-lft-identity60.4%
exp-prod60.4%
+-commutative60.4%
remove-double-neg60.4%
mul-1-neg60.4%
sub-neg60.4%
exp-prod60.4%
remove-double-neg60.4%
mul-1-neg60.4%
sub-neg60.4%
mul-1-neg60.4%
mul-1-neg60.4%
*-commutative60.4%
cancel-sign-sub-inv60.4%
Simplified60.4%
if -1.0000000000000001e-250 < x < 3.49999999999999976e100 or 5.80000000000000013e141 < x < 9.9999999999999994e252 or 3.8000000000000002e283 < x Initial program 70.0%
Simplified65.5%
Taylor expanded in eps around inf 99.0%
Taylor expanded in x around 0 68.7%
if 3.49999999999999976e100 < x < 5.80000000000000013e141 or 9.9999999999999994e252 < x < 3.8000000000000002e283Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
mul-1-neg100.0%
associate-*r*100.0%
+-commutative100.0%
associate-*r*100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
+-commutative100.0%
expm1-log1p-u5.0%
expm1-udef5.0%
log1p-udef5.0%
add-exp-log100.0%
unsub-neg100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in eps around 0 80.3%
exp-neg80.3%
associate-*r/80.3%
metadata-eval80.3%
Simplified80.3%
Final simplification66.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* x (- -1.0 eps))))
(if (<= x -3e-255)
(/ (+ 1.0 (exp t_0)) 2.0)
(if (<= x 3.7e+72)
(/ (+ (+ 1.0 t_0) (exp (* eps x))) 2.0)
(if (or (<= x 2.3e+142) (and (not (<= x 6.3e+252)) (<= x 3.8e+283)))
(/ (/ 2.0 (exp x)) 2.0)
(/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0))))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = x * (-1.0 - eps);
double tmp;
if (x <= -3e-255) {
tmp = (1.0 + exp(t_0)) / 2.0;
} else if (x <= 3.7e+72) {
tmp = ((1.0 + t_0) + exp((eps * x))) / 2.0;
} else if ((x <= 2.3e+142) || (!(x <= 6.3e+252) && (x <= 3.8e+283))) {
tmp = (2.0 / exp(x)) / 2.0;
} else {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) - eps)
if (x <= (-3d-255)) then
tmp = (1.0d0 + exp(t_0)) / 2.0d0
else if (x <= 3.7d+72) then
tmp = ((1.0d0 + t_0) + exp((eps * x))) / 2.0d0
else if ((x <= 2.3d+142) .or. (.not. (x <= 6.3d+252)) .and. (x <= 3.8d+283)) then
tmp = (2.0d0 / exp(x)) / 2.0d0
else
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double t_0 = x * (-1.0 - eps);
double tmp;
if (x <= -3e-255) {
tmp = (1.0 + Math.exp(t_0)) / 2.0;
} else if (x <= 3.7e+72) {
tmp = ((1.0 + t_0) + Math.exp((eps * x))) / 2.0;
} else if ((x <= 2.3e+142) || (!(x <= 6.3e+252) && (x <= 3.8e+283))) {
tmp = (2.0 / Math.exp(x)) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = x * (-1.0 - eps) tmp = 0 if x <= -3e-255: tmp = (1.0 + math.exp(t_0)) / 2.0 elif x <= 3.7e+72: tmp = ((1.0 + t_0) + math.exp((eps * x))) / 2.0 elif (x <= 2.3e+142) or (not (x <= 6.3e+252) and (x <= 3.8e+283)): tmp = (2.0 / math.exp(x)) / 2.0 else: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = Float64(x * Float64(-1.0 - eps)) tmp = 0.0 if (x <= -3e-255) tmp = Float64(Float64(1.0 + exp(t_0)) / 2.0); elseif (x <= 3.7e+72) tmp = Float64(Float64(Float64(1.0 + t_0) + exp(Float64(eps * x))) / 2.0); elseif ((x <= 2.3e+142) || (!(x <= 6.3e+252) && (x <= 3.8e+283))) tmp = Float64(Float64(2.0 / exp(x)) / 2.0); else tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) t_0 = x * (-1.0 - eps); tmp = 0.0; if (x <= -3e-255) tmp = (1.0 + exp(t_0)) / 2.0; elseif (x <= 3.7e+72) tmp = ((1.0 + t_0) + exp((eps * x))) / 2.0; elseif ((x <= 2.3e+142) || (~((x <= 6.3e+252)) && (x <= 3.8e+283))) tmp = (2.0 / exp(x)) / 2.0; else tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function
code[x_, eps_] := Block[{t$95$0 = N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e-255], N[(N[(1.0 + N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.7e+72], N[(N[(N[(1.0 + t$95$0), $MachinePrecision] + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 2.3e+142], And[N[Not[LessEqual[x, 6.3e+252]], $MachinePrecision], LessEqual[x, 3.8e+283]]], N[(N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
t_0 := x \cdot \left(-1 - \varepsilon\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{-255}:\\
\;\;\;\;\frac{1 + e^{t_0}}{2}\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+72}:\\
\;\;\;\;\frac{\left(1 + t_0\right) + e^{\varepsilon \cdot x}}{2}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+142} \lor \neg \left(x \leq 6.3 \cdot 10^{+252}\right) \land x \leq 3.8 \cdot 10^{+283}:\\
\;\;\;\;\frac{\frac{2}{e^{x}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\end{array}
\end{array}
if x < -3.00000000000000002e-255Initial program 76.0%
div-sub76.0%
+-rgt-identity76.0%
div-sub76.0%
Simplified76.0%
Taylor expanded in x around 0 41.0%
Taylor expanded in eps around inf 60.4%
cancel-sign-sub-inv60.4%
metadata-eval60.4%
*-lft-identity60.4%
exp-prod60.4%
+-commutative60.4%
remove-double-neg60.4%
mul-1-neg60.4%
sub-neg60.4%
exp-prod60.4%
remove-double-neg60.4%
mul-1-neg60.4%
sub-neg60.4%
mul-1-neg60.4%
mul-1-neg60.4%
*-commutative60.4%
cancel-sign-sub-inv60.4%
Simplified60.4%
if -3.00000000000000002e-255 < x < 3.7000000000000002e72Initial program 57.9%
Simplified51.5%
Taylor expanded in eps around inf 98.5%
Taylor expanded in x around 0 79.9%
mul-1-neg79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in eps around inf 80.0%
*-commutative80.0%
Simplified80.0%
if 3.7000000000000002e72 < x < 2.30000000000000002e142 or 6.3000000000000004e252 < x < 3.8000000000000002e283Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
mul-1-neg100.0%
associate-*r*100.0%
+-commutative100.0%
associate-*r*100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
+-commutative100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
+-commutative100.0%
expm1-log1p-u6.3%
expm1-udef6.3%
log1p-udef6.3%
add-exp-log100.0%
unsub-neg100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
Applied egg-rr100.0%
Taylor expanded in eps around 0 69.2%
exp-neg69.2%
associate-*r/69.2%
metadata-eval69.2%
Simplified69.2%
if 2.30000000000000002e142 < x < 6.3000000000000004e252 or 3.8000000000000002e283 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 41.2%
Final simplification67.0%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= eps 5.2e+127) (/ (/ 2.0 (exp x)) 2.0) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0)))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (eps <= 5.2e+127) {
tmp = (2.0 / exp(x)) / 2.0;
} else {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (eps <= 5.2d+127) then
tmp = (2.0d0 / exp(x)) / 2.0d0
else
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (eps <= 5.2e+127) {
tmp = (2.0 / Math.exp(x)) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if eps <= 5.2e+127: tmp = (2.0 / math.exp(x)) / 2.0 else: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (eps <= 5.2e+127) tmp = Float64(Float64(2.0 / exp(x)) / 2.0); else tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (eps <= 5.2e+127) tmp = (2.0 / exp(x)) / 2.0; else tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[eps, 5.2e+127], N[(N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq 5.2 \cdot 10^{+127}:\\
\;\;\;\;\frac{\frac{2}{e^{x}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\end{array}
\end{array}
if eps < 5.2000000000000004e127Initial program 69.9%
div-sub69.9%
+-rgt-identity69.9%
div-sub69.9%
Simplified69.9%
Taylor expanded in eps around inf 97.7%
mul-1-neg97.7%
*-commutative97.7%
mul-1-neg97.7%
associate-*r*97.7%
+-commutative97.7%
associate-*r*97.7%
mul-1-neg97.7%
*-commutative97.7%
distribute-rgt-neg-in97.7%
+-commutative97.7%
Simplified97.7%
distribute-rgt-neg-out97.7%
+-commutative97.7%
expm1-log1p-u60.7%
expm1-udef60.7%
log1p-udef60.7%
add-exp-log97.7%
unsub-neg97.7%
distribute-rgt-in97.7%
*-un-lft-identity97.7%
Applied egg-rr97.7%
Taylor expanded in eps around 0 77.2%
exp-neg77.2%
associate-*r/77.2%
metadata-eval77.2%
Simplified77.2%
if 5.2000000000000004e127 < eps Initial program 100.0%
Simplified90.3%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 58.8%
Final simplification74.4%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (or (<= x 1.2e+165) (not (<= x 1.6e+224)))
(/ (/ 2.0 (exp x)) 2.0)
(/
(+ 2.0 (* x (+ (/ 1.0 eps) (* (- 1.0 eps) (+ -1.0 (/ -1.0 eps))))))
2.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if ((x <= 1.2e+165) || !(x <= 1.6e+224)) {
tmp = (2.0 / exp(x)) / 2.0;
} else {
tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if ((x <= 1.2d+165) .or. (.not. (x <= 1.6d+224))) then
tmp = (2.0d0 / exp(x)) / 2.0d0
else
tmp = (2.0d0 + (x * ((1.0d0 / eps) + ((1.0d0 - eps) * ((-1.0d0) + ((-1.0d0) / eps)))))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if ((x <= 1.2e+165) || !(x <= 1.6e+224)) {
tmp = (2.0 / Math.exp(x)) / 2.0;
} else {
tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if (x <= 1.2e+165) or not (x <= 1.6e+224): tmp = (2.0 / math.exp(x)) / 2.0 else: tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if ((x <= 1.2e+165) || !(x <= 1.6e+224)) tmp = Float64(Float64(2.0 / exp(x)) / 2.0); else tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(1.0 / eps) + Float64(Float64(1.0 - eps) * Float64(-1.0 + Float64(-1.0 / eps)))))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if ((x <= 1.2e+165) || ~((x <= 1.6e+224))) tmp = (2.0 / exp(x)) / 2.0; else tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[Or[LessEqual[x, 1.2e+165], N[Not[LessEqual[x, 1.6e+224]], $MachinePrecision]], N[(N[(2.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 + N[(x * N[(N[(1.0 / eps), $MachinePrecision] + N[(N[(1.0 - eps), $MachinePrecision] * N[(-1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2 \cdot 10^{+165} \lor \neg \left(x \leq 1.6 \cdot 10^{+224}\right):\\
\;\;\;\;\frac{\frac{2}{e^{x}}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(\frac{1}{\varepsilon} + \left(1 - \varepsilon\right) \cdot \left(-1 + \frac{-1}{\varepsilon}\right)\right)}{2}\\
\end{array}
\end{array}
if x < 1.2e165 or 1.60000000000000007e224 < x Initial program 73.0%
div-sub73.0%
+-rgt-identity73.0%
div-sub73.0%
Simplified73.0%
Taylor expanded in eps around inf 97.9%
mul-1-neg97.9%
*-commutative97.9%
mul-1-neg97.9%
associate-*r*97.9%
+-commutative97.9%
associate-*r*97.9%
mul-1-neg97.9%
*-commutative97.9%
distribute-rgt-neg-in97.9%
+-commutative97.9%
Simplified97.9%
distribute-rgt-neg-out97.9%
+-commutative97.9%
expm1-log1p-u61.0%
expm1-udef61.0%
log1p-udef61.0%
add-exp-log97.9%
unsub-neg97.9%
distribute-rgt-in97.9%
*-un-lft-identity97.9%
Applied egg-rr97.9%
Taylor expanded in eps around 0 74.0%
exp-neg74.0%
associate-*r/74.0%
metadata-eval74.0%
Simplified74.0%
if 1.2e165 < x < 1.60000000000000007e224Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in eps around 0 27.5%
Final simplification71.3%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 8.5)
(/ (+ 2.0 (* (* eps x) (+ -1.0 (/ 1.0 eps)))) 2.0)
(if (<= x 3.8e+164)
0.0
(if (<= x 4e+225)
(/
(+ 2.0 (* x (+ (/ 1.0 eps) (* (- 1.0 eps) (+ -1.0 (/ -1.0 eps))))))
2.0)
0.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 8.5) {
tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0;
} else if (x <= 3.8e+164) {
tmp = 0.0;
} else if (x <= 4e+225) {
tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 8.5d0) then
tmp = (2.0d0 + ((eps * x) * ((-1.0d0) + (1.0d0 / eps)))) / 2.0d0
else if (x <= 3.8d+164) then
tmp = 0.0d0
else if (x <= 4d+225) then
tmp = (2.0d0 + (x * ((1.0d0 / eps) + ((1.0d0 - eps) * ((-1.0d0) + ((-1.0d0) / eps)))))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= 8.5) {
tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0;
} else if (x <= 3.8e+164) {
tmp = 0.0;
} else if (x <= 4e+225) {
tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 8.5: tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0 elif x <= 3.8e+164: tmp = 0.0 elif x <= 4e+225: tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 8.5) tmp = Float64(Float64(2.0 + Float64(Float64(eps * x) * Float64(-1.0 + Float64(1.0 / eps)))) / 2.0); elseif (x <= 3.8e+164) tmp = 0.0; elseif (x <= 4e+225) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(1.0 / eps) + Float64(Float64(1.0 - eps) * Float64(-1.0 + Float64(-1.0 / eps)))))) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 8.5) tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0; elseif (x <= 3.8e+164) tmp = 0.0; elseif (x <= 4e+225) tmp = (2.0 + (x * ((1.0 / eps) + ((1.0 - eps) * (-1.0 + (-1.0 / eps)))))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 8.5], N[(N[(2.0 + N[(N[(eps * x), $MachinePrecision] * N[(-1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.8e+164], 0.0, If[LessEqual[x, 4e+225], N[(N[(2.0 + N[(x * N[(N[(1.0 / eps), $MachinePrecision] + N[(N[(1.0 - eps), $MachinePrecision] * N[(-1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5:\\
\;\;\;\;\frac{2 + \left(\varepsilon \cdot x\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{2}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+164}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+225}:\\
\;\;\;\;\frac{2 + x \cdot \left(\frac{1}{\varepsilon} + \left(1 - \varepsilon\right) \cdot \left(-1 + \frac{-1}{\varepsilon}\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 8.5Initial program 64.7%
div-sub64.7%
+-rgt-identity64.7%
div-sub64.7%
Simplified64.7%
Taylor expanded in x around 0 42.3%
Taylor expanded in x around 0 47.7%
Taylor expanded in eps around inf 61.9%
if 8.5 < x < 3.80000000000000021e164 or 3.99999999999999971e225 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 55.1%
div-sub55.1%
rec-exp55.1%
mul-1-neg55.1%
+-inverses55.1%
Simplified55.1%
if 3.80000000000000021e164 < x < 3.99999999999999971e225Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in eps around 0 27.5%
Final simplification58.4%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 8.5) (/ (+ 2.0 (* (* eps x) (+ -1.0 (/ 1.0 eps)))) 2.0) (if (<= x 2.8e+162) 0.0 (if (<= x 1.35e+225) (* (* eps x) 0.5) 0.0))))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 8.5) {
tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0;
} else if (x <= 2.8e+162) {
tmp = 0.0;
} else if (x <= 1.35e+225) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 8.5d0) then
tmp = (2.0d0 + ((eps * x) * ((-1.0d0) + (1.0d0 / eps)))) / 2.0d0
else if (x <= 2.8d+162) then
tmp = 0.0d0
else if (x <= 1.35d+225) then
tmp = (eps * x) * 0.5d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= 8.5) {
tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0;
} else if (x <= 2.8e+162) {
tmp = 0.0;
} else if (x <= 1.35e+225) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 8.5: tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0 elif x <= 2.8e+162: tmp = 0.0 elif x <= 1.35e+225: tmp = (eps * x) * 0.5 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 8.5) tmp = Float64(Float64(2.0 + Float64(Float64(eps * x) * Float64(-1.0 + Float64(1.0 / eps)))) / 2.0); elseif (x <= 2.8e+162) tmp = 0.0; elseif (x <= 1.35e+225) tmp = Float64(Float64(eps * x) * 0.5); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 8.5) tmp = (2.0 + ((eps * x) * (-1.0 + (1.0 / eps)))) / 2.0; elseif (x <= 2.8e+162) tmp = 0.0; elseif (x <= 1.35e+225) tmp = (eps * x) * 0.5; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 8.5], N[(N[(2.0 + N[(N[(eps * x), $MachinePrecision] * N[(-1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.8e+162], 0.0, If[LessEqual[x, 1.35e+225], N[(N[(eps * x), $MachinePrecision] * 0.5), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5:\\
\;\;\;\;\frac{2 + \left(\varepsilon \cdot x\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{2}\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+162}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+225}:\\
\;\;\;\;\left(\varepsilon \cdot x\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 8.5Initial program 64.7%
div-sub64.7%
+-rgt-identity64.7%
div-sub64.7%
Simplified64.7%
Taylor expanded in x around 0 42.3%
Taylor expanded in x around 0 47.7%
Taylor expanded in eps around inf 61.9%
if 8.5 < x < 2.79999999999999991e162 or 1.3499999999999999e225 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 55.1%
div-sub55.1%
rec-exp55.1%
mul-1-neg55.1%
+-inverses55.1%
Simplified55.1%
if 2.79999999999999991e162 < x < 1.3499999999999999e225Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 33.8%
Taylor expanded in eps around inf 27.4%
*-commutative27.4%
*-commutative27.4%
Simplified27.4%
Final simplification58.4%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -1.0)
(* (* eps x) -0.5)
(if (<= x 8.2e+29)
1.0
(if (<= x 7.5e+163) 0.0 (if (<= x 8e+221) (* (* eps x) 0.5) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (eps * x) * -0.5;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else if (x <= 7.5e+163) {
tmp = 0.0;
} else if (x <= 8e+221) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (eps * x) * (-0.5d0)
else if (x <= 8.2d+29) then
tmp = 1.0d0
else if (x <= 7.5d+163) then
tmp = 0.0d0
else if (x <= 8d+221) then
tmp = (eps * x) * 0.5d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (eps * x) * -0.5;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else if (x <= 7.5e+163) {
tmp = 0.0;
} else if (x <= 8e+221) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -1.0: tmp = (eps * x) * -0.5 elif x <= 8.2e+29: tmp = 1.0 elif x <= 7.5e+163: tmp = 0.0 elif x <= 8e+221: tmp = (eps * x) * 0.5 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(eps * x) * -0.5); elseif (x <= 8.2e+29) tmp = 1.0; elseif (x <= 7.5e+163) tmp = 0.0; elseif (x <= 8e+221) tmp = Float64(Float64(eps * x) * 0.5); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.0) tmp = (eps * x) * -0.5; elseif (x <= 8.2e+29) tmp = 1.0; elseif (x <= 7.5e+163) tmp = 0.0; elseif (x <= 8e+221) tmp = (eps * x) * 0.5; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, -1.0], N[(N[(eps * x), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 8.2e+29], 1.0, If[LessEqual[x, 7.5e+163], 0.0, If[LessEqual[x, 8e+221], N[(N[(eps * x), $MachinePrecision] * 0.5), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(\varepsilon \cdot x\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+29}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+163}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+221}:\\
\;\;\;\;\left(\varepsilon \cdot x\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 95.6%
div-sub95.6%
+-rgt-identity95.6%
div-sub95.6%
Simplified95.6%
Taylor expanded in x around 0 41.8%
Taylor expanded in x around 0 23.4%
Taylor expanded in eps around inf 23.3%
*-commutative23.3%
Simplified23.3%
if -1 < x < 8.2000000000000007e29Initial program 55.6%
div-sub55.6%
+-rgt-identity55.6%
div-sub55.6%
Simplified55.6%
Taylor expanded in x around 0 43.7%
Taylor expanded in x around 0 54.5%
Taylor expanded in x around 0 73.9%
if 8.2000000000000007e29 < x < 7.50000000000000001e163 or 8.0000000000000004e221 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 58.1%
div-sub58.1%
rec-exp58.1%
mul-1-neg58.1%
+-inverses58.1%
Simplified58.1%
if 7.50000000000000001e163 < x < 8.0000000000000004e221Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 33.8%
Taylor expanded in eps around inf 27.4%
*-commutative27.4%
*-commutative27.4%
Simplified27.4%
Final simplification59.0%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -1.0)
(/ (+ 2.0 (- (/ x eps) (* eps x))) 2.0)
(if (<= x 8.2e+29)
1.0
(if (<= x 3.6e+169) 0.0 (if (<= x 7.2e+223) (* (* eps x) 0.5) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (2.0 + ((x / eps) - (eps * x))) / 2.0;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else if (x <= 3.6e+169) {
tmp = 0.0;
} else if (x <= 7.2e+223) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (2.0d0 + ((x / eps) - (eps * x))) / 2.0d0
else if (x <= 8.2d+29) then
tmp = 1.0d0
else if (x <= 3.6d+169) then
tmp = 0.0d0
else if (x <= 7.2d+223) then
tmp = (eps * x) * 0.5d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (2.0 + ((x / eps) - (eps * x))) / 2.0;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else if (x <= 3.6e+169) {
tmp = 0.0;
} else if (x <= 7.2e+223) {
tmp = (eps * x) * 0.5;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -1.0: tmp = (2.0 + ((x / eps) - (eps * x))) / 2.0 elif x <= 8.2e+29: tmp = 1.0 elif x <= 3.6e+169: tmp = 0.0 elif x <= 7.2e+223: tmp = (eps * x) * 0.5 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(2.0 + Float64(Float64(x / eps) - Float64(eps * x))) / 2.0); elseif (x <= 8.2e+29) tmp = 1.0; elseif (x <= 3.6e+169) tmp = 0.0; elseif (x <= 7.2e+223) tmp = Float64(Float64(eps * x) * 0.5); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.0) tmp = (2.0 + ((x / eps) - (eps * x))) / 2.0; elseif (x <= 8.2e+29) tmp = 1.0; elseif (x <= 3.6e+169) tmp = 0.0; elseif (x <= 7.2e+223) tmp = (eps * x) * 0.5; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, -1.0], N[(N[(2.0 + N[(N[(x / eps), $MachinePrecision] - N[(eps * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.2e+29], 1.0, If[LessEqual[x, 3.6e+169], 0.0, If[LessEqual[x, 7.2e+223], N[(N[(eps * x), $MachinePrecision] * 0.5), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{2 + \left(\frac{x}{\varepsilon} - \varepsilon \cdot x\right)}{2}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+29}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+169}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+223}:\\
\;\;\;\;\left(\varepsilon \cdot x\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 95.6%
div-sub95.6%
+-rgt-identity95.6%
div-sub95.6%
Simplified95.6%
Taylor expanded in x around 0 41.8%
Taylor expanded in x around 0 23.4%
Taylor expanded in eps around 0 23.4%
neg-mul-123.4%
associate-+r+23.4%
mul-1-neg23.4%
distribute-neg-in23.4%
distribute-lft1-in23.4%
*-commutative23.4%
distribute-rgt-neg-out23.4%
+-commutative23.4%
associate-+r+23.4%
Simplified23.4%
if -1 < x < 8.2000000000000007e29Initial program 55.6%
div-sub55.6%
+-rgt-identity55.6%
div-sub55.6%
Simplified55.6%
Taylor expanded in x around 0 43.7%
Taylor expanded in x around 0 54.5%
Taylor expanded in x around 0 73.9%
if 8.2000000000000007e29 < x < 3.6000000000000001e169 or 7.19999999999999982e223 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 58.1%
div-sub58.1%
rec-exp58.1%
mul-1-neg58.1%
+-inverses58.1%
Simplified58.1%
if 3.6000000000000001e169 < x < 7.19999999999999982e223Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 33.8%
Taylor expanded in eps around inf 27.4%
*-commutative27.4%
*-commutative27.4%
Simplified27.4%
Final simplification59.0%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x -1.0) (* (* eps x) -0.5) (if (<= x 8.2e+29) 1.0 0.0)))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (eps * x) * -0.5;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (eps * x) * (-0.5d0)
else if (x <= 8.2d+29) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= -1.0) {
tmp = (eps * x) * -0.5;
} else if (x <= 8.2e+29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -1.0: tmp = (eps * x) * -0.5 elif x <= 8.2e+29: tmp = 1.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(eps * x) * -0.5); elseif (x <= 8.2e+29) tmp = 1.0; else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.0) tmp = (eps * x) * -0.5; elseif (x <= 8.2e+29) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, -1.0], N[(N[(eps * x), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 8.2e+29], 1.0, 0.0]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(\varepsilon \cdot x\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+29}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 95.6%
div-sub95.6%
+-rgt-identity95.6%
div-sub95.6%
Simplified95.6%
Taylor expanded in x around 0 41.8%
Taylor expanded in x around 0 23.4%
Taylor expanded in eps around inf 23.3%
*-commutative23.3%
Simplified23.3%
if -1 < x < 8.2000000000000007e29Initial program 55.6%
div-sub55.6%
+-rgt-identity55.6%
div-sub55.6%
Simplified55.6%
Taylor expanded in x around 0 43.7%
Taylor expanded in x around 0 54.5%
Taylor expanded in x around 0 73.9%
if 8.2000000000000007e29 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 51.5%
div-sub51.5%
rec-exp51.5%
mul-1-neg51.5%
+-inverses51.5%
Simplified51.5%
Final simplification59.0%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 8.2e+29) 1.0 0.0))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 8.2e+29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 8.2d+29) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double tmp;
if (x <= 8.2e+29) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 8.2e+29: tmp = 1.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 8.2e+29) tmp = 1.0; else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 8.2e+29) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 8.2e+29], 1.0, 0.0]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.2 \cdot 10^{+29}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 8.2000000000000007e29Initial program 65.2%
div-sub65.2%
+-rgt-identity65.2%
div-sub65.2%
Simplified65.2%
Taylor expanded in x around 0 43.2%
Taylor expanded in x around 0 47.0%
Taylor expanded in x around 0 56.9%
if 8.2000000000000007e29 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 51.5%
div-sub51.5%
rec-exp51.5%
mul-1-neg51.5%
+-inverses51.5%
Simplified51.5%
Final simplification55.4%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 1.0)
eps = abs(eps);
double code(double x, double eps) {
return 1.0;
}
NOTE: eps should be positive before calling this function
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 1.0d0
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
return 1.0;
}
eps = abs(eps) def code(x, eps): return 1.0
eps = abs(eps) function code(x, eps) return 1.0 end
eps = abs(eps) function tmp = code(x, eps) tmp = 1.0; end
NOTE: eps should be positive before calling this function code[x_, eps_] := 1.0
\begin{array}{l}
eps = |eps|\\
\\
1
\end{array}
Initial program 74.6%
div-sub74.6%
+-rgt-identity74.6%
div-sub74.6%
Simplified74.6%
Taylor expanded in x around 0 38.0%
Taylor expanded in x around 0 37.5%
Taylor expanded in x around 0 42.4%
Final simplification42.4%
herbie shell --seed 2023240
(FPCore (x eps)
:name "NMSE Section 6.1 mentioned, A"
:precision binary64
(/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))