
(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 (/ (+ (/ 1.0 (exp (* x (+ 1.0 eps)))) (exp (* x (+ eps -1.0)))) 2.0))
double code(double x, double eps) {
return ((1.0 / exp((x * (1.0 + eps)))) + exp((x * (eps + -1.0)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = ((1.0d0 / exp((x * (1.0d0 + eps)))) + exp((x * (eps + (-1.0d0))))) / 2.0d0
end function
public static double code(double x, double eps) {
return ((1.0 / Math.exp((x * (1.0 + eps)))) + Math.exp((x * (eps + -1.0)))) / 2.0;
}
def code(x, eps): return ((1.0 / math.exp((x * (1.0 + eps)))) + math.exp((x * (eps + -1.0)))) / 2.0
function code(x, eps) return Float64(Float64(Float64(1.0 / exp(Float64(x * Float64(1.0 + eps)))) + exp(Float64(x * Float64(eps + -1.0)))) / 2.0) end
function tmp = code(x, eps) tmp = ((1.0 / exp((x * (1.0 + eps)))) + exp((x * (eps + -1.0)))) / 2.0; end
code[x_, eps_] := N[(N[(N[(1.0 / N[Exp[N[(x * N[(1.0 + eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{e^{x \cdot \left(1 + \varepsilon\right)}} + e^{x \cdot \left(\varepsilon + -1\right)}}{2}
\end{array}
Initial program 77.7%
Simplified65.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
exp-neg100.0%
exp-prod92.6%
add-sqr-sqrt53.6%
sqrt-unprod83.7%
sqr-neg83.7%
sqrt-unprod30.2%
add-sqr-sqrt60.7%
neg-mul-160.7%
exp-to-pow60.7%
add-log-exp60.6%
neg-mul-160.6%
add-sqr-sqrt30.1%
sqrt-unprod87.5%
sqr-neg87.5%
sqrt-unprod58.6%
add-sqr-sqrt100.0%
+-commutative100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x eps) :precision binary64 (let* ((t_0 (exp (* x eps)))) (if (<= x 1.7e+202) (/ (+ t_0 (/ 1.0 t_0)) 2.0) 0.0)))
double code(double x, double eps) {
double t_0 = exp((x * eps));
double tmp;
if (x <= 1.7e+202) {
tmp = (t_0 + (1.0 / t_0)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = exp((x * eps))
if (x <= 1.7d+202) then
tmp = (t_0 + (1.0d0 / t_0)) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = Math.exp((x * eps));
double tmp;
if (x <= 1.7e+202) {
tmp = (t_0 + (1.0 / t_0)) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): t_0 = math.exp((x * eps)) tmp = 0 if x <= 1.7e+202: tmp = (t_0 + (1.0 / t_0)) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) t_0 = exp(Float64(x * eps)) tmp = 0.0 if (x <= 1.7e+202) tmp = Float64(Float64(t_0 + Float64(1.0 / t_0)) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) t_0 = exp((x * eps)); tmp = 0.0; if (x <= 1.7e+202) tmp = (t_0 + (1.0 / t_0)) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[Exp[N[(x * eps), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.7e+202], N[(N[(t$95$0 + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{x \cdot \varepsilon}\\
\mathbf{if}\;x \leq 1.7 \cdot 10^{+202}:\\
\;\;\;\;\frac{t\_0 + \frac{1}{t\_0}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 1.7e202Initial program 75.8%
Simplified62.1%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
exp-neg100.0%
exp-prod92.0%
add-sqr-sqrt49.6%
sqrt-unprod82.4%
sqr-neg82.4%
sqrt-unprod32.7%
add-sqr-sqrt64.9%
neg-mul-164.9%
exp-to-pow64.9%
add-log-exp64.7%
neg-mul-164.7%
add-sqr-sqrt32.7%
sqrt-unprod86.4%
sqr-neg86.4%
sqrt-unprod55.0%
add-sqr-sqrt100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in eps around inf 91.7%
*-commutative91.7%
Simplified91.7%
if 1.7e202 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification90.1%
(FPCore (x eps) :precision binary64 (/ (+ (exp (* x (+ eps -1.0))) (exp (* x (- -1.0 eps)))) 2.0))
double code(double x, double eps) {
return (exp((x * (eps + -1.0))) + exp((x * (-1.0 - eps)))) / 2.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = (exp((x * (eps + (-1.0d0)))) + exp((x * ((-1.0d0) - eps)))) / 2.0d0
end function
public static double code(double x, double eps) {
return (Math.exp((x * (eps + -1.0))) + Math.exp((x * (-1.0 - eps)))) / 2.0;
}
def code(x, eps): return (math.exp((x * (eps + -1.0))) + math.exp((x * (-1.0 - eps)))) / 2.0
function code(x, eps) return Float64(Float64(exp(Float64(x * Float64(eps + -1.0))) + exp(Float64(x * Float64(-1.0 - eps)))) / 2.0) end
function tmp = code(x, eps) tmp = (exp((x * (eps + -1.0))) + exp((x * (-1.0 - eps)))) / 2.0; end
code[x_, eps_] := N[(N[(N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{x \cdot \left(\varepsilon + -1\right)} + e^{x \cdot \left(-1 - \varepsilon\right)}}{2}
\end{array}
Initial program 77.7%
Simplified65.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in eps around 0 100.0%
associate-*r*100.0%
distribute-rgt-in100.0%
mul-1-neg100.0%
unsub-neg100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x eps)
:precision binary64
(if (<= x -1.35)
(/ (/ 0.5 (exp x)) 2.0)
(if (<= x 2.4e-75)
1.0
(if (<= x 720.0)
(/
(+
2.0
(* x (* (/ (- 1.0 (* eps eps)) (+ 1.0 eps)) (+ -1.0 (/ -1.0 eps)))))
2.0)
(if (<= x 4e+202) (/ (expm1 x) 2.0) 0.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -1.35) {
tmp = (0.5 / exp(x)) / 2.0;
} else if (x <= 2.4e-75) {
tmp = 1.0;
} else if (x <= 720.0) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 4e+202) {
tmp = expm1(x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -1.35) {
tmp = (0.5 / Math.exp(x)) / 2.0;
} else if (x <= 2.4e-75) {
tmp = 1.0;
} else if (x <= 720.0) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 4e+202) {
tmp = Math.expm1(x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -1.35: tmp = (0.5 / math.exp(x)) / 2.0 elif x <= 2.4e-75: tmp = 1.0 elif x <= 720.0: tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0 elif x <= 4e+202: tmp = math.expm1(x) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -1.35) tmp = Float64(Float64(0.5 / exp(x)) / 2.0); elseif (x <= 2.4e-75) tmp = 1.0; elseif (x <= 720.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(1.0 - Float64(eps * eps)) / Float64(1.0 + eps)) * Float64(-1.0 + Float64(-1.0 / eps))))) / 2.0); elseif (x <= 4e+202) tmp = Float64(expm1(x) / 2.0); else tmp = 0.0; end return tmp end
code[x_, eps_] := If[LessEqual[x, -1.35], N[(N[(0.5 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.4e-75], 1.0, If[LessEqual[x, 720.0], N[(N[(2.0 + N[(x * N[(N[(N[(1.0 - N[(eps * eps), $MachinePrecision]), $MachinePrecision] / N[(1.0 + eps), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4e+202], N[(N[(Exp[x] - 1), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35:\\
\;\;\;\;\frac{\frac{0.5}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-75}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 720:\\
\;\;\;\;\frac{2 + x \cdot \left(\frac{1 - \varepsilon \cdot \varepsilon}{1 + \varepsilon} \cdot \left(-1 + \frac{-1}{\varepsilon}\right)\right)}{2}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+202}:\\
\;\;\;\;\frac{\mathsf{expm1}\left(x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -1.3500000000000001Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
exp-neg100.0%
exp-prod100.0%
add-sqr-sqrt0.0%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod51.9%
add-sqr-sqrt51.9%
neg-mul-151.9%
exp-to-pow51.9%
add-log-exp51.9%
neg-mul-151.9%
add-sqr-sqrt51.9%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr100.0%
unpow-1100.0%
count-2100.0%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
if -1.3500000000000001 < x < 2.40000000000000019e-75Initial program 54.2%
Simplified54.2%
Taylor expanded in x around 0 82.5%
if 2.40000000000000019e-75 < x < 720Initial program 73.9%
Simplified73.9%
Taylor expanded in x around 0 40.7%
Taylor expanded in x around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
*-commutative21.4%
distribute-rgt-neg-in21.4%
distribute-neg-in21.4%
metadata-eval21.4%
distribute-neg-frac21.4%
metadata-eval21.4%
Simplified21.4%
sub-neg21.4%
flip-+39.5%
metadata-eval39.5%
Applied egg-rr39.5%
if 720 < x < 3.9999999999999996e202Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 29.5%
Taylor expanded in eps around inf 29.4%
*-commutative71.7%
Simplified29.4%
Applied egg-rr0.0%
+-commutative0.0%
associate--l+0.0%
+-inverses64.2%
metadata-eval64.2%
metadata-eval64.2%
*-rgt-identity64.2%
metadata-eval64.2%
sub-neg64.2%
expm1-undefine64.2%
Simplified64.2%
if 3.9999999999999996e202 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification76.3%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (* (+ x -8.0) (+ -8.0 (* x 2.0)))) 2.0)
(if (<= x 2.15e-75)
1.0
(if (<= x 41.0)
(/
(+
2.0
(* x (* (/ (- 1.0 (* eps eps)) (+ 1.0 eps)) (+ -1.0 (/ -1.0 eps)))))
2.0)
(if (<= x 1.65e+205) (/ (expm1 x) 2.0) 0.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 2.15e-75) {
tmp = 1.0;
} else if (x <= 41.0) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 1.65e+205) {
tmp = expm1(x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 2.15e-75) {
tmp = 1.0;
} else if (x <= 41.0) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 1.65e+205) {
tmp = Math.expm1(x) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0 elif x <= 2.15e-75: tmp = 1.0 elif x <= 41.0: tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0 elif x <= 1.65e+205: tmp = math.expm1(x) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(-8.0 + Float64(x * 2.0)))) / 2.0); elseif (x <= 2.15e-75) tmp = 1.0; elseif (x <= 41.0) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(1.0 - Float64(eps * eps)) / Float64(1.0 + eps)) * Float64(-1.0 + Float64(-1.0 / eps))))) / 2.0); elseif (x <= 1.65e+205) tmp = Float64(expm1(x) / 2.0); else tmp = 0.0; end return tmp end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(-8.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 2.15e-75], 1.0, If[LessEqual[x, 41.0], N[(N[(2.0 + N[(x * N[(N[(N[(1.0 - N[(eps * eps), $MachinePrecision]), $MachinePrecision] / N[(1.0 + eps), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.65e+205], N[(N[(Exp[x] - 1), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(-8 + x \cdot 2\right)\right)}{2}\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-75}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 41:\\
\;\;\;\;\frac{2 + x \cdot \left(\frac{1 - \varepsilon \cdot \varepsilon}{1 + \varepsilon} \cdot \left(-1 + \frac{-1}{\varepsilon}\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+205}:\\
\;\;\;\;\frac{\mathsf{expm1}\left(x\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
*-commutative23.6%
distribute-rgt-neg-in23.6%
distribute-neg-in23.6%
metadata-eval23.6%
distribute-neg-frac23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in eps around inf 23.6%
associate-*r/23.6%
metadata-eval23.6%
Simplified23.6%
Applied egg-rr39.9%
*-commutative39.9%
associate-+r+39.9%
count-239.9%
Simplified39.9%
if -2.70000000000000005e-11 < x < 2.15e-75Initial program 53.8%
Simplified53.8%
Taylor expanded in x around 0 83.2%
if 2.15e-75 < x < 41Initial program 73.9%
Simplified73.9%
Taylor expanded in x around 0 40.7%
Taylor expanded in x around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
*-commutative21.4%
distribute-rgt-neg-in21.4%
distribute-neg-in21.4%
metadata-eval21.4%
distribute-neg-frac21.4%
metadata-eval21.4%
Simplified21.4%
sub-neg21.4%
flip-+39.5%
metadata-eval39.5%
Applied egg-rr39.5%
if 41 < x < 1.6500000000000001e205Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 29.5%
Taylor expanded in eps around inf 29.4%
*-commutative71.7%
Simplified29.4%
Applied egg-rr0.0%
+-commutative0.0%
associate--l+0.0%
+-inverses64.2%
metadata-eval64.2%
metadata-eval64.2%
*-rgt-identity64.2%
metadata-eval64.2%
sub-neg64.2%
expm1-undefine64.2%
Simplified64.2%
if 1.6500000000000001e205 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification65.9%
(FPCore (x eps) :precision binary64 (if (<= x -5.8e-245) (/ (+ (exp (* x (- -1.0 eps))) (- 1.0 x)) 2.0) (if (<= x 1.65e+205) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0) 0.0)))
double code(double x, double eps) {
double tmp;
if (x <= -5.8e-245) {
tmp = (exp((x * (-1.0 - eps))) + (1.0 - x)) / 2.0;
} else if (x <= 1.65e+205) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-5.8d-245)) then
tmp = (exp((x * ((-1.0d0) - eps))) + (1.0d0 - x)) / 2.0d0
else if (x <= 1.65d+205) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -5.8e-245) {
tmp = (Math.exp((x * (-1.0 - eps))) + (1.0 - x)) / 2.0;
} else if (x <= 1.65e+205) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -5.8e-245: tmp = (math.exp((x * (-1.0 - eps))) + (1.0 - x)) / 2.0 elif x <= 1.65e+205: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -5.8e-245) tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 - eps))) + Float64(1.0 - x)) / 2.0); elseif (x <= 1.65e+205) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -5.8e-245) tmp = (exp((x * (-1.0 - eps))) + (1.0 - x)) / 2.0; elseif (x <= 1.65e+205) tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -5.8e-245], N[(N[(N[Exp[N[(x * N[(-1.0 - eps), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.65e+205], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-245}:\\
\;\;\;\;\frac{e^{x \cdot \left(-1 - \varepsilon\right)} + \left(1 - x\right)}{2}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+205}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -5.7999999999999999e-245Initial program 75.5%
Simplified62.4%
Taylor expanded in eps around inf 100.0%
Taylor expanded in x around 0 66.6%
Taylor expanded in eps around 0 70.5%
neg-mul-170.5%
unsub-neg70.5%
Simplified70.5%
if -5.7999999999999999e-245 < x < 1.6500000000000001e205Initial program 76.0%
Simplified61.8%
Taylor expanded in eps around inf 99.9%
Taylor expanded in x around 0 62.0%
if 1.6500000000000001e205 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification65.8%
(FPCore (x eps) :precision binary64 (if (<= x -0.55) (/ (/ 0.5 (exp x)) 2.0) (if (<= x 1.05e+205) (/ (+ 1.0 (exp (* x (+ eps -1.0)))) 2.0) 0.0)))
double code(double x, double eps) {
double tmp;
if (x <= -0.55) {
tmp = (0.5 / exp(x)) / 2.0;
} else if (x <= 1.05e+205) {
tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-0.55d0)) then
tmp = (0.5d0 / exp(x)) / 2.0d0
else if (x <= 1.05d+205) then
tmp = (1.0d0 + exp((x * (eps + (-1.0d0))))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -0.55) {
tmp = (0.5 / Math.exp(x)) / 2.0;
} else if (x <= 1.05e+205) {
tmp = (1.0 + Math.exp((x * (eps + -1.0)))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -0.55: tmp = (0.5 / math.exp(x)) / 2.0 elif x <= 1.05e+205: tmp = (1.0 + math.exp((x * (eps + -1.0)))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -0.55) tmp = Float64(Float64(0.5 / exp(x)) / 2.0); elseif (x <= 1.05e+205) tmp = Float64(Float64(1.0 + exp(Float64(x * Float64(eps + -1.0)))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -0.55) tmp = (0.5 / exp(x)) / 2.0; elseif (x <= 1.05e+205) tmp = (1.0 + exp((x * (eps + -1.0)))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -0.55], N[(N[(0.5 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.05e+205], N[(N[(1.0 + N[Exp[N[(x * N[(eps + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.55:\\
\;\;\;\;\frac{\frac{0.5}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+205}:\\
\;\;\;\;\frac{1 + e^{x \cdot \left(\varepsilon + -1\right)}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.55000000000000004Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
exp-neg100.0%
exp-prod100.0%
add-sqr-sqrt0.0%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod51.9%
add-sqr-sqrt51.9%
neg-mul-151.9%
exp-to-pow51.9%
add-log-exp51.9%
neg-mul-151.9%
add-sqr-sqrt51.9%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr100.0%
unpow-1100.0%
count-2100.0%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
if -0.55000000000000004 < x < 1.05e205Initial program 70.1%
Simplified53.1%
Taylor expanded in eps around inf 99.9%
Taylor expanded in x around 0 68.3%
if 1.05e205 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification74.0%
(FPCore (x eps) :precision binary64 (if (<= x -0.6) (/ (/ 0.5 (exp x)) 2.0) (if (<= x 1.6e+205) (/ (+ 1.0 (exp (* x eps))) 2.0) 0.0)))
double code(double x, double eps) {
double tmp;
if (x <= -0.6) {
tmp = (0.5 / exp(x)) / 2.0;
} else if (x <= 1.6e+205) {
tmp = (1.0 + exp((x * eps))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-0.6d0)) then
tmp = (0.5d0 / exp(x)) / 2.0d0
else if (x <= 1.6d+205) then
tmp = (1.0d0 + exp((x * eps))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -0.6) {
tmp = (0.5 / Math.exp(x)) / 2.0;
} else if (x <= 1.6e+205) {
tmp = (1.0 + Math.exp((x * eps))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -0.6: tmp = (0.5 / math.exp(x)) / 2.0 elif x <= 1.6e+205: tmp = (1.0 + math.exp((x * eps))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -0.6) tmp = Float64(Float64(0.5 / exp(x)) / 2.0); elseif (x <= 1.6e+205) tmp = Float64(Float64(1.0 + exp(Float64(x * eps))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -0.6) tmp = (0.5 / exp(x)) / 2.0; elseif (x <= 1.6e+205) tmp = (1.0 + exp((x * eps))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -0.6], N[(N[(0.5 / N[Exp[x], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.6e+205], N[(N[(1.0 + N[Exp[N[(x * eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.6:\\
\;\;\;\;\frac{\frac{0.5}{e^{x}}}{2}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+205}:\\
\;\;\;\;\frac{1 + e^{x \cdot \varepsilon}}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -0.599999999999999978Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around inf 100.0%
mul-1-neg100.0%
exp-neg100.0%
exp-prod100.0%
add-sqr-sqrt0.0%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod51.9%
add-sqr-sqrt51.9%
neg-mul-151.9%
exp-to-pow51.9%
add-log-exp51.9%
neg-mul-151.9%
add-sqr-sqrt51.9%
sqrt-unprod51.9%
sqr-neg51.9%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
+-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in eps around inf 100.0%
*-commutative100.0%
Simplified100.0%
Applied egg-rr100.0%
unpow-1100.0%
count-2100.0%
associate-/r*100.0%
metadata-eval100.0%
Simplified100.0%
if -0.599999999999999978 < x < 1.59999999999999998e205Initial program 70.1%
Simplified53.1%
Taylor expanded in eps around inf 99.9%
Taylor expanded in x around 0 68.3%
Taylor expanded in eps around inf 68.3%
*-commutative91.8%
Simplified68.3%
if 1.59999999999999998e205 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 70.5%
Taylor expanded in x around 0 70.5%
Taylor expanded in eps around 0 70.5%
Final simplification74.0%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (* (+ x -8.0) (+ -8.0 (* x 2.0)))) 2.0)
(if (<= x 3.5e-75)
1.0
(if (<= x 1.3e+45)
(/
(+
2.0
(* x (* (/ (- 1.0 (* eps eps)) (+ 1.0 eps)) (+ -1.0 (/ -1.0 eps)))))
2.0)
(if (<= x 1.4e+117)
0.0
(if (<= x 1.4e+202)
(/ (* eps (* (+ x -8.0) (+ x -8.0))) 2.0)
0.0))))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 3.5e-75) {
tmp = 1.0;
} else if (x <= 1.3e+45) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 1.4e+117) {
tmp = 0.0;
} else if (x <= 1.4e+202) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.7d-11)) then
tmp = (eps * ((x + (-8.0d0)) * ((-8.0d0) + (x * 2.0d0)))) / 2.0d0
else if (x <= 3.5d-75) then
tmp = 1.0d0
else if (x <= 1.3d+45) then
tmp = (2.0d0 + (x * (((1.0d0 - (eps * eps)) / (1.0d0 + eps)) * ((-1.0d0) + ((-1.0d0) / eps))))) / 2.0d0
else if (x <= 1.4d+117) then
tmp = 0.0d0
else if (x <= 1.4d+202) then
tmp = (eps * ((x + (-8.0d0)) * (x + (-8.0d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 3.5e-75) {
tmp = 1.0;
} else if (x <= 1.3e+45) {
tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0;
} else if (x <= 1.4e+117) {
tmp = 0.0;
} else if (x <= 1.4e+202) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0 elif x <= 3.5e-75: tmp = 1.0 elif x <= 1.3e+45: tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0 elif x <= 1.4e+117: tmp = 0.0 elif x <= 1.4e+202: tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(-8.0 + Float64(x * 2.0)))) / 2.0); elseif (x <= 3.5e-75) tmp = 1.0; elseif (x <= 1.3e+45) tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(1.0 - Float64(eps * eps)) / Float64(1.0 + eps)) * Float64(-1.0 + Float64(-1.0 / eps))))) / 2.0); elseif (x <= 1.4e+117) tmp = 0.0; elseif (x <= 1.4e+202) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(x + -8.0))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.7e-11) tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0; elseif (x <= 3.5e-75) tmp = 1.0; elseif (x <= 1.3e+45) tmp = (2.0 + (x * (((1.0 - (eps * eps)) / (1.0 + eps)) * (-1.0 + (-1.0 / eps))))) / 2.0; elseif (x <= 1.4e+117) tmp = 0.0; elseif (x <= 1.4e+202) tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(-8.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.5e-75], 1.0, If[LessEqual[x, 1.3e+45], N[(N[(2.0 + N[(x * N[(N[(N[(1.0 - N[(eps * eps), $MachinePrecision]), $MachinePrecision] / N[(1.0 + eps), $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(-1.0 / eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.4e+117], 0.0, If[LessEqual[x, 1.4e+202], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(x + -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(-8 + x \cdot 2\right)\right)}{2}\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-75}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+45}:\\
\;\;\;\;\frac{2 + x \cdot \left(\frac{1 - \varepsilon \cdot \varepsilon}{1 + \varepsilon} \cdot \left(-1 + \frac{-1}{\varepsilon}\right)\right)}{2}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+117}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+202}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(x + -8\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
*-commutative23.6%
distribute-rgt-neg-in23.6%
distribute-neg-in23.6%
metadata-eval23.6%
distribute-neg-frac23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in eps around inf 23.6%
associate-*r/23.6%
metadata-eval23.6%
Simplified23.6%
Applied egg-rr39.9%
*-commutative39.9%
associate-+r+39.9%
count-239.9%
Simplified39.9%
if -2.70000000000000005e-11 < x < 3.49999999999999985e-75Initial program 53.8%
Simplified53.8%
Taylor expanded in x around 0 83.2%
if 3.49999999999999985e-75 < x < 1.30000000000000004e45Initial program 82.6%
Simplified82.6%
Taylor expanded in x around 0 40.5%
Taylor expanded in x around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
*-commutative20.0%
distribute-rgt-neg-in20.0%
distribute-neg-in20.0%
metadata-eval20.0%
distribute-neg-frac20.0%
metadata-eval20.0%
Simplified20.0%
sub-neg20.0%
flip-+36.9%
metadata-eval36.9%
Applied egg-rr36.9%
if 1.30000000000000004e45 < x < 1.39999999999999999e117 or 1.40000000000000008e202 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.9%
Taylor expanded in x around 0 71.9%
Taylor expanded in eps around 0 71.9%
if 1.39999999999999999e117 < x < 1.40000000000000008e202Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Applied egg-rr33.7%
Final simplification61.6%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (* (+ x -8.0) (+ -8.0 (* x 2.0)))) 2.0)
(if (<= x 3.8e-75)
1.0
(if (<= x 1.1e+45)
(/ (/ (- (* eps (+ 2.0 (* x eps))) x) eps) 2.0)
(if (<= x 4.8e+117)
0.0
(if (<= x 1.35e+205)
(/ (* eps (* (+ x -8.0) (+ x -8.0))) 2.0)
0.0))))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 3.8e-75) {
tmp = 1.0;
} else if (x <= 1.1e+45) {
tmp = (((eps * (2.0 + (x * eps))) - x) / eps) / 2.0;
} else if (x <= 4.8e+117) {
tmp = 0.0;
} else if (x <= 1.35e+205) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.7d-11)) then
tmp = (eps * ((x + (-8.0d0)) * ((-8.0d0) + (x * 2.0d0)))) / 2.0d0
else if (x <= 3.8d-75) then
tmp = 1.0d0
else if (x <= 1.1d+45) then
tmp = (((eps * (2.0d0 + (x * eps))) - x) / eps) / 2.0d0
else if (x <= 4.8d+117) then
tmp = 0.0d0
else if (x <= 1.35d+205) then
tmp = (eps * ((x + (-8.0d0)) * (x + (-8.0d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 3.8e-75) {
tmp = 1.0;
} else if (x <= 1.1e+45) {
tmp = (((eps * (2.0 + (x * eps))) - x) / eps) / 2.0;
} else if (x <= 4.8e+117) {
tmp = 0.0;
} else if (x <= 1.35e+205) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0 elif x <= 3.8e-75: tmp = 1.0 elif x <= 1.1e+45: tmp = (((eps * (2.0 + (x * eps))) - x) / eps) / 2.0 elif x <= 4.8e+117: tmp = 0.0 elif x <= 1.35e+205: tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(-8.0 + Float64(x * 2.0)))) / 2.0); elseif (x <= 3.8e-75) tmp = 1.0; elseif (x <= 1.1e+45) tmp = Float64(Float64(Float64(Float64(eps * Float64(2.0 + Float64(x * eps))) - x) / eps) / 2.0); elseif (x <= 4.8e+117) tmp = 0.0; elseif (x <= 1.35e+205) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(x + -8.0))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.7e-11) tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0; elseif (x <= 3.8e-75) tmp = 1.0; elseif (x <= 1.1e+45) tmp = (((eps * (2.0 + (x * eps))) - x) / eps) / 2.0; elseif (x <= 4.8e+117) tmp = 0.0; elseif (x <= 1.35e+205) tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(-8.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 3.8e-75], 1.0, If[LessEqual[x, 1.1e+45], N[(N[(N[(N[(eps * N[(2.0 + N[(x * eps), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / eps), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 4.8e+117], 0.0, If[LessEqual[x, 1.35e+205], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(x + -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(-8 + x \cdot 2\right)\right)}{2}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-75}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+45}:\\
\;\;\;\;\frac{\frac{\varepsilon \cdot \left(2 + x \cdot \varepsilon\right) - x}{\varepsilon}}{2}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+117}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+205}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(x + -8\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
*-commutative23.6%
distribute-rgt-neg-in23.6%
distribute-neg-in23.6%
metadata-eval23.6%
distribute-neg-frac23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in eps around inf 23.6%
associate-*r/23.6%
metadata-eval23.6%
Simplified23.6%
Applied egg-rr39.9%
*-commutative39.9%
associate-+r+39.9%
count-239.9%
Simplified39.9%
if -2.70000000000000005e-11 < x < 3.79999999999999994e-75Initial program 53.8%
Simplified53.8%
Taylor expanded in x around 0 83.2%
if 3.79999999999999994e-75 < x < 1.1e45Initial program 82.6%
Simplified82.6%
Taylor expanded in x around 0 40.5%
Taylor expanded in x around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
*-commutative20.0%
distribute-rgt-neg-in20.0%
distribute-neg-in20.0%
metadata-eval20.0%
distribute-neg-frac20.0%
metadata-eval20.0%
Simplified20.0%
Taylor expanded in eps around 0 34.5%
neg-mul-134.5%
+-commutative34.5%
unsub-neg34.5%
*-commutative34.5%
Simplified34.5%
if 1.1e45 < x < 4.7999999999999998e117 or 1.35000000000000006e205 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 71.9%
Taylor expanded in x around 0 71.9%
Taylor expanded in eps around 0 71.9%
if 4.7999999999999998e117 < x < 1.35000000000000006e205Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Applied egg-rr33.7%
Final simplification61.3%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (* (+ x -8.0) (+ -8.0 (* x 2.0)))) 2.0)
(if (<= x 105000.0)
1.0
(if (<= x 3.1e+118)
0.0
(if (<= x 4e+202) (/ (* eps (* (+ x -8.0) (+ x -8.0))) 2.0) 0.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 3.1e+118) {
tmp = 0.0;
} else if (x <= 4e+202) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.7d-11)) then
tmp = (eps * ((x + (-8.0d0)) * ((-8.0d0) + (x * 2.0d0)))) / 2.0d0
else if (x <= 105000.0d0) then
tmp = 1.0d0
else if (x <= 3.1d+118) then
tmp = 0.0d0
else if (x <= 4d+202) then
tmp = (eps * ((x + (-8.0d0)) * (x + (-8.0d0)))) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 3.1e+118) {
tmp = 0.0;
} else if (x <= 4e+202) {
tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0 elif x <= 105000.0: tmp = 1.0 elif x <= 3.1e+118: tmp = 0.0 elif x <= 4e+202: tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(-8.0 + Float64(x * 2.0)))) / 2.0); elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 3.1e+118) tmp = 0.0; elseif (x <= 4e+202) tmp = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(x + -8.0))) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.7e-11) tmp = (eps * ((x + -8.0) * (-8.0 + (x * 2.0)))) / 2.0; elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 3.1e+118) tmp = 0.0; elseif (x <= 4e+202) tmp = (eps * ((x + -8.0) * (x + -8.0))) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(-8.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 105000.0], 1.0, If[LessEqual[x, 3.1e+118], 0.0, If[LessEqual[x, 4e+202], N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(x + -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(-8 + x \cdot 2\right)\right)}{2}\\
\mathbf{elif}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+118}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+202}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(x + -8\right)\right)}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
*-commutative23.6%
distribute-rgt-neg-in23.6%
distribute-neg-in23.6%
metadata-eval23.6%
distribute-neg-frac23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in eps around inf 23.6%
associate-*r/23.6%
metadata-eval23.6%
Simplified23.6%
Applied egg-rr39.9%
*-commutative39.9%
associate-+r+39.9%
count-239.9%
Simplified39.9%
if -2.70000000000000005e-11 < x < 105000Initial program 58.3%
Simplified58.3%
Taylor expanded in x around 0 73.2%
if 105000 < x < 3.09999999999999986e118 or 3.9999999999999996e202 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.5%
Taylor expanded in x around 0 61.5%
Taylor expanded in eps around 0 61.5%
if 3.09999999999999986e118 < x < 3.9999999999999996e202Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Applied egg-rr33.7%
Final simplification61.0%
(FPCore (x eps)
:precision binary64
(let* ((t_0 (/ (* eps (* (+ x -8.0) (+ x -8.0))) 2.0)))
(if (<= x -2.7e-11)
t_0
(if (<= x 105000.0)
1.0
(if (<= x 8e+117) 0.0 (if (<= x 4e+202) t_0 0.0))))))
double code(double x, double eps) {
double t_0 = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
double tmp;
if (x <= -2.7e-11) {
tmp = t_0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 8e+117) {
tmp = 0.0;
} else if (x <= 4e+202) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: t_0
real(8) :: tmp
t_0 = (eps * ((x + (-8.0d0)) * (x + (-8.0d0)))) / 2.0d0
if (x <= (-2.7d-11)) then
tmp = t_0
else if (x <= 105000.0d0) then
tmp = 1.0d0
else if (x <= 8d+117) then
tmp = 0.0d0
else if (x <= 4d+202) then
tmp = t_0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double t_0 = (eps * ((x + -8.0) * (x + -8.0))) / 2.0;
double tmp;
if (x <= -2.7e-11) {
tmp = t_0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 8e+117) {
tmp = 0.0;
} else if (x <= 4e+202) {
tmp = t_0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): t_0 = (eps * ((x + -8.0) * (x + -8.0))) / 2.0 tmp = 0 if x <= -2.7e-11: tmp = t_0 elif x <= 105000.0: tmp = 1.0 elif x <= 8e+117: tmp = 0.0 elif x <= 4e+202: tmp = t_0 else: tmp = 0.0 return tmp
function code(x, eps) t_0 = Float64(Float64(eps * Float64(Float64(x + -8.0) * Float64(x + -8.0))) / 2.0) tmp = 0.0 if (x <= -2.7e-11) tmp = t_0; elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 8e+117) tmp = 0.0; elseif (x <= 4e+202) tmp = t_0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) t_0 = (eps * ((x + -8.0) * (x + -8.0))) / 2.0; tmp = 0.0; if (x <= -2.7e-11) tmp = t_0; elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 8e+117) tmp = 0.0; elseif (x <= 4e+202) tmp = t_0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := Block[{t$95$0 = N[(N[(eps * N[(N[(x + -8.0), $MachinePrecision] * N[(x + -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.7e-11], t$95$0, If[LessEqual[x, 105000.0], 1.0, If[LessEqual[x, 8e+117], 0.0, If[LessEqual[x, 4e+202], t$95$0, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\varepsilon \cdot \left(\left(x + -8\right) \cdot \left(x + -8\right)\right)}{2}\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+117}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+202}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11 or 8.0000000000000004e117 < x < 3.9999999999999996e202Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 45.5%
Taylor expanded in x around 0 22.2%
mul-1-neg22.2%
distribute-rgt-neg-in22.2%
*-commutative22.2%
distribute-rgt-neg-in22.2%
distribute-neg-in22.2%
metadata-eval22.2%
distribute-neg-frac22.2%
metadata-eval22.2%
Simplified22.2%
Taylor expanded in eps around inf 22.3%
associate-*r/22.3%
metadata-eval22.3%
Simplified22.3%
Applied egg-rr37.6%
if -2.70000000000000005e-11 < x < 105000Initial program 58.3%
Simplified58.3%
Taylor expanded in x around 0 73.2%
if 105000 < x < 8.0000000000000004e117 or 3.9999999999999996e202 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.5%
Taylor expanded in x around 0 61.5%
Taylor expanded in eps around 0 61.5%
Final simplification61.0%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (+ (* x -8.0) 64.0)) 2.0)
(if (<= x 105000.0)
1.0
(if (<= x 3.5e+115) 0.0 (if (<= x 3e+204) (/ (* x eps) 2.0) 0.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x * -8.0) + 64.0)) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 3.5e+115) {
tmp = 0.0;
} else if (x <= 3e+204) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.7d-11)) then
tmp = (eps * ((x * (-8.0d0)) + 64.0d0)) / 2.0d0
else if (x <= 105000.0d0) then
tmp = 1.0d0
else if (x <= 3.5d+115) then
tmp = 0.0d0
else if (x <= 3d+204) then
tmp = (x * eps) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * ((x * -8.0) + 64.0)) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 3.5e+115) {
tmp = 0.0;
} else if (x <= 3e+204) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * ((x * -8.0) + 64.0)) / 2.0 elif x <= 105000.0: tmp = 1.0 elif x <= 3.5e+115: tmp = 0.0 elif x <= 3e+204: tmp = (x * eps) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(Float64(x * -8.0) + 64.0)) / 2.0); elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 3.5e+115) tmp = 0.0; elseif (x <= 3e+204) tmp = Float64(Float64(x * eps) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.7e-11) tmp = (eps * ((x * -8.0) + 64.0)) / 2.0; elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 3.5e+115) tmp = 0.0; elseif (x <= 3e+204) tmp = (x * eps) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * N[(N[(x * -8.0), $MachinePrecision] + 64.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 105000.0], 1.0, If[LessEqual[x, 3.5e+115], 0.0, If[LessEqual[x, 3e+204], N[(N[(x * eps), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(x \cdot -8 + 64\right)}{2}\\
\mathbf{elif}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+115}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+204}:\\
\;\;\;\;\frac{x \cdot \varepsilon}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 51.6%
Taylor expanded in x around 0 23.6%
mul-1-neg23.6%
distribute-rgt-neg-in23.6%
*-commutative23.6%
distribute-rgt-neg-in23.6%
distribute-neg-in23.6%
metadata-eval23.6%
distribute-neg-frac23.6%
metadata-eval23.6%
Simplified23.6%
Taylor expanded in eps around inf 23.6%
associate-*r/23.6%
metadata-eval23.6%
Simplified23.6%
Applied egg-rr31.7%
distribute-lft-in31.7%
metadata-eval31.7%
Simplified31.7%
if -2.70000000000000005e-11 < x < 105000Initial program 58.3%
Simplified58.3%
Taylor expanded in x around 0 73.2%
if 105000 < x < 3.50000000000000005e115 or 2.99999999999999983e204 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.5%
Taylor expanded in x around 0 61.5%
Taylor expanded in eps around 0 61.5%
if 3.50000000000000005e115 < x < 2.99999999999999983e204Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Taylor expanded in eps around inf 20.2%
Final simplification58.1%
(FPCore (x eps)
:precision binary64
(if (<= x -2.7e-11)
(/ (* eps (- x)) 2.0)
(if (<= x 105000.0)
1.0
(if (<= x 2.1e+120) 0.0 (if (<= x 3e+203) (/ (* x eps) 2.0) 0.0)))))
double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * -x) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 2.1e+120) {
tmp = 0.0;
} else if (x <= 3e+203) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= (-2.7d-11)) then
tmp = (eps * -x) / 2.0d0
else if (x <= 105000.0d0) then
tmp = 1.0d0
else if (x <= 2.1d+120) then
tmp = 0.0d0
else if (x <= 3d+203) then
tmp = (x * eps) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= -2.7e-11) {
tmp = (eps * -x) / 2.0;
} else if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 2.1e+120) {
tmp = 0.0;
} else if (x <= 3e+203) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= -2.7e-11: tmp = (eps * -x) / 2.0 elif x <= 105000.0: tmp = 1.0 elif x <= 2.1e+120: tmp = 0.0 elif x <= 3e+203: tmp = (x * eps) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= -2.7e-11) tmp = Float64(Float64(eps * Float64(-x)) / 2.0); elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 2.1e+120) tmp = 0.0; elseif (x <= 3e+203) tmp = Float64(Float64(x * eps) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= -2.7e-11) tmp = (eps * -x) / 2.0; elseif (x <= 105000.0) tmp = 1.0; elseif (x <= 2.1e+120) tmp = 0.0; elseif (x <= 3e+203) tmp = (x * eps) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, -2.7e-11], N[(N[(eps * (-x)), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 105000.0], 1.0, If[LessEqual[x, 2.1e+120], 0.0, If[LessEqual[x, 3e+203], N[(N[(x * eps), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-11}:\\
\;\;\;\;\frac{\varepsilon \cdot \left(-x\right)}{2}\\
\mathbf{elif}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+120}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+203}:\\
\;\;\;\;\frac{x \cdot \varepsilon}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < -2.70000000000000005e-11Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 59.9%
Taylor expanded in eps around inf 31.7%
associate-*r*31.7%
mul-1-neg31.7%
Simplified31.7%
if -2.70000000000000005e-11 < x < 105000Initial program 58.3%
Simplified58.3%
Taylor expanded in x around 0 73.2%
if 105000 < x < 2.1e120 or 3e203 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.5%
Taylor expanded in x around 0 61.5%
Taylor expanded in eps around 0 61.5%
if 2.1e120 < x < 3e203Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Taylor expanded in eps around inf 20.2%
Final simplification58.1%
(FPCore (x eps) :precision binary64 (if (<= x 105000.0) 1.0 (if (<= x 7e+120) 0.0 (if (<= x 1.75e+204) (/ (* x eps) 2.0) 0.0))))
double code(double x, double eps) {
double tmp;
if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 7e+120) {
tmp = 0.0;
} else if (x <= 1.75e+204) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 105000.0d0) then
tmp = 1.0d0
else if (x <= 7d+120) then
tmp = 0.0d0
else if (x <= 1.75d+204) then
tmp = (x * eps) / 2.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 105000.0) {
tmp = 1.0;
} else if (x <= 7e+120) {
tmp = 0.0;
} else if (x <= 1.75e+204) {
tmp = (x * eps) / 2.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 105000.0: tmp = 1.0 elif x <= 7e+120: tmp = 0.0 elif x <= 1.75e+204: tmp = (x * eps) / 2.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 105000.0) tmp = 1.0; elseif (x <= 7e+120) tmp = 0.0; elseif (x <= 1.75e+204) tmp = Float64(Float64(x * eps) / 2.0); else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 105000.0) tmp = 1.0; elseif (x <= 7e+120) tmp = 0.0; elseif (x <= 1.75e+204) tmp = (x * eps) / 2.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 105000.0], 1.0, If[LessEqual[x, 7e+120], 0.0, If[LessEqual[x, 1.75e+204], N[(N[(x * eps), $MachinePrecision] / 2.0), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+120}:\\
\;\;\;\;0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+204}:\\
\;\;\;\;\frac{x \cdot \varepsilon}{2}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 105000Initial program 68.8%
Simplified68.8%
Taylor expanded in x around 0 55.6%
if 105000 < x < 7.00000000000000015e120 or 1.74999999999999995e204 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 61.5%
Taylor expanded in x around 0 61.5%
Taylor expanded in eps around 0 61.5%
if 7.00000000000000015e120 < x < 1.74999999999999995e204Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 35.2%
Taylor expanded in x around 0 19.9%
mul-1-neg19.9%
distribute-rgt-neg-in19.9%
*-commutative19.9%
distribute-rgt-neg-in19.9%
distribute-neg-in19.9%
metadata-eval19.9%
distribute-neg-frac19.9%
metadata-eval19.9%
Simplified19.9%
Taylor expanded in eps around inf 20.1%
associate-*r/20.1%
metadata-eval20.1%
Simplified20.1%
Taylor expanded in eps around inf 20.2%
Final simplification52.9%
(FPCore (x eps) :precision binary64 (if (<= x 105000.0) 1.0 0.0))
double code(double x, double eps) {
double tmp;
if (x <= 105000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
real(8) :: tmp
if (x <= 105000.0d0) then
tmp = 1.0d0
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double x, double eps) {
double tmp;
if (x <= 105000.0) {
tmp = 1.0;
} else {
tmp = 0.0;
}
return tmp;
}
def code(x, eps): tmp = 0 if x <= 105000.0: tmp = 1.0 else: tmp = 0.0 return tmp
function code(x, eps) tmp = 0.0 if (x <= 105000.0) tmp = 1.0; else tmp = 0.0; end return tmp end
function tmp_2 = code(x, eps) tmp = 0.0; if (x <= 105000.0) tmp = 1.0; else tmp = 0.0; end tmp_2 = tmp; end
code[x_, eps_] := If[LessEqual[x, 105000.0], 1.0, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 105000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if x < 105000Initial program 68.8%
Simplified68.8%
Taylor expanded in x around 0 55.6%
if 105000 < x Initial program 100.0%
Simplified100.0%
Taylor expanded in eps around 0 47.4%
Taylor expanded in x around 0 47.4%
Taylor expanded in eps around 0 47.4%
Final simplification53.3%
(FPCore (x eps) :precision binary64 0.0)
double code(double x, double eps) {
return 0.0;
}
real(8) function code(x, eps)
real(8), intent (in) :: x
real(8), intent (in) :: eps
code = 0.0d0
end function
public static double code(double x, double eps) {
return 0.0;
}
def code(x, eps): return 0.0
function code(x, eps) return 0.0 end
function tmp = code(x, eps) tmp = 0.0; end
code[x_, eps_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 77.7%
Simplified65.0%
Taylor expanded in eps around 0 15.0%
Taylor expanded in x around 0 15.2%
Taylor expanded in eps around 0 15.2%
Final simplification15.2%
herbie shell --seed 2024137
(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))