
(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 10 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 (exp (- x))))
(if (<= eps 1e-5)
(/ (+ (* t_0 (- (+ x 1.0) -1.0)) (* x t_0)) 2.0)
(/ (+ (exp (* x (+ eps -1.0))) (exp (* eps (- x)))) 2.0))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = exp(-x);
double tmp;
if (eps <= 1e-5) {
tmp = ((t_0 * ((x + 1.0) - -1.0)) + (x * t_0)) / 2.0;
} else {
tmp = (exp((x * (eps + -1.0))) + exp((eps * -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) :: t_0
real(8) :: tmp
t_0 = exp(-x)
if (eps <= 1d-5) then
tmp = ((t_0 * ((x + 1.0d0) - (-1.0d0))) + (x * t_0)) / 2.0d0
else
tmp = (exp((x * (eps + (-1.0d0)))) + exp((eps * -x))) / 2.0d0
end if
code = tmp
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
double t_0 = Math.exp(-x);
double tmp;
if (eps <= 1e-5) {
tmp = ((t_0 * ((x + 1.0) - -1.0)) + (x * t_0)) / 2.0;
} else {
tmp = (Math.exp((x * (eps + -1.0))) + Math.exp((eps * -x))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = math.exp(-x) tmp = 0 if eps <= 1e-5: tmp = ((t_0 * ((x + 1.0) - -1.0)) + (x * t_0)) / 2.0 else: tmp = (math.exp((x * (eps + -1.0))) + math.exp((eps * -x))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = exp(Float64(-x)) tmp = 0.0 if (eps <= 1e-5) tmp = Float64(Float64(Float64(t_0 * Float64(Float64(x + 1.0) - -1.0)) + Float64(x * t_0)) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps + -1.0))) + exp(Float64(eps * Float64(-x)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) t_0 = exp(-x); tmp = 0.0; if (eps <= 1e-5) tmp = ((t_0 * ((x + 1.0) - -1.0)) + (x * t_0)) / 2.0; else tmp = (exp((x * (eps + -1.0))) + exp((eps * -x))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function
code[x_, eps_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[eps, 1e-5], N[(N[(N[(t$95$0 * N[(N[(x + 1.0), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] + N[(x * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
t_0 := e^{-x}\\
\mathbf{if}\;\varepsilon \leq 10^{-5}:\\
\;\;\;\;\frac{t_0 \cdot \left(\left(x + 1\right) - -1\right) + x \cdot t_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(\varepsilon + -1\right)} + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\end{array}
\end{array}
if eps < 1.00000000000000008e-5Initial program 63.9%
sub-neg63.9%
neg-sub063.9%
associate-+r-63.9%
Simplified63.9%
Taylor expanded in eps around 0 68.4%
associate--r+68.4%
associate-*r*68.4%
neg-mul-168.4%
cancel-sign-sub68.4%
distribute-rgt1-in68.4%
distribute-rgt-out--68.4%
neg-mul-168.4%
neg-mul-168.4%
Simplified68.4%
if 1.00000000000000008e-5 < eps Initial program 100.0%
Simplified66.6%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification77.6%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -2.2e-273)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(if (<= x 6.8e+79)
(/ (+ 1.0 (exp (- (* eps x) x))) 2.0)
(/
(*
x
(/
(+ -1.0 (* (- 1.0 eps) (- 1.0 eps)))
(+ (+ eps -1.0) (/ (+ eps -1.0) eps))))
2.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -2.2e-273) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else if (x <= 6.8e+79) {
tmp = (1.0 + exp(((eps * x) - x))) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -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 <= (-2.2d-273)) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else if (x <= 6.8d+79) then
tmp = (1.0d0 + exp(((eps * x) - x))) / 2.0d0
else
tmp = (x * (((-1.0d0) + ((1.0d0 - eps) * (1.0d0 - eps))) / ((eps + (-1.0d0)) + ((eps + (-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 <= -2.2e-273) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else if (x <= 6.8e+79) {
tmp = (1.0 + Math.exp(((eps * x) - x))) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -2.2e-273: tmp = (1.0 + math.exp((eps * -x))) / 2.0 elif x <= 6.8e+79: tmp = (1.0 + math.exp(((eps * x) - x))) / 2.0 else: tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -2.2e-273) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); elseif (x <= 6.8e+79) tmp = Float64(Float64(1.0 + exp(Float64(Float64(eps * x) - x))) / 2.0); else tmp = Float64(Float64(x * Float64(Float64(-1.0 + Float64(Float64(1.0 - eps) * Float64(1.0 - eps))) / Float64(Float64(eps + -1.0) + Float64(Float64(eps + -1.0) / eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.2e-273) tmp = (1.0 + exp((eps * -x))) / 2.0; elseif (x <= 6.8e+79) tmp = (1.0 + exp(((eps * x) - x))) / 2.0; else tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, -2.2e-273], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.8e+79], N[(N[(1.0 + N[Exp[N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(-1.0 + N[(N[(1.0 - eps), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(eps + -1.0), $MachinePrecision] + N[(N[(eps + -1.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-273}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+79}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x - x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1 + \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right)}{\left(\varepsilon + -1\right) + \frac{\varepsilon + -1}{\varepsilon}}}{2}\\
\end{array}
\end{array}
if x < -2.1999999999999998e-273Initial program 78.9%
sub-neg78.9%
neg-sub078.9%
associate-+r-78.9%
Simplified78.9%
Taylor expanded in x around 0 43.6%
metadata-eval43.6%
distribute-neg-frac43.6%
sub-neg43.6%
Simplified43.6%
Taylor expanded in eps around inf 62.2%
cancel-sign-sub-inv62.2%
associate-*r*62.2%
exp-prod50.9%
remove-double-neg50.9%
neg-mul-150.9%
sub-neg50.9%
exp-prod62.2%
associate-*r*62.2%
remove-double-neg62.2%
mul-1-neg62.2%
metadata-eval62.2%
*-lft-identity62.2%
mul-1-neg62.2%
remove-double-neg62.2%
associate-*r*62.2%
neg-mul-162.2%
Simplified62.2%
Taylor expanded in eps around inf 62.5%
associate-*r*62.5%
mul-1-neg62.5%
Simplified62.5%
if -2.1999999999999998e-273 < x < 6.80000000000000063e79Initial program 56.3%
sub-neg56.3%
neg-sub056.3%
associate-+r-56.3%
Simplified56.3%
Taylor expanded in x around 0 34.9%
metadata-eval34.9%
distribute-neg-frac34.9%
sub-neg34.9%
Simplified34.9%
Taylor expanded in eps around inf 77.3%
cancel-sign-sub-inv77.3%
associate-*r*77.3%
exp-prod73.7%
remove-double-neg73.7%
neg-mul-173.7%
sub-neg73.7%
exp-prod77.3%
associate-*r*77.3%
remove-double-neg77.3%
mul-1-neg77.3%
metadata-eval77.3%
*-lft-identity77.3%
mul-1-neg77.3%
remove-double-neg77.3%
associate-*r*77.3%
neg-mul-177.3%
Simplified77.3%
distribute-rgt-in77.3%
*-un-lft-identity77.3%
unsub-neg77.3%
add-sqr-sqrt10.5%
sqrt-unprod78.3%
sqr-neg78.3%
sqrt-unprod68.7%
add-sqr-sqrt79.1%
Applied egg-rr79.1%
*-commutative79.1%
Simplified79.1%
if 6.80000000000000063e79 < x Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 28.5%
Taylor expanded in x around inf 18.3%
mul-1-neg18.3%
distribute-rgt-neg-in18.3%
*-commutative18.3%
distribute-rgt-neg-in18.3%
mul-1-neg18.3%
distribute-lft-in18.3%
metadata-eval18.3%
associate-*r/18.3%
metadata-eval18.3%
Simplified18.3%
distribute-lft-in18.3%
flip-+18.3%
Applied egg-rr18.3%
*-commutative18.3%
neg-mul-118.3%
*-commutative18.3%
neg-mul-118.3%
sqr-neg18.3%
*-commutative18.3%
neg-mul-118.3%
Simplified18.3%
Taylor expanded in eps around inf 71.7%
Final simplification71.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 1.25e-5)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(/
(*
x
(/
(+ -1.0 (* (- 1.0 eps) (- 1.0 eps)))
(+ (+ eps -1.0) (/ (+ eps -1.0) eps))))
2.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 1.25e-5) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -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.25d-5) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else
tmp = (x * (((-1.0d0) + ((1.0d0 - eps) * (1.0d0 - eps))) / ((eps + (-1.0d0)) + ((eps + (-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.25e-5) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 1.25e-5: tmp = (1.0 + math.exp((eps * -x))) / 2.0 else: tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 1.25e-5) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); else tmp = Float64(Float64(x * Float64(Float64(-1.0 + Float64(Float64(1.0 - eps) * Float64(1.0 - eps))) / Float64(Float64(eps + -1.0) + Float64(Float64(eps + -1.0) / eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 1.25e-5) tmp = (1.0 + exp((eps * -x))) / 2.0; else tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 1.25e-5], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(-1.0 + N[(N[(1.0 - eps), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(eps + -1.0), $MachinePrecision] + N[(N[(eps + -1.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1 + \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right)}{\left(\varepsilon + -1\right) + \frac{\varepsilon + -1}{\varepsilon}}}{2}\\
\end{array}
\end{array}
if x < 1.25000000000000006e-5Initial program 63.3%
sub-neg63.3%
neg-sub063.3%
associate-+r-63.3%
Simplified63.3%
Taylor expanded in x around 0 38.5%
metadata-eval38.5%
distribute-neg-frac38.5%
sub-neg38.5%
Simplified38.5%
Taylor expanded in eps around inf 73.0%
cancel-sign-sub-inv73.0%
associate-*r*73.0%
exp-prod65.1%
remove-double-neg65.1%
neg-mul-165.1%
sub-neg65.1%
exp-prod73.0%
associate-*r*73.0%
remove-double-neg73.0%
mul-1-neg73.0%
metadata-eval73.0%
*-lft-identity73.0%
mul-1-neg73.0%
remove-double-neg73.0%
associate-*r*73.0%
neg-mul-173.0%
Simplified73.0%
Taylor expanded in eps around inf 74.2%
associate-*r*74.2%
mul-1-neg74.2%
Simplified74.2%
if 1.25000000000000006e-5 < x Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.0%
Taylor expanded in x around inf 14.4%
mul-1-neg14.4%
distribute-rgt-neg-in14.4%
*-commutative14.4%
distribute-rgt-neg-in14.4%
mul-1-neg14.4%
distribute-lft-in14.4%
metadata-eval14.4%
associate-*r/14.4%
metadata-eval14.4%
Simplified14.4%
distribute-lft-in14.4%
flip-+16.8%
Applied egg-rr16.8%
*-commutative16.8%
neg-mul-116.8%
*-commutative16.8%
neg-mul-116.8%
sqr-neg16.8%
*-commutative16.8%
neg-mul-116.8%
Simplified16.8%
Taylor expanded in eps around inf 65.9%
Final simplification71.7%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 2.4e-7)
(/ (* (exp (- x)) 2.0) 2.0)
(/
(*
x
(/
(+ -1.0 (* (- 1.0 eps) (- 1.0 eps)))
(+ (+ eps -1.0) (/ (+ eps -1.0) eps))))
2.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 2.4e-7) {
tmp = (exp(-x) * 2.0) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -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 <= 2.4d-7) then
tmp = (exp(-x) * 2.0d0) / 2.0d0
else
tmp = (x * (((-1.0d0) + ((1.0d0 - eps) * (1.0d0 - eps))) / ((eps + (-1.0d0)) + ((eps + (-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 <= 2.4e-7) {
tmp = (Math.exp(-x) * 2.0) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 2.4e-7: tmp = (math.exp(-x) * 2.0) / 2.0 else: tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 2.4e-7) tmp = Float64(Float64(exp(Float64(-x)) * 2.0) / 2.0); else tmp = Float64(Float64(x * Float64(Float64(-1.0 + Float64(Float64(1.0 - eps) * Float64(1.0 - eps))) / Float64(Float64(eps + -1.0) + Float64(Float64(eps + -1.0) / eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 2.4e-7) tmp = (exp(-x) * 2.0) / 2.0; else tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 2.4e-7], N[(N[(N[Exp[(-x)], $MachinePrecision] * 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(-1.0 + N[(N[(1.0 - eps), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(eps + -1.0), $MachinePrecision] + N[(N[(eps + -1.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{e^{-x} \cdot 2}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1 + \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right)}{\left(\varepsilon + -1\right) + \frac{\varepsilon + -1}{\varepsilon}}}{2}\\
\end{array}
\end{array}
if x < 2.39999999999999979e-7Initial program 63.3%
Simplified40.1%
Taylor expanded in eps around inf 97.7%
Taylor expanded in eps around 0 75.4%
cancel-sign-sub-inv75.4%
metadata-eval75.4%
distribute-rgt1-in75.4%
metadata-eval75.4%
neg-mul-175.4%
Simplified75.4%
if 2.39999999999999979e-7 < x Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.0%
Taylor expanded in x around inf 14.4%
mul-1-neg14.4%
distribute-rgt-neg-in14.4%
*-commutative14.4%
distribute-rgt-neg-in14.4%
mul-1-neg14.4%
distribute-lft-in14.4%
metadata-eval14.4%
associate-*r/14.4%
metadata-eval14.4%
Simplified14.4%
distribute-lft-in14.4%
flip-+16.8%
Applied egg-rr16.8%
*-commutative16.8%
neg-mul-116.8%
*-commutative16.8%
neg-mul-116.8%
sqr-neg16.8%
*-commutative16.8%
neg-mul-116.8%
Simplified16.8%
Taylor expanded in eps around inf 65.9%
Final simplification72.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 3.8e-7)
(/ (+ (exp (- x)) 1.0) 2.0)
(/
(*
x
(/
(+ -1.0 (* (- 1.0 eps) (- 1.0 eps)))
(+ (+ eps -1.0) (/ (+ eps -1.0) eps))))
2.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 3.8e-7) {
tmp = (exp(-x) + 1.0) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -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 <= 3.8d-7) then
tmp = (exp(-x) + 1.0d0) / 2.0d0
else
tmp = (x * (((-1.0d0) + ((1.0d0 - eps) * (1.0d0 - eps))) / ((eps + (-1.0d0)) + ((eps + (-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 <= 3.8e-7) {
tmp = (Math.exp(-x) + 1.0) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 3.8e-7: tmp = (math.exp(-x) + 1.0) / 2.0 else: tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 3.8e-7) tmp = Float64(Float64(exp(Float64(-x)) + 1.0) / 2.0); else tmp = Float64(Float64(x * Float64(Float64(-1.0 + Float64(Float64(1.0 - eps) * Float64(1.0 - eps))) / Float64(Float64(eps + -1.0) + Float64(Float64(eps + -1.0) / eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 3.8e-7) tmp = (exp(-x) + 1.0) / 2.0; else tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 3.8e-7], N[(N[(N[Exp[(-x)], $MachinePrecision] + 1.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(-1.0 + N[(N[(1.0 - eps), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(eps + -1.0), $MachinePrecision] + N[(N[(eps + -1.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{e^{-x} + 1}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1 + \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right)}{\left(\varepsilon + -1\right) + \frac{\varepsilon + -1}{\varepsilon}}}{2}\\
\end{array}
\end{array}
if x < 3.80000000000000015e-7Initial program 63.3%
Simplified40.1%
Taylor expanded in eps around inf 97.7%
Taylor expanded in eps around inf 97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in eps around 0 75.4%
mul-1-neg75.4%
Simplified75.4%
if 3.80000000000000015e-7 < x Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.0%
Taylor expanded in x around inf 14.4%
mul-1-neg14.4%
distribute-rgt-neg-in14.4%
*-commutative14.4%
distribute-rgt-neg-in14.4%
mul-1-neg14.4%
distribute-lft-in14.4%
metadata-eval14.4%
associate-*r/14.4%
metadata-eval14.4%
Simplified14.4%
distribute-lft-in14.4%
flip-+16.8%
Applied egg-rr16.8%
*-commutative16.8%
neg-mul-116.8%
*-commutative16.8%
neg-mul-116.8%
sqr-neg16.8%
*-commutative16.8%
neg-mul-116.8%
Simplified16.8%
Taylor expanded in eps around inf 65.9%
Final simplification72.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 9.2e-7)
(/ (- 2.0 (* eps x)) 2.0)
(/
(*
x
(/
(+ -1.0 (* (- 1.0 eps) (- 1.0 eps)))
(+ (+ eps -1.0) (/ (+ eps -1.0) eps))))
2.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 9.2e-7) {
tmp = (2.0 - (eps * x)) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -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 <= 9.2d-7) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else
tmp = (x * (((-1.0d0) + ((1.0d0 - eps) * (1.0d0 - eps))) / ((eps + (-1.0d0)) + ((eps + (-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 <= 9.2e-7) {
tmp = (2.0 - (eps * x)) / 2.0;
} else {
tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 9.2e-7: tmp = (2.0 - (eps * x)) / 2.0 else: tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 9.2e-7) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); else tmp = Float64(Float64(x * Float64(Float64(-1.0 + Float64(Float64(1.0 - eps) * Float64(1.0 - eps))) / Float64(Float64(eps + -1.0) + Float64(Float64(eps + -1.0) / eps)))) / 2.0); end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 9.2e-7) tmp = (2.0 - (eps * x)) / 2.0; else tmp = (x * ((-1.0 + ((1.0 - eps) * (1.0 - eps))) / ((eps + -1.0) + ((eps + -1.0) / eps)))) / 2.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function code[x_, eps_] := If[LessEqual[x, 9.2e-7], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(-1.0 + N[(N[(1.0 - eps), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(eps + -1.0), $MachinePrecision] + N[(N[(eps + -1.0), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{-1 + \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right)}{\left(\varepsilon + -1\right) + \frac{\varepsilon + -1}{\varepsilon}}}{2}\\
\end{array}
\end{array}
if x < 9.1999999999999998e-7Initial program 63.3%
Simplified63.3%
Taylor expanded in x around 0 57.0%
Taylor expanded in eps around 0 60.1%
Taylor expanded in eps around 0 60.1%
mul-1-neg60.1%
Simplified60.1%
if 9.1999999999999998e-7 < x Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.0%
Taylor expanded in x around inf 14.4%
mul-1-neg14.4%
distribute-rgt-neg-in14.4%
*-commutative14.4%
distribute-rgt-neg-in14.4%
mul-1-neg14.4%
distribute-lft-in14.4%
metadata-eval14.4%
associate-*r/14.4%
metadata-eval14.4%
Simplified14.4%
distribute-lft-in14.4%
flip-+16.8%
Applied egg-rr16.8%
*-commutative16.8%
neg-mul-116.8%
*-commutative16.8%
neg-mul-116.8%
sqr-neg16.8%
*-commutative16.8%
neg-mul-116.8%
Simplified16.8%
Taylor expanded in eps around inf 65.9%
Final simplification61.9%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 0.0085) (/ (- 2.0 (* eps x)) 2.0) 0.0))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 0.0085) {
tmp = (2.0 - (eps * x)) / 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 <= 0.0085d0) then
tmp = (2.0d0 - (eps * x)) / 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 <= 0.0085) {
tmp = (2.0 - (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 0.0085: tmp = (2.0 - (eps * x)) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 0.0085) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 0.0085) tmp = (2.0 - (eps * x)) / 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, 0.0085], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0085:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 0.0085000000000000006Initial program 63.3%
Simplified63.3%
Taylor expanded in x around 0 57.0%
Taylor expanded in eps around 0 60.1%
Taylor expanded in eps around 0 60.1%
mul-1-neg60.1%
Simplified60.1%
if 0.0085000000000000006 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 50.8%
neg-mul-150.8%
rec-exp50.8%
neg-mul-150.8%
div-sub50.8%
+-inverses50.8%
Simplified50.8%
Final simplification57.3%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x -0.6) (/ (* eps (- x)) 2.0) (if (<= x 530.0) 1.0 0.0)))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -0.6) {
tmp = (eps * -x) / 2.0;
} else if (x <= 530.0) {
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 <= (-0.6d0)) then
tmp = (eps * -x) / 2.0d0
else if (x <= 530.0d0) 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 <= -0.6) {
tmp = (eps * -x) / 2.0;
} else if (x <= 530.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -0.6: tmp = (eps * -x) / 2.0 elif x <= 530.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -0.6) tmp = Float64(Float64(eps * Float64(-x)) / 2.0); elseif (x <= 530.0) 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 <= -0.6) tmp = (eps * -x) / 2.0; elseif (x <= 530.0) 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, -0.6], N[(N[(eps * (-x)), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 530.0], 1.0, 0.0]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.6:\\
\;\;\;\;\frac{\varepsilon \cdot \left(-x\right)}{2}\\
\mathbf{elif}\;x \leq 530:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.599999999999999978Initial program 97.4%
sub-neg97.4%
neg-sub097.4%
associate-+r-97.4%
Simplified97.4%
Taylor expanded in x around 0 56.7%
Taylor expanded in eps around inf 19.9%
mul-1-neg19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
Simplified19.9%
if -0.599999999999999978 < x < 530Initial program 54.4%
sub-neg54.4%
neg-sub054.4%
associate-+r-54.4%
Simplified54.4%
Taylor expanded in x around 0 71.1%
if 530 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 51.4%
neg-mul-151.4%
rec-exp51.4%
neg-mul-151.4%
div-sub51.4%
+-inverses51.4%
Simplified51.4%
Final simplification57.6%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 520.0) 1.0 0.0))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 520.0) {
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 <= 520.0d0) 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 <= 520.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 520.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 520.0) 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 <= 520.0) 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, 520.0], 1.0, 0.0]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 520:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 520Initial program 63.5%
sub-neg63.5%
neg-sub063.5%
associate-+r-63.5%
Simplified63.5%
Taylor expanded in x around 0 56.7%
if 520 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 51.4%
neg-mul-151.4%
rec-exp51.4%
neg-mul-151.4%
div-sub51.4%
+-inverses51.4%
Simplified51.4%
Final simplification55.1%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 0.0)
eps = abs(eps);
double code(double x, double eps) {
return 0.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 = 0.0d0
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
return 0.0;
}
eps = abs(eps) def code(x, eps): return 0.0
eps = abs(eps) function code(x, eps) return 0.0 end
eps = abs(eps) function tmp = code(x, eps) tmp = 0.0; end
NOTE: eps should be positive before calling this function code[x_, eps_] := 0.0
\begin{array}{l}
eps = |eps|\\
\\
0
\end{array}
Initial program 74.5%
Simplified74.5%
Taylor expanded in eps around 0 17.0%
neg-mul-117.0%
rec-exp17.0%
neg-mul-117.0%
div-sub17.0%
+-inverses17.2%
Simplified17.2%
Final simplification17.2%
herbie shell --seed 2023271
(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))