
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x eps) :precision binary64 (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x))))) 2.0))
double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps): return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0) end
function tmp = code(x, eps) tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 2e-89) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (/ 1.0 (pow E (* x eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2e-89) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + (1.0 / pow(((double) M_E), (x * eps_m)))) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2e-89) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + (1.0 / Math.pow(Math.E, (x * eps_m)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 2e-89: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + (1.0 / math.pow(math.e, (x * eps_m)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 2e-89) 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))) + Float64(1.0 / (exp(1) ^ Float64(x * 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 <= 2e-89) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + (1.0 / (2.71828182845904523536 ^ (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, 2e-89], 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[(1.0 / N[Power[E, N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 2 \cdot 10^{-89}:\\
\;\;\;\;\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)} + \frac{1}{{e}^{\left(x \cdot eps\_m\right)}}}{2}\\
\end{array}
\end{array}
if eps < 2.00000000000000008e-89Initial program 59.3%
Simplified51.8%
Taylor expanded in eps around 0 27.6%
associate-+r+68.6%
mul-1-neg68.6%
sub-neg68.6%
+-inverses68.6%
associate-*r*68.6%
distribute-rgt-out68.6%
mul-1-neg68.6%
Simplified68.6%
if 2.00000000000000008e-89 < eps Initial program 93.6%
Simplified85.1%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
exp-1-e100.0%
Simplified100.0%
Final simplification81.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp (* x eps_m))) 2.0))
(t_1 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_2 (/ (+ 1.0 (exp x)) 2.0))
(t_3 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)))
(if (<= x -1e-280)
(/ (+ 1.0 (pow E (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 8.5e-5)
t_0
(if (<= x 9e-5)
1.0
(if (<= x 0.0125)
t_3
(if (<= x 1.52e+35)
t_0
(if (<= x 1.65e+40)
0.0
(if (<= x 2e+66)
t_2
(if (<= x 1.5e+75)
0.0
(if (<= x 1.92e+77)
t_1
(if (<= x 1.3e+81)
0.0
(if (<= x 7e+106)
t_2
(if (<= x 7.5e+107)
0.0
(if (<= x 1.4e+108)
t_3
(if (<= x 4.7e+110)
0.0
(if (<= x 2.4e+129)
t_2
(if (<= x 2e+131)
0.0
(if (<= x 4e+142)
t_2
(if (<= x 3.4e+143)
0.0
(if (<= x 6e+156)
t_2
(if (<= x 4.2e+160)
0.0
(if (<= x 6.6e+167)
t_1
(if (<= x 2.7e+172)
0.0
(if (<= x 9.6e+173)
t_3
(if (<= x 1.65e+185)
0.0
(if (<= x 1.55e+187)
t_3
(if (<= x 6.5e+189)
0.0
(if (<= x 4.2e+196)
t_3
(if (<= x 9.6e+200)
0.0
(if (<= x 1.25e+206)
t_3
(if (<=
x
1.15e+211)
0.0
(if (<=
x
1.45e+229)
t_3
(if (<=
x
2e+229)
0.0
(if (<=
x
9.5e+235)
t_2
(if (<=
x
2e+236)
0.0
(if (<=
x
2e+240)
t_2
(if (<=
x
4.4e+240)
0.0
(if (or (<=
x
1.65e+265)
(and (not
(<=
x
9.5e+276))
(or (<=
x
1.6e+281)
(and (not
(<=
x
1.15e+284))
(or (<=
x
1.95e+293)
(and (not
(<=
x
4.1e+294))
(<=
x
5e+301)))))))
t_3
0.0)))))))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (1.0 + exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (1.0 + exp(x)) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + pow(((double) M_E), (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 9e-5) {
tmp = 1.0;
} else if (x <= 0.0125) {
tmp = t_3;
} else if (x <= 1.52e+35) {
tmp = t_0;
} else if (x <= 1.65e+40) {
tmp = 0.0;
} else if (x <= 2e+66) {
tmp = t_2;
} else if (x <= 1.5e+75) {
tmp = 0.0;
} else if (x <= 1.92e+77) {
tmp = t_1;
} else if (x <= 1.3e+81) {
tmp = 0.0;
} else if (x <= 7e+106) {
tmp = t_2;
} else if (x <= 7.5e+107) {
tmp = 0.0;
} else if (x <= 1.4e+108) {
tmp = t_3;
} else if (x <= 4.7e+110) {
tmp = 0.0;
} else if (x <= 2.4e+129) {
tmp = t_2;
} else if (x <= 2e+131) {
tmp = 0.0;
} else if (x <= 4e+142) {
tmp = t_2;
} else if (x <= 3.4e+143) {
tmp = 0.0;
} else if (x <= 6e+156) {
tmp = t_2;
} else if (x <= 4.2e+160) {
tmp = 0.0;
} else if (x <= 6.6e+167) {
tmp = t_1;
} else if (x <= 2.7e+172) {
tmp = 0.0;
} else if (x <= 9.6e+173) {
tmp = t_3;
} else if (x <= 1.65e+185) {
tmp = 0.0;
} else if (x <= 1.55e+187) {
tmp = t_3;
} else if (x <= 6.5e+189) {
tmp = 0.0;
} else if (x <= 4.2e+196) {
tmp = t_3;
} else if (x <= 9.6e+200) {
tmp = 0.0;
} else if (x <= 1.25e+206) {
tmp = t_3;
} else if (x <= 1.15e+211) {
tmp = 0.0;
} else if (x <= 1.45e+229) {
tmp = t_3;
} else if (x <= 2e+229) {
tmp = 0.0;
} else if (x <= 9.5e+235) {
tmp = t_2;
} else if (x <= 2e+236) {
tmp = 0.0;
} else if (x <= 2e+240) {
tmp = t_2;
} else if (x <= 4.4e+240) {
tmp = 0.0;
} else if ((x <= 1.65e+265) || (!(x <= 9.5e+276) && ((x <= 1.6e+281) || (!(x <= 1.15e+284) && ((x <= 1.95e+293) || (!(x <= 4.1e+294) && (x <= 5e+301))))))) {
tmp = t_3;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (1.0 + Math.exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (1.0 + Math.exp(x)) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + Math.pow(Math.E, (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 9e-5) {
tmp = 1.0;
} else if (x <= 0.0125) {
tmp = t_3;
} else if (x <= 1.52e+35) {
tmp = t_0;
} else if (x <= 1.65e+40) {
tmp = 0.0;
} else if (x <= 2e+66) {
tmp = t_2;
} else if (x <= 1.5e+75) {
tmp = 0.0;
} else if (x <= 1.92e+77) {
tmp = t_1;
} else if (x <= 1.3e+81) {
tmp = 0.0;
} else if (x <= 7e+106) {
tmp = t_2;
} else if (x <= 7.5e+107) {
tmp = 0.0;
} else if (x <= 1.4e+108) {
tmp = t_3;
} else if (x <= 4.7e+110) {
tmp = 0.0;
} else if (x <= 2.4e+129) {
tmp = t_2;
} else if (x <= 2e+131) {
tmp = 0.0;
} else if (x <= 4e+142) {
tmp = t_2;
} else if (x <= 3.4e+143) {
tmp = 0.0;
} else if (x <= 6e+156) {
tmp = t_2;
} else if (x <= 4.2e+160) {
tmp = 0.0;
} else if (x <= 6.6e+167) {
tmp = t_1;
} else if (x <= 2.7e+172) {
tmp = 0.0;
} else if (x <= 9.6e+173) {
tmp = t_3;
} else if (x <= 1.65e+185) {
tmp = 0.0;
} else if (x <= 1.55e+187) {
tmp = t_3;
} else if (x <= 6.5e+189) {
tmp = 0.0;
} else if (x <= 4.2e+196) {
tmp = t_3;
} else if (x <= 9.6e+200) {
tmp = 0.0;
} else if (x <= 1.25e+206) {
tmp = t_3;
} else if (x <= 1.15e+211) {
tmp = 0.0;
} else if (x <= 1.45e+229) {
tmp = t_3;
} else if (x <= 2e+229) {
tmp = 0.0;
} else if (x <= 9.5e+235) {
tmp = t_2;
} else if (x <= 2e+236) {
tmp = 0.0;
} else if (x <= 2e+240) {
tmp = t_2;
} else if (x <= 4.4e+240) {
tmp = 0.0;
} else if ((x <= 1.65e+265) || (!(x <= 9.5e+276) && ((x <= 1.6e+281) || (!(x <= 1.15e+284) && ((x <= 1.95e+293) || (!(x <= 4.1e+294) && (x <= 5e+301))))))) {
tmp = t_3;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (1.0 + math.exp((x * eps_m))) / 2.0 t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_2 = (1.0 + math.exp(x)) / 2.0 t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0 tmp = 0 if x <= -1e-280: tmp = (1.0 + math.pow(math.e, (x * (1.0 - eps_m)))) / 2.0 elif x <= 8.5e-5: tmp = t_0 elif x <= 9e-5: tmp = 1.0 elif x <= 0.0125: tmp = t_3 elif x <= 1.52e+35: tmp = t_0 elif x <= 1.65e+40: tmp = 0.0 elif x <= 2e+66: tmp = t_2 elif x <= 1.5e+75: tmp = 0.0 elif x <= 1.92e+77: tmp = t_1 elif x <= 1.3e+81: tmp = 0.0 elif x <= 7e+106: tmp = t_2 elif x <= 7.5e+107: tmp = 0.0 elif x <= 1.4e+108: tmp = t_3 elif x <= 4.7e+110: tmp = 0.0 elif x <= 2.4e+129: tmp = t_2 elif x <= 2e+131: tmp = 0.0 elif x <= 4e+142: tmp = t_2 elif x <= 3.4e+143: tmp = 0.0 elif x <= 6e+156: tmp = t_2 elif x <= 4.2e+160: tmp = 0.0 elif x <= 6.6e+167: tmp = t_1 elif x <= 2.7e+172: tmp = 0.0 elif x <= 9.6e+173: tmp = t_3 elif x <= 1.65e+185: tmp = 0.0 elif x <= 1.55e+187: tmp = t_3 elif x <= 6.5e+189: tmp = 0.0 elif x <= 4.2e+196: tmp = t_3 elif x <= 9.6e+200: tmp = 0.0 elif x <= 1.25e+206: tmp = t_3 elif x <= 1.15e+211: tmp = 0.0 elif x <= 1.45e+229: tmp = t_3 elif x <= 2e+229: tmp = 0.0 elif x <= 9.5e+235: tmp = t_2 elif x <= 2e+236: tmp = 0.0 elif x <= 2e+240: tmp = t_2 elif x <= 4.4e+240: tmp = 0.0 elif (x <= 1.65e+265) or (not (x <= 9.5e+276) and ((x <= 1.6e+281) or (not (x <= 1.15e+284) and ((x <= 1.95e+293) or (not (x <= 4.1e+294) and (x <= 5e+301)))))): tmp = t_3 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0) t_1 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_2 = Float64(Float64(1.0 + exp(x)) / 2.0) t_3 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) tmp = 0.0 if (x <= -1e-280) tmp = Float64(Float64(1.0 + (exp(1) ^ Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 9e-5) tmp = 1.0; elseif (x <= 0.0125) tmp = t_3; elseif (x <= 1.52e+35) tmp = t_0; elseif (x <= 1.65e+40) tmp = 0.0; elseif (x <= 2e+66) tmp = t_2; elseif (x <= 1.5e+75) tmp = 0.0; elseif (x <= 1.92e+77) tmp = t_1; elseif (x <= 1.3e+81) tmp = 0.0; elseif (x <= 7e+106) tmp = t_2; elseif (x <= 7.5e+107) tmp = 0.0; elseif (x <= 1.4e+108) tmp = t_3; elseif (x <= 4.7e+110) tmp = 0.0; elseif (x <= 2.4e+129) tmp = t_2; elseif (x <= 2e+131) tmp = 0.0; elseif (x <= 4e+142) tmp = t_2; elseif (x <= 3.4e+143) tmp = 0.0; elseif (x <= 6e+156) tmp = t_2; elseif (x <= 4.2e+160) tmp = 0.0; elseif (x <= 6.6e+167) tmp = t_1; elseif (x <= 2.7e+172) tmp = 0.0; elseif (x <= 9.6e+173) tmp = t_3; elseif (x <= 1.65e+185) tmp = 0.0; elseif (x <= 1.55e+187) tmp = t_3; elseif (x <= 6.5e+189) tmp = 0.0; elseif (x <= 4.2e+196) tmp = t_3; elseif (x <= 9.6e+200) tmp = 0.0; elseif (x <= 1.25e+206) tmp = t_3; elseif (x <= 1.15e+211) tmp = 0.0; elseif (x <= 1.45e+229) tmp = t_3; elseif (x <= 2e+229) tmp = 0.0; elseif (x <= 9.5e+235) tmp = t_2; elseif (x <= 2e+236) tmp = 0.0; elseif (x <= 2e+240) tmp = t_2; elseif (x <= 4.4e+240) tmp = 0.0; elseif ((x <= 1.65e+265) || (!(x <= 9.5e+276) && ((x <= 1.6e+281) || (!(x <= 1.15e+284) && ((x <= 1.95e+293) || (!(x <= 4.1e+294) && (x <= 5e+301))))))) tmp = t_3; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (1.0 + exp((x * eps_m))) / 2.0; t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_2 = (1.0 + exp(x)) / 2.0; t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0; tmp = 0.0; if (x <= -1e-280) tmp = (1.0 + (2.71828182845904523536 ^ (x * (1.0 - eps_m)))) / 2.0; elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 9e-5) tmp = 1.0; elseif (x <= 0.0125) tmp = t_3; elseif (x <= 1.52e+35) tmp = t_0; elseif (x <= 1.65e+40) tmp = 0.0; elseif (x <= 2e+66) tmp = t_2; elseif (x <= 1.5e+75) tmp = 0.0; elseif (x <= 1.92e+77) tmp = t_1; elseif (x <= 1.3e+81) tmp = 0.0; elseif (x <= 7e+106) tmp = t_2; elseif (x <= 7.5e+107) tmp = 0.0; elseif (x <= 1.4e+108) tmp = t_3; elseif (x <= 4.7e+110) tmp = 0.0; elseif (x <= 2.4e+129) tmp = t_2; elseif (x <= 2e+131) tmp = 0.0; elseif (x <= 4e+142) tmp = t_2; elseif (x <= 3.4e+143) tmp = 0.0; elseif (x <= 6e+156) tmp = t_2; elseif (x <= 4.2e+160) tmp = 0.0; elseif (x <= 6.6e+167) tmp = t_1; elseif (x <= 2.7e+172) tmp = 0.0; elseif (x <= 9.6e+173) tmp = t_3; elseif (x <= 1.65e+185) tmp = 0.0; elseif (x <= 1.55e+187) tmp = t_3; elseif (x <= 6.5e+189) tmp = 0.0; elseif (x <= 4.2e+196) tmp = t_3; elseif (x <= 9.6e+200) tmp = 0.0; elseif (x <= 1.25e+206) tmp = t_3; elseif (x <= 1.15e+211) tmp = 0.0; elseif (x <= 1.45e+229) tmp = t_3; elseif (x <= 2e+229) tmp = 0.0; elseif (x <= 9.5e+235) tmp = t_2; elseif (x <= 2e+236) tmp = 0.0; elseif (x <= 2e+240) tmp = t_2; elseif (x <= 4.4e+240) tmp = 0.0; elseif ((x <= 1.65e+265) || (~((x <= 9.5e+276)) && ((x <= 1.6e+281) || (~((x <= 1.15e+284)) && ((x <= 1.95e+293) || (~((x <= 4.1e+294)) && (x <= 5e+301))))))) tmp = t_3; 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[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -1e-280], N[(N[(1.0 + N[Power[E, N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.5e-5], t$95$0, If[LessEqual[x, 9e-5], 1.0, If[LessEqual[x, 0.0125], t$95$3, If[LessEqual[x, 1.52e+35], t$95$0, If[LessEqual[x, 1.65e+40], 0.0, If[LessEqual[x, 2e+66], t$95$2, If[LessEqual[x, 1.5e+75], 0.0, If[LessEqual[x, 1.92e+77], t$95$1, If[LessEqual[x, 1.3e+81], 0.0, If[LessEqual[x, 7e+106], t$95$2, If[LessEqual[x, 7.5e+107], 0.0, If[LessEqual[x, 1.4e+108], t$95$3, If[LessEqual[x, 4.7e+110], 0.0, If[LessEqual[x, 2.4e+129], t$95$2, If[LessEqual[x, 2e+131], 0.0, If[LessEqual[x, 4e+142], t$95$2, If[LessEqual[x, 3.4e+143], 0.0, If[LessEqual[x, 6e+156], t$95$2, If[LessEqual[x, 4.2e+160], 0.0, If[LessEqual[x, 6.6e+167], t$95$1, If[LessEqual[x, 2.7e+172], 0.0, If[LessEqual[x, 9.6e+173], t$95$3, If[LessEqual[x, 1.65e+185], 0.0, If[LessEqual[x, 1.55e+187], t$95$3, If[LessEqual[x, 6.5e+189], 0.0, If[LessEqual[x, 4.2e+196], t$95$3, If[LessEqual[x, 9.6e+200], 0.0, If[LessEqual[x, 1.25e+206], t$95$3, If[LessEqual[x, 1.15e+211], 0.0, If[LessEqual[x, 1.45e+229], t$95$3, If[LessEqual[x, 2e+229], 0.0, If[LessEqual[x, 9.5e+235], t$95$2, If[LessEqual[x, 2e+236], 0.0, If[LessEqual[x, 2e+240], t$95$2, If[LessEqual[x, 4.4e+240], 0.0, If[Or[LessEqual[x, 1.65e+265], And[N[Not[LessEqual[x, 9.5e+276]], $MachinePrecision], Or[LessEqual[x, 1.6e+281], And[N[Not[LessEqual[x, 1.15e+284]], $MachinePrecision], Or[LessEqual[x, 1.95e+293], And[N[Not[LessEqual[x, 4.1e+294]], $MachinePrecision], LessEqual[x, 5e+301]]]]]]], t$95$3, 0.0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{1 + e^{x \cdot eps\_m}}{2}\\
t_1 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_2 := \frac{1 + e^{x}}{2}\\
t_3 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + {e}^{\left(x \cdot \left(1 - eps\_m\right)\right)}}{2}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0125:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.52 \cdot 10^{+35}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+40}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+66}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+75}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.92 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+81}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+107}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+108}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+110}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+131}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+143}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+156}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+160}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+172}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+173}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+185}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+187}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+189}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+196}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+200}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+206}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+211}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+229}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+235}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+236}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+240}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+240}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+265} \lor \neg \left(x \leq 9.5 \cdot 10^{+276}\right) \land \left(x \leq 1.6 \cdot 10^{+281} \lor \neg \left(x \leq 1.15 \cdot 10^{+284}\right) \land \left(x \leq 1.95 \cdot 10^{+293} \lor \neg \left(x \leq 4.1 \cdot 10^{+294}\right) \land x \leq 5 \cdot 10^{+301}\right)\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.9999999999999996e-281Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
*-commutative77.4%
*-un-lft-identity77.4%
exp-prod77.4%
e-exp-177.4%
*-commutative77.4%
Applied egg-rr77.4%
if -9.9999999999999996e-281 < x < 8.500000000000001e-5 or 0.012500000000000001 < x < 1.5200000000000001e35Initial program 55.0%
Simplified43.9%
Taylor expanded in eps around inf 99.5%
Taylor expanded in x around 0 88.4%
Taylor expanded in eps around inf 88.9%
*-commutative100.0%
Simplified88.9%
if 8.500000000000001e-5 < x < 9.00000000000000057e-5Initial program 3.1%
Simplified3.1%
Taylor expanded in x around 0 60.9%
if 9.00000000000000057e-5 < x < 0.012500000000000001 or 7.4999999999999996e107 < x < 1.3999999999999999e108 or 2.7e172 < x < 9.5999999999999997e173 or 1.65000000000000006e185 < x < 1.55000000000000006e187 or 6.50000000000000027e189 < x < 4.20000000000000029e196 or 9.6000000000000003e200 < x < 1.25e206 or 1.15000000000000005e211 < x < 1.44999999999999991e229 or 4.4000000000000003e240 < x < 1.6499999999999999e265 or 9.50000000000000013e276 < x < 1.6000000000000001e281 or 1.14999999999999992e284 < x < 1.95000000000000014e293 or 4.0999999999999998e294 < x < 5.0000000000000004e301Initial program 93.9%
Simplified93.9%
Taylor expanded in x around 0 69.8%
Taylor expanded in x around 0 69.1%
associate-*r*69.1%
neg-mul-169.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in eps around inf 71.2%
associate-*r/71.2%
metadata-eval71.2%
Simplified71.2%
if 1.5200000000000001e35 < x < 1.6499999999999999e40 or 1.99999999999999989e66 < x < 1.5e75 or 1.92e77 < x < 1.29999999999999996e81 or 6.99999999999999962e106 < x < 7.4999999999999996e107 or 1.3999999999999999e108 < x < 4.6999999999999998e110 or 2.3999999999999999e129 < x < 1.9999999999999998e131 or 4.0000000000000002e142 < x < 3.39999999999999982e143 or 5.9999999999999999e156 < x < 4.19999999999999993e160 or 6.60000000000000036e167 < x < 2.7e172 or 9.5999999999999997e173 < x < 1.65000000000000006e185 or 1.55000000000000006e187 < x < 6.50000000000000027e189 or 4.20000000000000029e196 < x < 9.6000000000000003e200 or 1.25e206 < x < 1.15000000000000005e211 or 1.44999999999999991e229 < x < 2e229 or 9.49999999999999966e235 < x < 2.00000000000000011e236 or 2.00000000000000003e240 < x < 4.4000000000000003e240 or 1.6499999999999999e265 < x < 9.50000000000000013e276 or 1.6000000000000001e281 < x < 1.14999999999999992e284 or 1.95000000000000014e293 < x < 4.0999999999999998e294 or 5.0000000000000004e301 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
mul-1-neg100.0%
mul-1-neg100.0%
rec-exp100.0%
sub-neg100.0%
div-sub100.0%
mul-1-neg100.0%
rec-exp100.0%
+-inverses100.0%
Simplified100.0%
if 1.6499999999999999e40 < x < 1.99999999999999989e66 or 1.29999999999999996e81 < x < 6.99999999999999962e106 or 4.6999999999999998e110 < x < 2.3999999999999999e129 or 1.9999999999999998e131 < x < 4.0000000000000002e142 or 3.39999999999999982e143 < x < 5.9999999999999999e156 or 2e229 < x < 9.49999999999999966e235 or 2.00000000000000011e236 < x < 2.00000000000000003e240Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 57.9%
sub-neg57.9%
metadata-eval57.9%
distribute-rgt-in57.9%
add-sqr-sqrt57.9%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod0.0%
add-sqr-sqrt45.2%
neg-mul-145.2%
*-un-lft-identity45.2%
distribute-rgt-in45.2%
+-commutative45.2%
*-commutative45.2%
distribute-rgt-neg-out45.2%
neg-sub045.2%
add-sqr-sqrt45.2%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod0.0%
add-sqr-sqrt57.9%
*-commutative57.9%
+-commutative57.9%
distribute-rgt-in57.9%
Applied egg-rr45.2%
neg-sub045.2%
distribute-rgt-neg-in45.2%
+-commutative45.2%
distribute-neg-in45.2%
metadata-eval45.2%
sub-neg45.2%
Simplified45.2%
Taylor expanded in eps around 0 100.0%
if 1.5e75 < x < 1.92e77 or 4.19999999999999993e160 < x < 6.60000000000000036e167Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.1%
associate-*r*0.1%
neg-mul-10.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in eps around 0 0.0%
Final simplification84.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp (* x eps_m))) 2.0))
(t_1 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_2 (/ (+ 1.0 (exp x)) 2.0))
(t_3 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)))
(if (<= x -1e-280)
(/ (+ 1.0 (exp (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 8.5e-5)
t_0
(if (<= x 9e-5)
1.0
(if (<= x 0.0125)
t_3
(if (<= x 3.9e+36)
t_0
(if (<= x 5e+39)
0.0
(if (<= x 2e+65)
t_2
(if (<= x 5e+74)
0.0
(if (<= x 1.58e+78)
t_1
(if (<= x 5e+80)
0.0
(if (<= x 1.45e+107)
t_2
(if (<= x 5e+107)
0.0
(if (<= x 8e+107)
t_3
(if (<= x 1e+110)
0.0
(if (<= x 4.5e+129)
t_2
(if (<= x 2e+131)
0.0
(if (<= x 6e+142)
t_2
(if (<= x 2.25e+150)
0.0
(if (<= x 8.5e+157)
t_2
(if (<= x 2e+162)
0.0
(if (<= x 6e+168)
t_1
(if (<= x 4.2e+172)
0.0
(if (<= x 4e+174)
t_3
(if (<= x 3.4e+183)
0.0
(if (<= x 6e+186)
t_3
(if (<= x 4.6e+189)
0.0
(if (<= x 3.3e+198)
t_3
(if (<= x 8e+198)
0.0
(if (<= x 7e+205)
t_3
(if (<=
x
7.5e+207)
0.0
(if (<=
x
6.5e+228)
t_3
(if (<=
x
2e+229)
0.0
(if (<=
x
1.45e+236)
t_2
(if (<=
x
2e+236)
0.0
(if (<=
x
3e+240)
t_2
(if (<=
x
6.8e+240)
0.0
(if (or (<=
x
3.6e+266)
(and (not
(<=
x
2.3e+274))
(or (<=
x
5.6e+280)
(and (not
(<=
x
1.3e+284))
(or (<=
x
2.55e+294)
(and (not
(<=
x
2.7e+295))
(<=
x
5e+301)))))))
t_3
0.0)))))))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (1.0 + exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (1.0 + exp(x)) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 9e-5) {
tmp = 1.0;
} else if (x <= 0.0125) {
tmp = t_3;
} else if (x <= 3.9e+36) {
tmp = t_0;
} else if (x <= 5e+39) {
tmp = 0.0;
} else if (x <= 2e+65) {
tmp = t_2;
} else if (x <= 5e+74) {
tmp = 0.0;
} else if (x <= 1.58e+78) {
tmp = t_1;
} else if (x <= 5e+80) {
tmp = 0.0;
} else if (x <= 1.45e+107) {
tmp = t_2;
} else if (x <= 5e+107) {
tmp = 0.0;
} else if (x <= 8e+107) {
tmp = t_3;
} else if (x <= 1e+110) {
tmp = 0.0;
} else if (x <= 4.5e+129) {
tmp = t_2;
} else if (x <= 2e+131) {
tmp = 0.0;
} else if (x <= 6e+142) {
tmp = t_2;
} else if (x <= 2.25e+150) {
tmp = 0.0;
} else if (x <= 8.5e+157) {
tmp = t_2;
} else if (x <= 2e+162) {
tmp = 0.0;
} else if (x <= 6e+168) {
tmp = t_1;
} else if (x <= 4.2e+172) {
tmp = 0.0;
} else if (x <= 4e+174) {
tmp = t_3;
} else if (x <= 3.4e+183) {
tmp = 0.0;
} else if (x <= 6e+186) {
tmp = t_3;
} else if (x <= 4.6e+189) {
tmp = 0.0;
} else if (x <= 3.3e+198) {
tmp = t_3;
} else if (x <= 8e+198) {
tmp = 0.0;
} else if (x <= 7e+205) {
tmp = t_3;
} else if (x <= 7.5e+207) {
tmp = 0.0;
} else if (x <= 6.5e+228) {
tmp = t_3;
} else if (x <= 2e+229) {
tmp = 0.0;
} else if (x <= 1.45e+236) {
tmp = t_2;
} else if (x <= 2e+236) {
tmp = 0.0;
} else if (x <= 3e+240) {
tmp = t_2;
} else if (x <= 6.8e+240) {
tmp = 0.0;
} else if ((x <= 3.6e+266) || (!(x <= 2.3e+274) && ((x <= 5.6e+280) || (!(x <= 1.3e+284) && ((x <= 2.55e+294) || (!(x <= 2.7e+295) && (x <= 5e+301))))))) {
tmp = t_3;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = (1.0d0 + exp((x * eps_m))) / 2.0d0
t_1 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
t_2 = (1.0d0 + exp(x)) / 2.0d0
t_3 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
if (x <= (-1d-280)) then
tmp = (1.0d0 + exp((x * (1.0d0 - eps_m)))) / 2.0d0
else if (x <= 8.5d-5) then
tmp = t_0
else if (x <= 9d-5) then
tmp = 1.0d0
else if (x <= 0.0125d0) then
tmp = t_3
else if (x <= 3.9d+36) then
tmp = t_0
else if (x <= 5d+39) then
tmp = 0.0d0
else if (x <= 2d+65) then
tmp = t_2
else if (x <= 5d+74) then
tmp = 0.0d0
else if (x <= 1.58d+78) then
tmp = t_1
else if (x <= 5d+80) then
tmp = 0.0d0
else if (x <= 1.45d+107) then
tmp = t_2
else if (x <= 5d+107) then
tmp = 0.0d0
else if (x <= 8d+107) then
tmp = t_3
else if (x <= 1d+110) then
tmp = 0.0d0
else if (x <= 4.5d+129) then
tmp = t_2
else if (x <= 2d+131) then
tmp = 0.0d0
else if (x <= 6d+142) then
tmp = t_2
else if (x <= 2.25d+150) then
tmp = 0.0d0
else if (x <= 8.5d+157) then
tmp = t_2
else if (x <= 2d+162) then
tmp = 0.0d0
else if (x <= 6d+168) then
tmp = t_1
else if (x <= 4.2d+172) then
tmp = 0.0d0
else if (x <= 4d+174) then
tmp = t_3
else if (x <= 3.4d+183) then
tmp = 0.0d0
else if (x <= 6d+186) then
tmp = t_3
else if (x <= 4.6d+189) then
tmp = 0.0d0
else if (x <= 3.3d+198) then
tmp = t_3
else if (x <= 8d+198) then
tmp = 0.0d0
else if (x <= 7d+205) then
tmp = t_3
else if (x <= 7.5d+207) then
tmp = 0.0d0
else if (x <= 6.5d+228) then
tmp = t_3
else if (x <= 2d+229) then
tmp = 0.0d0
else if (x <= 1.45d+236) then
tmp = t_2
else if (x <= 2d+236) then
tmp = 0.0d0
else if (x <= 3d+240) then
tmp = t_2
else if (x <= 6.8d+240) then
tmp = 0.0d0
else if ((x <= 3.6d+266) .or. (.not. (x <= 2.3d+274)) .and. (x <= 5.6d+280) .or. (.not. (x <= 1.3d+284)) .and. (x <= 2.55d+294) .or. (.not. (x <= 2.7d+295)) .and. (x <= 5d+301)) then
tmp = t_3
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 = (1.0 + Math.exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (1.0 + Math.exp(x)) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + Math.exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 9e-5) {
tmp = 1.0;
} else if (x <= 0.0125) {
tmp = t_3;
} else if (x <= 3.9e+36) {
tmp = t_0;
} else if (x <= 5e+39) {
tmp = 0.0;
} else if (x <= 2e+65) {
tmp = t_2;
} else if (x <= 5e+74) {
tmp = 0.0;
} else if (x <= 1.58e+78) {
tmp = t_1;
} else if (x <= 5e+80) {
tmp = 0.0;
} else if (x <= 1.45e+107) {
tmp = t_2;
} else if (x <= 5e+107) {
tmp = 0.0;
} else if (x <= 8e+107) {
tmp = t_3;
} else if (x <= 1e+110) {
tmp = 0.0;
} else if (x <= 4.5e+129) {
tmp = t_2;
} else if (x <= 2e+131) {
tmp = 0.0;
} else if (x <= 6e+142) {
tmp = t_2;
} else if (x <= 2.25e+150) {
tmp = 0.0;
} else if (x <= 8.5e+157) {
tmp = t_2;
} else if (x <= 2e+162) {
tmp = 0.0;
} else if (x <= 6e+168) {
tmp = t_1;
} else if (x <= 4.2e+172) {
tmp = 0.0;
} else if (x <= 4e+174) {
tmp = t_3;
} else if (x <= 3.4e+183) {
tmp = 0.0;
} else if (x <= 6e+186) {
tmp = t_3;
} else if (x <= 4.6e+189) {
tmp = 0.0;
} else if (x <= 3.3e+198) {
tmp = t_3;
} else if (x <= 8e+198) {
tmp = 0.0;
} else if (x <= 7e+205) {
tmp = t_3;
} else if (x <= 7.5e+207) {
tmp = 0.0;
} else if (x <= 6.5e+228) {
tmp = t_3;
} else if (x <= 2e+229) {
tmp = 0.0;
} else if (x <= 1.45e+236) {
tmp = t_2;
} else if (x <= 2e+236) {
tmp = 0.0;
} else if (x <= 3e+240) {
tmp = t_2;
} else if (x <= 6.8e+240) {
tmp = 0.0;
} else if ((x <= 3.6e+266) || (!(x <= 2.3e+274) && ((x <= 5.6e+280) || (!(x <= 1.3e+284) && ((x <= 2.55e+294) || (!(x <= 2.7e+295) && (x <= 5e+301))))))) {
tmp = t_3;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (1.0 + math.exp((x * eps_m))) / 2.0 t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_2 = (1.0 + math.exp(x)) / 2.0 t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0 tmp = 0 if x <= -1e-280: tmp = (1.0 + math.exp((x * (1.0 - eps_m)))) / 2.0 elif x <= 8.5e-5: tmp = t_0 elif x <= 9e-5: tmp = 1.0 elif x <= 0.0125: tmp = t_3 elif x <= 3.9e+36: tmp = t_0 elif x <= 5e+39: tmp = 0.0 elif x <= 2e+65: tmp = t_2 elif x <= 5e+74: tmp = 0.0 elif x <= 1.58e+78: tmp = t_1 elif x <= 5e+80: tmp = 0.0 elif x <= 1.45e+107: tmp = t_2 elif x <= 5e+107: tmp = 0.0 elif x <= 8e+107: tmp = t_3 elif x <= 1e+110: tmp = 0.0 elif x <= 4.5e+129: tmp = t_2 elif x <= 2e+131: tmp = 0.0 elif x <= 6e+142: tmp = t_2 elif x <= 2.25e+150: tmp = 0.0 elif x <= 8.5e+157: tmp = t_2 elif x <= 2e+162: tmp = 0.0 elif x <= 6e+168: tmp = t_1 elif x <= 4.2e+172: tmp = 0.0 elif x <= 4e+174: tmp = t_3 elif x <= 3.4e+183: tmp = 0.0 elif x <= 6e+186: tmp = t_3 elif x <= 4.6e+189: tmp = 0.0 elif x <= 3.3e+198: tmp = t_3 elif x <= 8e+198: tmp = 0.0 elif x <= 7e+205: tmp = t_3 elif x <= 7.5e+207: tmp = 0.0 elif x <= 6.5e+228: tmp = t_3 elif x <= 2e+229: tmp = 0.0 elif x <= 1.45e+236: tmp = t_2 elif x <= 2e+236: tmp = 0.0 elif x <= 3e+240: tmp = t_2 elif x <= 6.8e+240: tmp = 0.0 elif (x <= 3.6e+266) or (not (x <= 2.3e+274) and ((x <= 5.6e+280) or (not (x <= 1.3e+284) and ((x <= 2.55e+294) or (not (x <= 2.7e+295) and (x <= 5e+301)))))): tmp = t_3 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0) t_1 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_2 = Float64(Float64(1.0 + exp(x)) / 2.0) t_3 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) tmp = 0.0 if (x <= -1e-280) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 9e-5) tmp = 1.0; elseif (x <= 0.0125) tmp = t_3; elseif (x <= 3.9e+36) tmp = t_0; elseif (x <= 5e+39) tmp = 0.0; elseif (x <= 2e+65) tmp = t_2; elseif (x <= 5e+74) tmp = 0.0; elseif (x <= 1.58e+78) tmp = t_1; elseif (x <= 5e+80) tmp = 0.0; elseif (x <= 1.45e+107) tmp = t_2; elseif (x <= 5e+107) tmp = 0.0; elseif (x <= 8e+107) tmp = t_3; elseif (x <= 1e+110) tmp = 0.0; elseif (x <= 4.5e+129) tmp = t_2; elseif (x <= 2e+131) tmp = 0.0; elseif (x <= 6e+142) tmp = t_2; elseif (x <= 2.25e+150) tmp = 0.0; elseif (x <= 8.5e+157) tmp = t_2; elseif (x <= 2e+162) tmp = 0.0; elseif (x <= 6e+168) tmp = t_1; elseif (x <= 4.2e+172) tmp = 0.0; elseif (x <= 4e+174) tmp = t_3; elseif (x <= 3.4e+183) tmp = 0.0; elseif (x <= 6e+186) tmp = t_3; elseif (x <= 4.6e+189) tmp = 0.0; elseif (x <= 3.3e+198) tmp = t_3; elseif (x <= 8e+198) tmp = 0.0; elseif (x <= 7e+205) tmp = t_3; elseif (x <= 7.5e+207) tmp = 0.0; elseif (x <= 6.5e+228) tmp = t_3; elseif (x <= 2e+229) tmp = 0.0; elseif (x <= 1.45e+236) tmp = t_2; elseif (x <= 2e+236) tmp = 0.0; elseif (x <= 3e+240) tmp = t_2; elseif (x <= 6.8e+240) tmp = 0.0; elseif ((x <= 3.6e+266) || (!(x <= 2.3e+274) && ((x <= 5.6e+280) || (!(x <= 1.3e+284) && ((x <= 2.55e+294) || (!(x <= 2.7e+295) && (x <= 5e+301))))))) tmp = t_3; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (1.0 + exp((x * eps_m))) / 2.0; t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_2 = (1.0 + exp(x)) / 2.0; t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0; tmp = 0.0; if (x <= -1e-280) tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0; elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 9e-5) tmp = 1.0; elseif (x <= 0.0125) tmp = t_3; elseif (x <= 3.9e+36) tmp = t_0; elseif (x <= 5e+39) tmp = 0.0; elseif (x <= 2e+65) tmp = t_2; elseif (x <= 5e+74) tmp = 0.0; elseif (x <= 1.58e+78) tmp = t_1; elseif (x <= 5e+80) tmp = 0.0; elseif (x <= 1.45e+107) tmp = t_2; elseif (x <= 5e+107) tmp = 0.0; elseif (x <= 8e+107) tmp = t_3; elseif (x <= 1e+110) tmp = 0.0; elseif (x <= 4.5e+129) tmp = t_2; elseif (x <= 2e+131) tmp = 0.0; elseif (x <= 6e+142) tmp = t_2; elseif (x <= 2.25e+150) tmp = 0.0; elseif (x <= 8.5e+157) tmp = t_2; elseif (x <= 2e+162) tmp = 0.0; elseif (x <= 6e+168) tmp = t_1; elseif (x <= 4.2e+172) tmp = 0.0; elseif (x <= 4e+174) tmp = t_3; elseif (x <= 3.4e+183) tmp = 0.0; elseif (x <= 6e+186) tmp = t_3; elseif (x <= 4.6e+189) tmp = 0.0; elseif (x <= 3.3e+198) tmp = t_3; elseif (x <= 8e+198) tmp = 0.0; elseif (x <= 7e+205) tmp = t_3; elseif (x <= 7.5e+207) tmp = 0.0; elseif (x <= 6.5e+228) tmp = t_3; elseif (x <= 2e+229) tmp = 0.0; elseif (x <= 1.45e+236) tmp = t_2; elseif (x <= 2e+236) tmp = 0.0; elseif (x <= 3e+240) tmp = t_2; elseif (x <= 6.8e+240) tmp = 0.0; elseif ((x <= 3.6e+266) || (~((x <= 2.3e+274)) && ((x <= 5.6e+280) || (~((x <= 1.3e+284)) && ((x <= 2.55e+294) || (~((x <= 2.7e+295)) && (x <= 5e+301))))))) tmp = t_3; 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[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -1e-280], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.5e-5], t$95$0, If[LessEqual[x, 9e-5], 1.0, If[LessEqual[x, 0.0125], t$95$3, If[LessEqual[x, 3.9e+36], t$95$0, If[LessEqual[x, 5e+39], 0.0, If[LessEqual[x, 2e+65], t$95$2, If[LessEqual[x, 5e+74], 0.0, If[LessEqual[x, 1.58e+78], t$95$1, If[LessEqual[x, 5e+80], 0.0, If[LessEqual[x, 1.45e+107], t$95$2, If[LessEqual[x, 5e+107], 0.0, If[LessEqual[x, 8e+107], t$95$3, If[LessEqual[x, 1e+110], 0.0, If[LessEqual[x, 4.5e+129], t$95$2, If[LessEqual[x, 2e+131], 0.0, If[LessEqual[x, 6e+142], t$95$2, If[LessEqual[x, 2.25e+150], 0.0, If[LessEqual[x, 8.5e+157], t$95$2, If[LessEqual[x, 2e+162], 0.0, If[LessEqual[x, 6e+168], t$95$1, If[LessEqual[x, 4.2e+172], 0.0, If[LessEqual[x, 4e+174], t$95$3, If[LessEqual[x, 3.4e+183], 0.0, If[LessEqual[x, 6e+186], t$95$3, If[LessEqual[x, 4.6e+189], 0.0, If[LessEqual[x, 3.3e+198], t$95$3, If[LessEqual[x, 8e+198], 0.0, If[LessEqual[x, 7e+205], t$95$3, If[LessEqual[x, 7.5e+207], 0.0, If[LessEqual[x, 6.5e+228], t$95$3, If[LessEqual[x, 2e+229], 0.0, If[LessEqual[x, 1.45e+236], t$95$2, If[LessEqual[x, 2e+236], 0.0, If[LessEqual[x, 3e+240], t$95$2, If[LessEqual[x, 6.8e+240], 0.0, If[Or[LessEqual[x, 3.6e+266], And[N[Not[LessEqual[x, 2.3e+274]], $MachinePrecision], Or[LessEqual[x, 5.6e+280], And[N[Not[LessEqual[x, 1.3e+284]], $MachinePrecision], Or[LessEqual[x, 2.55e+294], And[N[Not[LessEqual[x, 2.7e+295]], $MachinePrecision], LessEqual[x, 5e+301]]]]]]], t$95$3, 0.0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{1 + e^{x \cdot eps\_m}}{2}\\
t_1 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_2 := \frac{1 + e^{x}}{2}\\
t_3 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-5}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0125:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+39}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+74}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.58 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+80}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+107}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+107}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 10^{+110}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+129}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+131}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+150}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+157}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+162}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+172}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+174}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+183}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+186}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+189}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+198}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+198}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+205}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+207}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+228}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+236}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+240}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+240}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+266} \lor \neg \left(x \leq 2.3 \cdot 10^{+274}\right) \land \left(x \leq 5.6 \cdot 10^{+280} \lor \neg \left(x \leq 1.3 \cdot 10^{+284}\right) \land \left(x \leq 2.55 \cdot 10^{+294} \lor \neg \left(x \leq 2.7 \cdot 10^{+295}\right) \land x \leq 5 \cdot 10^{+301}\right)\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.9999999999999996e-281Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
if -9.9999999999999996e-281 < x < 8.500000000000001e-5 or 0.012500000000000001 < x < 3.90000000000000021e36Initial program 55.0%
Simplified43.9%
Taylor expanded in eps around inf 99.5%
Taylor expanded in x around 0 88.4%
Taylor expanded in eps around inf 88.9%
*-commutative100.0%
Simplified88.9%
if 8.500000000000001e-5 < x < 9.00000000000000057e-5Initial program 3.1%
Simplified3.1%
Taylor expanded in x around 0 60.9%
if 9.00000000000000057e-5 < x < 0.012500000000000001 or 5.0000000000000002e107 < x < 7.9999999999999998e107 or 4.2000000000000003e172 < x < 4.00000000000000028e174 or 3.4e183 < x < 5.99999999999999964e186 or 4.6e189 < x < 3.29999999999999994e198 or 8.00000000000000014e198 < x < 6.9999999999999996e205 or 7.49999999999999986e207 < x < 6.5e228 or 6.80000000000000017e240 < x < 3.59999999999999988e266 or 2.30000000000000003e274 < x < 5.60000000000000002e280 or 1.2999999999999999e284 < x < 2.55e294 or 2.7000000000000002e295 < x < 5.0000000000000004e301Initial program 93.9%
Simplified93.9%
Taylor expanded in x around 0 69.8%
Taylor expanded in x around 0 69.1%
associate-*r*69.1%
neg-mul-169.1%
*-commutative69.1%
Simplified69.1%
Taylor expanded in eps around inf 71.2%
associate-*r/71.2%
metadata-eval71.2%
Simplified71.2%
if 3.90000000000000021e36 < x < 5.00000000000000015e39 or 2e65 < x < 4.99999999999999963e74 or 1.58000000000000004e78 < x < 4.99999999999999961e80 or 1.44999999999999994e107 < x < 5.0000000000000002e107 or 7.9999999999999998e107 < x < 1e110 or 4.5000000000000001e129 < x < 1.9999999999999998e131 or 5.99999999999999949e142 < x < 2.25e150 or 8.4999999999999998e157 < x < 1.9999999999999999e162 or 5.9999999999999996e168 < x < 4.2000000000000003e172 or 4.00000000000000028e174 < x < 3.4e183 or 5.99999999999999964e186 < x < 4.6e189 or 3.29999999999999994e198 < x < 8.00000000000000014e198 or 6.9999999999999996e205 < x < 7.49999999999999986e207 or 6.5e228 < x < 2e229 or 1.45e236 < x < 2.00000000000000011e236 or 2.9999999999999999e240 < x < 6.80000000000000017e240 or 3.59999999999999988e266 < x < 2.30000000000000003e274 or 5.60000000000000002e280 < x < 1.2999999999999999e284 or 2.55e294 < x < 2.7000000000000002e295 or 5.0000000000000004e301 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
mul-1-neg100.0%
mul-1-neg100.0%
rec-exp100.0%
sub-neg100.0%
div-sub100.0%
mul-1-neg100.0%
rec-exp100.0%
+-inverses100.0%
Simplified100.0%
if 5.00000000000000015e39 < x < 2e65 or 4.99999999999999961e80 < x < 1.44999999999999994e107 or 1e110 < x < 4.5000000000000001e129 or 1.9999999999999998e131 < x < 5.99999999999999949e142 or 2.25e150 < x < 8.4999999999999998e157 or 2e229 < x < 1.45e236 or 2.00000000000000011e236 < x < 2.9999999999999999e240Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 57.9%
sub-neg57.9%
metadata-eval57.9%
distribute-rgt-in57.9%
add-sqr-sqrt57.9%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod0.0%
add-sqr-sqrt45.2%
neg-mul-145.2%
*-un-lft-identity45.2%
distribute-rgt-in45.2%
+-commutative45.2%
*-commutative45.2%
distribute-rgt-neg-out45.2%
neg-sub045.2%
add-sqr-sqrt45.2%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod0.0%
add-sqr-sqrt57.9%
*-commutative57.9%
+-commutative57.9%
distribute-rgt-in57.9%
Applied egg-rr45.2%
neg-sub045.2%
distribute-rgt-neg-in45.2%
+-commutative45.2%
distribute-neg-in45.2%
metadata-eval45.2%
sub-neg45.2%
Simplified45.2%
Taylor expanded in eps around 0 100.0%
if 4.99999999999999963e74 < x < 1.58000000000000004e78 or 1.9999999999999999e162 < x < 5.9999999999999996e168Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.1%
associate-*r*0.1%
neg-mul-10.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in eps around 0 0.0%
Final simplification84.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp (* x eps_m))) 2.0))
(t_1 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_2 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0))
(t_3 (/ (+ 1.0 (exp x)) 2.0)))
(if (<= x -2e-282)
(/ (+ 1.0 (pow E (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 8.5e-5)
t_0
(if (<= x 0.19)
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(if (<= x 8.5e+38)
t_0
(if (<= x 7.2e+39)
0.0
(if (<= x 4e+61)
t_3
(if (<= x 1e+76)
0.0
(if (<= x 2.25e+77)
t_1
(if (<= x 1.5e+80)
0.0
(if (<= x 1.35e+103)
t_3
(if (<= x 7.5e+107)
0.0
(if (<= x 9e+107)
t_2
(if (<= x 1e+110)
0.0
(if (<= x 5e+128)
t_3
(if (<= x 3e+135)
0.0
(if (<= x 2.2e+142)
t_3
(if (<= x 1e+143)
0.0
(if (<= x 1e+158)
t_3
(if (<= x 1.35e+160)
0.0
(if (<= x 2.3e+169)
t_1
(if (<= x 1.7e+173)
0.0
(if (<= x 1.3e+174)
t_2
(if (<= x 3.5e+186)
0.0
(if (<= x 2.6e+187)
t_2
(if (<= x 7e+191)
0.0
(if (<= x 3.8e+195)
t_2
(if (<= x 3.4e+201)
0.0
(if (<= x 1.3e+206)
t_2
(if (<= x 3.2e+206)
0.0
(if (<=
x
5.8e+228)
t_2
(if (<=
x
2.15e+229)
0.0
(if (<=
x
1.1e+235)
t_3
(if (<=
x
1.55e+236)
0.0
(if (<=
x
2e+240)
t_3
(if (<=
x
4.3e+240)
0.0
(if (or (<=
x
2.55e+265)
(and (not
(<=
x
2.1e+274))
(or (<=
x
1.5e+281)
(and (not
(<=
x
1.25e+289))
(or (<=
x
7.8e+293)
(and (not
(<=
x
4.4e+294))
(<=
x
5.3e+301)))))))
t_2
0.0))))))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (1.0 + exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_3 = (1.0 + exp(x)) / 2.0;
double tmp;
if (x <= -2e-282) {
tmp = (1.0 + pow(((double) M_E), (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 0.19) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if (x <= 8.5e+38) {
tmp = t_0;
} else if (x <= 7.2e+39) {
tmp = 0.0;
} else if (x <= 4e+61) {
tmp = t_3;
} else if (x <= 1e+76) {
tmp = 0.0;
} else if (x <= 2.25e+77) {
tmp = t_1;
} else if (x <= 1.5e+80) {
tmp = 0.0;
} else if (x <= 1.35e+103) {
tmp = t_3;
} else if (x <= 7.5e+107) {
tmp = 0.0;
} else if (x <= 9e+107) {
tmp = t_2;
} else if (x <= 1e+110) {
tmp = 0.0;
} else if (x <= 5e+128) {
tmp = t_3;
} else if (x <= 3e+135) {
tmp = 0.0;
} else if (x <= 2.2e+142) {
tmp = t_3;
} else if (x <= 1e+143) {
tmp = 0.0;
} else if (x <= 1e+158) {
tmp = t_3;
} else if (x <= 1.35e+160) {
tmp = 0.0;
} else if (x <= 2.3e+169) {
tmp = t_1;
} else if (x <= 1.7e+173) {
tmp = 0.0;
} else if (x <= 1.3e+174) {
tmp = t_2;
} else if (x <= 3.5e+186) {
tmp = 0.0;
} else if (x <= 2.6e+187) {
tmp = t_2;
} else if (x <= 7e+191) {
tmp = 0.0;
} else if (x <= 3.8e+195) {
tmp = t_2;
} else if (x <= 3.4e+201) {
tmp = 0.0;
} else if (x <= 1.3e+206) {
tmp = t_2;
} else if (x <= 3.2e+206) {
tmp = 0.0;
} else if (x <= 5.8e+228) {
tmp = t_2;
} else if (x <= 2.15e+229) {
tmp = 0.0;
} else if (x <= 1.1e+235) {
tmp = t_3;
} else if (x <= 1.55e+236) {
tmp = 0.0;
} else if (x <= 2e+240) {
tmp = t_3;
} else if (x <= 4.3e+240) {
tmp = 0.0;
} else if ((x <= 2.55e+265) || (!(x <= 2.1e+274) && ((x <= 1.5e+281) || (!(x <= 1.25e+289) && ((x <= 7.8e+293) || (!(x <= 4.4e+294) && (x <= 5.3e+301))))))) {
tmp = t_2;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (1.0 + Math.exp((x * eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_3 = (1.0 + Math.exp(x)) / 2.0;
double tmp;
if (x <= -2e-282) {
tmp = (1.0 + Math.pow(Math.E, (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 8.5e-5) {
tmp = t_0;
} else if (x <= 0.19) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if (x <= 8.5e+38) {
tmp = t_0;
} else if (x <= 7.2e+39) {
tmp = 0.0;
} else if (x <= 4e+61) {
tmp = t_3;
} else if (x <= 1e+76) {
tmp = 0.0;
} else if (x <= 2.25e+77) {
tmp = t_1;
} else if (x <= 1.5e+80) {
tmp = 0.0;
} else if (x <= 1.35e+103) {
tmp = t_3;
} else if (x <= 7.5e+107) {
tmp = 0.0;
} else if (x <= 9e+107) {
tmp = t_2;
} else if (x <= 1e+110) {
tmp = 0.0;
} else if (x <= 5e+128) {
tmp = t_3;
} else if (x <= 3e+135) {
tmp = 0.0;
} else if (x <= 2.2e+142) {
tmp = t_3;
} else if (x <= 1e+143) {
tmp = 0.0;
} else if (x <= 1e+158) {
tmp = t_3;
} else if (x <= 1.35e+160) {
tmp = 0.0;
} else if (x <= 2.3e+169) {
tmp = t_1;
} else if (x <= 1.7e+173) {
tmp = 0.0;
} else if (x <= 1.3e+174) {
tmp = t_2;
} else if (x <= 3.5e+186) {
tmp = 0.0;
} else if (x <= 2.6e+187) {
tmp = t_2;
} else if (x <= 7e+191) {
tmp = 0.0;
} else if (x <= 3.8e+195) {
tmp = t_2;
} else if (x <= 3.4e+201) {
tmp = 0.0;
} else if (x <= 1.3e+206) {
tmp = t_2;
} else if (x <= 3.2e+206) {
tmp = 0.0;
} else if (x <= 5.8e+228) {
tmp = t_2;
} else if (x <= 2.15e+229) {
tmp = 0.0;
} else if (x <= 1.1e+235) {
tmp = t_3;
} else if (x <= 1.55e+236) {
tmp = 0.0;
} else if (x <= 2e+240) {
tmp = t_3;
} else if (x <= 4.3e+240) {
tmp = 0.0;
} else if ((x <= 2.55e+265) || (!(x <= 2.1e+274) && ((x <= 1.5e+281) || (!(x <= 1.25e+289) && ((x <= 7.8e+293) || (!(x <= 4.4e+294) && (x <= 5.3e+301))))))) {
tmp = t_2;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (1.0 + math.exp((x * eps_m))) / 2.0 t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_2 = (eps_m * (x + (2.0 / eps_m))) / 2.0 t_3 = (1.0 + math.exp(x)) / 2.0 tmp = 0 if x <= -2e-282: tmp = (1.0 + math.pow(math.e, (x * (1.0 - eps_m)))) / 2.0 elif x <= 8.5e-5: tmp = t_0 elif x <= 0.19: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 elif x <= 8.5e+38: tmp = t_0 elif x <= 7.2e+39: tmp = 0.0 elif x <= 4e+61: tmp = t_3 elif x <= 1e+76: tmp = 0.0 elif x <= 2.25e+77: tmp = t_1 elif x <= 1.5e+80: tmp = 0.0 elif x <= 1.35e+103: tmp = t_3 elif x <= 7.5e+107: tmp = 0.0 elif x <= 9e+107: tmp = t_2 elif x <= 1e+110: tmp = 0.0 elif x <= 5e+128: tmp = t_3 elif x <= 3e+135: tmp = 0.0 elif x <= 2.2e+142: tmp = t_3 elif x <= 1e+143: tmp = 0.0 elif x <= 1e+158: tmp = t_3 elif x <= 1.35e+160: tmp = 0.0 elif x <= 2.3e+169: tmp = t_1 elif x <= 1.7e+173: tmp = 0.0 elif x <= 1.3e+174: tmp = t_2 elif x <= 3.5e+186: tmp = 0.0 elif x <= 2.6e+187: tmp = t_2 elif x <= 7e+191: tmp = 0.0 elif x <= 3.8e+195: tmp = t_2 elif x <= 3.4e+201: tmp = 0.0 elif x <= 1.3e+206: tmp = t_2 elif x <= 3.2e+206: tmp = 0.0 elif x <= 5.8e+228: tmp = t_2 elif x <= 2.15e+229: tmp = 0.0 elif x <= 1.1e+235: tmp = t_3 elif x <= 1.55e+236: tmp = 0.0 elif x <= 2e+240: tmp = t_3 elif x <= 4.3e+240: tmp = 0.0 elif (x <= 2.55e+265) or (not (x <= 2.1e+274) and ((x <= 1.5e+281) or (not (x <= 1.25e+289) and ((x <= 7.8e+293) or (not (x <= 4.4e+294) and (x <= 5.3e+301)))))): tmp = t_2 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0) t_1 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_2 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) t_3 = Float64(Float64(1.0 + exp(x)) / 2.0) tmp = 0.0 if (x <= -2e-282) tmp = Float64(Float64(1.0 + (exp(1) ^ Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 0.19) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); elseif (x <= 8.5e+38) tmp = t_0; elseif (x <= 7.2e+39) tmp = 0.0; elseif (x <= 4e+61) tmp = t_3; elseif (x <= 1e+76) tmp = 0.0; elseif (x <= 2.25e+77) tmp = t_1; elseif (x <= 1.5e+80) tmp = 0.0; elseif (x <= 1.35e+103) tmp = t_3; elseif (x <= 7.5e+107) tmp = 0.0; elseif (x <= 9e+107) tmp = t_2; elseif (x <= 1e+110) tmp = 0.0; elseif (x <= 5e+128) tmp = t_3; elseif (x <= 3e+135) tmp = 0.0; elseif (x <= 2.2e+142) tmp = t_3; elseif (x <= 1e+143) tmp = 0.0; elseif (x <= 1e+158) tmp = t_3; elseif (x <= 1.35e+160) tmp = 0.0; elseif (x <= 2.3e+169) tmp = t_1; elseif (x <= 1.7e+173) tmp = 0.0; elseif (x <= 1.3e+174) tmp = t_2; elseif (x <= 3.5e+186) tmp = 0.0; elseif (x <= 2.6e+187) tmp = t_2; elseif (x <= 7e+191) tmp = 0.0; elseif (x <= 3.8e+195) tmp = t_2; elseif (x <= 3.4e+201) tmp = 0.0; elseif (x <= 1.3e+206) tmp = t_2; elseif (x <= 3.2e+206) tmp = 0.0; elseif (x <= 5.8e+228) tmp = t_2; elseif (x <= 2.15e+229) tmp = 0.0; elseif (x <= 1.1e+235) tmp = t_3; elseif (x <= 1.55e+236) tmp = 0.0; elseif (x <= 2e+240) tmp = t_3; elseif (x <= 4.3e+240) tmp = 0.0; elseif ((x <= 2.55e+265) || (!(x <= 2.1e+274) && ((x <= 1.5e+281) || (!(x <= 1.25e+289) && ((x <= 7.8e+293) || (!(x <= 4.4e+294) && (x <= 5.3e+301))))))) tmp = t_2; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (1.0 + exp((x * eps_m))) / 2.0; t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_2 = (eps_m * (x + (2.0 / eps_m))) / 2.0; t_3 = (1.0 + exp(x)) / 2.0; tmp = 0.0; if (x <= -2e-282) tmp = (1.0 + (2.71828182845904523536 ^ (x * (1.0 - eps_m)))) / 2.0; elseif (x <= 8.5e-5) tmp = t_0; elseif (x <= 0.19) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; elseif (x <= 8.5e+38) tmp = t_0; elseif (x <= 7.2e+39) tmp = 0.0; elseif (x <= 4e+61) tmp = t_3; elseif (x <= 1e+76) tmp = 0.0; elseif (x <= 2.25e+77) tmp = t_1; elseif (x <= 1.5e+80) tmp = 0.0; elseif (x <= 1.35e+103) tmp = t_3; elseif (x <= 7.5e+107) tmp = 0.0; elseif (x <= 9e+107) tmp = t_2; elseif (x <= 1e+110) tmp = 0.0; elseif (x <= 5e+128) tmp = t_3; elseif (x <= 3e+135) tmp = 0.0; elseif (x <= 2.2e+142) tmp = t_3; elseif (x <= 1e+143) tmp = 0.0; elseif (x <= 1e+158) tmp = t_3; elseif (x <= 1.35e+160) tmp = 0.0; elseif (x <= 2.3e+169) tmp = t_1; elseif (x <= 1.7e+173) tmp = 0.0; elseif (x <= 1.3e+174) tmp = t_2; elseif (x <= 3.5e+186) tmp = 0.0; elseif (x <= 2.6e+187) tmp = t_2; elseif (x <= 7e+191) tmp = 0.0; elseif (x <= 3.8e+195) tmp = t_2; elseif (x <= 3.4e+201) tmp = 0.0; elseif (x <= 1.3e+206) tmp = t_2; elseif (x <= 3.2e+206) tmp = 0.0; elseif (x <= 5.8e+228) tmp = t_2; elseif (x <= 2.15e+229) tmp = 0.0; elseif (x <= 1.1e+235) tmp = t_3; elseif (x <= 1.55e+236) tmp = 0.0; elseif (x <= 2e+240) tmp = t_3; elseif (x <= 4.3e+240) tmp = 0.0; elseif ((x <= 2.55e+265) || (~((x <= 2.1e+274)) && ((x <= 1.5e+281) || (~((x <= 1.25e+289)) && ((x <= 7.8e+293) || (~((x <= 4.4e+294)) && (x <= 5.3e+301))))))) tmp = t_2; 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[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2e-282], N[(N[(1.0 + N[Power[E, N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.5e-5], t$95$0, If[LessEqual[x, 0.19], 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], If[LessEqual[x, 8.5e+38], t$95$0, If[LessEqual[x, 7.2e+39], 0.0, If[LessEqual[x, 4e+61], t$95$3, If[LessEqual[x, 1e+76], 0.0, If[LessEqual[x, 2.25e+77], t$95$1, If[LessEqual[x, 1.5e+80], 0.0, If[LessEqual[x, 1.35e+103], t$95$3, If[LessEqual[x, 7.5e+107], 0.0, If[LessEqual[x, 9e+107], t$95$2, If[LessEqual[x, 1e+110], 0.0, If[LessEqual[x, 5e+128], t$95$3, If[LessEqual[x, 3e+135], 0.0, If[LessEqual[x, 2.2e+142], t$95$3, If[LessEqual[x, 1e+143], 0.0, If[LessEqual[x, 1e+158], t$95$3, If[LessEqual[x, 1.35e+160], 0.0, If[LessEqual[x, 2.3e+169], t$95$1, If[LessEqual[x, 1.7e+173], 0.0, If[LessEqual[x, 1.3e+174], t$95$2, If[LessEqual[x, 3.5e+186], 0.0, If[LessEqual[x, 2.6e+187], t$95$2, If[LessEqual[x, 7e+191], 0.0, If[LessEqual[x, 3.8e+195], t$95$2, If[LessEqual[x, 3.4e+201], 0.0, If[LessEqual[x, 1.3e+206], t$95$2, If[LessEqual[x, 3.2e+206], 0.0, If[LessEqual[x, 5.8e+228], t$95$2, If[LessEqual[x, 2.15e+229], 0.0, If[LessEqual[x, 1.1e+235], t$95$3, If[LessEqual[x, 1.55e+236], 0.0, If[LessEqual[x, 2e+240], t$95$3, If[LessEqual[x, 4.3e+240], 0.0, If[Or[LessEqual[x, 2.55e+265], And[N[Not[LessEqual[x, 2.1e+274]], $MachinePrecision], Or[LessEqual[x, 1.5e+281], And[N[Not[LessEqual[x, 1.25e+289]], $MachinePrecision], Or[LessEqual[x, 7.8e+293], And[N[Not[LessEqual[x, 4.4e+294]], $MachinePrecision], LessEqual[x, 5.3e+301]]]]]]], t$95$2, 0.0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{1 + e^{x \cdot eps\_m}}{2}\\
t_1 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_2 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
t_3 := \frac{1 + e^{x}}{2}\\
\mathbf{if}\;x \leq -2 \cdot 10^{-282}:\\
\;\;\;\;\frac{1 + {e}^{\left(x \cdot \left(1 - eps\_m\right)\right)}}{2}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.19:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+39}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+61}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 10^{+76}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+80}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+103}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+107}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+107}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 10^{+110}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+128}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+135}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+142}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 10^{+143}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 10^{+158}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+160}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+173}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+174}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+186}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+191}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+195}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+201}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+206}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+206}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+228}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+235}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+236}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+240}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+240}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{+265} \lor \neg \left(x \leq 2.1 \cdot 10^{+274}\right) \land \left(x \leq 1.5 \cdot 10^{+281} \lor \neg \left(x \leq 1.25 \cdot 10^{+289}\right) \land \left(x \leq 7.8 \cdot 10^{+293} \lor \neg \left(x \leq 4.4 \cdot 10^{+294}\right) \land x \leq 5.3 \cdot 10^{+301}\right)\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2e-282Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
*-commutative77.4%
*-un-lft-identity77.4%
exp-prod77.4%
e-exp-177.4%
*-commutative77.4%
Applied egg-rr77.4%
if -2e-282 < x < 8.500000000000001e-5 or 0.19 < x < 8.4999999999999997e38Initial program 55.0%
Simplified43.9%
Taylor expanded in eps around inf 99.5%
Taylor expanded in x around 0 88.4%
Taylor expanded in eps around inf 88.9%
*-commutative100.0%
Simplified88.9%
if 8.500000000000001e-5 < x < 0.19Initial program 3.1%
Simplified3.0%
Taylor expanded in eps around 0 3.1%
associate-+r+99.2%
mul-1-neg99.2%
sub-neg99.2%
+-inverses99.2%
associate-*r*99.2%
distribute-rgt-out99.2%
mul-1-neg99.2%
Simplified99.2%
if 8.4999999999999997e38 < x < 7.19999999999999969e39 or 3.9999999999999998e61 < x < 1e76 or 2.25000000000000012e77 < x < 1.49999999999999993e80 or 1.34999999999999996e103 < x < 7.4999999999999996e107 or 9e107 < x < 1e110 or 5e128 < x < 3e135 or 2.19999999999999987e142 < x < 1e143 or 9.99999999999999953e157 < x < 1.35e160 or 2.2999999999999999e169 < x < 1.70000000000000011e173 or 1.2999999999999999e174 < x < 3.49999999999999987e186 or 2.5999999999999999e187 < x < 6.9999999999999994e191 or 3.8e195 < x < 3.4e201 or 1.29999999999999994e206 < x < 3.20000000000000005e206 or 5.80000000000000003e228 < x < 2.14999999999999996e229 or 1.1e235 < x < 1.55e236 or 2.00000000000000003e240 < x < 4.3e240 or 2.55000000000000011e265 < x < 2.10000000000000016e274 or 1.50000000000000005e281 < x < 1.25000000000000008e289 or 7.80000000000000055e293 < x < 4.4000000000000002e294 or 5.3000000000000001e301 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
mul-1-neg100.0%
mul-1-neg100.0%
rec-exp100.0%
sub-neg100.0%
div-sub100.0%
mul-1-neg100.0%
rec-exp100.0%
+-inverses100.0%
Simplified100.0%
if 7.19999999999999969e39 < x < 3.9999999999999998e61 or 1.49999999999999993e80 < x < 1.34999999999999996e103 or 1e110 < x < 5e128 or 3e135 < x < 2.19999999999999987e142 or 1e143 < x < 9.99999999999999953e157 or 2.14999999999999996e229 < x < 1.1e235 or 1.55e236 < x < 2.00000000000000003e240Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 57.9%
sub-neg57.9%
metadata-eval57.9%
distribute-rgt-in57.9%
add-sqr-sqrt57.9%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod0.0%
add-sqr-sqrt45.2%
neg-mul-145.2%
*-un-lft-identity45.2%
distribute-rgt-in45.2%
+-commutative45.2%
*-commutative45.2%
distribute-rgt-neg-out45.2%
neg-sub045.2%
add-sqr-sqrt45.2%
sqrt-unprod45.2%
sqr-neg45.2%
sqrt-unprod0.0%
add-sqr-sqrt57.9%
*-commutative57.9%
+-commutative57.9%
distribute-rgt-in57.9%
Applied egg-rr45.2%
neg-sub045.2%
distribute-rgt-neg-in45.2%
+-commutative45.2%
distribute-neg-in45.2%
metadata-eval45.2%
sub-neg45.2%
Simplified45.2%
Taylor expanded in eps around 0 100.0%
if 1e76 < x < 2.25000000000000012e77 or 1.35e160 < x < 2.2999999999999999e169Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.1%
associate-*r*0.1%
neg-mul-10.1%
*-commutative0.1%
Simplified0.1%
Taylor expanded in eps around 0 0.0%
if 7.4999999999999996e107 < x < 9e107 or 1.70000000000000011e173 < x < 1.2999999999999999e174 or 3.49999999999999987e186 < x < 2.5999999999999999e187 or 6.9999999999999994e191 < x < 3.8e195 or 3.4e201 < x < 1.29999999999999994e206 or 3.20000000000000005e206 < x < 5.80000000000000003e228 or 4.3e240 < x < 2.55000000000000011e265 or 2.10000000000000016e274 < x < 1.50000000000000005e281 or 1.25000000000000008e289 < x < 7.80000000000000055e293 or 4.4000000000000002e294 < x < 5.3000000000000001e301Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 74.2%
Taylor expanded in x around 0 73.3%
associate-*r*73.3%
neg-mul-173.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in eps around inf 73.3%
associate-*r/73.3%
metadata-eval73.3%
Simplified73.3%
Final simplification85.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 7e-15) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (/ 1.0 (pow E (* x eps_m))) (exp (* x eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = ((1.0 / pow(((double) M_E), (x * eps_m))) + exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = ((1.0 / Math.pow(Math.E, (x * eps_m))) + Math.exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 7e-15: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = ((1.0 / math.pow(math.e, (x * eps_m))) + math.exp((x * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 7e-15) 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(Float64(1.0 / (exp(1) ^ Float64(x * eps_m))) + exp(Float64(x * 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 <= 7e-15) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = ((1.0 / (2.71828182845904523536 ^ (x * eps_m))) + 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, 7e-15], 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[(1.0 / N[Power[E, N[(x * eps$95$m), $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 7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{{e}^{\left(x \cdot eps\_m\right)}} + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if eps < 7.0000000000000001e-15Initial program 58.4%
Simplified51.5%
Taylor expanded in eps around 0 29.2%
associate-+r+71.1%
mul-1-neg71.1%
sub-neg71.1%
+-inverses71.1%
associate-*r*71.1%
distribute-rgt-out71.1%
mul-1-neg71.1%
Simplified71.1%
if 7.0000000000000001e-15 < eps Initial program 100.0%
Simplified90.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
exp-1-e100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x eps_m))))
(if (<= eps_m 7e-15)
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(/ (+ t_0 (/ 1.0 t_0)) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * eps_m));
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (t_0 + (1.0 / t_0)) / 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) :: t_0
real(8) :: tmp
t_0 = exp((x * eps_m))
if (eps_m <= 7d-15) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else
tmp = (t_0 + (1.0d0 / t_0)) / 2.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));
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (t_0 + (1.0 / t_0)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * eps_m)) tmp = 0 if eps_m <= 7e-15: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (t_0 + (1.0 / t_0)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * eps_m)) tmp = 0.0 if (eps_m <= 7e-15) 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(t_0 + Float64(1.0 / t_0)) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * eps_m)); tmp = 0.0; if (eps_m <= 7e-15) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (t_0 + (1.0 / t_0)) / 2.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 * eps$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eps$95$m, 7e-15], 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[(t$95$0 + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot eps\_m}\\
\mathbf{if}\;eps\_m \leq 7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 + \frac{1}{t\_0}}{2}\\
\end{array}
\end{array}
if eps < 7.0000000000000001e-15Initial program 58.4%
Simplified51.5%
Taylor expanded in eps around 0 29.2%
associate-+r+71.1%
mul-1-neg71.1%
sub-neg71.1%
+-inverses71.1%
associate-*r*71.1%
distribute-rgt-out71.1%
mul-1-neg71.1%
Simplified71.1%
if 7.0000000000000001e-15 < eps Initial program 100.0%
Simplified90.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* 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 (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (x * eps_m))))) / 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 = (exp((x * (eps_m + (-1.0d0)))) + (1.0d0 / exp((x + (x * eps_m))))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((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.exp((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(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 = (exp((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[Exp[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^{x \cdot \left(eps\_m + -1\right)} + \frac{1}{e^{x + x \cdot eps\_m}}}{2}
\end{array}
Initial program 73.5%
Simplified65.4%
Taylor expanded in eps around inf 99.2%
Final simplification99.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (* x (+ eps_m (/ -1.0 eps_m))))
(t_1 (/ (- 2.0 (* x eps_m)) 2.0))
(t_2 (/ (+ 2.0 t_0) 2.0))
(t_3 (/ (+ 1.0 (exp x)) 2.0))
(t_4 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0))
(t_5 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_6
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0)))
(if (<= eps_m 1.9e+107)
t_3
(if (<= eps_m 2.1e+179)
t_6
(if (<= eps_m 1.32e+181)
t_5
(if (<= eps_m 3.4e+181)
t_6
(if (<= eps_m 1.55e+184)
(/
(+
(* (+ 1.0 (/ 1.0 eps_m)) (+ 1.0 (* x (+ eps_m -1.0))))
(+ 1.0 (/ -1.0 eps_m)))
2.0)
(if (<= eps_m 1.1e+187)
t_5
(if (<= eps_m 3.5e+192)
t_6
(if (<= eps_m 9.6e+197)
t_5
(if (<= eps_m 1.65e+203)
t_6
(if (<= eps_m 2.65e+228)
t_5
(if (<= eps_m 2.7e+228)
t_1
(if (<= eps_m 6.2e+230)
t_4
(if (<= eps_m 9.2e+232)
t_6
(if (<= eps_m 1.4e+236)
t_5
(if (<= eps_m 1.45e+236)
t_1
(if (<= eps_m 2.05e+237)
t_5
(if (<= eps_m 3.3e+237)
t_4
(if (<= eps_m 5.9e+237)
(/ (- 2.0 t_0) 2.0)
(if (<= eps_m 6e+241)
t_2
(if (<= eps_m 1.5e+243)
t_5
(if (<= eps_m 3.2e+248)
t_3
(if (<= eps_m 3.25e+248)
t_1
(if (<= eps_m 1.5e+254)
t_2
(if (<= eps_m 5.2e+265)
t_6
(if (<= eps_m 1.3e+268)
t_5
(if (<= eps_m 2e+272)
t_6
(if (<= eps_m 5e+278)
t_5
(if (<=
eps_m
9.5e+279)
t_6
(if (<=
eps_m
2.3e+283)
t_4
(if (or (<=
eps_m
2e+295)
(not
(<=
eps_m
2.7e+299)))
t_6
t_5))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (eps_m + (-1.0 / eps_m));
double t_1 = (2.0 - (x * eps_m)) / 2.0;
double t_2 = (2.0 + t_0) / 2.0;
double t_3 = (1.0 + exp(x)) / 2.0;
double t_4 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_5 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_6 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double tmp;
if (eps_m <= 1.9e+107) {
tmp = t_3;
} else if (eps_m <= 2.1e+179) {
tmp = t_6;
} else if (eps_m <= 1.32e+181) {
tmp = t_5;
} else if (eps_m <= 3.4e+181) {
tmp = t_6;
} else if (eps_m <= 1.55e+184) {
tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0;
} else if (eps_m <= 1.1e+187) {
tmp = t_5;
} else if (eps_m <= 3.5e+192) {
tmp = t_6;
} else if (eps_m <= 9.6e+197) {
tmp = t_5;
} else if (eps_m <= 1.65e+203) {
tmp = t_6;
} else if (eps_m <= 2.65e+228) {
tmp = t_5;
} else if (eps_m <= 2.7e+228) {
tmp = t_1;
} else if (eps_m <= 6.2e+230) {
tmp = t_4;
} else if (eps_m <= 9.2e+232) {
tmp = t_6;
} else if (eps_m <= 1.4e+236) {
tmp = t_5;
} else if (eps_m <= 1.45e+236) {
tmp = t_1;
} else if (eps_m <= 2.05e+237) {
tmp = t_5;
} else if (eps_m <= 3.3e+237) {
tmp = t_4;
} else if (eps_m <= 5.9e+237) {
tmp = (2.0 - t_0) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_2;
} else if (eps_m <= 1.5e+243) {
tmp = t_5;
} else if (eps_m <= 3.2e+248) {
tmp = t_3;
} else if (eps_m <= 3.25e+248) {
tmp = t_1;
} else if (eps_m <= 1.5e+254) {
tmp = t_2;
} else if (eps_m <= 5.2e+265) {
tmp = t_6;
} else if (eps_m <= 1.3e+268) {
tmp = t_5;
} else if (eps_m <= 2e+272) {
tmp = t_6;
} else if (eps_m <= 5e+278) {
tmp = t_5;
} else if (eps_m <= 9.5e+279) {
tmp = t_6;
} else if (eps_m <= 2.3e+283) {
tmp = t_4;
} else if ((eps_m <= 2e+295) || !(eps_m <= 2.7e+299)) {
tmp = t_6;
} else {
tmp = t_5;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_0 = x * (eps_m + ((-1.0d0) / eps_m))
t_1 = (2.0d0 - (x * eps_m)) / 2.0d0
t_2 = (2.0d0 + t_0) / 2.0d0
t_3 = (1.0d0 + exp(x)) / 2.0d0
t_4 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
t_5 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
t_6 = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
if (eps_m <= 1.9d+107) then
tmp = t_3
else if (eps_m <= 2.1d+179) then
tmp = t_6
else if (eps_m <= 1.32d+181) then
tmp = t_5
else if (eps_m <= 3.4d+181) then
tmp = t_6
else if (eps_m <= 1.55d+184) then
tmp = (((1.0d0 + (1.0d0 / eps_m)) * (1.0d0 + (x * (eps_m + (-1.0d0))))) + (1.0d0 + ((-1.0d0) / eps_m))) / 2.0d0
else if (eps_m <= 1.1d+187) then
tmp = t_5
else if (eps_m <= 3.5d+192) then
tmp = t_6
else if (eps_m <= 9.6d+197) then
tmp = t_5
else if (eps_m <= 1.65d+203) then
tmp = t_6
else if (eps_m <= 2.65d+228) then
tmp = t_5
else if (eps_m <= 2.7d+228) then
tmp = t_1
else if (eps_m <= 6.2d+230) then
tmp = t_4
else if (eps_m <= 9.2d+232) then
tmp = t_6
else if (eps_m <= 1.4d+236) then
tmp = t_5
else if (eps_m <= 1.45d+236) then
tmp = t_1
else if (eps_m <= 2.05d+237) then
tmp = t_5
else if (eps_m <= 3.3d+237) then
tmp = t_4
else if (eps_m <= 5.9d+237) then
tmp = (2.0d0 - t_0) / 2.0d0
else if (eps_m <= 6d+241) then
tmp = t_2
else if (eps_m <= 1.5d+243) then
tmp = t_5
else if (eps_m <= 3.2d+248) then
tmp = t_3
else if (eps_m <= 3.25d+248) then
tmp = t_1
else if (eps_m <= 1.5d+254) then
tmp = t_2
else if (eps_m <= 5.2d+265) then
tmp = t_6
else if (eps_m <= 1.3d+268) then
tmp = t_5
else if (eps_m <= 2d+272) then
tmp = t_6
else if (eps_m <= 5d+278) then
tmp = t_5
else if (eps_m <= 9.5d+279) then
tmp = t_6
else if (eps_m <= 2.3d+283) then
tmp = t_4
else if ((eps_m <= 2d+295) .or. (.not. (eps_m <= 2.7d+299))) then
tmp = t_6
else
tmp = t_5
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (eps_m + (-1.0 / eps_m));
double t_1 = (2.0 - (x * eps_m)) / 2.0;
double t_2 = (2.0 + t_0) / 2.0;
double t_3 = (1.0 + Math.exp(x)) / 2.0;
double t_4 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_5 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_6 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double tmp;
if (eps_m <= 1.9e+107) {
tmp = t_3;
} else if (eps_m <= 2.1e+179) {
tmp = t_6;
} else if (eps_m <= 1.32e+181) {
tmp = t_5;
} else if (eps_m <= 3.4e+181) {
tmp = t_6;
} else if (eps_m <= 1.55e+184) {
tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0;
} else if (eps_m <= 1.1e+187) {
tmp = t_5;
} else if (eps_m <= 3.5e+192) {
tmp = t_6;
} else if (eps_m <= 9.6e+197) {
tmp = t_5;
} else if (eps_m <= 1.65e+203) {
tmp = t_6;
} else if (eps_m <= 2.65e+228) {
tmp = t_5;
} else if (eps_m <= 2.7e+228) {
tmp = t_1;
} else if (eps_m <= 6.2e+230) {
tmp = t_4;
} else if (eps_m <= 9.2e+232) {
tmp = t_6;
} else if (eps_m <= 1.4e+236) {
tmp = t_5;
} else if (eps_m <= 1.45e+236) {
tmp = t_1;
} else if (eps_m <= 2.05e+237) {
tmp = t_5;
} else if (eps_m <= 3.3e+237) {
tmp = t_4;
} else if (eps_m <= 5.9e+237) {
tmp = (2.0 - t_0) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_2;
} else if (eps_m <= 1.5e+243) {
tmp = t_5;
} else if (eps_m <= 3.2e+248) {
tmp = t_3;
} else if (eps_m <= 3.25e+248) {
tmp = t_1;
} else if (eps_m <= 1.5e+254) {
tmp = t_2;
} else if (eps_m <= 5.2e+265) {
tmp = t_6;
} else if (eps_m <= 1.3e+268) {
tmp = t_5;
} else if (eps_m <= 2e+272) {
tmp = t_6;
} else if (eps_m <= 5e+278) {
tmp = t_5;
} else if (eps_m <= 9.5e+279) {
tmp = t_6;
} else if (eps_m <= 2.3e+283) {
tmp = t_4;
} else if ((eps_m <= 2e+295) || !(eps_m <= 2.7e+299)) {
tmp = t_6;
} else {
tmp = t_5;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (eps_m + (-1.0 / eps_m)) t_1 = (2.0 - (x * eps_m)) / 2.0 t_2 = (2.0 + t_0) / 2.0 t_3 = (1.0 + math.exp(x)) / 2.0 t_4 = (eps_m * (x + (2.0 / eps_m))) / 2.0 t_5 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_6 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 tmp = 0 if eps_m <= 1.9e+107: tmp = t_3 elif eps_m <= 2.1e+179: tmp = t_6 elif eps_m <= 1.32e+181: tmp = t_5 elif eps_m <= 3.4e+181: tmp = t_6 elif eps_m <= 1.55e+184: tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0 elif eps_m <= 1.1e+187: tmp = t_5 elif eps_m <= 3.5e+192: tmp = t_6 elif eps_m <= 9.6e+197: tmp = t_5 elif eps_m <= 1.65e+203: tmp = t_6 elif eps_m <= 2.65e+228: tmp = t_5 elif eps_m <= 2.7e+228: tmp = t_1 elif eps_m <= 6.2e+230: tmp = t_4 elif eps_m <= 9.2e+232: tmp = t_6 elif eps_m <= 1.4e+236: tmp = t_5 elif eps_m <= 1.45e+236: tmp = t_1 elif eps_m <= 2.05e+237: tmp = t_5 elif eps_m <= 3.3e+237: tmp = t_4 elif eps_m <= 5.9e+237: tmp = (2.0 - t_0) / 2.0 elif eps_m <= 6e+241: tmp = t_2 elif eps_m <= 1.5e+243: tmp = t_5 elif eps_m <= 3.2e+248: tmp = t_3 elif eps_m <= 3.25e+248: tmp = t_1 elif eps_m <= 1.5e+254: tmp = t_2 elif eps_m <= 5.2e+265: tmp = t_6 elif eps_m <= 1.3e+268: tmp = t_5 elif eps_m <= 2e+272: tmp = t_6 elif eps_m <= 5e+278: tmp = t_5 elif eps_m <= 9.5e+279: tmp = t_6 elif eps_m <= 2.3e+283: tmp = t_4 elif (eps_m <= 2e+295) or not (eps_m <= 2.7e+299): tmp = t_6 else: tmp = t_5 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(eps_m + Float64(-1.0 / eps_m))) t_1 = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0) t_2 = Float64(Float64(2.0 + t_0) / 2.0) t_3 = Float64(Float64(1.0 + exp(x)) / 2.0) t_4 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) t_5 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_6 = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0) tmp = 0.0 if (eps_m <= 1.9e+107) tmp = t_3; elseif (eps_m <= 2.1e+179) tmp = t_6; elseif (eps_m <= 1.32e+181) tmp = t_5; elseif (eps_m <= 3.4e+181) tmp = t_6; elseif (eps_m <= 1.55e+184) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * Float64(1.0 + Float64(x * Float64(eps_m + -1.0)))) + Float64(1.0 + Float64(-1.0 / eps_m))) / 2.0); elseif (eps_m <= 1.1e+187) tmp = t_5; elseif (eps_m <= 3.5e+192) tmp = t_6; elseif (eps_m <= 9.6e+197) tmp = t_5; elseif (eps_m <= 1.65e+203) tmp = t_6; elseif (eps_m <= 2.65e+228) tmp = t_5; elseif (eps_m <= 2.7e+228) tmp = t_1; elseif (eps_m <= 6.2e+230) tmp = t_4; elseif (eps_m <= 9.2e+232) tmp = t_6; elseif (eps_m <= 1.4e+236) tmp = t_5; elseif (eps_m <= 1.45e+236) tmp = t_1; elseif (eps_m <= 2.05e+237) tmp = t_5; elseif (eps_m <= 3.3e+237) tmp = t_4; elseif (eps_m <= 5.9e+237) tmp = Float64(Float64(2.0 - t_0) / 2.0); elseif (eps_m <= 6e+241) tmp = t_2; elseif (eps_m <= 1.5e+243) tmp = t_5; elseif (eps_m <= 3.2e+248) tmp = t_3; elseif (eps_m <= 3.25e+248) tmp = t_1; elseif (eps_m <= 1.5e+254) tmp = t_2; elseif (eps_m <= 5.2e+265) tmp = t_6; elseif (eps_m <= 1.3e+268) tmp = t_5; elseif (eps_m <= 2e+272) tmp = t_6; elseif (eps_m <= 5e+278) tmp = t_5; elseif (eps_m <= 9.5e+279) tmp = t_6; elseif (eps_m <= 2.3e+283) tmp = t_4; elseif ((eps_m <= 2e+295) || !(eps_m <= 2.7e+299)) tmp = t_6; else tmp = t_5; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (eps_m + (-1.0 / eps_m)); t_1 = (2.0 - (x * eps_m)) / 2.0; t_2 = (2.0 + t_0) / 2.0; t_3 = (1.0 + exp(x)) / 2.0; t_4 = (eps_m * (x + (2.0 / eps_m))) / 2.0; t_5 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_6 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; tmp = 0.0; if (eps_m <= 1.9e+107) tmp = t_3; elseif (eps_m <= 2.1e+179) tmp = t_6; elseif (eps_m <= 1.32e+181) tmp = t_5; elseif (eps_m <= 3.4e+181) tmp = t_6; elseif (eps_m <= 1.55e+184) tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0; elseif (eps_m <= 1.1e+187) tmp = t_5; elseif (eps_m <= 3.5e+192) tmp = t_6; elseif (eps_m <= 9.6e+197) tmp = t_5; elseif (eps_m <= 1.65e+203) tmp = t_6; elseif (eps_m <= 2.65e+228) tmp = t_5; elseif (eps_m <= 2.7e+228) tmp = t_1; elseif (eps_m <= 6.2e+230) tmp = t_4; elseif (eps_m <= 9.2e+232) tmp = t_6; elseif (eps_m <= 1.4e+236) tmp = t_5; elseif (eps_m <= 1.45e+236) tmp = t_1; elseif (eps_m <= 2.05e+237) tmp = t_5; elseif (eps_m <= 3.3e+237) tmp = t_4; elseif (eps_m <= 5.9e+237) tmp = (2.0 - t_0) / 2.0; elseif (eps_m <= 6e+241) tmp = t_2; elseif (eps_m <= 1.5e+243) tmp = t_5; elseif (eps_m <= 3.2e+248) tmp = t_3; elseif (eps_m <= 3.25e+248) tmp = t_1; elseif (eps_m <= 1.5e+254) tmp = t_2; elseif (eps_m <= 5.2e+265) tmp = t_6; elseif (eps_m <= 1.3e+268) tmp = t_5; elseif (eps_m <= 2e+272) tmp = t_6; elseif (eps_m <= 5e+278) tmp = t_5; elseif (eps_m <= 9.5e+279) tmp = t_6; elseif (eps_m <= 2.3e+283) tmp = t_4; elseif ((eps_m <= 2e+295) || ~((eps_m <= 2.7e+299))) tmp = t_6; else tmp = t_5; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(eps$95$m + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$6 = N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[eps$95$m, 1.9e+107], t$95$3, If[LessEqual[eps$95$m, 2.1e+179], t$95$6, If[LessEqual[eps$95$m, 1.32e+181], t$95$5, If[LessEqual[eps$95$m, 3.4e+181], t$95$6, If[LessEqual[eps$95$m, 1.55e+184], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 1.1e+187], t$95$5, If[LessEqual[eps$95$m, 3.5e+192], t$95$6, If[LessEqual[eps$95$m, 9.6e+197], t$95$5, If[LessEqual[eps$95$m, 1.65e+203], t$95$6, If[LessEqual[eps$95$m, 2.65e+228], t$95$5, If[LessEqual[eps$95$m, 2.7e+228], t$95$1, If[LessEqual[eps$95$m, 6.2e+230], t$95$4, If[LessEqual[eps$95$m, 9.2e+232], t$95$6, If[LessEqual[eps$95$m, 1.4e+236], t$95$5, If[LessEqual[eps$95$m, 1.45e+236], t$95$1, If[LessEqual[eps$95$m, 2.05e+237], t$95$5, If[LessEqual[eps$95$m, 3.3e+237], t$95$4, If[LessEqual[eps$95$m, 5.9e+237], N[(N[(2.0 - t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 6e+241], t$95$2, If[LessEqual[eps$95$m, 1.5e+243], t$95$5, If[LessEqual[eps$95$m, 3.2e+248], t$95$3, If[LessEqual[eps$95$m, 3.25e+248], t$95$1, If[LessEqual[eps$95$m, 1.5e+254], t$95$2, If[LessEqual[eps$95$m, 5.2e+265], t$95$6, If[LessEqual[eps$95$m, 1.3e+268], t$95$5, If[LessEqual[eps$95$m, 2e+272], t$95$6, If[LessEqual[eps$95$m, 5e+278], t$95$5, If[LessEqual[eps$95$m, 9.5e+279], t$95$6, If[LessEqual[eps$95$m, 2.3e+283], t$95$4, If[Or[LessEqual[eps$95$m, 2e+295], N[Not[LessEqual[eps$95$m, 2.7e+299]], $MachinePrecision]], t$95$6, t$95$5]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(eps\_m + \frac{-1}{eps\_m}\right)\\
t_1 := \frac{2 - x \cdot eps\_m}{2}\\
t_2 := \frac{2 + t\_0}{2}\\
t_3 := \frac{1 + e^{x}}{2}\\
t_4 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
t_5 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_6 := \frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
\mathbf{if}\;eps\_m \leq 1.9 \cdot 10^{+107}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eps\_m \leq 2.1 \cdot 10^{+179}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 1.32 \cdot 10^{+181}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.4 \cdot 10^{+181}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 1.55 \cdot 10^{+184}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \left(1 + x \cdot \left(eps\_m + -1\right)\right) + \left(1 + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;eps\_m \leq 1.1 \cdot 10^{+187}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.5 \cdot 10^{+192}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 9.6 \cdot 10^{+197}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.65 \cdot 10^{+203}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 2.65 \cdot 10^{+228}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 2.7 \cdot 10^{+228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 6.2 \cdot 10^{+230}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 9.2 \cdot 10^{+232}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 1.4 \cdot 10^{+236}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 2.05 \cdot 10^{+237}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.3 \cdot 10^{+237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 5.9 \cdot 10^{+237}:\\
\;\;\;\;\frac{2 - t\_0}{2}\\
\mathbf{elif}\;eps\_m \leq 6 \cdot 10^{+241}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 1.5 \cdot 10^{+243}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.2 \cdot 10^{+248}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eps\_m \leq 3.25 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.5 \cdot 10^{+254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 5.2 \cdot 10^{+265}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 1.3 \cdot 10^{+268}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+272}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 5 \cdot 10^{+278}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 9.5 \cdot 10^{+279}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;eps\_m \leq 2.3 \cdot 10^{+283}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+295} \lor \neg \left(eps\_m \leq 2.7 \cdot 10^{+299}\right):\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if eps < 1.8999999999999999e107 or 1.49999999999999992e243 < eps < 3.19999999999999985e248Initial program 65.9%
Simplified59.4%
Taylor expanded in eps around inf 99.0%
Taylor expanded in x around 0 69.2%
sub-neg69.2%
metadata-eval69.2%
distribute-rgt-in69.2%
add-sqr-sqrt34.9%
sqrt-unprod60.4%
sqr-neg60.4%
sqrt-unprod25.4%
add-sqr-sqrt65.7%
neg-mul-165.7%
*-un-lft-identity65.7%
distribute-rgt-in65.7%
+-commutative65.7%
*-commutative65.7%
distribute-rgt-neg-out65.7%
neg-sub065.7%
add-sqr-sqrt40.2%
sqrt-unprod73.2%
sqr-neg73.2%
sqrt-unprod34.3%
add-sqr-sqrt69.0%
*-commutative69.0%
+-commutative69.0%
distribute-rgt-in69.0%
Applied egg-rr65.5%
neg-sub065.5%
distribute-rgt-neg-in65.5%
+-commutative65.5%
distribute-neg-in65.5%
metadata-eval65.5%
sub-neg65.5%
Simplified65.5%
Taylor expanded in eps around 0 65.8%
if 1.8999999999999999e107 < eps < 2.0999999999999999e179 or 1.31999999999999996e181 < eps < 3.40000000000000031e181 or 1.0999999999999999e187 < eps < 3.49999999999999983e192 or 9.5999999999999995e197 < eps < 1.64999999999999995e203 or 6.19999999999999963e230 < eps < 9.20000000000000024e232 or 1.50000000000000003e254 < eps < 5.2000000000000003e265 or 1.29999999999999997e268 < eps < 2.0000000000000001e272 or 5.00000000000000029e278 < eps < 9.4999999999999991e279 or 2.3000000000000002e283 < eps < 2e295 or 2.7e299 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 33.6%
Taylor expanded in x around 0 17.9%
associate-*r*17.9%
neg-mul-117.9%
*-commutative17.9%
Simplified17.9%
distribute-lft-in17.9%
*-rgt-identity17.9%
distribute-rgt-in17.9%
add-sqr-sqrt8.7%
sqrt-unprod17.5%
sqr-neg17.5%
sqrt-unprod8.6%
add-sqr-sqrt50.8%
un-div-inv50.8%
add-sqr-sqrt42.2%
sqrt-unprod24.6%
sqr-neg24.6%
sqrt-unprod8.6%
add-sqr-sqrt50.8%
Applied egg-rr50.8%
Taylor expanded in eps around 0 80.3%
associate-+r+80.3%
distribute-rgt1-in80.3%
metadata-eval80.3%
associate-*r*80.3%
neg-mul-180.3%
*-commutative80.3%
Simplified80.3%
if 2.0999999999999999e179 < eps < 1.31999999999999996e181 or 1.5499999999999999e184 < eps < 1.0999999999999999e187 or 3.49999999999999983e192 < eps < 9.5999999999999995e197 or 1.64999999999999995e203 < eps < 2.65e228 or 9.20000000000000024e232 < eps < 1.39999999999999996e236 or 1.45e236 < eps < 2.05000000000000001e237 or 6.00000000000000031e241 < eps < 1.49999999999999992e243 or 5.2000000000000003e265 < eps < 1.29999999999999997e268 or 2.0000000000000001e272 < eps < 5.00000000000000029e278 or 2e295 < eps < 2.7e299Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 63.8%
associate-*r*63.8%
neg-mul-163.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in eps around 0 100.0%
if 3.40000000000000031e181 < eps < 1.5499999999999999e184Initial program 73.5%
Simplified73.5%
Taylor expanded in x around 0 40.1%
Taylor expanded in x around 0 24.0%
if 2.65e228 < eps < 2.7000000000000002e228 or 1.39999999999999996e236 < eps < 1.45e236 or 3.19999999999999985e248 < eps < 3.25000000000000024e248Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.0%
associate-*r*0.0%
neg-mul-10.0%
*-commutative0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
distribute-rgt-in100.0%
Applied egg-rr100.0%
associate-*l/100.0%
*-lft-identity100.0%
distribute-rgt-out100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
associate-+l-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
Simplified100.0%
if 2.7000000000000002e228 < eps < 6.19999999999999963e230 or 2.05000000000000001e237 < eps < 3.3000000000000001e237 or 9.4999999999999991e279 < eps < 2.3000000000000002e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 67.8%
associate-*r*67.8%
neg-mul-167.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in eps around inf 67.8%
associate-*r/67.8%
metadata-eval67.8%
Simplified67.8%
if 3.3000000000000001e237 < eps < 5.8999999999999997e237Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.5%
associate-*r*0.5%
neg-mul-10.5%
*-commutative0.5%
Simplified0.5%
add-sqr-sqrt0.5%
sqrt-unprod3.1%
sqr-neg3.1%
sqrt-unprod0.0%
add-sqr-sqrt3.7%
distribute-rgt-in3.7%
*-un-lft-identity3.7%
distribute-rgt-in3.7%
Applied egg-rr3.7%
associate-*l/3.7%
*-lft-identity3.7%
distribute-rgt-out3.7%
+-commutative3.7%
associate-+r-3.7%
div-sub3.7%
*-inverses3.7%
associate-+l-3.7%
metadata-eval3.7%
Simplified3.7%
if 5.8999999999999997e237 < eps < 6.00000000000000031e241 or 3.25000000000000024e248 < eps < 1.50000000000000003e254Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 67.7%
mul-1-neg67.7%
distribute-rgt-neg-in67.7%
mul-1-neg67.7%
mul-1-neg67.7%
distribute-rgt-neg-in67.7%
neg-sub067.7%
associate--r-67.7%
metadata-eval67.7%
+-commutative67.7%
+-commutative67.7%
distribute-rgt1-in67.7%
+-commutative67.7%
distribute-rgt-in67.7%
neg-mul-167.7%
rgt-mult-inverse67.7%
associate-+l+67.7%
+-commutative67.7%
associate-+r+67.7%
metadata-eval67.7%
sub-neg67.7%
neg-sub067.7%
distribute-neg-frac67.7%
metadata-eval67.7%
Simplified67.7%
Final simplification69.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_1
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0))
(t_2 (/ (- 2.0 (* x eps_m)) 2.0))
(t_3 (* x (+ eps_m (/ -1.0 eps_m))))
(t_4 (/ (+ 2.0 t_3) 2.0))
(t_5 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)))
(if (<= eps_m 1.28e+64)
1.0
(if (<= eps_m 8.8e+144)
t_1
(if (<= eps_m 5e+153)
t_0
(if (<= eps_m 2.3e+165)
t_4
(if (<= eps_m 2e+179)
t_1
(if (<= eps_m 3.35e+180)
t_0
(if (<= eps_m 8.2e+183)
t_1
(if (<= eps_m 1.55e+184)
(/
(+
(* (+ 1.0 (/ 1.0 eps_m)) (+ 1.0 (* x (+ eps_m -1.0))))
(+ 1.0 (/ -1.0 eps_m)))
2.0)
(if (<= eps_m 8.5e+186)
t_0
(if (<= eps_m 2e+191)
t_1
(if (<= eps_m 1.9e+198)
t_0
(if (<= eps_m 2.8e+203)
t_1
(if (<= eps_m 2.65e+228)
t_0
(if (<= eps_m 3.2e+228)
t_2
(if (<= eps_m 2e+230)
t_5
(if (<= eps_m 2.9e+232)
t_1
(if (<= eps_m 1.35e+236)
t_0
(if (<= eps_m 1.45e+236)
t_2
(if (<= eps_m 2.05e+237)
t_0
(if (<= eps_m 5.8e+237)
t_5
(if (<= eps_m 6.3e+237)
(/ (- 2.0 t_3) 2.0)
(if (<= eps_m 6e+241)
t_4
(if (<= eps_m 6.1e+246)
t_0
(if (<= eps_m 6.2e+246)
1.0
(if (<= eps_m 3.25e+248)
t_2
(if (<= eps_m 4.9e+253)
t_4
(if (<= eps_m 3.2e+265)
t_1
(if (<=
eps_m
1.3e+268)
t_0
(if (<=
eps_m
4.8e+272)
t_1
(if (<=
eps_m
1.85e+278)
t_0
(if (<=
eps_m
1.4e+280)
t_1
(if (<=
eps_m
1.7e+283)
t_5
(if (or (<=
eps_m
3.6e+295)
(not
(<=
eps_m
1.45e+299)))
t_1
t_0)))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_1 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double t_2 = (2.0 - (x * eps_m)) / 2.0;
double t_3 = x * (eps_m + (-1.0 / eps_m));
double t_4 = (2.0 + t_3) / 2.0;
double t_5 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (eps_m <= 1.28e+64) {
tmp = 1.0;
} else if (eps_m <= 8.8e+144) {
tmp = t_1;
} else if (eps_m <= 5e+153) {
tmp = t_0;
} else if (eps_m <= 2.3e+165) {
tmp = t_4;
} else if (eps_m <= 2e+179) {
tmp = t_1;
} else if (eps_m <= 3.35e+180) {
tmp = t_0;
} else if (eps_m <= 8.2e+183) {
tmp = t_1;
} else if (eps_m <= 1.55e+184) {
tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0;
} else if (eps_m <= 8.5e+186) {
tmp = t_0;
} else if (eps_m <= 2e+191) {
tmp = t_1;
} else if (eps_m <= 1.9e+198) {
tmp = t_0;
} else if (eps_m <= 2.8e+203) {
tmp = t_1;
} else if (eps_m <= 2.65e+228) {
tmp = t_0;
} else if (eps_m <= 3.2e+228) {
tmp = t_2;
} else if (eps_m <= 2e+230) {
tmp = t_5;
} else if (eps_m <= 2.9e+232) {
tmp = t_1;
} else if (eps_m <= 1.35e+236) {
tmp = t_0;
} else if (eps_m <= 1.45e+236) {
tmp = t_2;
} else if (eps_m <= 2.05e+237) {
tmp = t_0;
} else if (eps_m <= 5.8e+237) {
tmp = t_5;
} else if (eps_m <= 6.3e+237) {
tmp = (2.0 - t_3) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_4;
} else if (eps_m <= 6.1e+246) {
tmp = t_0;
} else if (eps_m <= 6.2e+246) {
tmp = 1.0;
} else if (eps_m <= 3.25e+248) {
tmp = t_2;
} else if (eps_m <= 4.9e+253) {
tmp = t_4;
} else if (eps_m <= 3.2e+265) {
tmp = t_1;
} else if (eps_m <= 1.3e+268) {
tmp = t_0;
} else if (eps_m <= 4.8e+272) {
tmp = t_1;
} else if (eps_m <= 1.85e+278) {
tmp = t_0;
} else if (eps_m <= 1.4e+280) {
tmp = t_1;
} else if (eps_m <= 1.7e+283) {
tmp = t_5;
} else if ((eps_m <= 3.6e+295) || !(eps_m <= 1.45e+299)) {
tmp = t_1;
} else {
tmp = t_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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
t_1 = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
t_2 = (2.0d0 - (x * eps_m)) / 2.0d0
t_3 = x * (eps_m + ((-1.0d0) / eps_m))
t_4 = (2.0d0 + t_3) / 2.0d0
t_5 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
if (eps_m <= 1.28d+64) then
tmp = 1.0d0
else if (eps_m <= 8.8d+144) then
tmp = t_1
else if (eps_m <= 5d+153) then
tmp = t_0
else if (eps_m <= 2.3d+165) then
tmp = t_4
else if (eps_m <= 2d+179) then
tmp = t_1
else if (eps_m <= 3.35d+180) then
tmp = t_0
else if (eps_m <= 8.2d+183) then
tmp = t_1
else if (eps_m <= 1.55d+184) then
tmp = (((1.0d0 + (1.0d0 / eps_m)) * (1.0d0 + (x * (eps_m + (-1.0d0))))) + (1.0d0 + ((-1.0d0) / eps_m))) / 2.0d0
else if (eps_m <= 8.5d+186) then
tmp = t_0
else if (eps_m <= 2d+191) then
tmp = t_1
else if (eps_m <= 1.9d+198) then
tmp = t_0
else if (eps_m <= 2.8d+203) then
tmp = t_1
else if (eps_m <= 2.65d+228) then
tmp = t_0
else if (eps_m <= 3.2d+228) then
tmp = t_2
else if (eps_m <= 2d+230) then
tmp = t_5
else if (eps_m <= 2.9d+232) then
tmp = t_1
else if (eps_m <= 1.35d+236) then
tmp = t_0
else if (eps_m <= 1.45d+236) then
tmp = t_2
else if (eps_m <= 2.05d+237) then
tmp = t_0
else if (eps_m <= 5.8d+237) then
tmp = t_5
else if (eps_m <= 6.3d+237) then
tmp = (2.0d0 - t_3) / 2.0d0
else if (eps_m <= 6d+241) then
tmp = t_4
else if (eps_m <= 6.1d+246) then
tmp = t_0
else if (eps_m <= 6.2d+246) then
tmp = 1.0d0
else if (eps_m <= 3.25d+248) then
tmp = t_2
else if (eps_m <= 4.9d+253) then
tmp = t_4
else if (eps_m <= 3.2d+265) then
tmp = t_1
else if (eps_m <= 1.3d+268) then
tmp = t_0
else if (eps_m <= 4.8d+272) then
tmp = t_1
else if (eps_m <= 1.85d+278) then
tmp = t_0
else if (eps_m <= 1.4d+280) then
tmp = t_1
else if (eps_m <= 1.7d+283) then
tmp = t_5
else if ((eps_m <= 3.6d+295) .or. (.not. (eps_m <= 1.45d+299))) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_1 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double t_2 = (2.0 - (x * eps_m)) / 2.0;
double t_3 = x * (eps_m + (-1.0 / eps_m));
double t_4 = (2.0 + t_3) / 2.0;
double t_5 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double tmp;
if (eps_m <= 1.28e+64) {
tmp = 1.0;
} else if (eps_m <= 8.8e+144) {
tmp = t_1;
} else if (eps_m <= 5e+153) {
tmp = t_0;
} else if (eps_m <= 2.3e+165) {
tmp = t_4;
} else if (eps_m <= 2e+179) {
tmp = t_1;
} else if (eps_m <= 3.35e+180) {
tmp = t_0;
} else if (eps_m <= 8.2e+183) {
tmp = t_1;
} else if (eps_m <= 1.55e+184) {
tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0;
} else if (eps_m <= 8.5e+186) {
tmp = t_0;
} else if (eps_m <= 2e+191) {
tmp = t_1;
} else if (eps_m <= 1.9e+198) {
tmp = t_0;
} else if (eps_m <= 2.8e+203) {
tmp = t_1;
} else if (eps_m <= 2.65e+228) {
tmp = t_0;
} else if (eps_m <= 3.2e+228) {
tmp = t_2;
} else if (eps_m <= 2e+230) {
tmp = t_5;
} else if (eps_m <= 2.9e+232) {
tmp = t_1;
} else if (eps_m <= 1.35e+236) {
tmp = t_0;
} else if (eps_m <= 1.45e+236) {
tmp = t_2;
} else if (eps_m <= 2.05e+237) {
tmp = t_0;
} else if (eps_m <= 5.8e+237) {
tmp = t_5;
} else if (eps_m <= 6.3e+237) {
tmp = (2.0 - t_3) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_4;
} else if (eps_m <= 6.1e+246) {
tmp = t_0;
} else if (eps_m <= 6.2e+246) {
tmp = 1.0;
} else if (eps_m <= 3.25e+248) {
tmp = t_2;
} else if (eps_m <= 4.9e+253) {
tmp = t_4;
} else if (eps_m <= 3.2e+265) {
tmp = t_1;
} else if (eps_m <= 1.3e+268) {
tmp = t_0;
} else if (eps_m <= 4.8e+272) {
tmp = t_1;
} else if (eps_m <= 1.85e+278) {
tmp = t_0;
} else if (eps_m <= 1.4e+280) {
tmp = t_1;
} else if (eps_m <= 1.7e+283) {
tmp = t_5;
} else if ((eps_m <= 3.6e+295) || !(eps_m <= 1.45e+299)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_1 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 t_2 = (2.0 - (x * eps_m)) / 2.0 t_3 = x * (eps_m + (-1.0 / eps_m)) t_4 = (2.0 + t_3) / 2.0 t_5 = (eps_m * (x + (2.0 / eps_m))) / 2.0 tmp = 0 if eps_m <= 1.28e+64: tmp = 1.0 elif eps_m <= 8.8e+144: tmp = t_1 elif eps_m <= 5e+153: tmp = t_0 elif eps_m <= 2.3e+165: tmp = t_4 elif eps_m <= 2e+179: tmp = t_1 elif eps_m <= 3.35e+180: tmp = t_0 elif eps_m <= 8.2e+183: tmp = t_1 elif eps_m <= 1.55e+184: tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0 elif eps_m <= 8.5e+186: tmp = t_0 elif eps_m <= 2e+191: tmp = t_1 elif eps_m <= 1.9e+198: tmp = t_0 elif eps_m <= 2.8e+203: tmp = t_1 elif eps_m <= 2.65e+228: tmp = t_0 elif eps_m <= 3.2e+228: tmp = t_2 elif eps_m <= 2e+230: tmp = t_5 elif eps_m <= 2.9e+232: tmp = t_1 elif eps_m <= 1.35e+236: tmp = t_0 elif eps_m <= 1.45e+236: tmp = t_2 elif eps_m <= 2.05e+237: tmp = t_0 elif eps_m <= 5.8e+237: tmp = t_5 elif eps_m <= 6.3e+237: tmp = (2.0 - t_3) / 2.0 elif eps_m <= 6e+241: tmp = t_4 elif eps_m <= 6.1e+246: tmp = t_0 elif eps_m <= 6.2e+246: tmp = 1.0 elif eps_m <= 3.25e+248: tmp = t_2 elif eps_m <= 4.9e+253: tmp = t_4 elif eps_m <= 3.2e+265: tmp = t_1 elif eps_m <= 1.3e+268: tmp = t_0 elif eps_m <= 4.8e+272: tmp = t_1 elif eps_m <= 1.85e+278: tmp = t_0 elif eps_m <= 1.4e+280: tmp = t_1 elif eps_m <= 1.7e+283: tmp = t_5 elif (eps_m <= 3.6e+295) or not (eps_m <= 1.45e+299): tmp = t_1 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_1 = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0) t_2 = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0) t_3 = Float64(x * Float64(eps_m + Float64(-1.0 / eps_m))) t_4 = Float64(Float64(2.0 + t_3) / 2.0) t_5 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) tmp = 0.0 if (eps_m <= 1.28e+64) tmp = 1.0; elseif (eps_m <= 8.8e+144) tmp = t_1; elseif (eps_m <= 5e+153) tmp = t_0; elseif (eps_m <= 2.3e+165) tmp = t_4; elseif (eps_m <= 2e+179) tmp = t_1; elseif (eps_m <= 3.35e+180) tmp = t_0; elseif (eps_m <= 8.2e+183) tmp = t_1; elseif (eps_m <= 1.55e+184) tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * Float64(1.0 + Float64(x * Float64(eps_m + -1.0)))) + Float64(1.0 + Float64(-1.0 / eps_m))) / 2.0); elseif (eps_m <= 8.5e+186) tmp = t_0; elseif (eps_m <= 2e+191) tmp = t_1; elseif (eps_m <= 1.9e+198) tmp = t_0; elseif (eps_m <= 2.8e+203) tmp = t_1; elseif (eps_m <= 2.65e+228) tmp = t_0; elseif (eps_m <= 3.2e+228) tmp = t_2; elseif (eps_m <= 2e+230) tmp = t_5; elseif (eps_m <= 2.9e+232) tmp = t_1; elseif (eps_m <= 1.35e+236) tmp = t_0; elseif (eps_m <= 1.45e+236) tmp = t_2; elseif (eps_m <= 2.05e+237) tmp = t_0; elseif (eps_m <= 5.8e+237) tmp = t_5; elseif (eps_m <= 6.3e+237) tmp = Float64(Float64(2.0 - t_3) / 2.0); elseif (eps_m <= 6e+241) tmp = t_4; elseif (eps_m <= 6.1e+246) tmp = t_0; elseif (eps_m <= 6.2e+246) tmp = 1.0; elseif (eps_m <= 3.25e+248) tmp = t_2; elseif (eps_m <= 4.9e+253) tmp = t_4; elseif (eps_m <= 3.2e+265) tmp = t_1; elseif (eps_m <= 1.3e+268) tmp = t_0; elseif (eps_m <= 4.8e+272) tmp = t_1; elseif (eps_m <= 1.85e+278) tmp = t_0; elseif (eps_m <= 1.4e+280) tmp = t_1; elseif (eps_m <= 1.7e+283) tmp = t_5; elseif ((eps_m <= 3.6e+295) || !(eps_m <= 1.45e+299)) tmp = t_1; else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_1 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; t_2 = (2.0 - (x * eps_m)) / 2.0; t_3 = x * (eps_m + (-1.0 / eps_m)); t_4 = (2.0 + t_3) / 2.0; t_5 = (eps_m * (x + (2.0 / eps_m))) / 2.0; tmp = 0.0; if (eps_m <= 1.28e+64) tmp = 1.0; elseif (eps_m <= 8.8e+144) tmp = t_1; elseif (eps_m <= 5e+153) tmp = t_0; elseif (eps_m <= 2.3e+165) tmp = t_4; elseif (eps_m <= 2e+179) tmp = t_1; elseif (eps_m <= 3.35e+180) tmp = t_0; elseif (eps_m <= 8.2e+183) tmp = t_1; elseif (eps_m <= 1.55e+184) tmp = (((1.0 + (1.0 / eps_m)) * (1.0 + (x * (eps_m + -1.0)))) + (1.0 + (-1.0 / eps_m))) / 2.0; elseif (eps_m <= 8.5e+186) tmp = t_0; elseif (eps_m <= 2e+191) tmp = t_1; elseif (eps_m <= 1.9e+198) tmp = t_0; elseif (eps_m <= 2.8e+203) tmp = t_1; elseif (eps_m <= 2.65e+228) tmp = t_0; elseif (eps_m <= 3.2e+228) tmp = t_2; elseif (eps_m <= 2e+230) tmp = t_5; elseif (eps_m <= 2.9e+232) tmp = t_1; elseif (eps_m <= 1.35e+236) tmp = t_0; elseif (eps_m <= 1.45e+236) tmp = t_2; elseif (eps_m <= 2.05e+237) tmp = t_0; elseif (eps_m <= 5.8e+237) tmp = t_5; elseif (eps_m <= 6.3e+237) tmp = (2.0 - t_3) / 2.0; elseif (eps_m <= 6e+241) tmp = t_4; elseif (eps_m <= 6.1e+246) tmp = t_0; elseif (eps_m <= 6.2e+246) tmp = 1.0; elseif (eps_m <= 3.25e+248) tmp = t_2; elseif (eps_m <= 4.9e+253) tmp = t_4; elseif (eps_m <= 3.2e+265) tmp = t_1; elseif (eps_m <= 1.3e+268) tmp = t_0; elseif (eps_m <= 4.8e+272) tmp = t_1; elseif (eps_m <= 1.85e+278) tmp = t_0; elseif (eps_m <= 1.4e+280) tmp = t_1; elseif (eps_m <= 1.7e+283) tmp = t_5; elseif ((eps_m <= 3.6e+295) || ~((eps_m <= 1.45e+299))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(eps$95$m + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 + t$95$3), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[eps$95$m, 1.28e+64], 1.0, If[LessEqual[eps$95$m, 8.8e+144], t$95$1, If[LessEqual[eps$95$m, 5e+153], t$95$0, If[LessEqual[eps$95$m, 2.3e+165], t$95$4, If[LessEqual[eps$95$m, 2e+179], t$95$1, If[LessEqual[eps$95$m, 3.35e+180], t$95$0, If[LessEqual[eps$95$m, 8.2e+183], t$95$1, If[LessEqual[eps$95$m, 1.55e+184], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 8.5e+186], t$95$0, If[LessEqual[eps$95$m, 2e+191], t$95$1, If[LessEqual[eps$95$m, 1.9e+198], t$95$0, If[LessEqual[eps$95$m, 2.8e+203], t$95$1, If[LessEqual[eps$95$m, 2.65e+228], t$95$0, If[LessEqual[eps$95$m, 3.2e+228], t$95$2, If[LessEqual[eps$95$m, 2e+230], t$95$5, If[LessEqual[eps$95$m, 2.9e+232], t$95$1, If[LessEqual[eps$95$m, 1.35e+236], t$95$0, If[LessEqual[eps$95$m, 1.45e+236], t$95$2, If[LessEqual[eps$95$m, 2.05e+237], t$95$0, If[LessEqual[eps$95$m, 5.8e+237], t$95$5, If[LessEqual[eps$95$m, 6.3e+237], N[(N[(2.0 - t$95$3), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 6e+241], t$95$4, If[LessEqual[eps$95$m, 6.1e+246], t$95$0, If[LessEqual[eps$95$m, 6.2e+246], 1.0, If[LessEqual[eps$95$m, 3.25e+248], t$95$2, If[LessEqual[eps$95$m, 4.9e+253], t$95$4, If[LessEqual[eps$95$m, 3.2e+265], t$95$1, If[LessEqual[eps$95$m, 1.3e+268], t$95$0, If[LessEqual[eps$95$m, 4.8e+272], t$95$1, If[LessEqual[eps$95$m, 1.85e+278], t$95$0, If[LessEqual[eps$95$m, 1.4e+280], t$95$1, If[LessEqual[eps$95$m, 1.7e+283], t$95$5, If[Or[LessEqual[eps$95$m, 3.6e+295], N[Not[LessEqual[eps$95$m, 1.45e+299]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_1 := \frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
t_2 := \frac{2 - x \cdot eps\_m}{2}\\
t_3 := x \cdot \left(eps\_m + \frac{-1}{eps\_m}\right)\\
t_4 := \frac{2 + t\_3}{2}\\
t_5 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{if}\;eps\_m \leq 1.28 \cdot 10^{+64}:\\
\;\;\;\;1\\
\mathbf{elif}\;eps\_m \leq 8.8 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 5 \cdot 10^{+153}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 2.3 \cdot 10^{+165}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 3.35 \cdot 10^{+180}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 8.2 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.55 \cdot 10^{+184}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \left(1 + x \cdot \left(eps\_m + -1\right)\right) + \left(1 + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;eps\_m \leq 8.5 \cdot 10^{+186}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.9 \cdot 10^{+198}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 2.8 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 2.65 \cdot 10^{+228}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 3.2 \cdot 10^{+228}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+230}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 2.9 \cdot 10^{+232}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.35 \cdot 10^{+236}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2.05 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 5.8 \cdot 10^{+237}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 6.3 \cdot 10^{+237}:\\
\;\;\;\;\frac{2 - t\_3}{2}\\
\mathbf{elif}\;eps\_m \leq 6 \cdot 10^{+241}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 6.1 \cdot 10^{+246}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 6.2 \cdot 10^{+246}:\\
\;\;\;\;1\\
\mathbf{elif}\;eps\_m \leq 3.25 \cdot 10^{+248}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 4.9 \cdot 10^{+253}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 3.2 \cdot 10^{+265}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.3 \cdot 10^{+268}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 4.8 \cdot 10^{+272}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.85 \cdot 10^{+278}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.4 \cdot 10^{+280}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.7 \cdot 10^{+283}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.6 \cdot 10^{+295} \lor \neg \left(eps\_m \leq 1.45 \cdot 10^{+299}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if eps < 1.28000000000000004e64 or 6.10000000000000028e246 < eps < 6.19999999999999977e246Initial program 63.1%
Simplified63.1%
Taylor expanded in x around 0 54.2%
if 1.28000000000000004e64 < eps < 8.79999999999999952e144 or 2.30000000000000016e165 < eps < 1.99999999999999996e179 or 3.3499999999999999e180 < eps < 8.20000000000000029e183 or 8.4999999999999999e186 < eps < 2.00000000000000015e191 or 1.89999999999999994e198 < eps < 2.7999999999999999e203 or 2.0000000000000002e230 < eps < 2.90000000000000023e232 or 4.9000000000000001e253 < eps < 3.20000000000000014e265 or 1.29999999999999997e268 < eps < 4.8000000000000001e272 or 1.85000000000000011e278 < eps < 1.40000000000000001e280 or 1.7000000000000001e283 < eps < 3.59999999999999984e295 or 1.44999999999999996e299 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 36.9%
Taylor expanded in x around 0 17.2%
associate-*r*17.2%
neg-mul-117.2%
*-commutative17.2%
Simplified17.2%
distribute-lft-in17.2%
*-rgt-identity17.2%
distribute-rgt-in17.2%
add-sqr-sqrt2.4%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod11.7%
add-sqr-sqrt41.8%
un-div-inv41.8%
add-sqr-sqrt30.1%
sqrt-unprod20.5%
sqr-neg20.5%
sqrt-unprod11.7%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
Taylor expanded in eps around 0 68.0%
associate-+r+68.0%
distribute-rgt1-in68.0%
metadata-eval68.0%
associate-*r*68.0%
neg-mul-168.0%
*-commutative68.0%
Simplified68.0%
if 8.79999999999999952e144 < eps < 5.00000000000000018e153 or 1.99999999999999996e179 < eps < 3.3499999999999999e180 or 1.5499999999999999e184 < eps < 8.4999999999999999e186 or 2.00000000000000015e191 < eps < 1.89999999999999994e198 or 2.7999999999999999e203 < eps < 2.65e228 or 2.90000000000000023e232 < eps < 1.3500000000000001e236 or 1.45e236 < eps < 2.05000000000000001e237 or 6.00000000000000031e241 < eps < 6.10000000000000028e246 or 3.20000000000000014e265 < eps < 1.29999999999999997e268 or 4.8000000000000001e272 < eps < 1.85000000000000011e278 or 3.59999999999999984e295 < eps < 1.44999999999999996e299Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 66.7%
associate-*r*66.7%
neg-mul-166.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in eps around 0 100.0%
if 5.00000000000000018e153 < eps < 2.30000000000000016e165 or 6.30000000000000008e237 < eps < 6.00000000000000031e241 or 3.25000000000000024e248 < eps < 4.9000000000000001e253Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
mul-1-neg83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
neg-sub083.9%
associate--r-83.9%
metadata-eval83.9%
+-commutative83.9%
+-commutative83.9%
distribute-rgt1-in83.9%
+-commutative83.9%
distribute-rgt-in83.9%
neg-mul-183.9%
rgt-mult-inverse83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r+83.9%
metadata-eval83.9%
sub-neg83.9%
neg-sub083.9%
distribute-neg-frac83.9%
metadata-eval83.9%
Simplified83.9%
if 8.20000000000000029e183 < eps < 1.5499999999999999e184Initial program 73.5%
Simplified73.5%
Taylor expanded in x around 0 40.1%
Taylor expanded in x around 0 24.0%
if 2.65e228 < eps < 3.2000000000000003e228 or 1.3500000000000001e236 < eps < 1.45e236 or 6.19999999999999977e246 < eps < 3.25000000000000024e248Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.0%
associate-*r*0.0%
neg-mul-10.0%
*-commutative0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
distribute-rgt-in100.0%
Applied egg-rr100.0%
associate-*l/100.0%
*-lft-identity100.0%
distribute-rgt-out100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
associate-+l-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
Simplified100.0%
if 3.2000000000000003e228 < eps < 2.0000000000000002e230 or 2.05000000000000001e237 < eps < 5.8000000000000002e237 or 1.40000000000000001e280 < eps < 1.7000000000000001e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 67.8%
associate-*r*67.8%
neg-mul-167.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in eps around inf 67.8%
associate-*r/67.8%
metadata-eval67.8%
Simplified67.8%
if 5.8000000000000002e237 < eps < 6.30000000000000008e237Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.5%
associate-*r*0.5%
neg-mul-10.5%
*-commutative0.5%
Simplified0.5%
add-sqr-sqrt0.5%
sqrt-unprod3.1%
sqr-neg3.1%
sqrt-unprod0.0%
add-sqr-sqrt3.7%
distribute-rgt-in3.7%
*-un-lft-identity3.7%
distribute-rgt-in3.7%
Applied egg-rr3.7%
associate-*l/3.7%
*-lft-identity3.7%
distribute-rgt-out3.7%
+-commutative3.7%
associate-+r-3.7%
div-sub3.7%
*-inverses3.7%
associate-+l-3.7%
metadata-eval3.7%
Simplified3.7%
Final simplification60.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (- 2.0 (* x eps_m)) 2.0))
(t_1 (* x (+ eps_m (/ -1.0 eps_m))))
(t_2 (/ (+ 2.0 t_1) 2.0))
(t_3 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0))
(t_4 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_5
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0)))
(if (<= eps_m 2.7e+63)
1.0
(if (<= eps_m 1.2e+145)
t_5
(if (<= eps_m 1.9e+153)
t_4
(if (<= eps_m 3e+165)
t_2
(if (<= eps_m 2e+179)
t_5
(if (<= eps_m 1.55e+181)
t_4
(if (<= eps_m 2.5e+181)
t_5
(if (<= eps_m 7.4e+186)
t_4
(if (<= eps_m 4.2e+191)
t_5
(if (<= eps_m 3.2e+197)
t_4
(if (<= eps_m 1.9e+203)
t_5
(if (<= eps_m 2.65e+228)
t_4
(if (<= eps_m 2.7e+228)
t_0
(if (<= eps_m 6.1e+230)
t_3
(if (<= eps_m 4.1e+232)
t_5
(if (<= eps_m 1.1e+236)
t_4
(if (<= eps_m 1.45e+236)
t_0
(if (<= eps_m 1.55e+237)
t_4
(if (<= eps_m 3.3e+237)
t_3
(if (<= eps_m 5.9e+237)
(/ (- 2.0 t_1) 2.0)
(if (<= eps_m 6e+241)
t_2
(if (<= eps_m 6.1e+246)
t_4
(if (<= eps_m 6.8e+246)
1.0
(if (<= eps_m 5.2e+248)
t_0
(if (<= eps_m 1.5e+254)
t_2
(if (<= eps_m 4e+264)
t_5
(if (<= eps_m 1.42e+268)
t_4
(if (<=
eps_m
2.45e+272)
t_5
(if (<=
eps_m
5e+275)
t_4
(if (<=
eps_m
1.45e+280)
t_5
(if (<=
eps_m
1.45e+283)
t_3
(if (or (<=
eps_m
3.7e+295)
(not
(<=
eps_m
2e+299)))
t_5
t_4))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (2.0 - (x * eps_m)) / 2.0;
double t_1 = x * (eps_m + (-1.0 / eps_m));
double t_2 = (2.0 + t_1) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_4 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_5 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double tmp;
if (eps_m <= 2.7e+63) {
tmp = 1.0;
} else if (eps_m <= 1.2e+145) {
tmp = t_5;
} else if (eps_m <= 1.9e+153) {
tmp = t_4;
} else if (eps_m <= 3e+165) {
tmp = t_2;
} else if (eps_m <= 2e+179) {
tmp = t_5;
} else if (eps_m <= 1.55e+181) {
tmp = t_4;
} else if (eps_m <= 2.5e+181) {
tmp = t_5;
} else if (eps_m <= 7.4e+186) {
tmp = t_4;
} else if (eps_m <= 4.2e+191) {
tmp = t_5;
} else if (eps_m <= 3.2e+197) {
tmp = t_4;
} else if (eps_m <= 1.9e+203) {
tmp = t_5;
} else if (eps_m <= 2.65e+228) {
tmp = t_4;
} else if (eps_m <= 2.7e+228) {
tmp = t_0;
} else if (eps_m <= 6.1e+230) {
tmp = t_3;
} else if (eps_m <= 4.1e+232) {
tmp = t_5;
} else if (eps_m <= 1.1e+236) {
tmp = t_4;
} else if (eps_m <= 1.45e+236) {
tmp = t_0;
} else if (eps_m <= 1.55e+237) {
tmp = t_4;
} else if (eps_m <= 3.3e+237) {
tmp = t_3;
} else if (eps_m <= 5.9e+237) {
tmp = (2.0 - t_1) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_2;
} else if (eps_m <= 6.1e+246) {
tmp = t_4;
} else if (eps_m <= 6.8e+246) {
tmp = 1.0;
} else if (eps_m <= 5.2e+248) {
tmp = t_0;
} else if (eps_m <= 1.5e+254) {
tmp = t_2;
} else if (eps_m <= 4e+264) {
tmp = t_5;
} else if (eps_m <= 1.42e+268) {
tmp = t_4;
} else if (eps_m <= 2.45e+272) {
tmp = t_5;
} else if (eps_m <= 5e+275) {
tmp = t_4;
} else if (eps_m <= 1.45e+280) {
tmp = t_5;
} else if (eps_m <= 1.45e+283) {
tmp = t_3;
} else if ((eps_m <= 3.7e+295) || !(eps_m <= 2e+299)) {
tmp = t_5;
} else {
tmp = t_4;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (2.0d0 - (x * eps_m)) / 2.0d0
t_1 = x * (eps_m + ((-1.0d0) / eps_m))
t_2 = (2.0d0 + t_1) / 2.0d0
t_3 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
t_4 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
t_5 = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
if (eps_m <= 2.7d+63) then
tmp = 1.0d0
else if (eps_m <= 1.2d+145) then
tmp = t_5
else if (eps_m <= 1.9d+153) then
tmp = t_4
else if (eps_m <= 3d+165) then
tmp = t_2
else if (eps_m <= 2d+179) then
tmp = t_5
else if (eps_m <= 1.55d+181) then
tmp = t_4
else if (eps_m <= 2.5d+181) then
tmp = t_5
else if (eps_m <= 7.4d+186) then
tmp = t_4
else if (eps_m <= 4.2d+191) then
tmp = t_5
else if (eps_m <= 3.2d+197) then
tmp = t_4
else if (eps_m <= 1.9d+203) then
tmp = t_5
else if (eps_m <= 2.65d+228) then
tmp = t_4
else if (eps_m <= 2.7d+228) then
tmp = t_0
else if (eps_m <= 6.1d+230) then
tmp = t_3
else if (eps_m <= 4.1d+232) then
tmp = t_5
else if (eps_m <= 1.1d+236) then
tmp = t_4
else if (eps_m <= 1.45d+236) then
tmp = t_0
else if (eps_m <= 1.55d+237) then
tmp = t_4
else if (eps_m <= 3.3d+237) then
tmp = t_3
else if (eps_m <= 5.9d+237) then
tmp = (2.0d0 - t_1) / 2.0d0
else if (eps_m <= 6d+241) then
tmp = t_2
else if (eps_m <= 6.1d+246) then
tmp = t_4
else if (eps_m <= 6.8d+246) then
tmp = 1.0d0
else if (eps_m <= 5.2d+248) then
tmp = t_0
else if (eps_m <= 1.5d+254) then
tmp = t_2
else if (eps_m <= 4d+264) then
tmp = t_5
else if (eps_m <= 1.42d+268) then
tmp = t_4
else if (eps_m <= 2.45d+272) then
tmp = t_5
else if (eps_m <= 5d+275) then
tmp = t_4
else if (eps_m <= 1.45d+280) then
tmp = t_5
else if (eps_m <= 1.45d+283) then
tmp = t_3
else if ((eps_m <= 3.7d+295) .or. (.not. (eps_m <= 2d+299))) then
tmp = t_5
else
tmp = t_4
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (2.0 - (x * eps_m)) / 2.0;
double t_1 = x * (eps_m + (-1.0 / eps_m));
double t_2 = (2.0 + t_1) / 2.0;
double t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_4 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_5 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double tmp;
if (eps_m <= 2.7e+63) {
tmp = 1.0;
} else if (eps_m <= 1.2e+145) {
tmp = t_5;
} else if (eps_m <= 1.9e+153) {
tmp = t_4;
} else if (eps_m <= 3e+165) {
tmp = t_2;
} else if (eps_m <= 2e+179) {
tmp = t_5;
} else if (eps_m <= 1.55e+181) {
tmp = t_4;
} else if (eps_m <= 2.5e+181) {
tmp = t_5;
} else if (eps_m <= 7.4e+186) {
tmp = t_4;
} else if (eps_m <= 4.2e+191) {
tmp = t_5;
} else if (eps_m <= 3.2e+197) {
tmp = t_4;
} else if (eps_m <= 1.9e+203) {
tmp = t_5;
} else if (eps_m <= 2.65e+228) {
tmp = t_4;
} else if (eps_m <= 2.7e+228) {
tmp = t_0;
} else if (eps_m <= 6.1e+230) {
tmp = t_3;
} else if (eps_m <= 4.1e+232) {
tmp = t_5;
} else if (eps_m <= 1.1e+236) {
tmp = t_4;
} else if (eps_m <= 1.45e+236) {
tmp = t_0;
} else if (eps_m <= 1.55e+237) {
tmp = t_4;
} else if (eps_m <= 3.3e+237) {
tmp = t_3;
} else if (eps_m <= 5.9e+237) {
tmp = (2.0 - t_1) / 2.0;
} else if (eps_m <= 6e+241) {
tmp = t_2;
} else if (eps_m <= 6.1e+246) {
tmp = t_4;
} else if (eps_m <= 6.8e+246) {
tmp = 1.0;
} else if (eps_m <= 5.2e+248) {
tmp = t_0;
} else if (eps_m <= 1.5e+254) {
tmp = t_2;
} else if (eps_m <= 4e+264) {
tmp = t_5;
} else if (eps_m <= 1.42e+268) {
tmp = t_4;
} else if (eps_m <= 2.45e+272) {
tmp = t_5;
} else if (eps_m <= 5e+275) {
tmp = t_4;
} else if (eps_m <= 1.45e+280) {
tmp = t_5;
} else if (eps_m <= 1.45e+283) {
tmp = t_3;
} else if ((eps_m <= 3.7e+295) || !(eps_m <= 2e+299)) {
tmp = t_5;
} else {
tmp = t_4;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (2.0 - (x * eps_m)) / 2.0 t_1 = x * (eps_m + (-1.0 / eps_m)) t_2 = (2.0 + t_1) / 2.0 t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0 t_4 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_5 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 tmp = 0 if eps_m <= 2.7e+63: tmp = 1.0 elif eps_m <= 1.2e+145: tmp = t_5 elif eps_m <= 1.9e+153: tmp = t_4 elif eps_m <= 3e+165: tmp = t_2 elif eps_m <= 2e+179: tmp = t_5 elif eps_m <= 1.55e+181: tmp = t_4 elif eps_m <= 2.5e+181: tmp = t_5 elif eps_m <= 7.4e+186: tmp = t_4 elif eps_m <= 4.2e+191: tmp = t_5 elif eps_m <= 3.2e+197: tmp = t_4 elif eps_m <= 1.9e+203: tmp = t_5 elif eps_m <= 2.65e+228: tmp = t_4 elif eps_m <= 2.7e+228: tmp = t_0 elif eps_m <= 6.1e+230: tmp = t_3 elif eps_m <= 4.1e+232: tmp = t_5 elif eps_m <= 1.1e+236: tmp = t_4 elif eps_m <= 1.45e+236: tmp = t_0 elif eps_m <= 1.55e+237: tmp = t_4 elif eps_m <= 3.3e+237: tmp = t_3 elif eps_m <= 5.9e+237: tmp = (2.0 - t_1) / 2.0 elif eps_m <= 6e+241: tmp = t_2 elif eps_m <= 6.1e+246: tmp = t_4 elif eps_m <= 6.8e+246: tmp = 1.0 elif eps_m <= 5.2e+248: tmp = t_0 elif eps_m <= 1.5e+254: tmp = t_2 elif eps_m <= 4e+264: tmp = t_5 elif eps_m <= 1.42e+268: tmp = t_4 elif eps_m <= 2.45e+272: tmp = t_5 elif eps_m <= 5e+275: tmp = t_4 elif eps_m <= 1.45e+280: tmp = t_5 elif eps_m <= 1.45e+283: tmp = t_3 elif (eps_m <= 3.7e+295) or not (eps_m <= 2e+299): tmp = t_5 else: tmp = t_4 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0) t_1 = Float64(x * Float64(eps_m + Float64(-1.0 / eps_m))) t_2 = Float64(Float64(2.0 + t_1) / 2.0) t_3 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) t_4 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_5 = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0) tmp = 0.0 if (eps_m <= 2.7e+63) tmp = 1.0; elseif (eps_m <= 1.2e+145) tmp = t_5; elseif (eps_m <= 1.9e+153) tmp = t_4; elseif (eps_m <= 3e+165) tmp = t_2; elseif (eps_m <= 2e+179) tmp = t_5; elseif (eps_m <= 1.55e+181) tmp = t_4; elseif (eps_m <= 2.5e+181) tmp = t_5; elseif (eps_m <= 7.4e+186) tmp = t_4; elseif (eps_m <= 4.2e+191) tmp = t_5; elseif (eps_m <= 3.2e+197) tmp = t_4; elseif (eps_m <= 1.9e+203) tmp = t_5; elseif (eps_m <= 2.65e+228) tmp = t_4; elseif (eps_m <= 2.7e+228) tmp = t_0; elseif (eps_m <= 6.1e+230) tmp = t_3; elseif (eps_m <= 4.1e+232) tmp = t_5; elseif (eps_m <= 1.1e+236) tmp = t_4; elseif (eps_m <= 1.45e+236) tmp = t_0; elseif (eps_m <= 1.55e+237) tmp = t_4; elseif (eps_m <= 3.3e+237) tmp = t_3; elseif (eps_m <= 5.9e+237) tmp = Float64(Float64(2.0 - t_1) / 2.0); elseif (eps_m <= 6e+241) tmp = t_2; elseif (eps_m <= 6.1e+246) tmp = t_4; elseif (eps_m <= 6.8e+246) tmp = 1.0; elseif (eps_m <= 5.2e+248) tmp = t_0; elseif (eps_m <= 1.5e+254) tmp = t_2; elseif (eps_m <= 4e+264) tmp = t_5; elseif (eps_m <= 1.42e+268) tmp = t_4; elseif (eps_m <= 2.45e+272) tmp = t_5; elseif (eps_m <= 5e+275) tmp = t_4; elseif (eps_m <= 1.45e+280) tmp = t_5; elseif (eps_m <= 1.45e+283) tmp = t_3; elseif ((eps_m <= 3.7e+295) || !(eps_m <= 2e+299)) tmp = t_5; else tmp = t_4; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (2.0 - (x * eps_m)) / 2.0; t_1 = x * (eps_m + (-1.0 / eps_m)); t_2 = (2.0 + t_1) / 2.0; t_3 = (eps_m * (x + (2.0 / eps_m))) / 2.0; t_4 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_5 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; tmp = 0.0; if (eps_m <= 2.7e+63) tmp = 1.0; elseif (eps_m <= 1.2e+145) tmp = t_5; elseif (eps_m <= 1.9e+153) tmp = t_4; elseif (eps_m <= 3e+165) tmp = t_2; elseif (eps_m <= 2e+179) tmp = t_5; elseif (eps_m <= 1.55e+181) tmp = t_4; elseif (eps_m <= 2.5e+181) tmp = t_5; elseif (eps_m <= 7.4e+186) tmp = t_4; elseif (eps_m <= 4.2e+191) tmp = t_5; elseif (eps_m <= 3.2e+197) tmp = t_4; elseif (eps_m <= 1.9e+203) tmp = t_5; elseif (eps_m <= 2.65e+228) tmp = t_4; elseif (eps_m <= 2.7e+228) tmp = t_0; elseif (eps_m <= 6.1e+230) tmp = t_3; elseif (eps_m <= 4.1e+232) tmp = t_5; elseif (eps_m <= 1.1e+236) tmp = t_4; elseif (eps_m <= 1.45e+236) tmp = t_0; elseif (eps_m <= 1.55e+237) tmp = t_4; elseif (eps_m <= 3.3e+237) tmp = t_3; elseif (eps_m <= 5.9e+237) tmp = (2.0 - t_1) / 2.0; elseif (eps_m <= 6e+241) tmp = t_2; elseif (eps_m <= 6.1e+246) tmp = t_4; elseif (eps_m <= 6.8e+246) tmp = 1.0; elseif (eps_m <= 5.2e+248) tmp = t_0; elseif (eps_m <= 1.5e+254) tmp = t_2; elseif (eps_m <= 4e+264) tmp = t_5; elseif (eps_m <= 1.42e+268) tmp = t_4; elseif (eps_m <= 2.45e+272) tmp = t_5; elseif (eps_m <= 5e+275) tmp = t_4; elseif (eps_m <= 1.45e+280) tmp = t_5; elseif (eps_m <= 1.45e+283) tmp = t_3; elseif ((eps_m <= 3.7e+295) || ~((eps_m <= 2e+299))) tmp = t_5; else tmp = t_4; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(eps$95$m + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 + t$95$1), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[eps$95$m, 2.7e+63], 1.0, If[LessEqual[eps$95$m, 1.2e+145], t$95$5, If[LessEqual[eps$95$m, 1.9e+153], t$95$4, If[LessEqual[eps$95$m, 3e+165], t$95$2, If[LessEqual[eps$95$m, 2e+179], t$95$5, If[LessEqual[eps$95$m, 1.55e+181], t$95$4, If[LessEqual[eps$95$m, 2.5e+181], t$95$5, If[LessEqual[eps$95$m, 7.4e+186], t$95$4, If[LessEqual[eps$95$m, 4.2e+191], t$95$5, If[LessEqual[eps$95$m, 3.2e+197], t$95$4, If[LessEqual[eps$95$m, 1.9e+203], t$95$5, If[LessEqual[eps$95$m, 2.65e+228], t$95$4, If[LessEqual[eps$95$m, 2.7e+228], t$95$0, If[LessEqual[eps$95$m, 6.1e+230], t$95$3, If[LessEqual[eps$95$m, 4.1e+232], t$95$5, If[LessEqual[eps$95$m, 1.1e+236], t$95$4, If[LessEqual[eps$95$m, 1.45e+236], t$95$0, If[LessEqual[eps$95$m, 1.55e+237], t$95$4, If[LessEqual[eps$95$m, 3.3e+237], t$95$3, If[LessEqual[eps$95$m, 5.9e+237], N[(N[(2.0 - t$95$1), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 6e+241], t$95$2, If[LessEqual[eps$95$m, 6.1e+246], t$95$4, If[LessEqual[eps$95$m, 6.8e+246], 1.0, If[LessEqual[eps$95$m, 5.2e+248], t$95$0, If[LessEqual[eps$95$m, 1.5e+254], t$95$2, If[LessEqual[eps$95$m, 4e+264], t$95$5, If[LessEqual[eps$95$m, 1.42e+268], t$95$4, If[LessEqual[eps$95$m, 2.45e+272], t$95$5, If[LessEqual[eps$95$m, 5e+275], t$95$4, If[LessEqual[eps$95$m, 1.45e+280], t$95$5, If[LessEqual[eps$95$m, 1.45e+283], t$95$3, If[Or[LessEqual[eps$95$m, 3.7e+295], N[Not[LessEqual[eps$95$m, 2e+299]], $MachinePrecision]], t$95$5, t$95$4]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{2 - x \cdot eps\_m}{2}\\
t_1 := x \cdot \left(eps\_m + \frac{-1}{eps\_m}\right)\\
t_2 := \frac{2 + t\_1}{2}\\
t_3 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
t_4 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_5 := \frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
\mathbf{if}\;eps\_m \leq 2.7 \cdot 10^{+63}:\\
\;\;\;\;1\\
\mathbf{elif}\;eps\_m \leq 1.2 \cdot 10^{+145}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.9 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 3 \cdot 10^{+165}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+179}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.55 \cdot 10^{+181}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2.5 \cdot 10^{+181}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 7.4 \cdot 10^{+186}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 4.2 \cdot 10^{+191}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 3.2 \cdot 10^{+197}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 1.9 \cdot 10^{+203}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 2.65 \cdot 10^{+228}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2.7 \cdot 10^{+228}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 6.1 \cdot 10^{+230}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eps\_m \leq 4.1 \cdot 10^{+232}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.1 \cdot 10^{+236}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.55 \cdot 10^{+237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 3.3 \cdot 10^{+237}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eps\_m \leq 5.9 \cdot 10^{+237}:\\
\;\;\;\;\frac{2 - t\_1}{2}\\
\mathbf{elif}\;eps\_m \leq 6 \cdot 10^{+241}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 6.1 \cdot 10^{+246}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 6.8 \cdot 10^{+246}:\\
\;\;\;\;1\\
\mathbf{elif}\;eps\_m \leq 5.2 \cdot 10^{+248}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.5 \cdot 10^{+254}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.42 \cdot 10^{+268}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2.45 \cdot 10^{+272}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 5 \cdot 10^{+275}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+280}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+283}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;eps\_m \leq 3.7 \cdot 10^{+295} \lor \neg \left(eps\_m \leq 2 \cdot 10^{+299}\right):\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if eps < 2.70000000000000017e63 or 6.10000000000000028e246 < eps < 6.79999999999999977e246Initial program 63.1%
Simplified63.1%
Taylor expanded in x around 0 54.2%
if 2.70000000000000017e63 < eps < 1.19999999999999996e145 or 2.9999999999999999e165 < eps < 1.99999999999999996e179 or 1.54999999999999995e181 < eps < 2.5000000000000002e181 or 7.4e186 < eps < 4.2000000000000001e191 or 3.1999999999999998e197 < eps < 1.90000000000000012e203 or 6.0999999999999999e230 < eps < 4.10000000000000002e232 or 1.50000000000000003e254 < eps < 4.00000000000000018e264 or 1.4200000000000001e268 < eps < 2.4500000000000001e272 or 5.0000000000000003e275 < eps < 1.44999999999999993e280 or 1.4499999999999999e283 < eps < 3.7000000000000002e295 or 2.0000000000000001e299 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 36.9%
Taylor expanded in x around 0 17.2%
associate-*r*17.2%
neg-mul-117.2%
*-commutative17.2%
Simplified17.2%
distribute-lft-in17.2%
*-rgt-identity17.2%
distribute-rgt-in17.2%
add-sqr-sqrt2.4%
sqrt-unprod14.3%
sqr-neg14.3%
sqrt-unprod11.7%
add-sqr-sqrt41.8%
un-div-inv41.8%
add-sqr-sqrt30.1%
sqrt-unprod20.5%
sqr-neg20.5%
sqrt-unprod11.7%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
Taylor expanded in eps around 0 68.0%
associate-+r+68.0%
distribute-rgt1-in68.0%
metadata-eval68.0%
associate-*r*68.0%
neg-mul-168.0%
*-commutative68.0%
Simplified68.0%
if 1.19999999999999996e145 < eps < 1.89999999999999983e153 or 1.99999999999999996e179 < eps < 1.54999999999999995e181 or 2.5000000000000002e181 < eps < 7.4e186 or 4.2000000000000001e191 < eps < 3.1999999999999998e197 or 1.90000000000000012e203 < eps < 2.65e228 or 4.10000000000000002e232 < eps < 1.09999999999999989e236 or 1.45e236 < eps < 1.54999999999999995e237 or 6.00000000000000031e241 < eps < 6.10000000000000028e246 or 4.00000000000000018e264 < eps < 1.4200000000000001e268 or 2.4500000000000001e272 < eps < 5.0000000000000003e275 or 3.7000000000000002e295 < eps < 2.0000000000000001e299Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 66.7%
associate-*r*66.7%
neg-mul-166.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in eps around 0 100.0%
if 1.89999999999999983e153 < eps < 2.9999999999999999e165 or 5.8999999999999997e237 < eps < 6.00000000000000031e241 or 5.20000000000000019e248 < eps < 1.50000000000000003e254Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
mul-1-neg83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
neg-sub083.9%
associate--r-83.9%
metadata-eval83.9%
+-commutative83.9%
+-commutative83.9%
distribute-rgt1-in83.9%
+-commutative83.9%
distribute-rgt-in83.9%
neg-mul-183.9%
rgt-mult-inverse83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r+83.9%
metadata-eval83.9%
sub-neg83.9%
neg-sub083.9%
distribute-neg-frac83.9%
metadata-eval83.9%
Simplified83.9%
if 2.65e228 < eps < 2.7000000000000002e228 or 1.09999999999999989e236 < eps < 1.45e236 or 6.79999999999999977e246 < eps < 5.20000000000000019e248Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.0%
associate-*r*0.0%
neg-mul-10.0%
*-commutative0.0%
Simplified0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
distribute-rgt-in100.0%
Applied egg-rr100.0%
associate-*l/100.0%
*-lft-identity100.0%
distribute-rgt-out100.0%
+-commutative100.0%
associate-+r-100.0%
div-sub100.0%
*-inverses100.0%
associate-+l-100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
Simplified100.0%
if 2.7000000000000002e228 < eps < 6.0999999999999999e230 or 1.54999999999999995e237 < eps < 3.3000000000000001e237 or 1.44999999999999993e280 < eps < 1.4499999999999999e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 67.8%
associate-*r*67.8%
neg-mul-167.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in eps around inf 67.8%
associate-*r/67.8%
metadata-eval67.8%
Simplified67.8%
if 3.3000000000000001e237 < eps < 5.8999999999999997e237Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.5%
associate-*r*0.5%
neg-mul-10.5%
*-commutative0.5%
Simplified0.5%
add-sqr-sqrt0.5%
sqrt-unprod3.1%
sqr-neg3.1%
sqrt-unprod0.0%
add-sqr-sqrt3.7%
distribute-rgt-in3.7%
*-un-lft-identity3.7%
distribute-rgt-in3.7%
Applied egg-rr3.7%
associate-*l/3.7%
*-lft-identity3.7%
distribute-rgt-out3.7%
+-commutative3.7%
associate-+r-3.7%
div-sub3.7%
*-inverses3.7%
associate-+l-3.7%
metadata-eval3.7%
Simplified3.7%
Final simplification60.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0))
(t_1 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0))
(t_2 (/ (- 2.0 (* x eps_m)) 2.0))
(t_3 (* x (+ eps_m (/ -1.0 eps_m))))
(t_4 (/ (- 2.0 t_3) 2.0))
(t_5 (/ (+ 2.0 t_3) 2.0)))
(if (<= eps_m 8.2e+68)
(/ (+ 2.0 (- (* x (- 1.0 eps_m)) x)) 2.0)
(if (<= eps_m 9e+153)
t_1
(if (<= eps_m 1.4e+166)
t_5
(if (<= eps_m 2e+179)
t_2
(if (<= eps_m 1.55e+181)
t_1
(if (<= eps_m 1.58e+181)
t_2
(if (<= eps_m 1.15e+187)
t_1
(if (<= eps_m 2e+191)
t_2
(if (<= eps_m 5e+197)
t_1
(if (<= eps_m 1.65e+203)
t_2
(if (<= eps_m 2.65e+228)
t_1
(if (<= eps_m 4.3e+228)
t_2
(if (<= eps_m 2.75e+230)
t_0
(if (<= eps_m 2.9e+232)
t_4
(if (<= eps_m 1.4e+236)
t_1
(if (<= eps_m 1.45e+236)
t_2
(if (<= eps_m 2.05e+237)
t_1
(if (<= eps_m 5.8e+237)
t_0
(if (<= eps_m 5.9e+237)
t_4
(if (<= eps_m 6e+241)
t_5
(if (<= eps_m 6.1e+246)
t_1
(if (<= eps_m 8e+246)
1.0
(if (<= eps_m 3.25e+248)
t_2
(if (<= eps_m 6.5e+254)
t_5
(if (<= eps_m 4e+264)
t_2
(if (<= eps_m 1.45e+268)
t_1
(if (<= eps_m 2e+268)
t_2
(if (<=
eps_m
1.05e+272)
t_4
(if (<=
eps_m
1.45e+279)
t_1
(if (<=
eps_m
4.8e+279)
t_4
(if (<=
eps_m
2.5e+283)
t_0
(if (<=
eps_m
1.4e+295)
t_4
(if (<=
eps_m
2.7e+299)
t_1
t_2)))))))))))))))))))))))))))))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (2.0 - (x * eps_m)) / 2.0;
double t_3 = x * (eps_m + (-1.0 / eps_m));
double t_4 = (2.0 - t_3) / 2.0;
double t_5 = (2.0 + t_3) / 2.0;
double tmp;
if (eps_m <= 8.2e+68) {
tmp = (2.0 + ((x * (1.0 - eps_m)) - x)) / 2.0;
} else if (eps_m <= 9e+153) {
tmp = t_1;
} else if (eps_m <= 1.4e+166) {
tmp = t_5;
} else if (eps_m <= 2e+179) {
tmp = t_2;
} else if (eps_m <= 1.55e+181) {
tmp = t_1;
} else if (eps_m <= 1.58e+181) {
tmp = t_2;
} else if (eps_m <= 1.15e+187) {
tmp = t_1;
} else if (eps_m <= 2e+191) {
tmp = t_2;
} else if (eps_m <= 5e+197) {
tmp = t_1;
} else if (eps_m <= 1.65e+203) {
tmp = t_2;
} else if (eps_m <= 2.65e+228) {
tmp = t_1;
} else if (eps_m <= 4.3e+228) {
tmp = t_2;
} else if (eps_m <= 2.75e+230) {
tmp = t_0;
} else if (eps_m <= 2.9e+232) {
tmp = t_4;
} else if (eps_m <= 1.4e+236) {
tmp = t_1;
} else if (eps_m <= 1.45e+236) {
tmp = t_2;
} else if (eps_m <= 2.05e+237) {
tmp = t_1;
} else if (eps_m <= 5.8e+237) {
tmp = t_0;
} else if (eps_m <= 5.9e+237) {
tmp = t_4;
} else if (eps_m <= 6e+241) {
tmp = t_5;
} else if (eps_m <= 6.1e+246) {
tmp = t_1;
} else if (eps_m <= 8e+246) {
tmp = 1.0;
} else if (eps_m <= 3.25e+248) {
tmp = t_2;
} else if (eps_m <= 6.5e+254) {
tmp = t_5;
} else if (eps_m <= 4e+264) {
tmp = t_2;
} else if (eps_m <= 1.45e+268) {
tmp = t_1;
} else if (eps_m <= 2e+268) {
tmp = t_2;
} else if (eps_m <= 1.05e+272) {
tmp = t_4;
} else if (eps_m <= 1.45e+279) {
tmp = t_1;
} else if (eps_m <= 4.8e+279) {
tmp = t_4;
} else if (eps_m <= 2.5e+283) {
tmp = t_0;
} else if (eps_m <= 1.4e+295) {
tmp = t_4;
} else if (eps_m <= 2.7e+299) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
t_1 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
t_2 = (2.0d0 - (x * eps_m)) / 2.0d0
t_3 = x * (eps_m + ((-1.0d0) / eps_m))
t_4 = (2.0d0 - t_3) / 2.0d0
t_5 = (2.0d0 + t_3) / 2.0d0
if (eps_m <= 8.2d+68) then
tmp = (2.0d0 + ((x * (1.0d0 - eps_m)) - x)) / 2.0d0
else if (eps_m <= 9d+153) then
tmp = t_1
else if (eps_m <= 1.4d+166) then
tmp = t_5
else if (eps_m <= 2d+179) then
tmp = t_2
else if (eps_m <= 1.55d+181) then
tmp = t_1
else if (eps_m <= 1.58d+181) then
tmp = t_2
else if (eps_m <= 1.15d+187) then
tmp = t_1
else if (eps_m <= 2d+191) then
tmp = t_2
else if (eps_m <= 5d+197) then
tmp = t_1
else if (eps_m <= 1.65d+203) then
tmp = t_2
else if (eps_m <= 2.65d+228) then
tmp = t_1
else if (eps_m <= 4.3d+228) then
tmp = t_2
else if (eps_m <= 2.75d+230) then
tmp = t_0
else if (eps_m <= 2.9d+232) then
tmp = t_4
else if (eps_m <= 1.4d+236) then
tmp = t_1
else if (eps_m <= 1.45d+236) then
tmp = t_2
else if (eps_m <= 2.05d+237) then
tmp = t_1
else if (eps_m <= 5.8d+237) then
tmp = t_0
else if (eps_m <= 5.9d+237) then
tmp = t_4
else if (eps_m <= 6d+241) then
tmp = t_5
else if (eps_m <= 6.1d+246) then
tmp = t_1
else if (eps_m <= 8d+246) then
tmp = 1.0d0
else if (eps_m <= 3.25d+248) then
tmp = t_2
else if (eps_m <= 6.5d+254) then
tmp = t_5
else if (eps_m <= 4d+264) then
tmp = t_2
else if (eps_m <= 1.45d+268) then
tmp = t_1
else if (eps_m <= 2d+268) then
tmp = t_2
else if (eps_m <= 1.05d+272) then
tmp = t_4
else if (eps_m <= 1.45d+279) then
tmp = t_1
else if (eps_m <= 4.8d+279) then
tmp = t_4
else if (eps_m <= 2.5d+283) then
tmp = t_0
else if (eps_m <= 1.4d+295) then
tmp = t_4
else if (eps_m <= 2.7d+299) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (eps_m * (x + (2.0 / eps_m))) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double t_2 = (2.0 - (x * eps_m)) / 2.0;
double t_3 = x * (eps_m + (-1.0 / eps_m));
double t_4 = (2.0 - t_3) / 2.0;
double t_5 = (2.0 + t_3) / 2.0;
double tmp;
if (eps_m <= 8.2e+68) {
tmp = (2.0 + ((x * (1.0 - eps_m)) - x)) / 2.0;
} else if (eps_m <= 9e+153) {
tmp = t_1;
} else if (eps_m <= 1.4e+166) {
tmp = t_5;
} else if (eps_m <= 2e+179) {
tmp = t_2;
} else if (eps_m <= 1.55e+181) {
tmp = t_1;
} else if (eps_m <= 1.58e+181) {
tmp = t_2;
} else if (eps_m <= 1.15e+187) {
tmp = t_1;
} else if (eps_m <= 2e+191) {
tmp = t_2;
} else if (eps_m <= 5e+197) {
tmp = t_1;
} else if (eps_m <= 1.65e+203) {
tmp = t_2;
} else if (eps_m <= 2.65e+228) {
tmp = t_1;
} else if (eps_m <= 4.3e+228) {
tmp = t_2;
} else if (eps_m <= 2.75e+230) {
tmp = t_0;
} else if (eps_m <= 2.9e+232) {
tmp = t_4;
} else if (eps_m <= 1.4e+236) {
tmp = t_1;
} else if (eps_m <= 1.45e+236) {
tmp = t_2;
} else if (eps_m <= 2.05e+237) {
tmp = t_1;
} else if (eps_m <= 5.8e+237) {
tmp = t_0;
} else if (eps_m <= 5.9e+237) {
tmp = t_4;
} else if (eps_m <= 6e+241) {
tmp = t_5;
} else if (eps_m <= 6.1e+246) {
tmp = t_1;
} else if (eps_m <= 8e+246) {
tmp = 1.0;
} else if (eps_m <= 3.25e+248) {
tmp = t_2;
} else if (eps_m <= 6.5e+254) {
tmp = t_5;
} else if (eps_m <= 4e+264) {
tmp = t_2;
} else if (eps_m <= 1.45e+268) {
tmp = t_1;
} else if (eps_m <= 2e+268) {
tmp = t_2;
} else if (eps_m <= 1.05e+272) {
tmp = t_4;
} else if (eps_m <= 1.45e+279) {
tmp = t_1;
} else if (eps_m <= 4.8e+279) {
tmp = t_4;
} else if (eps_m <= 2.5e+283) {
tmp = t_0;
} else if (eps_m <= 1.4e+295) {
tmp = t_4;
} else if (eps_m <= 2.7e+299) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (eps_m * (x + (2.0 / eps_m))) / 2.0 t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 t_2 = (2.0 - (x * eps_m)) / 2.0 t_3 = x * (eps_m + (-1.0 / eps_m)) t_4 = (2.0 - t_3) / 2.0 t_5 = (2.0 + t_3) / 2.0 tmp = 0 if eps_m <= 8.2e+68: tmp = (2.0 + ((x * (1.0 - eps_m)) - x)) / 2.0 elif eps_m <= 9e+153: tmp = t_1 elif eps_m <= 1.4e+166: tmp = t_5 elif eps_m <= 2e+179: tmp = t_2 elif eps_m <= 1.55e+181: tmp = t_1 elif eps_m <= 1.58e+181: tmp = t_2 elif eps_m <= 1.15e+187: tmp = t_1 elif eps_m <= 2e+191: tmp = t_2 elif eps_m <= 5e+197: tmp = t_1 elif eps_m <= 1.65e+203: tmp = t_2 elif eps_m <= 2.65e+228: tmp = t_1 elif eps_m <= 4.3e+228: tmp = t_2 elif eps_m <= 2.75e+230: tmp = t_0 elif eps_m <= 2.9e+232: tmp = t_4 elif eps_m <= 1.4e+236: tmp = t_1 elif eps_m <= 1.45e+236: tmp = t_2 elif eps_m <= 2.05e+237: tmp = t_1 elif eps_m <= 5.8e+237: tmp = t_0 elif eps_m <= 5.9e+237: tmp = t_4 elif eps_m <= 6e+241: tmp = t_5 elif eps_m <= 6.1e+246: tmp = t_1 elif eps_m <= 8e+246: tmp = 1.0 elif eps_m <= 3.25e+248: tmp = t_2 elif eps_m <= 6.5e+254: tmp = t_5 elif eps_m <= 4e+264: tmp = t_2 elif eps_m <= 1.45e+268: tmp = t_1 elif eps_m <= 2e+268: tmp = t_2 elif eps_m <= 1.05e+272: tmp = t_4 elif eps_m <= 1.45e+279: tmp = t_1 elif eps_m <= 4.8e+279: tmp = t_4 elif eps_m <= 2.5e+283: tmp = t_0 elif eps_m <= 1.4e+295: tmp = t_4 elif eps_m <= 2.7e+299: tmp = t_1 else: tmp = t_2 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) t_1 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) t_2 = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0) t_3 = Float64(x * Float64(eps_m + Float64(-1.0 / eps_m))) t_4 = Float64(Float64(2.0 - t_3) / 2.0) t_5 = Float64(Float64(2.0 + t_3) / 2.0) tmp = 0.0 if (eps_m <= 8.2e+68) tmp = Float64(Float64(2.0 + Float64(Float64(x * Float64(1.0 - eps_m)) - x)) / 2.0); elseif (eps_m <= 9e+153) tmp = t_1; elseif (eps_m <= 1.4e+166) tmp = t_5; elseif (eps_m <= 2e+179) tmp = t_2; elseif (eps_m <= 1.55e+181) tmp = t_1; elseif (eps_m <= 1.58e+181) tmp = t_2; elseif (eps_m <= 1.15e+187) tmp = t_1; elseif (eps_m <= 2e+191) tmp = t_2; elseif (eps_m <= 5e+197) tmp = t_1; elseif (eps_m <= 1.65e+203) tmp = t_2; elseif (eps_m <= 2.65e+228) tmp = t_1; elseif (eps_m <= 4.3e+228) tmp = t_2; elseif (eps_m <= 2.75e+230) tmp = t_0; elseif (eps_m <= 2.9e+232) tmp = t_4; elseif (eps_m <= 1.4e+236) tmp = t_1; elseif (eps_m <= 1.45e+236) tmp = t_2; elseif (eps_m <= 2.05e+237) tmp = t_1; elseif (eps_m <= 5.8e+237) tmp = t_0; elseif (eps_m <= 5.9e+237) tmp = t_4; elseif (eps_m <= 6e+241) tmp = t_5; elseif (eps_m <= 6.1e+246) tmp = t_1; elseif (eps_m <= 8e+246) tmp = 1.0; elseif (eps_m <= 3.25e+248) tmp = t_2; elseif (eps_m <= 6.5e+254) tmp = t_5; elseif (eps_m <= 4e+264) tmp = t_2; elseif (eps_m <= 1.45e+268) tmp = t_1; elseif (eps_m <= 2e+268) tmp = t_2; elseif (eps_m <= 1.05e+272) tmp = t_4; elseif (eps_m <= 1.45e+279) tmp = t_1; elseif (eps_m <= 4.8e+279) tmp = t_4; elseif (eps_m <= 2.5e+283) tmp = t_0; elseif (eps_m <= 1.4e+295) tmp = t_4; elseif (eps_m <= 2.7e+299) tmp = t_1; else tmp = t_2; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (eps_m * (x + (2.0 / eps_m))) / 2.0; t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; t_2 = (2.0 - (x * eps_m)) / 2.0; t_3 = x * (eps_m + (-1.0 / eps_m)); t_4 = (2.0 - t_3) / 2.0; t_5 = (2.0 + t_3) / 2.0; tmp = 0.0; if (eps_m <= 8.2e+68) tmp = (2.0 + ((x * (1.0 - eps_m)) - x)) / 2.0; elseif (eps_m <= 9e+153) tmp = t_1; elseif (eps_m <= 1.4e+166) tmp = t_5; elseif (eps_m <= 2e+179) tmp = t_2; elseif (eps_m <= 1.55e+181) tmp = t_1; elseif (eps_m <= 1.58e+181) tmp = t_2; elseif (eps_m <= 1.15e+187) tmp = t_1; elseif (eps_m <= 2e+191) tmp = t_2; elseif (eps_m <= 5e+197) tmp = t_1; elseif (eps_m <= 1.65e+203) tmp = t_2; elseif (eps_m <= 2.65e+228) tmp = t_1; elseif (eps_m <= 4.3e+228) tmp = t_2; elseif (eps_m <= 2.75e+230) tmp = t_0; elseif (eps_m <= 2.9e+232) tmp = t_4; elseif (eps_m <= 1.4e+236) tmp = t_1; elseif (eps_m <= 1.45e+236) tmp = t_2; elseif (eps_m <= 2.05e+237) tmp = t_1; elseif (eps_m <= 5.8e+237) tmp = t_0; elseif (eps_m <= 5.9e+237) tmp = t_4; elseif (eps_m <= 6e+241) tmp = t_5; elseif (eps_m <= 6.1e+246) tmp = t_1; elseif (eps_m <= 8e+246) tmp = 1.0; elseif (eps_m <= 3.25e+248) tmp = t_2; elseif (eps_m <= 6.5e+254) tmp = t_5; elseif (eps_m <= 4e+264) tmp = t_2; elseif (eps_m <= 1.45e+268) tmp = t_1; elseif (eps_m <= 2e+268) tmp = t_2; elseif (eps_m <= 1.05e+272) tmp = t_4; elseif (eps_m <= 1.45e+279) tmp = t_1; elseif (eps_m <= 4.8e+279) tmp = t_4; elseif (eps_m <= 2.5e+283) tmp = t_0; elseif (eps_m <= 1.4e+295) tmp = t_4; elseif (eps_m <= 2.7e+299) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(eps$95$m + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(2.0 - t$95$3), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$5 = N[(N[(2.0 + t$95$3), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[eps$95$m, 8.2e+68], N[(N[(2.0 + N[(N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 9e+153], t$95$1, If[LessEqual[eps$95$m, 1.4e+166], t$95$5, If[LessEqual[eps$95$m, 2e+179], t$95$2, If[LessEqual[eps$95$m, 1.55e+181], t$95$1, If[LessEqual[eps$95$m, 1.58e+181], t$95$2, If[LessEqual[eps$95$m, 1.15e+187], t$95$1, If[LessEqual[eps$95$m, 2e+191], t$95$2, If[LessEqual[eps$95$m, 5e+197], t$95$1, If[LessEqual[eps$95$m, 1.65e+203], t$95$2, If[LessEqual[eps$95$m, 2.65e+228], t$95$1, If[LessEqual[eps$95$m, 4.3e+228], t$95$2, If[LessEqual[eps$95$m, 2.75e+230], t$95$0, If[LessEqual[eps$95$m, 2.9e+232], t$95$4, If[LessEqual[eps$95$m, 1.4e+236], t$95$1, If[LessEqual[eps$95$m, 1.45e+236], t$95$2, If[LessEqual[eps$95$m, 2.05e+237], t$95$1, If[LessEqual[eps$95$m, 5.8e+237], t$95$0, If[LessEqual[eps$95$m, 5.9e+237], t$95$4, If[LessEqual[eps$95$m, 6e+241], t$95$5, If[LessEqual[eps$95$m, 6.1e+246], t$95$1, If[LessEqual[eps$95$m, 8e+246], 1.0, If[LessEqual[eps$95$m, 3.25e+248], t$95$2, If[LessEqual[eps$95$m, 6.5e+254], t$95$5, If[LessEqual[eps$95$m, 4e+264], t$95$2, If[LessEqual[eps$95$m, 1.45e+268], t$95$1, If[LessEqual[eps$95$m, 2e+268], t$95$2, If[LessEqual[eps$95$m, 1.05e+272], t$95$4, If[LessEqual[eps$95$m, 1.45e+279], t$95$1, If[LessEqual[eps$95$m, 4.8e+279], t$95$4, If[LessEqual[eps$95$m, 2.5e+283], t$95$0, If[LessEqual[eps$95$m, 1.4e+295], t$95$4, If[LessEqual[eps$95$m, 2.7e+299], t$95$1, t$95$2]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
t_1 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
t_2 := \frac{2 - x \cdot eps\_m}{2}\\
t_3 := x \cdot \left(eps\_m + \frac{-1}{eps\_m}\right)\\
t_4 := \frac{2 - t\_3}{2}\\
t_5 := \frac{2 + t\_3}{2}\\
\mathbf{if}\;eps\_m \leq 8.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(1 - eps\_m\right) - x\right)}{2}\\
\mathbf{elif}\;eps\_m \leq 9 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.4 \cdot 10^{+166}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+179}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 1.55 \cdot 10^{+181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.58 \cdot 10^{+181}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 1.15 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+191}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 5 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.65 \cdot 10^{+203}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2.65 \cdot 10^{+228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 4.3 \cdot 10^{+228}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2.75 \cdot 10^{+230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 2.9 \cdot 10^{+232}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 1.4 \cdot 10^{+236}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+236}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 2.05 \cdot 10^{+237}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 5.8 \cdot 10^{+237}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 5.9 \cdot 10^{+237}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 6 \cdot 10^{+241}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 6.1 \cdot 10^{+246}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 8 \cdot 10^{+246}:\\
\;\;\;\;1\\
\mathbf{elif}\;eps\_m \leq 3.25 \cdot 10^{+248}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 6.5 \cdot 10^{+254}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;eps\_m \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;eps\_m \leq 1.05 \cdot 10^{+272}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+279}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 4.8 \cdot 10^{+279}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2.5 \cdot 10^{+283}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.4 \cdot 10^{+295}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;eps\_m \leq 2.7 \cdot 10^{+299}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if eps < 8.1999999999999998e68Initial program 63.1%
Simplified63.1%
Taylor expanded in x around 0 32.5%
Taylor expanded in x around 0 34.3%
associate-*r*34.3%
neg-mul-134.3%
*-commutative34.3%
Simplified34.3%
distribute-lft-in34.3%
*-rgt-identity34.3%
distribute-rgt-in34.3%
add-sqr-sqrt17.8%
sqrt-unprod40.9%
sqr-neg40.9%
sqrt-unprod21.6%
add-sqr-sqrt36.8%
un-div-inv36.8%
add-sqr-sqrt15.2%
sqrt-unprod38.2%
sqr-neg38.2%
sqrt-unprod21.6%
add-sqr-sqrt36.8%
Applied egg-rr36.8%
Taylor expanded in eps around inf 57.9%
mul-1-neg57.9%
Simplified57.9%
if 8.1999999999999998e68 < eps < 9.0000000000000002e153 or 1.99999999999999996e179 < eps < 1.54999999999999995e181 or 1.58000000000000002e181 < eps < 1.15000000000000002e187 or 2.00000000000000015e191 < eps < 5.00000000000000009e197 or 1.64999999999999995e203 < eps < 2.65e228 or 2.90000000000000023e232 < eps < 1.39999999999999996e236 or 1.45e236 < eps < 2.05000000000000001e237 or 6.00000000000000031e241 < eps < 6.10000000000000028e246 or 4.00000000000000018e264 < eps < 1.4500000000000001e268 or 1.04999999999999998e272 < eps < 1.44999999999999988e279 or 1.4000000000000001e295 < eps < 2.7e299Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 76.4%
Taylor expanded in x around 0 43.2%
associate-*r*43.2%
neg-mul-143.2%
*-commutative43.2%
Simplified43.2%
Taylor expanded in eps around 0 59.3%
if 9.0000000000000002e153 < eps < 1.39999999999999998e166 or 5.8999999999999997e237 < eps < 6.00000000000000031e241 or 3.25000000000000024e248 < eps < 6.50000000000000024e254Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
mul-1-neg83.9%
mul-1-neg83.9%
distribute-rgt-neg-in83.9%
neg-sub083.9%
associate--r-83.9%
metadata-eval83.9%
+-commutative83.9%
+-commutative83.9%
distribute-rgt1-in83.9%
+-commutative83.9%
distribute-rgt-in83.9%
neg-mul-183.9%
rgt-mult-inverse83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r+83.9%
metadata-eval83.9%
sub-neg83.9%
neg-sub083.9%
distribute-neg-frac83.9%
metadata-eval83.9%
Simplified83.9%
if 1.39999999999999998e166 < eps < 1.99999999999999996e179 or 1.54999999999999995e181 < eps < 1.58000000000000002e181 or 1.15000000000000002e187 < eps < 2.00000000000000015e191 or 5.00000000000000009e197 < eps < 1.64999999999999995e203 or 2.65e228 < eps < 4.30000000000000032e228 or 1.39999999999999996e236 < eps < 1.45e236 or 8.00000000000000055e246 < eps < 3.25000000000000024e248 or 6.50000000000000024e254 < eps < 4.00000000000000018e264 or 1.4500000000000001e268 < eps < 1.9999999999999999e268 or 2.7e299 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 10.0%
Taylor expanded in x around 0 7.2%
associate-*r*7.2%
neg-mul-17.2%
*-commutative7.2%
Simplified7.2%
add-sqr-sqrt0.1%
sqrt-unprod7.4%
sqr-neg7.4%
sqrt-unprod7.1%
add-sqr-sqrt59.8%
distribute-rgt-in59.8%
*-un-lft-identity59.8%
distribute-rgt-in59.8%
Applied egg-rr59.8%
associate-*l/59.8%
*-lft-identity59.8%
distribute-rgt-out59.8%
+-commutative59.8%
associate-+r-59.8%
div-sub59.8%
*-inverses59.8%
associate-+l-59.8%
metadata-eval59.8%
Simplified59.8%
Taylor expanded in eps around inf 59.8%
associate-*r*59.8%
neg-mul-159.8%
*-commutative59.8%
Simplified59.8%
if 4.30000000000000032e228 < eps < 2.7499999999999999e230 or 2.05000000000000001e237 < eps < 5.8000000000000002e237 or 4.8000000000000001e279 < eps < 2.5000000000000002e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 67.8%
associate-*r*67.8%
neg-mul-167.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in eps around inf 67.8%
associate-*r/67.8%
metadata-eval67.8%
Simplified67.8%
if 2.7499999999999999e230 < eps < 2.90000000000000023e232 or 5.8000000000000002e237 < eps < 5.8999999999999997e237 or 1.9999999999999999e268 < eps < 1.04999999999999998e272 or 1.44999999999999988e279 < eps < 4.8000000000000001e279 or 2.5000000000000002e283 < eps < 1.4000000000000001e295Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in x around 0 0.3%
associate-*r*0.3%
neg-mul-10.3%
*-commutative0.3%
Simplified0.3%
add-sqr-sqrt0.3%
sqrt-unprod1.4%
sqr-neg1.4%
sqrt-unprod0.0%
add-sqr-sqrt45.1%
distribute-rgt-in45.1%
*-un-lft-identity45.1%
distribute-rgt-in45.1%
Applied egg-rr45.1%
associate-*l/45.1%
*-lft-identity45.1%
distribute-rgt-out45.1%
+-commutative45.1%
associate-+r-45.1%
div-sub45.1%
*-inverses45.1%
associate-+l-45.1%
metadata-eval45.1%
Simplified45.1%
if 6.10000000000000028e246 < eps < 8.00000000000000055e246Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification58.8%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0))
(t_1 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0)))
(if (<= eps_m 3.1e+254)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(if (<= eps_m 7.2e+272)
t_0
(if (<= eps_m 2e+276)
t_1
(if (<= eps_m 1.45e+280)
t_0
(if (<= eps_m 1.7e+283)
(/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)
(if (or (<= eps_m 4e+295) (not (<= eps_m 2.6e+299)))
t_0
t_1))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (eps_m <= 3.1e+254) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else if (eps_m <= 7.2e+272) {
tmp = t_0;
} else if (eps_m <= 2e+276) {
tmp = t_1;
} else if (eps_m <= 1.45e+280) {
tmp = t_0;
} else if (eps_m <= 1.7e+283) {
tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0;
} else if ((eps_m <= 4e+295) || !(eps_m <= 2.6e+299)) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
t_1 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
if (eps_m <= 3.1d+254) then
tmp = (1.0d0 + exp((x * eps_m))) / 2.0d0
else if (eps_m <= 7.2d+272) then
tmp = t_0
else if (eps_m <= 2d+276) then
tmp = t_1
else if (eps_m <= 1.45d+280) then
tmp = t_0
else if (eps_m <= 1.7d+283) then
tmp = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
else if ((eps_m <= 4d+295) .or. (.not. (eps_m <= 2.6d+299))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
double t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (eps_m <= 3.1e+254) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else if (eps_m <= 7.2e+272) {
tmp = t_0;
} else if (eps_m <= 2e+276) {
tmp = t_1;
} else if (eps_m <= 1.45e+280) {
tmp = t_0;
} else if (eps_m <= 1.7e+283) {
tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0;
} else if ((eps_m <= 4e+295) || !(eps_m <= 2.6e+299)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 tmp = 0 if eps_m <= 3.1e+254: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 elif eps_m <= 7.2e+272: tmp = t_0 elif eps_m <= 2e+276: tmp = t_1 elif eps_m <= 1.45e+280: tmp = t_0 elif eps_m <= 1.7e+283: tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0 elif (eps_m <= 4e+295) or not (eps_m <= 2.6e+299): tmp = t_0 else: tmp = t_1 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0) t_1 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) tmp = 0.0 if (eps_m <= 3.1e+254) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); elseif (eps_m <= 7.2e+272) tmp = t_0; elseif (eps_m <= 2e+276) tmp = t_1; elseif (eps_m <= 1.45e+280) tmp = t_0; elseif (eps_m <= 1.7e+283) tmp = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0); elseif ((eps_m <= 4e+295) || !(eps_m <= 2.6e+299)) tmp = t_0; else tmp = t_1; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; t_1 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; tmp = 0.0; if (eps_m <= 3.1e+254) tmp = (1.0 + exp((x * eps_m))) / 2.0; elseif (eps_m <= 7.2e+272) tmp = t_0; elseif (eps_m <= 2e+276) tmp = t_1; elseif (eps_m <= 1.45e+280) tmp = t_0; elseif (eps_m <= 1.7e+283) tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0; elseif ((eps_m <= 4e+295) || ~((eps_m <= 2.6e+299))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[eps$95$m, 3.1e+254], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 7.2e+272], t$95$0, If[LessEqual[eps$95$m, 2e+276], t$95$1, If[LessEqual[eps$95$m, 1.45e+280], t$95$0, If[LessEqual[eps$95$m, 1.7e+283], N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[eps$95$m, 4e+295], N[Not[LessEqual[eps$95$m, 2.6e+299]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
t_1 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
\mathbf{if}\;eps\_m \leq 3.1 \cdot 10^{+254}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{elif}\;eps\_m \leq 7.2 \cdot 10^{+272}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 2 \cdot 10^{+276}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;eps\_m \leq 1.45 \cdot 10^{+280}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;eps\_m \leq 1.7 \cdot 10^{+283}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{elif}\;eps\_m \leq 4 \cdot 10^{+295} \lor \neg \left(eps\_m \leq 2.6 \cdot 10^{+299}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if eps < 3.1000000000000002e254Initial program 72.2%
Simplified64.1%
Taylor expanded in eps around inf 99.2%
Taylor expanded in x around 0 67.8%
Taylor expanded in eps around inf 68.1%
*-commutative87.1%
Simplified68.1%
if 3.1000000000000002e254 < eps < 7.1999999999999995e272 or 2.0000000000000001e276 < eps < 1.44999999999999993e280 or 1.7000000000000001e283 < eps < 3.9999999999999999e295 or 2.6e299 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 12.8%
Taylor expanded in x around 0 0.9%
associate-*r*0.9%
neg-mul-10.9%
*-commutative0.9%
Simplified0.9%
distribute-lft-in0.9%
*-rgt-identity0.9%
distribute-rgt-in0.9%
add-sqr-sqrt0.1%
sqrt-unprod1.0%
sqr-neg1.0%
sqrt-unprod0.0%
add-sqr-sqrt42.7%
un-div-inv42.7%
add-sqr-sqrt42.7%
sqrt-unprod22.7%
sqr-neg22.7%
sqrt-unprod0.0%
add-sqr-sqrt42.7%
Applied egg-rr42.7%
Taylor expanded in eps around 0 90.0%
associate-+r+90.0%
distribute-rgt1-in90.0%
metadata-eval90.0%
associate-*r*90.0%
neg-mul-190.0%
*-commutative90.0%
Simplified90.0%
if 7.1999999999999995e272 < eps < 2.0000000000000001e276 or 3.9999999999999999e295 < eps < 2.6e299Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 6.6%
associate-*r*6.6%
neg-mul-16.6%
*-commutative6.6%
Simplified6.6%
Taylor expanded in eps around 0 100.0%
if 1.44999999999999993e280 < eps < 1.7000000000000001e283Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around 0 100.0%
associate-*r*100.0%
neg-mul-1100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r/100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification69.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (eps_m * (x + (2.0 / eps_m))) / 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 = (eps_m * (x + (2.0d0 / eps_m))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (eps_m * (x + (2.0 / eps_m))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (eps_m * (x + (2.0 / eps_m))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}
\end{array}
Initial program 73.5%
Simplified73.5%
Taylor expanded in x around 0 40.1%
Taylor expanded in x around 0 35.1%
associate-*r*35.1%
neg-mul-135.1%
*-commutative35.1%
Simplified35.1%
Taylor expanded in eps around inf 50.1%
associate-*r/50.1%
metadata-eval50.1%
Simplified50.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (- 2.0 (* x eps_m)) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (2.0 - (x * eps_m)) / 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 = (2.0d0 - (x * eps_m)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (2.0 - (x * eps_m)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (2.0 - (x * eps_m)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (2.0 - (x * eps_m)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{2 - x \cdot eps\_m}{2}
\end{array}
Initial program 73.5%
Simplified73.5%
Taylor expanded in x around 0 40.1%
Taylor expanded in x around 0 35.1%
associate-*r*35.1%
neg-mul-135.1%
*-commutative35.1%
Simplified35.1%
add-sqr-sqrt15.2%
sqrt-unprod38.1%
sqr-neg38.1%
sqrt-unprod18.2%
add-sqr-sqrt36.9%
distribute-rgt-in36.9%
*-un-lft-identity36.9%
distribute-rgt-in36.9%
Applied egg-rr36.9%
associate-*l/36.9%
*-lft-identity36.9%
distribute-rgt-out36.9%
+-commutative36.9%
associate-+r-36.9%
div-sub36.9%
*-inverses36.9%
associate-+l-36.9%
metadata-eval36.9%
Simplified36.9%
Taylor expanded in eps around inf 52.1%
associate-*r*52.1%
neg-mul-152.1%
*-commutative52.1%
Simplified52.1%
Final simplification52.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 1.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 1.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
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 1.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 1.0
eps_m = abs(eps) function code(x, eps_m) return 1.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 1.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 1.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
1
\end{array}
Initial program 73.5%
Simplified73.5%
Taylor expanded in x around 0 44.4%
Final simplification44.4%
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.5%
Simplified61.9%
Taylor expanded in eps around 0 14.0%
mul-1-neg14.0%
mul-1-neg14.0%
rec-exp13.9%
sub-neg13.9%
div-sub13.9%
mul-1-neg13.9%
rec-exp14.0%
+-inverses14.2%
Simplified14.2%
Final simplification14.2%
herbie shell --seed 2024096
(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))