
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(fma (/ l x) l (+ (* 2.0 (* t (+ t (/ t x)))) (* l (/ l x))))))))
(t_2 (fma 2.0 (* t t) (* l l)))
(t_3 (+ (/ 1.0 x) -1.0)))
(if (<= t -1e+146)
(- t_3 (/ 0.5 (* x x)))
(if (<= t -4.4e-184)
t_1
(if (<= t -2.4e-223)
t_3
(if (<= t 5.1e-251)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 1.75e-158)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/ (+ t_2 t_2) (* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
(if (<= t 1e+139) t_1 1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / fma((l / x), l, ((2.0 * (t * (t + (t / x)))) + (l * (l / x))))));
double t_2 = fma(2.0, (t * t), (l * l));
double t_3 = (1.0 / x) + -1.0;
double tmp;
if (t <= -1e+146) {
tmp = t_3 - (0.5 / (x * x));
} else if (t <= -4.4e-184) {
tmp = t_1;
} else if (t <= -2.4e-223) {
tmp = t_3;
} else if (t <= 5.1e-251) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 1.75e-158) {
tmp = t * (sqrt(2.0) / fma(0.5, ((t_2 + t_2) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 1e+139) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l * Float64(l / x))))))) t_2 = fma(2.0, Float64(t * t), Float64(l * l)) t_3 = Float64(Float64(1.0 / x) + -1.0) tmp = 0.0 if (t <= -1e+146) tmp = Float64(t_3 - Float64(0.5 / Float64(x * x))); elseif (t <= -4.4e-184) tmp = t_1; elseif (t <= -2.4e-223) tmp = t_3; elseif (t <= 5.1e-251) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 1.75e-158) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(t_2 + t_2) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 1e+139) tmp = t_1; else tmp = 1.0; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[t, -1e+146], N[(t$95$3 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.4e-184], t$95$1, If[LessEqual[t, -2.4e-223], t$95$3, If[LessEqual[t, 5.1e-251], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.75e-158], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(t$95$2 + t$95$2), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+139], t$95$1, 1.0]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
t_3 := \frac{1}{x} + -1\\
\mathbf{if}\;t \leq -1 \cdot 10^{+146}:\\
\;\;\;\;t_3 - \frac{0.5}{x \cdot x}\\
\mathbf{elif}\;t \leq -4.4 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-223}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{-251}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{-158}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{t_2 + t_2}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.99999999999999934e145Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
distribute-rgt-neg-in97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 97.8%
associate--r+97.8%
sub-neg97.8%
metadata-eval97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
if -9.99999999999999934e145 < t < -4.39999999999999984e-184 or 1.75000000000000006e-158 < t < 1.00000000000000003e139Initial program 51.3%
associate-*l/51.3%
Simplified51.3%
Taylor expanded in x around inf 80.4%
associate--l+80.4%
unpow280.4%
distribute-lft-out80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
mul-1-neg80.4%
unpow280.4%
+-commutative80.4%
unpow280.4%
fma-udef80.4%
Simplified80.4%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
unpow279.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
*-un-lft-identity79.6%
associate-/l*79.6%
+-commutative79.6%
associate-/l*79.6%
fma-udef79.6%
associate-/r/79.6%
Applied egg-rr79.6%
*-lft-identity79.6%
associate-/r/79.6%
fma-def79.6%
+-commutative79.6%
distribute-rgt-out79.6%
associate-/l*91.7%
Simplified91.7%
sqrt-undiv92.0%
fma-def91.9%
+-commutative91.9%
associate-/r/92.0%
Applied egg-rr92.0%
if -4.39999999999999984e-184 < t < -2.39999999999999985e-223Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if -2.39999999999999985e-223 < t < 5.10000000000000006e-251Initial program 5.6%
associate-*l/5.6%
Simplified5.6%
Taylor expanded in x around inf 62.8%
associate--l+62.8%
unpow262.8%
distribute-lft-out62.8%
unpow262.8%
unpow262.8%
associate-*r/62.8%
mul-1-neg62.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
fma-udef62.8%
Simplified62.8%
Taylor expanded in l around inf 61.3%
associate-*l*61.3%
Simplified61.3%
if 5.10000000000000006e-251 < t < 1.75000000000000006e-158Initial program 7.6%
associate-*l/7.6%
Simplified7.6%
Taylor expanded in x around inf 82.5%
fma-def82.5%
Simplified82.5%
if 1.00000000000000003e139 < t Initial program 10.7%
associate-*l/10.7%
Simplified10.7%
Taylor expanded in x around inf 94.6%
sqrt-unprod96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Final simplification89.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(fma (/ l x) l (+ (* 2.0 (* t (+ t (/ t x)))) (* l (/ l x))))))))
(t_2 (+ (/ 1.0 x) -1.0)))
(if (<= t -8.2e+145)
(- t_2 (/ 0.5 (* x x)))
(if (<= t -5.8e-189)
t_1
(if (<= t -4.9e-222)
t_2
(if (<= t 2.9e-251)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 5.5e-158)
(*
t
(/
(sqrt 2.0)
(fma
-0.5
(/
(- (- (* (* t t) -2.0) (* l l)) (* l l))
(* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
(if (<= t 6.4e+139) t_1 1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / fma((l / x), l, ((2.0 * (t * (t + (t / x)))) + (l * (l / x))))));
double t_2 = (1.0 / x) + -1.0;
double tmp;
if (t <= -8.2e+145) {
tmp = t_2 - (0.5 / (x * x));
} else if (t <= -5.8e-189) {
tmp = t_1;
} else if (t <= -4.9e-222) {
tmp = t_2;
} else if (t <= 2.9e-251) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 5.5e-158) {
tmp = t * (sqrt(2.0) / fma(-0.5, (((((t * t) * -2.0) - (l * l)) - (l * l)) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} else if (t <= 6.4e+139) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l * Float64(l / x))))))) t_2 = Float64(Float64(1.0 / x) + -1.0) tmp = 0.0 if (t <= -8.2e+145) tmp = Float64(t_2 - Float64(0.5 / Float64(x * x))); elseif (t <= -5.8e-189) tmp = t_1; elseif (t <= -4.9e-222) tmp = t_2; elseif (t <= 2.9e-251) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 5.5e-158) tmp = Float64(t * Float64(sqrt(2.0) / fma(-0.5, Float64(Float64(Float64(Float64(Float64(t * t) * -2.0) - Float64(l * l)) - Float64(l * l)) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); elseif (t <= 6.4e+139) tmp = t_1; else tmp = 1.0; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[t, -8.2e+145], N[(t$95$2 - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -5.8e-189], t$95$1, If[LessEqual[t, -4.9e-222], t$95$2, If[LessEqual[t, 2.9e-251], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-158], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(-0.5 * N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -2.0), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.4e+139], t$95$1, 1.0]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \frac{1}{x} + -1\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{+145}:\\
\;\;\;\;t_2 - \frac{0.5}{x \cdot x}\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.9 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-251}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-158}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(-0.5, \frac{\left(\left(t \cdot t\right) \cdot -2 - \ell \cdot \ell\right) - \ell \cdot \ell}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -8.2000000000000003e145Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
distribute-rgt-neg-in97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 97.8%
associate--r+97.8%
sub-neg97.8%
metadata-eval97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
if -8.2000000000000003e145 < t < -5.8e-189 or 5.50000000000000025e-158 < t < 6.4000000000000002e139Initial program 51.3%
associate-*l/51.3%
Simplified51.3%
Taylor expanded in x around inf 80.4%
associate--l+80.4%
unpow280.4%
distribute-lft-out80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
mul-1-neg80.4%
unpow280.4%
+-commutative80.4%
unpow280.4%
fma-udef80.4%
Simplified80.4%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
unpow279.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
*-un-lft-identity79.6%
associate-/l*79.6%
+-commutative79.6%
associate-/l*79.6%
fma-udef79.6%
associate-/r/79.6%
Applied egg-rr79.6%
*-lft-identity79.6%
associate-/r/79.6%
fma-def79.6%
+-commutative79.6%
distribute-rgt-out79.6%
associate-/l*91.7%
Simplified91.7%
sqrt-undiv92.0%
fma-def91.9%
+-commutative91.9%
associate-/r/92.0%
Applied egg-rr92.0%
if -5.8e-189 < t < -4.9e-222Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if -4.9e-222 < t < 2.9000000000000001e-251Initial program 5.6%
associate-*l/5.6%
Simplified5.6%
Taylor expanded in x around inf 62.8%
associate--l+62.8%
unpow262.8%
distribute-lft-out62.8%
unpow262.8%
unpow262.8%
associate-*r/62.8%
mul-1-neg62.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
fma-udef62.8%
Simplified62.8%
Taylor expanded in l around inf 61.3%
associate-*l*61.3%
Simplified61.3%
if 2.9000000000000001e-251 < t < 5.50000000000000025e-158Initial program 7.6%
associate-*l/7.6%
Simplified7.6%
Taylor expanded in x around inf 22.4%
associate--l+22.4%
unpow222.4%
distribute-lft-out22.4%
unpow222.4%
unpow222.4%
associate-*r/22.4%
mul-1-neg22.4%
unpow222.4%
+-commutative22.4%
unpow222.4%
fma-udef22.4%
Simplified22.4%
Taylor expanded in t around 0 21.9%
associate-*r/21.9%
neg-mul-121.9%
unpow221.9%
distribute-rgt-neg-in21.9%
Simplified21.9%
*-un-lft-identity21.9%
associate-/l*21.9%
+-commutative21.9%
associate-/l*21.9%
fma-udef21.9%
associate-/r/21.9%
Applied egg-rr21.9%
*-lft-identity21.9%
associate-/r/21.9%
fma-def21.9%
+-commutative21.9%
distribute-rgt-out21.9%
associate-/l*21.9%
Simplified21.9%
Taylor expanded in x around -inf 79.8%
fma-def79.8%
mul-1-neg79.8%
sub-neg79.8%
*-commutative79.8%
unpow279.8%
unpow279.8%
unpow279.8%
Simplified79.8%
if 6.4000000000000002e139 < t Initial program 10.7%
associate-*l/10.7%
Simplified10.7%
Taylor expanded in x around inf 94.6%
sqrt-unprod96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Final simplification89.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(fma (/ l x) l (+ (* 2.0 (* t (+ t (/ t x)))) (* l (/ l x))))))))
(t_2 (+ (/ 1.0 x) -1.0))
(t_3 (/ 0.5 (* x x))))
(if (<= t -1e+146)
(- t_2 t_3)
(if (<= t -4.7e-186)
t_1
(if (<= t -6.5e-222)
t_2
(if (<= t 6.1e-251)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 1.7e-157)
(+ 1.0 (+ t_3 (/ -1.0 x)))
(if (<= t 2.1e+139) t_1 1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / fma((l / x), l, ((2.0 * (t * (t + (t / x)))) + (l * (l / x))))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -1e+146) {
tmp = t_2 - t_3;
} else if (t <= -4.7e-186) {
tmp = t_1;
} else if (t <= -6.5e-222) {
tmp = t_2;
} else if (t <= 6.1e-251) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 1.7e-157) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 2.1e+139) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l * Float64(l / x))))))) t_2 = Float64(Float64(1.0 / x) + -1.0) t_3 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -1e+146) tmp = Float64(t_2 - t_3); elseif (t <= -4.7e-186) tmp = t_1; elseif (t <= -6.5e-222) tmp = t_2; elseif (t <= 6.1e-251) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 1.7e-157) tmp = Float64(1.0 + Float64(t_3 + Float64(-1.0 / x))); elseif (t <= 2.1e+139) tmp = t_1; else tmp = 1.0; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+146], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, -4.7e-186], t$95$1, If[LessEqual[t, -6.5e-222], t$95$2, If[LessEqual[t, 6.1e-251], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.7e-157], N[(1.0 + N[(t$95$3 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.1e+139], t$95$1, 1.0]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \frac{1}{x} + -1\\
t_3 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+146}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-186}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{-251}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-157}:\\
\;\;\;\;1 + \left(t_3 + \frac{-1}{x}\right)\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.99999999999999934e145Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
distribute-rgt-neg-in97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 97.8%
associate--r+97.8%
sub-neg97.8%
metadata-eval97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
if -9.99999999999999934e145 < t < -4.6999999999999997e-186 or 1.69999999999999989e-157 < t < 2.0999999999999999e139Initial program 51.3%
associate-*l/51.3%
Simplified51.3%
Taylor expanded in x around inf 80.4%
associate--l+80.4%
unpow280.4%
distribute-lft-out80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
mul-1-neg80.4%
unpow280.4%
+-commutative80.4%
unpow280.4%
fma-udef80.4%
Simplified80.4%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
unpow279.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
*-un-lft-identity79.6%
associate-/l*79.6%
+-commutative79.6%
associate-/l*79.6%
fma-udef79.6%
associate-/r/79.6%
Applied egg-rr79.6%
*-lft-identity79.6%
associate-/r/79.6%
fma-def79.6%
+-commutative79.6%
distribute-rgt-out79.6%
associate-/l*91.7%
Simplified91.7%
sqrt-undiv92.0%
fma-def91.9%
+-commutative91.9%
associate-/r/92.0%
Applied egg-rr92.0%
if -4.6999999999999997e-186 < t < -6.5000000000000005e-222Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if -6.5000000000000005e-222 < t < 6.1000000000000003e-251Initial program 5.6%
associate-*l/5.6%
Simplified5.6%
Taylor expanded in x around inf 62.8%
associate--l+62.8%
unpow262.8%
distribute-lft-out62.8%
unpow262.8%
unpow262.8%
associate-*r/62.8%
mul-1-neg62.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
fma-udef62.8%
Simplified62.8%
Taylor expanded in l around inf 61.3%
associate-*l*61.3%
Simplified61.3%
if 6.1000000000000003e-251 < t < 1.69999999999999989e-157Initial program 7.6%
associate-*l/7.6%
Simplified7.6%
Taylor expanded in t around inf 73.7%
Taylor expanded in x around inf 74.0%
associate--l+74.1%
associate-*r/74.1%
metadata-eval74.1%
unpow274.1%
Simplified74.1%
if 2.0999999999999999e139 < t Initial program 10.7%
associate-*l/10.7%
Simplified10.7%
Taylor expanded in x around inf 94.6%
sqrt-unprod96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Final simplification88.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(fma (/ l x) l (+ (* 2.0 (* t (+ t (/ t x)))) (* l (/ l x))))))))
(t_2 (+ (/ 1.0 x) -1.0))
(t_3 (/ 0.5 (* x x))))
(if (<= t -5e+146)
(- t_2 t_3)
(if (<= t -3.3e-189)
t_1
(if (<= t -4e-222)
t_2
(if (<= t 2.5e-252)
(* t (* (/ (sqrt 2.0) (/ l (sqrt 0.5))) (sqrt x)))
(if (<= t 6e-158)
(+ 1.0 (+ t_3 (/ -1.0 x)))
(if (<= t 1e+140) t_1 1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / fma((l / x), l, ((2.0 * (t * (t + (t / x)))) + (l * (l / x))))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -5e+146) {
tmp = t_2 - t_3;
} else if (t <= -3.3e-189) {
tmp = t_1;
} else if (t <= -4e-222) {
tmp = t_2;
} else if (t <= 2.5e-252) {
tmp = t * ((sqrt(2.0) / (l / sqrt(0.5))) * sqrt(x));
} else if (t <= 6e-158) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 1e+140) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l * Float64(l / x))))))) t_2 = Float64(Float64(1.0 / x) + -1.0) t_3 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -5e+146) tmp = Float64(t_2 - t_3); elseif (t <= -3.3e-189) tmp = t_1; elseif (t <= -4e-222) tmp = t_2; elseif (t <= 2.5e-252) tmp = Float64(t * Float64(Float64(sqrt(2.0) / Float64(l / sqrt(0.5))) * sqrt(x))); elseif (t <= 6e-158) tmp = Float64(1.0 + Float64(t_3 + Float64(-1.0 / x))); elseif (t <= 1e+140) tmp = t_1; else tmp = 1.0; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e+146], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, -3.3e-189], t$95$1, If[LessEqual[t, -4e-222], t$95$2, If[LessEqual[t, 2.5e-252], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(l / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-158], N[(1.0 + N[(t$95$3 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+140], t$95$1, 1.0]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \frac{1}{x} + -1\\
t_3 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -5 \cdot 10^{+146}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq -3.3 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-252}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\frac{\ell}{\sqrt{0.5}}} \cdot \sqrt{x}\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-158}:\\
\;\;\;\;1 + \left(t_3 + \frac{-1}{x}\right)\\
\mathbf{elif}\;t \leq 10^{+140}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.9999999999999999e146Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
distribute-rgt-neg-in97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 97.8%
associate--r+97.8%
sub-neg97.8%
metadata-eval97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
if -4.9999999999999999e146 < t < -3.3000000000000001e-189 or 6e-158 < t < 1.00000000000000006e140Initial program 51.3%
associate-*l/51.3%
Simplified51.3%
Taylor expanded in x around inf 80.4%
associate--l+80.4%
unpow280.4%
distribute-lft-out80.4%
unpow280.4%
unpow280.4%
associate-*r/80.4%
mul-1-neg80.4%
unpow280.4%
+-commutative80.4%
unpow280.4%
fma-udef80.4%
Simplified80.4%
Taylor expanded in t around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
unpow279.6%
distribute-rgt-neg-in79.6%
Simplified79.6%
*-un-lft-identity79.6%
associate-/l*79.6%
+-commutative79.6%
associate-/l*79.6%
fma-udef79.6%
associate-/r/79.6%
Applied egg-rr79.6%
*-lft-identity79.6%
associate-/r/79.6%
fma-def79.6%
+-commutative79.6%
distribute-rgt-out79.6%
associate-/l*91.7%
Simplified91.7%
sqrt-undiv92.0%
fma-def91.9%
+-commutative91.9%
associate-/r/92.0%
Applied egg-rr92.0%
if -3.3000000000000001e-189 < t < -4.00000000000000019e-222Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if -4.00000000000000019e-222 < t < 2.50000000000000004e-252Initial program 5.6%
associate-*l/5.6%
Simplified5.6%
expm1-log1p-u5.6%
expm1-udef5.6%
Applied egg-rr5.5%
expm1-def5.5%
expm1-log1p5.5%
metadata-eval5.5%
sub-neg5.5%
associate-/l*5.4%
sub-neg5.4%
metadata-eval5.4%
+-commutative5.4%
Simplified5.4%
Taylor expanded in x around inf 62.8%
distribute-lft-in62.8%
associate--l+62.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
fma-def62.8%
associate-/l*62.8%
associate-*r/62.8%
Simplified62.8%
Taylor expanded in l around inf 61.0%
associate-/l*61.0%
Simplified61.0%
if 2.50000000000000004e-252 < t < 6e-158Initial program 7.6%
associate-*l/7.6%
Simplified7.6%
Taylor expanded in t around inf 73.7%
Taylor expanded in x around inf 74.0%
associate--l+74.1%
associate-*r/74.1%
metadata-eval74.1%
unpow274.1%
Simplified74.1%
if 1.00000000000000006e140 < t Initial program 10.7%
associate-*l/10.7%
Simplified10.7%
Taylor expanded in x around inf 94.6%
sqrt-unprod96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Final simplification88.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(fma (/ l x) l (+ (* 2.0 (* t (+ t (/ t x)))) (* l (/ l x))))))))
(t_2 (+ (/ 1.0 x) -1.0))
(t_3 (/ 0.5 (* x x))))
(if (<= t -4e+145)
(- t_2 t_3)
(if (<= t -1.35e-187)
t_1
(if (<= t -5.8e-223)
t_2
(if (<= t 8.2e-256)
t_1
(if (<= t 1.05e-157)
(+ 1.0 (+ t_3 (/ -1.0 x)))
(if (<= t 6.5e+139) t_1 1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / fma((l / x), l, ((2.0 * (t * (t + (t / x)))) + (l * (l / x))))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -4e+145) {
tmp = t_2 - t_3;
} else if (t <= -1.35e-187) {
tmp = t_1;
} else if (t <= -5.8e-223) {
tmp = t_2;
} else if (t <= 8.2e-256) {
tmp = t_1;
} else if (t <= 1.05e-157) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 6.5e+139) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / fma(Float64(l / x), l, Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(l * Float64(l / x))))))) t_2 = Float64(Float64(1.0 / x) + -1.0) t_3 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -4e+145) tmp = Float64(t_2 - t_3); elseif (t <= -1.35e-187) tmp = t_1; elseif (t <= -5.8e-223) tmp = t_2; elseif (t <= 8.2e-256) tmp = t_1; elseif (t <= 1.05e-157) tmp = Float64(1.0 + Float64(t_3 + Float64(-1.0 / x))); elseif (t <= 6.5e+139) tmp = t_1; else tmp = 1.0; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l / x), $MachinePrecision] * l + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4e+145], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, -1.35e-187], t$95$1, If[LessEqual[t, -5.8e-223], t$95$2, If[LessEqual[t, 8.2e-256], t$95$1, If[LessEqual[t, 1.05e-157], N[(1.0 + N[(t$95$3 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+139], t$95$1, 1.0]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(\frac{\ell}{x}, \ell, 2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \frac{1}{x} + -1\\
t_3 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+145}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-223}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{-256}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-157}:\\
\;\;\;\;1 + \left(t_3 + \frac{-1}{x}\right)\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4e145Initial program 2.5%
associate-/l*2.5%
fma-neg2.5%
remove-double-neg2.5%
fma-neg2.5%
sub-neg2.5%
metadata-eval2.5%
remove-double-neg2.5%
fma-def2.5%
Simplified2.5%
Taylor expanded in t around -inf 97.8%
mul-1-neg97.8%
distribute-rgt-neg-in97.8%
+-commutative97.8%
sub-neg97.8%
metadata-eval97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around inf 97.8%
associate--r+97.8%
sub-neg97.8%
metadata-eval97.8%
associate-*r/97.8%
metadata-eval97.8%
unpow297.8%
Simplified97.8%
if -4e145 < t < -1.35e-187 or -5.8000000000000001e-223 < t < 8.2e-256 or 1.05e-157 < t < 6.5000000000000003e139Initial program 43.3%
associate-*l/43.3%
Simplified43.3%
Taylor expanded in x around inf 77.8%
associate--l+77.8%
unpow277.8%
distribute-lft-out77.8%
unpow277.8%
unpow277.8%
associate-*r/77.8%
mul-1-neg77.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
fma-udef77.8%
Simplified77.8%
Taylor expanded in t around 0 77.1%
associate-*r/77.1%
neg-mul-177.1%
unpow277.1%
distribute-rgt-neg-in77.1%
Simplified77.1%
*-un-lft-identity77.1%
associate-/l*77.1%
+-commutative77.1%
associate-/l*77.1%
fma-udef77.1%
associate-/r/77.1%
Applied egg-rr77.1%
*-lft-identity77.1%
associate-/r/77.1%
fma-def77.1%
+-commutative77.1%
distribute-rgt-out77.1%
associate-/l*87.7%
Simplified87.7%
sqrt-undiv87.9%
fma-def87.9%
+-commutative87.9%
associate-/r/87.9%
Applied egg-rr87.9%
if -1.35e-187 < t < -5.8000000000000001e-223Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if 8.2e-256 < t < 1.05e-157Initial program 7.2%
associate-*l/7.2%
Simplified7.2%
Taylor expanded in t around inf 68.9%
Taylor expanded in x around inf 69.2%
associate--l+69.3%
associate-*r/69.3%
metadata-eval69.3%
unpow269.3%
Simplified69.3%
if 6.5000000000000003e139 < t Initial program 10.7%
associate-*l/10.7%
Simplified10.7%
Taylor expanded in x around inf 94.6%
sqrt-unprod96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Final simplification89.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(+
(* 2.0 (+ (* t (+ t (/ t x))) (/ (* l l) x)))
(* 2.0 (/ (* t t) x)))))))
(t_2 (+ (/ 1.0 x) -1.0))
(t_3 (/ 0.5 (* x x))))
(if (<= t -8.8e+108)
(- t_2 t_3)
(if (<= t -1.7e-187)
t_1
(if (<= t -4.9e-222)
t_2
(if (<= t 1.08e-253)
t_1
(if (<= t 5e-158)
(+ 1.0 (+ t_3 (/ -1.0 x)))
(if (<= t 5.6e+49) t_1 (+ 1.0 (/ -1.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / ((2.0 * ((t * (t + (t / x))) + ((l * l) / x))) + (2.0 * ((t * t) / x)))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -8.8e+108) {
tmp = t_2 - t_3;
} else if (t <= -1.7e-187) {
tmp = t_1;
} else if (t <= -4.9e-222) {
tmp = t_2;
} else if (t <= 1.08e-253) {
tmp = t_1;
} else if (t <= 5e-158) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 5.6e+49) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * sqrt((2.0d0 / ((2.0d0 * ((t * (t + (t / x))) + ((l * l) / x))) + (2.0d0 * ((t * t) / x)))))
t_2 = (1.0d0 / x) + (-1.0d0)
t_3 = 0.5d0 / (x * x)
if (t <= (-8.8d+108)) then
tmp = t_2 - t_3
else if (t <= (-1.7d-187)) then
tmp = t_1
else if (t <= (-4.9d-222)) then
tmp = t_2
else if (t <= 1.08d-253) then
tmp = t_1
else if (t <= 5d-158) then
tmp = 1.0d0 + (t_3 + ((-1.0d0) / x))
else if (t <= 5.6d+49) then
tmp = t_1
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t * Math.sqrt((2.0 / ((2.0 * ((t * (t + (t / x))) + ((l * l) / x))) + (2.0 * ((t * t) / x)))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -8.8e+108) {
tmp = t_2 - t_3;
} else if (t <= -1.7e-187) {
tmp = t_1;
} else if (t <= -4.9e-222) {
tmp = t_2;
} else if (t <= 1.08e-253) {
tmp = t_1;
} else if (t <= 5e-158) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 5.6e+49) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * math.sqrt((2.0 / ((2.0 * ((t * (t + (t / x))) + ((l * l) / x))) + (2.0 * ((t * t) / x))))) t_2 = (1.0 / x) + -1.0 t_3 = 0.5 / (x * x) tmp = 0 if t <= -8.8e+108: tmp = t_2 - t_3 elif t <= -1.7e-187: tmp = t_1 elif t <= -4.9e-222: tmp = t_2 elif t <= 1.08e-253: tmp = t_1 elif t <= 5e-158: tmp = 1.0 + (t_3 + (-1.0 / x)) elif t <= 5.6e+49: tmp = t_1 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / Float64(Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(Float64(l * l) / x))) + Float64(2.0 * Float64(Float64(t * t) / x)))))) t_2 = Float64(Float64(1.0 / x) + -1.0) t_3 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -8.8e+108) tmp = Float64(t_2 - t_3); elseif (t <= -1.7e-187) tmp = t_1; elseif (t <= -4.9e-222) tmp = t_2; elseif (t <= 1.08e-253) tmp = t_1; elseif (t <= 5e-158) tmp = Float64(1.0 + Float64(t_3 + Float64(-1.0 / x))); elseif (t <= 5.6e+49) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * sqrt((2.0 / ((2.0 * ((t * (t + (t / x))) + ((l * l) / x))) + (2.0 * ((t * t) / x))))); t_2 = (1.0 / x) + -1.0; t_3 = 0.5 / (x * x); tmp = 0.0; if (t <= -8.8e+108) tmp = t_2 - t_3; elseif (t <= -1.7e-187) tmp = t_1; elseif (t <= -4.9e-222) tmp = t_2; elseif (t <= 1.08e-253) tmp = t_1; elseif (t <= 5e-158) tmp = 1.0 + (t_3 + (-1.0 / x)); elseif (t <= 5.6e+49) tmp = t_1; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+108], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, -1.7e-187], t$95$1, If[LessEqual[t, -4.9e-222], t$95$2, If[LessEqual[t, 1.08e-253], t$95$1, If[LessEqual[t, 5e-158], N[(1.0 + N[(t$95$3 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+49], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \frac{\ell \cdot \ell}{x}\right) + 2 \cdot \frac{t \cdot t}{x}}}\\
t_2 := \frac{1}{x} + -1\\
t_3 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+108}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq -1.7 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.9 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.08 \cdot 10^{-253}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-158}:\\
\;\;\;\;1 + \left(t_3 + \frac{-1}{x}\right)\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -8.8000000000000005e108Initial program 12.3%
associate-/l*12.3%
fma-neg12.3%
remove-double-neg12.3%
fma-neg12.3%
sub-neg12.3%
metadata-eval12.3%
remove-double-neg12.3%
fma-def12.3%
Simplified12.3%
Taylor expanded in t around -inf 95.0%
mul-1-neg95.0%
distribute-rgt-neg-in95.0%
+-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in x around inf 95.0%
associate--r+95.0%
sub-neg95.0%
metadata-eval95.0%
associate-*r/95.0%
metadata-eval95.0%
unpow295.0%
Simplified95.0%
if -8.8000000000000005e108 < t < -1.7000000000000001e-187 or -4.9e-222 < t < 1.08000000000000003e-253 or 4.99999999999999972e-158 < t < 5.5999999999999996e49Initial program 41.1%
associate-*l/41.2%
Simplified41.2%
expm1-log1p-u40.0%
expm1-udef22.1%
Applied egg-rr22.2%
expm1-def32.9%
expm1-log1p34.2%
metadata-eval34.2%
sub-neg34.2%
associate-/l*32.9%
sub-neg32.9%
metadata-eval32.9%
+-commutative32.9%
Simplified32.9%
Taylor expanded in x around inf 80.9%
distribute-lft-in80.9%
associate--l+80.9%
unpow280.9%
+-commutative80.9%
unpow280.9%
unpow280.9%
fma-def80.9%
associate-/l*80.9%
associate-*r/80.9%
Simplified80.9%
*-un-lft-identity80.9%
associate-/l*80.9%
associate-/r/80.9%
Applied egg-rr80.9%
*-lft-identity80.9%
associate-/r/80.9%
fma-def80.9%
+-commutative80.9%
distribute-rgt-out80.9%
Simplified80.9%
Taylor expanded in l around 0 80.9%
cancel-sign-sub-inv80.9%
+-commutative80.9%
+-commutative80.9%
distribute-lft-out80.9%
+-commutative80.9%
*-commutative80.9%
unpow280.9%
metadata-eval80.9%
unpow280.9%
Simplified80.9%
if -1.7000000000000001e-187 < t < -4.9e-222Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if 1.08000000000000003e-253 < t < 4.99999999999999972e-158Initial program 7.2%
associate-*l/7.2%
Simplified7.2%
Taylor expanded in t around inf 68.9%
Taylor expanded in x around inf 69.2%
associate--l+69.3%
associate-*r/69.3%
metadata-eval69.3%
unpow269.3%
Simplified69.3%
if 5.5999999999999996e49 < t Initial program 18.8%
associate-*l/18.8%
Simplified18.8%
Taylor expanded in t around inf 89.1%
Taylor expanded in x around inf 89.5%
Final simplification84.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(sqrt
(/
2.0
(+ (* l (/ l x)) (+ (* 2.0 (* t (+ t (/ t x)))) (/ (* l l) x)))))))
(t_2 (+ (/ 1.0 x) -1.0))
(t_3 (/ 0.5 (* x x))))
(if (<= t -8.8e+108)
(- t_2 t_3)
(if (<= t -8.8e-187)
t_1
(if (<= t -6.2e-222)
t_2
(if (<= t 4.5e-255)
t_1
(if (<= t 5e-158)
(+ 1.0 (+ t_3 (/ -1.0 x)))
(if (<= t 5.8e+49) t_1 (+ 1.0 (/ -1.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / ((l * (l / x)) + ((2.0 * (t * (t + (t / x)))) + ((l * l) / x)))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -8.8e+108) {
tmp = t_2 - t_3;
} else if (t <= -8.8e-187) {
tmp = t_1;
} else if (t <= -6.2e-222) {
tmp = t_2;
} else if (t <= 4.5e-255) {
tmp = t_1;
} else if (t <= 5e-158) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 5.8e+49) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * sqrt((2.0d0 / ((l * (l / x)) + ((2.0d0 * (t * (t + (t / x)))) + ((l * l) / x)))))
t_2 = (1.0d0 / x) + (-1.0d0)
t_3 = 0.5d0 / (x * x)
if (t <= (-8.8d+108)) then
tmp = t_2 - t_3
else if (t <= (-8.8d-187)) then
tmp = t_1
else if (t <= (-6.2d-222)) then
tmp = t_2
else if (t <= 4.5d-255) then
tmp = t_1
else if (t <= 5d-158) then
tmp = 1.0d0 + (t_3 + ((-1.0d0) / x))
else if (t <= 5.8d+49) then
tmp = t_1
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t * Math.sqrt((2.0 / ((l * (l / x)) + ((2.0 * (t * (t + (t / x)))) + ((l * l) / x)))));
double t_2 = (1.0 / x) + -1.0;
double t_3 = 0.5 / (x * x);
double tmp;
if (t <= -8.8e+108) {
tmp = t_2 - t_3;
} else if (t <= -8.8e-187) {
tmp = t_1;
} else if (t <= -6.2e-222) {
tmp = t_2;
} else if (t <= 4.5e-255) {
tmp = t_1;
} else if (t <= 5e-158) {
tmp = 1.0 + (t_3 + (-1.0 / x));
} else if (t <= 5.8e+49) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * math.sqrt((2.0 / ((l * (l / x)) + ((2.0 * (t * (t + (t / x)))) + ((l * l) / x))))) t_2 = (1.0 / x) + -1.0 t_3 = 0.5 / (x * x) tmp = 0 if t <= -8.8e+108: tmp = t_2 - t_3 elif t <= -8.8e-187: tmp = t_1 elif t <= -6.2e-222: tmp = t_2 elif t <= 4.5e-255: tmp = t_1 elif t <= 5e-158: tmp = 1.0 + (t_3 + (-1.0 / x)) elif t <= 5.8e+49: tmp = t_1 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / Float64(Float64(l * Float64(l / x)) + Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(Float64(l * l) / x)))))) t_2 = Float64(Float64(1.0 / x) + -1.0) t_3 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -8.8e+108) tmp = Float64(t_2 - t_3); elseif (t <= -8.8e-187) tmp = t_1; elseif (t <= -6.2e-222) tmp = t_2; elseif (t <= 4.5e-255) tmp = t_1; elseif (t <= 5e-158) tmp = Float64(1.0 + Float64(t_3 + Float64(-1.0 / x))); elseif (t <= 5.8e+49) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * sqrt((2.0 / ((l * (l / x)) + ((2.0 * (t * (t + (t / x)))) + ((l * l) / x))))); t_2 = (1.0 / x) + -1.0; t_3 = 0.5 / (x * x); tmp = 0.0; if (t <= -8.8e+108) tmp = t_2 - t_3; elseif (t <= -8.8e-187) tmp = t_1; elseif (t <= -6.2e-222) tmp = t_2; elseif (t <= 4.5e-255) tmp = t_1; elseif (t <= 5e-158) tmp = 1.0 + (t_3 + (-1.0 / x)); elseif (t <= 5.8e+49) tmp = t_1; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[Sqrt[N[(2.0 / N[(N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$3 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+108], N[(t$95$2 - t$95$3), $MachinePrecision], If[LessEqual[t, -8.8e-187], t$95$1, If[LessEqual[t, -6.2e-222], t$95$2, If[LessEqual[t, 4.5e-255], t$95$1, If[LessEqual[t, 5e-158], N[(1.0 + N[(t$95$3 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+49], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{\ell \cdot \frac{\ell}{x} + \left(2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \frac{\ell \cdot \ell}{x}\right)}}\\
t_2 := \frac{1}{x} + -1\\
t_3 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+108}:\\
\;\;\;\;t_2 - t_3\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-222}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-255}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-158}:\\
\;\;\;\;1 + \left(t_3 + \frac{-1}{x}\right)\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -8.8000000000000005e108Initial program 12.3%
associate-/l*12.3%
fma-neg12.3%
remove-double-neg12.3%
fma-neg12.3%
sub-neg12.3%
metadata-eval12.3%
remove-double-neg12.3%
fma-def12.3%
Simplified12.3%
Taylor expanded in t around -inf 95.0%
mul-1-neg95.0%
distribute-rgt-neg-in95.0%
+-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
+-commutative95.0%
Simplified95.0%
Taylor expanded in x around inf 95.0%
associate--r+95.0%
sub-neg95.0%
metadata-eval95.0%
associate-*r/95.0%
metadata-eval95.0%
unpow295.0%
Simplified95.0%
if -8.8000000000000005e108 < t < -8.80000000000000032e-187 or -6.19999999999999959e-222 < t < 4.49999999999999979e-255 or 4.99999999999999972e-158 < t < 5.8e49Initial program 41.1%
associate-*l/41.2%
Simplified41.2%
expm1-log1p-u40.0%
expm1-udef22.1%
Applied egg-rr22.2%
expm1-def32.9%
expm1-log1p34.2%
metadata-eval34.2%
sub-neg34.2%
associate-/l*32.9%
sub-neg32.9%
metadata-eval32.9%
+-commutative32.9%
Simplified32.9%
Taylor expanded in x around inf 80.9%
distribute-lft-in80.9%
associate--l+80.9%
unpow280.9%
+-commutative80.9%
unpow280.9%
unpow280.9%
fma-def80.9%
associate-/l*80.9%
associate-*r/80.9%
Simplified80.9%
*-un-lft-identity80.9%
associate-/l*80.9%
associate-/r/80.9%
Applied egg-rr80.9%
*-lft-identity80.9%
associate-/r/80.9%
fma-def80.9%
+-commutative80.9%
distribute-rgt-out80.9%
Simplified80.9%
Taylor expanded in t around 0 80.3%
associate-*r/80.1%
neg-mul-180.1%
unpow280.1%
distribute-rgt-neg-in80.1%
Simplified80.3%
if -8.80000000000000032e-187 < t < -6.19999999999999959e-222Initial program 3.0%
associate-/l*3.0%
fma-neg3.0%
remove-double-neg3.0%
fma-neg3.0%
sub-neg3.0%
metadata-eval3.0%
remove-double-neg3.0%
fma-def3.0%
Simplified3.0%
Taylor expanded in t around -inf 74.7%
mul-1-neg74.7%
distribute-rgt-neg-in74.7%
+-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
+-commutative74.7%
Simplified74.7%
Taylor expanded in x around inf 74.7%
if 4.49999999999999979e-255 < t < 4.99999999999999972e-158Initial program 7.2%
associate-*l/7.2%
Simplified7.2%
Taylor expanded in t around inf 68.9%
Taylor expanded in x around inf 69.2%
associate--l+69.3%
associate-*r/69.3%
metadata-eval69.3%
unpow269.3%
Simplified69.3%
if 5.8e49 < t Initial program 18.8%
associate-*l/18.8%
Simplified18.8%
Taylor expanded in t around inf 89.1%
Taylor expanded in x around inf 89.5%
Final simplification84.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -1.5e-223)
(- (+ (/ 1.0 x) -1.0) t_1)
(if (<= t 2.1e-305)
(*
t
(sqrt
(/
2.0
(+ (* l (/ l x)) (* (* t t) (+ (/ 2.0 x) (+ 2.0 (/ 2.0 x))))))))
(+ 1.0 (+ t_1 (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1.5e-223) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else if (t <= 2.1e-305) {
tmp = t * sqrt((2.0 / ((l * (l / x)) + ((t * t) * ((2.0 / x) + (2.0 + (2.0 / x)))))));
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-1.5d-223)) then
tmp = ((1.0d0 / x) + (-1.0d0)) - t_1
else if (t <= 2.1d-305) then
tmp = t * sqrt((2.0d0 / ((l * (l / x)) + ((t * t) * ((2.0d0 / x) + (2.0d0 + (2.0d0 / x)))))))
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -1.5e-223) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else if (t <= 2.1e-305) {
tmp = t * Math.sqrt((2.0 / ((l * (l / x)) + ((t * t) * ((2.0 / x) + (2.0 + (2.0 / x)))))));
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -1.5e-223: tmp = ((1.0 / x) + -1.0) - t_1 elif t <= 2.1e-305: tmp = t * math.sqrt((2.0 / ((l * (l / x)) + ((t * t) * ((2.0 / x) + (2.0 + (2.0 / x))))))) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -1.5e-223) tmp = Float64(Float64(Float64(1.0 / x) + -1.0) - t_1); elseif (t <= 2.1e-305) tmp = Float64(t * sqrt(Float64(2.0 / Float64(Float64(l * Float64(l / x)) + Float64(Float64(t * t) * Float64(Float64(2.0 / x) + Float64(2.0 + Float64(2.0 / x)))))))); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -1.5e-223) tmp = ((1.0 / x) + -1.0) - t_1; elseif (t <= 2.1e-305) tmp = t * sqrt((2.0 / ((l * (l / x)) + ((t * t) * ((2.0 / x) + (2.0 + (2.0 / x))))))); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e-223], N[(N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2.1e-305], N[(t * N[Sqrt[N[(2.0 / N[(N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{-223}:\\
\;\;\;\;\left(\frac{1}{x} + -1\right) - t_1\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{-305}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{\ell \cdot \frac{\ell}{x} + \left(t \cdot t\right) \cdot \left(\frac{2}{x} + \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -1.49999999999999996e-223Initial program 32.9%
associate-/l*32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around -inf 82.1%
mul-1-neg82.1%
distribute-rgt-neg-in82.1%
+-commutative82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in x around inf 82.1%
associate--r+82.1%
sub-neg82.1%
metadata-eval82.1%
associate-*r/82.1%
metadata-eval82.1%
unpow282.1%
Simplified82.1%
if -1.49999999999999996e-223 < t < 2.1e-305Initial program 7.2%
associate-*l/7.2%
Simplified7.2%
expm1-log1p-u7.2%
expm1-udef7.2%
Applied egg-rr7.1%
expm1-def7.1%
expm1-log1p7.1%
metadata-eval7.1%
sub-neg7.1%
associate-/l*7.2%
sub-neg7.2%
metadata-eval7.2%
+-commutative7.2%
Simplified7.2%
Taylor expanded in x around inf 71.8%
distribute-lft-in71.8%
associate--l+71.8%
unpow271.8%
+-commutative71.8%
unpow271.8%
unpow271.8%
fma-def71.8%
associate-/l*71.8%
associate-*r/71.8%
Simplified71.8%
*-un-lft-identity71.8%
associate-/l*71.8%
associate-/r/71.8%
Applied egg-rr71.8%
*-lft-identity71.8%
associate-/r/71.8%
fma-def71.8%
+-commutative71.8%
distribute-rgt-out71.8%
Simplified71.8%
Taylor expanded in t around inf 53.1%
*-commutative53.1%
unpow253.1%
distribute-lft-in53.1%
metadata-eval53.1%
associate-*r/53.1%
metadata-eval53.1%
associate-*r/53.1%
metadata-eval53.1%
Simplified53.1%
if 2.1e-305 < t Initial program 24.4%
associate-*l/24.4%
Simplified24.4%
Taylor expanded in t around inf 71.1%
Taylor expanded in x around inf 71.4%
associate--l+71.4%
associate-*r/71.4%
metadata-eval71.4%
unpow271.4%
Simplified71.4%
Final simplification75.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ 0.5 (* x x))))
(if (<= t -8e-224)
(- (+ (/ 1.0 x) -1.0) t_1)
(if (<= t -3.8e-308)
(*
t
(sqrt
(/ 2.0 (- (/ (+ 1.0 x) (* (/ 0.5 t) (/ (+ x -1.0) t))) (* l l)))))
(+ 1.0 (+ t_1 (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -8e-224) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else if (t <= -3.8e-308) {
tmp = t * sqrt((2.0 / (((1.0 + x) / ((0.5 / t) * ((x + -1.0) / t))) - (l * l))));
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-8d-224)) then
tmp = ((1.0d0 / x) + (-1.0d0)) - t_1
else if (t <= (-3.8d-308)) then
tmp = t * sqrt((2.0d0 / (((1.0d0 + x) / ((0.5d0 / t) * ((x + (-1.0d0)) / t))) - (l * l))))
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -8e-224) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else if (t <= -3.8e-308) {
tmp = t * Math.sqrt((2.0 / (((1.0 + x) / ((0.5 / t) * ((x + -1.0) / t))) - (l * l))));
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -8e-224: tmp = ((1.0 / x) + -1.0) - t_1 elif t <= -3.8e-308: tmp = t * math.sqrt((2.0 / (((1.0 + x) / ((0.5 / t) * ((x + -1.0) / t))) - (l * l)))) else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -8e-224) tmp = Float64(Float64(Float64(1.0 / x) + -1.0) - t_1); elseif (t <= -3.8e-308) tmp = Float64(t * sqrt(Float64(2.0 / Float64(Float64(Float64(1.0 + x) / Float64(Float64(0.5 / t) * Float64(Float64(x + -1.0) / t))) - Float64(l * l))))); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -8e-224) tmp = ((1.0 / x) + -1.0) - t_1; elseif (t <= -3.8e-308) tmp = t * sqrt((2.0 / (((1.0 + x) / ((0.5 / t) * ((x + -1.0) / t))) - (l * l)))); else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8e-224], N[(N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, -3.8e-308], N[(t * N[Sqrt[N[(2.0 / N[(N[(N[(1.0 + x), $MachinePrecision] / N[(N[(0.5 / t), $MachinePrecision] * N[(N[(x + -1.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -8 \cdot 10^{-224}:\\
\;\;\;\;\left(\frac{1}{x} + -1\right) - t_1\\
\mathbf{elif}\;t \leq -3.8 \cdot 10^{-308}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{\frac{1 + x}{\frac{0.5}{t} \cdot \frac{x + -1}{t}} - \ell \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -8.0000000000000002e-224Initial program 32.9%
associate-/l*32.8%
fma-neg32.8%
remove-double-neg32.8%
fma-neg32.8%
sub-neg32.8%
metadata-eval32.8%
remove-double-neg32.8%
fma-def32.8%
Simplified32.8%
Taylor expanded in t around -inf 82.1%
mul-1-neg82.1%
distribute-rgt-neg-in82.1%
+-commutative82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
Simplified82.1%
Taylor expanded in x around inf 82.1%
associate--r+82.1%
sub-neg82.1%
metadata-eval82.1%
associate-*r/82.1%
metadata-eval82.1%
unpow282.1%
Simplified82.1%
if -8.0000000000000002e-224 < t < -3.79999999999999975e-308Initial program 1.2%
associate-*l/1.2%
Simplified1.2%
expm1-log1p-u1.2%
expm1-udef1.2%
Applied egg-rr1.0%
expm1-def1.0%
expm1-log1p1.0%
metadata-eval1.0%
sub-neg1.0%
associate-/l*0.6%
sub-neg0.6%
metadata-eval0.6%
+-commutative0.6%
Simplified0.6%
Taylor expanded in t around inf 39.5%
associate-*r/39.5%
unpow239.5%
times-frac39.5%
sub-neg39.5%
metadata-eval39.5%
Simplified39.5%
if -3.79999999999999975e-308 < t Initial program 24.5%
associate-*l/24.5%
Simplified24.5%
Taylor expanded in t around inf 69.8%
Taylor expanded in x around inf 70.1%
associate--l+70.1%
associate-*r/70.1%
metadata-eval70.1%
unpow270.1%
Simplified70.1%
Final simplification73.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + (-1.0d0)
else
tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + -1.0 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + -1.0); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + -1.0; else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 29.4%
associate-/l*29.4%
fma-neg29.4%
remove-double-neg29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
remove-double-neg29.4%
fma-def29.4%
Simplified29.4%
Taylor expanded in t around -inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-in73.6%
+-commutative73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in x around inf 73.4%
if -4.999999999999985e-310 < t Initial program 24.7%
associate-*l/24.7%
Simplified24.7%
Taylor expanded in t around inf 70.3%
Taylor expanded in x around inf 70.6%
associate--l+70.6%
associate-*r/70.6%
metadata-eval70.6%
unpow270.6%
Simplified70.6%
Final simplification72.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (/ 0.5 (* x x)))) (if (<= t -5e-310) (- (+ (/ 1.0 x) -1.0) t_1) (+ 1.0 (+ t_1 (/ -1.0 x))))))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = 0.5d0 / (x * x)
if (t <= (-5d-310)) then
tmp = ((1.0d0 / x) + (-1.0d0)) - t_1
else
tmp = 1.0d0 + (t_1 + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = 0.5 / (x * x);
double tmp;
if (t <= -5e-310) {
tmp = ((1.0 / x) + -1.0) - t_1;
} else {
tmp = 1.0 + (t_1 + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = 0.5 / (x * x) tmp = 0 if t <= -5e-310: tmp = ((1.0 / x) + -1.0) - t_1 else: tmp = 1.0 + (t_1 + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(0.5 / Float64(x * x)) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(Float64(1.0 / x) + -1.0) - t_1); else tmp = Float64(1.0 + Float64(t_1 + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = 0.5 / (x * x); tmp = 0.0; if (t <= -5e-310) tmp = ((1.0 / x) + -1.0) - t_1; else tmp = 1.0 + (t_1 + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e-310], N[(N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(1.0 + N[(t$95$1 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x}\\
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{1}{x} + -1\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 29.4%
associate-/l*29.4%
fma-neg29.4%
remove-double-neg29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
remove-double-neg29.4%
fma-def29.4%
Simplified29.4%
Taylor expanded in t around -inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-in73.6%
+-commutative73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in x around inf 73.6%
associate--r+73.6%
sub-neg73.6%
metadata-eval73.6%
associate-*r/73.6%
metadata-eval73.6%
unpow273.6%
Simplified73.6%
if -4.999999999999985e-310 < t Initial program 24.7%
associate-*l/24.7%
Simplified24.7%
Taylor expanded in t around inf 70.3%
Taylor expanded in x around inf 70.6%
associate--l+70.6%
associate-*r/70.6%
metadata-eval70.6%
unpow270.6%
Simplified70.6%
Final simplification72.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 29.4%
associate-/l*29.4%
fma-neg29.4%
remove-double-neg29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
remove-double-neg29.4%
fma-def29.4%
Simplified29.4%
Taylor expanded in t around -inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-in73.6%
+-commutative73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in x around inf 72.9%
if -4.999999999999985e-310 < t Initial program 24.7%
associate-*l/24.7%
Simplified24.7%
Taylor expanded in t around inf 70.3%
Taylor expanded in x around inf 70.5%
Final simplification71.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ (/ 1.0 x) -1.0) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = (1.0d0 / x) + (-1.0d0)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = (1.0 / x) + -1.0;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = (1.0 / x) + -1.0 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = Float64(Float64(1.0 / x) + -1.0); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = (1.0 / x) + -1.0; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], N[(N[(1.0 / x), $MachinePrecision] + -1.0), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{1}{x} + -1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 29.4%
associate-/l*29.4%
fma-neg29.4%
remove-double-neg29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
remove-double-neg29.4%
fma-def29.4%
Simplified29.4%
Taylor expanded in t around -inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-in73.6%
+-commutative73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in x around inf 73.4%
if -4.999999999999985e-310 < t Initial program 24.7%
associate-*l/24.7%
Simplified24.7%
Taylor expanded in t around inf 70.3%
Taylor expanded in x around inf 70.5%
Final simplification72.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 29.4%
associate-/l*29.4%
fma-neg29.4%
remove-double-neg29.4%
fma-neg29.4%
sub-neg29.4%
metadata-eval29.4%
remove-double-neg29.4%
fma-def29.4%
Simplified29.4%
Taylor expanded in t around -inf 73.6%
mul-1-neg73.6%
distribute-rgt-neg-in73.6%
+-commutative73.6%
sub-neg73.6%
metadata-eval73.6%
+-commutative73.6%
Simplified73.6%
Taylor expanded in x around inf 72.9%
if -4.999999999999985e-310 < t Initial program 24.7%
associate-*l/24.7%
Simplified24.7%
Taylor expanded in x around inf 68.7%
sqrt-unprod69.7%
metadata-eval69.7%
metadata-eval69.7%
Applied egg-rr69.7%
Final simplification71.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 -1.0)
l = abs(l);
double code(double x, double l, double t) {
return -1.0;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = -1.0d0
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
return -1.0;
}
l = abs(l) def code(x, l, t): return -1.0
l = abs(l) function code(x, l, t) return -1.0 end
l = abs(l) function tmp = code(x, l, t) tmp = -1.0; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := -1.0
\begin{array}{l}
l = |l|\\
\\
-1
\end{array}
Initial program 27.0%
associate-/l*27.0%
fma-neg27.0%
remove-double-neg27.0%
fma-neg27.0%
sub-neg27.0%
metadata-eval27.0%
remove-double-neg27.0%
fma-def27.0%
Simplified27.0%
Taylor expanded in t around -inf 37.7%
mul-1-neg37.7%
distribute-rgt-neg-in37.7%
+-commutative37.7%
sub-neg37.7%
metadata-eval37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in x around inf 37.3%
Final simplification37.3%
herbie shell --seed 2023228
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))