
(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 15 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
(let* ((t_0 (/ (+ x 1.0) (exp x))))
(if (<= eps_m 2e-25)
(/ (+ t_0 t_0) 2.0)
(/ (+ (exp (* x (+ eps_m -1.0))) (exp (* (- x) eps_m))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (x + 1.0) / exp(x);
double tmp;
if (eps_m <= 2e-25) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp((-x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = (x + 1.0d0) / exp(x)
if (eps_m <= 2d-25) then
tmp = (t_0 + t_0) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp((-x * eps_m))) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = (x + 1.0) / Math.exp(x);
double tmp;
if (eps_m <= 2e-25) {
tmp = (t_0 + t_0) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp((-x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (x + 1.0) / math.exp(x) tmp = 0 if eps_m <= 2e-25: tmp = (t_0 + t_0) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp((-x * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(x + 1.0) / exp(x)) tmp = 0.0 if (eps_m <= 2e-25) tmp = Float64(Float64(t_0 + t_0) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(Float64(-x) * eps_m))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (x + 1.0) / exp(x); tmp = 0.0; if (eps_m <= 2e-25) tmp = (t_0 + t_0) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp((-x * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 2e-25], N[(N[(t$95$0 + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[((-x) * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{x + 1}{e^{x}}\\
\mathbf{if}\;eps\_m \leq 2 \cdot 10^{-25}:\\
\;\;\;\;\frac{t\_0 + t\_0}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{\left(-x\right) \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if eps < 2.00000000000000008e-25Initial program 65.6%
fma-neg65.6%
/-rgt-identity65.6%
fma-neg65.6%
/-rgt-identity65.6%
distribute-rgt-neg-in65.6%
sub-neg65.6%
metadata-eval65.6%
distribute-rgt-neg-in65.6%
Simplified65.6%
Taylor expanded in eps around 0 69.5%
Simplified69.5%
exp-neg69.5%
un-div-inv69.5%
Applied egg-rr69.5%
exp-neg69.5%
un-div-inv69.5%
Applied egg-rr69.5%
if 2.00000000000000008e-25 < eps Initial program 99.9%
fma-neg99.9%
/-rgt-identity99.9%
fma-neg99.9%
/-rgt-identity99.9%
distribute-rgt-neg-in99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-rgt-neg-in99.9%
Simplified99.9%
Taylor expanded in eps around inf 99.9%
Simplified99.9%
Taylor expanded in eps around inf 99.9%
associate-*r*99.9%
neg-mul-199.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
associate-*r*99.9%
mul-1-neg99.9%
Simplified99.9%
Final simplification77.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)))
(if (<= x -2.6e-285)
(/ (+ 1.0 (exp (* x (- -1.0 eps_m)))) 2.0)
(if (<= x 2400.0)
t_0
(if (<= x 1.65e+184)
(/ (/ (+ (exp (- x)) (/ -1.0 (exp x))) eps_m) 2.0)
(if (<= x 3.2e+208)
t_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 t_0 = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0;
double tmp;
if (x <= -2.6e-285) {
tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 2400.0) {
tmp = t_0;
} else if (x <= 1.65e+184) {
tmp = ((exp(-x) + (-1.0 / exp(x))) / eps_m) / 2.0;
} else if (x <= 3.2e+208) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 2.0d0
if (x <= (-2.6d-285)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 2400.0d0) then
tmp = t_0
else if (x <= 1.65d+184) then
tmp = ((exp(-x) + ((-1.0d0) / exp(x))) / eps_m) / 2.0d0
else if (x <= 3.2d+208) then
tmp = t_0
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 t_0 = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
double tmp;
if (x <= -2.6e-285) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 2400.0) {
tmp = t_0;
} else if (x <= 1.65e+184) {
tmp = ((Math.exp(-x) + (-1.0 / Math.exp(x))) / eps_m) / 2.0;
} else if (x <= 3.2e+208) {
tmp = t_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): t_0 = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 tmp = 0 if x <= -2.6e-285: tmp = (1.0 + math.exp((x * (-1.0 - eps_m)))) / 2.0 elif x <= 2400.0: tmp = t_0 elif x <= 1.65e+184: tmp = ((math.exp(-x) + (-1.0 / math.exp(x))) / eps_m) / 2.0 elif x <= 3.2e+208: tmp = t_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) t_0 = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.0) tmp = 0.0 if (x <= -2.6e-285) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 2400.0) tmp = t_0; elseif (x <= 1.65e+184) tmp = Float64(Float64(Float64(exp(Float64(-x)) + Float64(-1.0 / exp(x))) / eps_m) / 2.0); elseif (x <= 3.2e+208) tmp = t_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) t_0 = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; tmp = 0.0; if (x <= -2.6e-285) tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 2400.0) tmp = t_0; elseif (x <= 1.65e+184) tmp = ((exp(-x) + (-1.0 / exp(x))) / eps_m) / 2.0; elseif (x <= 3.2e+208) tmp = t_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_] := Block[{t$95$0 = N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.6e-285], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2400.0], t$95$0, If[LessEqual[x, 1.65e+184], N[(N[(N[(N[Exp[(-x)], $MachinePrecision] + N[(-1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.2e+208], t$95$0, 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}
t_0 := \frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-285}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 2400:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+184}:\\
\;\;\;\;\frac{\frac{e^{-x} + \frac{-1}{e^{x}}}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+208}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < -2.6000000000000002e-285Initial program 78.6%
fma-neg78.6%
/-rgt-identity78.6%
fma-neg78.6%
/-rgt-identity78.6%
distribute-rgt-neg-in78.6%
sub-neg78.6%
metadata-eval78.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
Taylor expanded in x around 0 47.2%
Taylor expanded in eps around inf 67.9%
if -2.6000000000000002e-285 < x < 2400 or 1.6499999999999999e184 < x < 3.2000000000000001e208Initial program 52.4%
fma-neg52.4%
/-rgt-identity52.4%
fma-neg52.4%
/-rgt-identity52.4%
distribute-rgt-neg-in52.4%
sub-neg52.4%
metadata-eval52.4%
distribute-rgt-neg-in52.4%
Simplified52.4%
Taylor expanded in eps around inf 97.3%
Simplified97.3%
Taylor expanded in eps around inf 96.2%
associate-*r*96.2%
neg-mul-196.2%
Simplified96.2%
Taylor expanded in x around inf 96.2%
mul-1-neg96.2%
distribute-rgt-neg-in96.2%
associate-*r*96.2%
mul-1-neg96.2%
Simplified96.2%
Taylor expanded in eps around 0 83.2%
if 2400 < x < 1.6499999999999999e184Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 59.5%
if 3.2000000000000001e208 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 12.8%
Taylor expanded in x around 0 72.3%
Final simplification72.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x (+ eps_m -1.0)))))
(if (<= x 3.8)
(/ (+ t_0 (exp (* (- x) eps_m))) 2.0)
(/ (+ t_0 (exp (- x))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * (eps_m + -1.0)));
double tmp;
if (x <= 3.8) {
tmp = (t_0 + exp((-x * eps_m))) / 2.0;
} else {
tmp = (t_0 + exp(-x)) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp((x * (eps_m + (-1.0d0))))
if (x <= 3.8d0) then
tmp = (t_0 + exp((-x * eps_m))) / 2.0d0
else
tmp = (t_0 + exp(-x)) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp((x * (eps_m + -1.0)));
double tmp;
if (x <= 3.8) {
tmp = (t_0 + Math.exp((-x * eps_m))) / 2.0;
} else {
tmp = (t_0 + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * (eps_m + -1.0))) tmp = 0 if x <= 3.8: tmp = (t_0 + math.exp((-x * eps_m))) / 2.0 else: tmp = (t_0 + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * Float64(eps_m + -1.0))) tmp = 0.0 if (x <= 3.8) tmp = Float64(Float64(t_0 + exp(Float64(Float64(-x) * eps_m))) / 2.0); else tmp = Float64(Float64(t_0 + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * (eps_m + -1.0))); tmp = 0.0; if (x <= 3.8) tmp = (t_0 + exp((-x * eps_m))) / 2.0; else tmp = (t_0 + exp(-x)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 3.8], N[(N[(t$95$0 + N[Exp[N[((-x) * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(t$95$0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot \left(eps\_m + -1\right)}\\
\mathbf{if}\;x \leq 3.8:\\
\;\;\;\;\frac{t\_0 + e^{\left(-x\right) \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 + e^{-x}}{2}\\
\end{array}
\end{array}
if x < 3.7999999999999998Initial program 65.5%
fma-neg65.6%
/-rgt-identity65.6%
fma-neg65.5%
/-rgt-identity65.5%
distribute-rgt-neg-in65.5%
sub-neg65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
Taylor expanded in eps around inf 98.7%
Simplified98.7%
Taylor expanded in eps around inf 98.8%
associate-*r*98.8%
neg-mul-198.8%
Simplified98.8%
Taylor expanded in x around inf 98.8%
mul-1-neg98.8%
distribute-rgt-neg-in98.8%
associate-*r*98.8%
mul-1-neg98.8%
Simplified98.8%
if 3.7999999999999998 < x Initial program 98.6%
fma-neg98.6%
/-rgt-identity98.6%
fma-neg98.6%
/-rgt-identity98.6%
distribute-rgt-neg-in98.6%
sub-neg98.6%
metadata-eval98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in eps around inf 98.8%
Simplified98.8%
Taylor expanded in eps around 0 76.3%
neg-mul-176.3%
Simplified76.3%
Final simplification92.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -5e-284) (/ (+ 1.0 (exp (* x (- -1.0 eps_m)))) 2.0) (/ (+ (exp (* x (+ eps_m -1.0))) (exp (- x))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-284) {
tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0;
} else {
tmp = (exp((x * (eps_m + -1.0))) + exp(-x)) / 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 <= (-5d-284)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
else
tmp = (exp((x * (eps_m + (-1.0d0)))) + exp(-x)) / 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 <= -5e-284) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
} else {
tmp = (Math.exp((x * (eps_m + -1.0))) + Math.exp(-x)) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-284: tmp = (1.0 + math.exp((x * (-1.0 - eps_m)))) / 2.0 else: tmp = (math.exp((x * (eps_m + -1.0))) + math.exp(-x)) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-284) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + exp(Float64(-x))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-284) tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0; else tmp = (exp((x * (eps_m + -1.0))) + exp(-x)) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-284], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-284}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(eps\_m + -1\right)} + e^{-x}}{2}\\
\end{array}
\end{array}
if x < -4.99999999999999973e-284Initial program 78.6%
fma-neg78.6%
/-rgt-identity78.6%
fma-neg78.6%
/-rgt-identity78.6%
distribute-rgt-neg-in78.6%
sub-neg78.6%
metadata-eval78.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
Taylor expanded in x around 0 47.2%
Taylor expanded in eps around inf 67.9%
if -4.99999999999999973e-284 < x Initial program 71.8%
fma-neg71.8%
/-rgt-identity71.8%
fma-neg71.8%
/-rgt-identity71.8%
distribute-rgt-neg-in71.8%
sub-neg71.8%
metadata-eval71.8%
distribute-rgt-neg-in71.8%
Simplified71.8%
Taylor expanded in eps around inf 98.4%
Simplified98.4%
Taylor expanded in eps around 0 81.6%
neg-mul-181.6%
Simplified81.6%
Final simplification76.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (+ eps_m -1.0))) (exp (* x (- -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (eps_m + -1.0))) + 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 * (eps_m + (-1.0d0)))) + 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 * (eps_m + -1.0))) + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (eps_m + -1.0))) + 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(eps_m + -1.0))) + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (eps_m + -1.0))) + 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[(eps$95$m + -1.0), $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(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)}}{2}
\end{array}
Initial program 74.6%
fma-neg74.6%
/-rgt-identity74.6%
fma-neg74.6%
/-rgt-identity74.6%
distribute-rgt-neg-in74.6%
sub-neg74.6%
metadata-eval74.6%
distribute-rgt-neg-in74.6%
Simplified74.6%
Taylor expanded in eps around inf 98.8%
Simplified98.8%
Final simplification98.8%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -5e-280)
(/ (+ 1.0 (exp (- x))) 2.0)
(if (<= x 3.8e+209)
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 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 <= -5e-280) {
tmp = (1.0 + exp(-x)) / 2.0;
} else if (x <= 3.8e+209) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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 <= (-5d-280)) then
tmp = (1.0d0 + exp(-x)) / 2.0d0
else if (x <= 3.8d+209) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 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 <= -5e-280) {
tmp = (1.0 + Math.exp(-x)) / 2.0;
} else if (x <= 3.8e+209) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 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 <= -5e-280: tmp = (1.0 + math.exp(-x)) / 2.0 elif x <= 3.8e+209: tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 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 <= -5e-280) tmp = Float64(Float64(1.0 + exp(Float64(-x))) / 2.0); elseif (x <= 3.8e+209) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 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 <= -5e-280) tmp = (1.0 + exp(-x)) / 2.0; elseif (x <= 3.8e+209) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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, -5e-280], N[(N[(1.0 + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.8e+209], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $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 -5 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + e^{-x}}{2}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+209}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{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 < -5.00000000000000028e-280Initial program 78.6%
fma-neg78.6%
/-rgt-identity78.6%
fma-neg78.6%
/-rgt-identity78.6%
distribute-rgt-neg-in78.6%
sub-neg78.6%
metadata-eval78.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
Taylor expanded in eps around inf 99.2%
Simplified99.2%
Taylor expanded in eps around inf 99.3%
associate-*r*99.3%
neg-mul-199.3%
Simplified99.3%
Taylor expanded in eps around 0 84.1%
mul-1-neg84.1%
Simplified84.1%
if -5.00000000000000028e-280 < x < 3.79999999999999984e209Initial program 65.5%
fma-neg65.5%
/-rgt-identity65.5%
fma-neg65.5%
/-rgt-identity65.5%
distribute-rgt-neg-in65.5%
sub-neg65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
Taylor expanded in eps around inf 98.1%
Simplified98.1%
Taylor expanded in eps around inf 87.1%
associate-*r*87.1%
neg-mul-187.1%
Simplified87.1%
Taylor expanded in x around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-in87.1%
associate-*r*87.1%
mul-1-neg87.1%
Simplified87.1%
Taylor expanded in eps around 0 63.6%
if 3.79999999999999984e209 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 12.8%
Taylor expanded in x around 0 72.3%
Final simplification72.9%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e-284)
(/ (+ 1.0 (exp (* x (- -1.0 eps_m)))) 2.0)
(if (<= x 1.8e+211)
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 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-284) {
tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 1.8e+211) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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-284)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 1.8d+211) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 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-284) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 1.8e+211) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 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-284: tmp = (1.0 + math.exp((x * (-1.0 - eps_m)))) / 2.0 elif x <= 1.8e+211: tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 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-284) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 1.8e+211) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 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-284) tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 1.8e+211) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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-284], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.8e+211], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $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^{-284}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+211}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{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 < -1.00000000000000004e-284Initial program 78.6%
fma-neg78.6%
/-rgt-identity78.6%
fma-neg78.6%
/-rgt-identity78.6%
distribute-rgt-neg-in78.6%
sub-neg78.6%
metadata-eval78.6%
distribute-rgt-neg-in78.6%
Simplified78.6%
Taylor expanded in x around 0 47.2%
Taylor expanded in eps around inf 67.9%
if -1.00000000000000004e-284 < x < 1.80000000000000001e211Initial program 65.5%
fma-neg65.5%
/-rgt-identity65.5%
fma-neg65.5%
/-rgt-identity65.5%
distribute-rgt-neg-in65.5%
sub-neg65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
Taylor expanded in eps around inf 98.1%
Simplified98.1%
Taylor expanded in eps around inf 87.1%
associate-*r*87.1%
neg-mul-187.1%
Simplified87.1%
Taylor expanded in x around inf 87.1%
mul-1-neg87.1%
distribute-rgt-neg-in87.1%
associate-*r*87.1%
mul-1-neg87.1%
Simplified87.1%
Taylor expanded in eps around 0 63.6%
if 1.80000000000000001e211 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 12.8%
Taylor expanded in x around 0 72.3%
Final simplification66.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 360.0) (/ (+ 1.0 (exp (- 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 <= 360.0) {
tmp = (1.0 + exp(-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 <= 360.0d0) then
tmp = (1.0d0 + exp(-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 <= 360.0) {
tmp = (1.0 + Math.exp(-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 <= 360.0: tmp = (1.0 + math.exp(-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 <= 360.0) tmp = Float64(Float64(1.0 + exp(Float64(-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 <= 360.0) tmp = (1.0 + exp(-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, 360.0], N[(N[(1.0 + N[Exp[(-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 360:\\
\;\;\;\;\frac{1 + e^{-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 < 360Initial program 65.2%
fma-neg65.2%
/-rgt-identity65.2%
fma-neg65.2%
/-rgt-identity65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
Simplified65.2%
Taylor expanded in eps around inf 98.3%
Simplified98.3%
Taylor expanded in eps around inf 98.3%
associate-*r*98.3%
neg-mul-198.3%
Simplified98.3%
Taylor expanded in eps around 0 80.1%
mul-1-neg80.1%
Simplified80.1%
if 360 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 25.1%
Taylor expanded in x around 0 56.5%
Final simplification73.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 200.0) (/ (+ (- 1.0 (* x eps_m)) (+ x (- 1.0 x))) 2.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 <= 200.0) {
tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - x))) / 2.0;
} else {
tmp = ((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 <= 200.0d0) then
tmp = ((1.0d0 - (x * eps_m)) + (x + (1.0d0 - x))) / 2.0d0
else
tmp = ((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 <= 200.0) {
tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - x))) / 2.0;
} else {
tmp = ((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 <= 200.0: tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - x))) / 2.0 else: tmp = ((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 <= 200.0) tmp = Float64(Float64(Float64(1.0 - Float64(x * eps_m)) + Float64(x + Float64(1.0 - x))) / 2.0); else tmp = Float64(Float64(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 <= 200.0) tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - x))) / 2.0; else tmp = ((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, 200.0], N[(N[(N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x + N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(1.0 / eps$95$m), $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 200:\\
\;\;\;\;\frac{\left(1 - x \cdot eps\_m\right) + \left(x + \left(1 - x\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{eps\_m} + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < 200Initial program 65.2%
fma-neg65.2%
/-rgt-identity65.2%
fma-neg65.2%
/-rgt-identity65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
Simplified65.2%
Taylor expanded in x around 0 43.0%
Taylor expanded in x around 0 27.7%
Taylor expanded in eps around inf 61.2%
sub-neg61.2%
mul-1-neg61.2%
unsub-neg61.2%
distribute-lft-out61.2%
distribute-lft-out61.2%
mul-1-neg61.2%
+-commutative61.2%
mul-1-neg61.2%
metadata-eval61.2%
distribute-neg-in61.2%
remove-double-neg61.2%
distribute-neg-in61.2%
mul-1-neg61.2%
associate-*r*61.2%
metadata-eval61.2%
*-lft-identity61.2%
distribute-neg-in61.2%
mul-1-neg61.2%
metadata-eval61.2%
+-commutative61.2%
Simplified61.2%
if 200 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 25.1%
Taylor expanded in x around 0 56.5%
Taylor expanded in eps around 0 56.5%
Final simplification59.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 190.0) (/ (+ (- 1.0 (* x eps_m)) (+ x (- 1.0 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 <= 190.0) {
tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - 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 <= 190.0d0) then
tmp = ((1.0d0 - (x * eps_m)) + (x + (1.0d0 - 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 <= 190.0) {
tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - 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 <= 190.0: tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - 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 <= 190.0) tmp = Float64(Float64(Float64(1.0 - Float64(x * eps_m)) + Float64(x + Float64(1.0 - 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 <= 190.0) tmp = ((1.0 - (x * eps_m)) + (x + (1.0 - 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, 190.0], N[(N[(N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x + N[(1.0 - x), $MachinePrecision]), $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 190:\\
\;\;\;\;\frac{\left(1 - x \cdot eps\_m\right) + \left(x + \left(1 - x\right)\right)}{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 < 190Initial program 65.2%
fma-neg65.2%
/-rgt-identity65.2%
fma-neg65.2%
/-rgt-identity65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
Simplified65.2%
Taylor expanded in x around 0 43.0%
Taylor expanded in x around 0 27.7%
Taylor expanded in eps around inf 61.2%
sub-neg61.2%
mul-1-neg61.2%
unsub-neg61.2%
distribute-lft-out61.2%
distribute-lft-out61.2%
mul-1-neg61.2%
+-commutative61.2%
mul-1-neg61.2%
metadata-eval61.2%
distribute-neg-in61.2%
remove-double-neg61.2%
distribute-neg-in61.2%
mul-1-neg61.2%
associate-*r*61.2%
metadata-eval61.2%
*-lft-identity61.2%
distribute-neg-in61.2%
mul-1-neg61.2%
metadata-eval61.2%
+-commutative61.2%
Simplified61.2%
if 190 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 25.1%
Taylor expanded in x around 0 56.5%
Final simplification59.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 2.0) (/ (+ 2.0 (* x (- -1.0 eps_m))) 2.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 <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0;
} else {
tmp = ((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 <= 2.0d0) then
tmp = (2.0d0 + (x * ((-1.0d0) - eps_m))) / 2.0d0
else
tmp = ((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 <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0;
} else {
tmp = ((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 <= 2.0: tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0 else: tmp = ((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 <= 2.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 - eps_m))) / 2.0); else tmp = Float64(Float64(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 <= 2.0) tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0; else tmp = ((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, 2.0], N[(N[(2.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(1.0 / eps$95$m), $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 2:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 - eps\_m\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{eps\_m} + \left(1 - \frac{1}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if x < 2Initial program 65.5%
fma-neg65.6%
/-rgt-identity65.6%
fma-neg65.5%
/-rgt-identity65.5%
distribute-rgt-neg-in65.5%
sub-neg65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
Taylor expanded in x around 0 43.2%
Taylor expanded in eps around inf 76.5%
Taylor expanded in x around 0 61.1%
if 2 < x Initial program 98.6%
fma-neg98.6%
/-rgt-identity98.6%
fma-neg98.6%
/-rgt-identity98.6%
distribute-rgt-neg-in98.6%
sub-neg98.6%
metadata-eval98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in x around 0 24.7%
Taylor expanded in x around 0 55.7%
Taylor expanded in eps around 0 55.7%
Final simplification59.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.0) (/ (* (- x) eps_m) 2.0) (if (<= x 185.0) 1.0 (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (-x * eps_m) / 2.0;
} else if (x <= 185.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 <= (-1.0d0)) then
tmp = (-x * eps_m) / 2.0d0
else if (x <= 185.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 <= -1.0) {
tmp = (-x * eps_m) / 2.0;
} else if (x <= 185.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 <= -1.0: tmp = (-x * eps_m) / 2.0 elif x <= 185.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 <= -1.0) tmp = Float64(Float64(Float64(-x) * eps_m) / 2.0); elseif (x <= 185.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 <= -1.0) tmp = (-x * eps_m) / 2.0; elseif (x <= 185.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, -1.0], N[(N[((-x) * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 185.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 -1:\\
\;\;\;\;\frac{\left(-x\right) \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 185:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 37.7%
Taylor expanded in x around 0 15.7%
Taylor expanded in eps around inf 15.7%
mul-1-neg15.7%
*-commutative15.7%
distribute-rgt-neg-in15.7%
Simplified15.7%
if -1 < x < 185Initial program 55.1%
fma-neg55.1%
/-rgt-identity55.1%
fma-neg55.1%
/-rgt-identity55.1%
distribute-rgt-neg-in55.1%
sub-neg55.1%
metadata-eval55.1%
distribute-rgt-neg-in55.1%
Simplified55.1%
Taylor expanded in x around 0 75.5%
if 185 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in eps around inf 9.9%
*-commutative9.9%
Simplified9.9%
Final simplification48.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 2.0) (/ (+ 2.0 (* x (- -1.0 eps_m))) 2.0) (/ (* x eps_m) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 2.0;
} else {
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 <= 2.0d0) then
tmp = (2.0d0 + (x * ((-1.0d0) - eps_m))) / 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 <= 2.0) {
tmp = (2.0 + (x * (-1.0 - eps_m))) / 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 <= 2.0: tmp = (2.0 + (x * (-1.0 - eps_m))) / 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 <= 2.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(-1.0 - eps_m))) / 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 <= 2.0) tmp = (2.0 + (x * (-1.0 - eps_m))) / 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, 2.0], N[(N[(2.0 + N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $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 2:\\
\;\;\;\;\frac{2 + x \cdot \left(-1 - eps\_m\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 2Initial program 65.5%
fma-neg65.6%
/-rgt-identity65.6%
fma-neg65.5%
/-rgt-identity65.5%
distribute-rgt-neg-in65.5%
sub-neg65.5%
metadata-eval65.5%
distribute-rgt-neg-in65.5%
Simplified65.5%
Taylor expanded in x around 0 43.2%
Taylor expanded in eps around inf 76.5%
Taylor expanded in x around 0 61.1%
if 2 < x Initial program 98.6%
fma-neg98.6%
/-rgt-identity98.6%
fma-neg98.6%
/-rgt-identity98.6%
distribute-rgt-neg-in98.6%
sub-neg98.6%
metadata-eval98.6%
distribute-rgt-neg-in98.6%
Simplified98.6%
Taylor expanded in x around 0 21.9%
Taylor expanded in eps around inf 9.8%
*-commutative9.8%
Simplified9.8%
Final simplification47.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 185.0) 1.0 (/ (* x eps_m) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 185.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 <= 185.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 <= 185.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 <= 185.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 <= 185.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 <= 185.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, 185.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 185:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 185Initial program 65.2%
fma-neg65.2%
/-rgt-identity65.2%
fma-neg65.2%
/-rgt-identity65.2%
distribute-rgt-neg-in65.2%
sub-neg65.2%
metadata-eval65.2%
distribute-rgt-neg-in65.2%
Simplified65.2%
Taylor expanded in x around 0 59.3%
if 185 < x Initial program 100.0%
fma-neg100.0%
/-rgt-identity100.0%
fma-neg100.0%
/-rgt-identity100.0%
distribute-rgt-neg-in100.0%
sub-neg100.0%
metadata-eval100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Taylor expanded in x around 0 22.2%
Taylor expanded in eps around inf 9.9%
*-commutative9.9%
Simplified9.9%
Final simplification45.9%
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 74.6%
fma-neg74.6%
/-rgt-identity74.6%
fma-neg74.6%
/-rgt-identity74.6%
distribute-rgt-neg-in74.6%
sub-neg74.6%
metadata-eval74.6%
distribute-rgt-neg-in74.6%
Simplified74.6%
Taylor expanded in x around 0 44.1%
Final simplification44.1%
herbie shell --seed 2024041
(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))