
(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 22 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 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (- t_1)))
(if (<= t -3.7e+28)
t_2
(if (<= t -1.46e-161)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma l l (* 2.0 (* t t))) x))))))
(if (<= t -4.2e-251)
t_2
(if (<= t 1.05e-195)
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt (+ (/ 2.0 x) (+ (/ 2.0 (* x x)) (/ 2.0 (pow x 3.0))))))))
(if (<= t 2.75e-105)
t_1
(if (<= t 3.6e-71)
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x)))))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double tmp;
if (t <= -3.7e+28) {
tmp = t_2;
} else if (t <= -1.46e-161) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma(l, l, (2.0 * (t * t))) / x)))));
} else if (t <= -4.2e-251) {
tmp = t_2;
} else if (t <= 1.05e-195) {
tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + ((2.0 / (x * x)) + (2.0 / pow(x, 3.0)))))));
} else if (t <= 2.75e-105) {
tmp = t_1;
} else if (t <= 3.6e-71) {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
} else {
tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = Float64(-t_1) tmp = 0.0 if (t <= -3.7e+28) tmp = t_2; elseif (t <= -1.46e-161) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(l, l, Float64(2.0 * Float64(t * t))) / x)))))); elseif (t <= -4.2e-251) tmp = t_2; elseif (t <= 1.05e-195) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / (x ^ 3.0)))))))); elseif (t <= 2.75e-105) tmp = t_1; elseif (t <= 3.6e-71) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, If[LessEqual[t, -3.7e+28], t$95$2, If[LessEqual[t, -1.46e-161], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-251], t$95$2, If[LessEqual[t, 1.05e-195], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.75e-105], t$95$1, If[LessEqual[t, 3.6e-71], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := -t_1\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+28}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.46 \cdot 10^{-161}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)}{x}\right)}}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-251}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-195}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{x \cdot x} + \frac{2}{{x}^{3}}\right)}}\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -3.6999999999999999e28 or -1.46e-161 < t < -4.19999999999999964e-251Initial program 25.5%
associate-*r/25.5%
fma-neg25.5%
sub-neg25.5%
metadata-eval25.5%
+-commutative25.5%
fma-def25.5%
distribute-rgt-neg-in25.5%
Simplified25.5%
Applied egg-rr82.9%
Taylor expanded in t around -inf 90.1%
mul-1-neg90.1%
sub-neg90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
if -3.6999999999999999e28 < t < -1.46e-161Initial program 57.4%
associate-*l/57.7%
Simplified57.7%
Taylor expanded in x around inf 84.4%
associate--l+84.4%
unpow284.4%
distribute-lft-out84.4%
unpow284.4%
unpow284.4%
associate-*r/84.4%
mul-1-neg84.4%
unpow284.4%
fma-udef84.4%
unpow284.4%
Simplified84.4%
if -4.19999999999999964e-251 < t < 1.05e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 76.3%
associate-*r/76.3%
metadata-eval76.3%
+-commutative76.3%
associate-*r/76.3%
metadata-eval76.3%
unpow276.3%
associate-*r/76.3%
metadata-eval76.3%
Simplified76.3%
if 1.05e-195 < t < 2.75000000000000015e-105Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 2.75000000000000015e-105 < t < 3.6e-71Initial program 14.9%
associate-*r/14.7%
fma-neg14.7%
sub-neg14.7%
metadata-eval14.7%
+-commutative14.7%
fma-def14.7%
distribute-rgt-neg-in14.7%
Simplified14.7%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 58.0%
if 3.6e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification83.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* 2.0 (* t t)))
(t_2 (/ (+ x 1.0) (+ x -1.0)))
(t_3 (* (sqrt 2.0) t))
(t_4 (/ t_3 (sqrt (- (* (+ (* l l) t_1) t_2) (* l l)))))
(t_5 (fma l l t_1)))
(if (<= t_4 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_4 0.0)
(/ 1.0 (/ (hypot (* (hypot l t_3) (sqrt t_2)) l) t_3))
(if (<= t_4 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(fma
2.0
(/ (* t t) (pow x 3.0))
(+
(+ (* 2.0 (+ (* t t) (/ (* t t) x))) (/ (* l l) (pow x 3.0)))
(/ (+ t_5 t_5) (* x x))))
(+ (/ t_5 (pow x 3.0)) (/ t_5 x)))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 * (t * t);
double t_2 = (x + 1.0) / (x + -1.0);
double t_3 = sqrt(2.0) * t;
double t_4 = t_3 / sqrt(((((l * l) + t_1) * t_2) - (l * l)));
double t_5 = fma(l, l, t_1);
double tmp;
if (t_4 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_4 <= 0.0) {
tmp = 1.0 / (hypot((hypot(l, t_3) * sqrt(t_2)), l) / t_3);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + (fma(2.0, ((t * t) / pow(x, 3.0)), (((2.0 * ((t * t) + ((t * t) / x))) + ((l * l) / pow(x, 3.0))) + ((t_5 + t_5) / (x * x)))) + ((t_5 / pow(x, 3.0)) + (t_5 / x))))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 * Float64(t * t)) t_2 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_3 = Float64(sqrt(2.0) * t) t_4 = Float64(t_3 / sqrt(Float64(Float64(Float64(Float64(l * l) + t_1) * t_2) - Float64(l * l)))) t_5 = fma(l, l, t_1) tmp = 0.0 if (t_4 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_4 <= 0.0) tmp = Float64(1.0 / Float64(hypot(Float64(hypot(l, t_3) * sqrt(t_2)), l) / t_3)); elseif (t_4 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(fma(2.0, Float64(Float64(t * t) / (x ^ 3.0)), Float64(Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(Float64(l * l) / (x ^ 3.0))) + Float64(Float64(t_5 + t_5) / Float64(x * x)))) + Float64(Float64(t_5 / (x ^ 3.0)) + Float64(t_5 / x))))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(l * l + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$4, 0.0], N[(1.0 / N[(N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$3 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 + t$95$5), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(t \cdot t\right)\\
t_2 := \frac{x + 1}{x + -1}\\
t_3 := \sqrt{2} \cdot t\\
t_4 := \frac{t_3}{\sqrt{\left(\ell \cdot \ell + t_1\right) \cdot t_2 - \ell \cdot \ell}}\\
t_5 := \mathsf{fma}\left(\ell, \ell, t_1\right)\\
\mathbf{if}\;t_4 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_3\right) \cdot \sqrt{t_2}, \ell\right)}{t_3}}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\mathsf{fma}\left(2, \frac{t \cdot t}{{x}^{3}}, \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\ell \cdot \ell}{{x}^{3}}\right) + \frac{t_5 + t_5}{x \cdot x}\right) + \left(\frac{t_5}{{x}^{3}} + \frac{t_5}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.0Initial program 7.2%
associate-*r/7.2%
fma-neg7.4%
sub-neg7.4%
metadata-eval7.4%
+-commutative7.4%
fma-def7.4%
distribute-rgt-neg-in7.4%
Simplified7.4%
Applied egg-rr94.6%
if -0.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 57.3%
associate-*l/57.5%
Simplified57.5%
Taylor expanded in x around -inf 84.8%
Simplified84.8%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* 2.0 (* t t)))
(t_2 (/ (+ x 1.0) (+ x -1.0)))
(t_3 (fma l l t_1))
(t_4 (* (sqrt 2.0) t))
(t_5 (/ t_4 (sqrt (- (* (+ (* l l) t_1) t_2) (* l l))))))
(if (<= t_5 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_5 0.0)
(/ 1.0 (/ (hypot (* (hypot l t_4) (sqrt t_2)) l) t_4))
(if (<= t_5 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(+ (* 2.0 (+ (* t t) (/ (* t t) x))) (/ (+ t_3 t_3) (* x x)))
(/ t_3 x))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 * (t * t);
double t_2 = (x + 1.0) / (x + -1.0);
double t_3 = fma(l, l, t_1);
double t_4 = sqrt(2.0) * t;
double t_5 = t_4 / sqrt(((((l * l) + t_1) * t_2) - (l * l)));
double tmp;
if (t_5 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_5 <= 0.0) {
tmp = 1.0 / (hypot((hypot(l, t_4) * sqrt(t_2)), l) / t_4);
} else if (t_5 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + (((2.0 * ((t * t) + ((t * t) / x))) + ((t_3 + t_3) / (x * x))) + (t_3 / x)))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 * Float64(t * t)) t_2 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_3 = fma(l, l, t_1) t_4 = Float64(sqrt(2.0) * t) t_5 = Float64(t_4 / sqrt(Float64(Float64(Float64(Float64(l * l) + t_1) * t_2) - Float64(l * l)))) tmp = 0.0 if (t_5 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_5 <= 0.0) tmp = Float64(1.0 / Float64(hypot(Float64(hypot(l, t_4) * sqrt(t_2)), l) / t_4)); elseif (t_5 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(Float64(t_3 + t_3) / Float64(x * x))) + Float64(t_3 / x)))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(l * l + t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$5, 0.0], N[(1.0 / N[(N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$4 ^ 2], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 + t$95$3), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 \cdot \left(t \cdot t\right)\\
t_2 := \frac{x + 1}{x + -1}\\
t_3 := \mathsf{fma}\left(\ell, \ell, t_1\right)\\
t_4 := \sqrt{2} \cdot t\\
t_5 := \frac{t_4}{\sqrt{\left(\ell \cdot \ell + t_1\right) \cdot t_2 - \ell \cdot \ell}}\\
\mathbf{if}\;t_5 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_4\right) \cdot \sqrt{t_2}, \ell\right)}{t_4}}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{t_3 + t_3}{x \cdot x}\right) + \frac{t_3}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.0Initial program 7.2%
associate-*r/7.2%
fma-neg7.4%
sub-neg7.4%
metadata-eval7.4%
+-commutative7.4%
fma-def7.4%
distribute-rgt-neg-in7.4%
Simplified7.4%
Applied egg-rr94.6%
if -0.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 57.3%
associate-*l/57.5%
Simplified57.5%
Taylor expanded in x around -inf 84.6%
associate--l+84.6%
unpow284.6%
sub-neg84.6%
Simplified84.6%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_3 2.0)
(/ 1.0 (/ (hypot (* (hypot l t_2) (sqrt t_1)) l) t_2))
(if (<= t_3 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_4 (+ t_4 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = 1.0 / (hypot((hypot(l, t_2) * sqrt(t_1)), l) / t_2);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(2.0) * t;
double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = 1.0 / (Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_1)), l) / t_2);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(2.0) * t t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -0.5: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t_3 <= 2.0: tmp = 1.0 / (math.hypot((math.hypot(l, t_2) * math.sqrt(t_1)), l) / t_2) elif t_3 <= math.inf: tmp = t * (math.sqrt(2.0) / math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_3 <= 2.0) tmp = Float64(1.0 / Float64(hypot(Float64(hypot(l, t_2) * sqrt(t_1)), l) / t_2)); elseif (t_3 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_4 + Float64(t_4 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(2.0) * t; t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -0.5) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t_3 <= 2.0) tmp = 1.0 / (hypot((hypot(l, t_2) * sqrt(t_1)), l) / t_2); elseif (t_3 <= Inf) tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = sqrt(2.0) * (t / (l * sqrt((2.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[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$3, 2.0], N[(1.0 / N[(N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$4 + N[(t$95$4 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_1}, \ell\right)}{t_2}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_4 + \left(t_4 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 37.0%
associate-*r/36.9%
fma-neg36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
fma-def36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Applied egg-rr95.5%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 67.4%
associate--l+67.4%
unpow267.4%
distribute-lft-out67.4%
unpow267.4%
unpow267.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
fma-udef67.4%
unpow267.4%
Simplified67.4%
Taylor expanded in l around inf 67.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_3 2.0)
(* (sqrt 2.0) (/ t (hypot (* (hypot l t_2) (sqrt t_1)) l)))
(if (<= t_3 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_4 (+ t_4 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = sqrt(2.0) * (t / hypot((hypot(l, t_2) * sqrt(t_1)), l));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(2.0) * t;
double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = Math.sqrt(2.0) * (t / Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_1)), l));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(2.0) * t t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -0.5: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t_3 <= 2.0: tmp = math.sqrt(2.0) * (t / math.hypot((math.hypot(l, t_2) * math.sqrt(t_1)), l)) elif t_3 <= math.inf: tmp = t * (math.sqrt(2.0) / math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_3 <= 2.0) tmp = Float64(sqrt(2.0) * Float64(t / hypot(Float64(hypot(l, t_2) * sqrt(t_1)), l))); elseif (t_3 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_4 + Float64(t_4 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(2.0) * t; t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -0.5) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t_3 <= 2.0) tmp = sqrt(2.0) * (t / hypot((hypot(l, t_2) * sqrt(t_1)), l)); elseif (t_3 <= Inf) tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = sqrt(2.0) * (t / (l * sqrt((2.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[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$3, 2.0], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$4 + N[(t$95$4 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_1}, \ell\right)}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_4 + \left(t_4 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 37.0%
Applied egg-rr95.2%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 67.4%
associate--l+67.4%
unpow267.4%
distribute-lft-out67.4%
unpow267.4%
unpow267.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
fma-udef67.4%
unpow267.4%
Simplified67.4%
Taylor expanded in l around inf 67.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_3 2.0)
(/ (sqrt 2.0) (/ (hypot (* (hypot l t_2) (sqrt t_1)) l) t))
(if (<= t_3 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_4 (+ t_4 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = sqrt(2.0) / (hypot((hypot(l, t_2) * sqrt(t_1)), l) / t);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(2.0) * t;
double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = Math.sqrt(2.0) / (Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_1)), l) / t);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(2.0) * t t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -0.5: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t_3 <= 2.0: tmp = math.sqrt(2.0) / (math.hypot((math.hypot(l, t_2) * math.sqrt(t_1)), l) / t) elif t_3 <= math.inf: tmp = t * (math.sqrt(2.0) / math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_3 <= 2.0) tmp = Float64(sqrt(2.0) / Float64(hypot(Float64(hypot(l, t_2) * sqrt(t_1)), l) / t)); elseif (t_3 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_4 + Float64(t_4 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(2.0) * t; t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -0.5) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t_3 <= 2.0) tmp = sqrt(2.0) / (hypot((hypot(l, t_2) * sqrt(t_1)), l) / t); elseif (t_3 <= Inf) tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = sqrt(2.0) * (t / (l * sqrt((2.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[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$3, 2.0], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$4 + N[(t$95$4 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_1}, \ell\right)}{t}}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_4 + \left(t_4 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 37.0%
associate-*r/36.9%
fma-neg36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
fma-def36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Applied egg-rr95.3%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 67.4%
associate--l+67.4%
unpow267.4%
distribute-lft-out67.4%
unpow267.4%
unpow267.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
fma-udef67.4%
unpow267.4%
Simplified67.4%
Taylor expanded in l around inf 67.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (+ x 1.0) (+ x -1.0)))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ t_2 (sqrt (- (* (+ (* l l) (* 2.0 (* t t))) t_1) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 -0.5)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t_3 2.0)
(/ t_2 (hypot (* (hypot l t_2) (sqrt t_1)) l))
(if (<= t_3 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_4 (+ t_4 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = sqrt(2.0) * t;
double t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_1)), l);
} else if (t_3 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (x + 1.0) / (x + -1.0);
double t_2 = Math.sqrt(2.0) * t;
double t_3 = t_2 / Math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -0.5) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t_3 <= 2.0) {
tmp = t_2 / Math.hypot((Math.hypot(l, t_2) * Math.sqrt(t_1)), l);
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (x + 1.0) / (x + -1.0) t_2 = math.sqrt(2.0) * t t_3 = t_2 / math.sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -0.5: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t_3 <= 2.0: tmp = t_2 / math.hypot((math.hypot(l, t_2) * math.sqrt(t_1)), l) elif t_3 <= math.inf: tmp = t * (math.sqrt(2.0) / math.sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(t_2 / sqrt(Float64(Float64(Float64(Float64(l * l) + Float64(2.0 * Float64(t * t))) * t_1) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= -0.5) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t_3 <= 2.0) tmp = Float64(t_2 / hypot(Float64(hypot(l, t_2) * sqrt(t_1)), l)); elseif (t_3 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_4 + Float64(t_4 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (x + 1.0) / (x + -1.0); t_2 = sqrt(2.0) * t; t_3 = t_2 / sqrt(((((l * l) + (2.0 * (t * t))) * t_1) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -0.5) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t_3 <= 2.0) tmp = t_2 / hypot((hypot(l, t_2) * sqrt(t_1)), l); elseif (t_3 <= Inf) tmp = t * (sqrt(2.0) / sqrt((t_4 + (t_4 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = sqrt(2.0) * (t / (l * sqrt((2.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[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, -0.5], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t$95$3, 2.0], N[(t$95$2 / N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$4 + N[(t$95$4 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{x + 1}{x + -1}\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{t_2}{\sqrt{\left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) \cdot t_1 - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -0.5:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\frac{t_2}{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_1}, \ell\right)}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_4 + \left(t_4 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -0.5Initial program 54.1%
associate-*r/54.1%
fma-neg54.1%
sub-neg54.1%
metadata-eval54.1%
+-commutative54.1%
fma-def54.1%
distribute-rgt-neg-in54.1%
Simplified54.1%
Applied egg-rr73.8%
Taylor expanded in t around -inf 87.4%
mul-1-neg87.4%
sub-neg87.4%
metadata-eval87.4%
+-commutative87.4%
Simplified87.4%
if -0.5 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 2Initial program 37.0%
associate-*r/36.9%
fma-neg36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
fma-def36.9%
distribute-rgt-neg-in36.9%
Simplified36.9%
Applied egg-rr95.5%
if 2 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 67.4%
associate--l+67.4%
unpow267.4%
distribute-lft-out67.4%
unpow267.4%
unpow267.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
fma-udef67.4%
unpow267.4%
Simplified67.4%
Taylor expanded in l around inf 67.4%
associate-*r/67.4%
mul-1-neg67.4%
unpow267.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*r/0.0%
fma-neg0.0%
sub-neg0.0%
metadata-eval0.0%
+-commutative0.0%
fma-def0.0%
distribute-rgt-neg-in0.0%
Simplified0.0%
Taylor expanded in l around inf 1.7%
*-commutative1.7%
associate--l+1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
sub-neg1.7%
metadata-eval1.7%
+-commutative1.7%
Simplified1.7%
Taylor expanded in x around inf 47.9%
Final simplification79.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_2 (- t_1))
(t_3 (/ (* l l) x)))
(if (<= t -1.7e+25)
t_2
(if (<= t -6.5e-162)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_3 (+ t_3 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t -1.2e-250)
t_2
(if (<= t 2e-195)
(*
(sqrt 2.0)
(/
t
(*
l
(sqrt (+ (/ 2.0 x) (+ (/ 2.0 (* x x)) (/ 2.0 (pow x 3.0))))))))
(if (<= t 2.7e-105)
t_1
(if (<= t 4.6e-71)
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x)))))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double t_3 = (l * l) / x;
double tmp;
if (t <= -1.7e+25) {
tmp = t_2;
} else if (t <= -6.5e-162) {
tmp = t * (sqrt(2.0) / sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -1.2e-250) {
tmp = t_2;
} else if (t <= 2e-195) {
tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + ((2.0 / (x * x)) + (2.0 / pow(x, 3.0)))))));
} else if (t <= 2.7e-105) {
tmp = t_1;
} else if (t <= 4.6e-71) {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = -t_1
t_3 = (l * l) / x
if (t <= (-1.7d+25)) then
tmp = t_2
else if (t <= (-6.5d-162)) then
tmp = t * (sqrt(2.0d0) / sqrt((t_3 + (t_3 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else if (t <= (-1.2d-250)) then
tmp = t_2
else if (t <= 2d-195) then
tmp = sqrt(2.0d0) * (t / (l * sqrt(((2.0d0 / x) + ((2.0d0 / (x * x)) + (2.0d0 / (x ** 3.0d0)))))))
else if (t <= 2.7d-105) then
tmp = t_1
else if (t <= 4.6d-71) then
tmp = sqrt(2.0d0) * (t / (l * sqrt((2.0d0 / x))))
else
tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
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(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double t_3 = (l * l) / x;
double tmp;
if (t <= -1.7e+25) {
tmp = t_2;
} else if (t <= -6.5e-162) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -1.2e-250) {
tmp = t_2;
} else if (t <= 2e-195) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((2.0 / x) + ((2.0 / (x * x)) + (2.0 / Math.pow(x, 3.0)))))));
} else if (t <= 2.7e-105) {
tmp = t_1;
} else if (t <= 4.6e-71) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = -t_1 t_3 = (l * l) / x tmp = 0 if t <= -1.7e+25: tmp = t_2 elif t <= -6.5e-162: tmp = t * (math.sqrt(2.0) / math.sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x))))))) elif t <= -1.2e-250: tmp = t_2 elif t <= 2e-195: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((2.0 / x) + ((2.0 / (x * x)) + (2.0 / math.pow(x, 3.0))))))) elif t <= 2.7e-105: tmp = t_1 elif t <= 4.6e-71: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = Float64(-t_1) t_3 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1.7e+25) tmp = t_2; elseif (t <= -6.5e-162) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_3 + Float64(t_3 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); elseif (t <= -1.2e-250) tmp = t_2; elseif (t <= 2e-195) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / (x ^ 3.0)))))))); elseif (t <= 2.7e-105) tmp = t_1; elseif (t <= 4.6e-71) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = -t_1; t_3 = (l * l) / x; tmp = 0.0; if (t <= -1.7e+25) tmp = t_2; elseif (t <= -6.5e-162) tmp = t * (sqrt(2.0) / sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x))))))); elseif (t <= -1.2e-250) tmp = t_2; elseif (t <= 2e-195) tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + ((2.0 / (x * x)) + (2.0 / (x ^ 3.0))))))); elseif (t <= 2.7e-105) tmp = t_1; elseif (t <= 4.6e-71) tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x)))); else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); 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[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.7e+25], t$95$2, If[LessEqual[t, -6.5e-162], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$3 + N[(t$95$3 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.2e-250], t$95$2, If[LessEqual[t, 2e-195], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-105], t$95$1, If[LessEqual[t, 4.6e-71], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := -t_1\\
t_3 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+25}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -6.5 \cdot 10^{-162}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_3 + \left(t_3 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-250}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-195}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \left(\frac{2}{x \cdot x} + \frac{2}{{x}^{3}}\right)}}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -1.69999999999999992e25 or -6.49999999999999989e-162 < t < -1.1999999999999999e-250Initial program 25.5%
associate-*r/25.5%
fma-neg25.5%
sub-neg25.5%
metadata-eval25.5%
+-commutative25.5%
fma-def25.5%
distribute-rgt-neg-in25.5%
Simplified25.5%
Applied egg-rr82.9%
Taylor expanded in t around -inf 90.1%
mul-1-neg90.1%
sub-neg90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
if -1.69999999999999992e25 < t < -6.49999999999999989e-162Initial program 57.4%
associate-*l/57.7%
Simplified57.7%
Taylor expanded in x around inf 84.4%
associate--l+84.4%
unpow284.4%
distribute-lft-out84.4%
unpow284.4%
unpow284.4%
associate-*r/84.4%
mul-1-neg84.4%
unpow284.4%
fma-udef84.4%
unpow284.4%
Simplified84.4%
Taylor expanded in l around inf 83.7%
associate-*r/83.7%
mul-1-neg83.7%
unpow283.7%
distribute-rgt-neg-in83.7%
Simplified83.7%
if -1.1999999999999999e-250 < t < 2.0000000000000002e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 76.3%
associate-*r/76.3%
metadata-eval76.3%
+-commutative76.3%
associate-*r/76.3%
metadata-eval76.3%
unpow276.3%
associate-*r/76.3%
metadata-eval76.3%
Simplified76.3%
if 2.0000000000000002e-195 < t < 2.69999999999999993e-105Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 2.69999999999999993e-105 < t < 4.5999999999999997e-71Initial program 14.9%
associate-*r/14.7%
fma-neg14.7%
sub-neg14.7%
metadata-eval14.7%
+-commutative14.7%
fma-def14.7%
distribute-rgt-neg-in14.7%
Simplified14.7%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 58.0%
if 4.5999999999999997e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification83.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_2 (- t_1))
(t_3 (/ (* l l) x)))
(if (<= t -1.9e+27)
t_2
(if (<= t -2.75e-163)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_3 (+ t_3 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(if (<= t -2.2e-253)
t_2
(if (<= t 1.25e-195)
(* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 9.5e-107)
t_1
(if (<= t 3.3e-71)
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x)))))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double t_3 = (l * l) / x;
double tmp;
if (t <= -1.9e+27) {
tmp = t_2;
} else if (t <= -2.75e-163) {
tmp = t * (sqrt(2.0) / sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -2.2e-253) {
tmp = t_2;
} else if (t <= 1.25e-195) {
tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 9.5e-107) {
tmp = t_1;
} else if (t <= 3.3e-71) {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = -t_1
t_3 = (l * l) / x
if (t <= (-1.9d+27)) then
tmp = t_2
else if (t <= (-2.75d-163)) then
tmp = t * (sqrt(2.0d0) / sqrt((t_3 + (t_3 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else if (t <= (-2.2d-253)) then
tmp = t_2
else if (t <= 1.25d-195) then
tmp = sqrt(2.0d0) * (t / (l * sqrt(((2.0d0 / x) + (2.0d0 / (x * x))))))
else if (t <= 9.5d-107) then
tmp = t_1
else if (t <= 3.3d-71) then
tmp = sqrt(2.0d0) * (t / (l * sqrt((2.0d0 / x))))
else
tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
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(((x + -1.0) / (x + 1.0)));
double t_2 = -t_1;
double t_3 = (l * l) / x;
double tmp;
if (t <= -1.9e+27) {
tmp = t_2;
} else if (t <= -2.75e-163) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else if (t <= -2.2e-253) {
tmp = t_2;
} else if (t <= 1.25e-195) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 9.5e-107) {
tmp = t_1;
} else if (t <= 3.3e-71) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = -t_1 t_3 = (l * l) / x tmp = 0 if t <= -1.9e+27: tmp = t_2 elif t <= -2.75e-163: tmp = t * (math.sqrt(2.0) / math.sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x))))))) elif t <= -2.2e-253: tmp = t_2 elif t <= 1.25e-195: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((2.0 / x) + (2.0 / (x * x)))))) elif t <= 9.5e-107: tmp = t_1 elif t <= 3.3e-71: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = Float64(-t_1) t_3 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1.9e+27) tmp = t_2; elseif (t <= -2.75e-163) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_3 + Float64(t_3 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); elseif (t <= -2.2e-253) tmp = t_2; elseif (t <= 1.25e-195) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 9.5e-107) tmp = t_1; elseif (t <= 3.3e-71) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = -t_1; t_3 = (l * l) / x; tmp = 0.0; if (t <= -1.9e+27) tmp = t_2; elseif (t <= -2.75e-163) tmp = t * (sqrt(2.0) / sqrt((t_3 + (t_3 + (2.0 * ((t * t) + ((t * t) / x))))))); elseif (t <= -2.2e-253) tmp = t_2; elseif (t <= 1.25e-195) tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * x)))))); elseif (t <= 9.5e-107) tmp = t_1; elseif (t <= 3.3e-71) tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x)))); else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); 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[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = (-t$95$1)}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.9e+27], t$95$2, If[LessEqual[t, -2.75e-163], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$3 + N[(t$95$3 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.2e-253], t$95$2, If[LessEqual[t, 1.25e-195], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e-107], t$95$1, If[LessEqual[t, 3.3e-71], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := -t_1\\
t_3 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1.9 \cdot 10^{+27}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -2.75 \cdot 10^{-163}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_3 + \left(t_3 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{elif}\;t \leq -2.2 \cdot 10^{-253}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-195}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-107}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -1.90000000000000011e27 or -2.7499999999999999e-163 < t < -2.19999999999999996e-253Initial program 25.5%
associate-*r/25.5%
fma-neg25.5%
sub-neg25.5%
metadata-eval25.5%
+-commutative25.5%
fma-def25.5%
distribute-rgt-neg-in25.5%
Simplified25.5%
Applied egg-rr82.9%
Taylor expanded in t around -inf 90.1%
mul-1-neg90.1%
sub-neg90.1%
metadata-eval90.1%
+-commutative90.1%
Simplified90.1%
if -1.90000000000000011e27 < t < -2.7499999999999999e-163Initial program 57.4%
associate-*l/57.7%
Simplified57.7%
Taylor expanded in x around inf 84.4%
associate--l+84.4%
unpow284.4%
distribute-lft-out84.4%
unpow284.4%
unpow284.4%
associate-*r/84.4%
mul-1-neg84.4%
unpow284.4%
fma-udef84.4%
unpow284.4%
Simplified84.4%
Taylor expanded in l around inf 83.7%
associate-*r/83.7%
mul-1-neg83.7%
unpow283.7%
distribute-rgt-neg-in83.7%
Simplified83.7%
if -2.19999999999999996e-253 < t < 1.25000000000000002e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 76.1%
associate-*r/76.1%
metadata-eval76.1%
unpow276.1%
associate-*r/76.1%
metadata-eval76.1%
Simplified76.1%
if 1.25000000000000002e-195 < t < 9.4999999999999999e-107Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 9.4999999999999999e-107 < t < 3.3000000000000002e-71Initial program 14.9%
associate-*r/14.7%
fma-neg14.7%
sub-neg14.7%
metadata-eval14.7%
+-commutative14.7%
fma-def14.7%
distribute-rgt-neg-in14.7%
Simplified14.7%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 58.0%
if 3.3000000000000002e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification83.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -7.5e-252)
(- t_1)
(if (<= t 1.05e-195)
(* (sqrt 2.0) (/ t (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 2.4e-104)
t_1
(if (<= t 6.6e-71)
(* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x)))))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7.5e-252) {
tmp = -t_1;
} else if (t <= 1.05e-195) {
tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 2.4e-104) {
tmp = t_1;
} else if (t <= 6.6e-71) {
tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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) :: t_1
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-7.5d-252)) then
tmp = -t_1
else if (t <= 1.05d-195) then
tmp = sqrt(2.0d0) * (t / (l * sqrt(((2.0d0 / x) + (2.0d0 / (x * x))))))
else if (t <= 2.4d-104) then
tmp = t_1
else if (t <= 6.6d-71) then
tmp = sqrt(2.0d0) * (t / (l * sqrt((2.0d0 / x))))
else
tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
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(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -7.5e-252) {
tmp = -t_1;
} else if (t <= 1.05e-195) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 2.4e-104) {
tmp = t_1;
} else if (t <= 6.6e-71) {
tmp = Math.sqrt(2.0) * (t / (l * Math.sqrt((2.0 / x))));
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -7.5e-252: tmp = -t_1 elif t <= 1.05e-195: tmp = math.sqrt(2.0) * (t / (l * math.sqrt(((2.0 / x) + (2.0 / (x * x)))))) elif t <= 2.4e-104: tmp = t_1 elif t <= 6.6e-71: tmp = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -7.5e-252) tmp = Float64(-t_1); elseif (t <= 1.05e-195) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 2.4e-104) tmp = t_1; elseif (t <= 6.6e-71) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -7.5e-252) tmp = -t_1; elseif (t <= 1.05e-195) tmp = sqrt(2.0) * (t / (l * sqrt(((2.0 / x) + (2.0 / (x * x)))))); elseif (t <= 2.4e-104) tmp = t_1; elseif (t <= 6.6e-71) tmp = sqrt(2.0) * (t / (l * sqrt((2.0 / x)))); else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); 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[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -7.5e-252], (-t$95$1), If[LessEqual[t, 1.05e-195], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-104], t$95$1, If[LessEqual[t, 6.6e-71], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{-252}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-195}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -7.4999999999999996e-252Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -7.4999999999999996e-252 < t < 1.05e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 76.1%
associate-*r/76.1%
metadata-eval76.1%
unpow276.1%
associate-*r/76.1%
metadata-eval76.1%
Simplified76.1%
if 1.05e-195 < t < 2.4000000000000001e-104Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 2.4000000000000001e-104 < t < 6.6000000000000003e-71Initial program 14.9%
associate-*r/14.7%
fma-neg14.7%
sub-neg14.7%
metadata-eval14.7%
+-commutative14.7%
fma-def14.7%
distribute-rgt-neg-in14.7%
Simplified14.7%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 58.0%
if 6.6000000000000003e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification81.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) (/ t (* l (sqrt (/ 2.0 x))))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -1.15e-250)
(- t_2)
(if (<= t 2.5e-195)
t_1
(if (<= t 9e-107)
t_2
(if (<= t 3.3e-71)
t_1
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * (t / (l * sqrt((2.0 / x))));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.15e-250) {
tmp = -t_2;
} else if (t <= 2.5e-195) {
tmp = t_1;
} else if (t <= 9e-107) {
tmp = t_2;
} else if (t <= 3.3e-71) {
tmp = t_1;
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(2.0d0) * (t / (l * sqrt((2.0d0 / x))))
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-1.15d-250)) then
tmp = -t_2
else if (t <= 2.5d-195) then
tmp = t_1
else if (t <= 9d-107) then
tmp = t_2
else if (t <= 3.3d-71) then
tmp = t_1
else
tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
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) * (t / (l * Math.sqrt((2.0 / x))));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -1.15e-250) {
tmp = -t_2;
} else if (t <= 2.5e-195) {
tmp = t_1;
} else if (t <= 9e-107) {
tmp = t_2;
} else if (t <= 3.3e-71) {
tmp = t_1;
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * (t / (l * math.sqrt((2.0 / x)))) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -1.15e-250: tmp = -t_2 elif t <= 2.5e-195: tmp = t_1 elif t <= 9e-107: tmp = t_2 elif t <= 3.3e-71: tmp = t_1 else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * Float64(t / Float64(l * sqrt(Float64(2.0 / x))))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -1.15e-250) tmp = Float64(-t_2); elseif (t <= 2.5e-195) tmp = t_1; elseif (t <= 9e-107) tmp = t_2; elseif (t <= 3.3e-71) tmp = t_1; else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * (t / (l * sqrt((2.0 / x)))); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -1.15e-250) tmp = -t_2; elseif (t <= 2.5e-195) tmp = t_1; elseif (t <= 9e-107) tmp = t_2; elseif (t <= 3.3e-71) tmp = t_1; else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.15e-250], (-t$95$2), If[LessEqual[t, 2.5e-195], t$95$1, If[LessEqual[t, 9e-107], t$95$2, If[LessEqual[t, 3.3e-71], t$95$1, N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot \frac{t}{\ell \cdot \sqrt{\frac{2}{x}}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{-250}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq 2.5 \cdot 10^{-195}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -1.15e-250Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -1.15e-250 < t < 2.50000000000000004e-195 or 9.00000000000000032e-107 < t < 3.3000000000000002e-71Initial program 8.4%
associate-*r/8.4%
fma-neg8.4%
sub-neg8.4%
metadata-eval8.4%
+-commutative8.4%
fma-def8.4%
distribute-rgt-neg-in8.4%
Simplified8.4%
Taylor expanded in l around inf 3.8%
*-commutative3.8%
associate--l+3.9%
sub-neg3.9%
metadata-eval3.9%
+-commutative3.9%
sub-neg3.9%
metadata-eval3.9%
+-commutative3.9%
Simplified3.9%
Taylor expanded in x around inf 71.0%
if 2.50000000000000004e-195 < t < 9.00000000000000032e-107Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 3.3000000000000002e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification81.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (sqrt (/ 2.0 x))))
(if (<= t -6.3e-251)
(- t_1)
(if (<= t 1.2e-195)
(* (/ (sqrt 2.0) l) (/ t t_2))
(if (<= t 8.5e-103)
t_1
(if (<= t 3.3e-71)
(* (sqrt 2.0) (/ t (* l t_2)))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = sqrt((2.0 / x));
double tmp;
if (t <= -6.3e-251) {
tmp = -t_1;
} else if (t <= 1.2e-195) {
tmp = (sqrt(2.0) / l) * (t / t_2);
} else if (t <= 8.5e-103) {
tmp = t_1;
} else if (t <= 3.3e-71) {
tmp = sqrt(2.0) * (t / (l * t_2));
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = sqrt((2.0d0 / x))
if (t <= (-6.3d-251)) then
tmp = -t_1
else if (t <= 1.2d-195) then
tmp = (sqrt(2.0d0) / l) * (t / t_2)
else if (t <= 8.5d-103) then
tmp = t_1
else if (t <= 3.3d-71) then
tmp = sqrt(2.0d0) * (t / (l * t_2))
else
tmp = t / (t * sqrt(((x + 1.0d0) / (x + (-1.0d0)))))
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(((x + -1.0) / (x + 1.0)));
double t_2 = Math.sqrt((2.0 / x));
double tmp;
if (t <= -6.3e-251) {
tmp = -t_1;
} else if (t <= 1.2e-195) {
tmp = (Math.sqrt(2.0) / l) * (t / t_2);
} else if (t <= 8.5e-103) {
tmp = t_1;
} else if (t <= 3.3e-71) {
tmp = Math.sqrt(2.0) * (t / (l * t_2));
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = math.sqrt((2.0 / x)) tmp = 0 if t <= -6.3e-251: tmp = -t_1 elif t <= 1.2e-195: tmp = (math.sqrt(2.0) / l) * (t / t_2) elif t <= 8.5e-103: tmp = t_1 elif t <= 3.3e-71: tmp = math.sqrt(2.0) * (t / (l * t_2)) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = sqrt(Float64(2.0 / x)) tmp = 0.0 if (t <= -6.3e-251) tmp = Float64(-t_1); elseif (t <= 1.2e-195) tmp = Float64(Float64(sqrt(2.0) / l) * Float64(t / t_2)); elseif (t <= 8.5e-103) tmp = t_1; elseif (t <= 3.3e-71) tmp = Float64(sqrt(2.0) * Float64(t / Float64(l * t_2))); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = sqrt((2.0 / x)); tmp = 0.0; if (t <= -6.3e-251) tmp = -t_1; elseif (t <= 1.2e-195) tmp = (sqrt(2.0) / l) * (t / t_2); elseif (t <= 8.5e-103) tmp = t_1; elseif (t <= 3.3e-71) tmp = sqrt(2.0) * (t / (l * t_2)); else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); 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[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 / x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -6.3e-251], (-t$95$1), If[LessEqual[t, 1.2e-195], N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-103], t$95$1, If[LessEqual[t, 3.3e-71], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[(l * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \sqrt{\frac{2}{x}}\\
\mathbf{if}\;t \leq -6.3 \cdot 10^{-251}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-195}:\\
\;\;\;\;\frac{\sqrt{2}}{\ell} \cdot \frac{t}{t_2}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-103}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{-71}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t}{\ell \cdot t_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -6.2999999999999998e-251Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -6.2999999999999998e-251 < t < 1.2e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 74.6%
associate-*r/74.6%
Applied egg-rr74.6%
times-frac74.6%
Simplified74.6%
if 1.2e-195 < t < 8.50000000000000032e-103Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr49.5%
Taylor expanded in l around 0 73.7%
if 8.50000000000000032e-103 < t < 3.3000000000000002e-71Initial program 14.9%
associate-*r/14.7%
fma-neg14.7%
sub-neg14.7%
metadata-eval14.7%
+-commutative14.7%
fma-def14.7%
distribute-rgt-neg-in14.7%
Simplified14.7%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
sub-neg1.8%
metadata-eval1.8%
+-commutative1.8%
Simplified1.8%
Taylor expanded in x around inf 58.0%
if 3.3000000000000002e-71 < t Initial program 31.0%
associate-*r/30.9%
fma-neg30.9%
sub-neg30.9%
metadata-eval30.9%
+-commutative30.9%
fma-def30.9%
distribute-rgt-neg-in30.9%
Simplified30.9%
Applied egg-rr68.8%
Taylor expanded in l around 0 82.2%
Final simplification81.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -2.4e-251)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.25e-195)
(* (/ t l) (sqrt x))
(/ t (* t (sqrt (/ (+ x 1.0) (+ x -1.0))))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2.4e-251) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.25e-195) {
tmp = (t / l) * sqrt(x);
} else {
tmp = t / (t * sqrt(((x + 1.0) / (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 <= (-2.4d-251)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.25d-195) then
tmp = (t / l) * sqrt(x)
else
tmp = t / (t * sqrt(((x + 1.0d0) / (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 <= -2.4e-251) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.25e-195) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t / (t * Math.sqrt(((x + 1.0) / (x + -1.0))));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2.4e-251: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.25e-195: tmp = (t / l) * math.sqrt(x) else: tmp = t / (t * math.sqrt(((x + 1.0) / (x + -1.0)))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2.4e-251) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.25e-195) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = Float64(t / Float64(t * sqrt(Float64(Float64(x + 1.0) / Float64(x + -1.0))))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -2.4e-251) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.25e-195) tmp = (t / l) * sqrt(x); else tmp = t / (t * sqrt(((x + 1.0) / (x + -1.0)))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -2.4e-251], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.25e-195], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(t / N[(t * N[Sqrt[N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{-251}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{-195}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{t \cdot \sqrt{\frac{x + 1}{x + -1}}}\\
\end{array}
\end{array}
if t < -2.39999999999999996e-251Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -2.39999999999999996e-251 < t < 1.25000000000000002e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in t around 0 67.4%
if 1.25000000000000002e-195 < t Initial program 29.7%
associate-*r/29.6%
fma-neg29.6%
sub-neg29.6%
metadata-eval29.6%
+-commutative29.6%
fma-def29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Applied egg-rr63.8%
Taylor expanded in l around 0 77.1%
Final simplification79.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -9.5e-251) (+ -1.0 (- (/ 1.0 x) (/ 0.5 (* x x)))) (if (<= t 1.35e-195) (* (/ t l) (sqrt x)) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -9.5e-251) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.35e-195) {
tmp = (t / l) * sqrt(x);
} else {
tmp = sqrt(((x + -1.0) / (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 <= (-9.5d-251)) then
tmp = (-1.0d0) + ((1.0d0 / x) - (0.5d0 / (x * x)))
else if (t <= 1.35d-195) then
tmp = (t / l) * sqrt(x)
else
tmp = sqrt(((x + (-1.0d0)) / (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 <= -9.5e-251) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.35e-195) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = Math.sqrt(((x + -1.0) / (x + 1.0)));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -9.5e-251: tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))) elif t <= 1.35e-195: tmp = (t / l) * math.sqrt(x) else: tmp = math.sqrt(((x + -1.0) / (x + 1.0))) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -9.5e-251) tmp = Float64(-1.0 + Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x)))); elseif (t <= 1.35e-195) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -9.5e-251) tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))); elseif (t <= 1.35e-195) tmp = (t / l) * sqrt(x); else tmp = sqrt(((x + -1.0) / (x + 1.0))); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -9.5e-251], N[(-1.0 + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.35e-195], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-251}:\\
\;\;\;\;-1 + \left(\frac{1}{x} - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-195}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -9.49999999999999927e-251Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in x around inf 82.8%
associate--l+82.8%
associate-*r/82.8%
metadata-eval82.8%
unpow282.8%
Simplified82.8%
if -9.49999999999999927e-251 < t < 1.35e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in t around 0 67.4%
if 1.35e-195 < t Initial program 29.7%
associate-*r/29.6%
fma-neg29.6%
sub-neg29.6%
metadata-eval29.6%
+-commutative29.6%
fma-def29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Applied egg-rr64.0%
Taylor expanded in l around 0 77.1%
Final simplification78.9%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -8.2e-254)
(- t_1)
(if (<= t 1.45e-195) (* (/ t l) (sqrt x)) t_1))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -8.2e-254) {
tmp = -t_1;
} else if (t <= 1.45e-195) {
tmp = (t / l) * sqrt(x);
} else {
tmp = 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(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-8.2d-254)) then
tmp = -t_1
else if (t <= 1.45d-195) then
tmp = (t / l) * sqrt(x)
else
tmp = 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(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -8.2e-254) {
tmp = -t_1;
} else if (t <= 1.45e-195) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -8.2e-254: tmp = -t_1 elif t <= 1.45e-195: tmp = (t / l) * math.sqrt(x) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -8.2e-254) tmp = Float64(-t_1); elseif (t <= 1.45e-195) tmp = Float64(Float64(t / l) * sqrt(x)); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -8.2e-254) tmp = -t_1; elseif (t <= 1.45e-195) tmp = (t / l) * sqrt(x); else tmp = 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[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -8.2e-254], (-t$95$1), If[LessEqual[t, 1.45e-195], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -8.2 \cdot 10^{-254}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-195}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -8.20000000000000034e-254Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
if -8.20000000000000034e-254 < t < 1.4500000000000001e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in t around 0 67.4%
if 1.4500000000000001e-195 < t Initial program 29.7%
associate-*r/29.6%
fma-neg29.6%
sub-neg29.6%
metadata-eval29.6%
+-commutative29.6%
fma-def29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Applied egg-rr64.0%
Taylor expanded in l around 0 77.1%
Final simplification79.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -9e-251) (+ -1.0 (- (/ 1.0 x) (/ 0.5 (* x x)))) (if (<= t 1.2e-195) (* (/ t l) (sqrt x)) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -9e-251) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.2e-195) {
tmp = (t / l) * sqrt(x);
} 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 <= (-9d-251)) then
tmp = (-1.0d0) + ((1.0d0 / x) - (0.5d0 / (x * x)))
else if (t <= 1.2d-195) then
tmp = (t / l) * sqrt(x)
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 <= -9e-251) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.2e-195) {
tmp = (t / l) * Math.sqrt(x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -9e-251: tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))) elif t <= 1.2e-195: tmp = (t / l) * math.sqrt(x) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -9e-251) tmp = Float64(-1.0 + Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x)))); elseif (t <= 1.2e-195) tmp = Float64(Float64(t / l) * sqrt(x)); 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 <= -9e-251) tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))); elseif (t <= 1.2e-195) tmp = (t / l) * sqrt(x); 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, -9e-251], N[(-1.0 + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e-195], N[(N[(t / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-251}:\\
\;\;\;\;-1 + \left(\frac{1}{x} - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-195}:\\
\;\;\;\;\frac{t}{\ell} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -8.99999999999999956e-251Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in x around inf 82.8%
associate--l+82.8%
associate-*r/82.8%
metadata-eval82.8%
unpow282.8%
Simplified82.8%
if -8.99999999999999956e-251 < t < 1.2e-195Initial program 6.6%
associate-*r/6.6%
fma-neg6.6%
sub-neg6.6%
metadata-eval6.6%
+-commutative6.6%
fma-def6.6%
distribute-rgt-neg-in6.6%
Simplified6.6%
Taylor expanded in l around inf 4.4%
*-commutative4.4%
associate--l+4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
sub-neg4.4%
metadata-eval4.4%
+-commutative4.4%
Simplified4.4%
Taylor expanded in x around inf 74.6%
Taylor expanded in t around 0 67.4%
if 1.2e-195 < t Initial program 29.7%
associate-*l/29.8%
Simplified29.8%
Taylor expanded in x around inf 39.7%
fma-def39.7%
sub-neg39.7%
unpow239.7%
fma-udef39.7%
unpow239.7%
mul-1-neg39.7%
remove-double-neg39.7%
unpow239.7%
fma-udef39.7%
unpow239.7%
*-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 60.6%
mul-1-neg60.6%
unsub-neg60.6%
+-commutative60.6%
associate-*r/60.6%
metadata-eval60.6%
unpow260.6%
rem-square-sqrt60.6%
metadata-eval60.6%
unpow260.6%
unpow260.6%
rem-square-sqrt60.6%
unpow260.6%
Simplified60.6%
Taylor expanded in l around 0 76.3%
Final simplification78.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -7.2e-252) (+ -1.0 (/ 1.0 x)) (if (<= t 6.2e-236) (* 2.0 (/ x (* (/ l t) (/ l t)))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -7.2e-252) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 6.2e-236) {
tmp = 2.0 * (x / ((l / t) * (l / t)));
} 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 <= (-7.2d-252)) then
tmp = (-1.0d0) + (1.0d0 / x)
else if (t <= 6.2d-236) then
tmp = 2.0d0 * (x / ((l / t) * (l / t)))
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 <= -7.2e-252) {
tmp = -1.0 + (1.0 / x);
} else if (t <= 6.2e-236) {
tmp = 2.0 * (x / ((l / t) * (l / t)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -7.2e-252: tmp = -1.0 + (1.0 / x) elif t <= 6.2e-236: tmp = 2.0 * (x / ((l / t) * (l / t))) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -7.2e-252) tmp = Float64(-1.0 + Float64(1.0 / x)); elseif (t <= 6.2e-236) tmp = Float64(2.0 * Float64(x / Float64(Float64(l / t) * Float64(l / t)))); 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 <= -7.2e-252) tmp = -1.0 + (1.0 / x); elseif (t <= 6.2e-236) tmp = 2.0 * (x / ((l / t) * (l / t))); 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, -7.2e-252], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e-236], N[(2.0 * N[(x / N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-252}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{-236}:\\
\;\;\;\;2 \cdot \frac{x}{\frac{\ell}{t} \cdot \frac{\ell}{t}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -7.20000000000000046e-252Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in x around inf 82.2%
if -7.20000000000000046e-252 < t < 6.1999999999999997e-236Initial program 4.4%
associate-*l/4.4%
Simplified4.4%
Taylor expanded in x around inf 57.8%
fma-def57.8%
sub-neg57.8%
unpow257.8%
fma-udef57.8%
unpow257.8%
mul-1-neg57.8%
remove-double-neg57.8%
unpow257.8%
fma-udef57.8%
unpow257.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in l around inf 52.5%
associate-/l*52.5%
unpow252.5%
rem-square-sqrt52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in l around 0 52.1%
*-commutative52.1%
associate-/l*52.1%
unpow252.1%
unpow252.1%
times-frac52.9%
Simplified52.9%
if 6.1999999999999997e-236 < t Initial program 29.1%
associate-*l/29.2%
Simplified29.2%
Taylor expanded in x around inf 41.5%
fma-def41.5%
sub-neg41.5%
unpow241.5%
fma-udef41.5%
unpow241.5%
mul-1-neg41.5%
remove-double-neg41.5%
unpow241.5%
fma-udef41.5%
unpow241.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in x around inf 58.0%
mul-1-neg58.0%
unsub-neg58.0%
+-commutative58.0%
associate-*r/58.0%
metadata-eval58.0%
unpow258.0%
rem-square-sqrt58.0%
metadata-eval58.0%
unpow258.0%
unpow258.0%
rem-square-sqrt58.0%
unpow258.0%
Simplified58.0%
Taylor expanded in l around 0 74.8%
Final simplification76.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2.3e-253) (+ -1.0 (- (/ 1.0 x) (/ 0.5 (* x x)))) (if (<= t 1.55e-237) (* 2.0 (/ x (* (/ l t) (/ l t)))) (+ 1.0 (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2.3e-253) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.55e-237) {
tmp = 2.0 * (x / ((l / t) * (l / t)));
} 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 <= (-2.3d-253)) then
tmp = (-1.0d0) + ((1.0d0 / x) - (0.5d0 / (x * x)))
else if (t <= 1.55d-237) then
tmp = 2.0d0 * (x / ((l / t) * (l / t)))
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 <= -2.3e-253) {
tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x)));
} else if (t <= 1.55e-237) {
tmp = 2.0 * (x / ((l / t) * (l / t)));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -2.3e-253: tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))) elif t <= 1.55e-237: tmp = 2.0 * (x / ((l / t) * (l / t))) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -2.3e-253) tmp = Float64(-1.0 + Float64(Float64(1.0 / x) - Float64(0.5 / Float64(x * x)))); elseif (t <= 1.55e-237) tmp = Float64(2.0 * Float64(x / Float64(Float64(l / t) * Float64(l / t)))); 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 <= -2.3e-253) tmp = -1.0 + ((1.0 / x) - (0.5 / (x * x))); elseif (t <= 1.55e-237) tmp = 2.0 * (x / ((l / t) * (l / t))); 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, -2.3e-253], N[(-1.0 + N[(N[(1.0 / x), $MachinePrecision] - N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e-237], N[(2.0 * N[(x / N[(N[(l / t), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-253}:\\
\;\;\;\;-1 + \left(\frac{1}{x} - \frac{0.5}{x \cdot x}\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-237}:\\
\;\;\;\;2 \cdot \frac{x}{\frac{\ell}{t} \cdot \frac{\ell}{t}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -2.3e-253Initial program 35.1%
associate-*r/35.1%
fma-neg35.2%
sub-neg35.2%
metadata-eval35.2%
+-commutative35.2%
fma-def35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Applied egg-rr75.4%
Taylor expanded in t around -inf 83.8%
mul-1-neg83.8%
sub-neg83.8%
metadata-eval83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in x around inf 82.8%
associate--l+82.8%
associate-*r/82.8%
metadata-eval82.8%
unpow282.8%
Simplified82.8%
if -2.3e-253 < t < 1.5499999999999999e-237Initial program 4.4%
associate-*l/4.4%
Simplified4.4%
Taylor expanded in x around inf 57.8%
fma-def57.8%
sub-neg57.8%
unpow257.8%
fma-udef57.8%
unpow257.8%
mul-1-neg57.8%
remove-double-neg57.8%
unpow257.8%
fma-udef57.8%
unpow257.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in l around inf 52.5%
associate-/l*52.5%
unpow252.5%
rem-square-sqrt52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in l around 0 52.1%
*-commutative52.1%
associate-/l*52.1%
unpow252.1%
unpow252.1%
times-frac52.9%
Simplified52.9%
if 1.5499999999999999e-237 < t Initial program 29.1%
associate-*l/29.2%
Simplified29.2%
Taylor expanded in x around inf 41.5%
fma-def41.5%
sub-neg41.5%
unpow241.5%
fma-udef41.5%
unpow241.5%
mul-1-neg41.5%
remove-double-neg41.5%
unpow241.5%
fma-udef41.5%
unpow241.5%
*-commutative41.5%
Simplified41.5%
Taylor expanded in x around inf 58.0%
mul-1-neg58.0%
unsub-neg58.0%
+-commutative58.0%
associate-*r/58.0%
metadata-eval58.0%
unpow258.0%
rem-square-sqrt58.0%
metadata-eval58.0%
unpow258.0%
unpow258.0%
rem-square-sqrt58.0%
unpow258.0%
Simplified58.0%
Taylor expanded in l around 0 74.8%
Final simplification76.9%
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 33.5%
associate-*r/33.5%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
+-commutative33.6%
fma-def33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Applied egg-rr73.5%
Taylor expanded in t around -inf 79.7%
mul-1-neg79.7%
sub-neg79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in x around inf 77.3%
if -4.999999999999985e-310 < t Initial program 26.4%
associate-*l/26.5%
Simplified26.5%
Taylor expanded in x around inf 44.2%
fma-def44.2%
sub-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
mul-1-neg44.2%
remove-double-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in x around inf 52.5%
mul-1-neg52.5%
unsub-neg52.5%
+-commutative52.5%
associate-*r/52.5%
metadata-eval52.5%
unpow252.5%
rem-square-sqrt52.5%
metadata-eval52.5%
unpow252.5%
unpow252.5%
rem-square-sqrt52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in l around 0 68.8%
Final simplification73.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-310) (+ -1.0 (/ 1.0 x)) (+ 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 + (1.0 / x);
} 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) + (1.0d0 / x)
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 + (1.0 / x);
} 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 + (1.0 / x) 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(-1.0 + Float64(1.0 / x)); 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 + (1.0 / x); 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[(-1.0 + N[(1.0 / x), $MachinePrecision]), $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}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -4.999999999999985e-310Initial program 33.5%
associate-*r/33.5%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
+-commutative33.6%
fma-def33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Applied egg-rr73.5%
Taylor expanded in t around -inf 79.7%
mul-1-neg79.7%
sub-neg79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in x around inf 78.1%
if -4.999999999999985e-310 < t Initial program 26.4%
associate-*l/26.5%
Simplified26.5%
Taylor expanded in x around inf 44.2%
fma-def44.2%
sub-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
mul-1-neg44.2%
remove-double-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in x around inf 52.5%
mul-1-neg52.5%
unsub-neg52.5%
+-commutative52.5%
associate-*r/52.5%
metadata-eval52.5%
unpow252.5%
rem-square-sqrt52.5%
metadata-eval52.5%
unpow252.5%
unpow252.5%
rem-square-sqrt52.5%
unpow252.5%
Simplified52.5%
Taylor expanded in l around 0 68.8%
Final simplification73.6%
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 33.5%
associate-*r/33.5%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
+-commutative33.6%
fma-def33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Applied egg-rr73.5%
Taylor expanded in t around -inf 79.7%
mul-1-neg79.7%
sub-neg79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in x around inf 77.3%
if -4.999999999999985e-310 < t Initial program 26.4%
associate-*l/26.5%
Simplified26.5%
Taylor expanded in x around inf 44.2%
fma-def44.2%
sub-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
mul-1-neg44.2%
remove-double-neg44.2%
unpow244.2%
fma-udef44.2%
unpow244.2%
*-commutative44.2%
Simplified44.2%
Taylor expanded in x around inf 67.7%
Taylor expanded in t around 0 67.9%
Final simplification72.7%
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 30.0%
associate-*l/30.2%
Simplified30.2%
Taylor expanded in x around inf 24.1%
fma-def24.1%
sub-neg24.1%
unpow224.1%
fma-udef24.1%
unpow224.1%
mul-1-neg24.1%
remove-double-neg24.1%
unpow224.1%
fma-udef24.1%
unpow224.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in x around inf 34.0%
Taylor expanded in t around 0 34.0%
Final simplification34.0%
herbie shell --seed 2023229
(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)))))