
(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 20 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}
(FPCore (x eps)
:precision binary64
(let* ((t_0
(+
(* (+ 1.0 (/ 1.0 eps)) (exp (* x (+ eps -1.0))))
(* (exp (* x (- -1.0 eps))) (+ 1.0 (/ -1.0 eps)))))
(t_1 (exp (- x)))
(t_2 (+ t_1 (* x t_1))))
(if (<= t_0 2.0) (/ (+ t_2 t_2) 2.0) (/ t_0 2.0))))
double code(double x, double eps) {
double t_0 = ((1.0 + (1.0 / eps)) * exp((x * (eps + -1.0)))) + (exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps)));
double t_1 = exp(-x);
double t_2 = t_1 + (x * t_1);
double tmp;
if (t_0 <= 2.0) {
tmp = (t_2 + t_2) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((1.0d0 + (1.0d0 / eps)) * exp((x * (eps + (-1.0d0))))) + (exp((x * ((-1.0d0) - eps))) * (1.0d0 + ((-1.0d0) / eps)))
t_1 = exp(-x)
t_2 = t_1 + (x * t_1)
if (t_0 <= 2.0d0) then
tmp = (t_2 + t_2) / 2.0d0
else
tmp = t_0 / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((1.0 + (1.0 / eps)) * Math.exp((x * (eps + -1.0)))) + (Math.exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps)));
double t_1 = Math.exp(-x);
double t_2 = t_1 + (x * t_1);
double tmp;
if (t_0 <= 2.0) {
tmp = (t_2 + t_2) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
def code(x, eps): t_0 = ((1.0 + (1.0 / eps)) * math.exp((x * (eps + -1.0)))) + (math.exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps))) t_1 = math.exp(-x) t_2 = t_1 + (x * t_1) tmp = 0 if t_0 <= 2.0: tmp = (t_2 + t_2) / 2.0 else: tmp = t_0 / 2.0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(x * Float64(eps + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps))) * Float64(1.0 + Float64(-1.0 / eps)))) t_1 = exp(Float64(-x)) t_2 = Float64(t_1 + Float64(x * t_1)) tmp = 0.0 if (t_0 <= 2.0) tmp = Float64(Float64(t_2 + t_2) / 2.0); else tmp = Float64(t_0 / 2.0); end return tmp end
function tmp_2 = code(x, eps) t_0 = ((1.0 + (1.0 / eps)) * exp((x * (eps + -1.0)))) + (exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps))); t_1 = exp(-x); t_2 = t_1 + (x * t_1); tmp = 0.0; if (t_0 <= 2.0) tmp = (t_2 + t_2) / 2.0; else tmp = t_0 / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2.0], N[(N[(t$95$2 + t$95$2), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + \frac{1}{\varepsilon}\right) \cdot e^{x \cdot \left(\varepsilon + -1\right)} + e^{x \cdot \left(-1 - \varepsilon\right)} \cdot \left(1 + \frac{-1}{\varepsilon}\right)\\
t_1 := e^{-x}\\
t_2 := t\_1 + x \cdot t\_1\\
\mathbf{if}\;t\_0 \leq 2:\\
\;\;\;\;\frac{t\_2 + t\_2}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) < 2Initial program 49.3%
Simplified49.3%
Taylor expanded in eps around 0 100.0%
if 2 < (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
associate-*r*100.0%
neg-mul-1100.0%
distribute-rgt-in100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(+
(* (+ 1.0 (/ 1.0 eps)) (exp (* x (+ eps -1.0))))
(* (exp (* x (- -1.0 eps))) (+ 1.0 (/ -1.0 eps))))))
(if (<= t_0 2.0)
(/ (/ (* eps (* 2.0 (* (exp (- x)) (+ 1.0 x)))) eps) 2.0)
(/ t_0 2.0))))
double code(double x, double eps) {
double t_0 = ((1.0 + (1.0 / eps)) * exp((x * (eps + -1.0)))) + (exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps)));
double tmp;
if (t_0 <= 2.0) {
tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((1.0d0 + (1.0d0 / eps)) * exp((x * (eps + (-1.0d0))))) + (exp((x * ((-1.0d0) - eps))) * (1.0d0 + ((-1.0d0) / eps)))
if (t_0 <= 2.0d0) then
tmp = ((eps * (2.0d0 * (exp(-x) * (1.0d0 + x)))) / eps) / 2.0d0
else
tmp = t_0 / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((1.0 + (1.0 / eps)) * Math.exp((x * (eps + -1.0)))) + (Math.exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps)));
double tmp;
if (t_0 <= 2.0) {
tmp = ((eps * (2.0 * (Math.exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = t_0 / 2.0;
}
return tmp;
}
def code(x, eps): t_0 = ((1.0 + (1.0 / eps)) * math.exp((x * (eps + -1.0)))) + (math.exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps))) tmp = 0 if t_0 <= 2.0: tmp = ((eps * (2.0 * (math.exp(-x) * (1.0 + x)))) / eps) / 2.0 else: tmp = t_0 / 2.0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(x * Float64(eps + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps))) * Float64(1.0 + Float64(-1.0 / eps)))) tmp = 0.0 if (t_0 <= 2.0) tmp = Float64(Float64(Float64(eps * Float64(2.0 * Float64(exp(Float64(-x)) * Float64(1.0 + x)))) / eps) / 2.0); else tmp = Float64(t_0 / 2.0); end return tmp end
function tmp_2 = code(x, eps) t_0 = ((1.0 + (1.0 / eps)) * exp((x * (eps + -1.0)))) + (exp((x * (-1.0 - eps))) * (1.0 + (-1.0 / eps))); tmp = 0.0; if (t_0 <= 2.0) tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0; else tmp = t_0 / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2.0], N[(N[(N[(eps * N[(2.0 * N[(N[Exp[(-x)], $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(t$95$0 / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + \frac{1}{\varepsilon}\right) \cdot e^{x \cdot \left(\varepsilon + -1\right)} + e^{x \cdot \left(-1 - \varepsilon\right)} \cdot \left(1 + \frac{-1}{\varepsilon}\right)\\
\mathbf{if}\;t\_0 \leq 2:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 \cdot \left(e^{-x} \cdot \left(1 + x\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{2}\\
\end{array}
\end{array}
if (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) < 2Initial program 49.3%
Simplified29.4%
Taylor expanded in eps around 0 48.4%
associate-+r+100.0%
mul-1-neg100.0%
sub-neg100.0%
+-inverses100.0%
distribute-lft-out100.0%
distribute-rgt1-in100.0%
mul-1-neg100.0%
Simplified100.0%
if 2 < (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 100.0%
associate-*r*100.0%
neg-mul-1100.0%
distribute-rgt-in100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x eps) :precision binary64 (if (<= eps 15.0) (/ (/ (* eps (* 2.0 (* (exp (- x)) (+ 1.0 x)))) eps) 2.0) (/ (+ (exp (* eps x)) (/ 1.0 (exp (+ x (* eps x))))) 2.0)))
double code(double x, double eps) {
double tmp;
if (eps <= 15.0) {
tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = (exp((eps * x)) + (1.0 / exp((x + (eps * x))))) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (eps <= 15.0d0) then
tmp = ((eps * (2.0d0 * (exp(-x) * (1.0d0 + x)))) / eps) / 2.0d0
else
tmp = (exp((eps * x)) + (1.0d0 / exp((x + (eps * x))))) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (eps <= 15.0) {
tmp = ((eps * (2.0 * (Math.exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = (Math.exp((eps * x)) + (1.0 / Math.exp((x + (eps * x))))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if eps <= 15.0: tmp = ((eps * (2.0 * (math.exp(-x) * (1.0 + x)))) / eps) / 2.0 else: tmp = (math.exp((eps * x)) + (1.0 / math.exp((x + (eps * x))))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (eps <= 15.0) tmp = Float64(Float64(Float64(eps * Float64(2.0 * Float64(exp(Float64(-x)) * Float64(1.0 + x)))) / eps) / 2.0); else tmp = Float64(Float64(exp(Float64(eps * x)) + Float64(1.0 / exp(Float64(x + Float64(eps * x))))) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (eps <= 15.0) tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0; else tmp = (exp((eps * x)) + (1.0 / exp((x + (eps * x))))) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[eps, 15.0], N[(N[(N[(eps * N[(2.0 * N[(N[Exp[(-x)], $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[Exp[N[(x + N[(eps * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq 15:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 \cdot \left(e^{-x} \cdot \left(1 + x\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x} + \frac{1}{e^{x + \varepsilon \cdot x}}}{2}\\
\end{array}
\end{array}
if eps < 15Initial program 61.0%
Simplified51.1%
Taylor expanded in eps around 0 31.1%
associate-+r+70.8%
mul-1-neg70.8%
sub-neg70.8%
+-inverses70.8%
distribute-lft-out70.8%
distribute-rgt1-in70.8%
mul-1-neg70.8%
Simplified70.8%
if 15 < eps Initial program 100.0%
Simplified83.3%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification78.7%
(FPCore (x eps) :precision binary64 (if (<= eps 15.0) (/ (/ (* eps (* 2.0 (* (exp (- x)) (+ 1.0 x)))) eps) 2.0) (/ (+ (exp (* x (- -1.0 eps))) (exp (* eps x))) 2.0)))
double code(double x, double eps) {
double tmp;
if (eps <= 15.0) {
tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = (exp((x * (-1.0 - eps))) + exp((eps * x))) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (eps <= 15.0d0) then
tmp = ((eps * (2.0d0 * (exp(-x) * (1.0d0 + x)))) / eps) / 2.0d0
else
tmp = (exp((x * ((-1.0d0) - eps))) + exp((eps * x))) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (eps <= 15.0) {
tmp = ((eps * (2.0 * (Math.exp(-x) * (1.0 + x)))) / eps) / 2.0;
} else {
tmp = (Math.exp((x * (-1.0 - eps))) + Math.exp((eps * x))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if eps <= 15.0: tmp = ((eps * (2.0 * (math.exp(-x) * (1.0 + x)))) / eps) / 2.0 else: tmp = (math.exp((x * (-1.0 - eps))) + math.exp((eps * x))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (eps <= 15.0) tmp = Float64(Float64(Float64(eps * Float64(2.0 * Float64(exp(Float64(-x)) * Float64(1.0 + x)))) / eps) / 2.0); else tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 - eps))) + exp(Float64(eps * x))) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (eps <= 15.0) tmp = ((eps * (2.0 * (exp(-x) * (1.0 + x)))) / eps) / 2.0; else tmp = (exp((x * (-1.0 - eps))) + exp((eps * x))) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[eps, 15.0], N[(N[(N[(eps * N[(2.0 * N[(N[Exp[(-x)], $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\varepsilon \leq 15:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 \cdot \left(e^{-x} \cdot \left(1 + x\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 - \varepsilon\right)} + e^{\varepsilon \cdot x}}{2}\\
\end{array}
\end{array}
if eps < 15Initial program 61.0%
Simplified51.1%
Taylor expanded in eps around 0 31.1%
associate-+r+70.8%
mul-1-neg70.8%
sub-neg70.8%
+-inverses70.8%
distribute-lft-out70.8%
distribute-rgt1-in70.8%
mul-1-neg70.8%
Simplified70.8%
if 15 < eps Initial program 100.0%
Simplified83.3%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.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%
*-commutative100.0%
fma-undefine100.0%
*-rgt-identity100.0%
exp-neg100.0%
*-rgt-identity100.0%
neg-mul-1100.0%
fma-undefine100.0%
*-commutative100.0%
+-commutative100.0%
distribute-lft-in100.0%
associate-*r*100.0%
neg-mul-1100.0%
distribute-rgt-in100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification78.7%
(FPCore (x eps)
:precision binary64
(if (<= x -2.6e+77)
(/
(/
(*
x
(+
-1.0
(* x (+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)
(if (<= x -1.05e-244)
(/ (+ (exp (* x (- -1.0 eps))) (+ 1.0 (* eps x))) 2.0)
(/ (+ (exp (* eps x)) (/ 1.0 (+ 1.0 (* x (+ 1.0 eps))))) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -2.6e+77) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= -1.05e-244) {
tmp = (exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0;
} else {
tmp = (exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.6d+77)) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps) / 2.0d0
else if (x <= (-1.05d-244)) then
tmp = (exp((x * ((-1.0d0) - eps))) + (1.0d0 + (eps * x))) / 2.0d0
else
tmp = (exp((eps * x)) + (1.0d0 / (1.0d0 + (x * (1.0d0 + eps))))) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.6e+77) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= -1.05e-244) {
tmp = (Math.exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0;
} else {
tmp = (Math.exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.6e+77: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 elif x <= -1.05e-244: tmp = (math.exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0 else: tmp = (math.exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.6e+77) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0); elseif (x <= -1.05e-244) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 - eps))) + Float64(1.0 + Float64(eps * x))) / 2.0); else tmp = Float64(Float64(exp(Float64(eps * x)) + Float64(1.0 / Float64(1.0 + Float64(x * Float64(1.0 + eps))))) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.6e+77) tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0; elseif (x <= -1.05e-244) tmp = (exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0; else tmp = (exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.6e+77], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -1.05e-244], N[(N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(1.0 + N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-244}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 - \varepsilon\right)} + \left(1 + \varepsilon \cdot x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x} + \frac{1}{1 + x \cdot \left(1 + \varepsilon\right)}}{2}\\
\end{array}
\end{array}
if x < -2.6000000000000002e77Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 50.0%
if -2.6000000000000002e77 < x < -1.05000000000000001e-244Initial program 55.6%
Simplified47.6%
Taylor expanded in eps around inf 94.8%
Taylor expanded in eps around inf 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in x around -inf 94.9%
cancel-sign-sub-inv94.9%
exp-sum86.9%
metadata-eval86.9%
*-lft-identity86.9%
exp-sum94.9%
*-commutative94.9%
fma-undefine94.9%
*-rgt-identity94.9%
exp-neg94.9%
*-rgt-identity94.9%
neg-mul-194.9%
fma-undefine94.9%
*-commutative94.9%
+-commutative94.9%
distribute-lft-in94.9%
associate-*r*94.9%
neg-mul-194.9%
distribute-rgt-in94.9%
unsub-neg94.9%
Simplified94.9%
Taylor expanded in x around 0 76.4%
if -1.05000000000000001e-244 < x Initial program 74.7%
Simplified67.5%
Taylor expanded in eps around inf 99.3%
Taylor expanded in eps around inf 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in x around 0 64.0%
Final simplification66.3%
(FPCore (x eps)
:precision binary64
(if (<= x -2.6e+77)
(/
(/
(*
x
(+
-1.0
(* x (+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)
(if (<= x 1e-287)
(/ (+ (exp (* x (- -1.0 eps))) (+ 1.0 (* eps x))) 2.0)
(/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -2.6e+77) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 1e-287) {
tmp = (exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0;
} else {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.6d+77)) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps) / 2.0d0
else if (x <= 1d-287) then
tmp = (exp((x * ((-1.0d0) - eps))) + (1.0d0 + (eps * x))) / 2.0d0
else
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.6e+77) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 1e-287) {
tmp = (Math.exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0;
} else {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.6e+77: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 elif x <= 1e-287: tmp = (math.exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0 else: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.6e+77) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0); elseif (x <= 1e-287) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 - eps))) + Float64(1.0 + Float64(eps * x))) / 2.0); else tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.6e+77) tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0; elseif (x <= 1e-287) tmp = (exp((x * (-1.0 - eps))) + (1.0 + (eps * x))) / 2.0; else tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.6e+77], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1e-287], N[(N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(eps * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 10^{-287}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 - \varepsilon\right)} + \left(1 + \varepsilon \cdot x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\end{array}
\end{array}
if x < -2.6000000000000002e77Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 50.0%
if -2.6000000000000002e77 < x < 1.00000000000000002e-287Initial program 55.7%
Simplified49.1%
Taylor expanded in eps around inf 96.0%
Taylor expanded in eps around inf 96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in x around -inf 96.1%
cancel-sign-sub-inv96.1%
exp-sum89.9%
metadata-eval89.9%
*-lft-identity89.9%
exp-sum96.1%
*-commutative96.1%
fma-undefine96.1%
*-rgt-identity96.1%
exp-neg96.1%
*-rgt-identity96.1%
neg-mul-196.1%
fma-undefine96.1%
*-commutative96.1%
+-commutative96.1%
distribute-lft-in96.1%
associate-*r*96.1%
neg-mul-196.1%
distribute-rgt-in96.1%
unsub-neg96.1%
Simplified96.1%
Taylor expanded in x around 0 81.7%
if 1.00000000000000002e-287 < x Initial program 77.8%
Simplified69.7%
Taylor expanded in eps around inf 99.1%
Taylor expanded in x around 0 58.1%
Final simplification66.3%
(FPCore (x eps) :precision binary64 (if (<= x -1.1e-242) (/ (* eps (+ x (/ (+ 1.0 (exp (* x (- -1.0 eps)))) eps))) 2.0) (/ (+ (exp (* eps x)) (/ 1.0 (+ 1.0 (* x (+ 1.0 eps))))) 2.0)))
double code(double x, double eps) {
double tmp;
if (x <= -1.1e-242) {
tmp = (eps * (x + ((1.0 + exp((x * (-1.0 - eps)))) / eps))) / 2.0;
} else {
tmp = (exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-1.1d-242)) then
tmp = (eps * (x + ((1.0d0 + exp((x * ((-1.0d0) - eps)))) / eps))) / 2.0d0
else
tmp = (exp((eps * x)) + (1.0d0 / (1.0d0 + (x * (1.0d0 + eps))))) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -1.1e-242) {
tmp = (eps * (x + ((1.0 + Math.exp((x * (-1.0 - eps)))) / eps))) / 2.0;
} else {
tmp = (Math.exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -1.1e-242: tmp = (eps * (x + ((1.0 + math.exp((x * (-1.0 - eps)))) / eps))) / 2.0 else: tmp = (math.exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -1.1e-242) tmp = Float64(Float64(eps * Float64(x + Float64(Float64(1.0 + exp(Float64(x * Float64(-1.0 - eps)))) / eps))) / 2.0); else tmp = Float64(Float64(exp(Float64(eps * x)) + Float64(1.0 / Float64(1.0 + Float64(x * Float64(1.0 + eps))))) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -1.1e-242) tmp = (eps * (x + ((1.0 + exp((x * (-1.0 - eps)))) / eps))) / 2.0; else tmp = (exp((eps * x)) + (1.0 / (1.0 + (x * (1.0 + eps))))) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -1.1e-242], N[(N[(eps * N[(x + N[(N[(1.0 + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(1.0 + N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-242}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(x + \frac{1 + e^{x \cdot \left(-1 - \varepsilon\right)}}{\varepsilon}\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x} + \frac{1}{1 + x \cdot \left(1 + \varepsilon\right)}}{2}\\
\end{array}
\end{array}
if x < -1.10000000000000001e-242Initial program 66.4%
Simplified66.4%
Taylor expanded in x around 0 39.4%
+-commutative39.4%
mul-1-neg39.4%
unsub-neg39.4%
*-commutative39.4%
Simplified39.4%
Taylor expanded in eps around inf 78.3%
Simplified78.3%
if -1.10000000000000001e-242 < x Initial program 74.7%
Simplified67.5%
Taylor expanded in eps around inf 99.3%
Taylor expanded in eps around inf 86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in x around 0 64.0%
Final simplification69.5%
(FPCore (x eps) :precision binary64 (if (<= x -10000.0) (/ (/ (expm1 (- x)) eps) 2.0) (if (<= x 2900000.0) (* (exp (- x)) (+ 1.0 x)) (/ (/ (expm1 x) eps) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -10000.0) {
tmp = (expm1(-x) / eps) / 2.0;
} else if (x <= 2900000.0) {
tmp = exp(-x) * (1.0 + x);
} else {
tmp = (expm1(x) / eps) / 2.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -10000.0) {
tmp = (Math.expm1(-x) / eps) / 2.0;
} else if (x <= 2900000.0) {
tmp = Math.exp(-x) * (1.0 + x);
} else {
tmp = (Math.expm1(x) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -10000.0: tmp = (math.expm1(-x) / eps) / 2.0 elif x <= 2900000.0: tmp = math.exp(-x) * (1.0 + x) else: tmp = (math.expm1(x) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -10000.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps) / 2.0); elseif (x <= 2900000.0) tmp = Float64(exp(Float64(-x)) * Float64(1.0 + x)); else tmp = Float64(Float64(expm1(x) / eps) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -10000.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2900000.0], N[(N[Exp[(-x)], $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Exp[x] - 1), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10000:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 2900000:\\
\;\;\;\;e^{-x} \cdot \left(1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(x\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < -1e4Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in eps around 0 48.6%
expm1-define48.6%
neg-mul-148.6%
Simplified48.6%
if -1e4 < x < 2.9e6Initial program 52.6%
Simplified31.5%
Taylor expanded in eps around 0 31.9%
associate-+r+80.1%
mul-1-neg80.1%
sub-neg80.1%
+-inverses80.1%
distribute-lft-out80.1%
distribute-rgt1-in80.1%
mul-1-neg80.1%
Simplified80.1%
Taylor expanded in eps around 0 80.1%
if 2.9e6 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 28.9%
Taylor expanded in eps around 0 1.9%
expm1-define1.9%
neg-mul-11.9%
Simplified1.9%
expm1-undefine1.9%
div-sub1.9%
add-sqr-sqrt0.0%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod27.4%
add-sqr-sqrt27.4%
Applied egg-rr27.4%
div-sub27.4%
expm1-define27.4%
Simplified27.4%
(FPCore (x eps)
:precision binary64
(if (<= x -16000.0)
(/
(/
(*
x
(+
-1.0
(* x (+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)
(if (<= x 1000000.0) (* (exp (- x)) (+ 1.0 x)) (/ (/ (expm1 x) eps) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -16000.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 1000000.0) {
tmp = exp(-x) * (1.0 + x);
} else {
tmp = (expm1(x) / eps) / 2.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -16000.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 1000000.0) {
tmp = Math.exp(-x) * (1.0 + x);
} else {
tmp = (Math.expm1(x) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -16000.0: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 elif x <= 1000000.0: tmp = math.exp(-x) * (1.0 + x) else: tmp = (math.expm1(x) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -16000.0) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0); elseif (x <= 1000000.0) tmp = Float64(exp(Float64(-x)) * Float64(1.0 + x)); else tmp = Float64(Float64(expm1(x) / eps) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -16000.0], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1000000.0], N[(N[Exp[(-x)], $MachinePrecision] * N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(Exp[x] - 1), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -16000:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 1000000:\\
\;\;\;\;e^{-x} \cdot \left(1 + x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(x\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < -16000Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in eps around 0 48.6%
expm1-define48.6%
neg-mul-148.6%
Simplified48.6%
Taylor expanded in x around 0 34.9%
if -16000 < x < 1e6Initial program 52.6%
Simplified31.5%
Taylor expanded in eps around 0 31.9%
associate-+r+80.1%
mul-1-neg80.1%
sub-neg80.1%
+-inverses80.1%
distribute-lft-out80.1%
distribute-rgt1-in80.1%
mul-1-neg80.1%
Simplified80.1%
Taylor expanded in eps around 0 80.1%
if 1e6 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 28.9%
Taylor expanded in eps around 0 1.9%
expm1-define1.9%
neg-mul-11.9%
Simplified1.9%
expm1-undefine1.9%
div-sub1.9%
add-sqr-sqrt0.0%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod27.4%
add-sqr-sqrt27.4%
Applied egg-rr27.4%
div-sub27.4%
expm1-define27.4%
Simplified27.4%
Final simplification60.1%
(FPCore (x eps)
:precision binary64
(if (<= x -15000.0)
(/
(/
(*
x
(+
-1.0
(* x (+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)
(if (<= x 600000.0)
(/
(/
(*
eps
(*
2.0
(*
(+ 1.0 x)
(+ 1.0 (* x (+ -1.0 (* x (+ 0.5 (* x -0.16666666666666666)))))))))
eps)
2.0)
(/ (/ (expm1 x) eps) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -15000.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 600000.0) {
tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))))))) / eps) / 2.0;
} else {
tmp = (expm1(x) / eps) / 2.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -15000.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else if (x <= 600000.0) {
tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))))))) / eps) / 2.0;
} else {
tmp = (Math.expm1(x) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -15000.0: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 elif x <= 600000.0: tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))))))) / eps) / 2.0 else: tmp = (math.expm1(x) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -15000.0) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0); elseif (x <= 600000.0) tmp = Float64(Float64(Float64(eps * Float64(2.0 * Float64(Float64(1.0 + x) * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * -0.16666666666666666))))))))) / eps) / 2.0); else tmp = Float64(Float64(expm1(x) / eps) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -15000.0], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 600000.0], N[(N[(N[(eps * N[(2.0 * N[(N[(1.0 + x), $MachinePrecision] * N[(1.0 + N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(Exp[x] - 1), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -15000:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 600000:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 \cdot \left(\left(1 + x\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(x\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < -15000Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in eps around 0 48.6%
expm1-define48.6%
neg-mul-148.6%
Simplified48.6%
Taylor expanded in x around 0 34.9%
if -15000 < x < 6e5Initial program 52.6%
Simplified31.5%
Taylor expanded in eps around 0 31.9%
associate-+r+80.1%
mul-1-neg80.1%
sub-neg80.1%
+-inverses80.1%
distribute-lft-out80.1%
distribute-rgt1-in80.1%
mul-1-neg80.1%
Simplified80.1%
Taylor expanded in x around 0 77.8%
if 6e5 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 28.9%
Taylor expanded in eps around 0 1.9%
expm1-define1.9%
neg-mul-11.9%
Simplified1.9%
expm1-undefine1.9%
div-sub1.9%
add-sqr-sqrt0.0%
sqrt-unprod27.4%
sqr-neg27.4%
sqrt-unprod27.4%
add-sqr-sqrt27.4%
Applied egg-rr27.4%
div-sub27.4%
expm1-define27.4%
Simplified27.4%
Final simplification58.8%
(FPCore (x eps) :precision binary64 (if (<= x -550.0) (/ (/ (expm1 (- x)) eps) 2.0) (/ (+ 1.0 (exp (* eps x))) 2.0)))
double code(double x, double eps) {
double tmp;
if (x <= -550.0) {
tmp = (expm1(-x) / eps) / 2.0;
} else {
tmp = (1.0 + exp((eps * x))) / 2.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -550.0) {
tmp = (Math.expm1(-x) / eps) / 2.0;
} else {
tmp = (1.0 + Math.exp((eps * x))) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -550.0: tmp = (math.expm1(-x) / eps) / 2.0 else: tmp = (1.0 + math.exp((eps * x))) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -550.0) tmp = Float64(Float64(expm1(Float64(-x)) / eps) / 2.0); else tmp = Float64(Float64(1.0 + exp(Float64(eps * x))) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -550.0], N[(N[(N[(Exp[(-x)] - 1), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + N[Exp[N[(eps * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -550:\\
\;\;\;\;\frac{\frac{\mathsf{expm1}\left(-x\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + e^{\varepsilon \cdot x}}{2}\\
\end{array}
\end{array}
if x < -550Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in eps around 0 48.6%
expm1-define48.6%
neg-mul-148.6%
Simplified48.6%
if -550 < x Initial program 67.0%
Simplified59.1%
Taylor expanded in eps around inf 97.7%
Taylor expanded in eps around inf 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in x around 0 69.5%
Final simplification66.6%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)))
(if (<= x -3e+37)
t_0
(if (<= x 520.0)
(/
(+
2.0
(* x (- (- (/ 1.0 eps) (* (+ 1.0 (/ 1.0 eps)) (- 1.0 eps))) eps)))
2.0)
(if (<= x 2e+79) 0.0 t_0)))))
double code(double x, double eps) {
double t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
double tmp;
if (x <= -3e+37) {
tmp = t_0;
} else if (x <= 520.0) {
tmp = (2.0 + (x * (((1.0 / eps) - ((1.0 + (1.0 / eps)) * (1.0 - eps))) - eps))) / 2.0;
} else if (x <= 2e+79) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps) / 2.0d0
if (x <= (-3d+37)) then
tmp = t_0
else if (x <= 520.0d0) then
tmp = (2.0d0 + (x * (((1.0d0 / eps) - ((1.0d0 + (1.0d0 / eps)) * (1.0d0 - eps))) - eps))) / 2.0d0
else if (x <= 2d+79) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
double tmp;
if (x <= -3e+37) {
tmp = t_0;
} else if (x <= 520.0) {
tmp = (2.0 + (x * (((1.0 / eps) - ((1.0 + (1.0 / eps)) * (1.0 - eps))) - eps))) / 2.0;
} else if (x <= 2e+79) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 tmp = 0 if x <= -3e+37: tmp = t_0 elif x <= 520.0: tmp = (2.0 + (x * (((1.0 / eps) - ((1.0 + (1.0 / eps)) * (1.0 - eps))) - eps))) / 2.0 elif x <= 2e+79: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0) tmp = 0.0 if (x <= -3e+37) tmp = t_0; elseif (x <= 520.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(1.0 / eps) - Float64(Float64(1.0 + Float64(1.0 / eps)) * Float64(1.0 - eps))) - eps))) / 2.0); elseif (x <= 2e+79) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0; tmp = 0.0; if (x <= -3e+37) tmp = t_0; elseif (x <= 520.0) tmp = (2.0 + (x * (((1.0 / eps) - ((1.0 + (1.0 / eps)) * (1.0 - eps))) - eps))) / 2.0; elseif (x <= 2e+79) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -3e+37], t$95$0, If[LessEqual[x, 520.0], N[(N[(2.0 + N[(x * N[(N[(N[(1.0 / eps), $MachinePrecision] - N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[(1.0 - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2e+79], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{if}\;x \leq -3 \cdot 10^{+37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 520:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(\frac{1}{\varepsilon} - \left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 - \varepsilon\right)\right) - \varepsilon\right)}{2}\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+79}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.00000000000000022e37 or 1.99999999999999993e79 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.7%
Taylor expanded in eps around 0 18.9%
expm1-define18.9%
neg-mul-118.9%
Simplified18.9%
Taylor expanded in x around 0 33.5%
if -3.00000000000000022e37 < x < 520Initial program 53.5%
Simplified42.5%
Taylor expanded in x around 0 75.5%
if 520 < x < 1.99999999999999993e79Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 40.9%
div-sub40.9%
mul-1-neg40.9%
rec-exp40.9%
+-inverses40.9%
metadata-eval40.9%
Simplified40.9%
Final simplification59.8%
(FPCore (x eps)
:precision binary64
(let* ((t_0
(/
(/
(*
x
(+
-1.0
(*
x
(+
0.5
(* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)))
(if (<= x -3.5e+37) t_0 (if (<= x 520.0) 1.0 (if (<= x 5e+82) 0.0 t_0)))))
double code(double x, double eps) {
double t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
double tmp;
if (x <= -3.5e+37) {
tmp = t_0;
} else if (x <= 520.0) {
tmp = 1.0;
} else if (x <= 5e+82) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps) / 2.0d0
if (x <= (-3.5d+37)) then
tmp = t_0
else if (x <= 520.0d0) then
tmp = 1.0d0
else if (x <= 5d+82) then
tmp = 0.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
double tmp;
if (x <= -3.5e+37) {
tmp = t_0;
} else if (x <= 520.0) {
tmp = 1.0;
} else if (x <= 5e+82) {
tmp = 0.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, eps): t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 tmp = 0 if x <= -3.5e+37: tmp = t_0 elif x <= 520.0: tmp = 1.0 elif x <= 5e+82: tmp = 0.0 else: tmp = t_0 return tmp
function code(x, eps) t_0 = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0) tmp = 0.0 if (x <= -3.5e+37) tmp = t_0; elseif (x <= 520.0) tmp = 1.0; elseif (x <= 5e+82) tmp = 0.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, eps) t_0 = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0; tmp = 0.0; if (x <= -3.5e+37) tmp = t_0; elseif (x <= 520.0) tmp = 1.0; elseif (x <= 5e+82) tmp = 0.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -3.5e+37], t$95$0, If[LessEqual[x, 520.0], 1.0, If[LessEqual[x, 5e+82], 0.0, t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 520:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+82}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.5e37 or 5.00000000000000015e82 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 39.7%
Taylor expanded in eps around 0 18.9%
expm1-define18.9%
neg-mul-118.9%
Simplified18.9%
Taylor expanded in x around 0 33.5%
if -3.5e37 < x < 520Initial program 53.5%
Simplified42.5%
Taylor expanded in eps around inf 96.8%
Taylor expanded in eps around inf 96.9%
*-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 75.5%
if 520 < x < 5.00000000000000015e82Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 40.9%
div-sub40.9%
mul-1-neg40.9%
rec-exp40.9%
+-inverses40.9%
metadata-eval40.9%
Simplified40.9%
Final simplification59.8%
(FPCore (x eps)
:precision binary64
(if (<= x -8.4e+113)
(/ (/ (* x (+ -1.0 (* x (+ 0.5 (* x -0.16666666666666666))))) eps) 2.0)
(if (<= x 120.0)
(/ (- 2.0 (* eps x)) 2.0)
(if (<= x 2.2e+152) 0.0 (/ (/ (* x (+ -1.0 (* x 0.5))) eps) 2.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -8.4e+113) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps) / 2.0;
} else if (x <= 120.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 2.2e+152) {
tmp = 0.0;
} else {
tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-8.4d+113)) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * (-0.16666666666666666d0)))))) / eps) / 2.0d0
else if (x <= 120.0d0) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else if (x <= 2.2d+152) then
tmp = 0.0d0
else
tmp = ((x * ((-1.0d0) + (x * 0.5d0))) / eps) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -8.4e+113) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps) / 2.0;
} else if (x <= 120.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 2.2e+152) {
tmp = 0.0;
} else {
tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -8.4e+113: tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps) / 2.0 elif x <= 120.0: tmp = (2.0 - (eps * x)) / 2.0 elif x <= 2.2e+152: tmp = 0.0 else: tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -8.4e+113) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * -0.16666666666666666))))) / eps) / 2.0); elseif (x <= 120.0) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); elseif (x <= 2.2e+152) tmp = 0.0; else tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * 0.5))) / eps) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -8.4e+113) tmp = ((x * (-1.0 + (x * (0.5 + (x * -0.16666666666666666))))) / eps) / 2.0; elseif (x <= 120.0) tmp = (2.0 - (eps * x)) / 2.0; elseif (x <= 2.2e+152) tmp = 0.0; else tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -8.4e+113], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 120.0], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.2e+152], 0.0, N[(N[(N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+113}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot -0.16666666666666666\right)\right)}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 120:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+152}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot 0.5\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < -8.3999999999999996e113Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in eps around 0 50.0%
expm1-define50.0%
neg-mul-150.0%
Simplified50.0%
Taylor expanded in x around 0 50.0%
if -8.3999999999999996e113 < x < 120Initial program 56.3%
Simplified45.9%
Taylor expanded in x around 0 71.2%
Taylor expanded in eps around 0 71.1%
Taylor expanded in x around 0 71.1%
mul-1-neg71.1%
*-commutative71.1%
unsub-neg71.1%
*-commutative71.1%
Simplified71.1%
if 120 < x < 2.1999999999999998e152Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 38.5%
div-sub38.5%
mul-1-neg38.5%
rec-exp38.5%
+-inverses38.5%
metadata-eval38.5%
Simplified38.5%
if 2.1999999999999998e152 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 31.6%
Taylor expanded in eps around 0 1.9%
expm1-define1.9%
neg-mul-11.9%
Simplified1.9%
Taylor expanded in x around 0 30.4%
Final simplification59.5%
(FPCore (x eps)
:precision binary64
(if (<= x -9500.0)
(/
(/
(*
x
(+
-1.0
(* x (+ 0.5 (* x (- (* x 0.041666666666666664) 0.16666666666666666))))))
eps)
2.0)
(/
(/ (* eps (* 2.0 (* (+ 1.0 x) (+ 1.0 (* x (+ -1.0 (* x 0.5))))))) eps)
2.0)))
double code(double x, double eps) {
double tmp;
if (x <= -9500.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else {
tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * 0.5))))))) / eps) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-9500.0d0)) then
tmp = ((x * ((-1.0d0) + (x * (0.5d0 + (x * ((x * 0.041666666666666664d0) - 0.16666666666666666d0)))))) / eps) / 2.0d0
else
tmp = ((eps * (2.0d0 * ((1.0d0 + x) * (1.0d0 + (x * ((-1.0d0) + (x * 0.5d0))))))) / eps) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -9500.0) {
tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0;
} else {
tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * 0.5))))))) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -9500.0: tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0 else: tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * 0.5))))))) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -9500.0) tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0); else tmp = Float64(Float64(Float64(eps * Float64(2.0 * Float64(Float64(1.0 + x) * Float64(1.0 + Float64(x * Float64(-1.0 + Float64(x * 0.5))))))) / eps) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -9500.0) tmp = ((x * (-1.0 + (x * (0.5 + (x * ((x * 0.041666666666666664) - 0.16666666666666666)))))) / eps) / 2.0; else tmp = ((eps * (2.0 * ((1.0 + x) * (1.0 + (x * (-1.0 + (x * 0.5))))))) / eps) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -9500.0], N[(N[(N[(x * N[(-1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.041666666666666664), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(eps * N[(2.0 * N[(N[(1.0 + x), $MachinePrecision] * N[(1.0 + N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9500:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.041666666666666664 - 0.16666666666666666\right)\right)\right)}{\varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 \cdot \left(\left(1 + x\right) \cdot \left(1 + x \cdot \left(-1 + x \cdot 0.5\right)\right)\right)\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < -9500Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 52.9%
Taylor expanded in eps around 0 48.6%
expm1-define48.6%
neg-mul-148.6%
Simplified48.6%
Taylor expanded in x around 0 34.9%
if -9500 < x Initial program 67.0%
Simplified52.3%
Taylor expanded in eps around 0 33.8%
associate-+r+67.4%
mul-1-neg67.4%
sub-neg67.4%
+-inverses67.4%
distribute-lft-out67.4%
distribute-rgt1-in67.4%
mul-1-neg67.4%
Simplified67.4%
Taylor expanded in x around 0 70.9%
Final simplification66.0%
(FPCore (x eps) :precision binary64 (if (<= x 210.0) (/ (- 2.0 (* eps x)) 2.0) (if (<= x 2.2e+152) 0.0 (/ (/ (* x (+ -1.0 (* x 0.5))) eps) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= 210.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 2.2e+152) {
tmp = 0.0;
} else {
tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 210.0d0) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else if (x <= 2.2d+152) then
tmp = 0.0d0
else
tmp = ((x * ((-1.0d0) + (x * 0.5d0))) / eps) / 2.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 210.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else if (x <= 2.2e+152) {
tmp = 0.0;
} else {
tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 210.0: tmp = (2.0 - (eps * x)) / 2.0 elif x <= 2.2e+152: tmp = 0.0 else: tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 210.0) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); elseif (x <= 2.2e+152) tmp = 0.0; else tmp = Float64(Float64(Float64(x * Float64(-1.0 + Float64(x * 0.5))) / eps) / 2.0); end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 210.0) tmp = (2.0 - (eps * x)) / 2.0; elseif (x <= 2.2e+152) tmp = 0.0; else tmp = ((x * (-1.0 + (x * 0.5))) / eps) / 2.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 210.0], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.2e+152], 0.0, N[(N[(N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 210:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+152}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot \left(-1 + x \cdot 0.5\right)}{\varepsilon}}{2}\\
\end{array}
\end{array}
if x < 210Initial program 60.9%
Simplified51.7%
Taylor expanded in x around 0 63.9%
Taylor expanded in eps around 0 67.3%
Taylor expanded in x around 0 67.3%
mul-1-neg67.3%
*-commutative67.3%
unsub-neg67.3%
*-commutative67.3%
Simplified67.3%
if 210 < x < 2.1999999999999998e152Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 38.5%
div-sub38.5%
mul-1-neg38.5%
rec-exp38.5%
+-inverses38.5%
metadata-eval38.5%
Simplified38.5%
if 2.1999999999999998e152 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 31.6%
Taylor expanded in eps around 0 1.9%
expm1-define1.9%
neg-mul-11.9%
Simplified1.9%
Taylor expanded in x around 0 30.4%
Final simplification58.4%
(FPCore (x eps) :precision binary64 (if (<= x 200.0) (/ (- 2.0 (* eps x)) 2.0) 0.0))
double code(double x, double eps) {
double tmp;
if (x <= 200.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 200.0d0) then
tmp = (2.0d0 - (eps * x)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 200.0) {
tmp = (2.0 - (eps * x)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 200.0: tmp = (2.0 - (eps * x)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 200.0) tmp = Float64(Float64(2.0 - Float64(eps * x)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 200.0) tmp = (2.0 - (eps * x)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 200.0], N[(N[(2.0 - N[(eps * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 200:\\
\;\;\;\;\frac{2 - \varepsilon \cdot x}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 200Initial program 60.9%
Simplified51.7%
Taylor expanded in x around 0 63.9%
Taylor expanded in eps around 0 67.3%
Taylor expanded in x around 0 67.3%
mul-1-neg67.3%
*-commutative67.3%
unsub-neg67.3%
*-commutative67.3%
Simplified67.3%
if 200 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 40.1%
div-sub40.1%
mul-1-neg40.1%
rec-exp40.1%
+-inverses40.1%
metadata-eval40.1%
Simplified40.1%
(FPCore (x eps) :precision binary64 (if (<= x -0.32) (* x (* eps -0.5)) (if (<= x 600.0) 1.0 0.0)))
double code(double x, double eps) {
double tmp;
if (x <= -0.32) {
tmp = x * (eps * -0.5);
} else if (x <= 600.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-0.32d0)) then
tmp = x * (eps * (-0.5d0))
else if (x <= 600.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -0.32) {
tmp = x * (eps * -0.5);
} else if (x <= 600.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -0.32: tmp = x * (eps * -0.5) elif x <= 600.0: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -0.32) tmp = Float64(x * Float64(eps * -0.5)); elseif (x <= 600.0) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -0.32) tmp = x * (eps * -0.5); elseif (x <= 600.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -0.32], N[(x * N[(eps * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 600.0], 1.0, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.32:\\
\;\;\;\;x \cdot \left(\varepsilon \cdot -0.5\right)\\
\mathbf{elif}\;x \leq 600:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.320000000000000007Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 3.1%
Taylor expanded in eps around 0 26.2%
Taylor expanded in x around 0 26.2%
mul-1-neg26.2%
*-commutative26.2%
unsub-neg26.2%
*-commutative26.2%
Simplified26.2%
Taylor expanded in eps around inf 26.2%
associate-*r*26.2%
Simplified26.2%
if -0.320000000000000007 < x < 600Initial program 51.6%
Simplified40.2%
Taylor expanded in eps around inf 96.6%
Taylor expanded in eps around inf 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 78.4%
if 600 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 40.1%
div-sub40.1%
mul-1-neg40.1%
rec-exp40.1%
+-inverses40.1%
metadata-eval40.1%
Simplified40.1%
Final simplification60.7%
(FPCore (x eps) :precision binary64 (if (<= x 520.0) 1.0 0.0))
double code(double x, double eps) {
double tmp;
if (x <= 520.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 520.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 520.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 520.0: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 520.0) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 520.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 520.0], 1.0, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 520:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 520Initial program 60.9%
Simplified51.7%
Taylor expanded in eps around inf 97.3%
Taylor expanded in eps around inf 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 63.9%
if 520 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 40.1%
div-sub40.1%
mul-1-neg40.1%
rec-exp40.1%
+-inverses40.1%
metadata-eval40.1%
Simplified40.1%
(FPCore (x eps) :precision binary64 0.0)
double code(double x, double eps) {
return 0.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 0.0d0
end function
public static double code(double x, double eps) {
return 0.0;
}
def code(x, eps): return 0.0
function code(x, eps) return 0.0 end
function tmp = code(x, eps) tmp = 0.0; end
code[x_, eps_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 71.5%
Simplified64.7%
Taylor expanded in eps around 0 12.5%
div-sub12.5%
mul-1-neg12.5%
rec-exp12.5%
+-inverses12.7%
metadata-eval12.7%
Simplified12.7%
herbie shell --seed 2024152
(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))