
(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 17 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 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))
(* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x))))
2.0)))
(if (<= t_0 0.0) (* (fma (+ x 2.0) (exp (- x)) (/ x (exp x))) 0.5) t_0)))
double code(double x, double eps) {
double t_0 = (((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0;
double tmp;
if (t_0 <= 0.0) {
tmp = fma((x + 2.0), exp(-x), (x / exp(x))) * 0.5;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(fma(Float64(x + 2.0), exp(Float64(-x)), Float64(x / exp(x))) * 0.5); else tmp = t_0; end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(N[(N[(x + 2.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision] + N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x + 2, e^{-x}, \frac{x}{e^{x}}\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (/.f64 (-.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))))) #s(literal 2 binary64)) < 0.0Initial program 41.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites100.0%
if 0.0 < (/.f64 (-.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))))) #s(literal 2 binary64)) Initial program 99.9%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow eps -1.0) 1.0)) (t_1 (+ 1.0 (pow eps -1.0))))
(if (<=
(/
(- (* t_1 (exp (* (+ -1.0 eps) x))) (* t_0 (exp (* (- -1.0 eps) x))))
2.0)
0.0)
(* (fma (+ x 2.0) (exp (- x)) (/ x (exp x))) 0.5)
(/ (- (* t_1 (exp (- (* x eps) x))) (* t_0 (exp (- (* x eps))))) 2.0))))
double code(double x, double eps) {
double t_0 = pow(eps, -1.0) - 1.0;
double t_1 = 1.0 + pow(eps, -1.0);
double tmp;
if ((((t_1 * exp(((-1.0 + eps) * x))) - (t_0 * exp(((-1.0 - eps) * x)))) / 2.0) <= 0.0) {
tmp = fma((x + 2.0), exp(-x), (x / exp(x))) * 0.5;
} else {
tmp = ((t_1 * exp(((x * eps) - x))) - (t_0 * exp(-(x * eps)))) / 2.0;
}
return tmp;
}
function code(x, eps) t_0 = Float64((eps ^ -1.0) - 1.0) t_1 = Float64(1.0 + (eps ^ -1.0)) tmp = 0.0 if (Float64(Float64(Float64(t_1 * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(t_0 * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 0.0) tmp = Float64(fma(Float64(x + 2.0), exp(Float64(-x)), Float64(x / exp(x))) * 0.5); else tmp = Float64(Float64(Float64(t_1 * exp(Float64(Float64(x * eps) - x))) - Float64(t_0 * exp(Float64(-Float64(x * eps))))) / 2.0); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(t$95$1 * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0], N[(N[(N[(x + 2.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision] + N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(t$95$1 * N[Exp[N[(N[(x * eps), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Exp[(-N[(x * eps), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\varepsilon}^{-1} - 1\\
t_1 := 1 + {\varepsilon}^{-1}\\
\mathbf{if}\;\frac{t\_1 \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - t\_0 \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x + 2, e^{-x}, \frac{x}{e^{x}}\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot e^{x \cdot \varepsilon - x} - t\_0 \cdot e^{-x \cdot \varepsilon}}{2}\\
\end{array}
\end{array}
if (/.f64 (-.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))))) #s(literal 2 binary64)) < 0.0Initial program 41.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites100.0%
if 0.0 < (/.f64 (-.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))))) #s(literal 2 binary64)) Initial program 99.9%
Taylor expanded in eps around inf
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around inf
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))))
(if (<=
(/ (- t_0 (* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x)))) 2.0)
1.0)
(* (fma (+ x 2.0) (exp (- x)) (/ x (exp x))) 0.5)
(/ (- t_0 (- (exp (- (fma x eps x))))) 2.0))))
double code(double x, double eps) {
double t_0 = (1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x));
double tmp;
if (((t_0 - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 1.0) {
tmp = fma((x + 2.0), exp(-x), (x / exp(x))) * 0.5;
} else {
tmp = (t_0 - -exp(-fma(x, eps, x))) / 2.0;
}
return tmp;
}
function code(x, eps) t_0 = Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) tmp = 0.0 if (Float64(Float64(t_0 - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 1.0) tmp = Float64(fma(Float64(x + 2.0), exp(Float64(-x)), Float64(x / exp(x))) * 0.5); else tmp = Float64(Float64(t_0 - Float64(-exp(Float64(-fma(x, eps, x))))) / 2.0); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 1.0], N[(N[(N[(x + 2.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision] + N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(t$95$0 - (-N[Exp[(-N[(x * eps + x), $MachinePrecision])], $MachinePrecision])), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x}\\
\mathbf{if}\;\frac{t\_0 - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 1:\\
\;\;\;\;\mathsf{fma}\left(x + 2, e^{-x}, \frac{x}{e^{x}}\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)}{2}\\
\end{array}
\end{array}
if (/.f64 (-.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))))) #s(literal 2 binary64)) < 1Initial program 59.1%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites100.0%
if 1 < (/.f64 (-.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))))) #s(literal 2 binary64)) Initial program 99.9%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6499.8
Applied rewrites99.8%
Applied rewrites99.8%
Final simplification99.9%
(FPCore (x eps)
:precision binary64
(if (<=
(/
(-
(* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))
(* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x))))
2.0)
5000000.0)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ (- (/ (+ 1.0 eps) eps) (- (exp (- (fma x eps x))))) 2.0)))
double code(double x, double eps) {
double tmp;
if (((((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 5000000.0) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = (((1.0 + eps) / eps) - -exp(-fma(x, eps, x))) / 2.0;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 5000000.0) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(Float64(Float64(Float64(1.0 + eps) / eps) - Float64(-exp(Float64(-fma(x, eps, x))))) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 5000000.0], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(N[(1.0 + eps), $MachinePrecision] / eps), $MachinePrecision] - (-N[Exp[(-N[(x * eps + x), $MachinePrecision])], $MachinePrecision])), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 5000000:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 + \varepsilon}{\varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)}{2}\\
\end{array}
\end{array}
if (/.f64 (-.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))))) #s(literal 2 binary64)) < 5e6Initial program 60.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.5%
Taylor expanded in x around 0
Applied rewrites71.5%
if 5e6 < (/.f64 (-.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))))) #s(literal 2 binary64)) Initial program 99.9%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6499.9
Applied rewrites99.9%
Applied rewrites99.9%
Taylor expanded in x around 0
*-inversesN/A
div-addN/A
+-commutativeN/A
lower-/.f64N/A
lower-+.f6449.7
Applied rewrites49.7%
Final simplification62.2%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (- (pow eps -1.0) 1.0)))
(if (<= eps -1.0)
(/ (- (* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x))) t_0) 2.0)
(if (<= eps 1.15e-10)
(* (fma (+ x 2.0) (exp (- x)) (/ x (exp x))) 0.5)
(/ (- (+ (pow eps -1.0) 1.0) (* t_0 (exp (* (- -1.0 eps) x)))) 2.0)))))
double code(double x, double eps) {
double t_0 = pow(eps, -1.0) - 1.0;
double tmp;
if (eps <= -1.0) {
tmp = (((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - t_0) / 2.0;
} else if (eps <= 1.15e-10) {
tmp = fma((x + 2.0), exp(-x), (x / exp(x))) * 0.5;
} else {
tmp = ((pow(eps, -1.0) + 1.0) - (t_0 * exp(((-1.0 - eps) * x)))) / 2.0;
}
return tmp;
}
function code(x, eps) t_0 = Float64((eps ^ -1.0) - 1.0) tmp = 0.0 if (eps <= -1.0) tmp = Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - t_0) / 2.0); elseif (eps <= 1.15e-10) tmp = Float64(fma(Float64(x + 2.0), exp(Float64(-x)), Float64(x / exp(x))) * 0.5); else tmp = Float64(Float64(Float64((eps ^ -1.0) + 1.0) - Float64(t_0 * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0); end return tmp end
code[x_, eps_] := Block[{t$95$0 = N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]}, If[LessEqual[eps, -1.0], N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[eps, 1.15e-10], N[(N[(N[(x + 2.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision] + N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision] - N[(t$95$0 * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\varepsilon}^{-1} - 1\\
\mathbf{if}\;\varepsilon \leq -1:\\
\;\;\;\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - t\_0}{2}\\
\mathbf{elif}\;\varepsilon \leq 1.15 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(x + 2, e^{-x}, \frac{x}{e^{x}}\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\varepsilon}^{-1} + 1\right) - t\_0 \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2}\\
\end{array}
\end{array}
if eps < -1Initial program 100.0%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6469.7
Applied rewrites69.7%
if -1 < eps < 1.15000000000000004e-10Initial program 42.5%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Applied rewrites100.0%
if 1.15000000000000004e-10 < eps Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
Final simplification82.7%
(FPCore (x eps)
:precision binary64
(if (<= x -3000.0)
(/
(-
(fma
(- (* (/ (fma -0.16666666666666666 x 0.5) eps) x) (pow eps -1.0))
x
(pow eps -1.0))
(- (fma x eps x) 1.0))
2.0)
(if (<= x 1.55)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ x (exp x)))))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = (fma((((fma(-0.16666666666666666, x, 0.5) / eps) * x) - pow(eps, -1.0)), x, pow(eps, -1.0)) - (fma(x, eps, x) - 1.0)) / 2.0;
} else if (x <= 1.55) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = x / exp(x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64(fma(Float64(Float64(Float64(fma(-0.16666666666666666, x, 0.5) / eps) * x) - (eps ^ -1.0)), x, (eps ^ -1.0)) - Float64(fma(x, eps, x) - 1.0)) / 2.0); elseif (x <= 1.55) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(x / exp(x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[(N[(N[(N[(N[(-0.16666666666666666 * x + 0.5), $MachinePrecision] / eps), $MachinePrecision] * x), $MachinePrecision] - N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * x + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right)}{\varepsilon} \cdot x - {\varepsilon}^{-1}, x, {\varepsilon}^{-1}\right) - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{x}}\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites34.9%
if -3e3 < x < 1.55000000000000004Initial program 62.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around 0
Applied rewrites67.1%
if 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in x around inf
Applied rewrites63.1%
Final simplification61.7%
(FPCore (x eps)
:precision binary64
(if (<= x -3000.0)
(/
(-
(fma
(- (* (/ (fma -0.16666666666666666 x 0.5) eps) x) (pow eps -1.0))
x
(pow eps -1.0))
(- (fma x eps x) 1.0))
2.0)
(if (<= x 0.0019)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ (- (+ (pow eps -1.0) 1.0) (- (pow eps -1.0) 1.0)) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = (fma((((fma(-0.16666666666666666, x, 0.5) / eps) * x) - pow(eps, -1.0)), x, pow(eps, -1.0)) - (fma(x, eps, x) - 1.0)) / 2.0;
} else if (x <= 0.0019) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = ((pow(eps, -1.0) + 1.0) - (pow(eps, -1.0) - 1.0)) / 2.0;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64(fma(Float64(Float64(Float64(fma(-0.16666666666666666, x, 0.5) / eps) * x) - (eps ^ -1.0)), x, (eps ^ -1.0)) - Float64(fma(x, eps, x) - 1.0)) / 2.0); elseif (x <= 0.0019) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(Float64(Float64((eps ^ -1.0) + 1.0) - Float64((eps ^ -1.0) - 1.0)) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[(N[(N[(N[(N[(-0.16666666666666666 * x + 0.5), $MachinePrecision] / eps), $MachinePrecision] * x), $MachinePrecision] - N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * x + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 0.0019], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right)}{\varepsilon} \cdot x - {\varepsilon}^{-1}, x, {\varepsilon}^{-1}\right) - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{elif}\;x \leq 0.0019:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\varepsilon}^{-1} + 1\right) - \left({\varepsilon}^{-1} - 1\right)}{2}\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites34.9%
if -3e3 < x < 0.0019Initial program 62.7%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.5%
Taylor expanded in x around 0
Applied rewrites67.5%
if 0.0019 < x Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6461.3
Applied rewrites61.3%
Final simplification61.5%
(FPCore (x eps)
:precision binary64
(if (<= x -3000.0)
(/
(-
(fma (- (* (/ 0.5 eps) x) (pow eps -1.0)) x (pow eps -1.0))
(- (fma x eps x) 1.0))
2.0)
(if (<= x 0.0019)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ (- (+ (pow eps -1.0) 1.0) (- (pow eps -1.0) 1.0)) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = (fma((((0.5 / eps) * x) - pow(eps, -1.0)), x, pow(eps, -1.0)) - (fma(x, eps, x) - 1.0)) / 2.0;
} else if (x <= 0.0019) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = ((pow(eps, -1.0) + 1.0) - (pow(eps, -1.0) - 1.0)) / 2.0;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64(fma(Float64(Float64(Float64(0.5 / eps) * x) - (eps ^ -1.0)), x, (eps ^ -1.0)) - Float64(fma(x, eps, x) - 1.0)) / 2.0); elseif (x <= 0.0019) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(Float64(Float64((eps ^ -1.0) + 1.0) - Float64((eps ^ -1.0) - 1.0)) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[(N[(N[(N[(0.5 / eps), $MachinePrecision] * x), $MachinePrecision] - N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * x + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 0.0019], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{\varepsilon} \cdot x - {\varepsilon}^{-1}, x, {\varepsilon}^{-1}\right) - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{elif}\;x \leq 0.0019:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\varepsilon}^{-1} + 1\right) - \left({\varepsilon}^{-1} - 1\right)}{2}\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites27.2%
if -3e3 < x < 0.0019Initial program 62.7%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.5%
Taylor expanded in x around 0
Applied rewrites67.5%
if 0.0019 < x Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6461.3
Applied rewrites61.3%
Final simplification60.4%
(FPCore (x eps)
:precision binary64
(if (<= x -3.55e-6)
(/ (- (/ (+ 1.0 eps) eps) (/ -1.0 (exp x))) 2.0)
(if (<= x -2.3e-57)
(/
(-
(* (exp (- (* eps x) x)) (+ (pow eps -1.0) 1.0))
(- (fma x eps x) 1.0))
2.0)
(if (<= x 1.55)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ x (exp x))))))
double code(double x, double eps) {
double tmp;
if (x <= -3.55e-6) {
tmp = (((1.0 + eps) / eps) - (-1.0 / exp(x))) / 2.0;
} else if (x <= -2.3e-57) {
tmp = ((exp(((eps * x) - x)) * (pow(eps, -1.0) + 1.0)) - (fma(x, eps, x) - 1.0)) / 2.0;
} else if (x <= 1.55) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = x / exp(x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3.55e-6) tmp = Float64(Float64(Float64(Float64(1.0 + eps) / eps) - Float64(-1.0 / exp(x))) / 2.0); elseif (x <= -2.3e-57) tmp = Float64(Float64(Float64(exp(Float64(Float64(eps * x) - x)) * Float64((eps ^ -1.0) + 1.0)) - Float64(fma(x, eps, x) - 1.0)) / 2.0); elseif (x <= 1.55) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(x / exp(x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3.55e-6], N[(N[(N[(N[(1.0 + eps), $MachinePrecision] / eps), $MachinePrecision] - N[(-1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -2.3e-57], N[(N[(N[(N[Exp[N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision] * N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.55 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{1 + \varepsilon}{\varepsilon} - \frac{-1}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{e^{\varepsilon \cdot x - x} \cdot \left({\varepsilon}^{-1} + 1\right) - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{x}}\\
\end{array}
\end{array}
if x < -3.5499999999999999e-6Initial program 97.4%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6497.4
Applied rewrites97.4%
Taylor expanded in x around 0
Applied rewrites55.8%
Taylor expanded in x around 0
*-inversesN/A
div-addN/A
+-commutativeN/A
lower-/.f64N/A
lower-+.f6418.1
Applied rewrites18.1%
Taylor expanded in eps around 0
Applied rewrites97.4%
if -3.5499999999999999e-6 < x < -2.3e-57Initial program 87.7%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6487.2
Applied rewrites87.2%
Taylor expanded in x around 0
Applied rewrites54.1%
Taylor expanded in x around 0
*-inversesN/A
div-addN/A
+-commutativeN/A
lower-/.f64N/A
lower-+.f645.6
Applied rewrites5.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f6454.1
Applied rewrites54.1%
if -2.3e-57 < x < 1.55000000000000004Initial program 60.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.7%
Taylor expanded in x around 0
Applied rewrites72.7%
if 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in x around inf
Applied rewrites63.1%
Final simplification72.7%
(FPCore (x eps)
:precision binary64
(if (<= x -1.58e-6)
(/ (- (/ (+ 1.0 eps) eps) (/ -1.0 (exp x))) 2.0)
(if (<= x -2.3e-57)
(/ (- (* (+ 1.0 (pow eps -1.0)) (exp (- (* eps x) x))) -1.0) 2.0)
(if (<= x 1.55)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ x (exp x))))))
double code(double x, double eps) {
double tmp;
if (x <= -1.58e-6) {
tmp = (((1.0 + eps) / eps) - (-1.0 / exp(x))) / 2.0;
} else if (x <= -2.3e-57) {
tmp = (((1.0 + pow(eps, -1.0)) * exp(((eps * x) - x))) - -1.0) / 2.0;
} else if (x <= 1.55) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = x / exp(x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -1.58e-6) tmp = Float64(Float64(Float64(Float64(1.0 + eps) / eps) - Float64(-1.0 / exp(x))) / 2.0); elseif (x <= -2.3e-57) tmp = Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(eps * x) - x))) - -1.0) / 2.0); elseif (x <= 1.55) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(x / exp(x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.58e-6], N[(N[(N[(N[(1.0 + eps), $MachinePrecision] / eps), $MachinePrecision] - N[(-1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -2.3e-57], N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(eps * x), $MachinePrecision] - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.58 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{1 + \varepsilon}{\varepsilon} - \frac{-1}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq -2.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\varepsilon \cdot x - x} - -1}{2}\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{x}}\\
\end{array}
\end{array}
if x < -1.57999999999999991e-6Initial program 97.5%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6497.5
Applied rewrites97.5%
Taylor expanded in x around 0
Applied rewrites54.4%
Taylor expanded in x around 0
*-inversesN/A
div-addN/A
+-commutativeN/A
lower-/.f64N/A
lower-+.f6417.7
Applied rewrites17.7%
Taylor expanded in eps around 0
Applied rewrites94.9%
if -1.57999999999999991e-6 < x < -2.3e-57Initial program 86.8%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f6486.4
Applied rewrites86.4%
Taylor expanded in x around 0
Applied rewrites55.2%
Taylor expanded in x around inf
lower-exp.f64N/A
lower--.f64N/A
lower-*.f6455.2
Applied rewrites55.2%
if -2.3e-57 < x < 1.55000000000000004Initial program 60.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.7%
Taylor expanded in x around 0
Applied rewrites72.7%
if 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in x around inf
Applied rewrites63.1%
Final simplification72.6%
(FPCore (x eps)
:precision binary64
(if (<= x -48.0)
(/ (- (* (+ 1.0 (pow eps -1.0)) (fma (- eps 1.0) x 1.0)) -1.0) 2.0)
(if (<= x 0.0019)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ (- (+ (pow eps -1.0) 1.0) (- (pow eps -1.0) 1.0)) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -48.0) {
tmp = (((1.0 + pow(eps, -1.0)) * fma((eps - 1.0), x, 1.0)) - -1.0) / 2.0;
} else if (x <= 0.0019) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = ((pow(eps, -1.0) + 1.0) - (pow(eps, -1.0) - 1.0)) / 2.0;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -48.0) tmp = Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * fma(Float64(eps - 1.0), x, 1.0)) - -1.0) / 2.0); elseif (x <= 0.0019) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(Float64(Float64((eps ^ -1.0) + 1.0) - Float64((eps ^ -1.0) - 1.0)) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -48.0], N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[(N[(eps - 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 0.0019], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -48:\\
\;\;\;\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot \mathsf{fma}\left(\varepsilon - 1, x, 1\right) - -1}{2}\\
\mathbf{elif}\;x \leq 0.0019:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\varepsilon}^{-1} + 1\right) - \left({\varepsilon}^{-1} - 1\right)}{2}\\
\end{array}
\end{array}
if x < -48Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites62.3%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6424.6
Applied rewrites24.6%
if -48 < x < 0.0019Initial program 62.4%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.9%
Taylor expanded in x around 0
Applied rewrites67.9%
if 0.0019 < x Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6461.3
Applied rewrites61.3%
Final simplification60.1%
(FPCore (x eps)
:precision binary64
(if (<= x -3000.0)
(/ (- (pow eps -1.0) (- (fma x eps x) 1.0)) 2.0)
(if (<= x 0.0019)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ (- (+ (pow eps -1.0) 1.0) (- (pow eps -1.0) 1.0)) 2.0))))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = (pow(eps, -1.0) - (fma(x, eps, x) - 1.0)) / 2.0;
} else if (x <= 0.0019) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = ((pow(eps, -1.0) + 1.0) - (pow(eps, -1.0) - 1.0)) / 2.0;
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64((eps ^ -1.0) - Float64(fma(x, eps, x) - 1.0)) / 2.0); elseif (x <= 0.0019) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(Float64(Float64((eps ^ -1.0) + 1.0) - Float64((eps ^ -1.0) - 1.0)) / 2.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[Power[eps, -1.0], $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 0.0019], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[(N[(N[Power[eps, -1.0], $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{{\varepsilon}^{-1} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{elif}\;x \leq 0.0019:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left({\varepsilon}^{-1} + 1\right) - \left({\varepsilon}^{-1} - 1\right)}{2}\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites19.0%
if -3e3 < x < 0.0019Initial program 62.7%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.5%
Taylor expanded in x around 0
Applied rewrites67.5%
if 0.0019 < x Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f6421.9
Applied rewrites21.9%
Taylor expanded in x around 0
lower--.f64N/A
lower-/.f6461.3
Applied rewrites61.3%
Final simplification59.3%
(FPCore (x eps)
:precision binary64
(if (<= x -122.0)
(/ (- (/ (+ 1.0 eps) eps) (/ -1.0 (exp x))) 2.0)
(if (<= x 1.55)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ x (exp x)))))
double code(double x, double eps) {
double tmp;
if (x <= -122.0) {
tmp = (((1.0 + eps) / eps) - (-1.0 / exp(x))) / 2.0;
} else if (x <= 1.55) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = x / exp(x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -122.0) tmp = Float64(Float64(Float64(Float64(1.0 + eps) / eps) - Float64(-1.0 / exp(x))) / 2.0); elseif (x <= 1.55) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(x / exp(x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -122.0], N[(N[(N[(N[(1.0 + eps), $MachinePrecision] / eps), $MachinePrecision] - N[(-1.0 / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -122:\\
\;\;\;\;\frac{\frac{1 + \varepsilon}{\varepsilon} - \frac{-1}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{x}}\\
\end{array}
\end{array}
if x < -122Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites57.2%
Taylor expanded in x around 0
*-inversesN/A
div-addN/A
+-commutativeN/A
lower-/.f64N/A
lower-+.f6418.4
Applied rewrites18.4%
Taylor expanded in eps around 0
Applied rewrites100.0%
if -122 < x < 1.55000000000000004Initial program 62.7%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.5%
Taylor expanded in x around 0
Applied rewrites67.5%
if 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in x around inf
Applied rewrites63.1%
(FPCore (x eps)
:precision binary64
(if (<= x -3000.0)
(/ (- (/ (exp (- x)) eps) -1.0) 2.0)
(if (<= x 1.55)
(fma (- (* (fma -0.125 x 0.3333333333333333) x) 0.5) (* x x) 1.0)
(/ x (exp x)))))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = ((exp(-x) / eps) - -1.0) / 2.0;
} else if (x <= 1.55) {
tmp = fma(((fma(-0.125, x, 0.3333333333333333) * x) - 0.5), (x * x), 1.0);
} else {
tmp = x / exp(x);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64(Float64(exp(Float64(-x)) / eps) - -1.0) / 2.0); elseif (x <= 1.55) tmp = fma(Float64(Float64(fma(-0.125, x, 0.3333333333333333) * x) - 0.5), Float64(x * x), 1.0); else tmp = Float64(x / exp(x)); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[(N[Exp[(-x)], $MachinePrecision] / eps), $MachinePrecision] - -1.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[(N[(N[(-0.125 * x + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision], N[(x / N[Exp[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{\frac{e^{-x}}{\varepsilon} - -1}{2}\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.125, x, 0.3333333333333333\right) \cdot x - 0.5, x \cdot x, 1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{e^{x}}\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites40.0%
if -3e3 < x < 1.55000000000000004Initial program 62.9%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around 0
Applied rewrites67.1%
if 1.55000000000000004 < x Initial program 100.0%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in x around inf
Applied rewrites63.1%
(FPCore (x eps) :precision binary64 (if (<= x -3000.0) (/ (- (pow eps -1.0) (- (fma x eps x) 1.0)) 2.0) (fma (- (* 0.3333333333333333 x) 0.5) (* x x) 1.0)))
double code(double x, double eps) {
double tmp;
if (x <= -3000.0) {
tmp = (pow(eps, -1.0) - (fma(x, eps, x) - 1.0)) / 2.0;
} else {
tmp = fma(((0.3333333333333333 * x) - 0.5), (x * x), 1.0);
}
return tmp;
}
function code(x, eps) tmp = 0.0 if (x <= -3000.0) tmp = Float64(Float64((eps ^ -1.0) - Float64(fma(x, eps, x) - 1.0)) / 2.0); else tmp = fma(Float64(Float64(0.3333333333333333 * x) - 0.5), Float64(x * x), 1.0); end return tmp end
code[x_, eps_] := If[LessEqual[x, -3000.0], N[(N[(N[Power[eps, -1.0], $MachinePrecision] - N[(N[(x * eps + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(0.3333333333333333 * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3000:\\
\;\;\;\;\frac{{\varepsilon}^{-1} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)\\
\end{array}
\end{array}
if x < -3e3Initial program 100.0%
Taylor expanded in eps around inf
exp-negN/A
associate-*r/N/A
metadata-evalN/A
lower-/.f64N/A
lower-exp.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
Applied rewrites56.0%
Taylor expanded in eps around 0
lower-/.f64N/A
lower-exp.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in x around 0
Applied rewrites19.0%
if -3e3 < x Initial program 73.6%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.9%
Taylor expanded in x around 0
Applied rewrites53.6%
Final simplification48.9%
(FPCore (x eps) :precision binary64 (fma (- (* 0.3333333333333333 x) 0.5) (* x x) 1.0))
double code(double x, double eps) {
return fma(((0.3333333333333333 * x) - 0.5), (x * x), 1.0);
}
function code(x, eps) return fma(Float64(Float64(0.3333333333333333 * x) - 0.5), Float64(x * x), 1.0) end
code[x_, eps_] := N[(N[(N[(0.3333333333333333 * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)
\end{array}
Initial program 77.2%
Taylor expanded in eps around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites46.3%
(FPCore (x eps) :precision binary64 1.0)
double code(double x, double eps) {
return 1.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 1.0d0
end function
public static double code(double x, double eps) {
return 1.0;
}
def code(x, eps): return 1.0
function code(x, eps) return 1.0 end
function tmp = code(x, eps) tmp = 1.0; end
code[x_, eps_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 77.2%
Taylor expanded in x around 0
Applied rewrites41.9%
herbie shell --seed 2024337
(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))