
(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 14 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 (/ (* l l) x))
(t_2 (+ 2.0 (/ 4.0 x)))
(t_3 (sqrt (/ (- x 1.0) (+ x 1.0)))))
(if (<= t -4.4e-166)
(- t_3)
(if (<= t 1.62e-227)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 3.5e-156)
(*
t
(/
(sqrt 2.0)
(fma (* (/ l x) (/ l t)) (sqrt (/ 1.0 t_2)) (* t (sqrt t_2)))))
(if (<= t 6.1e+28)
(* t (sqrt (/ 2.0 (+ t_1 (+ t_1 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
t_3))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = 2.0 + (4.0 / x);
double t_3 = sqrt(((x - 1.0) / (x + 1.0)));
double tmp;
if (t <= -4.4e-166) {
tmp = -t_3;
} else if (t <= 1.62e-227) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 3.5e-156) {
tmp = t * (sqrt(2.0) / fma(((l / x) * (l / t)), sqrt((1.0 / t_2)), (t * sqrt(t_2))));
} else if (t <= 6.1e+28) {
tmp = t * sqrt((2.0 / (t_1 + (t_1 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_3;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(2.0 + Float64(4.0 / x)) t_3 = sqrt(Float64(Float64(x - 1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4.4e-166) tmp = Float64(-t_3); elseif (t <= 1.62e-227) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 3.5e-156) tmp = Float64(t * Float64(sqrt(2.0) / fma(Float64(Float64(l / x) * Float64(l / t)), sqrt(Float64(1.0 / t_2)), Float64(t * sqrt(t_2))))); elseif (t <= 6.1e+28) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_1 + Float64(t_1 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); else tmp = t_3; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -4.4e-166], (-t$95$3), If[LessEqual[t, 1.62e-227], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-156], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(l / x), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision] + N[(t * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.1e+28], N[(t * N[Sqrt[N[(2.0 / N[(t$95$1 + N[(t$95$1 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := 2 + \frac{4}{x}\\
t_3 := \sqrt{\frac{x - 1}{x + 1}}\\
\mathbf{if}\;t \leq -4.4 \cdot 10^{-166}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq 1.62 \cdot 10^{-227}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-156}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(\frac{\ell}{x} \cdot \frac{\ell}{t}, \sqrt{\frac{1}{t_2}}, t \cdot \sqrt{t_2}\right)}\\
\mathbf{elif}\;t \leq 6.1 \cdot 10^{+28}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_1 + \left(t_1 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -4.4000000000000002e-166Initial program 47.8%
associate-*l/47.9%
*-commutative47.9%
fma-neg47.9%
sqr-neg47.9%
fma-neg47.9%
Simplified47.9%
Applied egg-rr79.1%
Taylor expanded in t around -inf 87.5%
mul-1-neg87.5%
sub-neg87.5%
metadata-eval87.5%
Simplified87.5%
if -4.4000000000000002e-166 < t < 1.62000000000000002e-227Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 69.9%
sub-neg69.9%
fma-def69.9%
unpow269.9%
fma-def69.9%
unpow269.9%
unpow269.9%
mul-1-neg69.9%
remove-double-neg69.9%
fma-def69.9%
unpow269.9%
unpow269.9%
Simplified69.9%
Taylor expanded in t around 0 53.9%
associate-*l*53.9%
Simplified53.9%
if 1.62000000000000002e-227 < t < 3.4999999999999999e-156Initial program 17.1%
associate-*l/17.1%
Simplified17.1%
Taylor expanded in x around inf 29.1%
sub-neg29.1%
fma-def29.1%
unpow229.1%
fma-def29.1%
unpow229.1%
unpow229.1%
mul-1-neg29.1%
remove-double-neg29.1%
fma-def29.1%
unpow229.1%
unpow229.1%
Simplified29.1%
Taylor expanded in t around inf 89.5%
+-commutative89.5%
fma-def89.5%
unpow289.5%
*-commutative89.5%
times-frac89.5%
associate-*r/89.5%
metadata-eval89.5%
associate-*r/89.5%
metadata-eval89.5%
Simplified89.5%
if 3.4999999999999999e-156 < t < 6.1000000000000002e28Initial program 57.0%
associate-*l/57.0%
Simplified57.0%
Taylor expanded in x around inf 81.4%
sub-neg81.4%
fma-def81.4%
unpow281.4%
fma-def81.4%
unpow281.4%
unpow281.4%
mul-1-neg81.4%
remove-double-neg81.4%
fma-def81.4%
unpow281.4%
unpow281.4%
Simplified81.4%
Taylor expanded in t around 0 81.3%
unpow281.3%
Simplified81.3%
*-un-lft-identity81.3%
sqrt-undiv81.4%
+-commutative81.4%
associate-/l*81.4%
Applied egg-rr81.4%
*-lft-identity81.4%
fma-udef81.4%
fma-udef81.4%
unpow281.4%
unpow281.4%
associate-+r+81.4%
Simplified81.4%
if 6.1000000000000002e28 < t Initial program 38.1%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr84.3%
Taylor expanded in t around inf 90.9%
Final simplification82.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (/ (+ x 1.0) (- x 1.0)))
(t_3 (fma 2.0 (* t t) (* l l)))
(t_4 (* 2.0 (* t t)))
(t_5 (/ t_1 (sqrt (- (* t_2 (+ (* l l) t_4)) (* l l))))))
(if (<= t_5 -1.0)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (+ t_4 (fma l l t_3)) (* x x))
(+
(fma
2.0
(/ (* t t) x)
(fma
2.0
(/ (* t t) (pow x 3.0))
(+ (fma 2.0 (* t t) (/ (* l l) x)) (/ (* l l) (pow x 3.0)))))
(+ (/ t_3 (pow x 3.0)) (/ t_3 x)))))))
(if (<= t_5 2.0)
(/ t_1 (hypot (* (sqrt t_2) (hypot l t_1)) l))
(*
t
(*
(sqrt (/ 1.0 (+ (/ 1.0 (- x 1.0)) (+ (/ 1.0 x) (/ 1.0 (* x x))))))
(/ (sqrt 2.0) l)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = (x + 1.0) / (x - 1.0);
double t_3 = fma(2.0, (t * t), (l * l));
double t_4 = 2.0 * (t * t);
double t_5 = t_1 / sqrt(((t_2 * ((l * l) + t_4)) - (l * l)));
double tmp;
if (t_5 <= -1.0) {
tmp = t * (sqrt(2.0) / sqrt((((t_4 + fma(l, l, t_3)) / (x * x)) + (fma(2.0, ((t * t) / x), fma(2.0, ((t * t) / pow(x, 3.0)), (fma(2.0, (t * t), ((l * l) / x)) + ((l * l) / pow(x, 3.0))))) + ((t_3 / pow(x, 3.0)) + (t_3 / x))))));
} else if (t_5 <= 2.0) {
tmp = t_1 / hypot((sqrt(t_2) * hypot(l, t_1)), l);
} else {
tmp = t * (sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (sqrt(2.0) / l));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = Float64(Float64(x + 1.0) / Float64(x - 1.0)) t_3 = fma(2.0, Float64(t * t), Float64(l * l)) t_4 = Float64(2.0 * Float64(t * t)) t_5 = Float64(t_1 / sqrt(Float64(Float64(t_2 * Float64(Float64(l * l) + t_4)) - Float64(l * l)))) tmp = 0.0 if (t_5 <= -1.0) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(t_4 + fma(l, l, t_3)) / Float64(x * x)) + Float64(fma(2.0, Float64(Float64(t * t) / x), fma(2.0, Float64(Float64(t * t) / (x ^ 3.0)), Float64(fma(2.0, Float64(t * t), Float64(Float64(l * l) / x)) + Float64(Float64(l * l) / (x ^ 3.0))))) + Float64(Float64(t_3 / (x ^ 3.0)) + Float64(t_3 / x))))))); elseif (t_5 <= 2.0) tmp = Float64(t_1 / hypot(Float64(sqrt(t_2) * hypot(l, t_1)), l)); else tmp = Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / Float64(x - 1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x * x)))))) * Float64(sqrt(2.0) / l))); end return 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] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$2 * N[(N[(l * l), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -1.0], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(t$95$4 + N[(l * l + t$95$3), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.0], N[(t$95$1 / N[Sqrt[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[Sqrt[l ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \frac{x + 1}{x - 1}\\
t_3 := \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)\\
t_4 := 2 \cdot \left(t \cdot t\right)\\
t_5 := \frac{t_1}{\sqrt{t_2 \cdot \left(\ell \cdot \ell + t_4\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_5 \leq -1:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{t_4 + \mathsf{fma}\left(\ell, \ell, t_3\right)}{x \cdot x} + \left(\mathsf{fma}\left(2, \frac{t \cdot t}{x}, \mathsf{fma}\left(2, \frac{t \cdot t}{{x}^{3}}, \mathsf{fma}\left(2, t \cdot t, \frac{\ell \cdot \ell}{x}\right) + \frac{\ell \cdot \ell}{{x}^{3}}\right)\right) + \left(\frac{t_3}{{x}^{3}} + \frac{t_3}{x}\right)\right)}}\\
\mathbf{elif}\;t_5 \leq 2:\\
\;\;\;\;\frac{t_1}{\mathsf{hypot}\left(\sqrt{t_2} \cdot \mathsf{hypot}\left(\ell, t_1\right), \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{\frac{1}{\frac{1}{x - 1} + \left(\frac{1}{x} + \frac{1}{x \cdot x}\right)}} \cdot \frac{\sqrt{2}}{\ell}\right)\\
\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)))) < -1Initial program 64.1%
associate-*l/64.2%
Simplified64.2%
Taylor expanded in x around -inf 86.4%
Simplified86.3%
if -1 < (/.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 43.2%
associate-*l/43.2%
*-commutative43.2%
fma-neg43.2%
sqr-neg43.2%
fma-neg43.2%
Simplified43.2%
Applied egg-rr97.7%
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)))) Initial program 0.9%
associate-*l/0.9%
*-commutative0.9%
fma-neg0.9%
sqr-neg0.9%
fma-neg0.9%
Simplified0.9%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in x around inf 44.3%
unpow244.3%
Simplified44.3%
Final simplification79.2%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (/ (+ x 1.0) (- x 1.0)))
(t_3 (/ t_1 (sqrt (- (* t_2 (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 (- INFINITY))
(* t (sqrt (/ 2.0 (+ t_4 (+ t_4 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
(if (<= t_3 2.0)
(/ (sqrt 2.0) (/ (hypot (* (sqrt t_2) (hypot l t_1)) l) t))
(*
t
(*
(sqrt (/ 1.0 (+ (/ 1.0 (- x 1.0)) (+ (/ 1.0 x) (/ 1.0 (* x x))))))
(/ (sqrt 2.0) l)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = (x + 1.0) / (x - 1.0);
double t_3 = t_1 / sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t * sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x)))))));
} else if (t_3 <= 2.0) {
tmp = sqrt(2.0) / (hypot((sqrt(t_2) * hypot(l, t_1)), l) / t);
} else {
tmp = t * (sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (sqrt(2.0) / l));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * t;
double t_2 = (x + 1.0) / (x - 1.0);
double t_3 = t_1 / Math.sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t * Math.sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x)))))));
} else if (t_3 <= 2.0) {
tmp = Math.sqrt(2.0) / (Math.hypot((Math.sqrt(t_2) * Math.hypot(l, t_1)), l) / t);
} else {
tmp = t * (Math.sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (Math.sqrt(2.0) / l));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * t t_2 = (x + 1.0) / (x - 1.0) t_3 = t_1 / math.sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -math.inf: tmp = t * math.sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x))))))) elif t_3 <= 2.0: tmp = math.sqrt(2.0) / (math.hypot((math.sqrt(t_2) * math.hypot(l, t_1)), l) / t) else: tmp = t * (math.sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (math.sqrt(2.0) / l)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = Float64(Float64(x + 1.0) / Float64(x - 1.0)) t_3 = Float64(t_1 / sqrt(Float64(Float64(t_2 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_4 + Float64(t_4 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); elseif (t_3 <= 2.0) tmp = Float64(sqrt(2.0) / Float64(hypot(Float64(sqrt(t_2) * hypot(l, t_1)), l) / t)); else tmp = Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / Float64(x - 1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x * x)))))) * Float64(sqrt(2.0) / l))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * t; t_2 = (x + 1.0) / (x - 1.0); t_3 = t_1 / sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -Inf) tmp = t * sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x))))))); elseif (t_3 <= 2.0) tmp = sqrt(2.0) / (hypot((sqrt(t_2) * hypot(l, t_1)), l) / t); else tmp = t * (sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (sqrt(2.0) / l)); 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] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$2 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t * N[Sqrt[N[(2.0 / N[(t$95$4 + N[(t$95$4 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2.0], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[Sqrt[l ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \frac{x + 1}{x - 1}\\
t_3 := \frac{t_1}{\sqrt{t_2 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_4 + \left(t_4 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\mathsf{hypot}\left(\sqrt{t_2} \cdot \mathsf{hypot}\left(\ell, t_1\right), \ell\right)}{t}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{\frac{1}{\frac{1}{x - 1} + \left(\frac{1}{x} + \frac{1}{x \cdot x}\right)}} \cdot \frac{\sqrt{2}}{\ell}\right)\\
\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)))) < -inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 63.8%
sub-neg63.8%
fma-def63.8%
unpow263.8%
fma-def63.8%
unpow263.8%
unpow263.8%
mul-1-neg63.8%
remove-double-neg63.8%
fma-def63.8%
unpow263.8%
unpow263.8%
Simplified63.8%
Taylor expanded in t around 0 63.8%
unpow263.8%
Simplified63.8%
*-un-lft-identity63.8%
sqrt-undiv64.3%
+-commutative64.3%
associate-/l*64.3%
Applied egg-rr64.3%
*-lft-identity64.3%
fma-udef64.3%
fma-udef64.3%
unpow264.3%
unpow264.3%
associate-+r+64.3%
Simplified64.3%
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)))) < 2Initial program 62.2%
associate-*l/62.3%
*-commutative62.3%
fma-neg62.3%
sqr-neg62.3%
fma-neg62.3%
Simplified62.3%
Applied egg-rr97.8%
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)))) Initial program 0.9%
associate-*l/0.9%
*-commutative0.9%
fma-neg0.9%
sqr-neg0.9%
fma-neg0.9%
Simplified0.9%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in x around inf 44.3%
unpow244.3%
Simplified44.3%
Final simplification79.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* (sqrt 2.0) t))
(t_2 (/ (+ x 1.0) (- x 1.0)))
(t_3 (/ t_1 (sqrt (- (* t_2 (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(t_4 (/ (* l l) x)))
(if (<= t_3 (- INFINITY))
(* t (sqrt (/ 2.0 (+ t_4 (+ t_4 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
(if (<= t_3 2.0)
(/ t_1 (hypot (* (sqrt t_2) (hypot l t_1)) l))
(*
t
(*
(sqrt (/ 1.0 (+ (/ 1.0 (- x 1.0)) (+ (/ 1.0 x) (/ 1.0 (* x x))))))
(/ (sqrt 2.0) l)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * t;
double t_2 = (x + 1.0) / (x - 1.0);
double t_3 = t_1 / sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t * sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x)))))));
} else if (t_3 <= 2.0) {
tmp = t_1 / hypot((sqrt(t_2) * hypot(l, t_1)), l);
} else {
tmp = t * (sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (sqrt(2.0) / l));
}
return tmp;
}
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(2.0) * t;
double t_2 = (x + 1.0) / (x - 1.0);
double t_3 = t_1 / Math.sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double t_4 = (l * l) / x;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t * Math.sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x)))))));
} else if (t_3 <= 2.0) {
tmp = t_1 / Math.hypot((Math.sqrt(t_2) * Math.hypot(l, t_1)), l);
} else {
tmp = t * (Math.sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (Math.sqrt(2.0) / l));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * t t_2 = (x + 1.0) / (x - 1.0) t_3 = t_1 / math.sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l))) t_4 = (l * l) / x tmp = 0 if t_3 <= -math.inf: tmp = t * math.sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x))))))) elif t_3 <= 2.0: tmp = t_1 / math.hypot((math.sqrt(t_2) * math.hypot(l, t_1)), l) else: tmp = t * (math.sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (math.sqrt(2.0) / l)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * t) t_2 = Float64(Float64(x + 1.0) / Float64(x - 1.0)) t_3 = Float64(t_1 / sqrt(Float64(Float64(t_2 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) t_4 = Float64(Float64(l * l) / x) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_4 + Float64(t_4 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); elseif (t_3 <= 2.0) tmp = Float64(t_1 / hypot(Float64(sqrt(t_2) * hypot(l, t_1)), l)); else tmp = Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / Float64(x - 1.0)) + Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x * x)))))) * Float64(sqrt(2.0) / l))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * t; t_2 = (x + 1.0) / (x - 1.0); t_3 = t_1 / sqrt(((t_2 * ((l * l) + (2.0 * (t * t)))) - (l * l))); t_4 = (l * l) / x; tmp = 0.0; if (t_3 <= -Inf) tmp = t * sqrt((2.0 / (t_4 + (t_4 + ((t * t) * (2.0 + (2.0 / x))))))); elseif (t_3 <= 2.0) tmp = t_1 / hypot((sqrt(t_2) * hypot(l, t_1)), l); else tmp = t * (sqrt((1.0 / ((1.0 / (x - 1.0)) + ((1.0 / x) + (1.0 / (x * x)))))) * (sqrt(2.0) / l)); 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] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[Sqrt[N[(N[(t$95$2 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t * N[Sqrt[N[(2.0 / N[(t$95$4 + N[(t$95$4 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2.0], N[(t$95$1 / N[Sqrt[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[Sqrt[l ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot t\\
t_2 := \frac{x + 1}{x - 1}\\
t_3 := \frac{t_1}{\sqrt{t_2 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_4 + \left(t_4 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{elif}\;t_3 \leq 2:\\
\;\;\;\;\frac{t_1}{\mathsf{hypot}\left(\sqrt{t_2} \cdot \mathsf{hypot}\left(\ell, t_1\right), \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\sqrt{\frac{1}{\frac{1}{x - 1} + \left(\frac{1}{x} + \frac{1}{x \cdot x}\right)}} \cdot \frac{\sqrt{2}}{\ell}\right)\\
\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)))) < -inf.0Initial program 2.7%
associate-*l/2.7%
Simplified2.7%
Taylor expanded in x around inf 63.8%
sub-neg63.8%
fma-def63.8%
unpow263.8%
fma-def63.8%
unpow263.8%
unpow263.8%
mul-1-neg63.8%
remove-double-neg63.8%
fma-def63.8%
unpow263.8%
unpow263.8%
Simplified63.8%
Taylor expanded in t around 0 63.8%
unpow263.8%
Simplified63.8%
*-un-lft-identity63.8%
sqrt-undiv64.3%
+-commutative64.3%
associate-/l*64.3%
Applied egg-rr64.3%
*-lft-identity64.3%
fma-udef64.3%
fma-udef64.3%
unpow264.3%
unpow264.3%
associate-+r+64.3%
Simplified64.3%
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)))) < 2Initial program 62.2%
associate-*l/62.3%
*-commutative62.3%
fma-neg62.3%
sqr-neg62.3%
fma-neg62.3%
Simplified62.3%
Applied egg-rr98.0%
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)))) Initial program 0.9%
associate-*l/0.9%
*-commutative0.9%
fma-neg0.9%
sqr-neg0.9%
fma-neg0.9%
Simplified0.9%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
sub-neg23.1%
metadata-eval23.1%
+-commutative23.1%
Simplified23.1%
Taylor expanded in x around inf 44.3%
unpow244.3%
Simplified44.3%
Final simplification79.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)))))
(if (<= t -3.2e-166)
(- t_1)
(if (<= t 2.7e-228)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 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 <= -3.2e-166) {
tmp = -t_1;
} else if (t <= 2.7e-228) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / 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 <= (-3.2d-166)) then
tmp = -t_1
else if (t <= 2.7d-228) then
tmp = t * (sqrt(2.0d0) / (l * (sqrt(2.0d0) * sqrt((1.0d0 / 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 <= -3.2e-166) {
tmp = -t_1;
} else if (t <= 2.7e-228) {
tmp = t * (Math.sqrt(2.0) / (l * (Math.sqrt(2.0) * Math.sqrt((1.0 / 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 <= -3.2e-166: tmp = -t_1 elif t <= 2.7e-228: tmp = t * (math.sqrt(2.0) / (l * (math.sqrt(2.0) * math.sqrt((1.0 / 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 <= -3.2e-166) tmp = Float64(-t_1); elseif (t <= 2.7e-228) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / 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 <= -3.2e-166) tmp = -t_1; elseif (t <= 2.7e-228) tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / 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, -3.2e-166], (-t$95$1), If[LessEqual[t, 2.7e-228], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x - 1}{x + 1}}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-166}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-228}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.20000000000000001e-166Initial program 47.8%
associate-*l/47.9%
*-commutative47.9%
fma-neg47.9%
sqr-neg47.9%
fma-neg47.9%
Simplified47.9%
Applied egg-rr79.1%
Taylor expanded in t around -inf 87.5%
mul-1-neg87.5%
sub-neg87.5%
metadata-eval87.5%
Simplified87.5%
if -3.20000000000000001e-166 < t < 2.69999999999999984e-228Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 69.9%
sub-neg69.9%
fma-def69.9%
unpow269.9%
fma-def69.9%
unpow269.9%
unpow269.9%
mul-1-neg69.9%
remove-double-neg69.9%
fma-def69.9%
unpow269.9%
unpow269.9%
Simplified69.9%
Taylor expanded in t around 0 53.9%
associate-*l*53.9%
Simplified53.9%
if 2.69999999999999984e-228 < t Initial program 41.4%
associate-*l/41.4%
*-commutative41.4%
fma-neg41.5%
sqr-neg41.5%
fma-neg41.4%
Simplified41.5%
Applied egg-rr75.0%
Taylor expanded in t around inf 84.0%
Final simplification81.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (* t (* (/ (sqrt 2.0) l) (sqrt (* x 0.5)))))
(t_2 (/ (* l l) x))
(t_3 (sqrt (/ (- x 1.0) (+ x 1.0)))))
(if (<= t -2.46e-166)
(- t_3)
(if (<= t 5.9e-232)
t_1
(if (<= t 4.5e-157)
1.0
(if (<= t 8e-148)
t_1
(if (<= t 5.9e+26)
(* t (sqrt (/ 2.0 (+ t_2 (+ t_2 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
t_3)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * ((sqrt(2.0) / l) * sqrt((x * 0.5)));
double t_2 = (l * l) / x;
double t_3 = sqrt(((x - 1.0) / (x + 1.0)));
double tmp;
if (t <= -2.46e-166) {
tmp = -t_3;
} else if (t <= 5.9e-232) {
tmp = t_1;
} else if (t <= 4.5e-157) {
tmp = 1.0;
} else if (t <= 8e-148) {
tmp = t_1;
} else if (t <= 5.9e+26) {
tmp = t * sqrt((2.0 / (t_2 + (t_2 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_3;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = t * ((sqrt(2.0d0) / l) * sqrt((x * 0.5d0)))
t_2 = (l * l) / x
t_3 = sqrt(((x - 1.0d0) / (x + 1.0d0)))
if (t <= (-2.46d-166)) then
tmp = -t_3
else if (t <= 5.9d-232) then
tmp = t_1
else if (t <= 4.5d-157) then
tmp = 1.0d0
else if (t <= 8d-148) then
tmp = t_1
else if (t <= 5.9d+26) then
tmp = t * sqrt((2.0d0 / (t_2 + (t_2 + ((t * t) * (2.0d0 + (2.0d0 / x)))))))
else
tmp = t_3
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = t * ((Math.sqrt(2.0) / l) * Math.sqrt((x * 0.5)));
double t_2 = (l * l) / x;
double t_3 = Math.sqrt(((x - 1.0) / (x + 1.0)));
double tmp;
if (t <= -2.46e-166) {
tmp = -t_3;
} else if (t <= 5.9e-232) {
tmp = t_1;
} else if (t <= 4.5e-157) {
tmp = 1.0;
} else if (t <= 8e-148) {
tmp = t_1;
} else if (t <= 5.9e+26) {
tmp = t * Math.sqrt((2.0 / (t_2 + (t_2 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_3;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * ((math.sqrt(2.0) / l) * math.sqrt((x * 0.5))) t_2 = (l * l) / x t_3 = math.sqrt(((x - 1.0) / (x + 1.0))) tmp = 0 if t <= -2.46e-166: tmp = -t_3 elif t <= 5.9e-232: tmp = t_1 elif t <= 4.5e-157: tmp = 1.0 elif t <= 8e-148: tmp = t_1 elif t <= 5.9e+26: tmp = t * math.sqrt((2.0 / (t_2 + (t_2 + ((t * t) * (2.0 + (2.0 / x))))))) else: tmp = t_3 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(Float64(sqrt(2.0) / l) * sqrt(Float64(x * 0.5)))) t_2 = Float64(Float64(l * l) / x) t_3 = sqrt(Float64(Float64(x - 1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -2.46e-166) tmp = Float64(-t_3); elseif (t <= 5.9e-232) tmp = t_1; elseif (t <= 4.5e-157) tmp = 1.0; elseif (t <= 8e-148) tmp = t_1; elseif (t <= 5.9e+26) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_2 + Float64(t_2 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); else tmp = t_3; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * ((sqrt(2.0) / l) * sqrt((x * 0.5))); t_2 = (l * l) / x; t_3 = sqrt(((x - 1.0) / (x + 1.0))); tmp = 0.0; if (t <= -2.46e-166) tmp = -t_3; elseif (t <= 5.9e-232) tmp = t_1; elseif (t <= 4.5e-157) tmp = 1.0; elseif (t <= 8e-148) tmp = t_1; elseif (t <= 5.9e+26) tmp = t * sqrt((2.0 / (t_2 + (t_2 + ((t * t) * (2.0 + (2.0 / x))))))); else tmp = t_3; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.46e-166], (-t$95$3), If[LessEqual[t, 5.9e-232], t$95$1, If[LessEqual[t, 4.5e-157], 1.0, If[LessEqual[t, 8e-148], t$95$1, If[LessEqual[t, 5.9e+26], N[(t * N[Sqrt[N[(2.0 / N[(t$95$2 + N[(t$95$2 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot \sqrt{x \cdot 0.5}\right)\\
t_2 := \frac{\ell \cdot \ell}{x}\\
t_3 := \sqrt{\frac{x - 1}{x + 1}}\\
\mathbf{if}\;t \leq -2.46 \cdot 10^{-166}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq 5.9 \cdot 10^{-232}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-157}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.9 \cdot 10^{+26}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_2 + \left(t_2 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -2.46e-166Initial program 47.8%
associate-*l/47.9%
*-commutative47.9%
fma-neg47.9%
sqr-neg47.9%
fma-neg47.9%
Simplified47.9%
Applied egg-rr79.1%
Taylor expanded in t around -inf 87.5%
mul-1-neg87.5%
sub-neg87.5%
metadata-eval87.5%
Simplified87.5%
if -2.46e-166 < t < 5.90000000000000017e-232 or 4.49999999999999999e-157 < t < 7.99999999999999949e-148Initial program 1.8%
associate-*l/1.8%
*-commutative1.8%
fma-neg1.8%
sqr-neg1.8%
fma-neg1.8%
Simplified1.8%
Taylor expanded in l around inf 1.9%
*-commutative1.9%
associate--l+34.9%
sub-neg34.9%
metadata-eval34.9%
+-commutative34.9%
sub-neg34.9%
metadata-eval34.9%
+-commutative34.9%
Simplified34.9%
Taylor expanded in x around inf 56.2%
Taylor expanded in x around inf 56.2%
*-commutative56.2%
Simplified56.2%
if 5.90000000000000017e-232 < t < 4.49999999999999999e-157Initial program 17.1%
associate-*l/17.1%
*-commutative17.1%
fma-neg17.1%
sqr-neg17.1%
fma-neg17.1%
Simplified17.1%
Taylor expanded in t around inf 78.3%
Taylor expanded in x around inf 78.5%
if 7.99999999999999949e-148 < t < 5.9000000000000003e26Initial program 61.3%
associate-*l/61.3%
Simplified61.3%
Taylor expanded in x around inf 83.6%
sub-neg83.6%
fma-def83.6%
unpow283.6%
fma-def83.6%
unpow283.6%
unpow283.6%
mul-1-neg83.6%
remove-double-neg83.6%
fma-def83.6%
unpow283.6%
unpow283.6%
Simplified83.6%
Taylor expanded in t around 0 83.5%
unpow283.5%
Simplified83.5%
*-un-lft-identity83.5%
sqrt-undiv83.6%
+-commutative83.6%
associate-/l*83.6%
Applied egg-rr83.6%
*-lft-identity83.6%
fma-udef83.6%
fma-udef83.6%
unpow283.6%
unpow283.6%
associate-+r+83.6%
Simplified83.6%
if 5.9000000000000003e26 < t Initial program 38.1%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr84.3%
Taylor expanded in t around inf 90.9%
Final simplification82.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (* x 0.5)))
(t_2 (sqrt (/ (- x 1.0) (+ x 1.0))))
(t_3 (/ (* l l) x)))
(if (<= t -6.5e-166)
(- t_2)
(if (<= t 4.6e-226)
(* t (/ (* (sqrt 2.0) t_1) l))
(if (<= t 3.4e-156)
1.0
(if (<= t 8e-148)
(* t (* (/ (sqrt 2.0) l) t_1))
(if (<= t 4.4e+27)
(* t (sqrt (/ 2.0 (+ t_3 (+ t_3 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
t_2)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt((x * 0.5));
double t_2 = sqrt(((x - 1.0) / (x + 1.0)));
double t_3 = (l * l) / x;
double tmp;
if (t <= -6.5e-166) {
tmp = -t_2;
} else if (t <= 4.6e-226) {
tmp = t * ((sqrt(2.0) * t_1) / l);
} else if (t <= 3.4e-156) {
tmp = 1.0;
} else if (t <= 8e-148) {
tmp = t * ((sqrt(2.0) / l) * t_1);
} else if (t <= 4.4e+27) {
tmp = t * sqrt((2.0 / (t_3 + (t_3 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((x * 0.5d0))
t_2 = sqrt(((x - 1.0d0) / (x + 1.0d0)))
t_3 = (l * l) / x
if (t <= (-6.5d-166)) then
tmp = -t_2
else if (t <= 4.6d-226) then
tmp = t * ((sqrt(2.0d0) * t_1) / l)
else if (t <= 3.4d-156) then
tmp = 1.0d0
else if (t <= 8d-148) then
tmp = t * ((sqrt(2.0d0) / l) * t_1)
else if (t <= 4.4d+27) then
tmp = t * sqrt((2.0d0 / (t_3 + (t_3 + ((t * t) * (2.0d0 + (2.0d0 / x)))))))
else
tmp = t_2
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt((x * 0.5));
double t_2 = Math.sqrt(((x - 1.0) / (x + 1.0)));
double t_3 = (l * l) / x;
double tmp;
if (t <= -6.5e-166) {
tmp = -t_2;
} else if (t <= 4.6e-226) {
tmp = t * ((Math.sqrt(2.0) * t_1) / l);
} else if (t <= 3.4e-156) {
tmp = 1.0;
} else if (t <= 8e-148) {
tmp = t * ((Math.sqrt(2.0) / l) * t_1);
} else if (t <= 4.4e+27) {
tmp = t * Math.sqrt((2.0 / (t_3 + (t_3 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt((x * 0.5)) t_2 = math.sqrt(((x - 1.0) / (x + 1.0))) t_3 = (l * l) / x tmp = 0 if t <= -6.5e-166: tmp = -t_2 elif t <= 4.6e-226: tmp = t * ((math.sqrt(2.0) * t_1) / l) elif t <= 3.4e-156: tmp = 1.0 elif t <= 8e-148: tmp = t * ((math.sqrt(2.0) / l) * t_1) elif t <= 4.4e+27: tmp = t * math.sqrt((2.0 / (t_3 + (t_3 + ((t * t) * (2.0 + (2.0 / x))))))) else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(x * 0.5)) t_2 = sqrt(Float64(Float64(x - 1.0) / Float64(x + 1.0))) t_3 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -6.5e-166) tmp = Float64(-t_2); elseif (t <= 4.6e-226) tmp = Float64(t * Float64(Float64(sqrt(2.0) * t_1) / l)); elseif (t <= 3.4e-156) tmp = 1.0; elseif (t <= 8e-148) tmp = Float64(t * Float64(Float64(sqrt(2.0) / l) * t_1)); elseif (t <= 4.4e+27) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_3 + Float64(t_3 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt((x * 0.5)); t_2 = sqrt(((x - 1.0) / (x + 1.0))); t_3 = (l * l) / x; tmp = 0.0; if (t <= -6.5e-166) tmp = -t_2; elseif (t <= 4.6e-226) tmp = t * ((sqrt(2.0) * t_1) / l); elseif (t <= 3.4e-156) tmp = 1.0; elseif (t <= 8e-148) tmp = t * ((sqrt(2.0) / l) * t_1); elseif (t <= 4.4e+27) tmp = t * sqrt((2.0 / (t_3 + (t_3 + ((t * t) * (2.0 + (2.0 / x))))))); else tmp = t_2; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -6.5e-166], (-t$95$2), If[LessEqual[t, 4.6e-226], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] * t$95$1), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e-156], 1.0, If[LessEqual[t, 8e-148], N[(t * N[(N[(N[Sqrt[2.0], $MachinePrecision] / l), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.4e+27], N[(t * N[Sqrt[N[(2.0 / N[(t$95$3 + N[(t$95$3 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{x \cdot 0.5}\\
t_2 := \sqrt{\frac{x - 1}{x + 1}}\\
t_3 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-166}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2} \cdot t_1}{\ell}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-156}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 8 \cdot 10^{-148}:\\
\;\;\;\;t \cdot \left(\frac{\sqrt{2}}{\ell} \cdot t_1\right)\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+27}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_3 + \left(t_3 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.50000000000000019e-166Initial program 47.8%
associate-*l/47.9%
*-commutative47.9%
fma-neg47.9%
sqr-neg47.9%
fma-neg47.9%
Simplified47.9%
Applied egg-rr79.1%
Taylor expanded in t around -inf 87.5%
mul-1-neg87.5%
sub-neg87.5%
metadata-eval87.5%
Simplified87.5%
if -6.50000000000000019e-166 < t < 4.6000000000000001e-226Initial program 1.8%
associate-*l/1.8%
*-commutative1.8%
fma-neg1.8%
sqr-neg1.8%
fma-neg1.8%
Simplified1.8%
Taylor expanded in l around inf 1.8%
*-commutative1.8%
associate--l+35.7%
sub-neg35.7%
metadata-eval35.7%
+-commutative35.7%
sub-neg35.7%
metadata-eval35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around inf 54.0%
Taylor expanded in x around inf 54.0%
*-commutative54.0%
Simplified54.0%
associate-*r/53.9%
Applied egg-rr53.9%
if 4.6000000000000001e-226 < t < 3.3999999999999999e-156Initial program 17.1%
associate-*l/17.1%
*-commutative17.1%
fma-neg17.1%
sqr-neg17.1%
fma-neg17.1%
Simplified17.1%
Taylor expanded in t around inf 78.3%
Taylor expanded in x around inf 78.5%
if 3.3999999999999999e-156 < t < 7.99999999999999949e-148Initial program 1.2%
associate-*l/1.2%
*-commutative1.2%
fma-neg1.2%
sqr-neg1.2%
fma-neg1.2%
Simplified1.2%
Taylor expanded in l around inf 2.2%
*-commutative2.2%
associate--l+20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
sub-neg20.3%
metadata-eval20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around inf 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
Simplified100.0%
if 7.99999999999999949e-148 < t < 4.3999999999999997e27Initial program 61.3%
associate-*l/61.3%
Simplified61.3%
Taylor expanded in x around inf 83.6%
sub-neg83.6%
fma-def83.6%
unpow283.6%
fma-def83.6%
unpow283.6%
unpow283.6%
mul-1-neg83.6%
remove-double-neg83.6%
fma-def83.6%
unpow283.6%
unpow283.6%
Simplified83.6%
Taylor expanded in t around 0 83.5%
unpow283.5%
Simplified83.5%
*-un-lft-identity83.5%
sqrt-undiv83.6%
+-commutative83.6%
associate-/l*83.6%
Applied egg-rr83.6%
*-lft-identity83.6%
fma-udef83.6%
fma-udef83.6%
unpow283.6%
unpow283.6%
associate-+r+83.6%
Simplified83.6%
if 4.3999999999999997e27 < t Initial program 38.1%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr84.3%
Taylor expanded in t around inf 90.9%
Final simplification82.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)) (t_2 (sqrt (/ (- x 1.0) (+ x 1.0)))))
(if (<= t -2.1e-166)
(- t_2)
(if (<= t 1.95e-229)
(* t (sqrt (/ 2.0 (+ t_1 (+ t_1 (* (* t t) (+ 2.0 (/ 2.0 x))))))))
t_2))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = sqrt(((x - 1.0) / (x + 1.0)));
double tmp;
if (t <= -2.1e-166) {
tmp = -t_2;
} else if (t <= 1.95e-229) {
tmp = t * sqrt((2.0 / (t_1 + (t_1 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (l * l) / x
t_2 = sqrt(((x - 1.0d0) / (x + 1.0d0)))
if (t <= (-2.1d-166)) then
tmp = -t_2
else if (t <= 1.95d-229) then
tmp = t * sqrt((2.0d0 / (t_1 + (t_1 + ((t * t) * (2.0d0 + (2.0d0 / x)))))))
else
tmp = t_2
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = Math.sqrt(((x - 1.0) / (x + 1.0)));
double tmp;
if (t <= -2.1e-166) {
tmp = -t_2;
} else if (t <= 1.95e-229) {
tmp = t * Math.sqrt((2.0 / (t_1 + (t_1 + ((t * t) * (2.0 + (2.0 / x)))))));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x t_2 = math.sqrt(((x - 1.0) / (x + 1.0))) tmp = 0 if t <= -2.1e-166: tmp = -t_2 elif t <= 1.95e-229: tmp = t * math.sqrt((2.0 / (t_1 + (t_1 + ((t * t) * (2.0 + (2.0 / x))))))) else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = sqrt(Float64(Float64(x - 1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -2.1e-166) tmp = Float64(-t_2); elseif (t <= 1.95e-229) tmp = Float64(t * sqrt(Float64(2.0 / Float64(t_1 + Float64(t_1 + Float64(Float64(t * t) * Float64(2.0 + Float64(2.0 / x)))))))); else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l * l) / x; t_2 = sqrt(((x - 1.0) / (x + 1.0))); tmp = 0.0; if (t <= -2.1e-166) tmp = -t_2; elseif (t <= 1.95e-229) tmp = t * sqrt((2.0 / (t_1 + (t_1 + ((t * t) * (2.0 + (2.0 / x))))))); else tmp = t_2; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x - 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -2.1e-166], (-t$95$2), If[LessEqual[t, 1.95e-229], N[(t * N[Sqrt[N[(2.0 / N[(t$95$1 + N[(t$95$1 + N[(N[(t * t), $MachinePrecision] * N[(2.0 + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := \sqrt{\frac{x - 1}{x + 1}}\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-229}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{t_1 + \left(t_1 + \left(t \cdot t\right) \cdot \left(2 + \frac{2}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.0999999999999999e-166Initial program 47.8%
associate-*l/47.9%
*-commutative47.9%
fma-neg47.9%
sqr-neg47.9%
fma-neg47.9%
Simplified47.9%
Applied egg-rr79.1%
Taylor expanded in t around -inf 87.5%
mul-1-neg87.5%
sub-neg87.5%
metadata-eval87.5%
Simplified87.5%
if -2.0999999999999999e-166 < t < 1.94999999999999992e-229Initial program 1.8%
associate-*l/1.8%
Simplified1.8%
Taylor expanded in x around inf 69.9%
sub-neg69.9%
fma-def69.9%
unpow269.9%
fma-def69.9%
unpow269.9%
unpow269.9%
mul-1-neg69.9%
remove-double-neg69.9%
fma-def69.9%
unpow269.9%
unpow269.9%
Simplified69.9%
Taylor expanded in t around 0 69.9%
unpow269.9%
Simplified69.9%
*-un-lft-identity69.9%
sqrt-undiv70.3%
+-commutative70.3%
associate-/l*70.3%
Applied egg-rr70.3%
*-lft-identity70.3%
fma-udef70.3%
fma-udef70.3%
unpow270.3%
unpow270.3%
associate-+r+70.3%
Simplified70.3%
if 1.94999999999999992e-229 < t Initial program 41.4%
associate-*l/41.4%
*-commutative41.4%
fma-neg41.5%
sqr-neg41.5%
fma-neg41.4%
Simplified41.5%
Applied egg-rr75.0%
Taylor expanded in t around inf 84.0%
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))))) (if (<= t -7.2e-205) (- t_1) (if (<= t 3.35e-276) (/ t l) 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 <= -7.2e-205) {
tmp = -t_1;
} else if (t <= 3.35e-276) {
tmp = t / l;
} 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 <= (-7.2d-205)) then
tmp = -t_1
else if (t <= 3.35d-276) then
tmp = t / l
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 <= -7.2e-205) {
tmp = -t_1;
} else if (t <= 3.35e-276) {
tmp = t / l;
} 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 <= -7.2e-205: tmp = -t_1 elif t <= 3.35e-276: tmp = t / l 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 <= -7.2e-205) tmp = Float64(-t_1); elseif (t <= 3.35e-276) tmp = Float64(t / l); 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 <= -7.2e-205) tmp = -t_1; elseif (t <= 3.35e-276) tmp = t / l; 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, -7.2e-205], (-t$95$1), If[LessEqual[t, 3.35e-276], N[(t / l), $MachinePrecision], t$95$1]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x - 1}{x + 1}}\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{-205}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 3.35 \cdot 10^{-276}:\\
\;\;\;\;\frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -7.1999999999999997e-205Initial program 46.7%
associate-*l/46.7%
*-commutative46.7%
fma-neg46.7%
sqr-neg46.7%
fma-neg46.7%
Simplified46.7%
Applied egg-rr77.3%
Taylor expanded in t around -inf 86.2%
mul-1-neg86.2%
sub-neg86.2%
metadata-eval86.2%
Simplified86.2%
if -7.1999999999999997e-205 < t < 3.34999999999999992e-276Initial program 1.6%
associate-*l/1.6%
*-commutative1.6%
fma-neg1.6%
sqr-neg1.6%
fma-neg1.6%
Simplified1.6%
Applied egg-rr38.6%
Taylor expanded in x around inf 38.6%
distribute-lft-out38.6%
unpow238.6%
unpow238.6%
Simplified38.6%
Taylor expanded in t around 0 40.4%
if 3.34999999999999992e-276 < t Initial program 38.6%
associate-*l/38.6%
*-commutative38.6%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.6%
Simplified38.6%
Applied egg-rr71.7%
Taylor expanded in t around inf 80.0%
Final simplification78.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 9.4e-278) (/ t l) (sqrt (/ (- x 1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 9.4e-278) {
tmp = t / l;
} 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.4d-278) then
tmp = t / l
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.4e-278) {
tmp = t / l;
} 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.4e-278: tmp = t / l 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.4e-278) tmp = Float64(t / l); 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.4e-278) tmp = t / l; 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.4e-278], N[(t / l), $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.4 \cdot 10^{-278}:\\
\;\;\;\;\frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x - 1}{x + 1}}\\
\end{array}
\end{array}
if t < 9.3999999999999994e-278Initial program 38.0%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr8.8%
Taylor expanded in x around inf 8.8%
distribute-lft-out8.8%
unpow28.8%
unpow28.8%
Simplified8.8%
Taylor expanded in t around 0 10.6%
if 9.3999999999999994e-278 < t Initial program 38.6%
associate-*l/38.6%
*-commutative38.6%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.6%
Simplified38.6%
Applied egg-rr71.7%
Taylor expanded in t around inf 80.0%
Final simplification40.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 4.8e-280) (/ t l) (+ (+ 1.0 (/ 0.5 (* x x))) (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 4.8e-280) {
tmp = t / l;
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 4.8d-280) then
tmp = t / l
else
tmp = (1.0d0 + (0.5d0 / (x * x))) + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= 4.8e-280) {
tmp = t / l;
} else {
tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 4.8e-280: tmp = t / l else: tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 4.8e-280) tmp = Float64(t / l); else tmp = Float64(Float64(1.0 + Float64(0.5 / Float64(x * x))) + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 4.8e-280) tmp = t / l; else tmp = (1.0 + (0.5 / (x * x))) + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, 4.8e-280], N[(t / l), $MachinePrecision], N[(N[(1.0 + N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{-280}:\\
\;\;\;\;\frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{0.5}{x \cdot x}\right) + \frac{-1}{x}\\
\end{array}
\end{array}
if t < 4.7999999999999996e-280Initial program 38.0%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr8.8%
Taylor expanded in x around inf 8.8%
distribute-lft-out8.8%
unpow28.8%
unpow28.8%
Simplified8.8%
Taylor expanded in t around 0 10.6%
if 4.7999999999999996e-280 < t Initial program 38.6%
associate-*l/38.6%
*-commutative38.6%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.6%
Simplified38.6%
Taylor expanded in t around inf 79.6%
Taylor expanded in x around inf 79.0%
associate-*r/79.0%
metadata-eval79.0%
unpow279.0%
Simplified79.0%
Final simplification40.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 2.9e-278) (/ t l) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 2.9e-278) {
tmp = t / l;
} 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.9d-278) then
tmp = t / l
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.9e-278) {
tmp = t / l;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 2.9e-278: tmp = t / l else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 2.9e-278) tmp = Float64(t / l); 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.9e-278) tmp = t / l; 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.9e-278], N[(t / l), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.9 \cdot 10^{-278}:\\
\;\;\;\;\frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < 2.9e-278Initial program 38.0%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr8.8%
Taylor expanded in x around inf 8.8%
distribute-lft-out8.8%
unpow28.8%
unpow28.8%
Simplified8.8%
Taylor expanded in t around 0 10.6%
if 2.9e-278 < t Initial program 38.6%
associate-*l/38.6%
*-commutative38.6%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.6%
Simplified38.6%
Taylor expanded in t around inf 79.6%
Taylor expanded in x around inf 78.6%
Final simplification39.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 3.3e-279) (/ t l) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 3.3e-279) {
tmp = t / l;
} 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 <= 3.3d-279) then
tmp = t / l
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 <= 3.3e-279) {
tmp = t / l;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 3.3e-279: tmp = t / l else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 3.3e-279) tmp = Float64(t / l); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 3.3e-279) tmp = t / l; 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, 3.3e-279], N[(t / l), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.3 \cdot 10^{-279}:\\
\;\;\;\;\frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 3.3e-279Initial program 38.0%
associate-*l/38.1%
*-commutative38.1%
fma-neg38.1%
sqr-neg38.1%
fma-neg38.1%
Simplified38.1%
Applied egg-rr8.8%
Taylor expanded in x around inf 8.8%
distribute-lft-out8.8%
unpow28.8%
unpow28.8%
Simplified8.8%
Taylor expanded in t around 0 10.6%
if 3.3e-279 < t Initial program 38.6%
associate-*l/38.6%
*-commutative38.6%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.6%
Simplified38.6%
Taylor expanded in t around inf 79.6%
Taylor expanded in x around inf 78.2%
Final simplification39.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 38.3%
associate-*l/38.3%
*-commutative38.3%
fma-neg38.3%
sqr-neg38.3%
fma-neg38.3%
Simplified38.3%
Taylor expanded in t around inf 35.7%
Taylor expanded in x around inf 35.1%
Final simplification35.1%
herbie shell --seed 2023278
(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)))))