
(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 13 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}
(FPCore (x eps) :precision binary64 (/ (+ (exp (* (+ eps -1.0) x)) (exp (* x (- -1.0 eps)))) 2.0))
double code(double x, double eps) {
return (exp(((eps + -1.0) * x)) + exp((x * (-1.0 - eps)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (exp(((eps + (-1.0d0)) * x)) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (Math.exp(((eps + -1.0) * x)) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
def code(x, eps): return (math.exp(((eps + -1.0) * x)) + math.exp((x * (-1.0 - eps)))) / 2.0
function code(x, eps) return Float64(Float64(exp(Float64(Float64(eps + -1.0) * x)) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0) end
function tmp = code(x, eps) tmp = (exp(((eps + -1.0) * x)) + exp((x * (-1.0 - eps)))) / 2.0; end
code[x_, eps_] := N[(N[(N[Exp[N[(N[(eps + -1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{\left(\varepsilon + -1\right) \cdot x} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}
\end{array}
Initial program 72.8%
div-sub72.8%
+-rgt-identity72.8%
div-sub72.8%
Simplified72.8%
Taylor expanded in eps around inf 99.5%
mul-1-neg99.5%
distribute-lft-neg-in99.5%
mul-1-neg99.5%
exp-prod99.5%
+-commutative99.5%
*-commutative99.5%
exp-prod99.5%
neg-mul-199.5%
+-commutative99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x eps) :precision binary64 (/ (+ (exp (* eps (- x))) (exp (* (+ eps -1.0) x))) 2.0))
double code(double x, double eps) {
return (exp((eps * -x)) + exp(((eps + -1.0) * x))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (exp((eps * -x)) + exp(((eps + (-1.0d0)) * x))) / 2.0d0
end function
public static double code(double x, double eps) {
return (Math.exp((eps * -x)) + Math.exp(((eps + -1.0) * x))) / 2.0;
}
def code(x, eps): return (math.exp((eps * -x)) + math.exp(((eps + -1.0) * x))) / 2.0
function code(x, eps) return Float64(Float64(exp(Float64(eps * Float64(-x))) + exp(Float64(Float64(eps + -1.0) * x))) / 2.0) end
function tmp = code(x, eps) tmp = (exp((eps * -x)) + exp(((eps + -1.0) * x))) / 2.0; end
code[x_, eps_] := N[(N[(N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(N[(eps + -1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{\varepsilon \cdot \left(-x\right)} + e^{\left(\varepsilon + -1\right) \cdot x}}{2}
\end{array}
Initial program 72.8%
div-sub72.8%
+-rgt-identity72.8%
div-sub72.8%
Simplified72.8%
Taylor expanded in eps around inf 99.5%
mul-1-neg99.5%
distribute-lft-neg-in99.5%
mul-1-neg99.5%
exp-prod99.5%
+-commutative99.5%
*-commutative99.5%
exp-prod99.5%
neg-mul-199.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in eps around inf 87.4%
Taylor expanded in eps around inf 87.4%
distribute-lft-neg-in87.4%
*-commutative87.4%
sub-neg87.4%
metadata-eval87.4%
Simplified87.4%
Final simplification87.4%
(FPCore (x eps)
:precision binary64
(if (<= x -6.6e-254)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(if (<= x 5e+24)
(/ (+ 1.0 (exp (* x (+ 1.0 eps)))) 2.0)
(if (<= x 3.8e+68)
0.0
(if (<= x 1e+97)
(/
(+
(* (+ 1.0 (/ 1.0 eps)) (exp (* (+ eps -1.0) x)))
(+ 1.0 (/ -1.0 eps)))
2.0)
(if (<= x 6.2e+214)
0.0
(if (<= x 3.1e+302)
(/ (+ (+ 1.0 (+ (* eps x) (- x x))) (exp (* x (- -1.0 eps)))) 2.0)
0.0)))))))
double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else if (x <= 5e+24) {
tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 3.8e+68) {
tmp = 0.0;
} else if (x <= 1e+97) {
tmp = (((1.0 + (1.0 / eps)) * exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0;
} else if (x <= 6.2e+214) {
tmp = 0.0;
} else if (x <= 3.1e+302) {
tmp = ((1.0 + ((eps * x) + (x - x))) + exp((x * (-1.0 - eps)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-6.6d-254)) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else if (x <= 5d+24) then
tmp = (1.0d0 + exp((x * (1.0d0 + eps)))) / 2.0d0
else if (x <= 3.8d+68) then
tmp = 0.0d0
else if (x <= 1d+97) then
tmp = (((1.0d0 + (1.0d0 / eps)) * exp(((eps + (-1.0d0)) * x))) + (1.0d0 + ((-1.0d0) / eps))) / 2.0d0
else if (x <= 6.2d+214) then
tmp = 0.0d0
else if (x <= 3.1d+302) then
tmp = ((1.0d0 + ((eps * x) + (x - x))) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else if (x <= 5e+24) {
tmp = (1.0 + Math.exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 3.8e+68) {
tmp = 0.0;
} else if (x <= 1e+97) {
tmp = (((1.0 + (1.0 / eps)) * Math.exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0;
} else if (x <= 6.2e+214) {
tmp = 0.0;
} else if (x <= 3.1e+302) {
tmp = ((1.0 + ((eps * x) + (x - x))) + Math.exp((x * (-1.0 - eps)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -6.6e-254: tmp = (1.0 + math.exp((eps * -x))) / 2.0 elif x <= 5e+24: tmp = (1.0 + math.exp((x * (1.0 + eps)))) / 2.0 elif x <= 3.8e+68: tmp = 0.0 elif x <= 1e+97: tmp = (((1.0 + (1.0 / eps)) * math.exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0 elif x <= 6.2e+214: tmp = 0.0 elif x <= 3.1e+302: tmp = ((1.0 + ((eps * x) + (x - x))) + math.exp((x * (-1.0 - eps)))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -6.6e-254) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); elseif (x <= 5e+24) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 + eps)))) / 2.0); elseif (x <= 3.8e+68) tmp = 0.0; elseif (x <= 1e+97) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(Float64(eps + -1.0) * x))) + Float64(1.0 + Float64(-1.0 / eps))) / 2.0); elseif (x <= 6.2e+214) tmp = 0.0; elseif (x <= 3.1e+302) tmp = Float64(Float64(Float64(1.0 + Float64(Float64(eps * x) + Float64(x - x))) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -6.6e-254) tmp = (1.0 + exp((eps * -x))) / 2.0; elseif (x <= 5e+24) tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0; elseif (x <= 3.8e+68) tmp = 0.0; elseif (x <= 1e+97) tmp = (((1.0 + (1.0 / eps)) * exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0; elseif (x <= 6.2e+214) tmp = 0.0; elseif (x <= 3.1e+302) tmp = ((1.0 + ((eps * x) + (x - x))) + exp((x * (-1.0 - eps)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -6.6e-254], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+24], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.8e+68], 0.0, If[LessEqual[x, 1e+97], N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(eps + -1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.2e+214], 0.0, If[LessEqual[x, 3.1e+302], N[(N[(N[(1.0 + N[(N[(eps * x), $MachinePrecision] + N[(x - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-254}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 + \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+68}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 10^{+97}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\left(\varepsilon + -1\right) \cdot x} + \left(1 + \frac{-1}{\varepsilon}\right)}{2}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+302}:\\
\;\;\;\;\frac{\left(1 + \left(\varepsilon \cdot x + \left(x - x\right)\right)\right) + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -6.60000000000000033e-254Initial program 68.1%
div-sub68.1%
+-rgt-identity68.1%
div-sub68.1%
Simplified68.1%
Taylor expanded in x around 0 39.0%
Taylor expanded in eps around inf 69.8%
Taylor expanded in eps around inf 70.8%
*-commutative70.8%
Simplified70.8%
if -6.60000000000000033e-254 < x < 5.00000000000000045e24Initial program 55.1%
div-sub55.1%
+-rgt-identity55.1%
div-sub55.1%
Simplified55.1%
Taylor expanded in x around 0 39.4%
add-log-exp39.4%
*-un-lft-identity39.4%
log-prod39.4%
metadata-eval39.4%
add-log-exp39.4%
*-commutative39.4%
add-sqr-sqrt7.5%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod30.9%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
+-lft-identity38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in eps around inf 83.1%
if 5.00000000000000045e24 < x < 3.8000000000000001e68 or 1.0000000000000001e97 < x < 6.19999999999999957e214 or 3.0999999999999998e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.6%
div-sub71.6%
rec-exp71.6%
mul-1-neg71.6%
+-inverses71.6%
Simplified71.6%
if 3.8000000000000001e68 < x < 1.0000000000000001e97Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 46.1%
if 6.19999999999999957e214 < x < 3.0999999999999998e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
Final simplification71.6%
(FPCore (x eps)
:precision binary64
(if (<= x -6.6e-254)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(if (<= x 1e+24)
(/ (+ 1.0 (exp (* x (+ 1.0 eps)))) 2.0)
(if (<= x 1.6e+67)
0.0
(if (<= x 1.4e+97)
(/
(+
(* (+ 1.0 (/ 1.0 eps)) (exp (* (+ eps -1.0) x)))
(+ 1.0 (/ -1.0 eps)))
2.0)
(if (<= x 6.9e+214)
0.0
(if (<= x 7.5e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0)))))))
double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else if (x <= 1e+24) {
tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 1.6e+67) {
tmp = 0.0;
} else if (x <= 1.4e+97) {
tmp = (((1.0 + (1.0 / eps)) * exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0;
} else if (x <= 6.9e+214) {
tmp = 0.0;
} else if (x <= 7.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-6.6d-254)) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else if (x <= 1d+24) then
tmp = (1.0d0 + exp((x * (1.0d0 + eps)))) / 2.0d0
else if (x <= 1.6d+67) then
tmp = 0.0d0
else if (x <= 1.4d+97) then
tmp = (((1.0d0 + (1.0d0 / eps)) * exp(((eps + (-1.0d0)) * x))) + (1.0d0 + ((-1.0d0) / eps))) / 2.0d0
else if (x <= 6.9d+214) then
tmp = 0.0d0
else if (x <= 7.5d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else if (x <= 1e+24) {
tmp = (1.0 + Math.exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 1.6e+67) {
tmp = 0.0;
} else if (x <= 1.4e+97) {
tmp = (((1.0 + (1.0 / eps)) * Math.exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0;
} else if (x <= 6.9e+214) {
tmp = 0.0;
} else if (x <= 7.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -6.6e-254: tmp = (1.0 + math.exp((eps * -x))) / 2.0 elif x <= 1e+24: tmp = (1.0 + math.exp((x * (1.0 + eps)))) / 2.0 elif x <= 1.6e+67: tmp = 0.0 elif x <= 1.4e+97: tmp = (((1.0 + (1.0 / eps)) * math.exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0 elif x <= 6.9e+214: tmp = 0.0 elif x <= 7.5e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -6.6e-254) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); elseif (x <= 1e+24) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 + eps)))) / 2.0); elseif (x <= 1.6e+67) tmp = 0.0; elseif (x <= 1.4e+97) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(Float64(eps + -1.0) * x))) + Float64(1.0 + Float64(-1.0 / eps))) / 2.0); elseif (x <= 6.9e+214) tmp = 0.0; elseif (x <= 7.5e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -6.6e-254) tmp = (1.0 + exp((eps * -x))) / 2.0; elseif (x <= 1e+24) tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0; elseif (x <= 1.6e+67) tmp = 0.0; elseif (x <= 1.4e+97) tmp = (((1.0 + (1.0 / eps)) * exp(((eps + -1.0) * x))) + (1.0 + (-1.0 / eps))) / 2.0; elseif (x <= 6.9e+214) tmp = 0.0; elseif (x <= 7.5e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -6.6e-254], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+24], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+67], 0.0, If[LessEqual[x, 1.4e+97], N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(eps + -1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.9e+214], 0.0, If[LessEqual[x, 7.5e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-254}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 10^{+24}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 + \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+67}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+97}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\left(\varepsilon + -1\right) \cdot x} + \left(1 + \frac{-1}{\varepsilon}\right)}{2}\\
\mathbf{elif}\;x \leq 6.9 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -6.60000000000000033e-254Initial program 68.1%
div-sub68.1%
+-rgt-identity68.1%
div-sub68.1%
Simplified68.1%
Taylor expanded in x around 0 39.0%
Taylor expanded in eps around inf 69.8%
Taylor expanded in eps around inf 70.8%
*-commutative70.8%
Simplified70.8%
if -6.60000000000000033e-254 < x < 9.9999999999999998e23Initial program 55.1%
div-sub55.1%
+-rgt-identity55.1%
div-sub55.1%
Simplified55.1%
Taylor expanded in x around 0 39.4%
add-log-exp39.4%
*-un-lft-identity39.4%
log-prod39.4%
metadata-eval39.4%
add-log-exp39.4%
*-commutative39.4%
add-sqr-sqrt7.5%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod30.9%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
+-lft-identity38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in eps around inf 83.1%
if 9.9999999999999998e23 < x < 1.59999999999999991e67 or 1.4e97 < x < 6.89999999999999976e214 or 7.49999999999999924e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.6%
div-sub71.6%
rec-exp71.6%
mul-1-neg71.6%
+-inverses71.6%
Simplified71.6%
if 1.59999999999999991e67 < x < 1.4e97Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 46.1%
if 6.89999999999999976e214 < x < 7.49999999999999924e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification71.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp x)) 2.0)))
(if (<= x -1.1e-242)
(/ (- 2.0 (* eps x)) 2.0)
(if (<= x 1e+24)
t_0
(if (<= x 2e+67)
0.0
(if (<= x 1e+97)
t_0
(if (<= x 5.8e+214)
0.0
(if (<= x 1.26e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))))))
double code(double x, double eps) {
double t_0 = (1.0 + exp(x)) / 2.0;
double tmp;
if (x <= -1.1e-242) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 1e+24) {
tmp = t_0;
} else if (x <= 2e+67) {
tmp = 0.0;
} else if (x <= 1e+97) {
tmp = t_0;
} else if (x <= 5.8e+214) {
tmp = 0.0;
} else if (x <= 1.26e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
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 = (1.0d0 + exp(x)) / 2.0d0
if (x <= (-1.1d-242)) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else if (x <= 1d+24) then
tmp = t_0
else if (x <= 2d+67) then
tmp = 0.0d0
else if (x <= 1d+97) then
tmp = t_0
else if (x <= 5.8d+214) then
tmp = 0.0d0
else if (x <= 1.26d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (1.0 + Math.exp(x)) / 2.0;
double tmp;
if (x <= -1.1e-242) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 1e+24) {
tmp = t_0;
} else if (x <= 2e+67) {
tmp = 0.0;
} else if (x <= 1e+97) {
tmp = t_0;
} else if (x <= 5.8e+214) {
tmp = 0.0;
} else if (x <= 1.26e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): t_0 = (1.0 + math.exp(x)) / 2.0 tmp = 0 if x <= -1.1e-242: tmp = (2.0 - (eps * x)) / 2.0 elif x <= 1e+24: tmp = t_0 elif x <= 2e+67: tmp = 0.0 elif x <= 1e+97: tmp = t_0 elif x <= 5.8e+214: tmp = 0.0 elif x <= 1.26e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) t_0 = Float64(Float64(1.0 + exp(x)) / 2.0) tmp = 0.0 if (x <= -1.1e-242) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); elseif (x <= 1e+24) tmp = t_0; elseif (x <= 2e+67) tmp = 0.0; elseif (x <= 1e+97) tmp = t_0; elseif (x <= 5.8e+214) tmp = 0.0; elseif (x <= 1.26e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (1.0 + exp(x)) / 2.0; tmp = 0.0; if (x <= -1.1e-242) tmp = (2.0 - (eps * x)) / 2.0; elseif (x <= 1e+24) tmp = t_0; elseif (x <= 2e+67) tmp = 0.0; elseif (x <= 1e+97) tmp = t_0; elseif (x <= 5.8e+214) tmp = 0.0; elseif (x <= 1.26e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -1.1e-242], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+24], t$95$0, If[LessEqual[x, 2e+67], 0.0, If[LessEqual[x, 1e+97], t$95$0, If[LessEqual[x, 5.8e+214], 0.0, If[LessEqual[x, 1.26e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1 + e^{x}}{2}\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-242}:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 10^{+24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+67}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 10^{+97}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.10000000000000001e-242Initial program 67.3%
div-sub67.3%
+-rgt-identity67.3%
div-sub67.3%
Simplified67.3%
Taylor expanded in x around 0 38.3%
Taylor expanded in x around 0 35.3%
Taylor expanded in eps around inf 53.4%
neg-mul-153.4%
distribute-lft-neg-in53.4%
Simplified53.4%
if -1.10000000000000001e-242 < x < 9.9999999999999998e23 or 1.99999999999999997e67 < x < 1.0000000000000001e97Initial program 59.6%
div-sub59.6%
+-rgt-identity59.6%
div-sub59.6%
Simplified59.6%
Taylor expanded in eps around inf 99.8%
mul-1-neg99.8%
distribute-lft-neg-in99.8%
mul-1-neg99.8%
exp-prod99.8%
+-commutative99.8%
*-commutative99.8%
exp-prod99.8%
neg-mul-199.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in eps around inf 96.2%
Taylor expanded in eps around 0 65.1%
mul-1-neg65.1%
Simplified65.1%
expm1-log1p-u63.6%
expm1-udef63.6%
add-sqr-sqrt14.9%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod60.4%
add-sqr-sqrt75.2%
Applied egg-rr75.2%
expm1-def75.2%
expm1-log1p76.7%
Simplified76.7%
if 9.9999999999999998e23 < x < 1.99999999999999997e67 or 1.0000000000000001e97 < x < 5.7999999999999999e214 or 1.25999999999999996e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.6%
div-sub71.6%
rec-exp71.6%
mul-1-neg71.6%
+-inverses71.6%
Simplified71.6%
if 5.7999999999999999e214 < x < 1.25999999999999996e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification64.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp x)) 2.0)))
(if (<= x -1e-242)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(if (<= x 5e+24)
t_0
(if (<= x 5e+67)
0.0
(if (<= x 9.5e+96)
t_0
(if (<= x 6.2e+214)
0.0
(if (<= x 2.3e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))))))
double code(double x, double eps) {
double t_0 = (1.0 + exp(x)) / 2.0;
double tmp;
if (x <= -1e-242) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else if (x <= 5e+24) {
tmp = t_0;
} else if (x <= 5e+67) {
tmp = 0.0;
} else if (x <= 9.5e+96) {
tmp = t_0;
} else if (x <= 6.2e+214) {
tmp = 0.0;
} else if (x <= 2.3e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
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 = (1.0d0 + exp(x)) / 2.0d0
if (x <= (-1d-242)) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else if (x <= 5d+24) then
tmp = t_0
else if (x <= 5d+67) then
tmp = 0.0d0
else if (x <= 9.5d+96) then
tmp = t_0
else if (x <= 6.2d+214) then
tmp = 0.0d0
else if (x <= 2.3d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (1.0 + Math.exp(x)) / 2.0;
double tmp;
if (x <= -1e-242) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else if (x <= 5e+24) {
tmp = t_0;
} else if (x <= 5e+67) {
tmp = 0.0;
} else if (x <= 9.5e+96) {
tmp = t_0;
} else if (x <= 6.2e+214) {
tmp = 0.0;
} else if (x <= 2.3e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): t_0 = (1.0 + math.exp(x)) / 2.0 tmp = 0 if x <= -1e-242: tmp = (1.0 + math.exp((eps * -x))) / 2.0 elif x <= 5e+24: tmp = t_0 elif x <= 5e+67: tmp = 0.0 elif x <= 9.5e+96: tmp = t_0 elif x <= 6.2e+214: tmp = 0.0 elif x <= 2.3e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) t_0 = Float64(Float64(1.0 + exp(x)) / 2.0) tmp = 0.0 if (x <= -1e-242) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); elseif (x <= 5e+24) tmp = t_0; elseif (x <= 5e+67) tmp = 0.0; elseif (x <= 9.5e+96) tmp = t_0; elseif (x <= 6.2e+214) tmp = 0.0; elseif (x <= 2.3e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (1.0 + exp(x)) / 2.0; tmp = 0.0; if (x <= -1e-242) tmp = (1.0 + exp((eps * -x))) / 2.0; elseif (x <= 5e+24) tmp = t_0; elseif (x <= 5e+67) tmp = 0.0; elseif (x <= 9.5e+96) tmp = t_0; elseif (x <= 6.2e+214) tmp = 0.0; elseif (x <= 2.3e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -1e-242], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+24], t$95$0, If[LessEqual[x, 5e+67], 0.0, If[LessEqual[x, 9.5e+96], t$95$0, If[LessEqual[x, 6.2e+214], 0.0, If[LessEqual[x, 2.3e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1 + e^{x}}{2}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-242}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+67}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+96}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1e-242Initial program 67.3%
div-sub67.3%
+-rgt-identity67.3%
div-sub67.3%
Simplified67.3%
Taylor expanded in x around 0 38.3%
Taylor expanded in eps around inf 69.9%
Taylor expanded in eps around inf 70.9%
*-commutative70.9%
Simplified70.9%
if -1e-242 < x < 5.00000000000000045e24 or 4.99999999999999976e67 < x < 9.50000000000000089e96Initial program 59.6%
div-sub59.6%
+-rgt-identity59.6%
div-sub59.6%
Simplified59.6%
Taylor expanded in eps around inf 99.8%
mul-1-neg99.8%
distribute-lft-neg-in99.8%
mul-1-neg99.8%
exp-prod99.8%
+-commutative99.8%
*-commutative99.8%
exp-prod99.8%
neg-mul-199.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in eps around inf 96.2%
Taylor expanded in eps around 0 65.1%
mul-1-neg65.1%
Simplified65.1%
expm1-log1p-u63.6%
expm1-udef63.6%
add-sqr-sqrt14.9%
sqrt-unprod75.2%
sqr-neg75.2%
sqrt-unprod60.4%
add-sqr-sqrt75.2%
Applied egg-rr75.2%
expm1-def75.2%
expm1-log1p76.7%
Simplified76.7%
if 5.00000000000000045e24 < x < 4.99999999999999976e67 or 9.50000000000000089e96 < x < 6.19999999999999957e214 or 2.3000000000000001e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.6%
div-sub71.6%
rec-exp71.6%
mul-1-neg71.6%
+-inverses71.6%
Simplified71.6%
if 6.19999999999999957e214 < x < 2.3000000000000001e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification70.3%
(FPCore (x eps)
:precision binary64
(if (<= x -6.6e-254)
(/ (+ 1.0 (exp (* eps (- x)))) 2.0)
(if (<= x 5e+28)
(/ (+ 1.0 (exp (* x (+ 1.0 eps)))) 2.0)
(if (<= x 2e+68)
0.0
(if (<= x 5.4e+96)
(/ (+ 1.0 (exp x)) 2.0)
(if (<= x 5.5e+214)
0.0
(if (<= x 6.5e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0)))))))
double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + exp((eps * -x))) / 2.0;
} else if (x <= 5e+28) {
tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 2e+68) {
tmp = 0.0;
} else if (x <= 5.4e+96) {
tmp = (1.0 + exp(x)) / 2.0;
} else if (x <= 5.5e+214) {
tmp = 0.0;
} else if (x <= 6.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-6.6d-254)) then
tmp = (1.0d0 + exp((eps * -x))) / 2.0d0
else if (x <= 5d+28) then
tmp = (1.0d0 + exp((x * (1.0d0 + eps)))) / 2.0d0
else if (x <= 2d+68) then
tmp = 0.0d0
else if (x <= 5.4d+96) then
tmp = (1.0d0 + exp(x)) / 2.0d0
else if (x <= 5.5d+214) then
tmp = 0.0d0
else if (x <= 6.5d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -6.6e-254) {
tmp = (1.0 + Math.exp((eps * -x))) / 2.0;
} else if (x <= 5e+28) {
tmp = (1.0 + Math.exp((x * (1.0 + eps)))) / 2.0;
} else if (x <= 2e+68) {
tmp = 0.0;
} else if (x <= 5.4e+96) {
tmp = (1.0 + Math.exp(x)) / 2.0;
} else if (x <= 5.5e+214) {
tmp = 0.0;
} else if (x <= 6.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -6.6e-254: tmp = (1.0 + math.exp((eps * -x))) / 2.0 elif x <= 5e+28: tmp = (1.0 + math.exp((x * (1.0 + eps)))) / 2.0 elif x <= 2e+68: tmp = 0.0 elif x <= 5.4e+96: tmp = (1.0 + math.exp(x)) / 2.0 elif x <= 5.5e+214: tmp = 0.0 elif x <= 6.5e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -6.6e-254) tmp = Float64(Float64(1.0 + exp(Float64(eps * Float64(-x)))) / 2.0); elseif (x <= 5e+28) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 + eps)))) / 2.0); elseif (x <= 2e+68) tmp = 0.0; elseif (x <= 5.4e+96) tmp = Float64(Float64(1.0 + exp(x)) / 2.0); elseif (x <= 5.5e+214) tmp = 0.0; elseif (x <= 6.5e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -6.6e-254) tmp = (1.0 + exp((eps * -x))) / 2.0; elseif (x <= 5e+28) tmp = (1.0 + exp((x * (1.0 + eps)))) / 2.0; elseif (x <= 2e+68) tmp = 0.0; elseif (x <= 5.4e+96) tmp = (1.0 + exp(x)) / 2.0; elseif (x <= 5.5e+214) tmp = 0.0; elseif (x <= 6.5e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -6.6e-254], N[(N[(1.0 + N[Exp[N[(eps * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+28], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2e+68], 0.0, If[LessEqual[x, 5.4e+96], N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.5e+214], 0.0, If[LessEqual[x, 6.5e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-254}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot \left(-x\right)}}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 + \varepsilon\right)}}{2}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+68}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+96}:\\
\;\;\;\;\frac{1 + e^{x}}{2}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -6.60000000000000033e-254Initial program 68.1%
div-sub68.1%
+-rgt-identity68.1%
div-sub68.1%
Simplified68.1%
Taylor expanded in x around 0 39.0%
Taylor expanded in eps around inf 69.8%
Taylor expanded in eps around inf 70.8%
*-commutative70.8%
Simplified70.8%
if -6.60000000000000033e-254 < x < 4.99999999999999957e28Initial program 55.1%
div-sub55.1%
+-rgt-identity55.1%
div-sub55.1%
Simplified55.1%
Taylor expanded in x around 0 39.4%
add-log-exp39.4%
*-un-lft-identity39.4%
log-prod39.4%
metadata-eval39.4%
add-log-exp39.4%
*-commutative39.4%
add-sqr-sqrt7.5%
sqrt-unprod34.8%
sqr-neg34.8%
sqrt-unprod30.9%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
+-lft-identity38.4%
+-commutative38.4%
Simplified38.4%
Taylor expanded in eps around inf 83.1%
if 4.99999999999999957e28 < x < 1.99999999999999991e68 or 5.40000000000000044e96 < x < 5.5000000000000003e214 or 6.50000000000000031e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.6%
div-sub71.6%
rec-exp71.6%
mul-1-neg71.6%
+-inverses71.6%
Simplified71.6%
if 1.99999999999999991e68 < x < 5.40000000000000044e96Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
distribute-lft-neg-in100.0%
mul-1-neg100.0%
exp-prod100.0%
+-commutative100.0%
*-commutative100.0%
exp-prod100.0%
neg-mul-1100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 78.3%
Taylor expanded in eps around 0 3.1%
mul-1-neg3.1%
Simplified3.1%
expm1-log1p-u3.1%
expm1-udef3.1%
add-sqr-sqrt0.0%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod78.1%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
expm1-def78.1%
expm1-log1p78.1%
Simplified78.1%
if 5.5000000000000003e214 < x < 6.50000000000000031e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification72.7%
(FPCore (x eps)
:precision binary64
(if (<= x 520.0)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 5.9e+214)
0.0
(if (<= x 2.7e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))
double code(double x, double eps) {
double tmp;
if (x <= 520.0) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 2.7e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
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 + exp(-x)) / 2.0d0
else if (x <= 5.9d+214) then
tmp = 0.0d0
else if (x <= 2.7d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 520.0) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 2.7e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 520.0: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 5.9e+214: tmp = 0.0 elif x <= 2.7e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 520.0) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 2.7e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 520.0) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 2.7e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 520.0], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.9e+214], 0.0, If[LessEqual[x, 2.7e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 520:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 520Initial program 59.2%
div-sub59.2%
+-rgt-identity59.2%
div-sub59.2%
Simplified59.2%
Taylor expanded in eps around inf 99.3%
mul-1-neg99.3%
distribute-lft-neg-in99.3%
mul-1-neg99.3%
exp-prod99.3%
+-commutative99.3%
*-commutative99.3%
exp-prod99.3%
neg-mul-199.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in eps around inf 99.4%
Taylor expanded in eps around 0 80.9%
mul-1-neg80.9%
Simplified80.9%
if 520 < x < 5.90000000000000004e214 or 2.6999999999999999e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 58.7%
div-sub58.7%
rec-exp58.7%
mul-1-neg58.7%
+-inverses58.7%
Simplified58.7%
if 5.90000000000000004e214 < x < 2.6999999999999999e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification71.5%
(FPCore (x eps) :precision binary64 (if (<= x 470.0) 1.0 (if (<= x 5.9e+214) 0.0 (if (<= x 7e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))
double code(double x, double eps) {
double tmp;
if (x <= 470.0) {
tmp = 1.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 7e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 470.0d0) then
tmp = 1.0d0
else if (x <= 5.9d+214) then
tmp = 0.0d0
else if (x <= 7d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 470.0) {
tmp = 1.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 7e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 470.0: tmp = 1.0 elif x <= 5.9e+214: tmp = 0.0 elif x <= 7e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 470.0) tmp = 1.0; elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 7e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 470.0) tmp = 1.0; elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 7e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 470.0], 1.0, If[LessEqual[x, 5.9e+214], 0.0, If[LessEqual[x, 7e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 470:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 470Initial program 59.2%
div-sub59.2%
+-rgt-identity59.2%
div-sub59.2%
Simplified59.2%
Taylor expanded in x around 0 63.9%
if 470 < x < 5.90000000000000004e214 or 6.99999999999999939e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 58.7%
div-sub58.7%
rec-exp58.7%
mul-1-neg58.7%
+-inverses58.7%
Simplified58.7%
if 5.90000000000000004e214 < x < 6.99999999999999939e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification60.1%
(FPCore (x eps)
:precision binary64
(if (<= x 5.8e-12)
(/ (- 2.0 (* eps x)) 2.0)
(if (<= x 5.8e+214)
0.0
(if (<= x 7.5e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))
double code(double x, double eps) {
double tmp;
if (x <= 5.8e-12) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 5.8e+214) {
tmp = 0.0;
} else if (x <= 7.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 5.8d-12) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else if (x <= 5.8d+214) then
tmp = 0.0d0
else if (x <= 7.5d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 5.8e-12) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 5.8e+214) {
tmp = 0.0;
} else if (x <= 7.5e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 5.8e-12: tmp = (2.0 - (eps * x)) / 2.0 elif x <= 5.8e+214: tmp = 0.0 elif x <= 7.5e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 5.8e-12) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); elseif (x <= 5.8e+214) tmp = 0.0; elseif (x <= 7.5e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 5.8e-12) tmp = (2.0 - (eps * x)) / 2.0; elseif (x <= 5.8e+214) tmp = 0.0; elseif (x <= 7.5e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 5.8e-12], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.8e+214], 0.0, If[LessEqual[x, 7.5e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 5.8000000000000003e-12Initial program 58.5%
div-sub58.5%
+-rgt-identity58.5%
div-sub58.5%
Simplified58.5%
Taylor expanded in x around 0 37.5%
Taylor expanded in x around 0 45.5%
Taylor expanded in eps around inf 66.5%
neg-mul-166.5%
distribute-lft-neg-in66.5%
Simplified66.5%
if 5.8000000000000003e-12 < x < 5.7999999999999999e214 or 7.49999999999999924e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 56.1%
div-sub56.1%
rec-exp56.1%
mul-1-neg56.1%
+-inverses56.1%
Simplified56.1%
if 5.7999999999999999e214 < x < 7.49999999999999924e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification61.1%
(FPCore (x eps)
:precision binary64
(if (<= x 480.0)
(/ (- (+ 2.0 (* 0.5 (* x x))) x) 2.0)
(if (<= x 5.9e+214)
0.0
(if (<= x 2.3e+302) (/ (+ 2.0 (* eps x)) 2.0) 0.0))))
double code(double x, double eps) {
double tmp;
if (x <= 480.0) {
tmp = ((2.0 + (0.5 * (x * x))) - x) / 2.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 2.3e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 480.0d0) then
tmp = ((2.0d0 + (0.5d0 * (x * x))) - x) / 2.0d0
else if (x <= 5.9d+214) then
tmp = 0.0d0
else if (x <= 2.3d+302) then
tmp = (2.0d0 + (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 480.0) {
tmp = ((2.0 + (0.5 * (x * x))) - x) / 2.0;
} else if (x <= 5.9e+214) {
tmp = 0.0;
} else if (x <= 2.3e+302) {
tmp = (2.0 + (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 480.0: tmp = ((2.0 + (0.5 * (x * x))) - x) / 2.0 elif x <= 5.9e+214: tmp = 0.0 elif x <= 2.3e+302: tmp = (2.0 + (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 480.0) tmp = Float64(Float64(Float64(2.0 + Float64(0.5 * Float64(x * x))) - x) / 2.0); elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 2.3e+302) tmp = Float64(Float64(2.0 + Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 480.0) tmp = ((2.0 + (0.5 * (x * x))) - x) / 2.0; elseif (x <= 5.9e+214) tmp = 0.0; elseif (x <= 2.3e+302) tmp = (2.0 + (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 480.0], N[(N[(N[(2.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.9e+214], 0.0, If[LessEqual[x, 2.3e+302], N[(N[(2.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 480:\\
\;\;\;\;\frac{\left(2 + 0.5 \cdot \left(x \cdot x\right)\right) - x}{2}\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+214}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+302}:\\
\;\;\;\;\frac{2 + \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 480Initial program 59.2%
div-sub59.2%
+-rgt-identity59.2%
div-sub59.2%
Simplified59.2%
Taylor expanded in eps around inf 99.3%
mul-1-neg99.3%
distribute-lft-neg-in99.3%
mul-1-neg99.3%
exp-prod99.3%
+-commutative99.3%
*-commutative99.3%
exp-prod99.3%
neg-mul-199.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in eps around inf 99.4%
Taylor expanded in eps around 0 80.9%
mul-1-neg80.9%
Simplified80.9%
Taylor expanded in x around 0 72.6%
associate-+r+72.6%
mul-1-neg72.6%
unsub-neg72.6%
unpow272.6%
Simplified72.6%
if 480 < x < 5.90000000000000004e214 or 2.3000000000000001e302 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 58.7%
div-sub58.7%
rec-exp58.7%
mul-1-neg58.7%
+-inverses58.7%
Simplified58.7%
if 5.90000000000000004e214 < x < 2.3000000000000001e302Initial program 100.0%
div-sub100.0%
+-rgt-identity100.0%
div-sub100.0%
Simplified100.0%
Taylor expanded in x around 0 35.4%
Taylor expanded in x around 0 35.4%
Taylor expanded in eps around inf 35.8%
associate-+r+35.8%
distribute-lft1-in35.8%
metadata-eval35.8%
mul0-lft35.8%
metadata-eval35.8%
metadata-eval35.8%
*-commutative35.8%
Simplified35.8%
Final simplification65.9%
(FPCore (x eps) :precision binary64 (if (<= x 460.0) 1.0 0.0))
double code(double x, double eps) {
double tmp;
if (x <= 460.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 460.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 460.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 460.0: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 460.0) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 460.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 460.0], 1.0, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 460:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 460Initial program 59.2%
div-sub59.2%
+-rgt-identity59.2%
div-sub59.2%
Simplified59.2%
Taylor expanded in x around 0 63.9%
if 460 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 53.7%
div-sub53.7%
rec-exp53.7%
mul-1-neg53.7%
+-inverses53.7%
Simplified53.7%
Final simplification60.5%
(FPCore (x eps) :precision binary64 0.0)
double code(double x, double eps) {
return 0.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 0.0d0
end function
public static double code(double x, double eps) {
return 0.0;
}
def code(x, eps): return 0.0
function code(x, eps) return 0.0 end
function tmp = code(x, eps) tmp = 0.0; end
code[x_, eps_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 72.8%
Simplified61.7%
Taylor expanded in eps around 0 19.3%
div-sub19.3%
rec-exp19.3%
mul-1-neg19.3%
+-inverses19.5%
Simplified19.5%
Final simplification19.5%
herbie shell --seed 2023238
(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))