
(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 16 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 7e-15) (/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0) (/ (+ (exp (* x eps_m)) (/ 1.0 (pow E (* x eps_m)))) 2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (exp((x * eps_m)) + (1.0 / pow(((double) M_E), (x * eps_m)))) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (eps_m <= 7e-15) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (Math.exp((x * eps_m)) + (1.0 / Math.pow(Math.E, (x * eps_m)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if eps_m <= 7e-15: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (math.exp((x * eps_m)) + (1.0 / math.pow(math.e, (x * eps_m)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 7e-15) 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)) + Float64(1.0 / (exp(1) ^ 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 <= 7e-15) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (exp((x * eps_m)) + (1.0 / (2.71828182845904523536 ^ (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, 7e-15], 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[(1.0 / N[Power[E, N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 7 \cdot 10^{-15}:\\
\;\;\;\;\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} + \frac{1}{{e}^{\left(x \cdot eps\_m\right)}}}{2}\\
\end{array}
\end{array}
if eps < 7.0000000000000001e-15Initial program 58.4%
Simplified51.5%
Taylor expanded in eps around 0 29.2%
associate-+r+71.1%
mul-1-neg71.1%
sub-neg71.1%
+-inverses71.1%
associate-*r*71.1%
distribute-rgt-out71.1%
mul-1-neg71.1%
Simplified71.1%
if 7.0000000000000001e-15 < eps Initial program 100.0%
Simplified90.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
*-un-lft-identity100.0%
exp-prod100.0%
Applied egg-rr100.0%
exp-1-e100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (exp (* x eps_m))))
(if (<= eps_m 7e-15)
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(/ (+ t_0 (/ 1.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 <= 7e-15) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (t_0 + (1.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 <= 7d-15) then
tmp = ((eps_m * (exp(-x) * (2.0d0 + (x * 2.0d0)))) / eps_m) / 2.0d0
else
tmp = (t_0 + (1.0d0 / 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 <= 7e-15) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (t_0 + (1.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 <= 7e-15: tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (t_0 + (1.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 <= 7e-15) 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(t_0 + Float64(1.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 <= 7e-15) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (t_0 + (1.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, 7e-15], 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[(t$95$0 + N[(1.0 / t$95$0), $MachinePrecision]), $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 7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 + \frac{1}{t\_0}}{2}\\
\end{array}
\end{array}
if eps < 7.0000000000000001e-15Initial program 58.4%
Simplified51.5%
Taylor expanded in eps around 0 29.2%
associate-+r+71.1%
mul-1-neg71.1%
sub-neg71.1%
+-inverses71.1%
associate-*r*71.1%
distribute-rgt-out71.1%
mul-1-neg71.1%
Simplified71.1%
if 7.0000000000000001e-15 < eps Initial program 100.0%
Simplified90.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification81.6%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (+ eps_m -1.0))) (/ 1.0 (exp (+ x (* x eps_m))))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (x * 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)))) + (1.0d0 / exp((x + (x * 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))) + (1.0 / Math.exp((x + (x * eps_m))))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (eps_m + -1.0))) + (1.0 / math.exp((x + (x * eps_m))))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(eps_m + -1.0))) + Float64(1.0 / exp(Float64(x + Float64(x * eps_m))))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (eps_m + -1.0))) + (1.0 / exp((x + (x * 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[(1.0 / N[Exp[N[(x + N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot \left(eps\_m + -1\right)} + \frac{1}{e^{x + x \cdot eps\_m}}}{2}
\end{array}
Initial program 73.5%
Simplified65.4%
Taylor expanded in eps around inf 99.2%
Final simplification99.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -5e-282)
(/ (+ 1.0 (pow E (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 1.12e+66)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(if (or (<= x 2.1e+80) (not (<= x 2e+261)))
(/ (/ (* eps_m (* (exp (- x)) (+ 2.0 (* x 2.0)))) eps_m) 2.0)
(/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -5e-282) {
tmp = (1.0 + pow(((double) M_E), (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 1.12e+66) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else if ((x <= 2.1e+80) || !(x <= 2e+261)) {
tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -5e-282) {
tmp = (1.0 + Math.pow(Math.E, (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 1.12e+66) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else if ((x <= 2.1e+80) || !(x <= 2e+261)) {
tmp = ((eps_m * (Math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -5e-282: tmp = (1.0 + math.pow(math.e, (x * (1.0 - eps_m)))) / 2.0 elif x <= 1.12e+66: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 elif (x <= 2.1e+80) or not (x <= 2e+261): tmp = ((eps_m * (math.exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0 else: tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -5e-282) tmp = Float64(Float64(1.0 + (exp(1) ^ Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 1.12e+66) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); elseif ((x <= 2.1e+80) || !(x <= 2e+261)) 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(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 2.0); end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) tmp = 0.0; if (x <= -5e-282) tmp = (1.0 + (2.71828182845904523536 ^ (x * (1.0 - eps_m)))) / 2.0; elseif (x <= 1.12e+66) tmp = (1.0 + exp((x * eps_m))) / 2.0; elseif ((x <= 2.1e+80) || ~((x <= 2e+261))) tmp = ((eps_m * (exp(-x) * (2.0 + (x * 2.0)))) / eps_m) / 2.0; else tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0; end tmp_2 = tmp; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -5e-282], N[(N[(1.0 + N[Power[E, N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.12e+66], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 2.1e+80], N[Not[LessEqual[x, 2e+261]], $MachinePrecision]], 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[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-282}:\\
\;\;\;\;\frac{1 + {e}^{\left(x \cdot \left(1 - eps\_m\right)\right)}}{2}\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+66}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+80} \lor \neg \left(x \leq 2 \cdot 10^{+261}\right):\\
\;\;\;\;\frac{\frac{eps\_m \cdot \left(e^{-x} \cdot \left(2 + x \cdot 2\right)\right)}{eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\end{array}
\end{array}
if x < -5.0000000000000001e-282Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
*-commutative77.4%
*-un-lft-identity77.4%
exp-prod77.4%
e-exp-177.4%
*-commutative77.4%
Applied egg-rr77.4%
if -5.0000000000000001e-282 < x < 1.12e66Initial program 57.3%
Simplified47.3%
Taylor expanded in eps around inf 98.1%
Taylor expanded in x around 0 84.0%
Taylor expanded in eps around inf 84.7%
*-commutative97.9%
Simplified84.7%
if 1.12e66 < x < 2.10000000000000001e80 or 1.9999999999999999e261 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
associate-+r+78.1%
mul-1-neg78.1%
sub-neg78.1%
+-inverses78.1%
associate-*r*78.1%
distribute-rgt-out78.1%
mul-1-neg78.1%
Simplified78.1%
if 2.10000000000000001e80 < x < 1.9999999999999999e261Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 41.0%
Final simplification73.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e-280)
(/ (+ 1.0 (exp (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 3.5e+70)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(if (<= x 1e+81)
0.0
(if (<= x 3.15e+266) (/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 3.5e+70) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else if (x <= 1e+81) {
tmp = 0.0;
} else if (x <= 3.15e+266) {
tmp = (1.0 + exp((x * (eps_m + -1.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) :: tmp
if (x <= (-1d-280)) then
tmp = (1.0d0 + exp((x * (1.0d0 - eps_m)))) / 2.0d0
else if (x <= 3.5d+70) then
tmp = (1.0d0 + exp((x * eps_m))) / 2.0d0
else if (x <= 1d+81) then
tmp = 0.0d0
else if (x <= 3.15d+266) then
tmp = (1.0d0 + exp((x * (eps_m + (-1.0d0))))) / 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 <= -1e-280) {
tmp = (1.0 + Math.exp((x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 3.5e+70) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else if (x <= 1e+81) {
tmp = 0.0;
} else if (x <= 3.15e+266) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e-280: tmp = (1.0 + math.exp((x * (1.0 - eps_m)))) / 2.0 elif x <= 3.5e+70: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 elif x <= 1e+81: tmp = 0.0 elif x <= 3.15e+266: tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e-280) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 3.5e+70) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); elseif (x <= 1e+81) tmp = 0.0; elseif (x <= 3.15e+266) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 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 <= -1e-280) tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0; elseif (x <= 3.5e+70) tmp = (1.0 + exp((x * eps_m))) / 2.0; elseif (x <= 1e+81) tmp = 0.0; elseif (x <= 3.15e+266) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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, -1e-280], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.5e+70], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e+81], 0.0, If[LessEqual[x, 3.15e+266], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $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 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{elif}\;x \leq 10^{+81}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{+266}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.9999999999999996e-281Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
if -9.9999999999999996e-281 < x < 3.50000000000000002e70Initial program 57.3%
Simplified47.3%
Taylor expanded in eps around inf 98.1%
Taylor expanded in x around 0 84.0%
Taylor expanded in eps around inf 84.7%
*-commutative97.9%
Simplified84.7%
if 3.50000000000000002e70 < x < 9.99999999999999921e80 or 3.15e266 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
if 9.99999999999999921e80 < x < 3.15e266Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 41.0%
Final simplification73.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e-280)
(/ (+ 1.0 (pow E (* x (- 1.0 eps_m)))) 2.0)
(if (<= x 1.56e+66)
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
(if (<= x 1.15e+85)
0.0
(if (<= x 4.65e+266) (/ (+ 1.0 (exp (* x (+ eps_m -1.0)))) 2.0) 0.0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + pow(((double) M_E), (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 1.56e+66) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else if (x <= 1.15e+85) {
tmp = 0.0;
} else if (x <= 4.65e+266) {
tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + Math.pow(Math.E, (x * (1.0 - eps_m)))) / 2.0;
} else if (x <= 1.56e+66) {
tmp = (1.0 + Math.exp((x * eps_m))) / 2.0;
} else if (x <= 1.15e+85) {
tmp = 0.0;
} else if (x <= 4.65e+266) {
tmp = (1.0 + Math.exp((x * (eps_m + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -1e-280: tmp = (1.0 + math.pow(math.e, (x * (1.0 - eps_m)))) / 2.0 elif x <= 1.56e+66: tmp = (1.0 + math.exp((x * eps_m))) / 2.0 elif x <= 1.15e+85: tmp = 0.0 elif x <= 4.65e+266: tmp = (1.0 + math.exp((x * (eps_m + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -1e-280) tmp = Float64(Float64(1.0 + (exp(1) ^ Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif (x <= 1.56e+66) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); elseif (x <= 1.15e+85) tmp = 0.0; elseif (x <= 4.65e+266) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps_m + -1.0)))) / 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 <= -1e-280) tmp = (1.0 + (2.71828182845904523536 ^ (x * (1.0 - eps_m)))) / 2.0; elseif (x <= 1.56e+66) tmp = (1.0 + exp((x * eps_m))) / 2.0; elseif (x <= 1.15e+85) tmp = 0.0; elseif (x <= 4.65e+266) tmp = (1.0 + exp((x * (eps_m + -1.0)))) / 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, -1e-280], N[(N[(1.0 + N[Power[E, N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.56e+66], N[(N[(1.0 + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.15e+85], 0.0, If[LessEqual[x, 4.65e+266], N[(N[(1.0 + N[Exp[N[(x * N[(eps$95$m + -1.0), $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 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + {e}^{\left(x \cdot \left(1 - eps\_m\right)\right)}}{2}\\
\mathbf{elif}\;x \leq 1.56 \cdot 10^{+66}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+85}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4.65 \cdot 10^{+266}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(eps\_m + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.9999999999999996e-281Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
*-commutative77.4%
*-un-lft-identity77.4%
exp-prod77.4%
e-exp-177.4%
*-commutative77.4%
Applied egg-rr77.4%
if -9.9999999999999996e-281 < x < 1.5599999999999999e66Initial program 57.3%
Simplified47.3%
Taylor expanded in eps around inf 98.1%
Taylor expanded in x around 0 84.0%
Taylor expanded in eps around inf 84.7%
*-commutative97.9%
Simplified84.7%
if 1.5599999999999999e66 < x < 1.1499999999999999e85 or 4.65e266 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
if 1.1499999999999999e85 < x < 4.65e266Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 41.0%
Final simplification73.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -450.0)
(/ (/ (expm1 (- x)) eps_m) 2.0)
(if (or (<= x 4.9e+70) (and (not (<= x 1.2e+80)) (<= x 4.65e+266)))
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -450.0) {
tmp = (expm1(-x) / eps_m) / 2.0;
} else if ((x <= 4.9e+70) || (!(x <= 1.2e+80) && (x <= 4.65e+266))) {
tmp = (1.0 + exp((x * eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -450.0) {
tmp = (Math.expm1(-x) / eps_m) / 2.0;
} else if ((x <= 4.9e+70) || (!(x <= 1.2e+80) && (x <= 4.65e+266))) {
tmp = (1.0 + Math.exp((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 <= -450.0: tmp = (math.expm1(-x) / eps_m) / 2.0 elif (x <= 4.9e+70) or (not (x <= 1.2e+80) and (x <= 4.65e+266)): tmp = (1.0 + math.exp((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 <= -450.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps_m) / 2.0); elseif ((x <= 4.9e+70) || (!(x <= 1.2e+80) && (x <= 4.65e+266))) tmp = Float64(Float64(1.0 + exp(Float64(x * eps_m))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -450.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 4.9e+70], And[N[Not[LessEqual[x, 1.2e+80]], $MachinePrecision], LessEqual[x, 4.65e+266]]], N[(N[(1.0 + N[Exp[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 -450:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{+70} \lor \neg \left(x \leq 1.2 \cdot 10^{+80}\right) \land x \leq 4.65 \cdot 10^{+266}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -450Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 34.5%
Taylor expanded in eps around 0 67.6%
expm1-define67.6%
neg-mul-167.6%
Simplified67.6%
if -450 < x < 4.90000000000000028e70 or 1.1999999999999999e80 < x < 4.65e266Initial program 66.7%
Simplified56.6%
Taylor expanded in eps around inf 99.0%
Taylor expanded in x around 0 75.2%
Taylor expanded in eps around inf 75.6%
*-commutative91.3%
Simplified75.6%
if 4.90000000000000028e70 < x < 1.1999999999999999e80 or 4.65e266 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
Final simplification74.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -1e-280)
(/ (+ 1.0 (exp (* x (- 1.0 eps_m)))) 2.0)
(if (or (<= x 1.25e+66) (and (not (<= x 1.2e+80)) (<= x 5e+260)))
(/ (+ 1.0 (exp (* x eps_m))) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -1e-280) {
tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0;
} else if ((x <= 1.25e+66) || (!(x <= 1.2e+80) && (x <= 5e+260))) {
tmp = (1.0 + exp((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 <= (-1d-280)) then
tmp = (1.0d0 + exp((x * (1.0d0 - eps_m)))) / 2.0d0
else if ((x <= 1.25d+66) .or. (.not. (x <= 1.2d+80)) .and. (x <= 5d+260)) then
tmp = (1.0d0 + exp((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 <= -1e-280) {
tmp = (1.0 + Math.exp((x * (1.0 - eps_m)))) / 2.0;
} else if ((x <= 1.25e+66) || (!(x <= 1.2e+80) && (x <= 5e+260))) {
tmp = (1.0 + Math.exp((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 <= -1e-280: tmp = (1.0 + math.exp((x * (1.0 - eps_m)))) / 2.0 elif (x <= 1.25e+66) or (not (x <= 1.2e+80) and (x <= 5e+260)): tmp = (1.0 + math.exp((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 <= -1e-280) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(1.0 - eps_m)))) / 2.0); elseif ((x <= 1.25e+66) || (!(x <= 1.2e+80) && (x <= 5e+260))) tmp = Float64(Float64(1.0 + exp(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 <= -1e-280) tmp = (1.0 + exp((x * (1.0 - eps_m)))) / 2.0; elseif ((x <= 1.25e+66) || (~((x <= 1.2e+80)) && (x <= 5e+260))) tmp = (1.0 + exp((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, -1e-280], N[(N[(1.0 + N[Exp[N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1.25e+66], And[N[Not[LessEqual[x, 1.2e+80]], $MachinePrecision], LessEqual[x, 5e+260]]], N[(N[(1.0 + N[Exp[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 -1 \cdot 10^{-280}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(1 - eps\_m\right)}}{2}\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+66} \lor \neg \left(x \leq 1.2 \cdot 10^{+80}\right) \land x \leq 5 \cdot 10^{+260}:\\
\;\;\;\;\frac{1 + e^{x \cdot eps\_m}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -9.9999999999999996e-281Initial program 71.6%
Simplified60.0%
Taylor expanded in eps around inf 99.8%
Taylor expanded in x around 0 68.9%
sub-neg68.9%
metadata-eval68.9%
distribute-rgt-in68.9%
add-sqr-sqrt0.0%
sqrt-unprod73.5%
sqr-neg73.5%
sqrt-unprod77.4%
add-sqr-sqrt77.4%
neg-mul-177.4%
*-un-lft-identity77.4%
distribute-rgt-in77.4%
+-commutative77.4%
*-commutative77.4%
distribute-rgt-neg-out77.4%
neg-sub077.4%
add-sqr-sqrt0.0%
sqrt-unprod66.9%
sqr-neg66.9%
sqrt-unprod68.8%
add-sqr-sqrt68.8%
*-commutative68.8%
+-commutative68.8%
distribute-rgt-in68.8%
Applied egg-rr77.4%
neg-sub077.4%
distribute-rgt-neg-in77.4%
+-commutative77.4%
distribute-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
Simplified77.4%
if -9.9999999999999996e-281 < x < 1.24999999999999998e66 or 1.1999999999999999e80 < x < 4.9999999999999996e260Initial program 71.4%
Simplified64.7%
Taylor expanded in eps around inf 98.7%
Taylor expanded in x around 0 69.8%
Taylor expanded in eps around inf 70.2%
*-commutative87.3%
Simplified70.2%
if 1.24999999999999998e66 < x < 1.1999999999999999e80 or 4.9999999999999996e260 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
Final simplification73.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -3.2e-12)
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0)
(if (or (<= x 4e+61) (and (not (<= x 3e+81)) (<= x 2e+256)))
(/ (+ 1.0 (exp x)) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -3.2e-12) {
tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
} else if ((x <= 4e+61) || (!(x <= 3e+81) && (x <= 2e+256))) {
tmp = (1.0 + exp(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 <= (-3.2d-12)) then
tmp = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
else if ((x <= 4d+61) .or. (.not. (x <= 3d+81)) .and. (x <= 2d+256)) then
tmp = (1.0d0 + exp(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 <= -3.2e-12) {
tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
} else if ((x <= 4e+61) || (!(x <= 3e+81) && (x <= 2e+256))) {
tmp = (1.0 + Math.exp(x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -3.2e-12: tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 elif (x <= 4e+61) or (not (x <= 3e+81) and (x <= 2e+256)): tmp = (1.0 + math.exp(x)) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -3.2e-12) tmp = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0); elseif ((x <= 4e+61) || (!(x <= 3e+81) && (x <= 2e+256))) tmp = Float64(Float64(1.0 + exp(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 <= -3.2e-12) tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; elseif ((x <= 4e+61) || (~((x <= 3e+81)) && (x <= 2e+256))) tmp = (1.0 + exp(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, -3.2e-12], N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 4e+61], And[N[Not[LessEqual[x, 3e+81]], $MachinePrecision], LessEqual[x, 2e+256]]], N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+61} \lor \neg \left(x \leq 3 \cdot 10^{+81}\right) \land x \leq 2 \cdot 10^{+256}:\\
\;\;\;\;\frac{1 + e^{x}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -3.2000000000000001e-12Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 34.5%
Taylor expanded in x around 0 13.2%
associate-*r*13.2%
neg-mul-113.2%
*-commutative13.2%
Simplified13.2%
distribute-lft-in13.2%
*-rgt-identity13.2%
distribute-rgt-in13.2%
add-sqr-sqrt13.2%
sqrt-unprod16.0%
sqr-neg16.0%
sqrt-unprod0.0%
add-sqr-sqrt40.2%
un-div-inv40.2%
add-sqr-sqrt40.2%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod0.0%
add-sqr-sqrt40.2%
Applied egg-rr40.2%
Taylor expanded in eps around 0 56.4%
associate-+r+56.4%
distribute-rgt1-in56.4%
metadata-eval56.4%
associate-*r*56.4%
neg-mul-156.4%
*-commutative56.4%
Simplified56.4%
if -3.2000000000000001e-12 < x < 3.9999999999999998e61 or 2.99999999999999997e81 < x < 2.0000000000000001e256Initial program 66.7%
Simplified56.6%
Taylor expanded in eps around inf 99.0%
Taylor expanded in x around 0 75.2%
sub-neg75.2%
metadata-eval75.2%
distribute-rgt-in75.2%
add-sqr-sqrt44.6%
sqrt-unprod70.9%
sqr-neg70.9%
sqrt-unprod29.1%
add-sqr-sqrt69.4%
neg-mul-169.4%
*-un-lft-identity69.4%
distribute-rgt-in69.4%
+-commutative69.4%
*-commutative69.4%
distribute-rgt-neg-out69.4%
neg-sub069.4%
add-sqr-sqrt40.3%
sqrt-unprod69.6%
sqr-neg69.6%
sqrt-unprod30.6%
add-sqr-sqrt75.1%
*-commutative75.1%
+-commutative75.1%
distribute-rgt-in75.1%
Applied egg-rr69.3%
neg-sub069.3%
distribute-rgt-neg-in69.3%
+-commutative69.3%
distribute-neg-in69.3%
metadata-eval69.3%
sub-neg69.3%
Simplified69.3%
Taylor expanded in eps around 0 72.4%
if 3.9999999999999998e61 < x < 2.99999999999999997e81 or 2.0000000000000001e256 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
Final simplification70.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x -450.0)
(/ (/ (expm1 (- x)) eps_m) 2.0)
(if (or (<= x 1.1e+70) (and (not (<= x 2e+80)) (<= x 4.2e+266)))
(/ (+ 1.0 (exp x)) 2.0)
0.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -450.0) {
tmp = (expm1(-x) / eps_m) / 2.0;
} else if ((x <= 1.1e+70) || (!(x <= 2e+80) && (x <= 4.2e+266))) {
tmp = (1.0 + exp(x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double tmp;
if (x <= -450.0) {
tmp = (Math.expm1(-x) / eps_m) / 2.0;
} else if ((x <= 1.1e+70) || (!(x <= 2e+80) && (x <= 4.2e+266))) {
tmp = (1.0 + Math.exp(x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= -450.0: tmp = (math.expm1(-x) / eps_m) / 2.0 elif (x <= 1.1e+70) or (not (x <= 2e+80) and (x <= 4.2e+266)): tmp = (1.0 + math.exp(x)) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -450.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps_m) / 2.0); elseif ((x <= 1.1e+70) || (!(x <= 2e+80) && (x <= 4.2e+266))) tmp = Float64(Float64(1.0 + exp(x)) / 2.0); else tmp = 0.0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -450.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision], If[Or[LessEqual[x, 1.1e+70], And[N[Not[LessEqual[x, 2e+80]], $MachinePrecision], LessEqual[x, 4.2e+266]]], N[(N[(1.0 + N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -450:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+70} \lor \neg \left(x \leq 2 \cdot 10^{+80}\right) \land x \leq 4.2 \cdot 10^{+266}:\\
\;\;\;\;\frac{1 + e^{x}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -450Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 34.5%
Taylor expanded in eps around 0 67.6%
expm1-define67.6%
neg-mul-167.6%
Simplified67.6%
if -450 < x < 1.1e70 or 2e80 < x < 4.19999999999999996e266Initial program 66.7%
Simplified56.6%
Taylor expanded in eps around inf 99.0%
Taylor expanded in x around 0 75.2%
sub-neg75.2%
metadata-eval75.2%
distribute-rgt-in75.2%
add-sqr-sqrt44.6%
sqrt-unprod70.9%
sqr-neg70.9%
sqrt-unprod29.1%
add-sqr-sqrt69.4%
neg-mul-169.4%
*-un-lft-identity69.4%
distribute-rgt-in69.4%
+-commutative69.4%
*-commutative69.4%
distribute-rgt-neg-out69.4%
neg-sub069.4%
add-sqr-sqrt40.3%
sqrt-unprod69.6%
sqr-neg69.6%
sqrt-unprod30.6%
add-sqr-sqrt75.1%
*-commutative75.1%
+-commutative75.1%
distribute-rgt-in75.1%
Applied egg-rr69.3%
neg-sub069.3%
distribute-rgt-neg-in69.3%
+-commutative69.3%
distribute-neg-in69.3%
metadata-eval69.3%
sub-neg69.3%
Simplified69.3%
Taylor expanded in eps around 0 72.4%
if 1.1e70 < x < 2e80 or 4.19999999999999996e266 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 78.1%
mul-1-neg78.1%
mul-1-neg78.1%
rec-exp78.1%
sub-neg78.1%
div-sub78.1%
mul-1-neg78.1%
rec-exp78.1%
+-inverses78.1%
Simplified78.1%
Final simplification72.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0)))
(if (<= x -0.00039)
(/ (+ 2.0 (/ (+ x (* eps_m (- (* x 0.0) (* x eps_m)))) eps_m)) 2.0)
(if (<= x 0.076)
1.0
(if (<= x 3.5e+65)
t_0
(if (<= x 2.3e+82)
0.0
(if (<= x 5.2e+128)
t_0
(if (<= x 8.5e+183)
0.0
(if (<= x 6.8e+265)
(/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)
0.0)))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (x <= -0.00039) {
tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
} else if (x <= 0.076) {
tmp = 1.0;
} else if (x <= 3.5e+65) {
tmp = t_0;
} else if (x <= 2.3e+82) {
tmp = 0.0;
} else if (x <= 5.2e+128) {
tmp = t_0;
} else if (x <= 8.5e+183) {
tmp = 0.0;
} else if (x <= 6.8e+265) {
tmp = (eps_m * (x + (2.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) :: t_0
real(8) :: tmp
t_0 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
if (x <= (-0.00039d0)) then
tmp = (2.0d0 + ((x + (eps_m * ((x * 0.0d0) - (x * eps_m)))) / eps_m)) / 2.0d0
else if (x <= 0.076d0) then
tmp = 1.0d0
else if (x <= 3.5d+65) then
tmp = t_0
else if (x <= 2.3d+82) then
tmp = 0.0d0
else if (x <= 5.2d+128) then
tmp = t_0
else if (x <= 8.5d+183) then
tmp = 0.0d0
else if (x <= 6.8d+265) then
tmp = (eps_m * (x + (2.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 t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (x <= -0.00039) {
tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0;
} else if (x <= 0.076) {
tmp = 1.0;
} else if (x <= 3.5e+65) {
tmp = t_0;
} else if (x <= 2.3e+82) {
tmp = 0.0;
} else if (x <= 5.2e+128) {
tmp = t_0;
} else if (x <= 8.5e+183) {
tmp = 0.0;
} else if (x <= 6.8e+265) {
tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 tmp = 0 if x <= -0.00039: tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0 elif x <= 0.076: tmp = 1.0 elif x <= 3.5e+65: tmp = t_0 elif x <= 2.3e+82: tmp = 0.0 elif x <= 5.2e+128: tmp = t_0 elif x <= 8.5e+183: tmp = 0.0 elif x <= 6.8e+265: tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) tmp = 0.0 if (x <= -0.00039) tmp = Float64(Float64(2.0 + Float64(Float64(x + Float64(eps_m * Float64(Float64(x * 0.0) - Float64(x * eps_m)))) / eps_m)) / 2.0); elseif (x <= 0.076) tmp = 1.0; elseif (x <= 3.5e+65) tmp = t_0; elseif (x <= 2.3e+82) tmp = 0.0; elseif (x <= 5.2e+128) tmp = t_0; elseif (x <= 8.5e+183) tmp = 0.0; elseif (x <= 6.8e+265) tmp = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; tmp = 0.0; if (x <= -0.00039) tmp = (2.0 + ((x + (eps_m * ((x * 0.0) - (x * eps_m)))) / eps_m)) / 2.0; elseif (x <= 0.076) tmp = 1.0; elseif (x <= 3.5e+65) tmp = t_0; elseif (x <= 2.3e+82) tmp = 0.0; elseif (x <= 5.2e+128) tmp = t_0; elseif (x <= 8.5e+183) tmp = 0.0; elseif (x <= 6.8e+265) tmp = (eps_m * (x + (2.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_] := Block[{t$95$0 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -0.00039], N[(N[(2.0 + N[(N[(x + N[(eps$95$m * N[(N[(x * 0.0), $MachinePrecision] - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 0.076], 1.0, If[LessEqual[x, 3.5e+65], t$95$0, If[LessEqual[x, 2.3e+82], 0.0, If[LessEqual[x, 5.2e+128], t$95$0, If[LessEqual[x, 8.5e+183], 0.0, If[LessEqual[x, 6.8e+265], N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
\mathbf{if}\;x \leq -0.00039:\\
\;\;\;\;\frac{2 + \frac{x + eps\_m \cdot \left(x \cdot 0 - x \cdot eps\_m\right)}{eps\_m}}{2}\\
\mathbf{elif}\;x \leq 0.076:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+65}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+82}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+128}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+183}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{+265}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -3.89999999999999993e-4Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 34.5%
Taylor expanded in x around 0 13.2%
associate-*r*13.2%
neg-mul-113.2%
*-commutative13.2%
Simplified13.2%
distribute-lft-in13.2%
*-rgt-identity13.2%
distribute-rgt-in13.2%
add-sqr-sqrt13.2%
sqrt-unprod16.0%
sqr-neg16.0%
sqrt-unprod0.0%
add-sqr-sqrt40.2%
un-div-inv40.2%
add-sqr-sqrt40.2%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-unprod0.0%
add-sqr-sqrt40.2%
Applied egg-rr40.2%
Taylor expanded in eps around 0 56.4%
associate-+r+56.4%
distribute-rgt1-in56.4%
metadata-eval56.4%
associate-*r*56.4%
neg-mul-156.4%
*-commutative56.4%
Simplified56.4%
if -3.89999999999999993e-4 < x < 0.0759999999999999981Initial program 53.8%
Simplified53.8%
Taylor expanded in x around 0 75.0%
if 0.0759999999999999981 < x < 3.5000000000000001e65 or 2.29999999999999988e82 < x < 5.2e128Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.4%
Taylor expanded in x around 0 14.8%
associate-*r*14.8%
neg-mul-114.8%
*-commutative14.8%
Simplified14.8%
Taylor expanded in eps around 0 30.4%
if 3.5000000000000001e65 < x < 2.29999999999999988e82 or 5.2e128 < x < 8.5000000000000004e183 or 6.79999999999999981e265 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 73.8%
mul-1-neg73.8%
mul-1-neg73.8%
rec-exp73.8%
sub-neg73.8%
div-sub73.8%
mul-1-neg73.8%
rec-exp73.8%
+-inverses73.8%
Simplified73.8%
if 8.5000000000000004e183 < x < 6.79999999999999981e265Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.8%
Taylor expanded in x around 0 29.7%
associate-*r*29.7%
neg-mul-129.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in eps around inf 30.0%
associate-*r/30.0%
metadata-eval30.0%
Simplified30.0%
Final simplification64.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (/ (- (* eps_m (+ (* x eps_m) 2.0)) x) eps_m) 2.0)))
(if (<= x 2.1e-15)
(/ (- 2.0 (* x eps_m)) 2.0)
(if (<= x 5.8e+70)
t_0
(if (<= x 7.2e+81)
0.0
(if (<= x 2.3e+129)
t_0
(if (<= x 4.5e+185)
0.0
(if (<= x 1.02e+258)
(/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0)
0.0))))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (x <= 2.1e-15) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 5.8e+70) {
tmp = t_0;
} else if (x <= 7.2e+81) {
tmp = 0.0;
} else if (x <= 2.3e+129) {
tmp = t_0;
} else if (x <= 4.5e+185) {
tmp = 0.0;
} else if (x <= 1.02e+258) {
tmp = (eps_m * (x + (2.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) :: t_0
real(8) :: tmp
t_0 = (((eps_m * ((x * eps_m) + 2.0d0)) - x) / eps_m) / 2.0d0
if (x <= 2.1d-15) then
tmp = (2.0d0 - (x * eps_m)) / 2.0d0
else if (x <= 5.8d+70) then
tmp = t_0
else if (x <= 7.2d+81) then
tmp = 0.0d0
else if (x <= 2.3d+129) then
tmp = t_0
else if (x <= 4.5d+185) then
tmp = 0.0d0
else if (x <= 1.02d+258) then
tmp = (eps_m * (x + (2.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 t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0;
double tmp;
if (x <= 2.1e-15) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 5.8e+70) {
tmp = t_0;
} else if (x <= 7.2e+81) {
tmp = 0.0;
} else if (x <= 2.3e+129) {
tmp = t_0;
} else if (x <= 4.5e+185) {
tmp = 0.0;
} else if (x <= 1.02e+258) {
tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0 tmp = 0 if x <= 2.1e-15: tmp = (2.0 - (x * eps_m)) / 2.0 elif x <= 5.8e+70: tmp = t_0 elif x <= 7.2e+81: tmp = 0.0 elif x <= 2.3e+129: tmp = t_0 elif x <= 4.5e+185: tmp = 0.0 elif x <= 1.02e+258: tmp = (eps_m * (x + (2.0 / eps_m))) / 2.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(Float64(eps_m * Float64(Float64(x * eps_m) + 2.0)) - x) / eps_m) / 2.0) tmp = 0.0 if (x <= 2.1e-15) tmp = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0); elseif (x <= 5.8e+70) tmp = t_0; elseif (x <= 7.2e+81) tmp = 0.0; elseif (x <= 2.3e+129) tmp = t_0; elseif (x <= 4.5e+185) tmp = 0.0; elseif (x <= 1.02e+258) tmp = Float64(Float64(eps_m * Float64(x + Float64(2.0 / eps_m))) / 2.0); else tmp = 0.0; end return tmp end
eps_m = abs(eps); function tmp_2 = code(x, eps_m) t_0 = (((eps_m * ((x * eps_m) + 2.0)) - x) / eps_m) / 2.0; tmp = 0.0; if (x <= 2.1e-15) tmp = (2.0 - (x * eps_m)) / 2.0; elseif (x <= 5.8e+70) tmp = t_0; elseif (x <= 7.2e+81) tmp = 0.0; elseif (x <= 2.3e+129) tmp = t_0; elseif (x <= 4.5e+185) tmp = 0.0; elseif (x <= 1.02e+258) tmp = (eps_m * (x + (2.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_] := Block[{t$95$0 = N[(N[(N[(N[(eps$95$m * N[(N[(x * eps$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, 2.1e-15], N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 5.8e+70], t$95$0, If[LessEqual[x, 7.2e+81], 0.0, If[LessEqual[x, 2.3e+129], t$95$0, If[LessEqual[x, 4.5e+185], 0.0, If[LessEqual[x, 1.02e+258], N[(N[(eps$95$m * N[(x + N[(2.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{eps\_m \cdot \left(x \cdot eps\_m + 2\right) - x}{eps\_m}}{2}\\
\mathbf{if}\;x \leq 2.1 \cdot 10^{-15}:\\
\;\;\;\;\frac{2 - x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{+70}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+81}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+185}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{+258}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 2.09999999999999981e-15Initial program 62.9%
Simplified62.9%
Taylor expanded in x around 0 42.3%
Taylor expanded in x around 0 43.0%
associate-*r*43.0%
neg-mul-143.0%
*-commutative43.0%
Simplified43.0%
add-sqr-sqrt22.2%
sqrt-unprod48.7%
sqr-neg48.7%
sqrt-unprod20.7%
add-sqr-sqrt48.1%
distribute-rgt-in48.1%
*-un-lft-identity48.1%
distribute-rgt-in48.1%
Applied egg-rr48.1%
associate-*l/48.1%
*-lft-identity48.1%
distribute-rgt-out48.1%
+-commutative48.1%
associate-+r-48.1%
div-sub48.1%
*-inverses48.1%
associate-+l-48.1%
metadata-eval48.1%
Simplified48.1%
Taylor expanded in eps around inf 69.0%
associate-*r*69.0%
neg-mul-169.0%
*-commutative69.0%
Simplified69.0%
if 2.09999999999999981e-15 < x < 5.7999999999999997e70 or 7.20000000000000011e81 < x < 2.2999999999999999e129Initial program 90.3%
Simplified90.3%
Taylor expanded in x around 0 45.0%
Taylor expanded in x around 0 12.3%
associate-*r*12.3%
neg-mul-112.3%
*-commutative12.3%
Simplified12.3%
Taylor expanded in eps around 0 24.7%
if 5.7999999999999997e70 < x < 7.20000000000000011e81 or 2.2999999999999999e129 < x < 4.5000000000000002e185 or 1.0200000000000001e258 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 73.8%
mul-1-neg73.8%
mul-1-neg73.8%
rec-exp73.8%
sub-neg73.8%
div-sub73.8%
mul-1-neg73.8%
rec-exp73.8%
+-inverses73.8%
Simplified73.8%
if 4.5000000000000002e185 < x < 1.0200000000000001e258Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.8%
Taylor expanded in x around 0 29.7%
associate-*r*29.7%
neg-mul-129.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in eps around inf 30.0%
associate-*r/30.0%
metadata-eval30.0%
Simplified30.0%
Final simplification61.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 17.0)
(/ (- 2.0 (* x eps_m)) 2.0)
(if (<= x 9e+182)
0.0
(if (<= x 2.2e+266) (/ (* eps_m (+ x (/ 2.0 eps_m))) 2.0) 0.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 17.0) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 9e+182) {
tmp = 0.0;
} else if (x <= 2.2e+266) {
tmp = (eps_m * (x + (2.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 <= 17.0d0) then
tmp = (2.0d0 - (x * eps_m)) / 2.0d0
else if (x <= 9d+182) then
tmp = 0.0d0
else if (x <= 2.2d+266) then
tmp = (eps_m * (x + (2.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 <= 17.0) {
tmp = (2.0 - (x * eps_m)) / 2.0;
} else if (x <= 9e+182) {
tmp = 0.0;
} else if (x <= 2.2e+266) {
tmp = (eps_m * (x + (2.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 <= 17.0: tmp = (2.0 - (x * eps_m)) / 2.0 elif x <= 9e+182: tmp = 0.0 elif x <= 2.2e+266: tmp = (eps_m * (x + (2.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 <= 17.0) tmp = Float64(Float64(2.0 - Float64(x * eps_m)) / 2.0); elseif (x <= 9e+182) tmp = 0.0; elseif (x <= 2.2e+266) tmp = Float64(Float64(eps_m * Float64(x + Float64(2.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 <= 17.0) tmp = (2.0 - (x * eps_m)) / 2.0; elseif (x <= 9e+182) tmp = 0.0; elseif (x <= 2.2e+266) tmp = (eps_m * (x + (2.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, 17.0], N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 9e+182], 0.0, If[LessEqual[x, 2.2e+266], N[(N[(eps$95$m * N[(x + N[(2.0 / 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 17:\\
\;\;\;\;\frac{2 - x \cdot eps\_m}{2}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+182}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+266}:\\
\;\;\;\;\frac{eps\_m \cdot \left(x + \frac{2}{eps\_m}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 17Initial program 62.5%
Simplified62.5%
Taylor expanded in x around 0 41.6%
Taylor expanded in x around 0 41.7%
associate-*r*41.7%
neg-mul-141.7%
*-commutative41.7%
Simplified41.7%
add-sqr-sqrt21.5%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod20.2%
add-sqr-sqrt46.6%
distribute-rgt-in46.6%
*-un-lft-identity46.6%
distribute-rgt-in46.6%
Applied egg-rr46.6%
associate-*l/46.6%
*-lft-identity46.6%
distribute-rgt-out46.6%
+-commutative46.6%
associate-+r-46.6%
div-sub46.6%
*-inverses46.6%
associate-+l-46.6%
metadata-eval46.6%
Simplified46.6%
Taylor expanded in eps around inf 67.9%
associate-*r*67.9%
neg-mul-167.9%
*-commutative67.9%
Simplified67.9%
if 17 < x < 9.00000000000000058e182 or 2.1999999999999999e266 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 47.1%
mul-1-neg47.1%
mul-1-neg47.1%
rec-exp47.1%
sub-neg47.1%
div-sub47.1%
mul-1-neg47.1%
rec-exp47.1%
+-inverses47.1%
Simplified47.1%
if 9.00000000000000058e182 < x < 2.1999999999999999e266Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.8%
Taylor expanded in x around 0 29.7%
associate-*r*29.7%
neg-mul-129.7%
*-commutative29.7%
Simplified29.7%
Taylor expanded in eps around inf 30.0%
associate-*r/30.0%
metadata-eval30.0%
Simplified30.0%
Final simplification60.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 17.0) (/ (- 2.0 (* x eps_m)) 2.0) 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 17.0) {
tmp = (2.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 <= 17.0d0) then
tmp = (2.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 <= 17.0) {
tmp = (2.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 <= 17.0: tmp = (2.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 <= 17.0) tmp = Float64(Float64(2.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 <= 17.0) tmp = (2.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, 17.0], N[(N[(2.0 - N[(x * eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 17:\\
\;\;\;\;\frac{2 - x \cdot eps\_m}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 17Initial program 62.5%
Simplified62.5%
Taylor expanded in x around 0 41.6%
Taylor expanded in x around 0 41.7%
associate-*r*41.7%
neg-mul-141.7%
*-commutative41.7%
Simplified41.7%
add-sqr-sqrt21.5%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod20.2%
add-sqr-sqrt46.6%
distribute-rgt-in46.6%
*-un-lft-identity46.6%
distribute-rgt-in46.6%
Applied egg-rr46.6%
associate-*l/46.6%
*-lft-identity46.6%
distribute-rgt-out46.6%
+-commutative46.6%
associate-+r-46.6%
div-sub46.6%
*-inverses46.6%
associate-+l-46.6%
metadata-eval46.6%
Simplified46.6%
Taylor expanded in eps around inf 67.9%
associate-*r*67.9%
neg-mul-167.9%
*-commutative67.9%
Simplified67.9%
if 17 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 42.3%
mul-1-neg42.3%
mul-1-neg42.3%
rec-exp42.3%
sub-neg42.3%
div-sub42.3%
mul-1-neg42.3%
rec-exp42.3%
+-inverses42.3%
Simplified42.3%
Final simplification60.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x 4.9e+33) 1.0 0.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 4.9e+33) {
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 <= 4.9d+33) 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 <= 4.9e+33) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
eps_m = math.fabs(eps) def code(x, eps_m): tmp = 0 if x <= 4.9e+33: tmp = 1.0 else: tmp = 0.0 return tmp
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 4.9e+33) 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 <= 4.9e+33) 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, 4.9e+33], 1.0, 0.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.9 \cdot 10^{+33}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 4.90000000000000014e33Initial program 63.3%
Simplified63.3%
Taylor expanded in x around 0 60.2%
if 4.90000000000000014e33 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 44.5%
mul-1-neg44.5%
mul-1-neg44.5%
rec-exp44.5%
sub-neg44.5%
div-sub44.5%
mul-1-neg44.5%
rec-exp44.5%
+-inverses44.5%
Simplified44.5%
Final simplification55.9%
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 73.5%
Simplified61.9%
Taylor expanded in eps around 0 14.0%
mul-1-neg14.0%
mul-1-neg14.0%
rec-exp13.9%
sub-neg13.9%
div-sub13.9%
mul-1-neg13.9%
rec-exp14.0%
+-inverses14.2%
Simplified14.2%
Final simplification14.2%
herbie shell --seed 2024096
(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))