
(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 13 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 (/ (fma 2.0 (* t t) (* l l)) x)))
(if (<= t -4.8e+60)
-1.0
(if (<= t -1e-179)
(*
t
(sqrt
(/
2.0
(+ (fma 2.0 (/ (* t t) x) (fma 2.0 (* t t) (/ (* l l) x))) t_1))))
(if (<= t -1.35e-206)
-1.0
(if (<= t 1.3e-216)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 3.2e+73)
(/
(sqrt (* 2.0 (* t t)))
(sqrt (+ (* 2.0 (* t (+ t (/ t x)))) (+ t_1 (* l (/ l x))))))
(*
t
(/
(sqrt 2.0)
(* (* t (sqrt 2.0)) (sqrt (/ (+ x 1.0) (+ -1.0 x))))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = fma(2.0, (t * t), (l * l)) / x;
double tmp;
if (t <= -4.8e+60) {
tmp = -1.0;
} else if (t <= -1e-179) {
tmp = t * sqrt((2.0 / (fma(2.0, ((t * t) / x), fma(2.0, (t * t), ((l * l) / x))) + t_1)));
} else if (t <= -1.35e-206) {
tmp = -1.0;
} else if (t <= 1.3e-216) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 3.2e+73) {
tmp = sqrt((2.0 * (t * t))) / sqrt(((2.0 * (t * (t + (t / x)))) + (t_1 + (l * (l / x)))));
} else {
tmp = t * (sqrt(2.0) / ((t * sqrt(2.0)) * sqrt(((x + 1.0) / (-1.0 + x)))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x) tmp = 0.0 if (t <= -4.8e+60) tmp = -1.0; elseif (t <= -1e-179) tmp = Float64(t * sqrt(Float64(2.0 / Float64(fma(2.0, Float64(Float64(t * t) / x), fma(2.0, Float64(t * t), Float64(Float64(l * l) / x))) + t_1)))); elseif (t <= -1.35e-206) tmp = -1.0; elseif (t <= 1.3e-216) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 3.2e+73) tmp = Float64(sqrt(Float64(2.0 * Float64(t * t))) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(t_1 + Float64(l * Float64(l / x)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x + 1.0) / Float64(-1.0 + x)))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -4.8e+60], -1.0, If[LessEqual[t, -1e-179], N[(t * N[Sqrt[N[(2.0 / N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.35e-206], -1.0, If[LessEqual[t, 1.3e-216], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 3.2e+73], N[(N[Sqrt[N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\\
\mathbf{if}\;t \leq -4.8 \cdot 10^{+60}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-179}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{\mathsf{fma}\left(2, \frac{t \cdot t}{x}, \mathsf{fma}\left(2, t \cdot t, \frac{\ell \cdot \ell}{x}\right)\right) + t_1}}\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-206}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-216}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{+73}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t \cdot t\right)}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \left(t_1 + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}\\
\end{array}
\end{array}
if t < -4.8e60 or -1e-179 < t < -1.35e-206Initial program 27.3%
associate-*l/27.3%
Simplified27.3%
expm1-log1p-u27.3%
expm1-udef2.4%
Applied egg-rr2.4%
expm1-def5.5%
expm1-log1p5.5%
metadata-eval5.5%
sub-neg5.5%
associate-/l*27.4%
sub-neg27.4%
metadata-eval27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in x around inf 35.9%
unpow235.9%
Simplified35.9%
Taylor expanded in t around -inf 95.4%
if -4.8e60 < t < -1e-179Initial program 48.8%
associate-*l/48.8%
Simplified48.8%
expm1-log1p-u47.0%
expm1-udef30.6%
Applied egg-rr30.7%
expm1-def43.1%
expm1-log1p45.0%
metadata-eval45.0%
sub-neg45.0%
associate-/l*36.8%
sub-neg36.8%
metadata-eval36.8%
+-commutative36.8%
Simplified36.8%
Taylor expanded in x around inf 87.3%
sub-neg87.3%
fma-def87.3%
unpow287.3%
fma-def87.3%
unpow287.3%
unpow287.3%
mul-1-neg87.3%
unpow287.3%
unpow287.3%
fma-udef87.3%
remove-double-neg87.3%
Simplified87.3%
if -1.35e-206 < t < 1.2999999999999999e-216Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 55.4%
sub-neg55.4%
fma-def55.4%
unpow255.4%
fma-def55.4%
unpow255.4%
unpow255.4%
mul-1-neg55.4%
remove-double-neg55.4%
fma-def55.4%
unpow255.4%
unpow255.4%
Simplified55.4%
Taylor expanded in t around 0 47.6%
associate-*l*47.6%
Simplified47.6%
if 1.2999999999999999e-216 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 3.19999999999999982e73Initial program 58.1%
add-sqr-sqrt58.0%
sqrt-prod58.1%
sqrt-prod58.5%
pow1/258.5%
Applied egg-rr58.5%
unpow1/258.5%
Simplified58.5%
Taylor expanded in x around inf 87.5%
sub-neg87.5%
associate-+r+87.5%
mul-1-neg87.5%
unpow287.5%
unpow287.5%
fma-udef87.5%
remove-double-neg87.5%
associate-+l+87.5%
Simplified87.5%
if 3.19999999999999982e73 < t Initial program 30.3%
associate-*l/30.3%
Simplified30.3%
Taylor expanded in t around inf 91.0%
Final simplification85.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -2e+58)
-1.0
(if (<= t -3.9e-175)
(*
t
(/
(sqrt 2.0)
(sqrt (* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(if (<= t -9.2e-207)
-1.0
(if (<= t 6.8e-217)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 2.8e+73)
(/
(sqrt (* 2.0 (* t t)))
(sqrt
(+
(* 2.0 (* t (+ t (/ t x))))
(+ (/ (fma 2.0 (* t t) (* l l)) x) (* l (/ l x))))))
(*
t
(/
(sqrt 2.0)
(* (* t (sqrt 2.0)) (sqrt (/ (+ x 1.0) (+ -1.0 x)))))))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e+58) {
tmp = -1.0;
} else if (t <= -3.9e-175) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else if (t <= -9.2e-207) {
tmp = -1.0;
} else if (t <= 6.8e-217) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 2.8e+73) {
tmp = sqrt((2.0 * (t * t))) / sqrt(((2.0 * (t * (t + (t / x)))) + ((fma(2.0, (t * t), (l * l)) / x) + (l * (l / x)))));
} else {
tmp = t * (sqrt(2.0) / ((t * sqrt(2.0)) * sqrt(((x + 1.0) / (-1.0 + x)))));
}
return tmp;
}
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2e+58) tmp = -1.0; elseif (t <= -3.9e-175) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); elseif (t <= -9.2e-207) tmp = -1.0; elseif (t <= 6.8e-217) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 2.8e+73) tmp = Float64(sqrt(Float64(2.0 * Float64(t * t))) / sqrt(Float64(Float64(2.0 * Float64(t * Float64(t + Float64(t / x)))) + Float64(Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x) + Float64(l * Float64(l / x)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x + 1.0) / Float64(-1.0 + x)))))); end return tmp end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2e+58], -1.0, If[LessEqual[t, -3.9e-175], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9.2e-207], -1.0, If[LessEqual[t, 6.8e-217], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 2.8e+73], N[(N[Sqrt[N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(N[(2.0 * N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{+58}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq -3.9 \cdot 10^{-175}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-207}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+73}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(t \cdot t\right)}}{\sqrt{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right)\right) + \left(\frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x} + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}\\
\end{array}
\end{array}
if t < -1.99999999999999989e58 or -3.89999999999999998e-175 < t < -9.2000000000000002e-207Initial program 28.4%
associate-*l/28.4%
Simplified28.4%
expm1-log1p-u28.4%
expm1-udef2.4%
Applied egg-rr2.4%
expm1-def7.0%
expm1-log1p7.0%
metadata-eval7.0%
sub-neg7.0%
associate-/l*28.5%
sub-neg28.5%
metadata-eval28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in x around inf 37.0%
unpow237.0%
Simplified37.0%
Taylor expanded in t around -inf 95.5%
if -1.99999999999999989e58 < t < -3.89999999999999998e-175Initial program 47.8%
associate-*l/47.7%
Simplified47.7%
Taylor expanded in l around 0 69.3%
fma-def69.3%
+-commutative69.3%
associate-*r/73.5%
sub-neg73.5%
metadata-eval73.5%
unpow273.5%
+-commutative73.5%
unpow273.5%
associate--l+76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
sub-neg76.2%
metadata-eval76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in x around inf 86.9%
distribute-lft-out86.9%
distribute-lft-out86.9%
cancel-sign-sub-inv86.9%
metadata-eval86.9%
distribute-rgt1-in86.9%
metadata-eval86.9%
*-commutative86.9%
unpow286.9%
associate-*l*86.9%
unpow286.9%
unpow286.9%
Simplified86.9%
if -9.2000000000000002e-207 < t < 6.80000000000000032e-217Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in x around inf 55.4%
sub-neg55.4%
fma-def55.4%
unpow255.4%
fma-def55.4%
unpow255.4%
unpow255.4%
mul-1-neg55.4%
remove-double-neg55.4%
fma-def55.4%
unpow255.4%
unpow255.4%
Simplified55.4%
Taylor expanded in t around 0 47.6%
associate-*l*47.6%
Simplified47.6%
if 6.80000000000000032e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 2.80000000000000008e73Initial program 58.1%
add-sqr-sqrt58.0%
sqrt-prod58.1%
sqrt-prod58.5%
pow1/258.5%
Applied egg-rr58.5%
unpow1/258.5%
Simplified58.5%
Taylor expanded in x around inf 87.5%
sub-neg87.5%
associate-+r+87.5%
mul-1-neg87.5%
unpow287.5%
unpow287.5%
fma-udef87.5%
remove-double-neg87.5%
associate-+l+87.5%
Simplified87.5%
if 2.80000000000000008e73 < t Initial program 30.3%
associate-*l/30.3%
Simplified30.3%
Taylor expanded in t around inf 91.0%
Final simplification85.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2 (* t (sqrt 2.0)))
(t_3 (sqrt (/ (+ x 1.0) (+ -1.0 x)))))
(if (<= t -1.02e-150)
(* t (/ (sqrt 2.0) (* t_2 (- t_3))))
(if (<= t 3.5e-217)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 7e+73)
(*
t
(sqrt
(/ 2.0 (+ t_1 (fma 2.0 (/ (* t t) x) (fma 2.0 (* t t) t_1))))))
(* t (/ (sqrt 2.0) (* t_2 t_3)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t * sqrt(2.0);
double t_3 = sqrt(((x + 1.0) / (-1.0 + x)));
double tmp;
if (t <= -1.02e-150) {
tmp = t * (sqrt(2.0) / (t_2 * -t_3));
} else if (t <= 3.5e-217) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 7e+73) {
tmp = t * sqrt((2.0 / (t_1 + fma(2.0, ((t * t) / x), fma(2.0, (t * t), t_1)))));
} else {
tmp = t * (sqrt(2.0) / (t_2 * t_3));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(t * sqrt(2.0)) t_3 = sqrt(Float64(Float64(x + 1.0) / Float64(-1.0 + x))) tmp = 0.0 if (t <= -1.02e-150) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_2 * Float64(-t_3)))); elseif (t <= 3.5e-217) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 7e+73) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_1 + fma(2.0, Float64(Float64(t * t) / x), fma(2.0, Float64(t * t), t_1)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_2 * t_3))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.02e-150], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$2 * (-t$95$3)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-217], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 7e+73], N[(t * N[Sqrt[N[(2.0 / N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := t \cdot \sqrt{2}\\
t_3 := \sqrt{\frac{x + 1}{-1 + x}}\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{-150}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_2 \cdot \left(-t_3\right)}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_1 + \mathsf{fma}\left(2, \frac{t \cdot t}{x}, \mathsf{fma}\left(2, t \cdot t, t_1\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_2 \cdot t_3}\\
\end{array}
\end{array}
if t < -1.0199999999999999e-150Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in t around -inf 89.0%
mul-1-neg89.0%
*-commutative89.0%
distribute-rgt-neg-in89.0%
+-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
distribute-rgt-neg-in89.0%
Simplified89.0%
if -1.0199999999999999e-150 < t < 3.5e-217Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in x around inf 56.0%
sub-neg56.0%
fma-def56.0%
unpow256.0%
fma-def56.0%
unpow256.0%
unpow256.0%
mul-1-neg56.0%
remove-double-neg56.0%
fma-def56.0%
unpow256.0%
unpow256.0%
Simplified56.0%
Taylor expanded in t around 0 41.0%
associate-*l*41.0%
Simplified41.0%
if 3.5e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 7.00000000000000004e73Initial program 58.1%
associate-*l/58.3%
Simplified58.3%
expm1-log1p-u56.7%
expm1-udef25.1%
Applied egg-rr25.1%
expm1-def39.3%
expm1-log1p41.0%
metadata-eval41.0%
sub-neg41.0%
associate-/l*47.4%
sub-neg47.4%
metadata-eval47.4%
+-commutative47.4%
Simplified47.4%
Taylor expanded in x around inf 87.3%
sub-neg87.3%
fma-def87.3%
unpow287.3%
fma-def87.3%
unpow287.3%
unpow287.3%
mul-1-neg87.3%
unpow287.3%
unpow287.3%
fma-udef87.3%
remove-double-neg87.3%
Simplified87.3%
Taylor expanded in t around 0 87.3%
unpow287.3%
Simplified87.3%
if 7.00000000000000004e73 < t Initial program 30.3%
associate-*l/30.3%
Simplified30.3%
Taylor expanded in t around inf 91.0%
Final simplification82.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -1.35e-150)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ 2.0 (/ 4.0 x)))))))
(if (<= t 1.2e-217)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 1.1e+43)
(*
t
(/
(sqrt 2.0)
(sqrt (* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(*
t
(/
(sqrt 2.0)
(* (* t (sqrt 2.0)) (sqrt (/ (+ x 1.0) (+ -1.0 x)))))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.35e-150) {
tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x)))));
} else if (t <= 1.2e-217) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 1.1e+43) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (sqrt(2.0) / ((t * sqrt(2.0)) * sqrt(((x + 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 <= (-1.35d-150)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt((2.0d0 + (4.0d0 / x)))))
else if (t <= 1.2d-217) then
tmp = t * (sqrt(2.0d0) / (l * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 1.1d+43) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (((t * (t * 2.0d0)) / x) + ((t * t) + ((l * l) / x))))))
else
tmp = t * (sqrt(2.0d0) / ((t * sqrt(2.0d0)) * sqrt(((x + 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 <= -1.35e-150) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt((2.0 + (4.0 / x)))));
} else if (t <= 1.2e-217) {
tmp = t * (Math.sqrt(2.0) / (l * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 1.1e+43) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (Math.sqrt(2.0) / ((t * Math.sqrt(2.0)) * Math.sqrt(((x + 1.0) / (-1.0 + x)))));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.35e-150: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt((2.0 + (4.0 / x))))) elif t <= 1.2e-217: tmp = t * (math.sqrt(2.0) / (l * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) elif t <= 2.55e-147: tmp = 1.0 elif t <= 1.1e+43: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))) else: tmp = t * (math.sqrt(2.0) / ((t * math.sqrt(2.0)) * math.sqrt(((x + 1.0) / (-1.0 + x))))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.35e-150) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(2.0 + Float64(4.0 / x))))))); elseif (t <= 1.2e-217) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 1.1e+43) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(t * sqrt(2.0)) * sqrt(Float64(Float64(x + 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 <= -1.35e-150) tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x))))); elseif (t <= 1.2e-217) tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 1.1e+43) tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))); else tmp = t * (sqrt(2.0) / ((t * sqrt(2.0)) * sqrt(((x + 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, -1.35e-150], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-217], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 1.1e+43], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-150}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \frac{4}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+43}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\left(t \cdot \sqrt{2}\right) \cdot \sqrt{\frac{x + 1}{-1 + x}}}\\
\end{array}
\end{array}
if t < -1.3500000000000001e-150Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
fma-def56.8%
unpow256.8%
fma-def56.8%
unpow256.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
fma-def56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
Taylor expanded in t around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
if -1.3500000000000001e-150 < t < 1.1999999999999999e-217Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in x around inf 56.0%
sub-neg56.0%
fma-def56.0%
unpow256.0%
fma-def56.0%
unpow256.0%
unpow256.0%
mul-1-neg56.0%
remove-double-neg56.0%
fma-def56.0%
unpow256.0%
unpow256.0%
Simplified56.0%
Taylor expanded in t around 0 41.0%
associate-*l*41.0%
Simplified41.0%
if 1.1999999999999999e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 1.1e43Initial program 50.5%
associate-*l/50.6%
Simplified50.6%
Taylor expanded in l around 0 53.5%
fma-def53.5%
+-commutative53.5%
associate-*r/61.6%
sub-neg61.6%
metadata-eval61.6%
unpow261.6%
+-commutative61.6%
unpow261.6%
associate--l+68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
Simplified68.1%
Taylor expanded in x around inf 84.0%
distribute-lft-out84.0%
distribute-lft-out84.0%
cancel-sign-sub-inv84.0%
metadata-eval84.0%
distribute-rgt1-in84.0%
metadata-eval84.0%
*-commutative84.0%
unpow284.0%
associate-*l*84.0%
unpow284.0%
unpow284.0%
Simplified84.0%
if 1.1e43 < t Initial program 37.7%
associate-*l/37.7%
Simplified37.7%
Taylor expanded in t around inf 92.1%
Final simplification81.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (sqrt 2.0))) (t_2 (sqrt (/ (+ x 1.0) (+ -1.0 x)))))
(if (<= t -6e-151)
(* t (/ (sqrt 2.0) (* t_1 (- t_2))))
(if (<= t 4.2e-217)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 1.35e+42)
(*
t
(/
(sqrt 2.0)
(sqrt
(* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(* t (/ (sqrt 2.0) (* t_1 t_2)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt(2.0);
double t_2 = sqrt(((x + 1.0) / (-1.0 + x)));
double tmp;
if (t <= -6e-151) {
tmp = t * (sqrt(2.0) / (t_1 * -t_2));
} else if (t <= 4.2e-217) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 1.35e+42) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (sqrt(2.0) / (t_1 * t_2));
}
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) :: tmp
t_1 = t * sqrt(2.0d0)
t_2 = sqrt(((x + 1.0d0) / ((-1.0d0) + x)))
if (t <= (-6d-151)) then
tmp = t * (sqrt(2.0d0) / (t_1 * -t_2))
else if (t <= 4.2d-217) then
tmp = t * (sqrt(2.0d0) / (l * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 1.35d+42) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (((t * (t * 2.0d0)) / x) + ((t * t) + ((l * l) / x))))))
else
tmp = t * (sqrt(2.0d0) / (t_1 * t_2))
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);
double t_2 = Math.sqrt(((x + 1.0) / (-1.0 + x)));
double tmp;
if (t <= -6e-151) {
tmp = t * (Math.sqrt(2.0) / (t_1 * -t_2));
} else if (t <= 4.2e-217) {
tmp = t * (Math.sqrt(2.0) / (l * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 1.35e+42) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (Math.sqrt(2.0) / (t_1 * t_2));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * math.sqrt(2.0) t_2 = math.sqrt(((x + 1.0) / (-1.0 + x))) tmp = 0 if t <= -6e-151: tmp = t * (math.sqrt(2.0) / (t_1 * -t_2)) elif t <= 4.2e-217: tmp = t * (math.sqrt(2.0) / (l * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) elif t <= 2.55e-147: tmp = 1.0 elif t <= 1.35e+42: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))) else: tmp = t * (math.sqrt(2.0) / (t_1 * t_2)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(2.0)) t_2 = sqrt(Float64(Float64(x + 1.0) / Float64(-1.0 + x))) tmp = 0.0 if (t <= -6e-151) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_1 * Float64(-t_2)))); elseif (t <= 4.2e-217) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 1.35e+42) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_1 * t_2))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * sqrt(2.0); t_2 = sqrt(((x + 1.0) / (-1.0 + x))); tmp = 0.0; if (t <= -6e-151) tmp = t * (sqrt(2.0) / (t_1 * -t_2)); elseif (t <= 4.2e-217) tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 1.35e+42) tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))); else tmp = t * (sqrt(2.0) / (t_1 * t_2)); 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[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6e-151], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$1 * (-t$95$2)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.2e-217], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 1.35e+42], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{2}\\
t_2 := \sqrt{\frac{x + 1}{-1 + x}}\\
\mathbf{if}\;t \leq -6 \cdot 10^{-151}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_1 \cdot \left(-t_2\right)}\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+42}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_1 \cdot t_2}\\
\end{array}
\end{array}
if t < -6e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in t around -inf 89.0%
mul-1-neg89.0%
*-commutative89.0%
distribute-rgt-neg-in89.0%
+-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
distribute-rgt-neg-in89.0%
Simplified89.0%
if -6e-151 < t < 4.2e-217Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in x around inf 56.0%
sub-neg56.0%
fma-def56.0%
unpow256.0%
fma-def56.0%
unpow256.0%
unpow256.0%
mul-1-neg56.0%
remove-double-neg56.0%
fma-def56.0%
unpow256.0%
unpow256.0%
Simplified56.0%
Taylor expanded in t around 0 41.0%
associate-*l*41.0%
Simplified41.0%
if 4.2e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 1.35e42Initial program 50.5%
associate-*l/50.6%
Simplified50.6%
Taylor expanded in l around 0 53.5%
fma-def53.5%
+-commutative53.5%
associate-*r/61.6%
sub-neg61.6%
metadata-eval61.6%
unpow261.6%
+-commutative61.6%
unpow261.6%
associate--l+68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
Simplified68.1%
Taylor expanded in x around inf 84.0%
distribute-lft-out84.0%
distribute-lft-out84.0%
cancel-sign-sub-inv84.0%
metadata-eval84.0%
distribute-rgt1-in84.0%
metadata-eval84.0%
*-commutative84.0%
unpow284.0%
associate-*l*84.0%
unpow284.0%
unpow284.0%
Simplified84.0%
if 1.35e42 < t Initial program 37.7%
associate-*l/37.7%
Simplified37.7%
Taylor expanded in t around inf 92.1%
Final simplification82.1%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -3.6e-151)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ 2.0 (/ 4.0 x)))))))
(if (<= t 1.4e-216)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 1.0 x) (/ 1.0 (+ -1.0 x)))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 8.8e+73)
(*
t
(/
(sqrt 2.0)
(sqrt (* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(* (* (sqrt 2.0) (sqrt 0.5)) (sqrt (/ (+ -1.0 x) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -3.6e-151) {
tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x)))));
} else if (t <= 1.4e-216) {
tmp = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 8.8e+73) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = (sqrt(2.0) * sqrt(0.5)) * sqrt(((-1.0 + x) / (x + 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 <= (-3.6d-151)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt((2.0d0 + (4.0d0 / x)))))
else if (t <= 1.4d-216) then
tmp = t * (sqrt(2.0d0) / (l * sqrt(((1.0d0 / x) + (1.0d0 / ((-1.0d0) + x))))))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 8.8d+73) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (((t * (t * 2.0d0)) / x) + ((t * t) + ((l * l) / x))))))
else
tmp = (sqrt(2.0d0) * sqrt(0.5d0)) * sqrt((((-1.0d0) + x) / (x + 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 <= -3.6e-151) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt((2.0 + (4.0 / x)))));
} else if (t <= 1.4e-216) {
tmp = t * (Math.sqrt(2.0) / (l * Math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 8.8e+73) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = (Math.sqrt(2.0) * Math.sqrt(0.5)) * Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -3.6e-151: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt((2.0 + (4.0 / x))))) elif t <= 1.4e-216: tmp = t * (math.sqrt(2.0) / (l * math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))) elif t <= 2.55e-147: tmp = 1.0 elif t <= 8.8e+73: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))) else: tmp = (math.sqrt(2.0) * math.sqrt(0.5)) * math.sqrt(((-1.0 + x) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -3.6e-151) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(2.0 + Float64(4.0 / x))))))); elseif (t <= 1.4e-216) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(-1.0 + x))))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 8.8e+73) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); else tmp = Float64(Float64(sqrt(2.0) * sqrt(0.5)) * sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -3.6e-151) tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x))))); elseif (t <= 1.4e-216) tmp = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 8.8e+73) tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))); else tmp = (sqrt(2.0) * sqrt(0.5)) * sqrt(((-1.0 + x) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -3.6e-151], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-216], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 8.8e+73], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-151}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \frac{4}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-216}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{-1 + x}}}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+73}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
if t < -3.60000000000000032e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
fma-def56.8%
unpow256.8%
fma-def56.8%
unpow256.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
fma-def56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
Taylor expanded in t around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
if -3.60000000000000032e-151 < t < 1.4e-216Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in l around inf 4.7%
associate--l+26.6%
sub-neg26.6%
metadata-eval26.6%
+-commutative26.6%
sub-neg26.6%
metadata-eval26.6%
+-commutative26.6%
Simplified26.6%
Taylor expanded in x around inf 40.9%
if 1.4e-216 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 8.8e73Initial program 58.1%
associate-*l/58.3%
Simplified58.3%
Taylor expanded in l around 0 49.9%
fma-def49.9%
+-commutative49.9%
associate-*r/69.2%
sub-neg69.2%
metadata-eval69.2%
unpow269.2%
+-commutative69.2%
unpow269.2%
associate--l+74.4%
sub-neg74.4%
metadata-eval74.4%
+-commutative74.4%
sub-neg74.4%
metadata-eval74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in x around inf 87.1%
distribute-lft-out87.1%
distribute-lft-out87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
distribute-rgt1-in87.1%
metadata-eval87.1%
*-commutative87.1%
unpow287.1%
associate-*l*87.1%
unpow287.1%
unpow287.1%
Simplified87.1%
if 8.8e73 < t Initial program 30.3%
associate-*l/30.3%
Simplified30.3%
Taylor expanded in t around inf 89.9%
Final simplification81.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -1.75e-150)
(* t (/ (sqrt 2.0) (* t (- (sqrt (+ 2.0 (/ 4.0 x)))))))
(if (<= t 3e-217)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 6.9e+75)
(*
t
(/
(sqrt 2.0)
(sqrt (* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(* (* (sqrt 2.0) (sqrt 0.5)) (sqrt (/ (+ -1.0 x) (+ x 1.0)))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.75e-150) {
tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x)))));
} else if (t <= 3e-217) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 6.9e+75) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = (sqrt(2.0) * sqrt(0.5)) * sqrt(((-1.0 + x) / (x + 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 <= (-1.75d-150)) then
tmp = t * (sqrt(2.0d0) / (t * -sqrt((2.0d0 + (4.0d0 / x)))))
else if (t <= 3d-217) then
tmp = t * (sqrt(2.0d0) / (l * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 6.9d+75) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (((t * (t * 2.0d0)) / x) + ((t * t) + ((l * l) / x))))))
else
tmp = (sqrt(2.0d0) * sqrt(0.5d0)) * sqrt((((-1.0d0) + x) / (x + 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 <= -1.75e-150) {
tmp = t * (Math.sqrt(2.0) / (t * -Math.sqrt((2.0 + (4.0 / x)))));
} else if (t <= 3e-217) {
tmp = t * (Math.sqrt(2.0) / (l * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 6.9e+75) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = (Math.sqrt(2.0) * Math.sqrt(0.5)) * Math.sqrt(((-1.0 + x) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.75e-150: tmp = t * (math.sqrt(2.0) / (t * -math.sqrt((2.0 + (4.0 / x))))) elif t <= 3e-217: tmp = t * (math.sqrt(2.0) / (l * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) elif t <= 2.55e-147: tmp = 1.0 elif t <= 6.9e+75: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))) else: tmp = (math.sqrt(2.0) * math.sqrt(0.5)) * math.sqrt(((-1.0 + x) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.75e-150) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * Float64(-sqrt(Float64(2.0 + Float64(4.0 / x))))))); elseif (t <= 3e-217) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 6.9e+75) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); else tmp = Float64(Float64(sqrt(2.0) * sqrt(0.5)) * sqrt(Float64(Float64(-1.0 + x) / Float64(x + 1.0)))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.75e-150) tmp = t * (sqrt(2.0) / (t * -sqrt((2.0 + (4.0 / x))))); elseif (t <= 3e-217) tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 6.9e+75) tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))); else tmp = (sqrt(2.0) * sqrt(0.5)) * sqrt(((-1.0 + x) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1.75e-150], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * (-N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e-217], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 6.9e+75], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(-1.0 + x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{-150}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \left(-\sqrt{2 + \frac{4}{x}}\right)}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-217}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 6.9 \cdot 10^{+75}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{2} \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{-1 + x}{x + 1}}\\
\end{array}
\end{array}
if t < -1.7499999999999999e-150Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
fma-def56.8%
unpow256.8%
fma-def56.8%
unpow256.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
fma-def56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
Taylor expanded in t around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
if -1.7499999999999999e-150 < t < 3.00000000000000004e-217Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in x around inf 56.0%
sub-neg56.0%
fma-def56.0%
unpow256.0%
fma-def56.0%
unpow256.0%
unpow256.0%
mul-1-neg56.0%
remove-double-neg56.0%
fma-def56.0%
unpow256.0%
unpow256.0%
Simplified56.0%
Taylor expanded in t around 0 41.0%
associate-*l*41.0%
Simplified41.0%
if 3.00000000000000004e-217 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 6.9000000000000004e75Initial program 58.1%
associate-*l/58.3%
Simplified58.3%
Taylor expanded in l around 0 49.9%
fma-def49.9%
+-commutative49.9%
associate-*r/69.2%
sub-neg69.2%
metadata-eval69.2%
unpow269.2%
+-commutative69.2%
unpow269.2%
associate--l+74.4%
sub-neg74.4%
metadata-eval74.4%
+-commutative74.4%
sub-neg74.4%
metadata-eval74.4%
+-commutative74.4%
Simplified74.4%
Taylor expanded in x around inf 87.1%
distribute-lft-out87.1%
distribute-lft-out87.1%
cancel-sign-sub-inv87.1%
metadata-eval87.1%
distribute-rgt1-in87.1%
metadata-eval87.1%
*-commutative87.1%
unpow287.1%
associate-*l*87.1%
unpow287.1%
unpow287.1%
Simplified87.1%
if 6.9000000000000004e75 < t Initial program 30.3%
associate-*l/30.3%
Simplified30.3%
Taylor expanded in t around inf 89.9%
Final simplification81.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (+ 2.0 (/ 4.0 x)))))
(if (<= t -1.4e-151)
(* t (/ (sqrt 2.0) (* t_1 (- t))))
(if (<= t 8.6e-218)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 1.0 x) (/ 1.0 (+ -1.0 x)))))))
(if (<= t 2.55e-147)
1.0
(if (<= t 4.7e+42)
(*
t
(/
(sqrt 2.0)
(sqrt
(* 2.0 (+ (/ (* t (* t 2.0)) x) (+ (* t t) (/ (* l l) x)))))))
(* t (/ (sqrt 2.0) (* t t_1)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -1.4e-151) {
tmp = t * (sqrt(2.0) / (t_1 * -t));
} else if (t <= 8.6e-218) {
tmp = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 4.7e+42) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (sqrt(2.0) / (t * t_1));
}
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 = sqrt((2.0d0 + (4.0d0 / x)))
if (t <= (-1.4d-151)) then
tmp = t * (sqrt(2.0d0) / (t_1 * -t))
else if (t <= 8.6d-218) then
tmp = t * (sqrt(2.0d0) / (l * sqrt(((1.0d0 / x) + (1.0d0 / ((-1.0d0) + x))))))
else if (t <= 2.55d-147) then
tmp = 1.0d0
else if (t <= 4.7d+42) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (((t * (t * 2.0d0)) / x) + ((t * t) + ((l * l) / x))))))
else
tmp = t * (sqrt(2.0d0) / (t * t_1))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -1.4e-151) {
tmp = t * (Math.sqrt(2.0) / (t_1 * -t));
} else if (t <= 8.6e-218) {
tmp = t * (Math.sqrt(2.0) / (l * Math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
} else if (t <= 2.55e-147) {
tmp = 1.0;
} else if (t <= 4.7e+42) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x))))));
} else {
tmp = t * (Math.sqrt(2.0) / (t * t_1));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt((2.0 + (4.0 / x))) tmp = 0 if t <= -1.4e-151: tmp = t * (math.sqrt(2.0) / (t_1 * -t)) elif t <= 8.6e-218: tmp = t * (math.sqrt(2.0) / (l * math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))) elif t <= 2.55e-147: tmp = 1.0 elif t <= 4.7e+42: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))) else: tmp = t * (math.sqrt(2.0) / (t * t_1)) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(2.0 + Float64(4.0 / x))) tmp = 0.0 if (t <= -1.4e-151) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_1 * Float64(-t)))); elseif (t <= 8.6e-218) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(-1.0 + x))))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 4.7e+42) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(Float64(Float64(t * Float64(t * 2.0)) / x) + Float64(Float64(t * t) + Float64(Float64(l * l) / x))))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * t_1))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt((2.0 + (4.0 / x))); tmp = 0.0; if (t <= -1.4e-151) tmp = t * (sqrt(2.0) / (t_1 * -t)); elseif (t <= 8.6e-218) tmp = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))); elseif (t <= 2.55e-147) tmp = 1.0; elseif (t <= 4.7e+42) tmp = t * (sqrt(2.0) / sqrt((2.0 * (((t * (t * 2.0)) / x) + ((t * t) + ((l * l) / x)))))); else tmp = t * (sqrt(2.0) / (t * t_1)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.4e-151], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$1 * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.6e-218], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e-147], 1.0, If[LessEqual[t, 4.7e+42], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2 + \frac{4}{x}}\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-151}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_1 \cdot \left(-t\right)}\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{-218}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{-1 + x}}}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 4.7 \cdot 10^{+42}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\frac{t \cdot \left(t \cdot 2\right)}{x} + \left(t \cdot t + \frac{\ell \cdot \ell}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot t_1}\\
\end{array}
\end{array}
if t < -1.4e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
fma-def56.8%
unpow256.8%
fma-def56.8%
unpow256.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
fma-def56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
Taylor expanded in t around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
if -1.4e-151 < t < 8.6e-218Initial program 2.1%
associate-*l/2.1%
Simplified2.1%
Taylor expanded in l around inf 4.7%
associate--l+26.6%
sub-neg26.6%
metadata-eval26.6%
+-commutative26.6%
sub-neg26.6%
metadata-eval26.6%
+-commutative26.6%
Simplified26.6%
Taylor expanded in x around inf 40.9%
if 8.6e-218 < t < 2.5499999999999998e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 2.5499999999999998e-147 < t < 4.69999999999999986e42Initial program 50.5%
associate-*l/50.6%
Simplified50.6%
Taylor expanded in l around 0 53.5%
fma-def53.5%
+-commutative53.5%
associate-*r/61.6%
sub-neg61.6%
metadata-eval61.6%
unpow261.6%
+-commutative61.6%
unpow261.6%
associate--l+68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
sub-neg68.1%
metadata-eval68.1%
+-commutative68.1%
Simplified68.1%
Taylor expanded in x around inf 84.0%
distribute-lft-out84.0%
distribute-lft-out84.0%
cancel-sign-sub-inv84.0%
metadata-eval84.0%
distribute-rgt1-in84.0%
metadata-eval84.0%
*-commutative84.0%
unpow284.0%
associate-*l*84.0%
unpow284.0%
unpow284.0%
Simplified84.0%
if 4.69999999999999986e42 < t Initial program 37.7%
associate-*l/37.7%
Simplified37.7%
Taylor expanded in x around inf 39.7%
sub-neg39.7%
fma-def39.7%
unpow239.7%
fma-def39.7%
unpow239.7%
unpow239.7%
mul-1-neg39.7%
remove-double-neg39.7%
fma-def39.7%
unpow239.7%
unpow239.7%
Simplified39.7%
Taylor expanded in t around inf 90.4%
associate-*r/90.4%
metadata-eval90.4%
Simplified90.4%
Final simplification81.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 1.0 x) (/ 1.0 (+ -1.0 x))))))))
(t_2 (sqrt (+ 2.0 (/ 4.0 x)))))
(if (<= t -2.9e-151)
(* t (/ (sqrt 2.0) (* t_2 (- t))))
(if (<= t 1.15e-216)
t_1
(if (<= t 9.6e-147)
1.0
(if (<= t 1e-93) t_1 (* t (/ (sqrt 2.0) (* t t_2)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
double t_2 = sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -2.9e-151) {
tmp = t * (sqrt(2.0) / (t_2 * -t));
} else if (t <= 1.15e-216) {
tmp = t_1;
} else if (t <= 9.6e-147) {
tmp = 1.0;
} else if (t <= 1e-93) {
tmp = t_1;
} else {
tmp = t * (sqrt(2.0) / (t * t_2));
}
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) :: tmp
t_1 = t * (sqrt(2.0d0) / (l * sqrt(((1.0d0 / x) + (1.0d0 / ((-1.0d0) + x))))))
t_2 = sqrt((2.0d0 + (4.0d0 / x)))
if (t <= (-2.9d-151)) then
tmp = t * (sqrt(2.0d0) / (t_2 * -t))
else if (t <= 1.15d-216) then
tmp = t_1
else if (t <= 9.6d-147) then
tmp = 1.0d0
else if (t <= 1d-93) then
tmp = t_1
else
tmp = t * (sqrt(2.0d0) / (t * t_2))
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 * Math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x))))));
double t_2 = Math.sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -2.9e-151) {
tmp = t * (Math.sqrt(2.0) / (t_2 * -t));
} else if (t <= 1.15e-216) {
tmp = t_1;
} else if (t <= 9.6e-147) {
tmp = 1.0;
} else if (t <= 1e-93) {
tmp = t_1;
} else {
tmp = t * (Math.sqrt(2.0) / (t * t_2));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * (math.sqrt(2.0) / (l * math.sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))) t_2 = math.sqrt((2.0 + (4.0 / x))) tmp = 0 if t <= -2.9e-151: tmp = t * (math.sqrt(2.0) / (t_2 * -t)) elif t <= 1.15e-216: tmp = t_1 elif t <= 9.6e-147: tmp = 1.0 elif t <= 1e-93: tmp = t_1 else: tmp = t * (math.sqrt(2.0) / (t * t_2)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(1.0 / x) + Float64(1.0 / Float64(-1.0 + x))))))) t_2 = sqrt(Float64(2.0 + Float64(4.0 / x))) tmp = 0.0 if (t <= -2.9e-151) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_2 * Float64(-t)))); elseif (t <= 1.15e-216) tmp = t_1; elseif (t <= 9.6e-147) tmp = 1.0; elseif (t <= 1e-93) tmp = t_1; else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * t_2))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * (sqrt(2.0) / (l * sqrt(((1.0 / x) + (1.0 / (-1.0 + x)))))); t_2 = sqrt((2.0 + (4.0 / x))); tmp = 0.0; if (t <= -2.9e-151) tmp = t * (sqrt(2.0) / (t_2 * -t)); elseif (t <= 1.15e-216) tmp = t_1; elseif (t <= 9.6e-147) tmp = 1.0; elseif (t <= 1e-93) tmp = t_1; else tmp = t * (sqrt(2.0) / (t * t_2)); 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[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.9e-151], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$2 * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-216], t$95$1, If[LessEqual[t, 9.6e-147], 1.0, If[LessEqual[t, 1e-93], t$95$1, N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{1}{x} + \frac{1}{-1 + x}}}\\
t_2 := \sqrt{2 + \frac{4}{x}}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-151}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_2 \cdot \left(-t\right)}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-216}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-147}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 10^{-93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot t_2}\\
\end{array}
\end{array}
if t < -2.90000000000000013e-151Initial program 39.0%
associate-*l/39.0%
Simplified39.0%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
fma-def56.8%
unpow256.8%
fma-def56.8%
unpow256.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
fma-def56.8%
unpow256.8%
unpow256.8%
Simplified56.8%
Taylor expanded in t around -inf 88.8%
mul-1-neg88.8%
distribute-rgt-neg-in88.8%
associate-*r/88.8%
metadata-eval88.8%
Simplified88.8%
if -2.90000000000000013e-151 < t < 1.14999999999999998e-216 or 9.59999999999999994e-147 < t < 9.999999999999999e-94Initial program 1.9%
associate-*l/1.9%
Simplified1.9%
Taylor expanded in l around inf 4.1%
associate--l+26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
sub-neg26.4%
metadata-eval26.4%
+-commutative26.4%
Simplified26.4%
Taylor expanded in x around inf 47.6%
if 1.14999999999999998e-216 < t < 9.59999999999999994e-147Initial program 24.9%
associate-*l/24.9%
Simplified24.9%
expm1-log1p-u23.2%
expm1-udef23.2%
Applied egg-rr17.1%
expm1-def17.1%
expm1-log1p18.5%
metadata-eval18.5%
sub-neg18.5%
associate-/l*2.0%
sub-neg2.0%
metadata-eval2.0%
+-commutative2.0%
Simplified2.0%
Taylor expanded in x around inf 17.7%
unpow217.7%
Simplified17.7%
Taylor expanded in t around 0 70.9%
if 9.999999999999999e-94 < t Initial program 45.3%
associate-*l/45.3%
Simplified45.3%
Taylor expanded in x around inf 53.7%
sub-neg53.7%
fma-def53.7%
unpow253.7%
fma-def53.7%
unpow253.7%
unpow253.7%
mul-1-neg53.7%
remove-double-neg53.7%
fma-def53.7%
unpow253.7%
unpow253.7%
Simplified53.7%
Taylor expanded in t around inf 87.1%
associate-*r/87.1%
metadata-eval87.1%
Simplified87.1%
Final simplification80.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (+ 2.0 (/ 4.0 x)))))
(if (<= t -1.65e-295)
(* t (/ (sqrt 2.0) (* t_1 (- t))))
(* t (/ (sqrt 2.0) (* t t_1))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -1.65e-295) {
tmp = t * (sqrt(2.0) / (t_1 * -t));
} else {
tmp = t * (sqrt(2.0) / (t * t_1));
}
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 = sqrt((2.0d0 + (4.0d0 / x)))
if (t <= (-1.65d-295)) then
tmp = t * (sqrt(2.0d0) / (t_1 * -t))
else
tmp = t * (sqrt(2.0d0) / (t * t_1))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt((2.0 + (4.0 / x)));
double tmp;
if (t <= -1.65e-295) {
tmp = t * (Math.sqrt(2.0) / (t_1 * -t));
} else {
tmp = t * (Math.sqrt(2.0) / (t * t_1));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt((2.0 + (4.0 / x))) tmp = 0 if t <= -1.65e-295: tmp = t * (math.sqrt(2.0) / (t_1 * -t)) else: tmp = t * (math.sqrt(2.0) / (t * t_1)) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(2.0 + Float64(4.0 / x))) tmp = 0.0 if (t <= -1.65e-295) tmp = Float64(t * Float64(sqrt(2.0) / Float64(t_1 * Float64(-t)))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * t_1))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt((2.0 + (4.0 / x))); tmp = 0.0; if (t <= -1.65e-295) tmp = t * (sqrt(2.0) / (t_1 * -t)); else tmp = t * (sqrt(2.0) / (t * t_1)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.65e-295], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t$95$1 * (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2 + \frac{4}{x}}\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{-295}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t_1 \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot t_1}\\
\end{array}
\end{array}
if t < -1.6499999999999999e-295Initial program 33.5%
associate-*l/33.5%
Simplified33.5%
Taylor expanded in x around inf 56.0%
sub-neg56.0%
fma-def56.0%
unpow256.0%
fma-def56.0%
unpow256.0%
unpow256.0%
mul-1-neg56.0%
remove-double-neg56.0%
fma-def56.0%
unpow256.0%
unpow256.0%
Simplified56.0%
Taylor expanded in t around -inf 81.4%
mul-1-neg81.4%
distribute-rgt-neg-in81.4%
associate-*r/81.4%
metadata-eval81.4%
Simplified81.4%
if -1.6499999999999999e-295 < t Initial program 35.9%
associate-*l/35.9%
Simplified35.9%
Taylor expanded in x around inf 54.7%
sub-neg54.7%
fma-def54.7%
unpow254.7%
fma-def54.7%
unpow254.7%
unpow254.7%
mul-1-neg54.7%
remove-double-neg54.7%
fma-def54.7%
unpow254.7%
unpow254.7%
Simplified54.7%
Taylor expanded in t around inf 73.6%
associate-*r/73.6%
metadata-eval73.6%
Simplified73.6%
Final simplification77.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 5e-309) -1.0 (* t (/ (sqrt 2.0) (* t (sqrt (+ 2.0 (/ 4.0 x))))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 5e-309) {
tmp = -1.0;
} else {
tmp = t * (sqrt(2.0) / (t * sqrt((2.0 + (4.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-309) then
tmp = -1.0d0
else
tmp = t * (sqrt(2.0d0) / (t * sqrt((2.0d0 + (4.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-309) {
tmp = -1.0;
} else {
tmp = t * (Math.sqrt(2.0) / (t * Math.sqrt((2.0 + (4.0 / x)))));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 5e-309: tmp = -1.0 else: tmp = t * (math.sqrt(2.0) / (t * math.sqrt((2.0 + (4.0 / x))))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 5e-309) tmp = -1.0; else tmp = Float64(t * Float64(sqrt(2.0) / Float64(t * sqrt(Float64(2.0 + Float64(4.0 / x)))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 5e-309) tmp = -1.0; else tmp = t * (sqrt(2.0) / (t * sqrt((2.0 + (4.0 / x))))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, 5e-309], -1.0, N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * N[Sqrt[N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-309}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{t \cdot \sqrt{2 + \frac{4}{x}}}\\
\end{array}
\end{array}
if t < 4.9999999999999995e-309Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
expm1-log1p-u32.3%
expm1-udef13.4%
Applied egg-rr15.1%
expm1-def21.5%
expm1-log1p22.3%
metadata-eval22.3%
sub-neg22.3%
associate-/l*28.3%
sub-neg28.3%
metadata-eval28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in x around inf 46.7%
unpow246.7%
Simplified46.7%
Taylor expanded in t around -inf 79.8%
if 4.9999999999999995e-309 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
Taylor expanded in x around inf 54.0%
sub-neg54.0%
fma-def54.0%
unpow254.0%
fma-def54.0%
unpow254.0%
unpow254.0%
mul-1-neg54.0%
remove-double-neg54.0%
fma-def54.0%
unpow254.0%
unpow254.0%
Simplified54.0%
Taylor expanded in t around inf 74.6%
associate-*r/74.6%
metadata-eval74.6%
Simplified74.6%
Final simplification77.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2e-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 <= (-2d-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 <= -2e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2e-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 <= -2e-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, -2e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.999999999999994e-310Initial program 33.0%
associate-*l/33.0%
Simplified33.0%
expm1-log1p-u32.3%
expm1-udef13.4%
Applied egg-rr15.1%
expm1-def21.5%
expm1-log1p22.3%
metadata-eval22.3%
sub-neg22.3%
associate-/l*28.3%
sub-neg28.3%
metadata-eval28.3%
+-commutative28.3%
Simplified28.3%
Taylor expanded in x around inf 46.7%
unpow246.7%
Simplified46.7%
Taylor expanded in t around -inf 79.8%
if -1.999999999999994e-310 < t Initial program 36.4%
associate-*l/36.4%
Simplified36.4%
expm1-log1p-u35.7%
expm1-udef12.0%
Applied egg-rr11.5%
expm1-def19.2%
expm1-log1p19.9%
metadata-eval19.9%
sub-neg19.9%
associate-/l*30.6%
sub-neg30.6%
metadata-eval30.6%
+-commutative30.6%
Simplified30.6%
Taylor expanded in x around inf 41.4%
unpow241.4%
Simplified41.4%
Taylor expanded in t around 0 74.1%
Final simplification76.9%
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 34.8%
associate-*l/34.8%
Simplified34.8%
expm1-log1p-u34.1%
expm1-udef12.6%
Applied egg-rr13.3%
expm1-def20.3%
expm1-log1p21.1%
metadata-eval21.1%
sub-neg21.1%
associate-/l*29.5%
sub-neg29.5%
metadata-eval29.5%
+-commutative29.5%
Simplified29.5%
Taylor expanded in x around inf 44.0%
unpow244.0%
Simplified44.0%
Taylor expanded in t around -inf 39.3%
Final simplification39.3%
herbie shell --seed 2023279
(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)))))