
(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 (if (<= eps_m 5.45e-5) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (exp (* x eps_m)) (exp (* eps_m (- x)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 5.45e-5) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (exp((x * eps_m)) + exp((eps_m * -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 (eps_m <= 5.45d-5) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else
tmp = (exp((x * eps_m)) + exp((eps_m * -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 (eps_m <= 5.45e-5) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (Math.exp((x * eps_m)) + Math.exp((eps_m * -x))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 5.45e-5: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (math.exp((x * eps_m)) + math.exp((eps_m * -x))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 5.45e-5) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); else tmp = Float64(Float64(exp(Float64(x * eps_m)) + exp(Float64(eps_m * Float64(-x)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (eps_m <= 5.45e-5) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (exp((x * eps_m)) + exp((eps_m * -x))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 5.45e-5], N[(N[(N[(eps$95$m * N[(N[Exp[(-x)], $MachinePrecision] * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 5.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m} + e^{eps\_m \cdot \left(-x\right)}}{2}\\
\end{array}
\end{array}
if eps < 5.45000000000000034e-5Initial program 61.6%
Simplified50.8%
Taylor expanded in eps around 0 31.0%
associate-+r+70.7%
mul-1-neg70.7%
sub-neg70.7%
+-inverses70.7%
associate-*r*70.7%
distribute-rgt-out71.3%
mul-1-neg71.3%
Simplified71.3%
if 5.45000000000000034e-5 < eps Initial program 100.0%
Simplified87.6%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around -inf 100.0%
cancel-sign-sub-inv100.0%
exp-sum100.0%
metadata-eval100.0%
*-lft-identity100.0%
exp-sum100.0%
distribute-lft1-in100.0%
+-commutative100.0%
remove-double-neg100.0%
mul-1-neg100.0%
sub-neg100.0%
*-commutative100.0%
exp-neg100.0%
distribute-rgt-neg-in100.0%
cancel-sign-sub-inv100.0%
metadata-eval100.0%
*-lft-identity100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
associate-*r*100.0%
mul-1-neg100.0%
Simplified100.0%
Final simplification78.4%
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 71.2%
Simplified64.4%
Taylor expanded in eps around inf 98.5%
Taylor expanded in x around -inf 98.5%
cancel-sign-sub-inv98.5%
exp-sum79.7%
metadata-eval79.7%
*-lft-identity79.7%
exp-sum98.5%
distribute-lft1-in98.5%
+-commutative98.5%
remove-double-neg98.5%
mul-1-neg98.5%
sub-neg98.5%
*-commutative98.5%
exp-neg98.5%
distribute-rgt-neg-in98.5%
cancel-sign-sub-inv98.5%
metadata-eval98.5%
*-lft-identity98.5%
distribute-neg-in98.5%
metadata-eval98.5%
unsub-neg98.5%
Simplified98.5%
Final simplification98.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 5.45e-5)
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(if (<= eps_m 3.3e+126)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(/ (* eps_m (+ x (/ (+ 1.0 (exp (* eps_m (- x)))) eps_m))) 2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 5.45e-5) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if (eps_m <= 3.3e+126) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else {
tmp = (eps_m * (x + ((1.0 + exp((eps_m * -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 <= 5.45d-5) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else if (eps_m <= 3.3d+126) then
tmp = (1.0d0 + exp((x * eps_m))) / 2.0d0
else
tmp = (eps_m * (x + ((1.0d0 + exp((eps_m * -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 <= 5.45e-5) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else if (eps_m <= 3.3e+126) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else {
tmp = (eps_m * (x + ((1.0 + Math.exp((eps_m * -x))) / eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 5.45e-5: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 elif eps_m <= 3.3e+126: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 else: tmp = (eps_m * (x + ((1.0 + math.exp((eps_m * -x))) / eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 5.45e-5) tmp = Float64(Float64(Float64(eps_m * Float64(exp(Float64(-x)) * Float64(2.0 + Float64(x * 2.0)))) / eps_m) / 2.0); elseif (eps_m <= 3.3e+126) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); else tmp = Float64(Float64(eps_m * Float64(x + Float64(Float64(1.0 + exp(Float64(eps_m * 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 <= 5.45e-5) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; elseif (eps_m <= 3.3e+126) tmp = (1.0 + exp((x * eps_m))) / 2.0; else tmp = (eps_m * (x + ((1.0 + exp((eps_m * -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, 5.45e-5], N[(N[(N[(eps$95$m * N[(N[Exp[(-x)], $MachinePrecision] * N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps$95$m, 3.3e+126], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(eps$95$m * N[(x + N[(N[(1.0 + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 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 5.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{elif}\;eps\_m \leq 3.3 \cdot 10^{+126}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{1 + e^{eps\_m \cdot \left(-x\right)}}{eps\_m}\right)}{2}\\
\end{array}
\end{array}
if eps < 5.45000000000000034e-5Initial program 61.6%
Simplified50.8%
Taylor expanded in eps around 0 31.0%
associate-+r+70.7%
mul-1-neg70.7%
sub-neg70.7%
+-inverses70.7%
associate-*r*70.7%
distribute-rgt-out71.3%
mul-1-neg71.3%
Simplified71.3%
if 5.45000000000000034e-5 < eps < 3.30000000000000013e126Initial program 100.0%
Simplified95.6%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 86.8%
Taylor expanded in eps around inf 86.8%
*-commutative100.0%
Simplified86.8%
if 3.30000000000000013e126 < eps Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 65.9%
+-commutative65.9%
associate-+r+65.9%
mul-1-neg65.9%
distribute-rgt-neg-in65.9%
*-commutative65.9%
distribute-rgt-neg-in65.9%
neg-mul-165.9%
distribute-rgt-in65.9%
metadata-eval65.9%
associate-*l/65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in eps around inf 80.2%
Simplified80.2%
Taylor expanded in eps around inf 80.2%
associate-*r*100.0%
mul-1-neg100.0%
Simplified80.2%
Final simplification74.0%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 8e-305) (/ (* eps_m (+ x (/ (+ 1.0 (exp (* eps_m (- x)))) eps_m))) 2.0) (/ (+ 1.0 (exp (* x eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 8e-305) {
tmp = (eps_m * (x + ((1.0 + exp((eps_m * -x))) / eps_m))) / 2.0;
} else {
tmp = (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) :: tmp
if (x <= 8d-305) then
tmp = (eps_m * (x + ((1.0d0 + exp((eps_m * -x))) / eps_m))) / 2.0d0
else
tmp = (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 tmp;
if (x <= 8e-305) {
tmp = (eps_m * (x + ((1.0 + Math.exp((eps_m * -x))) / eps_m))) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 8e-305: tmp = (eps_m * (x + ((1.0 + math.exp((eps_m * -x))) / eps_m))) / 2.0 else: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 8e-305) tmp = Float64(Float64(eps_m * Float64(x + Float64(Float64(1.0 + exp(Float64(eps_m * Float64(-x)))) / eps_m))) / 2.0); else tmp = Float64(Float64(1.0 + 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 (x <= 8e-305) tmp = (eps_m * (x + ((1.0 + exp((eps_m * -x))) / eps_m))) / 2.0; else tmp = (1.0 + exp((x * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 8e-305], N[(N[(eps$95$m * N[(x + N[(N[(1.0 + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + 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}\;x \leq 8 \cdot 10^{-305}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{1 + e^{eps\_m \cdot \left(-x\right)}}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if x < 7.99999999999999997e-305Initial program 65.8%
Simplified65.8%
Taylor expanded in x around 0 40.6%
+-commutative40.6%
associate-+r+40.6%
mul-1-neg40.6%
distribute-rgt-neg-in40.6%
*-commutative40.6%
distribute-rgt-neg-in40.6%
neg-mul-140.6%
distribute-rgt-in40.6%
metadata-eval40.6%
associate-*l/40.6%
metadata-eval40.6%
Simplified40.6%
Taylor expanded in eps around inf 78.3%
Simplified78.3%
Taylor expanded in eps around inf 78.4%
associate-*r*98.1%
mul-1-neg98.1%
Simplified78.4%
if 7.99999999999999997e-305 < x Initial program 75.0%
Simplified70.5%
Taylor expanded in eps around inf 98.9%
Taylor expanded in x around 0 63.0%
Taylor expanded in eps around inf 63.3%
*-commutative84.7%
Simplified63.3%
Final simplification69.5%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -2e-298) (/ (+ 1.0 (exp (* x (- -1.0 eps_m)))) 2.0) (/ (+ 1.0 (exp (* x eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -2e-298) {
tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0;
} else {
tmp = (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) :: tmp
if (x <= (-2d-298)) then
tmp = (1.0d0 + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
else
tmp = (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 tmp;
if (x <= -2e-298) {
tmp = (1.0 + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -2e-298: tmp = (1.0 + math.exp((x * (-1.0 - eps_m)))) / 2.0 else: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -2e-298) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0); else tmp = Float64(Float64(1.0 + 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 (x <= -2e-298) tmp = (1.0 + exp((x * (-1.0 - eps_m)))) / 2.0; else tmp = (1.0 + exp((x * eps_m))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -2e-298], N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + 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}\;x \leq -2 \cdot 10^{-298}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(-1 - eps\_m\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if x < -1.99999999999999982e-298Initial program 66.1%
Simplified56.1%
Taylor expanded in eps around inf 97.9%
Taylor expanded in x around -inf 97.9%
cancel-sign-sub-inv97.9%
exp-sum78.5%
metadata-eval78.5%
*-lft-identity78.5%
exp-sum97.9%
distribute-lft1-in97.9%
+-commutative97.9%
remove-double-neg97.9%
mul-1-neg97.9%
sub-neg97.9%
*-commutative97.9%
exp-neg97.9%
distribute-rgt-neg-in97.9%
cancel-sign-sub-inv97.9%
metadata-eval97.9%
*-lft-identity97.9%
distribute-neg-in97.9%
metadata-eval97.9%
unsub-neg97.9%
Simplified97.9%
Taylor expanded in eps around inf 97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 68.1%
if -1.99999999999999982e-298 < x Initial program 74.7%
Simplified70.0%
Taylor expanded in eps around inf 98.9%
Taylor expanded in x around 0 63.2%
Taylor expanded in eps around inf 63.5%
*-commutative84.9%
Simplified63.5%
Final simplification65.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -70000000.0) (/ (/ (expm1 (- x)) eps_m) 2.0) (/ (+ 1.0 (exp (* x eps_m))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (expm1(-x) / eps_m) / 2.0;
} else {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (Math.expm1(-x) / eps_m) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -70000000.0: tmp = (math.expm1(-x) / eps_m) / 2.0 else: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -70000000.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps_m) / 2.0); else tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -70000000.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + 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}\;x \leq -70000000:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\end{array}
\end{array}
if x < -7e7Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 60.1%
Taylor expanded in eps around 0 41.2%
expm1-define41.2%
neg-mul-141.2%
Simplified41.2%
if -7e7 < x Initial program 66.8%
Simplified58.9%
Taylor expanded in eps around inf 98.3%
Taylor expanded in x around 0 72.0%
Taylor expanded in eps around inf 72.3%
*-commutative88.6%
Simplified72.3%
Final simplification68.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -70000000.0) (/ (/ (expm1 (- x)) eps_m) 2.0) (if (<= x 4000.0) 1.0 (if (<= x 8.2e+229) 0.0 (/ (* x eps_m) 2.0)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (expm1(-x) / eps_m) / 2.0;
} else if (x <= 4000.0) {
tmp = 1.0;
} else if (x <= 8.2e+229) {
tmp = 0.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -70000000.0) {
tmp = (Math.expm1(-x) / eps_m) / 2.0;
} else if (x <= 4000.0) {
tmp = 1.0;
} else if (x <= 8.2e+229) {
tmp = 0.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -70000000.0: tmp = (math.expm1(-x) / eps_m) / 2.0 elif x <= 4000.0: tmp = 1.0 elif x <= 8.2e+229: tmp = 0.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -70000000.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps_m) / 2.0); elseif (x <= 4000.0) tmp = 1.0; elseif (x <= 8.2e+229) tmp = 0.0; else tmp = Float64(Float64(x * eps_m) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -70000000.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4000.0], 1.0, If[LessEqual[x, 8.2e+229], 0.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 -70000000:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 4000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -7e7Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 60.1%
Taylor expanded in eps around 0 41.2%
expm1-define41.2%
neg-mul-141.2%
Simplified41.2%
if -7e7 < x < 4e3Initial program 50.5%
Simplified50.5%
Taylor expanded in x around 0 78.7%
if 4e3 < x < 8.2000000000000003e229Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 50.8%
mul-1-neg50.8%
mul-1-neg50.8%
rec-exp50.8%
sub-neg50.8%
div-sub50.8%
mul-1-neg50.8%
rec-exp50.8%
+-inverses50.8%
Simplified50.8%
if 8.2000000000000003e229 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 53.9%
+-commutative53.9%
associate-+r+53.9%
mul-1-neg53.9%
distribute-rgt-neg-in53.9%
*-commutative53.9%
distribute-rgt-neg-in53.9%
neg-mul-153.9%
distribute-rgt-in53.9%
metadata-eval53.9%
associate-*l/53.9%
metadata-eval53.9%
Simplified53.9%
Taylor expanded in eps around inf 69.9%
Simplified69.9%
Taylor expanded in eps around inf 48.9%
*-commutative48.9%
Simplified48.9%
Final simplification65.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.0) (* (* x eps_m) -0.5) (if (<= x 4000.0) 1.0 (if (<= x 8e+229) 0.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) * -0.5;
} else if (x <= 4000.0) {
tmp = 1.0;
} else if (x <= 8e+229) {
tmp = 0.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) * (-0.5d0)
else if (x <= 4000.0d0) then
tmp = 1.0d0
else if (x <= 8d+229) then
tmp = 0.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) * -0.5;
} else if (x <= 4000.0) {
tmp = 1.0;
} else if (x <= 8e+229) {
tmp = 0.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) * -0.5 elif x <= 4000.0: tmp = 1.0 elif x <= 8e+229: tmp = 0.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(x * eps_m) * -0.5); elseif (x <= 4000.0) tmp = 1.0; elseif (x <= 8e+229) tmp = 0.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) * -0.5; elseif (x <= 4000.0) tmp = 1.0; elseif (x <= 8e+229) tmp = 0.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] * -0.5), $MachinePrecision], If[LessEqual[x, 4000.0], 1.0, If[LessEqual[x, 8e+229], 0.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:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 4000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < -1Initial program 94.7%
Simplified94.7%
Taylor expanded in x around 0 50.6%
+-commutative50.6%
associate-+r+50.6%
mul-1-neg50.6%
distribute-rgt-neg-in50.6%
*-commutative50.6%
distribute-rgt-neg-in50.6%
neg-mul-150.6%
distribute-rgt-in50.6%
metadata-eval50.6%
associate-*l/50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in eps around inf 66.9%
Simplified66.9%
Taylor expanded in eps around inf 29.1%
*-commutative29.1%
Simplified29.1%
frac-2neg29.1%
*-commutative29.1%
distribute-lft-neg-out29.1%
div-inv29.1%
*-commutative29.1%
add-sqr-sqrt29.0%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod20.3%
add-sqr-sqrt20.5%
metadata-eval20.5%
metadata-eval20.5%
Applied egg-rr20.5%
if -1 < x < 4e3Initial program 50.9%
Simplified50.9%
Taylor expanded in x around 0 80.2%
if 4e3 < x < 7.9999999999999999e229Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 50.8%
mul-1-neg50.8%
mul-1-neg50.8%
rec-exp50.8%
sub-neg50.8%
div-sub50.8%
mul-1-neg50.8%
rec-exp50.8%
+-inverses50.8%
Simplified50.8%
if 7.9999999999999999e229 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 53.9%
+-commutative53.9%
associate-+r+53.9%
mul-1-neg53.9%
distribute-rgt-neg-in53.9%
*-commutative53.9%
distribute-rgt-neg-in53.9%
neg-mul-153.9%
distribute-rgt-in53.9%
metadata-eval53.9%
associate-*l/53.9%
metadata-eval53.9%
Simplified53.9%
Taylor expanded in eps around inf 69.9%
Simplified69.9%
Taylor expanded in eps around inf 48.9%
*-commutative48.9%
Simplified48.9%
Final simplification63.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 300.0) (/ (- 2.0 (* x eps_m)) 2.0) (if (<= x 8.2e+229) 0.0 (/ (* x eps_m) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 300.0) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 8.2e+229) {
tmp = 0.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 <= 300.0d0) then
tmp = (2.0d0 - (x * eps_m)) / 2.0d0
else if (x <= 8.2d+229) then
tmp = 0.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 <= 300.0) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 8.2e+229) {
tmp = 0.0;
} else {
tmp = (x * eps_m) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 300.0: tmp = (2.0 - (x * eps_m)) / 2.0 elif x <= 8.2e+229: tmp = 0.0 else: tmp = (x * eps_m) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 300.0) tmp = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0); elseif (x <= 8.2e+229) tmp = 0.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 <= 300.0) tmp = (2.0 - (x * eps_m)) / 2.0; elseif (x <= 8.2e+229) tmp = 0.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, 300.0], N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 8.2e+229], 0.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 300:\\
\;\;\;\;\frac{2 - x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+229}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot eps\_m}{2}\\
\end{array}
\end{array}
if x < 300Initial program 59.5%
Simplified49.9%
Taylor expanded in x around 0 65.0%
Taylor expanded in eps around 0 68.1%
Taylor expanded in x around 0 68.1%
mul-1-neg68.1%
*-commutative68.1%
unsub-neg68.1%
Simplified68.1%
if 300 < x < 8.2000000000000003e229Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 49.9%
mul-1-neg49.9%
mul-1-neg49.9%
rec-exp49.9%
sub-neg49.9%
div-sub49.9%
mul-1-neg49.9%
rec-exp49.9%
+-inverses49.9%
Simplified49.9%
if 8.2000000000000003e229 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 53.9%
+-commutative53.9%
associate-+r+53.9%
mul-1-neg53.9%
distribute-rgt-neg-in53.9%
*-commutative53.9%
distribute-rgt-neg-in53.9%
neg-mul-153.9%
distribute-rgt-in53.9%
metadata-eval53.9%
associate-*l/53.9%
metadata-eval53.9%
Simplified53.9%
Taylor expanded in eps around inf 69.9%
Simplified69.9%
Taylor expanded in eps around inf 48.9%
*-commutative48.9%
Simplified48.9%
Final simplification62.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -1.0) (* (* x eps_m) -0.5) (if (<= x 4000.0) 1.0 0.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 4000.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 <= (-1.0d0)) then
tmp = (x * eps_m) * (-0.5d0)
else if (x <= 4000.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 <= -1.0) {
tmp = (x * eps_m) * -0.5;
} else if (x <= 4000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1.0: tmp = (x * eps_m) * -0.5 elif x <= 4000.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(x * eps_m) * -0.5); elseif (x <= 4000.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 <= -1.0) tmp = (x * eps_m) * -0.5; elseif (x <= 4000.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, -1.0], N[(N[(x * eps$95$m), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[x, 4000.0], 1.0, 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\left(x \cdot eps\_m\right) \cdot -0.5\\
\mathbf{elif}\;x \leq 4000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1Initial program 94.7%
Simplified94.7%
Taylor expanded in x around 0 50.6%
+-commutative50.6%
associate-+r+50.6%
mul-1-neg50.6%
distribute-rgt-neg-in50.6%
*-commutative50.6%
distribute-rgt-neg-in50.6%
neg-mul-150.6%
distribute-rgt-in50.6%
metadata-eval50.6%
associate-*l/50.6%
metadata-eval50.6%
Simplified50.6%
Taylor expanded in eps around inf 66.9%
Simplified66.9%
Taylor expanded in eps around inf 29.1%
*-commutative29.1%
Simplified29.1%
frac-2neg29.1%
*-commutative29.1%
distribute-lft-neg-out29.1%
div-inv29.1%
*-commutative29.1%
add-sqr-sqrt29.0%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod20.3%
add-sqr-sqrt20.5%
metadata-eval20.5%
metadata-eval20.5%
Applied egg-rr20.5%
if -1 < x < 4e3Initial program 50.9%
Simplified50.9%
Taylor expanded in x around 0 80.2%
if 4e3 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 43.4%
mul-1-neg43.4%
mul-1-neg43.4%
rec-exp43.4%
sub-neg43.4%
div-sub43.4%
mul-1-neg43.4%
rec-exp43.4%
+-inverses43.4%
Simplified43.4%
Final simplification61.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 4000.0) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 4000.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 <= 4000.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 <= 4000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 4000.0: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 4000.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 <= 4000.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, 4000.0], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4e3Initial program 59.7%
Simplified59.7%
Taylor expanded in x around 0 64.6%
if 4e3 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 43.4%
mul-1-neg43.4%
mul-1-neg43.4%
rec-exp43.4%
sub-neg43.4%
div-sub43.4%
mul-1-neg43.4%
rec-exp43.4%
+-inverses43.4%
Simplified43.4%
Final simplification58.6%
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 71.2%
Simplified58.7%
Taylor expanded in eps around 0 14.0%
mul-1-neg14.0%
mul-1-neg14.0%
rec-exp14.0%
sub-neg14.0%
div-sub14.0%
mul-1-neg14.0%
rec-exp14.0%
+-inverses14.2%
Simplified14.2%
Final simplification14.2%
herbie shell --seed 2024108
(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))