
(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 9 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
(let* ((t_0 (* x (+ 1.0 eps_m))))
(/
(+
(exp (* x (+ -1.0 eps_m)))
(pow (pow (exp -1.0) (cbrt (* t_0 t_0))) (cbrt (* x eps_m))))
2.0)))eps_m = fabs(eps);
double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
return (exp((x * (-1.0 + eps_m))) + pow(pow(exp(-1.0), cbrt((t_0 * t_0))), cbrt((x * eps_m)))) / 2.0;
}
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
double t_0 = x * (1.0 + eps_m);
return (Math.exp((x * (-1.0 + eps_m))) + Math.pow(Math.pow(Math.exp(-1.0), Math.cbrt((t_0 * t_0))), Math.cbrt((x * eps_m)))) / 2.0;
}
eps_m = abs(eps) function code(x, eps_m) t_0 = Float64(x * Float64(1.0 + eps_m)) return Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + ((exp(-1.0) ^ cbrt(Float64(t_0 * t_0))) ^ cbrt(Float64(x * eps_m)))) / 2.0) end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Power[N[Power[N[Exp[-1.0], $MachinePrecision], N[Power[N[(t$95$0 * t$95$0), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision], N[Power[N[(x * eps$95$m), $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\begin{array}{l}
t_0 := x \cdot \left(1 + eps\_m\right)\\
\frac{e^{x \cdot \left(-1 + eps\_m\right)} + {\left({\left(e^{-1}\right)}^{\left(\sqrt[3]{t\_0 \cdot t\_0}\right)}\right)}^{\left(\sqrt[3]{x \cdot eps\_m}\right)}}{2}
\end{array}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in eps around inf 97.8%
exp-prod97.8%
add-cube-cbrt97.8%
pow-unpow97.8%
cbrt-unprod97.8%
pow297.8%
Applied egg-rr97.8%
unpow297.8%
Applied egg-rr97.8%
Taylor expanded in eps around inf 89.7%
*-commutative89.7%
Simplified89.7%
Final simplification89.7%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (pow (exp -1.0) (* x (- 1.0 eps_m))) (exp (* x (- -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (pow(exp(-1.0), (x * (1.0 - eps_m))) + exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = ((exp((-1.0d0)) ** (x * (1.0d0 - eps_m))) + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.pow(Math.exp(-1.0), (x * (1.0 - eps_m))) + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.pow(math.exp(-1.0), (x * (1.0 - eps_m))) + math.exp((x * (-1.0 - eps_m)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64((exp(-1.0) ^ Float64(x * Float64(1.0 - eps_m))) + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = ((exp(-1.0) ^ (x * (1.0 - eps_m))) + exp((x * (-1.0 - eps_m)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Power[N[Exp[-1.0], $MachinePrecision], N[(x * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{{\left(e^{-1}\right)}^{\left(x \cdot \left(1 - eps\_m\right)\right)} + e^{x \cdot \left(-1 - eps\_m\right)}}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in eps around inf 97.8%
exp-prod97.8%
Applied egg-rr97.8%
Final simplification97.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (+ -1.0 eps_m))) (exp (* x (- -1.0 eps_m)))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (-1.0 + eps_m))) + exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (exp((x * ((-1.0d0) + eps_m))) + exp((x * ((-1.0d0) - eps_m)))) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((x * (-1.0 + eps_m))) + Math.exp((x * (-1.0 - eps_m)))) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (-1.0 + eps_m))) + math.exp((x * (-1.0 - eps_m)))) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(x * Float64(-1.0 - eps_m)))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (-1.0 + eps_m))) + exp((x * (-1.0 - eps_m)))) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{x \cdot \left(-1 - eps\_m\right)}}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in eps around inf 97.8%
Final simplification97.8%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (exp (* x (+ -1.0 eps_m))) (exp (- x))) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (exp((x * (-1.0 + eps_m))) + exp(-x)) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (exp((x * ((-1.0d0) + eps_m))) + exp(-x)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (Math.exp((x * (-1.0 + eps_m))) + Math.exp(-x)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (math.exp((x * (-1.0 + eps_m))) + math.exp(-x)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(-x))) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (exp((x * (-1.0 + eps_m))) + exp(-x)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[(-x)], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{-x}}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in eps around inf 97.8%
Taylor expanded in eps around 0 82.1%
neg-mul-182.1%
Simplified82.1%
Final simplification82.1%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (- (- 1.0 x) (* eps_m (* x -2.0))) (+ x 1.0)) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (((1.0 - x) - (eps_m * (x * -2.0))) + (x + 1.0)) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (((1.0d0 - x) - (eps_m * (x * (-2.0d0)))) + (x + 1.0d0)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (((1.0 - x) - (eps_m * (x * -2.0))) + (x + 1.0)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (((1.0 - x) - (eps_m * (x * -2.0))) + (x + 1.0)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(Float64(Float64(1.0 - x) - Float64(eps_m * Float64(x * -2.0))) + Float64(x + 1.0)) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (((1.0 - x) - (eps_m * (x * -2.0))) + (x + 1.0)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[(N[(1.0 - x), $MachinePrecision] - N[(eps$95$m * N[(x * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{\left(\left(1 - x\right) - eps\_m \cdot \left(x \cdot -2\right)\right) + \left(x + 1\right)}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in x around 0 26.5%
add-sqr-sqrt13.4%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod12.6%
add-sqr-sqrt25.1%
distribute-lft-neg-in25.1%
Applied egg-rr25.1%
Taylor expanded in eps around -inf 60.9%
sub-neg60.9%
associate-+r+60.9%
mul-1-neg60.9%
unsub-neg60.9%
mul-1-neg60.9%
unsub-neg60.9%
*-lft-identity60.9%
distribute-rgt-out--60.9%
metadata-eval60.9%
mul-1-neg60.9%
remove-double-neg60.9%
+-commutative60.9%
Simplified60.9%
Final simplification60.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (+ (- 1.0 x) (+ x 1.0)) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return ((1.0 - x) + (x + 1.0)) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = ((1.0d0 - x) + (x + 1.0d0)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return ((1.0 - x) + (x + 1.0)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return ((1.0 - x) + (x + 1.0)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(Float64(1.0 - x) + Float64(x + 1.0)) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = ((1.0 - x) + (x + 1.0)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(N[(1.0 - x), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{\left(1 - x\right) + \left(x + 1\right)}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in x around 0 26.5%
Taylor expanded in eps around 0 56.2%
sub-neg56.2%
+-commutative56.2%
mul-1-neg56.2%
remove-double-neg56.2%
neg-mul-156.2%
unsub-neg56.2%
Simplified56.2%
Final simplification56.2%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* eps_m (+ x x)) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (eps_m * (x + x)) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (eps_m * (x + x)) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (eps_m * (x + x)) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (eps_m * (x + x)) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(eps_m * Float64(x + x)) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (eps_m * (x + x)) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(eps$95$m * N[(x + x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{eps\_m \cdot \left(x + x\right)}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in x around 0 26.5%
add-sqr-sqrt13.4%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod12.6%
add-sqr-sqrt25.1%
distribute-lft-neg-in25.1%
Applied egg-rr25.1%
Taylor expanded in eps around inf 8.9%
cancel-sign-sub-inv8.9%
metadata-eval8.9%
*-lft-identity8.9%
Simplified8.9%
Final simplification8.9%
eps_m = (fabs.f64 eps) (FPCore (x eps_m) :precision binary64 (/ (* x eps_m) 2.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
return (x * eps_m) / 2.0;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
real(8), intent (in) :: x
real(8), intent (in) :: eps_m
code = (x * eps_m) / 2.0d0
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
return (x * eps_m) / 2.0;
}
eps_m = math.fabs(eps) def code(x, eps_m): return (x * eps_m) / 2.0
eps_m = abs(eps) function code(x, eps_m) return Float64(Float64(x * eps_m) / 2.0) end
eps_m = abs(eps); function tmp = code(x, eps_m) tmp = (x * eps_m) / 2.0; end
eps_m = N[Abs[eps], $MachinePrecision] code[x_, eps$95$m_] := N[(N[(x * eps$95$m), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|
\\
\frac{x \cdot eps\_m}{2}
\end{array}
Initial program 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in x around 0 40.6%
Taylor expanded in x around inf 8.8%
mul-1-neg8.8%
*-commutative8.8%
associate-*l*8.8%
distribute-rgt-neg-in8.8%
distribute-neg-in8.8%
metadata-eval8.8%
distribute-neg-frac8.8%
metadata-eval8.8%
Simplified8.8%
Taylor expanded in eps around inf 8.9%
*-commutative8.9%
Simplified8.9%
Final simplification8.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 76.5%
fma-neg76.5%
/-rgt-identity76.5%
fma-neg76.5%
/-rgt-identity76.5%
distribute-rgt-neg-in76.5%
sub-neg76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
Taylor expanded in x around 0 41.5%
Final simplification41.5%
herbie shell --seed 2024033
(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))