
(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 14 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 126.0) (/ (+ x 1.0) (exp x)) (/ (+ (exp (* x (- -1.0 eps_m))) (exp (* x eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / exp(x);
} else {
tmp = (exp((x * (-1.0 - eps_m))) + exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 126.0d0) then
tmp = (x + 1.0d0) / exp(x)
else
tmp = (exp((x * ((-1.0d0) - eps_m))) + exp((x * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / Math.exp(x);
} else {
tmp = (Math.exp((x * (-1.0 - 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 <= 126.0: tmp = (x + 1.0) / math.exp(x) else: tmp = (math.exp((x * (-1.0 - 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 <= 126.0) tmp = Float64(Float64(x + 1.0) / exp(x)); else tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 - eps_m))) + exp(Float64(x * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 126.0) tmp = (x + 1.0) / exp(x); else tmp = (exp((x * (-1.0 - eps_m))) + exp((x * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 126.0], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 - eps\_m\right)} + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if eps < 126Initial program 67.2%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Simplified65.4%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
clear-numN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Applied egg-rr65.4%
if 126 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification73.7%
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 75.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified98.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 126.0)
(/ (+ x 1.0) (exp x))
(/
(+
(exp (* x eps_m))
(+
1.0
(* x (+ (- -1.0 eps_m) (* 0.5 (* (+ eps_m 1.0) (* x (+ eps_m 1.0))))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / exp(x);
} else {
tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 126.0d0) then
tmp = (x + 1.0d0) / exp(x)
else
tmp = (exp((x * eps_m)) + (1.0d0 + (x * (((-1.0d0) - eps_m) + (0.5d0 * ((eps_m + 1.0d0) * (x * (eps_m + 1.0d0)))))))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / Math.exp(x);
} else {
tmp = (Math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 126.0: tmp = (x + 1.0) / math.exp(x) else: tmp = (math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 126.0) tmp = Float64(Float64(x + 1.0) / exp(x)); else tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 + Float64(x * Float64(Float64(-1.0 - eps_m) + Float64(0.5 * Float64(Float64(eps_m + 1.0) * Float64(x * Float64(eps_m + 1.0)))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 126.0) tmp = (x + 1.0) / exp(x); else tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 126.0], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(N[(-1.0 - eps$95$m), $MachinePrecision] + N[(0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(x * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 + x \cdot \left(\left(-1 - eps\_m\right) + 0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(x \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)}{2}\\
\end{array}
\end{array}
if eps < 126Initial program 67.2%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Simplified65.4%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
clear-numN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Applied egg-rr65.4%
if 126 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified86.9%
Final simplification70.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 126.0)
(/ (+ x 1.0) (exp x))
(/
(+
(exp (* x eps_m))
(+ 1.0 (* x (+ (- -1.0 eps_m) (* 0.5 (* (* x eps_m) (+ eps_m 1.0)))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / exp(x);
} else {
tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 126.0d0) then
tmp = (x + 1.0d0) / exp(x)
else
tmp = (exp((x * eps_m)) + (1.0d0 + (x * (((-1.0d0) - eps_m) + (0.5d0 * ((x * eps_m) * (eps_m + 1.0d0))))))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = (x + 1.0) / Math.exp(x);
} else {
tmp = (Math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 126.0: tmp = (x + 1.0) / math.exp(x) else: tmp = (math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 126.0) tmp = Float64(Float64(x + 1.0) / exp(x)); else tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 + Float64(x * Float64(Float64(-1.0 - eps_m) + Float64(0.5 * Float64(Float64(x * eps_m) * Float64(eps_m + 1.0))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 126.0) tmp = (x + 1.0) / exp(x); else tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 126.0], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(N[(-1.0 - eps$95$m), $MachinePrecision] + N[(0.5 * N[(N[(x * eps$95$m), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 + x \cdot \left(\left(-1 - eps\_m\right) + 0.5 \cdot \left(\left(x \cdot eps\_m\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)}{2}\\
\end{array}
\end{array}
if eps < 126Initial program 67.2%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Simplified65.4%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
clear-numN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Applied egg-rr65.4%
if 126 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified86.9%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f6486.9%
Simplified86.9%
Final simplification70.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ -1.0 (/ 1.0 eps_m))) (t_1 (+ 1.0 (/ 1.0 eps_m))))
(if (<= eps_m 0.027)
(/ (+ x 1.0) (exp x))
(if (<= eps_m 9.6e+106)
(/
(+
2.0
(*
x
(+
(* (+ eps_m 1.0) t_0)
(+
(*
t_1
(+ (+ -1.0 eps_m) (* (* x 0.5) (* (- 1.0 eps_m) (- 1.0 eps_m)))))
(* x (* t_0 (* -0.5 (* (+ eps_m 1.0) (+ eps_m 1.0)))))))))
2.0)
(/
(/
(* (+ (/ 1.0 eps_m) (+ 1.0 t_0)) (+ 1.0 (- (/ 0.0 eps_m) -1.0)))
(+ t_1 (- -1.0 (/ -1.0 eps_m))))
2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = -1.0 + (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (eps_m <= 0.027) {
tmp = (x + 1.0) / exp(x);
} else if (eps_m <= 9.6e+106) {
tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-1.0d0) + (1.0d0 / eps_m)
t_1 = 1.0d0 + (1.0d0 / eps_m)
if (eps_m <= 0.027d0) then
tmp = (x + 1.0d0) / exp(x)
else if (eps_m <= 9.6d+106) then
tmp = (2.0d0 + (x * (((eps_m + 1.0d0) * t_0) + ((t_1 * (((-1.0d0) + eps_m) + ((x * 0.5d0) * ((1.0d0 - eps_m) * (1.0d0 - eps_m))))) + (x * (t_0 * ((-0.5d0) * ((eps_m + 1.0d0) * (eps_m + 1.0d0))))))))) / 2.0d0
else
tmp = ((((1.0d0 / eps_m) + (1.0d0 + t_0)) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / (t_1 + ((-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 t_0 = -1.0 + (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (eps_m <= 0.027) {
tmp = (x + 1.0) / Math.exp(x);
} else if (eps_m <= 9.6e+106) {
tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = -1.0 + (1.0 / eps_m) t_1 = 1.0 + (1.0 / eps_m) tmp = 0 if eps_m <= 0.027: tmp = (x + 1.0) / math.exp(x) elif eps_m <= 9.6e+106: tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0 else: tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(-1.0 + Float64(1.0 / eps_m)) t_1 = Float64(1.0 + Float64(1.0 / eps_m)) tmp = 0.0 if (eps_m <= 0.027) tmp = Float64(Float64(x + 1.0) / exp(x)); elseif (eps_m <= 9.6e+106) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(eps_m + 1.0) * t_0) + Float64(Float64(t_1 * Float64(Float64(-1.0 + eps_m) + Float64(Float64(x * 0.5) * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))))) + Float64(x * Float64(t_0 * Float64(-0.5 * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0))))))))) / 2.0); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + t_0)) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / Float64(t_1 + 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) t_0 = -1.0 + (1.0 / eps_m); t_1 = 1.0 + (1.0 / eps_m); tmp = 0.0; if (eps_m <= 0.027) tmp = (x + 1.0) / exp(x); elseif (eps_m <= 9.6e+106) tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0; else tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / 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[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 0.027], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 9.6e+106], N[(N[(2.0 + N[(x * N[(N[(N[(eps$95$m + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(-1.0 + eps$95$m), $MachinePrecision] + N[(N[(x * 0.5), $MachinePrecision] * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(t$95$0 * N[(-0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := -1 + \frac{1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\
\mathbf{elif}\;eps\_m \leq 9.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + 1\right) \cdot t\_0 + \left(t\_1 \cdot \left(\left(-1 + eps\_m\right) + \left(x \cdot 0.5\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right) + x \cdot \left(t\_0 \cdot \left(-0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + t\_0\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{t\_1 + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\
\end{array}
\end{array}
if eps < 0.0269999999999999997Initial program 66.9%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.1%
Simplified65.1%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
clear-numN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.1%
Applied egg-rr65.1%
if 0.0269999999999999997 < eps < 9.6000000000000002e106Initial program 100.0%
Taylor expanded in x around 0
Simplified80.9%
if 9.6000000000000002e106 < eps Initial program 100.0%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6461.6%
Simplified61.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
/-lowering-/.f6417.0%
Simplified17.0%
sub-negN/A
flip-+N/A
sqr-negN/A
/-lowering-/.f64N/A
Applied egg-rr84.7%
Final simplification69.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 90000.0)
(exp (- 0.0 x))
(if (<= eps_m 7.1e+106)
(/
(+
2.0
(+ (* x (+ -1.0 (* x 0.5))) (* eps_m (+ (* x x) (* eps_m (* x x))))))
2.0)
(/
(/
(*
(+ (/ 1.0 eps_m) (+ 1.0 (+ -1.0 (/ 1.0 eps_m))))
(+ 1.0 (- (/ 0.0 eps_m) -1.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 (eps_m <= 90000.0) {
tmp = exp((0.0 - x));
} else if (eps_m <= 7.1e+106) {
tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 (eps_m <= 90000.0d0) then
tmp = exp((0.0d0 - x))
else if (eps_m <= 7.1d+106) then
tmp = (2.0d0 + ((x * ((-1.0d0) + (x * 0.5d0))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0d0
else
tmp = ((((1.0d0 / eps_m) + (1.0d0 + ((-1.0d0) + (1.0d0 / eps_m)))) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / ((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 (eps_m <= 90000.0) {
tmp = Math.exp((0.0 - x));
} else if (eps_m <= 7.1e+106) {
tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 eps_m <= 90000.0: tmp = math.exp((0.0 - x)) elif eps_m <= 7.1e+106: tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0 else: tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 (eps_m <= 90000.0) tmp = exp(Float64(0.0 - x)); elseif (eps_m <= 7.1e+106) tmp = Float64(Float64(2.0 + Float64(Float64(x * Float64(-1.0 + Float64(x * 0.5))) + Float64(eps_m * Float64(Float64(x * x) + Float64(eps_m * Float64(x * x)))))) / 2.0); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + Float64(-1.0 + Float64(1.0 / eps_m)))) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / 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 (eps_m <= 90000.0) tmp = exp((0.0 - x)); elseif (eps_m <= 7.1e+106) tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0; else tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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[eps$95$m, 90000.0], N[Exp[N[(0.0 - x), $MachinePrecision]], $MachinePrecision], If[LessEqual[eps$95$m, 7.1e+106], N[(N[(2.0 + N[(N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps$95$m * N[(N[(x * x), $MachinePrecision] + N[(eps$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 90000:\\
\;\;\;\;e^{0 - x}\\
\mathbf{elif}\;eps\_m \leq 7.1 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(-1 + x \cdot 0.5\right) + eps\_m \cdot \left(x \cdot x + eps\_m \cdot \left(x \cdot x\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + \left(-1 + \frac{1}{eps\_m}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\
\end{array}
\end{array}
if eps < 9e4Initial program 67.4%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified98.1%
Taylor expanded in eps around 0
exp-lowering-exp.f64N/A
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6475.2%
Simplified75.2%
if 9e4 < eps < 7.1000000000000003e106Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified82.6%
Taylor expanded in eps around 0
Simplified82.6%
if 7.1000000000000003e106 < eps Initial program 100.0%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6461.6%
Simplified61.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
/-lowering-/.f6417.0%
Simplified17.0%
sub-negN/A
flip-+N/A
sqr-negN/A
/-lowering-/.f64N/A
Applied egg-rr84.7%
Final simplification77.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ -1.0 (/ 1.0 eps_m))) (t_1 (+ 1.0 (/ 1.0 eps_m))))
(if (<= eps_m 0.027)
(/ 1.0 (+ 1.0 (* 0.5 (* x x))))
(if (<= eps_m 1.1e+107)
(/
(+
2.0
(*
x
(+
(* (+ eps_m 1.0) t_0)
(+
(*
t_1
(+ (+ -1.0 eps_m) (* (* x 0.5) (* (- 1.0 eps_m) (- 1.0 eps_m)))))
(* x (* t_0 (* -0.5 (* (+ eps_m 1.0) (+ eps_m 1.0)))))))))
2.0)
(/
(/
(* (+ (/ 1.0 eps_m) (+ 1.0 t_0)) (+ 1.0 (- (/ 0.0 eps_m) -1.0)))
(+ t_1 (- -1.0 (/ -1.0 eps_m))))
2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = -1.0 + (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 1.1e+107) {
tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-1.0d0) + (1.0d0 / eps_m)
t_1 = 1.0d0 + (1.0d0 / eps_m)
if (eps_m <= 0.027d0) then
tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
else if (eps_m <= 1.1d+107) then
tmp = (2.0d0 + (x * (((eps_m + 1.0d0) * t_0) + ((t_1 * (((-1.0d0) + eps_m) + ((x * 0.5d0) * ((1.0d0 - eps_m) * (1.0d0 - eps_m))))) + (x * (t_0 * ((-0.5d0) * ((eps_m + 1.0d0) * (eps_m + 1.0d0))))))))) / 2.0d0
else
tmp = ((((1.0d0 / eps_m) + (1.0d0 + t_0)) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / (t_1 + ((-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 t_0 = -1.0 + (1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 1.1e+107) {
tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = -1.0 + (1.0 / eps_m) t_1 = 1.0 + (1.0 / eps_m) tmp = 0 if eps_m <= 0.027: tmp = 1.0 / (1.0 + (0.5 * (x * x))) elif eps_m <= 1.1e+107: tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0 else: tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(-1.0 + Float64(1.0 / eps_m)) t_1 = Float64(1.0 + Float64(1.0 / eps_m)) tmp = 0.0 if (eps_m <= 0.027) tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x)))); elseif (eps_m <= 1.1e+107) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(eps_m + 1.0) * t_0) + Float64(Float64(t_1 * Float64(Float64(-1.0 + eps_m) + Float64(Float64(x * 0.5) * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))))) + Float64(x * Float64(t_0 * Float64(-0.5 * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0))))))))) / 2.0); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + t_0)) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / Float64(t_1 + 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) t_0 = -1.0 + (1.0 / eps_m); t_1 = 1.0 + (1.0 / eps_m); tmp = 0.0; if (eps_m <= 0.027) tmp = 1.0 / (1.0 + (0.5 * (x * x))); elseif (eps_m <= 1.1e+107) tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0; else tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / 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[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 1.1e+107], N[(N[(2.0 + N[(x * N[(N[(N[(eps$95$m + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(-1.0 + eps$95$m), $MachinePrecision] + N[(N[(x * 0.5), $MachinePrecision] * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(t$95$0 * N[(-0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := -1 + \frac{1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;eps\_m \leq 1.1 \cdot 10^{+107}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + 1\right) \cdot t\_0 + \left(t\_1 \cdot \left(\left(-1 + eps\_m\right) + \left(x \cdot 0.5\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right) + x \cdot \left(t\_0 \cdot \left(-0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + t\_0\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{t\_1 + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\
\end{array}
\end{array}
if eps < 0.0269999999999999997Initial program 66.9%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.1%
Simplified65.1%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f6465.1%
Applied egg-rr65.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.1%
Simplified57.1%
if 0.0269999999999999997 < eps < 1.1e107Initial program 100.0%
Taylor expanded in x around 0
Simplified80.9%
if 1.1e107 < eps Initial program 100.0%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6461.6%
Simplified61.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
/-lowering-/.f6417.0%
Simplified17.0%
sub-negN/A
flip-+N/A
sqr-negN/A
/-lowering-/.f64N/A
Applied egg-rr84.7%
Final simplification63.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 126.0)
(/ 1.0 (+ 1.0 (* 0.5 (* x x))))
(if (<= eps_m 2.8e+106)
(/
(+
2.0
(+ (* x (+ -1.0 (* x 0.5))) (* eps_m (+ (* x x) (* eps_m (* x x))))))
2.0)
(/
(/
(*
(+ (/ 1.0 eps_m) (+ 1.0 (+ -1.0 (/ 1.0 eps_m))))
(+ 1.0 (- (/ 0.0 eps_m) -1.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 (eps_m <= 126.0) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 2.8e+106) {
tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 (eps_m <= 126.0d0) then
tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
else if (eps_m <= 2.8d+106) then
tmp = (2.0d0 + ((x * ((-1.0d0) + (x * 0.5d0))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0d0
else
tmp = ((((1.0d0 / eps_m) + (1.0d0 + ((-1.0d0) + (1.0d0 / eps_m)))) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / ((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 (eps_m <= 126.0) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 2.8e+106) {
tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
} else {
tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 eps_m <= 126.0: tmp = 1.0 / (1.0 + (0.5 * (x * x))) elif eps_m <= 2.8e+106: tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0 else: tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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 (eps_m <= 126.0) tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x)))); elseif (eps_m <= 2.8e+106) tmp = Float64(Float64(2.0 + Float64(Float64(x * Float64(-1.0 + Float64(x * 0.5))) + Float64(eps_m * Float64(Float64(x * x) + Float64(eps_m * Float64(x * x)))))) / 2.0); else tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + Float64(-1.0 + Float64(1.0 / eps_m)))) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / 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 (eps_m <= 126.0) tmp = 1.0 / (1.0 + (0.5 * (x * x))); elseif (eps_m <= 2.8e+106) tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0; else tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((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[eps$95$m, 126.0], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 2.8e+106], N[(N[(2.0 + N[(N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps$95$m * N[(N[(x * x), $MachinePrecision] + N[(eps$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;eps\_m \leq 2.8 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(-1 + x \cdot 0.5\right) + eps\_m \cdot \left(x \cdot x + eps\_m \cdot \left(x \cdot x\right)\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + \left(-1 + \frac{1}{eps\_m}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\
\end{array}
\end{array}
if eps < 126Initial program 67.2%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Simplified65.4%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f6465.4%
Applied egg-rr65.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.5%
Simplified57.5%
if 126 < eps < 2.79999999999999993e106Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified79.3%
Taylor expanded in eps around 0
Simplified79.3%
if 2.79999999999999993e106 < eps Initial program 100.0%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6461.6%
Simplified61.6%
Taylor expanded in x around 0
+-lowering-+.f64N/A
/-lowering-/.f6417.0%
Simplified17.0%
sub-negN/A
flip-+N/A
sqr-negN/A
/-lowering-/.f64N/A
Applied egg-rr84.7%
Final simplification63.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 126.0)
(/ 1.0 (+ 1.0 (* 0.5 (* x x))))
(/
(+
2.0
(*
x
(+
(+ eps_m (- -1.0 eps_m))
(* x (* 0.5 (+ (* eps_m eps_m) (* (+ eps_m 1.0) (+ eps_m 1.0))))))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else {
tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 1.0) * (eps_m + 1.0)))))))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 126.0d0) then
tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
else
tmp = (2.0d0 + (x * ((eps_m + ((-1.0d0) - eps_m)) + (x * (0.5d0 * ((eps_m * eps_m) + ((eps_m + 1.0d0) * (eps_m + 1.0d0)))))))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 126.0) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else {
tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 1.0) * (eps_m + 1.0)))))))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 126.0: tmp = 1.0 / (1.0 + (0.5 * (x * x))) else: tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 1.0) * (eps_m + 1.0)))))))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 126.0) tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x)))); else tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(eps_m + Float64(-1.0 - eps_m)) + Float64(x * Float64(0.5 * Float64(Float64(eps_m * eps_m) + Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0)))))))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 126.0) tmp = 1.0 / (1.0 + (0.5 * (x * x))); else tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 1.0) * (eps_m + 1.0)))))))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 126.0], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(x * N[(N[(eps$95$m + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 * N[(N[(eps$95$m * eps$95$m), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + \left(-1 - eps\_m\right)\right) + x \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m + \left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)}{2}\\
\end{array}
\end{array}
if eps < 126Initial program 67.2%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.4%
Simplified65.4%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f6465.4%
Applied egg-rr65.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.5%
Simplified57.5%
if 126 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f6481.1%
Simplified81.1%
Final simplification63.1%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 0.027)
(/ 1.0 (+ 1.0 (* 0.5 (* x x))))
(if (<= eps_m 1.75e+120)
(+ 1.0 (/ (* x (* x 0.25)) eps_m))
(* eps_m (* eps_m (* (* x x) 0.25))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 1.75e+120) {
tmp = 1.0 + ((x * (x * 0.25)) / eps_m);
} else {
tmp = eps_m * (eps_m * ((x * x) * 0.25));
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 0.027d0) then
tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
else if (eps_m <= 1.75d+120) then
tmp = 1.0d0 + ((x * (x * 0.25d0)) / eps_m)
else
tmp = eps_m * (eps_m * ((x * x) * 0.25d0))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else if (eps_m <= 1.75e+120) {
tmp = 1.0 + ((x * (x * 0.25)) / eps_m);
} else {
tmp = eps_m * (eps_m * ((x * x) * 0.25));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 0.027: tmp = 1.0 / (1.0 + (0.5 * (x * x))) elif eps_m <= 1.75e+120: tmp = 1.0 + ((x * (x * 0.25)) / eps_m) else: tmp = eps_m * (eps_m * ((x * x) * 0.25)) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 0.027) tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x)))); elseif (eps_m <= 1.75e+120) tmp = Float64(1.0 + Float64(Float64(x * Float64(x * 0.25)) / eps_m)); else tmp = Float64(eps_m * Float64(eps_m * Float64(Float64(x * x) * 0.25))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 0.027) tmp = 1.0 / (1.0 + (0.5 * (x * x))); elseif (eps_m <= 1.75e+120) tmp = 1.0 + ((x * (x * 0.25)) / eps_m); else tmp = eps_m * (eps_m * ((x * x) * 0.25)); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 1.75e+120], N[(1.0 + N[(N[(x * N[(x * 0.25), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision], N[(eps$95$m * N[(eps$95$m * N[(N[(x * x), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\
\mathbf{elif}\;eps\_m \leq 1.75 \cdot 10^{+120}:\\
\;\;\;\;1 + \frac{x \cdot \left(x \cdot 0.25\right)}{eps\_m}\\
\mathbf{else}:\\
\;\;\;\;eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\
\end{array}
\end{array}
if eps < 0.0269999999999999997Initial program 66.9%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.1%
Simplified65.1%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f6465.1%
Applied egg-rr65.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.1%
Simplified57.1%
if 0.0269999999999999997 < eps < 1.75000000000000004e120Initial program 100.0%
Taylor expanded in x around 0
associate--l+N/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6470.5%
Simplified70.5%
Taylor expanded in x around 0
Simplified81.4%
Taylor expanded in eps around 0
associate-*r/N/A
/-lowering-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6474.1%
Simplified74.1%
if 1.75000000000000004e120 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified100.0%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified91.0%
Taylor expanded in eps around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.9%
Simplified59.9%
Final simplification59.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (* eps_m (* eps_m (* (* x x) 0.25))))) (if (<= x -0.00019) t_0 (if (<= x 0.066) (/ (- 2.0 (* x x)) 2.0) t_0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = eps_m * (eps_m * ((x * x) * 0.25));
double tmp;
if (x <= -0.00019) {
tmp = t_0;
} else if (x <= 0.066) {
tmp = (2.0 - (x * x)) / 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 = eps_m * (eps_m * ((x * x) * 0.25d0))
if (x <= (-0.00019d0)) then
tmp = t_0
else if (x <= 0.066d0) then
tmp = (2.0d0 - (x * x)) / 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 = eps_m * (eps_m * ((x * x) * 0.25));
double tmp;
if (x <= -0.00019) {
tmp = t_0;
} else if (x <= 0.066) {
tmp = (2.0 - (x * x)) / 2.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = eps_m * (eps_m * ((x * x) * 0.25)) tmp = 0 if x <= -0.00019: tmp = t_0 elif x <= 0.066: tmp = (2.0 - (x * x)) / 2.0 else: tmp = t_0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(eps_m * Float64(eps_m * Float64(Float64(x * x) * 0.25))) tmp = 0.0 if (x <= -0.00019) tmp = t_0; elseif (x <= 0.066) tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0); else tmp = t_0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = eps_m * (eps_m * ((x * x) * 0.25)); tmp = 0.0; if (x <= -0.00019) tmp = t_0; elseif (x <= 0.066) tmp = (2.0 - (x * x)) / 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[(eps$95$m * N[(eps$95$m * N[(N[(x * x), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00019], t$95$0, If[LessEqual[x, 0.066], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\
\mathbf{if}\;x \leq -0.00019:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.066:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.9000000000000001e-4 or 0.066000000000000003 < x Initial program 99.1%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
distribute-rgt-neg-inN/A
sub-negN/A
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
mul-1-negN/A
remove-double-negN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
Simplified99.1%
Taylor expanded in eps around inf
*-commutativeN/A
*-lowering-*.f6475.4%
Simplified75.4%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r*N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified62.5%
Taylor expanded in eps around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6464.2%
Simplified64.2%
if -1.9000000000000001e-4 < x < 0.066000000000000003Initial program 57.7%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6472.4%
Simplified72.4%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6471.9%
Simplified71.9%
Final simplification68.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 0.027) (/ 1.0 (+ 1.0 (* 0.5 (* x x)))) (+ 1.0 (* x (* x (* (* eps_m eps_m) 0.25))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else {
tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)));
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (eps_m <= 0.027d0) then
tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
else
tmp = 1.0d0 + (x * (x * ((eps_m * eps_m) * 0.25d0)))
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 0.027) {
tmp = 1.0 / (1.0 + (0.5 * (x * x)));
} else {
tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)));
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 0.027: tmp = 1.0 / (1.0 + (0.5 * (x * x))) else: tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25))) return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 0.027) tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x)))); else tmp = Float64(1.0 + Float64(x * Float64(x * Float64(Float64(eps_m * eps_m) * 0.25)))); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 0.027) tmp = 1.0 / (1.0 + (0.5 * (x * x))); else tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25))); end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(N[(eps$95$m * eps$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(\left(eps\_m \cdot eps\_m\right) \cdot 0.25\right)\right)\\
\end{array}
\end{array}
if eps < 0.0269999999999999997Initial program 66.9%
Taylor expanded in eps around 0
distribute-lft-outN/A
cancel-sign-sub-invN/A
metadata-evalN/A
distribute-rgt1-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
distribute-rgt1-inN/A
exp-negN/A
associate-*r/N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f6465.1%
Simplified65.1%
clear-numN/A
associate-/r*N/A
metadata-evalN/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64N/A
+-lowering-+.f6465.1%
Applied egg-rr65.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.1%
Simplified57.1%
if 0.0269999999999999997 < eps Initial program 100.0%
Taylor expanded in x around 0
associate--l+N/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6463.5%
Simplified63.5%
Taylor expanded in x around 0
Simplified80.5%
Taylor expanded in eps around inf
associate-*r*N/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
metadata-evalN/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6481.3%
Simplified81.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -0.00019) (* eps_m (* x -0.5)) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -0.00019) {
tmp = eps_m * (x * -0.5);
} 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 <= (-0.00019d0)) then
tmp = eps_m * (x * (-0.5d0))
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 <= -0.00019) {
tmp = eps_m * (x * -0.5);
} else {
tmp = 1.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -0.00019: tmp = eps_m * (x * -0.5) else: tmp = 1.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -0.00019) tmp = Float64(eps_m * Float64(x * -0.5)); else tmp = 1.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -0.00019) tmp = eps_m * (x * -0.5); else tmp = 1.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -0.00019], N[(eps$95$m * N[(x * -0.5), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00019:\\
\;\;\;\;eps\_m \cdot \left(x \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.9000000000000001e-4Initial program 97.4%
Taylor expanded in x around 0
associate--l+N/A
mul-1-negN/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-lft1-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6453.8%
Simplified53.8%
Taylor expanded in eps around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6419.7%
Simplified19.7%
if -1.9000000000000001e-4 < x Initial program 71.1%
Taylor expanded in x around 0
Simplified50.0%
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 75.0%
Taylor expanded in x around 0
Simplified43.0%
herbie shell --seed 2024191
(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))