
(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 12 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 (exp (* x eps_m))))
(if (<= eps_m 1.0)
(/ (* 2.0 (exp (- x))) 2.0)
(/ (+ (/ 1.0 t_0) t_0) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = exp((x * eps_m));
double tmp;
if (eps_m <= 1.0) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = ((1.0 / t_0) + t_0) / 2.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = exp((x * eps_m))
if (eps_m <= 1.0d0) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = ((1.0d0 / t_0) + t_0) / 2.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = Math.exp((x * eps_m));
double tmp;
if (eps_m <= 1.0) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = ((1.0 / t_0) + t_0) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = math.exp((x * eps_m)) tmp = 0 if eps_m <= 1.0: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = ((1.0 / t_0) + t_0) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = exp(Float64(x * eps_m)) tmp = 0.0 if (eps_m <= 1.0) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(Float64(1.0 / t_0) + t_0) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = exp((x * eps_m)); tmp = 0.0; if (eps_m <= 1.0) tmp = (2.0 * exp(-x)) / 2.0; else tmp = ((1.0 / t_0) + t_0) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eps$95$m, 1.0], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(1.0 / t$95$0), $MachinePrecision] + t$95$0), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := e^{x \cdot eps\_m}\\
\mathbf{if}\;eps\_m \leq 1:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{t\_0} + t\_0}{2}\\
\end{array}
\end{array}
if eps < 1Initial program 59.0%
Simplified48.6%
Taylor expanded in eps around inf 97.8%
Taylor expanded in eps around 0 84.2%
neg-mul-184.2%
Simplified84.2%
if 1 < eps Initial program 100.0%
Simplified76.5%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
distribute-lft-neg-out100.0%
exp-neg100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification88.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= eps_m 1.0) (/ (* 2.0 (exp (- x))) 2.0) (/ (+ (exp (* x eps_m)) (exp (* x (- eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 1.0) {
tmp = (2.0 * exp(-x)) / 2.0;
} else {
tmp = (exp((x * 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 <= 1.0d0) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else
tmp = (exp((x * 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 <= 1.0) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else {
tmp = (Math.exp((x * eps_m)) + Math.exp((x * -eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 1.0: tmp = (2.0 * math.exp(-x)) / 2.0 else: tmp = (math.exp((x * eps_m)) + math.exp((x * -eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 1.0) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); else tmp = Float64(Float64(exp(Float64(x * eps_m)) + exp(Float64(x * Float64(-eps_m)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 1.0) tmp = (2.0 * exp(-x)) / 2.0; else tmp = (exp((x * eps_m)) + exp((x * -eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1.0], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * (-eps$95$m)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 1:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + e^{x \cdot \left(-eps\_m\right)}}{2}\\
\end{array}
\end{array}
if eps < 1Initial program 59.0%
Simplified48.6%
Taylor expanded in eps around inf 97.8%
Taylor expanded in eps around 0 84.2%
neg-mul-184.2%
Simplified84.2%
if 1 < eps Initial program 100.0%
Simplified76.5%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification88.5%
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 70.1%
Simplified56.1%
Taylor expanded in eps around inf 98.4%
Final simplification98.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -5e-240) (/ (+ 1.0 (exp (* x (- -1.0 eps_m)))) 2.0) (if (<= x 72000.0) (/ (+ (exp (* x eps_m)) (- 1.0 (* x eps_m))) 2.0) 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-240) {
tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 72000.0) {
tmp = (exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-5d-240)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
else if (x <= 72000.0d0) then
tmp = (exp((x * eps_m)) + (1.0d0 - (x * eps_m))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5e-240) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
} else if (x <= 72000.0) {
tmp = (Math.exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-240: tmp = (1.0 + math.exp((x * (-1.0 - eps_m)))) / 2.0 elif x <= 72000.0: tmp = (math.exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-240) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0); elseif (x <= 72000.0) tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 - Float64(x * eps_m))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-240) tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0; elseif (x <= 72000.0) tmp = (exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-240], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 72000.0], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-240}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 72000:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -5.0000000000000004e-240Initial program 72.0%
Simplified72.0%
Taylor expanded in x around 0 48.7%
Taylor expanded in eps around inf 73.1%
mul-1-neg73.1%
neg-mul-173.1%
distribute-rgt-neg-in73.1%
distribute-neg-in73.1%
metadata-eval73.1%
Simplified73.1%
if -5.0000000000000004e-240 < x < 72000Initial program 48.3%
Simplified20.3%
Taylor expanded in eps around inf 98.0%
Taylor expanded in eps around inf 98.1%
associate-*r*98.1%
neg-mul-198.1%
Simplified98.1%
Taylor expanded in eps around 0 89.2%
neg-mul-189.2%
unsub-neg89.2%
Simplified89.2%
Taylor expanded in eps around inf 89.9%
*-commutative98.8%
Simplified89.9%
if 72000 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.7%
pow-exp22.7%
*-commutative22.7%
+-commutative22.7%
distribute-rgt-in22.7%
add-sqr-sqrt0.0%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod39.5%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
fma-define39.5%
add-sqr-sqrt0.0%
sqrt-unprod91.6%
sqr-neg91.6%
Applied egg-rr100.0%
Taylor expanded in eps around 0 62.0%
rec-exp62.0%
div-sub62.0%
neg-mul-162.0%
+-inverses62.0%
Simplified62.0%
metadata-eval62.0%
Applied egg-rr62.0%
Final simplification76.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -550.0) (/ (* 2.0 (exp (- x))) 2.0) (if (<= x 6000.0) (/ (+ (exp (* x eps_m)) (- 1.0 (* x eps_m))) 2.0) 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -550.0) {
tmp = (2.0 * exp(-x)) / 2.0;
} else if (x <= 6000.0) {
tmp = (exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-550.0d0)) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else if (x <= 6000.0d0) then
tmp = (exp((x * eps_m)) + (1.0d0 - (x * eps_m))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -550.0) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else if (x <= 6000.0) {
tmp = (Math.exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -550.0: tmp = (2.0 * math.exp(-x)) / 2.0 elif x <= 6000.0: tmp = (math.exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -550.0) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); elseif (x <= 6000.0) tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 - Float64(x * eps_m))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -550.0) tmp = (2.0 * exp(-x)) / 2.0; elseif (x <= 6000.0) tmp = (exp((x * eps_m)) + (1.0 - (x * eps_m))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -550.0], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 6000.0], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -550:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{elif}\;x \leq 6000:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 - x \cdot eps\_m\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -550Initial program 97.4%
Simplified97.4%
Taylor expanded in eps around inf 97.4%
Taylor expanded in eps around 0 95.0%
neg-mul-195.0%
Simplified95.0%
if -550 < x < 6e3Initial program 48.9%
Simplified24.8%
Taylor expanded in eps around inf 97.9%
Taylor expanded in eps around inf 98.0%
associate-*r*98.0%
neg-mul-198.0%
Simplified98.0%
Taylor expanded in eps around 0 85.4%
neg-mul-185.4%
unsub-neg85.4%
Simplified85.4%
Taylor expanded in eps around inf 85.9%
*-commutative98.5%
Simplified85.9%
if 6e3 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.7%
pow-exp22.7%
*-commutative22.7%
+-commutative22.7%
distribute-rgt-in22.7%
add-sqr-sqrt0.0%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod39.5%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
fma-define39.5%
add-sqr-sqrt0.0%
sqrt-unprod91.6%
sqr-neg91.6%
Applied egg-rr100.0%
Taylor expanded in eps around 0 62.0%
rec-exp62.0%
div-sub62.0%
neg-mul-162.0%
+-inverses62.0%
Simplified62.0%
metadata-eval62.0%
Applied egg-rr62.0%
Final simplification80.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 1.1e-216) (/ (* 2.0 (exp (- x))) 2.0) (if (<= x 68000.0) (/ (+ 1.0 (exp (* x (+ -1.0 eps_m)))) 2.0) 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.1e-216) {
tmp = (2.0 * exp(-x)) / 2.0;
} else if (x <= 68000.0) {
tmp = (1.0 + exp((x * (-1.0 + eps_m)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 1.1d-216) then
tmp = (2.0d0 * exp(-x)) / 2.0d0
else if (x <= 68000.0d0) then
tmp = (1.0d0 + exp((x * ((-1.0d0) + eps_m)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 1.1e-216) {
tmp = (2.0 * Math.exp(-x)) / 2.0;
} else if (x <= 68000.0) {
tmp = (1.0 + Math.exp((x * (-1.0 + eps_m)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.1e-216: tmp = (2.0 * math.exp(-x)) / 2.0 elif x <= 68000.0: tmp = (1.0 + math.exp((x * (-1.0 + eps_m)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.1e-216) tmp = Float64(Float64(2.0 * exp(Float64(-x))) / 2.0); elseif (x <= 68000.0) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 + eps_m)))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1.1e-216) tmp = (2.0 * exp(-x)) / 2.0; elseif (x <= 68000.0) tmp = (1.0 + exp((x * (-1.0 + eps_m)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1.1e-216], N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 68000.0], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.1 \cdot 10^{-216}:\\
\;\;\;\;\frac{2 \cdot e^{-x}}{2}\\
\mathbf{elif}\;x \leq 68000:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 + eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.09999999999999995e-216Initial program 65.4%
Simplified43.9%
Taylor expanded in eps around inf 98.4%
Taylor expanded in eps around 0 86.8%
neg-mul-186.8%
Simplified86.8%
if 1.09999999999999995e-216 < x < 68000Initial program 43.9%
Simplified29.8%
Taylor expanded in eps around inf 96.4%
Taylor expanded in eps around inf 96.5%
associate-*r*96.5%
neg-mul-196.5%
Simplified96.5%
distribute-lft-neg-out96.5%
exp-neg96.5%
Applied egg-rr96.5%
Taylor expanded in eps around 0 81.2%
if 68000 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.7%
pow-exp22.7%
*-commutative22.7%
+-commutative22.7%
distribute-rgt-in22.7%
add-sqr-sqrt0.0%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod39.5%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
fma-define39.5%
add-sqr-sqrt0.0%
sqrt-unprod91.6%
sqr-neg91.6%
Applied egg-rr100.0%
Taylor expanded in eps around 0 62.0%
rec-exp62.0%
div-sub62.0%
neg-mul-162.0%
+-inverses62.0%
Simplified62.0%
metadata-eval62.0%
Applied egg-rr62.0%
Final simplification78.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* 2.0 (exp (- x))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (2.0 * exp(-x)) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (2.0d0 * exp(-x)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (2.0 * Math.exp(-x)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (2.0 * math.exp(-x)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(2.0 * exp(Float64(-x))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (2.0 * exp(-x)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(2.0 * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{2 \cdot e^{-x}}{2}
\end{array}
Initial program 70.1%
Simplified56.1%
Taylor expanded in eps around inf 98.4%
Taylor expanded in eps around 0 76.9%
neg-mul-176.9%
Simplified76.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (let* ((t_0 (* x (- (/ 2.0 x) -2.0)))) (if (<= x 1.0) (/ (/ (* (* x (+ (/ 2.0 x) -2.0)) t_0) t_0) 2.0) 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * ((2.0 / x) - -2.0);
double tmp;
if (x <= 1.0) {
tmp = (((x * ((2.0 / x) + -2.0)) * t_0) / t_0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((2.0d0 / x) - (-2.0d0))
if (x <= 1.0d0) then
tmp = (((x * ((2.0d0 / x) + (-2.0d0))) * t_0) / t_0) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * ((2.0 / x) - -2.0);
double tmp;
if (x <= 1.0) {
tmp = (((x * ((2.0 / x) + -2.0)) * t_0) / t_0) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = x * ((2.0 / x) - -2.0) tmp = 0 if x <= 1.0: tmp = (((x * ((2.0 / x) + -2.0)) * t_0) / t_0) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(Float64(2.0 / x) - -2.0)) tmp = 0.0 if (x <= 1.0) tmp = Float64(Float64(Float64(Float64(x * Float64(Float64(2.0 / x) + -2.0)) * t_0) / t_0) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = x * ((2.0 / x) - -2.0); tmp = 0.0; if (x <= 1.0) tmp = (((x * ((2.0 / x) + -2.0)) * t_0) / t_0) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(N[(2.0 / x), $MachinePrecision] - -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(N[(N[(N[(x * N[(N[(2.0 / x), $MachinePrecision] + -2.0), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] / t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(\frac{2}{x} - -2\right)\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{\frac{\left(x \cdot \left(\frac{2}{x} + -2\right)\right) \cdot t\_0}{t\_0}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1Initial program 58.4%
Simplified38.9%
Taylor expanded in eps around inf 97.8%
Taylor expanded in x around 0 64.9%
associate--l+64.3%
sub-neg64.3%
distribute-lft-in64.3%
metadata-eval64.3%
neg-mul-164.3%
unsub-neg64.3%
metadata-eval64.3%
Simplified64.3%
Taylor expanded in x around inf 64.8%
sub-neg64.8%
associate-*r/64.8%
metadata-eval64.8%
metadata-eval64.8%
Simplified64.8%
distribute-lft-in64.8%
flip-+74.8%
Applied egg-rr74.8%
difference-of-squares74.8%
distribute-lft-in74.8%
distribute-lft-out--74.8%
distribute-lft-out--74.8%
Simplified74.8%
if 1 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.1%
pow-exp22.1%
*-commutative22.1%
+-commutative22.1%
distribute-rgt-in22.1%
add-sqr-sqrt0.0%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
*-un-lft-identity41.2%
fma-define41.2%
add-sqr-sqrt0.0%
sqrt-unprod91.8%
sqr-neg91.8%
Applied egg-rr100.0%
Taylor expanded in eps around 0 60.4%
rec-exp60.4%
div-sub60.4%
neg-mul-160.4%
+-inverses60.4%
Simplified60.4%
metadata-eval60.4%
Applied egg-rr60.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -9.5e-34) (/ (+ 2.0 (* (* x (+ 1.0 eps_m)) (+ -1.0 (/ 1.0 eps_m)))) 2.0) (if (<= x 520.0) 1.0 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -9.5e-34) {
tmp = (2.0 + ((x * (1.0 + eps_m)) * (-1.0 + (1.0 / eps_m)))) / 2.0;
} else if (x <= 520.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= (-9.5d-34)) then
tmp = (2.0d0 + ((x * (1.0d0 + eps_m)) * ((-1.0d0) + (1.0d0 / eps_m)))) / 2.0d0
else if (x <= 520.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -9.5e-34) {
tmp = (2.0 + ((x * (1.0 + eps_m)) * (-1.0 + (1.0 / eps_m)))) / 2.0;
} else if (x <= 520.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -9.5e-34: tmp = (2.0 + ((x * (1.0 + eps_m)) * (-1.0 + (1.0 / eps_m)))) / 2.0 elif x <= 520.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -9.5e-34) tmp = Float64(Float64(2.0 + Float64(Float64(x * Float64(1.0 + eps_m)) * Float64(-1.0 + Float64(1.0 / eps_m)))) / 2.0); elseif (x <= 520.0) tmp = 1.0; else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -9.5e-34) tmp = (2.0 + ((x * (1.0 + eps_m)) * (-1.0 + (1.0 / eps_m)))) / 2.0; elseif (x <= 520.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -9.5e-34], N[(N[(2.0 + N[(N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 520.0], 1.0, 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(1 + eps\_m\right)\right) \cdot \left(-1 + \frac{1}{eps\_m}\right)}{2}\\
\mathbf{elif}\;x \leq 520:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.49999999999999985e-34Initial program 95.6%
Simplified95.6%
Taylor expanded in x around 0 57.0%
Taylor expanded in x around 0 24.6%
associate-*r*24.6%
+-commutative24.6%
sub-neg24.6%
metadata-eval24.6%
+-commutative24.6%
Simplified24.6%
if -9.49999999999999985e-34 < x < 520Initial program 47.1%
Simplified47.1%
Taylor expanded in x around 0 83.6%
if 520 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.7%
pow-exp22.7%
*-commutative22.7%
+-commutative22.7%
distribute-rgt-in22.7%
add-sqr-sqrt0.0%
sqrt-unprod56.4%
sqr-neg56.4%
sqrt-unprod39.5%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
fma-define39.5%
add-sqr-sqrt0.0%
sqrt-unprod91.6%
sqr-neg91.6%
Applied egg-rr100.0%
Taylor expanded in eps around 0 62.0%
rec-exp62.0%
div-sub62.0%
neg-mul-162.0%
+-inverses62.0%
Simplified62.0%
metadata-eval62.0%
Applied egg-rr62.0%
Final simplification67.3%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 2.0) (/ (- 2.0 x) 2.0) 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 - x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 2.0d0) then
tmp = (2.0d0 - x) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 2.0) {
tmp = (2.0 - x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 2.0: tmp = (2.0 - x) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 2.0) tmp = Float64(Float64(2.0 - x) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 2.0) tmp = (2.0 - x) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 2.0], N[(N[(2.0 - x), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;\frac{2 - x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2Initial program 58.4%
Simplified38.9%
Taylor expanded in eps around inf 97.8%
Taylor expanded in eps around inf 97.8%
associate-*r*97.8%
neg-mul-197.8%
Simplified97.8%
Taylor expanded in x around 0 65.0%
distribute-rgt1-in65.0%
metadata-eval65.0%
mul0-lft65.0%
metadata-eval65.0%
*-commutative65.0%
neg-mul-165.0%
Simplified65.0%
if 2 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.1%
pow-exp22.1%
*-commutative22.1%
+-commutative22.1%
distribute-rgt-in22.1%
add-sqr-sqrt0.0%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
*-un-lft-identity41.2%
fma-define41.2%
add-sqr-sqrt0.0%
sqrt-unprod91.8%
sqr-neg91.8%
Applied egg-rr100.0%
Taylor expanded in eps around 0 60.4%
rec-exp60.4%
div-sub60.4%
neg-mul-160.4%
+-inverses60.4%
Simplified60.4%
metadata-eval60.4%
Applied egg-rr60.4%
Final simplification63.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 1.0) (- 1.0 x) 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 - x;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 1.0d0 - x
else
tmp = 0.0d0
end if
code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= 1.0) {
tmp = 1.0 - x;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 1.0: tmp = 1.0 - x else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 1.0) tmp = Float64(1.0 - x); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= 1.0) tmp = 1.0 - x; else tmp = 0.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 1.0], N[(1.0 - x), $MachinePrecision], 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1Initial program 58.4%
Simplified38.9%
Taylor expanded in eps around inf 97.8%
Taylor expanded in x around 0 64.9%
associate--l+64.3%
sub-neg64.3%
distribute-lft-in64.3%
metadata-eval64.3%
neg-mul-164.3%
unsub-neg64.3%
metadata-eval64.3%
Simplified64.3%
Taylor expanded in x around inf 64.8%
sub-neg64.8%
associate-*r/64.8%
metadata-eval64.8%
metadata-eval64.8%
Simplified64.8%
Taylor expanded in x around 0 64.9%
neg-mul-164.9%
unsub-neg64.9%
Simplified64.9%
if 1 < x Initial program 100.0%
Simplified100.0%
pow-exp100.0%
pow-neg100.0%
un-div-inv100.0%
+-commutative100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt22.1%
pow-exp22.1%
*-commutative22.1%
+-commutative22.1%
distribute-rgt-in22.1%
add-sqr-sqrt0.0%
sqrt-unprod57.6%
sqr-neg57.6%
sqrt-unprod41.2%
add-sqr-sqrt41.2%
*-un-lft-identity41.2%
fma-define41.2%
add-sqr-sqrt0.0%
sqrt-unprod91.8%
sqr-neg91.8%
Applied egg-rr100.0%
Taylor expanded in eps around 0 60.4%
rec-exp60.4%
div-sub60.4%
neg-mul-160.4%
+-inverses60.4%
Simplified60.4%
metadata-eval60.4%
Applied egg-rr60.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 0.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 0.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 0.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 0.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 0.0
eps_m = abs(eps) function code(x, eps_m) return 0.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 0.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 0.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
0
\end{array}
Initial program 70.1%
Simplified70.1%
pow-exp56.1%
pow-neg56.1%
un-div-inv56.1%
+-commutative56.1%
add-sqr-sqrt34.9%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod9.3%
add-sqr-sqrt19.4%
pow-exp33.4%
*-commutative33.4%
+-commutative33.4%
distribute-rgt-in33.4%
add-sqr-sqrt14.8%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-unprod27.0%
add-sqr-sqrt53.5%
*-un-lft-identity53.5%
fma-define53.5%
add-sqr-sqrt26.6%
sqrt-unprod63.2%
sqr-neg63.2%
Applied egg-rr70.1%
Taylor expanded in eps around 0 18.6%
rec-exp18.6%
div-sub18.6%
neg-mul-118.6%
+-inverses18.8%
Simplified18.8%
metadata-eval18.8%
Applied egg-rr18.8%
herbie shell --seed 2024160
(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))