
(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 19 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 (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
0.0)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/ (+ (exp (- (* x eps_m) x)) (exp (* eps_m (- x)))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 0.0) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = (exp(((x * eps_m) - x)) + exp((eps_m * -x))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 0.0) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(Float64(exp(Float64(Float64(x * eps_m) - x)) + exp(Float64(eps_m * Float64(-x)))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(N[(x * eps$95$m), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 0:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m - x} + e^{eps\_m \cdot \left(-x\right)}}{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))))) < 0.0Initial program 35.7%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.0
Simplified99.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.1
Simplified99.1%
if 0.0 < (-.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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Final simplification99.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
0.0)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/ (+ (exp (- (fma x eps_m x))) (exp (* x eps_m))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 0.0) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = (exp(-fma(x, eps_m, x)) + exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 0.0) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(Float64(exp(Float64(-fma(x, eps_m, x))) + exp(Float64(x * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[(-N[(x * eps$95$m + x), $MachinePrecision])], $MachinePrecision] + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 0:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-\mathsf{fma}\left(x, eps\_m, x\right)} + e^{x \cdot eps\_m}}{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))))) < 0.0Initial program 35.7%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.0
Simplified99.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.1
Simplified99.1%
if 0.0 < (-.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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f6499.8
Simplified99.8%
Final simplification99.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
0.0)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/ (+ (exp (* eps_m (- x))) (exp (* x eps_m))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 0.0) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = (exp((eps_m * -x)) + exp((x * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 0.0) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(Float64(exp(Float64(eps_m * Float64(-x))) + exp(Float64(x * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(eps$95$m * (-x)), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 0:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{eps\_m \cdot \left(-x\right)} + e^{x \cdot eps\_m}}{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))))) < 0.0Initial program 35.7%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.0
Simplified99.0%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.1
Simplified99.1%
if 0.0 < (-.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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Taylor expanded in eps around inf
lower-*.f6499.8
Simplified99.8%
Final simplification99.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (+ 1.0 (/ -1.0 eps_m))) (t_1 (+ 1.0 (/ 1.0 eps_m))))
(if (<=
(+
(* t_1 (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) t_0))
2.0)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/
(fma
x
(fma
x
(*
0.5
(fma
(+ eps_m 1.0)
(* (+ eps_m 1.0) t_0)
(* t_1 (* (- 1.0 eps_m) (- 1.0 eps_m)))))
(fma (+ eps_m 1.0) (+ (/ 1.0 eps_m) -1.0) (* t_1 (+ eps_m -1.0))))
2.0)
2.0))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = 1.0 + (-1.0 / eps_m);
double t_1 = 1.0 + (1.0 / eps_m);
double tmp;
if (((t_1 * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * t_0)) <= 2.0) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = fma(x, fma(x, (0.5 * fma((eps_m + 1.0), ((eps_m + 1.0) * t_0), (t_1 * ((1.0 - eps_m) * (1.0 - eps_m))))), fma((eps_m + 1.0), ((1.0 / eps_m) + -1.0), (t_1 * (eps_m + -1.0)))), 2.0) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(1.0 + Float64(-1.0 / eps_m)) t_1 = Float64(1.0 + Float64(1.0 / eps_m)) tmp = 0.0 if (Float64(Float64(t_1 * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * t_0)) <= 2.0) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(fma(x, fma(x, Float64(0.5 * fma(Float64(eps_m + 1.0), Float64(Float64(eps_m + 1.0) * t_0), Float64(t_1 * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))))), fma(Float64(eps_m + 1.0), Float64(Float64(1.0 / eps_m) + -1.0), Float64(t_1 * Float64(eps_m + -1.0)))), 2.0) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(x * N[(0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(N[(eps$95$m + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(t$95$1 * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + -1.0), $MachinePrecision] + N[(t$95$1 * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := 1 + \frac{-1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;t\_1 \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot t\_0 \leq 2:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5 \cdot \mathsf{fma}\left(eps\_m + 1, \left(eps\_m + 1\right) \cdot t\_0, t\_1 \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right), \mathsf{fma}\left(eps\_m + 1, \frac{1}{eps\_m} + -1, t\_1 \cdot \left(eps\_m + -1\right)\right)\right), 2\right)}{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 50.3%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.3
Simplified99.3%
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%
Taylor expanded in x around 0
Simplified85.8%
Final simplification93.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
2.0)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/
(fma
x
(fma (* x 0.5) (fma eps_m eps_m (* (- 1.0 eps_m) (- 1.0 eps_m))) -1.0)
2.0)
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 2.0) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = fma(x, fma((x * 0.5), fma(eps_m, eps_m, ((1.0 - eps_m) * (1.0 - eps_m))), -1.0), 2.0) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 2.0) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(fma(x, fma(Float64(x * 0.5), fma(eps_m, eps_m, Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))), -1.0), 2.0) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m * eps$95$m + N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 2:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x \cdot 0.5, \mathsf{fma}\left(eps\_m, eps\_m, \left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right), -1\right), 2\right)}{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 50.3%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.3
Simplified99.3%
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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
lower-fma.f64N/A
Simplified85.8%
Final simplification93.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
2.0)
(/ (* (exp (- x)) (+ x (+ x 2.0))) 2.0)
(/
(fma
x
(fma (* x 0.5) (fma eps_m eps_m (* (- 1.0 eps_m) (- 1.0 eps_m))) -1.0)
2.0)
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 2.0) {
tmp = (exp(-x) * (x + (x + 2.0))) / 2.0;
} else {
tmp = fma(x, fma((x * 0.5), fma(eps_m, eps_m, ((1.0 - eps_m) * (1.0 - eps_m))), -1.0), 2.0) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 2.0) tmp = Float64(Float64(exp(Float64(-x)) * Float64(x + Float64(x + 2.0))) / 2.0); else tmp = Float64(fma(x, fma(Float64(x * 0.5), fma(eps_m, eps_m, Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))), -1.0), 2.0) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x + N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m * eps$95$m + N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 2:\\
\;\;\;\;\frac{e^{-x} \cdot \left(x + \left(x + 2\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x \cdot 0.5, \mathsf{fma}\left(eps\_m, eps\_m, \left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right), -1\right), 2\right)}{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 50.3%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.3
Simplified99.3%
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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
lower-fma.f64N/A
Simplified85.8%
Final simplification93.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
2.0)
(exp (- x))
(/
(fma
x
(fma (* x 0.5) (fma eps_m eps_m (* (- 1.0 eps_m) (- 1.0 eps_m))) -1.0)
2.0)
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 2.0) {
tmp = exp(-x);
} else {
tmp = fma(x, fma((x * 0.5), fma(eps_m, eps_m, ((1.0 - eps_m) * (1.0 - eps_m))), -1.0), 2.0) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 2.0) tmp = exp(Float64(-x)); else tmp = Float64(fma(x, fma(Float64(x * 0.5), fma(eps_m, eps_m, Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))), -1.0), 2.0) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], N[Exp[(-x)], $MachinePrecision], N[(N[(x * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m * eps$95$m + N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 2:\\
\;\;\;\;e^{-x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x \cdot 0.5, \mathsf{fma}\left(eps\_m, eps\_m, \left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right), -1\right), 2\right)}{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 50.3%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
Simplified97.1%
Taylor expanded in x around inf
neg-mul-1N/A
lower-exp.f64N/A
neg-mul-1N/A
lower-neg.f6497.1
Simplified97.1%
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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
lower-fma.f64N/A
Simplified85.8%
Final simplification92.5%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
2.0)
(/ (fma x (* x (fma x (fma x -0.25 0.6666666666666666) -1.0)) 2.0) 2.0)
(/
(fma
x
(fma (* x 0.5) (fma eps_m eps_m (* (- 1.0 eps_m) (- 1.0 eps_m))) -1.0)
2.0)
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 2.0) {
tmp = fma(x, (x * fma(x, fma(x, -0.25, 0.6666666666666666), -1.0)), 2.0) / 2.0;
} else {
tmp = fma(x, fma((x * 0.5), fma(eps_m, eps_m, ((1.0 - eps_m) * (1.0 - eps_m))), -1.0), 2.0) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 2.0) tmp = Float64(fma(x, Float64(x * fma(x, fma(x, -0.25, 0.6666666666666666), -1.0)), 2.0) / 2.0); else tmp = Float64(fma(x, fma(Float64(x * 0.5), fma(eps_m, eps_m, Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))), -1.0), 2.0) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], N[(N[(x * N[(x * N[(x * N[(x * -0.25 + 0.6666666666666666), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(x * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m * eps$95$m + N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 2:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, -0.25, 0.6666666666666666\right), -1\right), 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x \cdot 0.5, \mathsf{fma}\left(eps\_m, eps\_m, \left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right), -1\right), 2\right)}{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 50.3%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6499.3
Simplified99.3%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6473.2
Simplified73.2%
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%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified99.8%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.8
Simplified99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
lower-fma.f64N/A
Simplified85.8%
Final simplification78.4%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
10000.0)
(/ (fma x (* x (fma x (fma x -0.25 0.6666666666666666) -1.0)) 2.0) 2.0)
(/ (* (* x x) (* 0.5 (* eps_m eps_m))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 10000.0) {
tmp = fma(x, (x * fma(x, fma(x, -0.25, 0.6666666666666666), -1.0)), 2.0) / 2.0;
} else {
tmp = ((x * x) * (0.5 * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 10000.0) tmp = Float64(fma(x, Float64(x * fma(x, fma(x, -0.25, 0.6666666666666666), -1.0)), 2.0) / 2.0); else tmp = Float64(Float64(Float64(x * x) * Float64(0.5 * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 10000.0], N[(N[(x * N[(x * N[(x * N[(x * -0.25 + 0.6666666666666666), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 10000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, x \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(x, -0.25, 0.6666666666666666\right), -1\right), 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m\right)\right)}{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))))) < 1e4Initial program 51.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6496.8
Simplified96.8%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6471.6
Simplified71.6%
if 1e4 < (-.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%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6489.6
Simplified89.6%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Simplified81.8%
Final simplification75.6%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<=
(+
(* (+ 1.0 (/ 1.0 eps_m)) (exp (* x (+ eps_m -1.0))))
(* (exp (* x (- -1.0 eps_m))) (+ 1.0 (/ -1.0 eps_m))))
10000.0)
(fma (* x x) (fma x 0.3333333333333333 -0.5) 1.0)
(/ (* (* x x) (* 0.5 (* eps_m eps_m))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if ((((1.0 + (1.0 / eps_m)) * exp((x * (eps_m + -1.0)))) + (exp((x * (-1.0 - eps_m))) * (1.0 + (-1.0 / eps_m)))) <= 10000.0) {
tmp = fma((x * x), fma(x, 0.3333333333333333, -0.5), 1.0);
} else {
tmp = ((x * x) * (0.5 * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(x * Float64(eps_m + -1.0)))) + Float64(exp(Float64(x * Float64(-1.0 - eps_m))) * Float64(1.0 + Float64(-1.0 / eps_m)))) <= 10000.0) tmp = fma(Float64(x * x), fma(x, 0.3333333333333333, -0.5), 1.0); else tmp = Float64(Float64(Float64(x * x) * Float64(0.5 * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(x * N[(eps$95$m + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 10000.0], N[(N[(x * x), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.5), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;\left(1 + \frac{1}{eps\_m}\right) \cdot e^{x \cdot \left(eps\_m + -1\right)} + e^{x \cdot \left(-1 - eps\_m\right)} \cdot \left(1 + \frac{-1}{eps\_m}\right) \leq 10000:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, 0.3333333333333333, -0.5\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m\right)\right)}{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))))) < 1e4Initial program 51.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6496.8
Simplified96.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6471.3
Simplified71.3%
Taylor expanded in x around 0
+-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
*-inversesN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-neg-outN/A
distribute-lft-inN/A
sub-negN/A
lower-fma.f64N/A
Simplified71.3%
if 1e4 < (-.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%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6489.6
Simplified89.6%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6481.8
Simplified81.8%
Final simplification75.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (- (* x eps_m) x)) (exp (- (fma x eps_m x)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp(((x * eps_m) - x)) + exp(-fma(x, eps_m, x))) / 2.0;
}
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(Float64(x * eps_m) - x)) + exp(Float64(-fma(x, eps_m, x)))) / 2.0) end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Exp[N[(N[(x * eps$95$m), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] + N[Exp[(-N[(x * eps$95$m + x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot eps\_m - x} + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}}{2}
\end{array}
Initial program 70.8%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified98.2%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= eps_m 2.6e-13)
(/ (* (exp (- x)) (fma x 2.0 2.0)) 2.0)
(/
(+
(exp (- (* x eps_m) x))
(fma x (fma 0.5 (* (fma x eps_m x) (+ eps_m 1.0)) (- -1.0 eps_m)) 1.0))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (eps_m <= 2.6e-13) {
tmp = (exp(-x) * fma(x, 2.0, 2.0)) / 2.0;
} else {
tmp = (exp(((x * eps_m) - x)) + fma(x, fma(0.5, (fma(x, eps_m, x) * (eps_m + 1.0)), (-1.0 - eps_m)), 1.0)) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (eps_m <= 2.6e-13) tmp = Float64(Float64(exp(Float64(-x)) * fma(x, 2.0, 2.0)) / 2.0); else tmp = Float64(Float64(exp(Float64(Float64(x * eps_m) - x)) + fma(x, fma(0.5, Float64(fma(x, eps_m, x) * Float64(eps_m + 1.0)), Float64(-1.0 - eps_m)), 1.0)) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 2.6e-13], N[(N[(N[Exp[(-x)], $MachinePrecision] * N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(N[(x * eps$95$m), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] + N[(x * N[(0.5 * N[(N[(x * eps$95$m + x), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 2.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{e^{-x} \cdot \mathsf{fma}\left(x, 2, 2\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{x \cdot eps\_m - x} + \mathsf{fma}\left(x, \mathsf{fma}\left(0.5, \mathsf{fma}\left(x, eps\_m, x\right) \cdot \left(eps\_m + 1\right), -1 - eps\_m\right), 1\right)}{2}\\
\end{array}
\end{array}
if eps < 2.6e-13Initial program 60.9%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6469.5
Simplified69.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6469.5
Simplified69.5%
if 2.6e-13 < eps Initial program 100.0%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
lower--.f6488.4
Simplified88.4%
Final simplification74.3%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ (+ 1.0 (/ 1.0 eps_m)) (+ 1.0 (/ -1.0 eps_m))) 2.0)))
(if (<= x 760.0)
(/
(+
(fma x (fma 0.5 (* (fma x eps_m x) (+ eps_m 1.0)) (- -1.0 eps_m)) 1.0)
(fma x (* (+ eps_m -1.0) (fma (* x 0.5) (+ eps_m -1.0) 1.0)) 1.0))
2.0)
(if (<= x 1.6e+24)
t_0
(if (<= x 9.5e+268) (/ (* (* x x) (* 0.5 (* eps_m eps_m))) 2.0) t_0)))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = ((1.0 + (1.0 / eps_m)) + (1.0 + (-1.0 / eps_m))) / 2.0;
double tmp;
if (x <= 760.0) {
tmp = (fma(x, fma(0.5, (fma(x, eps_m, x) * (eps_m + 1.0)), (-1.0 - eps_m)), 1.0) + fma(x, ((eps_m + -1.0) * fma((x * 0.5), (eps_m + -1.0), 1.0)), 1.0)) / 2.0;
} else if (x <= 1.6e+24) {
tmp = t_0;
} else if (x <= 9.5e+268) {
tmp = ((x * x) * (0.5 * (eps_m * eps_m))) / 2.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 + Float64(-1.0 / eps_m))) / 2.0) tmp = 0.0 if (x <= 760.0) tmp = Float64(Float64(fma(x, fma(0.5, Float64(fma(x, eps_m, x) * Float64(eps_m + 1.0)), Float64(-1.0 - eps_m)), 1.0) + fma(x, Float64(Float64(eps_m + -1.0) * fma(Float64(x * 0.5), Float64(eps_m + -1.0), 1.0)), 1.0)) / 2.0); elseif (x <= 1.6e+24) tmp = t_0; elseif (x <= 9.5e+268) tmp = Float64(Float64(Float64(x * x) * Float64(0.5 * Float64(eps_m * eps_m))) / 2.0); else tmp = t_0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, 760.0], N[(N[(N[(x * N[(0.5 * N[(N[(x * eps$95$m + x), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + N[(x * N[(N[(eps$95$m + -1.0), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+24], t$95$0, If[LessEqual[x, 9.5e+268], N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{if}\;x \leq 760:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(0.5, \mathsf{fma}\left(x, eps\_m, x\right) \cdot \left(eps\_m + 1\right), -1 - eps\_m\right), 1\right) + \mathsf{fma}\left(x, \left(eps\_m + -1\right) \cdot \mathsf{fma}\left(x \cdot 0.5, eps\_m + -1, 1\right), 1\right)}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+268}:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < 760Initial program 58.5%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified97.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
lower--.f6489.9
Simplified89.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate--l+N/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-lft1-inN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f6486.3
Simplified86.3%
if 760 < x < 1.5999999999999999e24 or 9.49999999999999956e268 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified7.2%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6480.6
Simplified80.6%
if 1.5999999999999999e24 < x < 9.49999999999999956e268Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6461.4
Simplified61.4%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.0
Simplified72.0%
Final simplification82.7%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(let* ((t_0 (/ (+ (+ 1.0 (/ 1.0 eps_m)) (+ 1.0 (/ -1.0 eps_m))) 2.0)))
(if (<= x -3.3e-159)
(/
(fma
x
(fma (* x 0.5) (fma eps_m eps_m (* (- 1.0 eps_m) (- 1.0 eps_m))) -1.0)
2.0)
2.0)
(if (<= x 760.0)
(/
(+
1.0
(fma
x
(fma 0.5 (* (fma x eps_m x) (+ eps_m 1.0)) (- -1.0 eps_m))
1.0))
2.0)
(if (<= x 1.6e+24)
t_0
(if (<= x 9.5e+268)
(/ (* (* x x) (* 0.5 (* eps_m eps_m))) 2.0)
t_0))))))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = ((1.0 + (1.0 / eps_m)) + (1.0 + (-1.0 / eps_m))) / 2.0;
double tmp;
if (x <= -3.3e-159) {
tmp = fma(x, fma((x * 0.5), fma(eps_m, eps_m, ((1.0 - eps_m) * (1.0 - eps_m))), -1.0), 2.0) / 2.0;
} else if (x <= 760.0) {
tmp = (1.0 + fma(x, fma(0.5, (fma(x, eps_m, x) * (eps_m + 1.0)), (-1.0 - eps_m)), 1.0)) / 2.0;
} else if (x <= 1.6e+24) {
tmp = t_0;
} else if (x <= 9.5e+268) {
tmp = ((x * x) * (0.5 * (eps_m * eps_m))) / 2.0;
} else {
tmp = t_0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(1.0 + Float64(-1.0 / eps_m))) / 2.0) tmp = 0.0 if (x <= -3.3e-159) tmp = Float64(fma(x, fma(Float64(x * 0.5), fma(eps_m, eps_m, Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))), -1.0), 2.0) / 2.0); elseif (x <= 760.0) tmp = Float64(Float64(1.0 + fma(x, fma(0.5, Float64(fma(x, eps_m, x) * Float64(eps_m + 1.0)), Float64(-1.0 - eps_m)), 1.0)) / 2.0); elseif (x <= 1.6e+24) tmp = t_0; elseif (x <= 9.5e+268) tmp = Float64(Float64(Float64(x * x) * Float64(0.5 * Float64(eps_m * eps_m))) / 2.0); else tmp = t_0; end return tmp end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -3.3e-159], N[(N[(x * N[(N[(x * 0.5), $MachinePrecision] * N[(eps$95$m * eps$95$m + N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 760.0], N[(N[(1.0 + N[(x * N[(0.5 * N[(N[(x * eps$95$m + x), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+24], t$95$0, If[LessEqual[x, 9.5e+268], N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := \frac{\left(1 + \frac{1}{eps\_m}\right) + \left(1 + \frac{-1}{eps\_m}\right)}{2}\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{-159}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x \cdot 0.5, \mathsf{fma}\left(eps\_m, eps\_m, \left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right), -1\right), 2\right)}{2}\\
\mathbf{elif}\;x \leq 760:\\
\;\;\;\;\frac{1 + \mathsf{fma}\left(x, \mathsf{fma}\left(0.5, \mathsf{fma}\left(x, eps\_m, x\right) \cdot \left(eps\_m + 1\right), -1 - eps\_m\right), 1\right)}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+268}:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.3000000000000002e-159Initial program 71.9%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified96.4%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6496.4
Simplified96.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
distribute-rgt1-inN/A
metadata-evalN/A
mul0-lftN/A
+-lft-identityN/A
lower-fma.f64N/A
Simplified85.5%
if -3.3000000000000002e-159 < x < 760Initial program 50.2%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified98.2%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
lower--.f6492.9
Simplified92.9%
Taylor expanded in x around 0
Simplified89.8%
if 760 < x < 1.5999999999999999e24 or 9.49999999999999956e268 < x Initial program 100.0%
Taylor expanded in x around 0
Simplified7.2%
Taylor expanded in x around 0
sub-negN/A
metadata-evalN/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6480.6
Simplified80.6%
if 1.5999999999999999e24 < x < 9.49999999999999956e268Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6461.4
Simplified61.4%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.0
Simplified72.0%
Final simplification84.0%
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
:precision binary64
(if (<= x 0.038)
(/
(+
1.0
(fma x (fma 0.5 (* (fma x eps_m x) (+ eps_m 1.0)) (- -1.0 eps_m)) 1.0))
2.0)
(/ (* (* x x) (* 0.5 (* eps_m eps_m))) 2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= 0.038) {
tmp = (1.0 + fma(x, fma(0.5, (fma(x, eps_m, x) * (eps_m + 1.0)), (-1.0 - eps_m)), 1.0)) / 2.0;
} else {
tmp = ((x * x) * (0.5 * (eps_m * eps_m))) / 2.0;
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= 0.038) tmp = Float64(Float64(1.0 + fma(x, fma(0.5, Float64(fma(x, eps_m, x) * Float64(eps_m + 1.0)), Float64(-1.0 - eps_m)), 1.0)) / 2.0); else tmp = Float64(Float64(Float64(x * x) * Float64(0.5 * Float64(eps_m * eps_m))) / 2.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, 0.038], N[(N[(1.0 + N[(x * N[(0.5 * N[(N[(x * eps$95$m + x), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] * N[(0.5 * N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.038:\\
\;\;\;\;\frac{1 + \mathsf{fma}\left(x, \mathsf{fma}\left(0.5, \mathsf{fma}\left(x, eps\_m, x\right) \cdot \left(eps\_m + 1\right), -1 - eps\_m\right), 1\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot x\right) \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m\right)\right)}{2}\\
\end{array}
\end{array}
if x < 0.0379999999999999991Initial program 58.3%
Taylor expanded in eps around inf
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-+.f64N/A
Simplified97.5%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
distribute-lft-inN/A
metadata-evalN/A
mul-1-negN/A
sub-negN/A
lower--.f6489.8
Simplified89.8%
Taylor expanded in x around 0
Simplified86.1%
if 0.0379999999999999991 < x Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-*r*N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6450.2
Simplified50.2%
Taylor expanded in eps around inf
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.1
Simplified58.1%
Final simplification77.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -460.0) (fma x (fma x (fma x -0.16666666666666666 0.5) -1.0) 1.0) (fma (* x x) (fma x 0.3333333333333333 -0.5) 1.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -460.0) {
tmp = fma(x, fma(x, fma(x, -0.16666666666666666, 0.5), -1.0), 1.0);
} else {
tmp = fma((x * x), fma(x, 0.3333333333333333, -0.5), 1.0);
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -460.0) tmp = fma(x, fma(x, fma(x, -0.16666666666666666, 0.5), -1.0), 1.0); else tmp = fma(Float64(x * x), fma(x, 0.3333333333333333, -0.5), 1.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -460.0], N[(x * N[(x * N[(x * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -460:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, 0.3333333333333333, -0.5\right), 1\right)\\
\end{array}
\end{array}
if x < -460Initial program 100.0%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f640.0
Simplified0.0%
Taylor expanded in x around 0
Simplified97.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
Simplified63.5%
if -460 < x Initial program 66.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6467.4
Simplified67.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6461.4
Simplified61.4%
Taylor expanded in x around 0
+-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
*-inversesN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-neg-outN/A
distribute-lft-inN/A
sub-negN/A
lower-fma.f64N/A
Simplified61.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (if (<= x -460.0) (fma x (fma x 0.5 -1.0) 1.0) (fma (* x x) (fma x 0.3333333333333333 -0.5) 1.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
double tmp;
if (x <= -460.0) {
tmp = fma(x, fma(x, 0.5, -1.0), 1.0);
} else {
tmp = fma((x * x), fma(x, 0.3333333333333333, -0.5), 1.0);
}
return tmp;
}
eps_m = abs(eps) function code(x, eps_m) tmp = 0.0 if (x <= -460.0) tmp = fma(x, fma(x, 0.5, -1.0), 1.0); else tmp = fma(Float64(x * x), fma(x, 0.3333333333333333, -0.5), 1.0); end return tmp end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := If[LessEqual[x, -460.0], N[(x * N[(x * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.5), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -460:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x, 0.3333333333333333, -0.5\right), 1\right)\\
\end{array}
\end{array}
if x < -460Initial program 100.0%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f640.0
Simplified0.0%
Taylor expanded in x around 0
Simplified97.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6451.0
Simplified51.0%
if -460 < x Initial program 66.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6467.4
Simplified67.4%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6461.4
Simplified61.4%
Taylor expanded in x around 0
+-commutativeN/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
*-inversesN/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
metadata-evalN/A
associate-*r/N/A
distribute-rgt-neg-outN/A
distribute-lft-inN/A
sub-negN/A
lower-fma.f64N/A
Simplified61.4%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (fma x (fma x 0.5 -1.0) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return fma(x, fma(x, 0.5, -1.0), 1.0);
}
eps_m = abs(eps) function code(x, eps_m) return fma(x, fma(x, 0.5, -1.0), 1.0) end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(x * N[(x * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.5, -1\right), 1\right)
\end{array}
Initial program 70.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6459.2
Simplified59.2%
Taylor expanded in x around 0
Simplified69.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6457.9
Simplified57.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 1.0)
eps_m = fabs(eps);
double code(double x, double eps_m) {
return 1.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = 1.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return 1.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return 1.0
eps_m = abs(eps) function code(x, eps_m) return 1.0 end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = 1.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := 1.0
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
1
\end{array}
Initial program 70.8%
Taylor expanded in eps around 0
mul-1-negN/A
unsub-negN/A
associate-+l-N/A
distribute-rgt1-inN/A
distribute-rgt-out--N/A
*-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-+.f64N/A
associate--l+N/A
metadata-evalN/A
lower-+.f6459.2
Simplified59.2%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
unpow2N/A
lower-*.f6443.4
Simplified43.4%
Taylor expanded in x around 0
Simplified44.2%
herbie shell --seed 2024215
(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))