
(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 21 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 0.00084) (/ (* 2.0 (exp (- (log1p x) x))) 2.0) (/ (+ (exp (* 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 <= 0.00084) {
tmp = (2.0 * exp((log1p(x) - x))) / 2.0;
} else {
tmp = (exp((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 <= 0.00084) {
tmp = (2.0 * Math.exp((Math.log1p(x) - x))) / 2.0;
} else {
tmp = (Math.exp((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 <= 0.00084: tmp = (2.0 * math.exp((math.log1p(x) - x))) / 2.0 else: tmp = (math.exp((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 <= 0.00084) tmp = Float64(Float64(2.0 * exp(Float64(log1p(x) - x))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(-eps_m))) + exp(Float64(x * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.00084], N[(N[(2.0 * N[Exp[N[(N[Log[1 + x], $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * (-eps$95$m)), $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 0.00084:\\
\;\;\;\;\frac{2 \cdot e^{\mathsf{log1p}\left(x\right) - x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(-eps\_m\right)} + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if eps < 8.4000000000000003e-4Initial program 61.4%
Simplified61.4%
Taylor expanded in eps around 0 67.5%
associate--l+67.5%
neg-mul-167.5%
neg-mul-167.5%
distribute-lft-out67.5%
distribute-rgt1-in67.5%
neg-mul-167.5%
Applied egg-rr67.5%
associate-+r-67.5%
distribute-rgt1-in68.6%
cancel-sign-sub-inv68.6%
metadata-eval68.6%
distribute-rgt1-in68.6%
metadata-eval68.6%
rem-exp-log67.5%
exp-sum67.5%
unsub-neg67.5%
+-commutative67.5%
log1p-define67.5%
Simplified67.5%
if 8.4000000000000003e-4 < eps Initial program 100.0%
Simplified78.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (- -1.0 eps_m))) (exp (* x (+ -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (-1.0 - eps_m))) + exp((x * (-1.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 = (exp((x * ((-1.0d0) - eps_m))) + exp((x * ((-1.0d0) + eps_m)))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((x * (-1.0 - eps_m))) + Math.exp((x * (-1.0 + eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (-1.0 - eps_m))) + math.exp((x * (-1.0 + eps_m)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(-1.0 - eps_m))) + exp(Float64(x * Float64(-1.0 + eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (-1.0 - eps_m))) + exp((x * (-1.0 + eps_m)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot \left(-1 - eps\_m\right)} + e^{x \cdot \left(-1 + eps\_m\right)}}{2}
\end{array}
Initial program 72.7%
Simplified60.0%
Taylor expanded in eps around inf 98.3%
Final simplification98.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (* x (+ 1.0 eps_m)))
(t_1 (/ t_0 eps_m))
(t_2 (* x (- -1.0 eps_m))))
(if (<= x -1.05e+65)
(/
(*
x
(+
(*
x
(+
(*
x
(-
(* x 7.233796296296296e-5)
(* 0.16666666666666666 (/ 1.0 eps_m))))
(* (/ 1.0 eps_m) 0.5)))
(/ -1.0 eps_m)))
2.0)
(if (<= x -4.2e-10)
(/ (/ (+ (* t_0 t_0) (* t_1 (/ t_2 eps_m))) (- t_2 t_1)) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (<= x 1.5e+93)
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
(if (<= x 4e+166)
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps_m)
2.0)
(pow (* x 1.000072337962963) -4.0))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 1.5e+93) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else if (x <= 4e+166) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
} else {
tmp = pow((x * 1.000072337962963), -4.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) :: tmp
t_0 = x * (1.0d0 + eps_m)
t_1 = t_0 / eps_m
t_2 = x * ((-1.0d0) - eps_m)
if (x <= (-1.05d+65)) then
tmp = (x * ((x * ((x * ((x * 7.233796296296296d-5) - (0.16666666666666666d0 * (1.0d0 / eps_m)))) + ((1.0d0 / eps_m) * 0.5d0))) + ((-1.0d0) / eps_m))) / 2.0d0
else if (x <= (-4.2d-10)) then
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if (x <= 1.5d+93) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
else if (x <= 4d+166) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps_m) / 2.0d0
else
tmp = (x * 1.000072337962963d0) ** (-4.0d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 1.5e+93) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else if (x <= 4e+166) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
} else {
tmp = Math.pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (1.0 + eps_m) t_1 = t_0 / eps_m t_2 = x * (-1.0 - eps_m) tmp = 0 if x <= -1.05e+65: tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0 elif x <= -4.2e-10: tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif x <= 1.5e+93: tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 elif x <= 4e+166: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0 else: tmp = math.pow((x * 1.000072337962963), -4.0) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(1.0 + eps_m)) t_1 = Float64(t_0 / eps_m) t_2 = Float64(x * Float64(-1.0 - eps_m)) tmp = 0.0 if (x <= -1.05e+65) tmp = Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 7.233796296296296e-5) - Float64(0.16666666666666666 * Float64(1.0 / eps_m)))) + Float64(Float64(1.0 / eps_m) * 0.5))) + Float64(-1.0 / eps_m))) / 2.0); elseif (x <= -4.2e-10) tmp = Float64(Float64(Float64(Float64(t_0 * t_0) + Float64(t_1 * Float64(t_2 / eps_m))) / Float64(t_2 - t_1)) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif (x <= 1.5e+93) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); elseif (x <= 4e+166) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0); else tmp = Float64(x * 1.000072337962963) ^ -4.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (1.0 + eps_m); t_1 = t_0 / eps_m; t_2 = x * (-1.0 - eps_m); tmp = 0.0; if (x <= -1.05e+65) tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0; elseif (x <= -4.2e-10) tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif (x <= 1.5e+93) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; elseif (x <= 4e+166) tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0; else tmp = (x * 1.000072337962963) ^ -4.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / eps$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+65], N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 7.233796296296296e-5), $MachinePrecision] - N[(0.16666666666666666 * N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -4.2e-10], N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(t$95$2 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.5e+93], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4e+166], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[Power[N[(x * 1.000072337962963), $MachinePrecision], -4.0], $MachinePrecision]]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(1 + eps\_m\right)\\
t_1 := \frac{t\_0}{eps\_m}\\
t_2 := x \cdot \left(-1 - eps\_m\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 7.233796296296296 \cdot 10^{-5} - 0.16666666666666666 \cdot \frac{1}{eps\_m}\right) + \frac{1}{eps\_m} \cdot 0.5\right) + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{t\_0 \cdot t\_0 + t\_1 \cdot \frac{t\_2}{eps\_m}}{t\_2 - t\_1}}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+93}:\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot 1.000072337962963\right)}^{-4}\\
\end{array}
\end{array}
if x < -1.04999999999999996e65Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 30.2%
Applied egg-rr88.7%
+-commutative88.7%
associate--l+88.7%
metadata-eval88.7%
+-rgt-identity88.7%
Simplified88.7%
if -1.04999999999999996e65 < x < -4.2e-10Initial program 82.5%
Simplified82.5%
Taylor expanded in x around 0 37.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
*-commutative3.3%
distribute-rgt-neg-in3.3%
mul-1-neg3.3%
distribute-lft-in3.3%
metadata-eval3.3%
neg-mul-13.3%
distribute-neg-frac3.3%
metadata-eval3.3%
Simplified3.3%
Applied egg-rr12.9%
if -4.2e-10 < x < 1.4199999999999999Initial program 54.2%
Simplified54.2%
Taylor expanded in eps around 0 74.2%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Applied egg-rr73.8%
if 1.4199999999999999 < x < 1.49999999999999989e93Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 43.4%
Taylor expanded in x around 0 54.1%
if 1.49999999999999989e93 < x < 3.99999999999999976e166Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.2%
Taylor expanded in eps around 0 1.8%
expm1-define1.8%
neg-mul-11.8%
Simplified1.8%
Taylor expanded in x around 0 38.0%
if 3.99999999999999976e166 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.2%
Taylor expanded in eps around 0 2.0%
expm1-define2.0%
neg-mul-12.0%
Simplified2.0%
Taylor expanded in x around 0 20.2%
Applied egg-rr62.1%
*-rgt-identity62.1%
distribute-lft-out62.1%
metadata-eval62.1%
Simplified62.1%
Final simplification65.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (* x (+ 1.0 eps_m)))
(t_1 (/ t_0 eps_m))
(t_2 (* x (- -1.0 eps_m))))
(if (<= x -1.05e+65)
(/
(*
x
(+
(*
x
(+
(*
x
(-
(* x 7.233796296296296e-5)
(* 0.16666666666666666 (/ 1.0 eps_m))))
(* (/ 1.0 eps_m) 0.5)))
(/ -1.0 eps_m)))
2.0)
(if (<= x -4.2e-10)
(/ (/ (+ (* t_0 t_0) (* t_1 (/ t_2 eps_m))) (- t_2 t_1)) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (<= x 3e+170)
(/ (/ (expm1 x) eps_m) 2.0)
(pow (* x 1.000072337962963) -4.0)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 3e+170) {
tmp = (expm1(x) / eps_m) / 2.0;
} else {
tmp = pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if (x <= 3e+170) {
tmp = (Math.expm1(x) / eps_m) / 2.0;
} else {
tmp = Math.pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (1.0 + eps_m) t_1 = t_0 / eps_m t_2 = x * (-1.0 - eps_m) tmp = 0 if x <= -1.05e+65: tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0 elif x <= -4.2e-10: tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif x <= 3e+170: tmp = (math.expm1(x) / eps_m) / 2.0 else: tmp = math.pow((x * 1.000072337962963), -4.0) return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(1.0 + eps_m)) t_1 = Float64(t_0 / eps_m) t_2 = Float64(x * Float64(-1.0 - eps_m)) tmp = 0.0 if (x <= -1.05e+65) tmp = Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 7.233796296296296e-5) - Float64(0.16666666666666666 * Float64(1.0 / eps_m)))) + Float64(Float64(1.0 / eps_m) * 0.5))) + Float64(-1.0 / eps_m))) / 2.0); elseif (x <= -4.2e-10) tmp = Float64(Float64(Float64(Float64(t_0 * t_0) + Float64(t_1 * Float64(t_2 / eps_m))) / Float64(t_2 - t_1)) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif (x <= 3e+170) tmp = Float64(Float64(expm1(x) / eps_m) / 2.0); else tmp = Float64(x * 1.000072337962963) ^ -4.0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / eps$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+65], N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 7.233796296296296e-5), $MachinePrecision] - N[(0.16666666666666666 * N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -4.2e-10], N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(t$95$2 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3e+170], N[(N[(N[(Exp[x] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[Power[N[(x * 1.000072337962963), $MachinePrecision], -4.0], $MachinePrecision]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(1 + eps\_m\right)\\
t_1 := \frac{t\_0}{eps\_m}\\
t_2 := x \cdot \left(-1 - eps\_m\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 7.233796296296296 \cdot 10^{-5} - 0.16666666666666666 \cdot \frac{1}{eps\_m}\right) + \frac{1}{eps\_m} \cdot 0.5\right) + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{t\_0 \cdot t\_0 + t\_1 \cdot \frac{t\_2}{eps\_m}}{t\_2 - t\_1}}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+170}:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(x\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot 1.000072337962963\right)}^{-4}\\
\end{array}
\end{array}
if x < -1.04999999999999996e65Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 30.2%
Applied egg-rr88.7%
+-commutative88.7%
associate--l+88.7%
metadata-eval88.7%
+-rgt-identity88.7%
Simplified88.7%
if -1.04999999999999996e65 < x < -4.2e-10Initial program 82.5%
Simplified82.5%
Taylor expanded in x around 0 37.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
*-commutative3.3%
distribute-rgt-neg-in3.3%
mul-1-neg3.3%
distribute-lft-in3.3%
metadata-eval3.3%
neg-mul-13.3%
distribute-neg-frac3.3%
metadata-eval3.3%
Simplified3.3%
Applied egg-rr12.9%
if -4.2e-10 < x < 1.4199999999999999Initial program 54.2%
Simplified54.2%
Taylor expanded in eps around 0 74.2%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Applied egg-rr73.8%
if 1.4199999999999999 < x < 2.99999999999999997e170Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 41.1%
Taylor expanded in eps around 0 1.8%
expm1-define1.8%
neg-mul-11.8%
Simplified1.8%
expm1-undefine1.8%
div-sub1.8%
add-sqr-sqrt0.0%
sqrt-unprod40.2%
sqr-neg40.2%
sqrt-unprod40.2%
add-sqr-sqrt40.2%
Applied egg-rr40.2%
div-sub40.2%
expm1-define40.2%
Simplified40.2%
if 2.99999999999999997e170 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.2%
Taylor expanded in eps around 0 2.0%
expm1-define2.0%
neg-mul-12.0%
Simplified2.0%
Taylor expanded in x around 0 20.2%
Applied egg-rr62.1%
*-rgt-identity62.1%
distribute-lft-out62.1%
metadata-eval62.1%
Simplified62.1%
Final simplification64.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -4e-295)
(/ (+ 1.0 (exp (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 6.7e+170)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(pow (* x 1.000072337962963) -4.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -4e-295) {
tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 6.7e+170) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else {
tmp = pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-4d-295)) then
tmp = (1.0d0 + exp((x * (1.0d0 - eps_m)))) / 2.0d0
else if (x <= 6.7d+170) then
tmp = (1.0d0 + exp((x * eps_m))) / 2.0d0
else
tmp = (x * 1.000072337962963d0) ** (-4.0d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -4e-295) {
tmp = (1.0 + Math.exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 6.7e+170) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else {
tmp = Math.pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -4e-295: tmp = (1.0 + math.exp((x * (1.0 - eps_m)))) / 2.0 elif x <= 6.7e+170: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 else: tmp = math.pow((x * 1.000072337962963), -4.0) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -4e-295) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 6.7e+170) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); else tmp = Float64(x * 1.000072337962963) ^ -4.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -4e-295) tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0; elseif (x <= 6.7e+170) tmp = (1.0 + exp((x * eps_m))) / 2.0; else tmp = (x * 1.000072337962963) ^ -4.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -4e-295], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6.7e+170], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[Power[N[(x * 1.000072337962963), $MachinePrecision], -4.0], $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-295}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 6.7 \cdot 10^{+170}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot 1.000072337962963\right)}^{-4}\\
\end{array}
\end{array}
if x < -4.00000000000000024e-295Initial program 63.6%
Simplified63.6%
Taylor expanded in x around 0 44.1%
Taylor expanded in eps around inf 76.8%
associate-*r*76.8%
neg-mul-176.8%
*-commutative76.8%
Simplified76.8%
neg-sub076.8%
sub-neg76.8%
add-sqr-sqrt76.8%
sqrt-unprod76.1%
sqr-neg76.1%
sqrt-unprod0.0%
add-sqr-sqrt73.4%
Applied egg-rr73.4%
+-lft-identity73.4%
Simplified73.4%
if -4.00000000000000024e-295 < x < 6.69999999999999984e170Initial program 75.3%
Simplified75.3%
Taylor expanded in x around 0 39.3%
Taylor expanded in eps around inf 62.9%
associate-*r*62.9%
neg-mul-162.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in eps around inf 63.2%
if 6.69999999999999984e170 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.2%
Taylor expanded in eps around 0 2.0%
expm1-define2.0%
neg-mul-12.0%
Simplified2.0%
Taylor expanded in x around 0 20.2%
Applied egg-rr62.1%
*-rgt-identity62.1%
distribute-lft-out62.1%
metadata-eval62.1%
Simplified62.1%
Final simplification67.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -4e-295)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 1.9e+171)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(pow (* x 1.000072337962963) -4.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -4e-295) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 1.9e+171) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else {
tmp = pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-4d-295)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 1.9d+171) then
tmp = (1.0d0 + exp((x * eps_m))) / 2.0d0
else
tmp = (x * 1.000072337962963d0) ** (-4.0d0)
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -4e-295) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 1.9e+171) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else {
tmp = Math.pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -4e-295: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 1.9e+171: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 else: tmp = math.pow((x * 1.000072337962963), -4.0) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -4e-295) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 1.9e+171) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); else tmp = Float64(x * 1.000072337962963) ^ -4.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -4e-295) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 1.9e+171) tmp = (1.0 + exp((x * eps_m))) / 2.0; else tmp = (x * 1.000072337962963) ^ -4.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -4e-295], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.9e+171], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[Power[N[(x * 1.000072337962963), $MachinePrecision], -4.0], $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-295}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+171}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot 1.000072337962963\right)}^{-4}\\
\end{array}
\end{array}
if x < -4.00000000000000024e-295Initial program 63.6%
Simplified47.2%
Taylor expanded in eps around inf 97.3%
Taylor expanded in eps around inf 97.3%
mul-1-neg97.3%
*-commutative97.3%
distribute-rgt-neg-in97.3%
Simplified97.3%
Taylor expanded in eps around 0 86.0%
neg-mul-186.0%
Simplified86.0%
if -4.00000000000000024e-295 < x < 1.9000000000000001e171Initial program 75.3%
Simplified75.3%
Taylor expanded in x around 0 39.3%
Taylor expanded in eps around inf 62.9%
associate-*r*62.9%
neg-mul-162.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in eps around inf 63.2%
if 1.9000000000000001e171 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.2%
Taylor expanded in eps around 0 2.0%
expm1-define2.0%
neg-mul-12.0%
Simplified2.0%
Taylor expanded in x around 0 20.2%
Applied egg-rr62.1%
*-rgt-identity62.1%
distribute-lft-out62.1%
metadata-eval62.1%
Simplified62.1%
Final simplification73.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 600.0)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 7e+167)
(/ (/ (expm1 x) eps_m) 2.0)
(pow (* x 1.000072337962963) -4.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 600.0) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 7e+167) {
tmp = (expm1(x) / eps_m) / 2.0;
} else {
tmp = pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 600.0) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 7e+167) {
tmp = (Math.expm1(x) / eps_m) / 2.0;
} else {
tmp = Math.pow((x * 1.000072337962963), -4.0);
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 600.0: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 7e+167: tmp = (math.expm1(x) / eps_m) / 2.0 else: tmp = math.pow((x * 1.000072337962963), -4.0) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 600.0) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 7e+167) tmp = Float64(Float64(expm1(x) / eps_m) / 2.0); else tmp = Float64(x * 1.000072337962963) ^ -4.0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 600.0], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 7e+167], N[(N[(N[(Exp[x] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[Power[N[(x * 1.000072337962963), $MachinePrecision], -4.0], $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 600:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(x\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;{\left(x \cdot 1.000072337962963\right)}^{-4}\\
\end{array}
\end{array}
if x < 600Initial program 62.6%
Simplified45.3%
Taylor expanded in eps around inf 97.6%
Taylor expanded in eps around inf 97.7%
mul-1-neg97.7%
*-commutative97.7%
distribute-rgt-neg-in97.7%
Simplified97.7%
Taylor expanded in eps around 0 76.5%
neg-mul-176.5%
Simplified76.5%
if 600 < x < 6.99999999999999975e167Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 41.1%
Taylor expanded in eps around 0 1.8%
expm1-define1.8%
neg-mul-11.8%
Simplified1.8%
expm1-undefine1.8%
div-sub1.8%
add-sqr-sqrt0.0%
sqrt-unprod40.2%
sqr-neg40.2%
sqrt-unprod40.2%
add-sqr-sqrt40.2%
Applied egg-rr40.2%
div-sub40.2%
expm1-define40.2%
Simplified40.2%
if 6.99999999999999975e167 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 21.2%
Taylor expanded in eps around 0 2.0%
expm1-define2.0%
neg-mul-12.0%
Simplified2.0%
Taylor expanded in x around 0 20.2%
Applied egg-rr62.1%
*-rgt-identity62.1%
distribute-lft-out62.1%
metadata-eval62.1%
Simplified62.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (* x (+ 1.0 eps_m)))
(t_1 (/ t_0 eps_m))
(t_2 (* x (- -1.0 eps_m))))
(if (<= x -1.05e+65)
(/
(*
x
(+
(*
x
(+
(*
x
(-
(* x 7.233796296296296e-5)
(* 0.16666666666666666 (/ 1.0 eps_m))))
(* (/ 1.0 eps_m) 0.5)))
(/ -1.0 eps_m)))
2.0)
(if (<= x -4.2e-10)
(/ (/ (+ (* t_0 t_0) (* t_1 (/ t_2 eps_m))) (- t_2 t_1)) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (or (<= x 7.8e+92) (not (<= x 5.4e+168)))
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps_m)
2.0)))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 7.8e+92) || !(x <= 5.4e+168)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x * (1.0d0 + eps_m)
t_1 = t_0 / eps_m
t_2 = x * ((-1.0d0) - eps_m)
if (x <= (-1.05d+65)) then
tmp = (x * ((x * ((x * ((x * 7.233796296296296d-5) - (0.16666666666666666d0 * (1.0d0 / eps_m)))) + ((1.0d0 / eps_m) * 0.5d0))) + ((-1.0d0) / eps_m))) / 2.0d0
else if (x <= (-4.2d-10)) then
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if ((x <= 7.8d+92) .or. (.not. (x <= 5.4d+168))) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
else
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
double t_1 = t_0 / eps_m;
double t_2 = x * (-1.0 - eps_m);
double tmp;
if (x <= -1.05e+65) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= -4.2e-10) {
tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 7.8e+92) || !(x <= 5.4e+168)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * (1.0 + eps_m) t_1 = t_0 / eps_m t_2 = x * (-1.0 - eps_m) tmp = 0 if x <= -1.05e+65: tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0 elif x <= -4.2e-10: tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif (x <= 7.8e+92) or not (x <= 5.4e+168): tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 else: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(1.0 + eps_m)) t_1 = Float64(t_0 / eps_m) t_2 = Float64(x * Float64(-1.0 - eps_m)) tmp = 0.0 if (x <= -1.05e+65) tmp = Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 7.233796296296296e-5) - Float64(0.16666666666666666 * Float64(1.0 / eps_m)))) + Float64(Float64(1.0 / eps_m) * 0.5))) + Float64(-1.0 / eps_m))) / 2.0); elseif (x <= -4.2e-10) tmp = Float64(Float64(Float64(Float64(t_0 * t_0) + Float64(t_1 * Float64(t_2 / eps_m))) / Float64(t_2 - t_1)) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif ((x <= 7.8e+92) || !(x <= 5.4e+168)) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); else tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * (1.0 + eps_m); t_1 = t_0 / eps_m; t_2 = x * (-1.0 - eps_m); tmp = 0.0; if (x <= -1.05e+65) tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0; elseif (x <= -4.2e-10) tmp = (((t_0 * t_0) + (t_1 * (t_2 / eps_m))) / (t_2 - t_1)) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif ((x <= 7.8e+92) || ~((x <= 5.4e+168))) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; else tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / eps$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+65], N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 7.233796296296296e-5), $MachinePrecision] - N[(0.16666666666666666 * N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -4.2e-10], N[(N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(t$95$2 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 7.8e+92], N[Not[LessEqual[x, 5.4e+168]], $MachinePrecision]], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(1 + eps\_m\right)\\
t_1 := \frac{t\_0}{eps\_m}\\
t_2 := x \cdot \left(-1 - eps\_m\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 7.233796296296296 \cdot 10^{-5} - 0.16666666666666666 \cdot \frac{1}{eps\_m}\right) + \frac{1}{eps\_m} \cdot 0.5\right) + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{\frac{t\_0 \cdot t\_0 + t\_1 \cdot \frac{t\_2}{eps\_m}}{t\_2 - t\_1}}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+92} \lor \neg \left(x \leq 5.4 \cdot 10^{+168}\right):\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{eps\_m}}{2}\\
\end{array}
\end{array}
if x < -1.04999999999999996e65Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 30.2%
Applied egg-rr88.7%
+-commutative88.7%
associate--l+88.7%
metadata-eval88.7%
+-rgt-identity88.7%
Simplified88.7%
if -1.04999999999999996e65 < x < -4.2e-10Initial program 82.5%
Simplified82.5%
Taylor expanded in x around 0 37.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
*-commutative3.3%
distribute-rgt-neg-in3.3%
mul-1-neg3.3%
distribute-lft-in3.3%
metadata-eval3.3%
neg-mul-13.3%
distribute-neg-frac3.3%
metadata-eval3.3%
Simplified3.3%
Applied egg-rr12.9%
if -4.2e-10 < x < 1.4199999999999999Initial program 54.2%
Simplified54.2%
Taylor expanded in eps around 0 74.2%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Applied egg-rr73.8%
if 1.4199999999999999 < x < 7.80000000000000022e92 or 5.40000000000000031e168 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 30.5%
Taylor expanded in x around 0 56.9%
if 7.80000000000000022e92 < x < 5.40000000000000031e168Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.2%
Taylor expanded in eps around 0 1.8%
expm1-define1.8%
neg-mul-11.8%
Simplified1.8%
Taylor expanded in x around 0 38.0%
Final simplification64.8%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ 1.0 eps_m) eps_m))
(t_1
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps_m)
2.0)))
(if (<= x -2.6e+77)
t_1
(if (<= x -1e-11)
(/
(*
x
(/
(- (* (+ 1.0 eps_m) (+ 1.0 eps_m)) (* t_0 t_0))
(- (- -1.0 eps_m) t_0)))
2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (or (<= x 3.4e+93) (not (<= x 9.4e+170)))
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
t_1))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (1.0 + eps_m) / eps_m;
double t_1 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
double tmp;
if (x <= -2.6e+77) {
tmp = t_1;
} else if (x <= -1e-11) {
tmp = (x * ((((1.0 + eps_m) * (1.0 + eps_m)) - (t_0 * t_0)) / ((-1.0 - eps_m) - t_0))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 3.4e+93) || !(x <= 9.4e+170)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.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 = (1.0d0 + eps_m) / eps_m
t_1 = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps_m) / 2.0d0
if (x <= (-2.6d+77)) then
tmp = t_1
else if (x <= (-1d-11)) then
tmp = (x * ((((1.0d0 + eps_m) * (1.0d0 + eps_m)) - (t_0 * t_0)) / (((-1.0d0) - eps_m) - t_0))) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if ((x <= 3.4d+93) .or. (.not. (x <= 9.4d+170))) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
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 = (1.0 + eps_m) / eps_m;
double t_1 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
double tmp;
if (x <= -2.6e+77) {
tmp = t_1;
} else if (x <= -1e-11) {
tmp = (x * ((((1.0 + eps_m) * (1.0 + eps_m)) - (t_0 * t_0)) / ((-1.0 - eps_m) - t_0))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 3.4e+93) || !(x <= 9.4e+170)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = t_1;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (1.0 + eps_m) / eps_m t_1 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0 tmp = 0 if x <= -2.6e+77: tmp = t_1 elif x <= -1e-11: tmp = (x * ((((1.0 + eps_m) * (1.0 + eps_m)) - (t_0 * t_0)) / ((-1.0 - eps_m) - t_0))) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif (x <= 3.4e+93) or not (x <= 9.4e+170): tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 else: tmp = t_1 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(1.0 + eps_m) / eps_m) t_1 = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0) tmp = 0.0 if (x <= -2.6e+77) tmp = t_1; elseif (x <= -1e-11) tmp = Float64(Float64(x * Float64(Float64(Float64(Float64(1.0 + eps_m) * Float64(1.0 + eps_m)) - Float64(t_0 * t_0)) / Float64(Float64(-1.0 - eps_m) - t_0))) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif ((x <= 3.4e+93) || !(x <= 9.4e+170)) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); else tmp = t_1; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (1.0 + eps_m) / eps_m; t_1 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0; tmp = 0.0; if (x <= -2.6e+77) tmp = t_1; elseif (x <= -1e-11) tmp = (x * ((((1.0 + eps_m) * (1.0 + eps_m)) - (t_0 * t_0)) / ((-1.0 - eps_m) - t_0))) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif ((x <= 3.4e+93) || ~((x <= 9.4e+170))) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.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[(1.0 + eps$95$m), $MachinePrecision] / eps$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.6e+77], t$95$1, If[LessEqual[x, -1e-11], N[(N[(x * N[(N[(N[(N[(1.0 + eps$95$m), $MachinePrecision] * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 - eps$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 3.4e+93], N[Not[LessEqual[x, 9.4e+170]], $MachinePrecision]], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{1 + eps\_m}{eps\_m}\\
t_1 := \frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{eps\_m}}{2}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot \frac{\left(1 + eps\_m\right) \cdot \left(1 + eps\_m\right) - t\_0 \cdot t\_0}{\left(-1 - eps\_m\right) - t\_0}}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+93} \lor \neg \left(x \leq 9.4 \cdot 10^{+170}\right):\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.6000000000000002e77 or 3.4e93 < x < 9.40000000000000008e170Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 48.2%
Taylor expanded in eps around 0 21.0%
expm1-define21.0%
neg-mul-121.0%
Simplified21.0%
Taylor expanded in x around 0 40.2%
if -2.6000000000000002e77 < x < -9.99999999999999939e-12Initial program 85.2%
Simplified85.2%
Taylor expanded in x around 0 36.7%
Taylor expanded in x around inf 2.9%
mul-1-neg2.9%
distribute-rgt-neg-in2.9%
*-commutative2.9%
distribute-rgt-neg-in2.9%
mul-1-neg2.9%
distribute-lft-in2.9%
metadata-eval2.9%
neg-mul-12.9%
distribute-neg-frac2.9%
metadata-eval2.9%
Simplified2.9%
distribute-lft-in2.9%
flip-+7.2%
Applied egg-rr26.2%
*-commutative26.2%
neg-mul-126.2%
distribute-neg-in26.2%
metadata-eval26.2%
sub-neg26.2%
*-commutative26.2%
neg-mul-126.2%
distribute-neg-in26.2%
metadata-eval26.2%
sub-neg26.2%
*-lft-identity26.2%
*-lft-identity26.2%
*-lft-identity26.2%
+-commutative26.2%
*-lft-identity26.2%
+-commutative26.2%
Simplified26.2%
if -9.99999999999999939e-12 < x < 1.4199999999999999Initial program 54.2%
Simplified54.2%
Taylor expanded in eps around 0 74.2%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
Applied egg-rr73.8%
if 1.4199999999999999 < x < 3.4e93 or 9.40000000000000008e170 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 30.5%
Taylor expanded in x around 0 56.9%
Final simplification61.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -70000000.0)
(/
(*
x
(+
(*
x
(+
(*
x
(- (* x 7.233796296296296e-5) (* 0.16666666666666666 (/ 1.0 eps_m))))
(* (/ 1.0 eps_m) 0.5)))
(/ -1.0 eps_m)))
2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (or (<= x 1.6e+94) (not (<= x 1.9e+171)))
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
(/
(/
(*
x
(+
-1.0
(*
x
(+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps_m)
2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 1.6e+94) || !(x <= 1.9e+171)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-70000000.0d0)) then
tmp = (x * ((x * ((x * ((x * 7.233796296296296d-5) - (0.16666666666666666d0 * (1.0d0 / eps_m)))) + ((1.0d0 / eps_m) * 0.5d0))) + ((-1.0d0) / eps_m))) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if ((x <= 1.6d+94) .or. (.not. (x <= 1.9d+171))) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
else
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 1.6e+94) || !(x <= 1.9e+171)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -70000000.0: tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif (x <= 1.6e+94) or not (x <= 1.9e+171): tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 else: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -70000000.0) tmp = Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 7.233796296296296e-5) - Float64(0.16666666666666666 * Float64(1.0 / eps_m)))) + Float64(Float64(1.0 / eps_m) * 0.5))) + Float64(-1.0 / eps_m))) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif ((x <= 1.6e+94) || !(x <= 1.9e+171)) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); else tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -70000000.0) tmp = (x * ((x * ((x * ((x * 7.233796296296296e-5) - (0.16666666666666666 * (1.0 / eps_m)))) + ((1.0 / eps_m) * 0.5))) + (-1.0 / eps_m))) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif ((x <= 1.6e+94) || ~((x <= 1.9e+171))) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; else tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -70000000.0], N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 7.233796296296296e-5), $MachinePrecision] - N[(0.16666666666666666 * N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / eps$95$m), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1.6e+94], N[Not[LessEqual[x, 1.9e+171]], $MachinePrecision]], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -70000000:\\
\;\;\;\;\frac{x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 7.233796296296296 \cdot 10^{-5} - 0.16666666666666666 \cdot \frac{1}{eps\_m}\right) + \frac{1}{eps\_m} \cdot 0.5\right) + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+94} \lor \neg \left(x \leq 1.9 \cdot 10^{+171}\right):\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{eps\_m}}{2}\\
\end{array}
\end{array}
if x < -7e7Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 54.3%
Taylor expanded in eps around 0 47.2%
expm1-define47.2%
neg-mul-147.2%
Simplified47.2%
Taylor expanded in x around 0 20.7%
Applied egg-rr60.8%
+-commutative60.8%
associate--l+60.8%
metadata-eval60.8%
+-rgt-identity60.8%
Simplified60.8%
if -7e7 < x < 1.4199999999999999Initial program 53.7%
Simplified53.7%
Taylor expanded in eps around 0 72.4%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
Applied egg-rr71.7%
if 1.4199999999999999 < x < 1.60000000000000007e94 or 1.9000000000000001e171 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 30.5%
Taylor expanded in x around 0 56.9%
if 1.60000000000000007e94 < x < 1.9000000000000001e171Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.2%
Taylor expanded in eps around 0 1.8%
expm1-define1.8%
neg-mul-11.8%
Simplified1.8%
Taylor expanded in x around 0 38.0%
Final simplification64.4%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps_m)
2.0)))
(if (<= x -12000000.0)
t_0
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (or (<= x 1.8e+92) (not (<= x 1.85e+171)))
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
t_0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
double tmp;
if (x <= -12000000.0) {
tmp = t_0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 1.8e+92) || !(x <= 1.85e+171)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} 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) :: tmp
t_0 = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps_m) / 2.0d0
if (x <= (-12000000.0d0)) then
tmp = t_0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if ((x <= 1.8d+92) .or. (.not. (x <= 1.85d+171))) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
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 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0;
double tmp;
if (x <= -12000000.0) {
tmp = t_0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 1.8e+92) || !(x <= 1.85e+171)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0 tmp = 0 if x <= -12000000.0: tmp = t_0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif (x <= 1.8e+92) or not (x <= 1.85e+171): tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0) tmp = 0.0 if (x <= -12000000.0) tmp = t_0; elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif ((x <= 1.8e+92) || !(x <= 1.85e+171)) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps_m) / 2.0; tmp = 0.0; if (x <= -12000000.0) tmp = t_0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif ((x <= 1.8e+92) || ~((x <= 1.85e+171))) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; 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[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -12000000.0], t$95$0, If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1.8e+92], N[Not[LessEqual[x, 1.85e+171]], $MachinePrecision]], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{eps\_m}}{2}\\
\mathbf{if}\;x \leq -12000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+92} \lor \neg \left(x \leq 1.85 \cdot 10^{+171}\right):\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.2e7 or 1.8e92 < x < 1.84999999999999999e171Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 48.2%
Taylor expanded in eps around 0 29.1%
expm1-define29.1%
neg-mul-129.1%
Simplified29.1%
Taylor expanded in x around 0 30.7%
if -1.2e7 < x < 1.4199999999999999Initial program 53.7%
Simplified53.7%
Taylor expanded in eps around 0 72.4%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
Applied egg-rr71.7%
if 1.4199999999999999 < x < 1.8e92 or 1.84999999999999999e171 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 30.5%
Taylor expanded in x around 0 56.9%
Final simplification59.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0
(/
(*
x
(/
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666)))))
eps_m))
2.0)))
(if (<= x -16000000.0)
t_0
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(if (or (<= x 2.7e+103) (not (<= x 7.4e+167)))
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)
t_0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (x * ((-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666))))) / eps_m)) / 2.0;
double tmp;
if (x <= -16000000.0) {
tmp = t_0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 2.7e+103) || !(x <= 7.4e+167)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} 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) :: tmp
t_0 = (x * (((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0))))) / eps_m)) / 2.0d0
if (x <= (-16000000.0d0)) then
tmp = t_0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else if ((x <= 2.7d+103) .or. (.not. (x <= 7.4d+167))) then
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
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 = (x * ((-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666))))) / eps_m)) / 2.0;
double tmp;
if (x <= -16000000.0) {
tmp = t_0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else if ((x <= 2.7e+103) || !(x <= 7.4e+167)) {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (x * ((-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666))))) / eps_m)) / 2.0 tmp = 0 if x <= -16000000.0: tmp = t_0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 elif (x <= 2.7e+103) or not (x <= 7.4e+167): tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(x * Float64(Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666))))) / eps_m)) / 2.0) tmp = 0.0 if (x <= -16000000.0) tmp = t_0; elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); elseif ((x <= 2.7e+103) || !(x <= 7.4e+167)) tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (x * ((-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666))))) / eps_m)) / 2.0; tmp = 0.0; if (x <= -16000000.0) tmp = t_0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; elseif ((x <= 2.7e+103) || ~((x <= 7.4e+167))) tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; 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[(x * N[(N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -16000000.0], t$95$0, If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 2.7e+103], N[Not[LessEqual[x, 7.4e+167]], $MachinePrecision]], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{x \cdot \frac{-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)}{eps\_m}}{2}\\
\mathbf{if}\;x \leq -16000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+103} \lor \neg \left(x \leq 7.4 \cdot 10^{+167}\right):\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.6e7 or 2.69999999999999993e103 < x < 7.4000000000000002e167Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 47.2%
Taylor expanded in eps around 0 30.5%
expm1-define30.5%
neg-mul-130.5%
Simplified30.5%
Taylor expanded in x around 0 23.9%
Taylor expanded in eps around 0 27.1%
if -1.6e7 < x < 1.4199999999999999Initial program 53.7%
Simplified53.7%
Taylor expanded in eps around 0 72.4%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
Applied egg-rr71.7%
if 1.4199999999999999 < x < 2.69999999999999993e103 or 7.4000000000000002e167 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 32.9%
Taylor expanded in x around 0 55.6%
Final simplification58.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e+103)
(/ (/ (* x (+ -1.0 (* x (+ 0.5 (* x -0.16666666666666666))))) eps_m) 2.0)
(if (<= x -1.0)
(/ (* x (+ (+ 1.0 (/ 1.0 eps_m)) (- -1.0 eps_m))) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e+103) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps_m) / 2.0;
} else if (x <= -1.0) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1d+103)) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * (-0.16666666666666666d0)))))) / eps_m) / 2.0d0
else if (x <= (-1.0d0)) then
tmp = (x * ((1.0d0 + (1.0d0 / eps_m)) + ((-1.0d0) - eps_m))) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1e+103) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps_m) / 2.0;
} else if (x <= -1.0) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e+103: tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps_m) / 2.0 elif x <= -1.0: tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 else: tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e+103) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * -0.16666666666666666))))) / eps_m) / 2.0); elseif (x <= -1.0) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(-1.0 - eps_m))) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); else tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1e+103) tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps_m) / 2.0; elseif (x <= -1.0) tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; else tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1e+103], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -1.0], N[(N[(x * N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+103}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq -1:\\
\;\;\;\;\frac{x \cdot \left(\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < -1e103Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 56.9%
Taylor expanded in eps around 0 44.4%
expm1-define44.4%
neg-mul-144.4%
Simplified44.4%
Taylor expanded in x around 0 44.4%
if -1e103 < x < -1Initial program 90.0%
Simplified90.0%
Taylor expanded in x around 0 32.0%
Taylor expanded in x around inf 2.7%
mul-1-neg2.7%
distribute-rgt-neg-in2.7%
*-commutative2.7%
distribute-rgt-neg-in2.7%
mul-1-neg2.7%
distribute-lft-in2.7%
metadata-eval2.7%
neg-mul-12.7%
distribute-neg-frac2.7%
metadata-eval2.7%
Simplified2.7%
*-commutative2.7%
sub-neg2.7%
distribute-rgt-in2.7%
*-un-lft-identity2.7%
metadata-eval2.7%
add-sqr-sqrt0.1%
sqrt-unprod2.1%
sqr-neg2.1%
sqrt-unprod2.0%
add-sqr-sqrt2.3%
frac-2neg2.3%
add-sqr-sqrt2.0%
sqrt-unprod27.9%
sqr-neg27.9%
sqrt-unprod21.3%
add-sqr-sqrt21.5%
metadata-eval21.5%
add-sqr-sqrt21.3%
sqrt-unprod26.5%
sqr-neg26.5%
sqrt-unprod0.2%
add-sqr-sqrt21.5%
frac-2neg21.5%
Applied egg-rr21.5%
distribute-rgt1-in21.5%
+-commutative21.5%
+-commutative21.5%
distribute-rgt-in21.5%
associate-*l/21.5%
*-lft-identity21.5%
neg-mul-121.5%
unsub-neg21.5%
*-lft-identity21.5%
associate-*l/21.5%
+-commutative21.5%
distribute-lft-in21.5%
lft-mult-inverse21.5%
*-rgt-identity21.5%
+-commutative21.5%
Simplified21.5%
if -1 < x < 1.4199999999999999Initial program 54.4%
Simplified54.4%
Taylor expanded in eps around 0 73.4%
Taylor expanded in x around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
Simplified72.6%
Applied egg-rr72.6%
if 1.4199999999999999 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 33.6%
Taylor expanded in x around 0 46.6%
Final simplification59.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -6.6)
(/ (* x (+ (+ 1.0 (/ 1.0 eps_m)) (- -1.0 eps_m))) 2.0)
(if (<= x 1.42)
(/ (- 2.0 (* x x)) 2.0)
(/ (- (+ 1.0 (/ -1.0 eps_m)) (- -1.0 (/ 1.0 eps_m))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -6.6) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-6.6d0)) then
tmp = (x * ((1.0d0 + (1.0d0 / eps_m)) + ((-1.0d0) - eps_m))) / 2.0d0
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else
tmp = ((1.0d0 + ((-1.0d0) / eps_m)) - ((-1.0d0) - (1.0d0 / eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -6.6) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -6.6: tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0 elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 else: tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -6.6) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(-1.0 - eps_m))) / 2.0); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); else tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / eps_m)) - Float64(-1.0 - Float64(1.0 / eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -6.6) tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0; elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; else tmp = ((1.0 + (-1.0 / eps_m)) - (-1.0 - (1.0 / eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -6.6], N[(N[(x * N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] - N[(-1.0 - N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6:\\
\;\;\;\;\frac{x \cdot \left(\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \frac{-1}{eps\_m}\right) - \left(-1 - \frac{1}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < -6.5999999999999996Initial program 94.7%
Simplified94.7%
Taylor expanded in x around 0 46.3%
Taylor expanded in x around inf 20.4%
mul-1-neg20.4%
distribute-rgt-neg-in20.4%
*-commutative20.4%
distribute-rgt-neg-in20.4%
mul-1-neg20.4%
distribute-lft-in20.4%
metadata-eval20.4%
neg-mul-120.4%
distribute-neg-frac20.4%
metadata-eval20.4%
Simplified20.4%
*-commutative20.4%
sub-neg20.4%
distribute-rgt-in20.4%
*-un-lft-identity20.4%
metadata-eval20.4%
add-sqr-sqrt0.1%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod19.9%
add-sqr-sqrt20.1%
frac-2neg20.1%
add-sqr-sqrt19.9%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod22.5%
add-sqr-sqrt22.6%
metadata-eval22.6%
add-sqr-sqrt22.5%
sqrt-unprod25.2%
sqr-neg25.2%
sqrt-unprod0.1%
add-sqr-sqrt22.6%
frac-2neg22.6%
Applied egg-rr22.6%
distribute-rgt1-in22.6%
+-commutative22.6%
+-commutative22.6%
distribute-rgt-in22.6%
associate-*l/22.6%
*-lft-identity22.6%
neg-mul-122.6%
unsub-neg22.6%
*-lft-identity22.6%
associate-*l/22.6%
+-commutative22.6%
distribute-lft-in22.6%
lft-mult-inverse22.6%
*-rgt-identity22.6%
+-commutative22.6%
Simplified22.6%
if -6.5999999999999996 < x < 1.4199999999999999Initial program 54.4%
Simplified54.4%
Taylor expanded in eps around 0 73.4%
Taylor expanded in x around 0 72.6%
mul-1-neg72.6%
unsub-neg72.6%
Simplified72.6%
Applied egg-rr72.6%
if 1.4199999999999999 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 33.6%
Taylor expanded in x around 0 46.6%
Final simplification58.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.0) (/ (* x (+ (+ 1.0 (/ 1.0 eps_m)) (- -1.0 eps_m))) 2.0) (/ (+ 2.0 (* x (+ -1.0 eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (x * ((1.0d0 + (1.0d0 / eps_m)) + ((-1.0d0) - eps_m))) / 2.0d0
else
tmp = (2.0d0 + (x * ((-1.0d0) + eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0;
} else {
tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.0: tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0 else: tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(-1.0 - eps_m))) / 2.0); else tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -1.0) tmp = (x * ((1.0 + (1.0 / eps_m)) + (-1.0 - eps_m))) / 2.0; else tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -1.0], N[(N[(x * N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(2.0 + N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{x \cdot \left(\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - eps\_m\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + eps\_m\right)}{2}\\
\end{array}
\end{array}
if x < -1Initial program 94.7%
Simplified94.7%
Taylor expanded in x around 0 46.3%
Taylor expanded in x around inf 20.4%
mul-1-neg20.4%
distribute-rgt-neg-in20.4%
*-commutative20.4%
distribute-rgt-neg-in20.4%
mul-1-neg20.4%
distribute-lft-in20.4%
metadata-eval20.4%
neg-mul-120.4%
distribute-neg-frac20.4%
metadata-eval20.4%
Simplified20.4%
*-commutative20.4%
sub-neg20.4%
distribute-rgt-in20.4%
*-un-lft-identity20.4%
metadata-eval20.4%
add-sqr-sqrt0.1%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod19.9%
add-sqr-sqrt20.1%
frac-2neg20.1%
add-sqr-sqrt19.9%
sqrt-unprod47.3%
sqr-neg47.3%
sqrt-unprod22.5%
add-sqr-sqrt22.6%
metadata-eval22.6%
add-sqr-sqrt22.5%
sqrt-unprod25.2%
sqr-neg25.2%
sqrt-unprod0.1%
add-sqr-sqrt22.6%
frac-2neg22.6%
Applied egg-rr22.6%
distribute-rgt1-in22.6%
+-commutative22.6%
+-commutative22.6%
distribute-rgt-in22.6%
associate-*l/22.6%
*-lft-identity22.6%
neg-mul-122.6%
unsub-neg22.6%
*-lft-identity22.6%
associate-*l/22.6%
+-commutative22.6%
distribute-lft-in22.6%
lft-mult-inverse22.6%
*-rgt-identity22.6%
+-commutative22.6%
Simplified22.6%
if -1 < x Initial program 68.9%
Simplified68.9%
Taylor expanded in x around 0 37.0%
Taylor expanded in eps around inf 67.2%
associate-*r*67.2%
neg-mul-167.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in x around 0 54.2%
mul-1-neg54.2%
distribute-rgt-neg-in54.2%
sub-neg54.2%
metadata-eval54.2%
distribute-neg-in54.2%
+-commutative54.2%
remove-double-neg54.2%
+-commutative54.2%
Simplified54.2%
Final simplification49.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -3500000.0) (* (* x 1.000072337962963) (* x 1.000072337962963)) (if (<= x 1.42) (/ (- 2.0 (* x x)) 2.0) (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -3500000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-3500000.0d0)) then
tmp = (x * 1.000072337962963d0) * (x * 1.000072337962963d0)
else if (x <= 1.42d0) then
tmp = (2.0d0 - (x * x)) / 2.0d0
else
tmp = (x * eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -3500000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else if (x <= 1.42) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -3500000.0: tmp = (x * 1.000072337962963) * (x * 1.000072337962963) elif x <= 1.42: tmp = (2.0 - (x * x)) / 2.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -3500000.0) tmp = Float64(Float64(x * 1.000072337962963) * Float64(x * 1.000072337962963)); elseif (x <= 1.42) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); else tmp = Float64(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 (x <= -3500000.0) tmp = (x * 1.000072337962963) * (x * 1.000072337962963); elseif (x <= 1.42) tmp = (2.0 - (x * x)) / 2.0; else tmp = (x * eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -3500000.0], N[(N[(x * 1.000072337962963), $MachinePrecision] * N[(x * 1.000072337962963), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.42], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3500000:\\
\;\;\;\;\left(x \cdot 1.000072337962963\right) \cdot \left(x \cdot 1.000072337962963\right)\\
\mathbf{elif}\;x \leq 1.42:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -3.5e6Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 54.3%
Taylor expanded in eps around 0 47.2%
expm1-define47.2%
neg-mul-147.2%
Simplified47.2%
Taylor expanded in x around 0 20.7%
Applied egg-rr39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
Simplified39.2%
if -3.5e6 < x < 1.4199999999999999Initial program 53.7%
Simplified53.7%
Taylor expanded in eps around 0 72.4%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
Applied egg-rr71.7%
if 1.4199999999999999 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 26.3%
Taylor expanded in x around inf 17.6%
mul-1-neg17.6%
distribute-rgt-neg-in17.6%
*-commutative17.6%
distribute-rgt-neg-in17.6%
mul-1-neg17.6%
distribute-lft-in17.6%
metadata-eval17.6%
neg-mul-117.6%
distribute-neg-frac17.6%
metadata-eval17.6%
Simplified17.6%
Taylor expanded in eps around inf 18.5%
Final simplification52.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (or (<= x -2900000.0) (not (<= x 6.6e+69))) (* x (* x 1.000072337962963)) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((x <= -2900000.0) || !(x <= 6.6e+69)) {
tmp = x * (x * 1.000072337962963);
} else {
tmp = 1.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if ((x <= (-2900000.0d0)) .or. (.not. (x <= 6.6d+69))) then
tmp = x * (x * 1.000072337962963d0)
else
tmp = 1.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if ((x <= -2900000.0) || !(x <= 6.6e+69)) {
tmp = x * (x * 1.000072337962963);
} else {
tmp = 1.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if (x <= -2900000.0) or not (x <= 6.6e+69): tmp = x * (x * 1.000072337962963) else: tmp = 1.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if ((x <= -2900000.0) || !(x <= 6.6e+69)) tmp = Float64(x * Float64(x * 1.000072337962963)); else tmp = 1.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if ((x <= -2900000.0) || ~((x <= 6.6e+69))) tmp = x * (x * 1.000072337962963); else tmp = 1.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[Or[LessEqual[x, -2900000.0], N[Not[LessEqual[x, 6.6e+69]], $MachinePrecision]], N[(x * N[(x * 1.000072337962963), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2900000 \lor \neg \left(x \leq 6.6 \cdot 10^{+69}\right):\\
\;\;\;\;x \cdot \left(x \cdot 1.000072337962963\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.9e6 or 6.5999999999999997e69 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 40.1%
Taylor expanded in eps around 0 19.8%
expm1-define19.8%
neg-mul-119.8%
Simplified19.8%
Taylor expanded in x around 0 23.1%
Applied egg-rr33.4%
*-commutative33.4%
distribute-lft1-in33.4%
metadata-eval33.4%
Simplified33.4%
if -2.9e6 < x < 6.5999999999999997e69Initial program 57.6%
Simplified57.6%
Taylor expanded in x around 0 39.2%
Taylor expanded in eps around inf 78.3%
associate-*r*78.3%
neg-mul-178.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x around 0 65.6%
Final simplification54.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -2900000.0) (* (* x 1.000072337962963) (* x 1.000072337962963)) (if (<= x 36.0) 1.0 (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else if (x <= 36.0) {
tmp = 1.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-2900000.0d0)) then
tmp = (x * 1.000072337962963d0) * (x * 1.000072337962963d0)
else if (x <= 36.0d0) then
tmp = 1.0d0
else
tmp = (x * eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else if (x <= 36.0) {
tmp = 1.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2900000.0: tmp = (x * 1.000072337962963) * (x * 1.000072337962963) elif x <= 36.0: tmp = 1.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2900000.0) tmp = Float64(Float64(x * 1.000072337962963) * Float64(x * 1.000072337962963)); elseif (x <= 36.0) tmp = 1.0; else tmp = Float64(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 (x <= -2900000.0) tmp = (x * 1.000072337962963) * (x * 1.000072337962963); elseif (x <= 36.0) tmp = 1.0; else tmp = (x * eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2900000.0], N[(N[(x * 1.000072337962963), $MachinePrecision] * N[(x * 1.000072337962963), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 36.0], 1.0, N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2900000:\\
\;\;\;\;\left(x \cdot 1.000072337962963\right) \cdot \left(x \cdot 1.000072337962963\right)\\
\mathbf{elif}\;x \leq 36:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -2.9e6Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 54.3%
Taylor expanded in eps around 0 47.2%
expm1-define47.2%
neg-mul-147.2%
Simplified47.2%
Taylor expanded in x around 0 20.7%
Applied egg-rr39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
Simplified39.2%
if -2.9e6 < x < 36Initial program 53.7%
Simplified53.7%
Taylor expanded in x around 0 38.8%
Taylor expanded in eps around inf 81.5%
associate-*r*81.5%
neg-mul-181.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in x around 0 71.3%
if 36 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 26.3%
Taylor expanded in x around inf 17.6%
mul-1-neg17.6%
distribute-rgt-neg-in17.6%
*-commutative17.6%
distribute-rgt-neg-in17.6%
mul-1-neg17.6%
distribute-lft-in17.6%
metadata-eval17.6%
neg-mul-117.6%
distribute-neg-frac17.6%
metadata-eval17.6%
Simplified17.6%
Taylor expanded in eps around inf 18.5%
Final simplification52.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -2900000.0) (* x (* x 1.000072337962963)) (if (<= x 39.0) 1.0 (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = x * (x * 1.000072337962963);
} else if (x <= 39.0) {
tmp = 1.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-2900000.0d0)) then
tmp = x * (x * 1.000072337962963d0)
else if (x <= 39.0d0) then
tmp = 1.0d0
else
tmp = (x * eps_m) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = x * (x * 1.000072337962963);
} else if (x <= 39.0) {
tmp = 1.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2900000.0: tmp = x * (x * 1.000072337962963) elif x <= 39.0: tmp = 1.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2900000.0) tmp = Float64(x * Float64(x * 1.000072337962963)); elseif (x <= 39.0) tmp = 1.0; else tmp = Float64(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 (x <= -2900000.0) tmp = x * (x * 1.000072337962963); elseif (x <= 39.0) tmp = 1.0; else tmp = (x * eps_m) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2900000.0], N[(x * N[(x * 1.000072337962963), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 39.0], 1.0, N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2900000:\\
\;\;\;\;x \cdot \left(x \cdot 1.000072337962963\right)\\
\mathbf{elif}\;x \leq 39:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -2.9e6Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 54.3%
Taylor expanded in eps around 0 47.2%
expm1-define47.2%
neg-mul-147.2%
Simplified47.2%
Taylor expanded in x around 0 20.7%
Applied egg-rr39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
Simplified39.2%
if -2.9e6 < x < 39Initial program 53.7%
Simplified53.7%
Taylor expanded in x around 0 38.8%
Taylor expanded in eps around inf 81.5%
associate-*r*81.5%
neg-mul-181.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in x around 0 71.3%
if 39 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 26.3%
Taylor expanded in x around inf 17.6%
mul-1-neg17.6%
distribute-rgt-neg-in17.6%
*-commutative17.6%
distribute-rgt-neg-in17.6%
mul-1-neg17.6%
distribute-lft-in17.6%
metadata-eval17.6%
neg-mul-117.6%
distribute-neg-frac17.6%
metadata-eval17.6%
Simplified17.6%
Taylor expanded in eps around inf 18.5%
Final simplification52.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -2900000.0) (* (* x 1.000072337962963) (* x 1.000072337962963)) (/ (+ 2.0 (* x (+ -1.0 eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else {
tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-2900000.0d0)) then
tmp = (x * 1.000072337962963d0) * (x * 1.000072337962963d0)
else
tmp = (2.0d0 + (x * ((-1.0d0) + eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -2900000.0) {
tmp = (x * 1.000072337962963) * (x * 1.000072337962963);
} else {
tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2900000.0: tmp = (x * 1.000072337962963) * (x * 1.000072337962963) else: tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2900000.0) tmp = Float64(Float64(x * 1.000072337962963) * Float64(x * 1.000072337962963)); else tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 + eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -2900000.0) tmp = (x * 1.000072337962963) * (x * 1.000072337962963); else tmp = (2.0 + (x * (-1.0 + eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2900000.0], N[(N[(x * 1.000072337962963), $MachinePrecision] * N[(x * 1.000072337962963), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2900000:\\
\;\;\;\;\left(x \cdot 1.000072337962963\right) \cdot \left(x \cdot 1.000072337962963\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 + eps\_m\right)}{2}\\
\end{array}
\end{array}
if x < -2.9e6Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 54.3%
Taylor expanded in eps around 0 47.2%
expm1-define47.2%
neg-mul-147.2%
Simplified47.2%
Taylor expanded in x around 0 20.7%
Applied egg-rr39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
*-commutative39.2%
distribute-lft1-in39.2%
metadata-eval39.2%
Simplified39.2%
if -2.9e6 < x Initial program 68.2%
Simplified68.2%
Taylor expanded in x around 0 37.1%
Taylor expanded in eps around inf 66.6%
associate-*r*66.6%
neg-mul-166.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in x around 0 53.7%
mul-1-neg53.7%
distribute-rgt-neg-in53.7%
sub-neg53.7%
metadata-eval53.7%
distribute-neg-in53.7%
+-commutative53.7%
remove-double-neg53.7%
+-commutative53.7%
Simplified53.7%
Final simplification51.7%
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 72.7%
Simplified72.7%
Taylor expanded in x around 0 39.5%
Taylor expanded in eps around inf 64.8%
associate-*r*64.8%
neg-mul-164.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in x around 0 43.4%
herbie shell --seed 2024150
(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))