
(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 17 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}
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 1e-22) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1e-22) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 1d-22) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((x * -eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1e-22) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 1e-22: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((x * -eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 1e-22) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(x * Float64(-eps_m)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 1e-22) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((x * -eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1e-22], N[(N[(N[(eps$95$m * N[(N[Exp[(-x)], $MachinePrecision] * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 10^{-22}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\end{array}
\end{array}
if eps < 1e-22Initial program 63.9%
Simplified55.1%
Taylor expanded in eps around 0 29.8%
Simplified65.8%
if 1e-22 < eps Initial program 100.0%
Simplified85.8%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
rec-exp100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification74.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (pow E (* x (+ eps_m -1.0))) (/ 1.0 (exp (+ x (* x eps_m))))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (pow(((double) M_E), (x * (eps_m + -1.0))) + (1.0 / exp((x + (x * eps_m))))) / 2.0;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.pow(Math.E, (x * (eps_m + -1.0))) + (1.0 / Math.exp((x + (x * eps_m))))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.pow(math.e, (x * (eps_m + -1.0))) + (1.0 / math.exp((x + (x * eps_m))))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64((exp(1) ^ Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 / exp(Float64(x + Float64(x * eps_m))))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = ((2.71828182845904523536 ^ (x * (eps_m + -1.0))) + (1.0 / exp((x + (x * eps_m))))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Power[E, N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[Exp[N[(x + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{{e}^{\left(x \cdot \left(eps\_m + -1\right)\right)} + \frac{1}{e^{x + x \cdot eps\_m}}}{2}
\end{array}
Initial program 73.1%
Simplified65.9%
Taylor expanded in eps around inf 98.6%
*-un-lft-identity98.6%
exp-prod98.6%
sub-neg98.6%
metadata-eval98.6%
Applied egg-rr98.6%
exp-1-e98.6%
Simplified98.6%
Final simplification98.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (/ 1.0 (exp (+ x (* x eps_m)))) (exp (* x (+ eps_m -1.0)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return ((1.0 / exp((x + (x * eps_m)))) + exp((x * (eps_m + -1.0)))) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = ((1.0d0 / exp((x + (x * eps_m)))) + exp((x * (eps_m + (-1.0d0))))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return ((1.0 / Math.exp((x + (x * eps_m)))) + Math.exp((x * (eps_m + -1.0)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return ((1.0 / math.exp((x + (x * eps_m)))) + math.exp((x * (eps_m + -1.0)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(Float64(1.0 / exp(Float64(x + Float64(x * eps_m)))) + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = ((1.0 / exp((x + (x * eps_m)))) + exp((x * (eps_m + -1.0)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[(1.0 / N[Exp[N[(x + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{\frac{1}{e^{x + x \cdot eps\_m}} + e^{x \cdot \left(eps\_m + -1\right)}}{2}
\end{array}
Initial program 73.1%
Simplified65.9%
Taylor expanded in eps around inf 98.6%
Final simplification98.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -5e-307)
(/ (+ 1.0 (/ 1.0 (exp (* x eps_m)))) 2.0)
(if (or (<= x 1e+101) (and (not (<= x 3.3e+198)) (<= x 5.6e+288)))
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-307) {
tmp = (1.0 + (1.0 / exp((x * eps_m)))) / 2.0;
} else if ((x <= 1e+101) || (!(x <= 3.3e+198) && (x <= 5.6e+288))) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-5d-307)) then
tmp = (1.0d0 + (1.0d0 / exp((x * eps_m)))) / 2.0d0
else if ((x <= 1d+101) .or. (.not. (x <= 3.3d+198)) .and. (x <= 5.6d+288)) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5e-307) {
tmp = (1.0 + (1.0 / Math.exp((x * eps_m)))) / 2.0;
} else if ((x <= 1e+101) || (!(x <= 3.3e+198) && (x <= 5.6e+288))) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-307: tmp = (1.0 + (1.0 / math.exp((x * eps_m)))) / 2.0 elif (x <= 1e+101) or (not (x <= 3.3e+198) and (x <= 5.6e+288)): tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-307) tmp = Float64(Float64(1.0 + Float64(1.0 / exp(Float64(x * eps_m)))) / 2.0); elseif ((x <= 1e+101) || (!(x <= 3.3e+198) && (x <= 5.6e+288))) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-307) tmp = (1.0 + (1.0 / exp((x * eps_m)))) / 2.0; elseif ((x <= 1e+101) || (~((x <= 3.3e+198)) && (x <= 5.6e+288))) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-307], N[(N[(1.0 + N[(1.0 / N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1e+101], And[N[Not[LessEqual[x, 3.3e+198]], $MachinePrecision], LessEqual[x, 5.6e+288]]], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-307}:\\
\;\;\;\;\frac{1 + \frac{1}{e^{x \cdot eps\_m}}}{2}\\
\mathbf{elif}\;x \leq 10^{+101} \lor \neg \left(x \leq 3.3 \cdot 10^{+198}\right) \land x \leq 5.6 \cdot 10^{+288}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -5.00000000000000014e-307Initial program 71.6%
Simplified63.7%
Taylor expanded in eps around inf 99.7%
Taylor expanded in eps around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 67.2%
if -5.00000000000000014e-307 < x < 9.9999999999999998e100 or 3.29999999999999994e198 < x < 5.59999999999999961e288Initial program 69.2%
Simplified69.2%
Taylor expanded in x around 0 33.4%
Taylor expanded in eps around inf 62.0%
*-commutative62.0%
associate-*r*62.0%
*-commutative62.0%
mul-1-neg62.0%
sub-neg62.0%
mul-1-neg62.0%
distribute-neg-in62.0%
metadata-eval62.0%
mul-1-neg62.0%
remove-double-neg62.0%
+-commutative62.0%
Simplified62.0%
if 9.9999999999999998e100 < x < 3.29999999999999994e198 or 5.59999999999999961e288 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.3%
mul-1-neg71.3%
mul-1-neg71.3%
rec-exp71.3%
sub-neg71.3%
div-sub71.3%
mul-1-neg71.3%
rec-exp71.3%
+-inverses71.3%
Simplified71.3%
Final simplification65.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -5e-307)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (or (<= x 7e+96) (and (not (<= x 4.2e+201)) (<= x 2.8e+288)))
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-307) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if ((x <= 7e+96) || (!(x <= 4.2e+201) && (x <= 2.8e+288))) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-5d-307)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if ((x <= 7d+96) .or. (.not. (x <= 4.2d+201)) .and. (x <= 2.8d+288)) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5e-307) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if ((x <= 7e+96) || (!(x <= 4.2e+201) && (x <= 2.8e+288))) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-307: tmp = (1.0 + math.exp(-x)) / 2.0 elif (x <= 7e+96) or (not (x <= 4.2e+201) and (x <= 2.8e+288)): tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-307) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif ((x <= 7e+96) || (!(x <= 4.2e+201) && (x <= 2.8e+288))) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-307) tmp = (1.0 + exp(-x)) / 2.0; elseif ((x <= 7e+96) || (~((x <= 4.2e+201)) && (x <= 2.8e+288))) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-307], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 7e+96], And[N[Not[LessEqual[x, 4.2e+201]], $MachinePrecision], LessEqual[x, 2.8e+288]]], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-307}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+96} \lor \neg \left(x \leq 4.2 \cdot 10^{+201}\right) \land x \leq 2.8 \cdot 10^{+288}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -5.00000000000000014e-307Initial program 71.6%
Simplified71.6%
Taylor expanded in x around 0 46.9%
Taylor expanded in eps around inf 74.9%
*-commutative74.9%
associate-*r*74.9%
*-commutative74.9%
mul-1-neg74.9%
sub-neg74.9%
mul-1-neg74.9%
distribute-neg-in74.9%
metadata-eval74.9%
mul-1-neg74.9%
remove-double-neg74.9%
+-commutative74.9%
Simplified74.9%
Taylor expanded in eps around 0 79.1%
mul-1-neg79.1%
Simplified79.1%
if -5.00000000000000014e-307 < x < 6.9999999999999998e96 or 4.1999999999999998e201 < x < 2.7999999999999998e288Initial program 69.2%
Simplified69.2%
Taylor expanded in x around 0 33.4%
Taylor expanded in eps around inf 62.0%
*-commutative62.0%
associate-*r*62.0%
*-commutative62.0%
mul-1-neg62.0%
sub-neg62.0%
mul-1-neg62.0%
distribute-neg-in62.0%
metadata-eval62.0%
mul-1-neg62.0%
remove-double-neg62.0%
+-commutative62.0%
Simplified62.0%
if 6.9999999999999998e96 < x < 4.1999999999999998e201 or 2.7999999999999998e288 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.3%
mul-1-neg71.3%
mul-1-neg71.3%
rec-exp71.3%
sub-neg71.3%
div-sub71.3%
mul-1-neg71.3%
rec-exp71.3%
+-inverses71.3%
Simplified71.3%
Final simplification70.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (+ eps_m -1.0)))))
(if (<= x -7.6e-225)
(/ (+ 1.0 (/ 1.0 (exp (* x eps_m)))) 2.0)
(if (<= x 2.05e+99)
(/ (+ t_0 (- 1.0 (* x eps_m))) 2.0)
(if (<= x 1.05e+205)
0.0
(if (<= x 3.6e+286) (/ (+ 1.0 t_0) 2.0) 0.0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * (eps_m + -1.0)));
double tmp;
if (x <= -7.6e-225) {
tmp = (1.0 + (1.0 / exp((x * eps_m)))) / 2.0;
} else if (x <= 2.05e+99) {
tmp = (t_0 + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 1.05e+205) {
tmp = 0.0;
} else if (x <= 3.6e+286) {
tmp = (1.0 + t_0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp((x * (eps_m + (-1.0d0))))
if (x <= (-7.6d-225)) then
tmp = (1.0d0 + (1.0d0 / exp((x * eps_m)))) / 2.0d0
else if (x <= 2.05d+99) then
tmp = (t_0 + (1.0d0 - (x * eps_m))) / 2.0d0
else if (x <= 1.05d+205) then
tmp = 0.0d0
else if (x <= 3.6d+286) then
tmp = (1.0d0 + t_0) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp((x * (eps_m + -1.0)));
double tmp;
if (x <= -7.6e-225) {
tmp = (1.0 + (1.0 / Math.exp((x * eps_m)))) / 2.0;
} else if (x <= 2.05e+99) {
tmp = (t_0 + (1.0 - (x * eps_m))) / 2.0;
} else if (x <= 1.05e+205) {
tmp = 0.0;
} else if (x <= 3.6e+286) {
tmp = (1.0 + t_0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * (eps_m + -1.0))) tmp = 0 if x <= -7.6e-225: tmp = (1.0 + (1.0 / math.exp((x * eps_m)))) / 2.0 elif x <= 2.05e+99: tmp = (t_0 + (1.0 - (x * eps_m))) / 2.0 elif x <= 1.05e+205: tmp = 0.0 elif x <= 3.6e+286: tmp = (1.0 + t_0) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(eps_m + -1.0))) tmp = 0.0 if (x <= -7.6e-225) tmp = Float64(Float64(1.0 + Float64(1.0 / exp(Float64(x * eps_m)))) / 2.0); elseif (x <= 2.05e+99) tmp = Float64(Float64(t_0 + Float64(1.0 - Float64(x * eps_m))) / 2.0); elseif (x <= 1.05e+205) tmp = 0.0; elseif (x <= 3.6e+286) tmp = Float64(Float64(1.0 + t_0) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * (eps_m + -1.0))); tmp = 0.0; if (x <= -7.6e-225) tmp = (1.0 + (1.0 / exp((x * eps_m)))) / 2.0; elseif (x <= 2.05e+99) tmp = (t_0 + (1.0 - (x * eps_m))) / 2.0; elseif (x <= 1.05e+205) tmp = 0.0; elseif (x <= 3.6e+286) tmp = (1.0 + t_0) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -7.6e-225], N[(N[(1.0 + N[(1.0 / N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.05e+99], N[(N[(t$95$0 + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.05e+205], 0.0, If[LessEqual[x, 3.6e+286], N[(N[(1.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(eps\_m + -1\right)}\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{-225}:\\
\;\;\;\;\frac{1 + \frac{1}{e^{x \cdot eps\_m}}}{2}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+99}:\\
\;\;\;\;\frac{t\_0 + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+205}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+286}:\\
\;\;\;\;\frac{1 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -7.6000000000000005e-225Initial program 78.8%
Simplified69.6%
Taylor expanded in eps around inf 99.6%
Taylor expanded in eps around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 59.5%
if -7.6000000000000005e-225 < x < 2.0499999999999999e99Initial program 61.2%
Simplified53.1%
Taylor expanded in eps around inf 97.6%
Taylor expanded in eps around inf 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in x around 0 74.1%
mul-1-neg74.1%
*-commutative74.1%
unsub-neg74.1%
*-commutative74.1%
Simplified74.1%
if 2.0499999999999999e99 < x < 1.05e205 or 3.6e286 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.3%
mul-1-neg71.3%
mul-1-neg71.3%
rec-exp71.3%
sub-neg71.3%
div-sub71.3%
mul-1-neg71.3%
rec-exp71.3%
+-inverses71.3%
Simplified71.3%
if 1.05e205 < x < 3.6e286Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in eps around inf 22.5%
*-commutative22.5%
associate-*r*22.5%
*-commutative22.5%
mul-1-neg22.5%
sub-neg22.5%
mul-1-neg22.5%
distribute-neg-in22.5%
metadata-eval22.5%
mul-1-neg22.5%
remove-double-neg22.5%
+-commutative22.5%
Simplified22.5%
Final simplification65.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 350.0) (/ (+ 1.0 (exp (- x))) 2.0) (if (<= x 1.3e+19) (/ (+ 1.0 (exp x)) 2.0) 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 350.0) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 1.3e+19) {
tmp = (1.0 + exp(x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 350.0d0) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 1.3d+19) then
tmp = (1.0d0 + exp(x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 350.0) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 1.3e+19) {
tmp = (1.0 + Math.exp(x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 350.0: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 1.3e+19: tmp = (1.0 + math.exp(x)) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 350.0) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 1.3e+19) tmp = Float64(Float64(1.0 + exp(x)) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 350.0) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 1.3e+19) tmp = (1.0 + exp(x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 350.0], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.3e+19], N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 350:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{1 + e^{x}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 350Initial program 63.0%
Simplified63.0%
Taylor expanded in x around 0 43.7%
Taylor expanded in eps around inf 79.0%
*-commutative79.0%
associate-*r*79.0%
*-commutative79.0%
mul-1-neg79.0%
sub-neg79.0%
mul-1-neg79.0%
distribute-neg-in79.0%
metadata-eval79.0%
mul-1-neg79.0%
remove-double-neg79.0%
+-commutative79.0%
Simplified79.0%
Taylor expanded in eps around 0 76.8%
mul-1-neg76.8%
Simplified76.8%
if 350 < x < 1.3e19Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 80.6%
Taylor expanded in eps around inf 80.6%
*-commutative80.6%
associate-*r*80.6%
*-commutative80.6%
mul-1-neg80.6%
sub-neg80.6%
mul-1-neg80.6%
distribute-neg-in80.6%
metadata-eval80.6%
mul-1-neg80.6%
remove-double-neg80.6%
+-commutative80.6%
Simplified80.6%
Taylor expanded in eps around 0 3.1%
mul-1-neg3.1%
Simplified3.1%
*-un-lft-identity3.1%
add-sqr-sqrt0.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
*-lft-identity100.0%
Simplified100.0%
if 1.3e19 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 54.6%
mul-1-neg54.6%
mul-1-neg54.6%
rec-exp54.6%
sub-neg54.6%
div-sub54.6%
mul-1-neg54.6%
rec-exp54.6%
+-inverses54.6%
Simplified54.6%
Final simplification71.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 2.5)
(/ (+ 2.0 (* x (+ -1.0 (* x (+ 0.5 (* x -0.16666666666666666)))))) 2.0)
(if (<= x 2e+19)
(/ (+ 1.0 (exp x)) 2.0)
(if (<= x 5e+194)
0.0
(if (<= x 1e+282) (/ (+ 2.0 (* x (+ -1.0 (* x 0.5)))) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.5) {
tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0;
} else if (x <= 2e+19) {
tmp = (1.0 + exp(x)) / 2.0;
} else if (x <= 5e+194) {
tmp = 0.0;
} else if (x <= 1e+282) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 2.5d0) then
tmp = (2.0d0 + (x * ((-1.0d0) + (x * (0.5d0 + (x * (-0.16666666666666666d0))))))) / 2.0d0
else if (x <= 2d+19) then
tmp = (1.0d0 + exp(x)) / 2.0d0
else if (x <= 5d+194) then
tmp = 0.0d0
else if (x <= 1d+282) then
tmp = (2.0d0 + (x * ((-1.0d0) + (x * 0.5d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 2.5) {
tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0;
} else if (x <= 2e+19) {
tmp = (1.0 + Math.exp(x)) / 2.0;
} else if (x <= 5e+194) {
tmp = 0.0;
} else if (x <= 1e+282) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.5: tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0 elif x <= 2e+19: tmp = (1.0 + math.exp(x)) / 2.0 elif x <= 5e+194: tmp = 0.0 elif x <= 1e+282: tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.5) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * -0.16666666666666666)))))) / 2.0); elseif (x <= 2e+19) tmp = Float64(Float64(1.0 + exp(x)) / 2.0); elseif (x <= 5e+194) tmp = 0.0; elseif (x <= 1e+282) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(x * 0.5)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.5) tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0; elseif (x <= 2e+19) tmp = (1.0 + exp(x)) / 2.0; elseif (x <= 5e+194) tmp = 0.0; elseif (x <= 1e+282) tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.5], N[(N[(2.0 + N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2e+19], N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5e+194], 0.0, If[LessEqual[x, 1e+282], N[(N[(2.0 + N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)}{2}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+19}:\\
\;\;\;\;\frac{1 + e^{x}}{2}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+194}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 10^{+282}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + x \cdot 0.5\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.5Initial program 63.3%
Simplified63.3%
Taylor expanded in x around 0 43.9%
Taylor expanded in eps around inf 79.3%
*-commutative79.3%
associate-*r*79.3%
*-commutative79.3%
mul-1-neg79.3%
sub-neg79.3%
mul-1-neg79.3%
distribute-neg-in79.3%
metadata-eval79.3%
mul-1-neg79.3%
remove-double-neg79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in eps around 0 77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in x around 0 70.4%
if 2.5 < x < 2e19Initial program 83.9%
Simplified83.9%
Taylor expanded in x around 0 67.4%
Taylor expanded in eps around inf 69.2%
*-commutative69.2%
associate-*r*69.2%
*-commutative69.2%
mul-1-neg69.2%
sub-neg69.2%
mul-1-neg69.2%
distribute-neg-in69.2%
metadata-eval69.2%
mul-1-neg69.2%
remove-double-neg69.2%
+-commutative69.2%
Simplified69.2%
Taylor expanded in eps around 0 4.6%
mul-1-neg4.6%
Simplified4.6%
*-un-lft-identity4.6%
add-sqr-sqrt0.0%
sqrt-unprod85.0%
sqr-neg85.0%
sqrt-unprod85.0%
add-sqr-sqrt85.0%
Applied egg-rr85.0%
*-lft-identity85.0%
Simplified85.0%
if 2e19 < x < 4.99999999999999989e194 or 1.00000000000000003e282 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
if 4.99999999999999989e194 < x < 1.00000000000000003e282Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in eps around inf 22.5%
*-commutative22.5%
associate-*r*22.5%
*-commutative22.5%
mul-1-neg22.5%
sub-neg22.5%
mul-1-neg22.5%
distribute-neg-in22.5%
metadata-eval22.5%
mul-1-neg22.5%
remove-double-neg22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in eps around 0 3.1%
mul-1-neg3.1%
Simplified3.1%
Taylor expanded in x around 0 67.2%
Final simplification68.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -0.52)
(/ (* x (- -1.0 eps_m)) 2.0)
(if (<= x 3.4e+18)
1.0
(if (<= x 3.1e+209)
0.0
(if (<= x 2.5e+283) (/ (+ (* x eps_m) 2.0) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -0.52) {
tmp = (x * (-1.0 - eps_m)) / 2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 3.1e+209) {
tmp = 0.0;
} else if (x <= 2.5e+283) {
tmp = ((x * eps_m) + 2.0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-0.52d0)) then
tmp = (x * ((-1.0d0) - eps_m)) / 2.0d0
else if (x <= 3.4d+18) then
tmp = 1.0d0
else if (x <= 3.1d+209) then
tmp = 0.0d0
else if (x <= 2.5d+283) then
tmp = ((x * eps_m) + 2.0d0) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -0.52) {
tmp = (x * (-1.0 - eps_m)) / 2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 3.1e+209) {
tmp = 0.0;
} else if (x <= 2.5e+283) {
tmp = ((x * eps_m) + 2.0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -0.52: tmp = (x * (-1.0 - eps_m)) / 2.0 elif x <= 3.4e+18: tmp = 1.0 elif x <= 3.1e+209: tmp = 0.0 elif x <= 2.5e+283: tmp = ((x * eps_m) + 2.0) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -0.52) tmp = Float64(Float64(x * Float64(-1.0 - eps_m)) / 2.0); elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 3.1e+209) tmp = 0.0; elseif (x <= 2.5e+283) tmp = Float64(Float64(Float64(x * eps_m) + 2.0) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -0.52) tmp = (x * (-1.0 - eps_m)) / 2.0; elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 3.1e+209) tmp = 0.0; elseif (x <= 2.5e+283) tmp = ((x * eps_m) + 2.0) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -0.52], N[(N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.4e+18], 1.0, If[LessEqual[x, 3.1e+209], 0.0, If[LessEqual[x, 2.5e+283], N[(N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.52:\\
\;\;\;\;\frac{x \cdot \left(-1 - eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+209}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+283}:\\
\;\;\;\;\frac{x \cdot eps\_m + 2}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.52000000000000002Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 45.7%
associate-*r*45.7%
neg-mul-145.7%
Simplified45.7%
Taylor expanded in x around inf 11.6%
+-commutative11.6%
*-commutative11.6%
distribute-rgt1-in11.6%
distribute-lft-in11.6%
associate-*r*11.6%
neg-mul-111.6%
distribute-rgt-in11.6%
unsub-neg11.6%
Simplified11.6%
if -0.52000000000000002 < x < 3.4e18Initial program 54.1%
Simplified54.1%
Taylor expanded in x around 0 69.6%
if 3.4e18 < x < 3.1000000000000001e209 or 2.5000000000000002e283 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
if 3.1000000000000001e209 < x < 2.5000000000000002e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in x around 0 20.5%
mul-1-neg20.5%
unsub-neg20.5%
associate-*r*20.5%
Simplified20.5%
Taylor expanded in eps around inf 20.9%
associate-*r*20.9%
neg-mul-120.9%
Simplified20.9%
Final simplification55.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (or (<= x 3.4e+18) (and (not (<= x 1e+198)) (<= x 1e+288))) (/ (+ 2.0 (* x (+ -1.0 (* x 0.5)))) 2.0) 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((x <= 3.4e+18) || (!(x <= 1e+198) && (x <= 1e+288))) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if ((x <= 3.4d+18) .or. (.not. (x <= 1d+198)) .and. (x <= 1d+288)) then
tmp = (2.0d0 + (x * ((-1.0d0) + (x * 0.5d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if ((x <= 3.4e+18) || (!(x <= 1e+198) && (x <= 1e+288))) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if (x <= 3.4e+18) or (not (x <= 1e+198) and (x <= 1e+288)): tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if ((x <= 3.4e+18) || (!(x <= 1e+198) && (x <= 1e+288))) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(x * 0.5)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if ((x <= 3.4e+18) || (~((x <= 1e+198)) && (x <= 1e+288))) tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[Or[LessEqual[x, 3.4e+18], And[N[Not[LessEqual[x, 1e+198]], $MachinePrecision], LessEqual[x, 1e+288]]], N[(N[(2.0 + N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+18} \lor \neg \left(x \leq 10^{+198}\right) \land x \leq 10^{+288}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + x \cdot 0.5\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.4e18 or 1.00000000000000002e198 < x < 1e288Initial program 66.6%
Simplified66.6%
Taylor expanded in x around 0 43.0%
Taylor expanded in eps around inf 74.9%
*-commutative74.9%
associate-*r*74.9%
*-commutative74.9%
mul-1-neg74.9%
sub-neg74.9%
mul-1-neg74.9%
distribute-neg-in74.9%
metadata-eval74.9%
mul-1-neg74.9%
remove-double-neg74.9%
+-commutative74.9%
Simplified74.9%
Taylor expanded in eps around 0 69.6%
mul-1-neg69.6%
Simplified69.6%
Taylor expanded in x around 0 65.1%
if 3.4e18 < x < 1.00000000000000002e198 or 1e288 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
Final simplification64.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 2.5)
(/ (+ 2.0 (* x (+ -1.0 (* x (+ 0.5 (* x -0.16666666666666666)))))) 2.0)
(if (<= x 1e+206)
0.0
(if (<= x 1.42e+284) (/ (+ 2.0 (* x (+ -1.0 (* x 0.5)))) 2.0) 0.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.5) {
tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0;
} else if (x <= 1e+206) {
tmp = 0.0;
} else if (x <= 1.42e+284) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 2.5d0) then
tmp = (2.0d0 + (x * ((-1.0d0) + (x * (0.5d0 + (x * (-0.16666666666666666d0))))))) / 2.0d0
else if (x <= 1d+206) then
tmp = 0.0d0
else if (x <= 1.42d+284) then
tmp = (2.0d0 + (x * ((-1.0d0) + (x * 0.5d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 2.5) {
tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0;
} else if (x <= 1e+206) {
tmp = 0.0;
} else if (x <= 1.42e+284) {
tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.5: tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0 elif x <= 1e+206: tmp = 0.0 elif x <= 1.42e+284: tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.5) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * -0.16666666666666666)))))) / 2.0); elseif (x <= 1e+206) tmp = 0.0; elseif (x <= 1.42e+284) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + Float64(x * 0.5)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.5) tmp = (2.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666)))))) / 2.0; elseif (x <= 1e+206) tmp = 0.0; elseif (x <= 1.42e+284) tmp = (2.0 + (x * (-1.0 + (x * 0.5)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.5], N[(N[(2.0 + N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+206], 0.0, If[LessEqual[x, 1.42e+284], N[(N[(2.0 + N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)}{2}\\
\mathbf{elif}\;x \leq 10^{+206}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.42 \cdot 10^{+284}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + x \cdot 0.5\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.5Initial program 63.3%
Simplified63.3%
Taylor expanded in x around 0 43.9%
Taylor expanded in eps around inf 79.3%
*-commutative79.3%
associate-*r*79.3%
*-commutative79.3%
mul-1-neg79.3%
sub-neg79.3%
mul-1-neg79.3%
distribute-neg-in79.3%
metadata-eval79.3%
mul-1-neg79.3%
remove-double-neg79.3%
+-commutative79.3%
Simplified79.3%
Taylor expanded in eps around 0 77.1%
mul-1-neg77.1%
Simplified77.1%
Taylor expanded in x around 0 70.4%
if 2.5 < x < 1e206 or 1.42000000000000002e284 < x Initial program 98.3%
Simplified98.2%
Taylor expanded in eps around 0 54.3%
mul-1-neg54.3%
mul-1-neg54.3%
rec-exp54.3%
sub-neg54.3%
div-sub54.3%
mul-1-neg54.3%
rec-exp54.3%
+-inverses54.3%
Simplified54.3%
if 1e206 < x < 1.42000000000000002e284Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in eps around inf 22.5%
*-commutative22.5%
associate-*r*22.5%
*-commutative22.5%
mul-1-neg22.5%
sub-neg22.5%
mul-1-neg22.5%
distribute-neg-in22.5%
metadata-eval22.5%
mul-1-neg22.5%
remove-double-neg22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in eps around 0 3.1%
mul-1-neg3.1%
Simplified3.1%
Taylor expanded in x around 0 67.2%
Final simplification66.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -0.62)
(/ (* x (- -1.0 eps_m)) 2.0)
(if (<= x 3.4e+18)
1.0
(if (<= x 5e+211) 0.0 (if (<= x 2.3e+284) (/ (* x eps_m) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -0.62) {
tmp = (x * (-1.0 - eps_m)) / 2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 5e+211) {
tmp = 0.0;
} else if (x <= 2.3e+284) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-0.62d0)) then
tmp = (x * ((-1.0d0) - eps_m)) / 2.0d0
else if (x <= 3.4d+18) then
tmp = 1.0d0
else if (x <= 5d+211) then
tmp = 0.0d0
else if (x <= 2.3d+284) then
tmp = (x * eps_m) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -0.62) {
tmp = (x * (-1.0 - eps_m)) / 2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 5e+211) {
tmp = 0.0;
} else if (x <= 2.3e+284) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -0.62: tmp = (x * (-1.0 - eps_m)) / 2.0 elif x <= 3.4e+18: tmp = 1.0 elif x <= 5e+211: tmp = 0.0 elif x <= 2.3e+284: tmp = (x * eps_m) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -0.62) tmp = Float64(Float64(x * Float64(-1.0 - eps_m)) / 2.0); elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 5e+211) tmp = 0.0; elseif (x <= 2.3e+284) tmp = Float64(Float64(x * eps_m) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -0.62) tmp = (x * (-1.0 - eps_m)) / 2.0; elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 5e+211) tmp = 0.0; elseif (x <= 2.3e+284) tmp = (x * eps_m) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -0.62], N[(N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.4e+18], 1.0, If[LessEqual[x, 5e+211], 0.0, If[LessEqual[x, 2.3e+284], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.62:\\
\;\;\;\;\frac{x \cdot \left(-1 - eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+211}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+284}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.619999999999999996Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 45.7%
associate-*r*45.7%
neg-mul-145.7%
Simplified45.7%
Taylor expanded in x around inf 11.6%
+-commutative11.6%
*-commutative11.6%
distribute-rgt1-in11.6%
distribute-lft-in11.6%
associate-*r*11.6%
neg-mul-111.6%
distribute-rgt-in11.6%
unsub-neg11.6%
Simplified11.6%
if -0.619999999999999996 < x < 3.4e18Initial program 54.1%
Simplified54.1%
Taylor expanded in x around 0 69.6%
if 3.4e18 < x < 4.9999999999999995e211 or 2.29999999999999984e284 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
if 4.9999999999999995e211 < x < 2.29999999999999984e284Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
+-commutative27.2%
associate-+l+27.2%
mul-1-neg27.2%
distribute-rgt-neg-in27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
neg-mul-127.2%
distribute-rgt-in27.2%
metadata-eval27.2%
associate-*l/27.2%
metadata-eval27.2%
Simplified27.2%
Taylor expanded in eps around inf 67.5%
Simplified67.5%
Taylor expanded in eps around inf 20.9%
Final simplification55.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1.0)
(/ (* x eps_m) (- 2.0))
(if (<= x 3.4e+18)
1.0
(if (<= x 3e+197) 0.0 (if (<= x 3.5e+287) (/ (* x eps_m) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) / -2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 3e+197) {
tmp = 0.0;
} else if (x <= 3.5e+287) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (x * eps_m) / -2.0d0
else if (x <= 3.4d+18) then
tmp = 1.0d0
else if (x <= 3d+197) then
tmp = 0.0d0
else if (x <= 3.5d+287) then
tmp = (x * eps_m) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) / -2.0;
} else if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 3e+197) {
tmp = 0.0;
} else if (x <= 3.5e+287) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.0: tmp = (x * eps_m) / -2.0 elif x <= 3.4e+18: tmp = 1.0 elif x <= 3e+197: tmp = 0.0 elif x <= 3.5e+287: tmp = (x * eps_m) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x * eps_m) / Float64(-2.0)); elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 3e+197) tmp = 0.0; elseif (x <= 3.5e+287) tmp = Float64(Float64(x * eps_m) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.0) tmp = (x * eps_m) / -2.0; elseif (x <= 3.4e+18) tmp = 1.0; elseif (x <= 3e+197) tmp = 0.0; elseif (x <= 3.5e+287) tmp = (x * eps_m) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.0], N[(N[(x * eps$95$m), $MachinePrecision] / (-2.0)), $MachinePrecision], If[LessEqual[x, 3.4e+18], 1.0, If[LessEqual[x, 3e+197], 0.0, If[LessEqual[x, 3.5e+287], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{x \cdot eps\_m}{-2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+197}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+287}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 45.7%
associate-*r*45.7%
neg-mul-145.7%
Simplified45.7%
Taylor expanded in x around 0 11.6%
Taylor expanded in eps around inf 11.6%
associate-*r*11.6%
neg-mul-111.6%
*-commutative11.6%
Simplified11.6%
if -1 < x < 3.4e18Initial program 54.1%
Simplified54.1%
Taylor expanded in x around 0 69.6%
if 3.4e18 < x < 3.0000000000000002e197 or 3.49999999999999976e287 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
if 3.0000000000000002e197 < x < 3.49999999999999976e287Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
+-commutative27.2%
associate-+l+27.2%
mul-1-neg27.2%
distribute-rgt-neg-in27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
neg-mul-127.2%
distribute-rgt-in27.2%
metadata-eval27.2%
associate-*l/27.2%
metadata-eval27.2%
Simplified27.2%
Taylor expanded in eps around inf 67.5%
Simplified67.5%
Taylor expanded in eps around inf 20.9%
Final simplification55.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 2.0)
(/ (+ 2.0 (* x (- -1.0 eps_m))) 2.0)
(if (<= x 1e+195)
0.0
(if (<= x 4.2e+288) (/ (+ (* x eps_m) 2.0) 2.0) 0.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0;
} else if (x <= 1e+195) {
tmp = 0.0;
} else if (x <= 4.2e+288) {
tmp = ((x * eps_m) + 2.0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (2.0d0 + (x * ((-1.0d0) - eps_m))) / 2.0d0
else if (x <= 1d+195) then
tmp = 0.0d0
else if (x <= 4.2d+288) then
tmp = ((x * eps_m) + 2.0d0) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0;
} else if (x <= 1e+195) {
tmp = 0.0;
} else if (x <= 4.2e+288) {
tmp = ((x * eps_m) + 2.0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.0: tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0 elif x <= 1e+195: tmp = 0.0 elif x <= 4.2e+288: tmp = ((x * eps_m) + 2.0) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 - eps_m))) / 2.0); elseif (x <= 1e+195) tmp = 0.0; elseif (x <= 4.2e+288) tmp = Float64(Float64(Float64(x * eps_m) + 2.0) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.0) tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0; elseif (x <= 1e+195) tmp = 0.0; elseif (x <= 4.2e+288) tmp = ((x * eps_m) + 2.0) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.0], N[(N[(2.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+195], 0.0, If[LessEqual[x, 4.2e+288], N[(N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 - eps\_m\right)}{2}\\
\mathbf{elif}\;x \leq 10^{+195}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot eps\_m + 2}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2Initial program 63.3%
Simplified53.3%
Taylor expanded in eps around inf 98.6%
Taylor expanded in x around 0 76.6%
associate-*r*76.6%
neg-mul-176.6%
Simplified76.6%
Taylor expanded in x around 0 56.8%
associate-+r+56.8%
distribute-lft-neg-out56.8%
unsub-neg56.8%
metadata-eval56.8%
+-commutative56.8%
Applied egg-rr56.8%
if 2 < x < 9.99999999999999977e194 or 4.19999999999999998e288 < x Initial program 98.3%
Simplified98.2%
Taylor expanded in eps around 0 54.3%
mul-1-neg54.3%
mul-1-neg54.3%
rec-exp54.3%
sub-neg54.3%
div-sub54.3%
mul-1-neg54.3%
rec-exp54.3%
+-inverses54.3%
Simplified54.3%
if 9.99999999999999977e194 < x < 4.19999999999999998e288Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in x around 0 20.5%
mul-1-neg20.5%
unsub-neg20.5%
associate-*r*20.5%
Simplified20.5%
Taylor expanded in eps around inf 20.9%
associate-*r*20.9%
neg-mul-120.9%
Simplified20.9%
Final simplification54.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 3.4e+18) 1.0 (if (<= x 2.5e+202) 0.0 (if (<= x 3.7e+288) (/ (* x eps_m) 2.0) 0.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 2.5e+202) {
tmp = 0.0;
} else if (x <= 3.7e+288) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 3.4d+18) then
tmp = 1.0d0
else if (x <= 2.5d+202) then
tmp = 0.0d0
else if (x <= 3.7d+288) then
tmp = (x * eps_m) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 3.4e+18) {
tmp = 1.0;
} else if (x <= 2.5e+202) {
tmp = 0.0;
} else if (x <= 3.7e+288) {
tmp = (x * eps_m) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 3.4e+18: tmp = 1.0 elif x <= 2.5e+202: tmp = 0.0 elif x <= 3.7e+288: tmp = (x * eps_m) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 3.4e+18) tmp = 1.0; elseif (x <= 2.5e+202) tmp = 0.0; elseif (x <= 3.7e+288) tmp = Float64(Float64(x * eps_m) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 3.4e+18) tmp = 1.0; elseif (x <= 2.5e+202) tmp = 0.0; elseif (x <= 3.7e+288) tmp = (x * eps_m) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 3.4e+18], 1.0, If[LessEqual[x, 2.5e+202], 0.0, If[LessEqual[x, 3.7e+288], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+202}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.4e18Initial program 63.9%
Simplified63.9%
Taylor expanded in x around 0 55.3%
if 3.4e18 < x < 2.5e202 or 3.6999999999999998e288 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 60.6%
mul-1-neg60.6%
mul-1-neg60.6%
rec-exp60.6%
sub-neg60.6%
div-sub60.6%
mul-1-neg60.6%
rec-exp60.6%
+-inverses60.6%
Simplified60.6%
if 2.5e202 < x < 3.6999999999999998e288Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 27.2%
+-commutative27.2%
+-commutative27.2%
associate-+l+27.2%
mul-1-neg27.2%
distribute-rgt-neg-in27.2%
*-commutative27.2%
distribute-rgt-neg-in27.2%
neg-mul-127.2%
distribute-rgt-in27.2%
metadata-eval27.2%
associate-*l/27.2%
metadata-eval27.2%
Simplified27.2%
Taylor expanded in eps around inf 67.5%
Simplified67.5%
Taylor expanded in eps around inf 20.9%
Final simplification54.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 3.4e+18) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 3.4e+18) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 3.4d+18) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 3.4e+18) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 3.4e+18: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 3.4e+18) tmp = 1.0; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 3.4e+18) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 3.4e+18], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+18}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 3.4e18Initial program 63.9%
Simplified63.9%
Taylor expanded in x around 0 55.3%
if 3.4e18 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 54.6%
mul-1-neg54.6%
mul-1-neg54.6%
rec-exp54.6%
sub-neg54.6%
div-sub54.6%
mul-1-neg54.6%
rec-exp54.6%
+-inverses54.6%
Simplified54.6%
Final simplification55.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 0.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 0.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 0.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 0.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 0.0
eps_m = abs(eps) function code(x, eps_m) return 0.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 0.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 0.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
0
\end{array}
Initial program 73.1%
Simplified62.1%
Taylor expanded in eps around 0 15.4%
mul-1-neg15.4%
mul-1-neg15.4%
rec-exp15.4%
sub-neg15.4%
div-sub15.4%
mul-1-neg15.4%
rec-exp15.4%
+-inverses15.7%
Simplified15.7%
Final simplification15.7%
herbie shell --seed 2024085
(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))