
(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 16 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 1.6e-15)
(/ (- (* x t_0) (* t_0 (+ -1.0 (- -1.0 x)))) 2.0)
(/ (+ (exp (* eps x)) (exp (* x (- -1.0 eps)))) 2.0))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = exp(-x);
double tmp;
if (eps <= 1.6e-15) {
tmp = ((x * t_0) - (t_0 * (-1.0 + (-1.0 - x)))) / 2.0;
} else {
tmp = (exp((eps * 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 = exp(-x)
if (eps <= 1.6d-15) then
tmp = ((x * t_0) - (t_0 * ((-1.0d0) + ((-1.0d0) - x)))) / 2.0d0
else
tmp = (exp((eps * 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 = Math.exp(-x);
double tmp;
if (eps <= 1.6e-15) {
tmp = ((x * t_0) - (t_0 * (-1.0 + (-1.0 - x)))) / 2.0;
} else {
tmp = (Math.exp((eps * x)) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = math.exp(-x) tmp = 0 if eps <= 1.6e-15: tmp = ((x * t_0) - (t_0 * (-1.0 + (-1.0 - x)))) / 2.0 else: tmp = (math.exp((eps * x)) + math.exp((x * (-1.0 - eps)))) / 2.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = exp(Float64(-x)) tmp = 0.0 if (eps <= 1.6e-15) tmp = Float64(Float64(Float64(x * t_0) - Float64(t_0 * Float64(-1.0 + Float64(-1.0 - x)))) / 2.0); else tmp = Float64(Float64(exp(Float64(eps * 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 = exp(-x); tmp = 0.0; if (eps <= 1.6e-15) tmp = ((x * t_0) - (t_0 * (-1.0 + (-1.0 - x)))) / 2.0; else tmp = (exp((eps * 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[Exp[(-x)], $MachinePrecision]}, If[LessEqual[eps, 1.6e-15], N[(N[(N[(x * t$95$0), $MachinePrecision] - N[(t$95$0 * N[(-1.0 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(eps * 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 := e^{-x}\\
\mathbf{if}\;\varepsilon \leq 1.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{x \cdot t_0 - t_0 \cdot \left(-1 + \left(-1 - x\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\end{array}
\end{array}
if eps < 1.6e-15Initial program 65.6%
sub-neg65.6%
neg-sub065.6%
associate-+r-65.6%
Simplified65.6%
Taylor expanded in eps around 0 72.9%
associate--r+72.9%
associate-*r*72.9%
neg-mul-172.9%
cancel-sign-sub72.9%
distribute-rgt1-in72.8%
distribute-rgt-out--73.4%
neg-mul-173.4%
neg-mul-173.4%
Simplified73.4%
if 1.6e-15 < eps Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
mul-1-neg100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
remove-double-neg100.0%
mul-1-neg100.0%
sub-neg100.0%
distribute-rgt-neg-in100.0%
mul-1-neg100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
mul-1-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification79.5%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 4.9e+90)
(/ (+ (exp (* eps x)) (exp (* x (- -1.0 eps)))) 2.0)
(if (<= x 1.8e+184)
0.0
(if (<= x 3.7e+251) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0) 0.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 4.9e+90) {
tmp = (exp((eps * x)) + exp((x * (-1.0 - eps)))) / 2.0;
} else if (x <= 1.8e+184) {
tmp = 0.0;
} else if (x <= 3.7e+251) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 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 <= 4.9d+90) then
tmp = (exp((eps * x)) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
else if (x <= 1.8d+184) then
tmp = 0.0d0
else if (x <= 3.7d+251) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 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 <= 4.9e+90) {
tmp = (Math.exp((eps * x)) + Math.exp((x * (-1.0 - eps)))) / 2.0;
} else if (x <= 1.8e+184) {
tmp = 0.0;
} else if (x <= 3.7e+251) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 4.9e+90: tmp = (math.exp((eps * x)) + math.exp((x * (-1.0 - eps)))) / 2.0 elif x <= 1.8e+184: tmp = 0.0 elif x <= 3.7e+251: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 4.9e+90) tmp = Float64(Float64(exp(Float64(eps * x)) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0); elseif (x <= 1.8e+184) tmp = 0.0; elseif (x <= 3.7e+251) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 4.9e+90) tmp = (exp((eps * x)) + exp((x * (-1.0 - eps)))) / 2.0; elseif (x <= 1.8e+184) tmp = 0.0; elseif (x <= 3.7e+251) tmp = (1.0 + exp((x * (eps + -1.0)))) / 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, 4.9e+90], N[(N[(N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.8e+184], 0.0, If[LessEqual[x, 3.7e+251], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.9 \cdot 10^{+90}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+184}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+251}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.9000000000000003e90Initial program 64.3%
sub-neg64.3%
neg-sub064.3%
associate-+r-64.3%
Simplified64.3%
Taylor expanded in eps around inf 98.8%
associate-*r*98.8%
neg-mul-198.8%
*-commutative98.8%
mul-1-neg98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
remove-double-neg98.8%
mul-1-neg98.8%
sub-neg98.8%
distribute-rgt-neg-in98.8%
mul-1-neg98.8%
mul-1-neg98.8%
*-commutative98.8%
distribute-rgt-neg-in98.8%
sub-neg98.8%
mul-1-neg98.8%
remove-double-neg98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in eps around inf 94.8%
*-commutative94.8%
Simplified94.8%
if 4.9000000000000003e90 < x < 1.80000000000000007e184 or 3.6999999999999999e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 74.3%
neg-mul-174.3%
rec-exp74.3%
neg-mul-174.3%
div-sub74.3%
+-inverses74.3%
Simplified74.3%
if 1.80000000000000007e184 < x < 3.6999999999999999e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.9%
Taylor expanded in eps around inf 32.2%
*-commutative32.2%
neg-mul-132.2%
neg-sub032.2%
*-commutative32.2%
sub-neg32.2%
mul-1-neg32.2%
distribute-rgt-in32.2%
*-lft-identity32.2%
mul-1-neg32.2%
cancel-sign-sub-inv32.2%
associate-+l-32.2%
neg-sub032.2%
neg-mul-132.2%
distribute-rgt-out32.2%
Simplified32.2%
Final simplification86.2%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (/ (+ (exp (* x (+ eps -1.0))) (exp (* x (- -1.0 eps)))) 2.0))
eps = abs(eps);
double code(double x, double eps) {
return (exp((x * (eps + -1.0))) + 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((x * (eps + (-1.0d0)))) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
end function
eps = Math.abs(eps);
public static double code(double x, double eps) {
return (Math.exp((x * (eps + -1.0))) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
eps = abs(eps) def code(x, eps): return (math.exp((x * (eps + -1.0))) + math.exp((x * (-1.0 - eps)))) / 2.0
eps = abs(eps) function code(x, eps) return Float64(Float64(exp(Float64(x * Float64(eps + -1.0))) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0) end
eps = abs(eps) function tmp = code(x, eps) tmp = (exp((x * (eps + -1.0))) + 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[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps = |eps|\\
\\
\frac{e^{x \cdot \left(\varepsilon + -1\right)} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}
\end{array}
Initial program 73.5%
sub-neg73.5%
neg-sub073.5%
associate-+r-73.5%
Simplified73.5%
Taylor expanded in eps around inf 99.1%
associate-*r*99.1%
neg-mul-199.1%
*-commutative99.1%
mul-1-neg99.1%
mul-1-neg99.1%
distribute-rgt-neg-in99.1%
remove-double-neg99.1%
mul-1-neg99.1%
sub-neg99.1%
distribute-rgt-neg-in99.1%
mul-1-neg99.1%
mul-1-neg99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
sub-neg99.1%
mul-1-neg99.1%
remove-double-neg99.1%
+-commutative99.1%
Simplified99.1%
Final simplification99.1%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(let* ((t_0 (exp (* x (- -1.0 eps)))))
(if (<= x -470.0)
(/ (- (+ 1.0 (/ 1.0 eps)) (* (+ -1.0 (/ 1.0 eps)) t_0)) 2.0)
(if (<= x -5e-259)
(/ (+ (+ 1.0 (+ x (- (* eps x) x))) t_0) 2.0)
(if (<= x 3.8e+90)
(/ (+ 1.0 (exp (* eps x))) 2.0)
(if (<= x 1.05e+186)
0.0
(if (<= x 1.55e+252)
(/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0)
0.0)))))))eps = abs(eps);
double code(double x, double eps) {
double t_0 = exp((x * (-1.0 - eps)));
double tmp;
if (x <= -470.0) {
tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * t_0)) / 2.0;
} else if (x <= -5e-259) {
tmp = ((1.0 + (x + ((eps * x) - x))) + t_0) / 2.0;
} else if (x <= 3.8e+90) {
tmp = (1.0 + exp((eps * x))) / 2.0;
} else if (x <= 1.05e+186) {
tmp = 0.0;
} else if (x <= 1.55e+252) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 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) :: t_0
real(8) :: tmp
t_0 = exp((x * ((-1.0d0) - eps)))
if (x <= (-470.0d0)) then
tmp = ((1.0d0 + (1.0d0 / eps)) - (((-1.0d0) + (1.0d0 / eps)) * t_0)) / 2.0d0
else if (x <= (-5d-259)) then
tmp = ((1.0d0 + (x + ((eps * x) - x))) + t_0) / 2.0d0
else if (x <= 3.8d+90) then
tmp = (1.0d0 + exp((eps * x))) / 2.0d0
else if (x <= 1.05d+186) then
tmp = 0.0d0
else if (x <= 1.55d+252) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 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 t_0 = Math.exp((x * (-1.0 - eps)));
double tmp;
if (x <= -470.0) {
tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * t_0)) / 2.0;
} else if (x <= -5e-259) {
tmp = ((1.0 + (x + ((eps * x) - x))) + t_0) / 2.0;
} else if (x <= 3.8e+90) {
tmp = (1.0 + Math.exp((eps * x))) / 2.0;
} else if (x <= 1.05e+186) {
tmp = 0.0;
} else if (x <= 1.55e+252) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): t_0 = math.exp((x * (-1.0 - eps))) tmp = 0 if x <= -470.0: tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * t_0)) / 2.0 elif x <= -5e-259: tmp = ((1.0 + (x + ((eps * x) - x))) + t_0) / 2.0 elif x <= 3.8e+90: tmp = (1.0 + math.exp((eps * x))) / 2.0 elif x <= 1.05e+186: tmp = 0.0 elif x <= 1.55e+252: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) t_0 = exp(Float64(x * Float64(-1.0 - eps))) tmp = 0.0 if (x <= -470.0) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) - Float64(Float64(-1.0 + Float64(1.0 / eps)) * t_0)) / 2.0); elseif (x <= -5e-259) tmp = Float64(Float64(Float64(1.0 + Float64(x + Float64(Float64(eps * x) - x))) + t_0) / 2.0); elseif (x <= 3.8e+90) tmp = Float64(Float64(1.0 + exp(Float64(eps * x))) / 2.0); elseif (x <= 1.05e+186) tmp = 0.0; elseif (x <= 1.55e+252) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) t_0 = exp((x * (-1.0 - eps))); tmp = 0.0; if (x <= -470.0) tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * t_0)) / 2.0; elseif (x <= -5e-259) tmp = ((1.0 + (x + ((eps * x) - x))) + t_0) / 2.0; elseif (x <= 3.8e+90) tmp = (1.0 + exp((eps * x))) / 2.0; elseif (x <= 1.05e+186) tmp = 0.0; elseif (x <= 1.55e+252) tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
NOTE: eps should be positive before calling this function
code[x_, eps_] := Block[{t$95$0 = N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -470.0], N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -5e-259], N[(N[(N[(1.0 + N[(x + N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.8e+90], N[(N[(1.0 + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.05e+186], 0.0, If[LessEqual[x, 1.55e+252], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(-1 - \varepsilon\right)}\\
\mathbf{if}\;x \leq -470:\\
\;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot t_0}{2}\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-259}:\\
\;\;\;\;\frac{\left(1 + \left(x + \left(\varepsilon \cdot x - x\right)\right)\right) + t_0}{2}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+90}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x}}{2}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+186}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+252}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -470Initial program 96.7%
sub-neg96.7%
neg-sub096.7%
associate-+r-96.7%
Simplified96.7%
Taylor expanded in x around 0 45.0%
if -470 < x < -4.99999999999999977e-259Initial program 44.9%
sub-neg44.9%
neg-sub044.9%
associate-+r-44.9%
Simplified44.9%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
associate-+r+34.6%
associate-*r*34.6%
neg-mul-134.6%
*-commutative34.6%
associate-*r*34.6%
distribute-lft-neg-in34.6%
distribute-rgt-neg-in34.6%
sub-neg34.6%
mul-1-neg34.6%
distribute-neg-in34.6%
metadata-eval34.6%
mul-1-neg34.6%
remove-double-neg34.6%
+-commutative34.6%
distribute-rgt-in34.6%
neg-mul-134.6%
sub-neg34.6%
*-commutative34.6%
Simplified34.6%
Taylor expanded in eps around inf 89.0%
if -4.99999999999999977e-259 < x < 3.8000000000000001e90Initial program 65.8%
sub-neg65.8%
neg-sub065.8%
associate-+r-65.8%
Simplified65.8%
Taylor expanded in x around 0 41.6%
Taylor expanded in eps around inf 75.2%
*-commutative75.2%
neg-mul-175.2%
neg-sub075.2%
*-commutative75.2%
sub-neg75.2%
mul-1-neg75.2%
distribute-rgt-in75.2%
*-lft-identity75.2%
mul-1-neg75.2%
cancel-sign-sub-inv75.2%
associate-+l-75.2%
neg-sub075.2%
neg-mul-175.2%
distribute-rgt-out75.2%
Simplified75.2%
Taylor expanded in eps around inf 75.3%
*-commutative75.3%
Simplified75.3%
if 3.8000000000000001e90 < x < 1.05e186 or 1.54999999999999991e252 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 74.3%
neg-mul-174.3%
rec-exp74.3%
neg-mul-174.3%
div-sub74.3%
+-inverses74.3%
Simplified74.3%
if 1.05e186 < x < 1.54999999999999991e252Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.9%
Taylor expanded in eps around inf 32.2%
*-commutative32.2%
neg-mul-132.2%
neg-sub032.2%
*-commutative32.2%
sub-neg32.2%
mul-1-neg32.2%
distribute-rgt-in32.2%
*-lft-identity32.2%
mul-1-neg32.2%
cancel-sign-sub-inv32.2%
associate-+l-32.2%
neg-sub032.2%
neg-mul-132.2%
distribute-rgt-out32.2%
Simplified32.2%
Final simplification71.3%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -1.7e-27)
(/
(- (+ 1.0 (/ 1.0 eps)) (* (+ -1.0 (/ 1.0 eps)) (exp (* x (- -1.0 eps)))))
2.0)
(if (<= x 4.6e+90)
(/ (+ 1.0 (exp (* eps x))) 2.0)
(if (<= x 1.55e+187)
0.0
(if (<= x 9e+251) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -1.7e-27) {
tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * exp((x * (-1.0 - eps))))) / 2.0;
} else if (x <= 4.6e+90) {
tmp = (1.0 + exp((eps * x))) / 2.0;
} else if (x <= 1.55e+187) {
tmp = 0.0;
} else if (x <= 9e+251) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 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 <= (-1.7d-27)) then
tmp = ((1.0d0 + (1.0d0 / eps)) - (((-1.0d0) + (1.0d0 / eps)) * exp((x * ((-1.0d0) - eps))))) / 2.0d0
else if (x <= 4.6d+90) then
tmp = (1.0d0 + exp((eps * x))) / 2.0d0
else if (x <= 1.55d+187) then
tmp = 0.0d0
else if (x <= 9d+251) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 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 <= -1.7e-27) {
tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * Math.exp((x * (-1.0 - eps))))) / 2.0;
} else if (x <= 4.6e+90) {
tmp = (1.0 + Math.exp((eps * x))) / 2.0;
} else if (x <= 1.55e+187) {
tmp = 0.0;
} else if (x <= 9e+251) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -1.7e-27: tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * math.exp((x * (-1.0 - eps))))) / 2.0 elif x <= 4.6e+90: tmp = (1.0 + math.exp((eps * x))) / 2.0 elif x <= 1.55e+187: tmp = 0.0 elif x <= 9e+251: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -1.7e-27) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) - Float64(Float64(-1.0 + Float64(1.0 / eps)) * exp(Float64(x * Float64(-1.0 - eps))))) / 2.0); elseif (x <= 4.6e+90) tmp = Float64(Float64(1.0 + exp(Float64(eps * x))) / 2.0); elseif (x <= 1.55e+187) tmp = 0.0; elseif (x <= 9e+251) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.7e-27) tmp = ((1.0 + (1.0 / eps)) - ((-1.0 + (1.0 / eps)) * exp((x * (-1.0 - eps))))) / 2.0; elseif (x <= 4.6e+90) tmp = (1.0 + exp((eps * x))) / 2.0; elseif (x <= 1.55e+187) tmp = 0.0; elseif (x <= 9e+251) tmp = (1.0 + exp((x * (eps + -1.0)))) / 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, -1.7e-27], N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.6e+90], N[(N[(1.0 + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55e+187], 0.0, If[LessEqual[x, 9e+251], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+90}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x}}{2}\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+187}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+251}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.69999999999999985e-27Initial program 94.2%
sub-neg94.2%
neg-sub094.2%
associate-+r-94.2%
Simplified94.2%
Taylor expanded in x around 0 42.9%
if -1.69999999999999985e-27 < x < 4.6e90Initial program 57.8%
sub-neg57.8%
neg-sub057.8%
associate-+r-57.8%
Simplified57.8%
Taylor expanded in x around 0 37.7%
Taylor expanded in eps around inf 79.5%
*-commutative79.5%
neg-mul-179.5%
neg-sub079.5%
*-commutative79.5%
sub-neg79.5%
mul-1-neg79.5%
distribute-rgt-in79.5%
*-lft-identity79.5%
mul-1-neg79.5%
cancel-sign-sub-inv79.5%
associate-+l-79.5%
neg-sub079.5%
neg-mul-179.5%
distribute-rgt-out79.5%
Simplified79.5%
Taylor expanded in eps around inf 79.6%
*-commutative79.6%
Simplified79.6%
if 4.6e90 < x < 1.55000000000000006e187 or 8.9999999999999997e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 74.3%
neg-mul-174.3%
rec-exp74.3%
neg-mul-174.3%
div-sub74.3%
+-inverses74.3%
Simplified74.3%
if 1.55000000000000006e187 < x < 8.9999999999999997e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.9%
Taylor expanded in eps around inf 32.2%
*-commutative32.2%
neg-mul-132.2%
neg-sub032.2%
*-commutative32.2%
sub-neg32.2%
mul-1-neg32.2%
distribute-rgt-in32.2%
*-lft-identity32.2%
mul-1-neg32.2%
cancel-sign-sub-inv32.2%
associate-+l-32.2%
neg-sub032.2%
neg-mul-132.2%
distribute-rgt-out32.2%
Simplified32.2%
Final simplification70.0%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -2.6e-262)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 1.02e+89)
(/ (+ 1.0 (exp (* eps x))) 2.0)
(if (<= x 9.8e+191)
0.0
(if (<= x 1.35e+252) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -2.6e-262) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 1.02e+89) {
tmp = (1.0 + exp((eps * x))) / 2.0;
} else if (x <= 9.8e+191) {
tmp = 0.0;
} else if (x <= 1.35e+252) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 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 <= (-2.6d-262)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 1.02d+89) then
tmp = (1.0d0 + exp((eps * x))) / 2.0d0
else if (x <= 9.8d+191) then
tmp = 0.0d0
else if (x <= 1.35d+252) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 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 <= -2.6e-262) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 1.02e+89) {
tmp = (1.0 + Math.exp((eps * x))) / 2.0;
} else if (x <= 9.8e+191) {
tmp = 0.0;
} else if (x <= 1.35e+252) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -2.6e-262: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 1.02e+89: tmp = (1.0 + math.exp((eps * x))) / 2.0 elif x <= 9.8e+191: tmp = 0.0 elif x <= 1.35e+252: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -2.6e-262) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 1.02e+89) tmp = Float64(Float64(1.0 + exp(Float64(eps * x))) / 2.0); elseif (x <= 9.8e+191) tmp = 0.0; elseif (x <= 1.35e+252) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps = abs(eps) function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.6e-262) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 1.02e+89) tmp = (1.0 + exp((eps * x))) / 2.0; elseif (x <= 9.8e+191) tmp = 0.0; elseif (x <= 1.35e+252) tmp = (1.0 + exp((x * (eps + -1.0)))) / 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, -2.6e-262], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.02e+89], N[(N[(1.0 + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9.8e+191], 0.0, If[LessEqual[x, 1.35e+252], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-262}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+89}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x}}{2}\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{+191}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+252}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.5999999999999999e-262Initial program 62.5%
sub-neg62.5%
neg-sub062.5%
associate-+r-62.5%
Simplified62.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in eps around inf 75.4%
*-commutative75.4%
neg-mul-175.4%
neg-sub075.4%
*-commutative75.4%
sub-neg75.4%
mul-1-neg75.4%
distribute-rgt-in75.4%
*-lft-identity75.4%
mul-1-neg75.4%
cancel-sign-sub-inv75.4%
associate-+l-75.4%
neg-sub075.4%
neg-mul-175.4%
distribute-rgt-out75.4%
Simplified75.4%
Taylor expanded in eps around 0 83.9%
neg-mul-183.9%
Simplified83.9%
if -2.5999999999999999e-262 < x < 1.0199999999999999e89Initial program 65.8%
sub-neg65.8%
neg-sub065.8%
associate-+r-65.8%
Simplified65.8%
Taylor expanded in x around 0 41.6%
Taylor expanded in eps around inf 75.2%
*-commutative75.2%
neg-mul-175.2%
neg-sub075.2%
*-commutative75.2%
sub-neg75.2%
mul-1-neg75.2%
distribute-rgt-in75.2%
*-lft-identity75.2%
mul-1-neg75.2%
cancel-sign-sub-inv75.2%
associate-+l-75.2%
neg-sub075.2%
neg-mul-175.2%
distribute-rgt-out75.2%
Simplified75.2%
Taylor expanded in eps around inf 75.3%
*-commutative75.3%
Simplified75.3%
if 1.0199999999999999e89 < x < 9.7999999999999999e191 or 1.35000000000000005e252 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 74.3%
neg-mul-174.3%
rec-exp74.3%
neg-mul-174.3%
div-sub74.3%
+-inverses74.3%
Simplified74.3%
if 9.7999999999999999e191 < x < 1.35000000000000005e252Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 31.9%
Taylor expanded in eps around inf 32.2%
*-commutative32.2%
neg-mul-132.2%
neg-sub032.2%
*-commutative32.2%
sub-neg32.2%
mul-1-neg32.2%
distribute-rgt-in32.2%
*-lft-identity32.2%
mul-1-neg32.2%
cancel-sign-sub-inv32.2%
associate-+l-32.2%
neg-sub032.2%
neg-mul-132.2%
distribute-rgt-out32.2%
Simplified32.2%
Final simplification74.7%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -2.6e-262)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (or (<= x 1.85e+90) (and (not (<= x 8.2e+184)) (<= x 1e+252)))
(/ (+ 1.0 (exp (* eps x))) 2.0)
0.0)))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -2.6e-262) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if ((x <= 1.85e+90) || (!(x <= 8.2e+184) && (x <= 1e+252))) {
tmp = (1.0 + exp((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 <= (-2.6d-262)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if ((x <= 1.85d+90) .or. (.not. (x <= 8.2d+184)) .and. (x <= 1d+252)) then
tmp = (1.0d0 + exp((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 <= -2.6e-262) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if ((x <= 1.85e+90) || (!(x <= 8.2e+184) && (x <= 1e+252))) {
tmp = (1.0 + Math.exp((eps * x))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -2.6e-262: tmp = (1.0 + math.exp(-x)) / 2.0 elif (x <= 1.85e+90) or (not (x <= 8.2e+184) and (x <= 1e+252)): tmp = (1.0 + math.exp((eps * x))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -2.6e-262) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif ((x <= 1.85e+90) || (!(x <= 8.2e+184) && (x <= 1e+252))) tmp = Float64(Float64(1.0 + exp(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 <= -2.6e-262) tmp = (1.0 + exp(-x)) / 2.0; elseif ((x <= 1.85e+90) || (~((x <= 8.2e+184)) && (x <= 1e+252))) tmp = (1.0 + exp((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, -2.6e-262], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1.85e+90], And[N[Not[LessEqual[x, 8.2e+184]], $MachinePrecision], LessEqual[x, 1e+252]]], N[(N[(1.0 + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-262}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+90} \lor \neg \left(x \leq 8.2 \cdot 10^{+184}\right) \land x \leq 10^{+252}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.5999999999999999e-262Initial program 62.5%
sub-neg62.5%
neg-sub062.5%
associate-+r-62.5%
Simplified62.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in eps around inf 75.4%
*-commutative75.4%
neg-mul-175.4%
neg-sub075.4%
*-commutative75.4%
sub-neg75.4%
mul-1-neg75.4%
distribute-rgt-in75.4%
*-lft-identity75.4%
mul-1-neg75.4%
cancel-sign-sub-inv75.4%
associate-+l-75.4%
neg-sub075.4%
neg-mul-175.4%
distribute-rgt-out75.4%
Simplified75.4%
Taylor expanded in eps around 0 83.9%
neg-mul-183.9%
Simplified83.9%
if -2.5999999999999999e-262 < x < 1.85e90 or 8.1999999999999993e184 < x < 1.0000000000000001e252Initial program 71.4%
sub-neg71.4%
neg-sub071.4%
associate-+r-71.4%
Simplified71.4%
Taylor expanded in x around 0 40.0%
Taylor expanded in eps around inf 68.1%
*-commutative68.1%
neg-mul-168.1%
neg-sub068.1%
*-commutative68.1%
sub-neg68.1%
mul-1-neg68.1%
distribute-rgt-in68.1%
*-lft-identity68.1%
mul-1-neg68.1%
cancel-sign-sub-inv68.1%
associate-+l-68.1%
neg-sub068.1%
neg-mul-168.1%
distribute-rgt-out68.1%
Simplified68.1%
Taylor expanded in eps around inf 68.2%
*-commutative68.2%
Simplified68.2%
if 1.85e90 < x < 8.1999999999999993e184 or 1.0000000000000001e252 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 74.3%
neg-mul-174.3%
rec-exp74.3%
neg-mul-174.3%
div-sub74.3%
+-inverses74.3%
Simplified74.3%
Final simplification74.7%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 1400000000000.0)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 3.4e+185)
0.0
(if (<= x 9.8e+247)
(/ (+ 2.0 (* (+ 1.0 (/ 1.0 eps)) (- (* 0.5 (* x x)) x))) 2.0)
0.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 1400000000000.0) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 3.4e+185) {
tmp = 0.0;
} else if (x <= 9.8e+247) {
tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - 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 <= 1400000000000.0d0) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 3.4d+185) then
tmp = 0.0d0
else if (x <= 9.8d+247) then
tmp = (2.0d0 + ((1.0d0 + (1.0d0 / eps)) * ((0.5d0 * (x * x)) - 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 <= 1400000000000.0) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 3.4e+185) {
tmp = 0.0;
} else if (x <= 9.8e+247) {
tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - x))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 1400000000000.0: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 3.4e+185: tmp = 0.0 elif x <= 9.8e+247: tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - x))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 1400000000000.0) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 3.4e+185) tmp = 0.0; elseif (x <= 9.8e+247) tmp = Float64(Float64(2.0 + Float64(Float64(1.0 + Float64(1.0 / eps)) * Float64(Float64(0.5 * Float64(x * x)) - 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 <= 1400000000000.0) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 3.4e+185) tmp = 0.0; elseif (x <= 9.8e+247) tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - 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, 1400000000000.0], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.4e+185], 0.0, If[LessEqual[x, 9.8e+247], N[(N[(2.0 + N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1400000000000:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+185}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{+247}:\\
\;\;\;\;\frac{2 + \left(1 + \frac{1}{\varepsilon}\right) \cdot \left(0.5 \cdot \left(x \cdot x\right) - x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.4e12Initial program 59.6%
sub-neg59.6%
neg-sub059.6%
associate-+r-59.6%
Simplified59.6%
Taylor expanded in x around 0 42.7%
Taylor expanded in eps around inf 81.2%
*-commutative81.2%
neg-mul-181.2%
neg-sub081.2%
*-commutative81.2%
sub-neg81.2%
mul-1-neg81.2%
distribute-rgt-in81.2%
*-lft-identity81.2%
mul-1-neg81.2%
cancel-sign-sub-inv81.2%
associate-+l-81.2%
neg-sub081.2%
neg-mul-181.2%
distribute-rgt-out81.2%
Simplified81.2%
Taylor expanded in eps around 0 81.9%
neg-mul-181.9%
Simplified81.9%
if 1.4e12 < x < 3.40000000000000017e185 or 9.7999999999999996e247 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 63.4%
neg-mul-163.4%
rec-exp63.4%
neg-mul-163.4%
div-sub63.4%
+-inverses63.4%
Simplified63.4%
if 3.40000000000000017e185 < x < 9.7999999999999996e247Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 29.8%
Taylor expanded in eps around 0 2.9%
neg-mul-12.9%
Simplified2.9%
Taylor expanded in x around 0 72.4%
+-commutative72.4%
associate-*r*72.4%
neg-mul-172.4%
distribute-lft-neg-in72.4%
distribute-rgt-out72.7%
unpow272.7%
Simplified72.7%
Final simplification76.2%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x 0.45)
(/ (- (- 2.0 x) (* eps x)) 2.0)
(if (<= x 1.5e+189)
0.0
(if (<= x 2e+249)
(/ (+ 2.0 (* (+ 1.0 (/ 1.0 eps)) (- (* 0.5 (* x x)) x))) 2.0)
0.0))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 0.45) {
tmp = ((2.0 - x) - (eps * x)) / 2.0;
} else if (x <= 1.5e+189) {
tmp = 0.0;
} else if (x <= 2e+249) {
tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - 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.45d0) then
tmp = ((2.0d0 - x) - (eps * x)) / 2.0d0
else if (x <= 1.5d+189) then
tmp = 0.0d0
else if (x <= 2d+249) then
tmp = (2.0d0 + ((1.0d0 + (1.0d0 / eps)) * ((0.5d0 * (x * x)) - 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.45) {
tmp = ((2.0 - x) - (eps * x)) / 2.0;
} else if (x <= 1.5e+189) {
tmp = 0.0;
} else if (x <= 2e+249) {
tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - x))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 0.45: tmp = ((2.0 - x) - (eps * x)) / 2.0 elif x <= 1.5e+189: tmp = 0.0 elif x <= 2e+249: tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - x))) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 0.45) tmp = Float64(Float64(Float64(2.0 - x) - Float64(eps * x)) / 2.0); elseif (x <= 1.5e+189) tmp = 0.0; elseif (x <= 2e+249) tmp = Float64(Float64(2.0 + Float64(Float64(1.0 + Float64(1.0 / eps)) * Float64(Float64(0.5 * Float64(x * x)) - 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.45) tmp = ((2.0 - x) - (eps * x)) / 2.0; elseif (x <= 1.5e+189) tmp = 0.0; elseif (x <= 2e+249) tmp = (2.0 + ((1.0 + (1.0 / eps)) * ((0.5 * (x * x)) - 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.45], N[(N[(N[(2.0 - x), $MachinePrecision] - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.5e+189], 0.0, If[LessEqual[x, 2e+249], N[(N[(2.0 + N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.45:\\
\;\;\;\;\frac{\left(2 - x\right) - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+189}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+249}:\\
\;\;\;\;\frac{2 + \left(1 + \frac{1}{\varepsilon}\right) \cdot \left(0.5 \cdot \left(x \cdot x\right) - x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 0.450000000000000011Initial program 58.9%
sub-neg58.9%
neg-sub058.9%
associate-+r-58.9%
Simplified58.9%
Taylor expanded in x around 0 46.5%
+-commutative46.5%
associate-+r+46.5%
associate-*r*46.5%
neg-mul-146.5%
*-commutative46.5%
associate-*r*46.5%
distribute-lft-neg-in46.5%
distribute-rgt-neg-in46.5%
sub-neg46.5%
mul-1-neg46.5%
distribute-neg-in46.5%
metadata-eval46.5%
mul-1-neg46.5%
remove-double-neg46.5%
+-commutative46.5%
distribute-rgt-in46.5%
neg-mul-146.5%
sub-neg46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in x around 0 25.8%
Taylor expanded in eps around 0 28.4%
neg-mul-128.4%
Simplified28.4%
Taylor expanded in eps around 0 68.2%
neg-mul-168.2%
associate-+r+68.2%
mul-1-neg68.2%
*-commutative68.2%
unsub-neg68.2%
unsub-neg68.2%
Simplified68.2%
if 0.450000000000000011 < x < 1.4999999999999999e189 or 1.9999999999999998e249 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.9%
neg-mul-160.9%
rec-exp60.9%
neg-mul-160.9%
div-sub60.9%
+-inverses60.9%
Simplified60.9%
if 1.4999999999999999e189 < x < 1.9999999999999998e249Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 29.8%
Taylor expanded in eps around 0 2.9%
neg-mul-12.9%
Simplified2.9%
Taylor expanded in x around 0 72.4%
+-commutative72.4%
associate-*r*72.4%
neg-mul-172.4%
distribute-lft-neg-in72.4%
distribute-rgt-out72.7%
unpow272.7%
Simplified72.7%
Final simplification66.4%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -0.00065)
(/ (* eps (- x)) 2.0)
(if (<= x 1400000000000.0)
1.0
(if (<= x 2.6e+193) 0.0 (if (<= x 9e+251) (/ (* eps x) 2.0) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -0.00065) {
tmp = (eps * -x) / 2.0;
} else if (x <= 1400000000000.0) {
tmp = 1.0;
} else if (x <= 2.6e+193) {
tmp = 0.0;
} else if (x <= 9e+251) {
tmp = (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.00065d0)) then
tmp = (eps * -x) / 2.0d0
else if (x <= 1400000000000.0d0) then
tmp = 1.0d0
else if (x <= 2.6d+193) then
tmp = 0.0d0
else if (x <= 9d+251) then
tmp = (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.00065) {
tmp = (eps * -x) / 2.0;
} else if (x <= 1400000000000.0) {
tmp = 1.0;
} else if (x <= 2.6e+193) {
tmp = 0.0;
} else if (x <= 9e+251) {
tmp = (eps * x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -0.00065: tmp = (eps * -x) / 2.0 elif x <= 1400000000000.0: tmp = 1.0 elif x <= 2.6e+193: tmp = 0.0 elif x <= 9e+251: tmp = (eps * x) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -0.00065) tmp = Float64(Float64(eps * Float64(-x)) / 2.0); elseif (x <= 1400000000000.0) tmp = 1.0; elseif (x <= 2.6e+193) tmp = 0.0; elseif (x <= 9e+251) tmp = Float64(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.00065) tmp = (eps * -x) / 2.0; elseif (x <= 1400000000000.0) tmp = 1.0; elseif (x <= 2.6e+193) tmp = 0.0; elseif (x <= 9e+251) tmp = (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.00065], N[(N[(eps * (-x)), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1400000000000.0], 1.0, If[LessEqual[x, 2.6e+193], 0.0, If[LessEqual[x, 9e+251], N[(N[(eps * x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00065:\\
\;\;\;\;\frac{\varepsilon \cdot \left(-x\right)}{2}\\
\mathbf{elif}\;x \leq 1400000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+193}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+251}:\\
\;\;\;\;\frac{\varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -6.4999999999999997e-4Initial program 96.9%
sub-neg96.9%
neg-sub096.9%
associate-+r-96.9%
Simplified96.9%
Taylor expanded in x around 0 66.6%
+-commutative66.6%
associate-+r+66.6%
associate-*r*66.6%
neg-mul-166.6%
*-commutative66.6%
associate-*r*66.6%
distribute-lft-neg-in66.6%
distribute-rgt-neg-in66.6%
sub-neg66.6%
mul-1-neg66.6%
distribute-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
remove-double-neg66.6%
+-commutative66.6%
distribute-rgt-in66.6%
neg-mul-166.6%
sub-neg66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in x around 0 0.8%
Taylor expanded in eps around 0 17.2%
neg-mul-117.2%
Simplified17.2%
Taylor expanded in eps around inf 17.2%
associate-*r*17.2%
mul-1-neg17.2%
Simplified17.2%
if -6.4999999999999997e-4 < x < 1.4e12Initial program 50.9%
sub-neg50.9%
neg-sub050.9%
associate-+r-50.9%
Simplified50.9%
Taylor expanded in x around 0 80.1%
if 1.4e12 < x < 2.60000000000000013e193 or 8.9999999999999997e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 63.8%
neg-mul-163.8%
rec-exp63.8%
neg-mul-163.8%
div-sub63.8%
+-inverses63.8%
Simplified63.8%
if 2.60000000000000013e193 < x < 8.9999999999999997e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 30.9%
+-commutative30.9%
associate-+r+30.9%
associate-*r*30.9%
neg-mul-130.9%
*-commutative30.9%
associate-*r*30.9%
distribute-lft-neg-in30.9%
distribute-rgt-neg-in30.9%
sub-neg30.9%
mul-1-neg30.9%
distribute-neg-in30.9%
metadata-eval30.9%
mul-1-neg30.9%
remove-double-neg30.9%
+-commutative30.9%
distribute-rgt-in30.9%
neg-mul-130.9%
sub-neg30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in eps around inf 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification63.7%
NOTE: eps should be positive before calling this function
(FPCore (x eps)
:precision binary64
(if (<= x -0.00065)
(/ (* eps (- x)) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (<= x 1.2e+191) 0.0 (if (<= x 7.8e+251) (/ (* eps x) 2.0) 0.0)))))eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= -0.00065) {
tmp = (eps * -x) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 1.2e+191) {
tmp = 0.0;
} else if (x <= 7.8e+251) {
tmp = (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.00065d0)) then
tmp = (eps * -x) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if (x <= 1.2d+191) then
tmp = 0.0d0
else if (x <= 7.8d+251) then
tmp = (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.00065) {
tmp = (eps * -x) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 1.2e+191) {
tmp = 0.0;
} else if (x <= 7.8e+251) {
tmp = (eps * x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= -0.00065: tmp = (eps * -x) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif x <= 1.2e+191: tmp = 0.0 elif x <= 7.8e+251: tmp = (eps * x) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= -0.00065) tmp = Float64(Float64(eps * Float64(-x)) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif (x <= 1.2e+191) tmp = 0.0; elseif (x <= 7.8e+251) tmp = Float64(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.00065) tmp = (eps * -x) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif (x <= 1.2e+191) tmp = 0.0; elseif (x <= 7.8e+251) tmp = (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.00065], N[(N[(eps * (-x)), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.2e+191], 0.0, If[LessEqual[x, 7.8e+251], N[(N[(eps * x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00065:\\
\;\;\;\;\frac{\varepsilon \cdot \left(-x\right)}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+191}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+251}:\\
\;\;\;\;\frac{\varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -6.4999999999999997e-4Initial program 96.9%
sub-neg96.9%
neg-sub096.9%
associate-+r-96.9%
Simplified96.9%
Taylor expanded in x around 0 66.6%
+-commutative66.6%
associate-+r+66.6%
associate-*r*66.6%
neg-mul-166.6%
*-commutative66.6%
associate-*r*66.6%
distribute-lft-neg-in66.6%
distribute-rgt-neg-in66.6%
sub-neg66.6%
mul-1-neg66.6%
distribute-neg-in66.6%
metadata-eval66.6%
mul-1-neg66.6%
remove-double-neg66.6%
+-commutative66.6%
distribute-rgt-in66.6%
neg-mul-166.6%
sub-neg66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in x around 0 0.8%
Taylor expanded in eps around 0 17.2%
neg-mul-117.2%
Simplified17.2%
Taylor expanded in eps around inf 17.2%
associate-*r*17.2%
mul-1-neg17.2%
Simplified17.2%
if -6.4999999999999997e-4 < x < 1.4199999999999999Initial program 50.1%
sub-neg50.1%
neg-sub050.1%
associate-+r-50.1%
Simplified50.1%
Taylor expanded in eps around 0 81.8%
distribute-rgt1-in81.7%
neg-mul-181.7%
distribute-lft-out81.7%
distribute-rgt1-in81.7%
neg-mul-181.7%
Simplified81.7%
Taylor expanded in x around 0 81.4%
*-commutative81.4%
unpow281.4%
Simplified81.4%
Taylor expanded in x around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
unpow281.4%
Simplified81.4%
if 1.4199999999999999 < x < 1.19999999999999993e191 or 7.79999999999999951e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 62.0%
neg-mul-162.0%
rec-exp62.0%
neg-mul-162.0%
div-sub62.0%
+-inverses62.0%
Simplified62.0%
if 1.19999999999999993e191 < x < 7.79999999999999951e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 30.9%
+-commutative30.9%
associate-+r+30.9%
associate-*r*30.9%
neg-mul-130.9%
*-commutative30.9%
associate-*r*30.9%
distribute-lft-neg-in30.9%
distribute-rgt-neg-in30.9%
sub-neg30.9%
mul-1-neg30.9%
distribute-neg-in30.9%
metadata-eval30.9%
mul-1-neg30.9%
remove-double-neg30.9%
+-commutative30.9%
distribute-rgt-in30.9%
neg-mul-130.9%
sub-neg30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in eps around inf 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification63.8%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 1400000000000.0) 1.0 (if (<= x 2.8e+192) 0.0 (if (<= x 8.4e+251) (/ (* eps x) 2.0) 0.0))))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 1400000000000.0) {
tmp = 1.0;
} else if (x <= 2.8e+192) {
tmp = 0.0;
} else if (x <= 8.4e+251) {
tmp = (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 <= 1400000000000.0d0) then
tmp = 1.0d0
else if (x <= 2.8d+192) then
tmp = 0.0d0
else if (x <= 8.4d+251) then
tmp = (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 <= 1400000000000.0) {
tmp = 1.0;
} else if (x <= 2.8e+192) {
tmp = 0.0;
} else if (x <= 8.4e+251) {
tmp = (eps * x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 1400000000000.0: tmp = 1.0 elif x <= 2.8e+192: tmp = 0.0 elif x <= 8.4e+251: tmp = (eps * x) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 1400000000000.0) tmp = 1.0; elseif (x <= 2.8e+192) tmp = 0.0; elseif (x <= 8.4e+251) tmp = Float64(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 <= 1400000000000.0) tmp = 1.0; elseif (x <= 2.8e+192) tmp = 0.0; elseif (x <= 8.4e+251) tmp = (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, 1400000000000.0], 1.0, If[LessEqual[x, 2.8e+192], 0.0, If[LessEqual[x, 8.4e+251], N[(N[(eps * x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1400000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+192}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{+251}:\\
\;\;\;\;\frac{\varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.4e12Initial program 59.6%
sub-neg59.6%
neg-sub059.6%
associate-+r-59.6%
Simplified59.6%
Taylor expanded in x around 0 65.4%
if 1.4e12 < x < 2.79999999999999976e192 or 8.4000000000000001e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 63.8%
neg-mul-163.8%
rec-exp63.8%
neg-mul-163.8%
div-sub63.8%
+-inverses63.8%
Simplified63.8%
if 2.79999999999999976e192 < x < 8.4000000000000001e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 30.9%
+-commutative30.9%
associate-+r+30.9%
associate-*r*30.9%
neg-mul-130.9%
*-commutative30.9%
associate-*r*30.9%
distribute-lft-neg-in30.9%
distribute-rgt-neg-in30.9%
sub-neg30.9%
mul-1-neg30.9%
distribute-neg-in30.9%
metadata-eval30.9%
mul-1-neg30.9%
remove-double-neg30.9%
+-commutative30.9%
distribute-rgt-in30.9%
neg-mul-130.9%
sub-neg30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in eps around inf 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification61.9%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 2.0) (/ (- 2.0 x) 2.0) (if (<= x 2.5e+188) 0.0 (if (<= x 2.8e+251) (/ (* eps x) 2.0) 0.0))))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 - x) / 2.0;
} else if (x <= 2.5e+188) {
tmp = 0.0;
} else if (x <= 2.8e+251) {
tmp = (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 <= 2.0d0) then
tmp = (2.0d0 - x) / 2.0d0
else if (x <= 2.5d+188) then
tmp = 0.0d0
else if (x <= 2.8d+251) then
tmp = (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 <= 2.0) {
tmp = (2.0 - x) / 2.0;
} else if (x <= 2.5e+188) {
tmp = 0.0;
} else if (x <= 2.8e+251) {
tmp = (eps * x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 2.0: tmp = (2.0 - x) / 2.0 elif x <= 2.5e+188: tmp = 0.0 elif x <= 2.8e+251: tmp = (eps * x) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(2.0 - x) / 2.0); elseif (x <= 2.5e+188) tmp = 0.0; elseif (x <= 2.8e+251) tmp = Float64(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 <= 2.0) tmp = (2.0 - x) / 2.0; elseif (x <= 2.5e+188) tmp = 0.0; elseif (x <= 2.8e+251) tmp = (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, 2.0], N[(N[(2.0 - x), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.5e+188], 0.0, If[LessEqual[x, 2.8e+251], N[(N[(eps * x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\frac{2 - x}{2}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+188}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+251}:\\
\;\;\;\;\frac{\varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2Initial program 59.1%
sub-neg59.1%
neg-sub059.1%
associate-+r-59.1%
Simplified59.1%
Taylor expanded in x around 0 46.8%
+-commutative46.8%
associate-+r+46.8%
associate-*r*46.8%
neg-mul-146.8%
*-commutative46.8%
associate-*r*46.8%
distribute-lft-neg-in46.8%
distribute-rgt-neg-in46.8%
sub-neg46.8%
mul-1-neg46.8%
distribute-neg-in46.8%
metadata-eval46.8%
mul-1-neg46.8%
remove-double-neg46.8%
+-commutative46.8%
distribute-rgt-in46.8%
neg-mul-146.8%
sub-neg46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in x around 0 25.7%
Taylor expanded in eps around 0 28.3%
neg-mul-128.3%
Simplified28.3%
Taylor expanded in eps around 0 66.3%
neg-mul-166.3%
unsub-neg66.3%
Simplified66.3%
if 2 < x < 2.5000000000000001e188 or 2.8e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 62.0%
neg-mul-162.0%
rec-exp62.0%
neg-mul-162.0%
div-sub62.0%
+-inverses62.0%
Simplified62.0%
if 2.5000000000000001e188 < x < 2.8e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 30.9%
+-commutative30.9%
associate-+r+30.9%
associate-*r*30.9%
neg-mul-130.9%
*-commutative30.9%
associate-*r*30.9%
distribute-lft-neg-in30.9%
distribute-rgt-neg-in30.9%
sub-neg30.9%
mul-1-neg30.9%
distribute-neg-in30.9%
metadata-eval30.9%
mul-1-neg30.9%
remove-double-neg30.9%
+-commutative30.9%
distribute-rgt-in30.9%
neg-mul-130.9%
sub-neg30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in eps around inf 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification62.0%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 0.45) (/ (- (- 2.0 x) (* eps x)) 2.0) (if (<= x 1.35e+193) 0.0 (if (<= x 2.2e+251) (/ (* eps x) 2.0) 0.0))))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 0.45) {
tmp = ((2.0 - x) - (eps * x)) / 2.0;
} else if (x <= 1.35e+193) {
tmp = 0.0;
} else if (x <= 2.2e+251) {
tmp = (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.45d0) then
tmp = ((2.0d0 - x) - (eps * x)) / 2.0d0
else if (x <= 1.35d+193) then
tmp = 0.0d0
else if (x <= 2.2d+251) then
tmp = (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.45) {
tmp = ((2.0 - x) - (eps * x)) / 2.0;
} else if (x <= 1.35e+193) {
tmp = 0.0;
} else if (x <= 2.2e+251) {
tmp = (eps * x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 0.45: tmp = ((2.0 - x) - (eps * x)) / 2.0 elif x <= 1.35e+193: tmp = 0.0 elif x <= 2.2e+251: tmp = (eps * x) / 2.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 0.45) tmp = Float64(Float64(Float64(2.0 - x) - Float64(eps * x)) / 2.0); elseif (x <= 1.35e+193) tmp = 0.0; elseif (x <= 2.2e+251) tmp = Float64(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.45) tmp = ((2.0 - x) - (eps * x)) / 2.0; elseif (x <= 1.35e+193) tmp = 0.0; elseif (x <= 2.2e+251) tmp = (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.45], N[(N[(N[(2.0 - x), $MachinePrecision] - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.35e+193], 0.0, If[LessEqual[x, 2.2e+251], N[(N[(eps * x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.45:\\
\;\;\;\;\frac{\left(2 - x\right) - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+193}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+251}:\\
\;\;\;\;\frac{\varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 0.450000000000000011Initial program 58.9%
sub-neg58.9%
neg-sub058.9%
associate-+r-58.9%
Simplified58.9%
Taylor expanded in x around 0 46.5%
+-commutative46.5%
associate-+r+46.5%
associate-*r*46.5%
neg-mul-146.5%
*-commutative46.5%
associate-*r*46.5%
distribute-lft-neg-in46.5%
distribute-rgt-neg-in46.5%
sub-neg46.5%
mul-1-neg46.5%
distribute-neg-in46.5%
metadata-eval46.5%
mul-1-neg46.5%
remove-double-neg46.5%
+-commutative46.5%
distribute-rgt-in46.5%
neg-mul-146.5%
sub-neg46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in x around 0 25.8%
Taylor expanded in eps around 0 28.4%
neg-mul-128.4%
Simplified28.4%
Taylor expanded in eps around 0 68.2%
neg-mul-168.2%
associate-+r+68.2%
mul-1-neg68.2%
*-commutative68.2%
unsub-neg68.2%
unsub-neg68.2%
Simplified68.2%
if 0.450000000000000011 < x < 1.35e193 or 2.2e251 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.2%
neg-mul-161.2%
rec-exp61.2%
neg-mul-161.2%
div-sub61.2%
+-inverses61.2%
Simplified61.2%
if 1.35e193 < x < 2.2e251Initial program 100.0%
sub-neg100.0%
neg-sub0100.0%
associate-+r-100.0%
Simplified100.0%
Taylor expanded in x around 0 30.9%
+-commutative30.9%
associate-+r+30.9%
associate-*r*30.9%
neg-mul-130.9%
*-commutative30.9%
associate-*r*30.9%
distribute-lft-neg-in30.9%
distribute-rgt-neg-in30.9%
sub-neg30.9%
mul-1-neg30.9%
distribute-neg-in30.9%
metadata-eval30.9%
mul-1-neg30.9%
remove-double-neg30.9%
+-commutative30.9%
distribute-rgt-in30.9%
neg-mul-130.9%
sub-neg30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in eps around inf 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification63.0%
NOTE: eps should be positive before calling this function (FPCore (x eps) :precision binary64 (if (<= x 1400000000000.0) 1.0 0.0))
eps = abs(eps);
double code(double x, double eps) {
double tmp;
if (x <= 1400000000000.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 <= 1400000000000.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 <= 1400000000000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps = abs(eps) def code(x, eps): tmp = 0 if x <= 1400000000000.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps = abs(eps) function code(x, eps) tmp = 0.0 if (x <= 1400000000000.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 <= 1400000000000.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, 1400000000000.0], 1.0, 0.0]
\begin{array}{l}
eps = |eps|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1400000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.4e12Initial program 59.6%
sub-neg59.6%
neg-sub059.6%
associate-+r-59.6%
Simplified59.6%
Taylor expanded in x around 0 65.4%
if 1.4e12 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 56.4%
neg-mul-156.4%
rec-exp56.4%
neg-mul-156.4%
div-sub56.4%
+-inverses56.4%
Simplified56.4%
Final simplification62.3%
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 73.5%
Simplified73.5%
Taylor expanded in eps around 0 20.9%
neg-mul-120.9%
rec-exp20.9%
neg-mul-120.9%
div-sub20.9%
+-inverses21.1%
Simplified21.1%
Final simplification21.1%
herbie shell --seed 2023293
(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))