
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.6e+140)
(- t_1)
(if (<= t -5.7e-145)
(* t (sqrt (/ 2.0 (* 2.0 (+ (* t (+ t (/ t x))) (* l (/ l x)))))))
(if (<= t 1.45e-226)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 6e-43)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/ (* 2.0 (fma 2.0 (* t t) (* l l))) (* (sqrt 2.0) (* t x)))
(* t (sqrt 2.0)))))
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.6e+140) {
tmp = -t_1;
} else if (t <= -5.7e-145) {
tmp = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x))))));
} else if (t <= 1.45e-226) {
tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 6e-43) {
tmp = t * (sqrt(2.0) / fma(0.5, ((2.0 * fma(2.0, (t * t), (l * l))) / (sqrt(2.0) * (t * x))), (t * sqrt(2.0))));
} 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.6e+140) tmp = Float64(-t_1); elseif (t <= -5.7e-145) tmp = Float64(t * sqrt(Float64(2.0 / Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(l * Float64(l / x))))))); elseif (t <= 1.45e-226) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 6e-43) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(2.0 * fma(2.0, Float64(t * t), Float64(l * l))) / Float64(sqrt(2.0) * Float64(t * x))), Float64(t * sqrt(2.0))))); else tmp = t_1; 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]}, If[LessEqual[t, -3.6e+140], (-t$95$1), If[LessEqual[t, -5.7e-145], N[(t * N[Sqrt[N[(2.0 / N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.45e-226], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / 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, 6e-43], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(2.0 * N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+140}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-145}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-43}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{\sqrt{2} \cdot \left(t \cdot x\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.6e140Initial program 6.4%
associate-*l/6.5%
Simplified6.5%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/9.4%
sub-neg9.4%
metadata-eval9.4%
unpow29.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
if -3.6e140 < t < -5.70000000000000032e-145Initial program 65.5%
associate-*l/65.7%
Simplified65.7%
Taylor expanded in x around inf 82.8%
sub-neg82.8%
fma-def82.8%
unpow282.8%
fma-def82.8%
unpow282.8%
unpow282.8%
mul-1-neg82.8%
remove-double-neg82.8%
fma-def82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.0%
unpow282.0%
associate-/l*82.1%
Simplified82.1%
sqrt-undiv82.2%
associate-/l*82.2%
associate-/l*92.8%
associate-/r/92.8%
associate-/r/92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 82.2%
+-commutative82.2%
distribute-lft-out82.2%
unpow282.2%
associate-*r/92.8%
distribute-lft-out92.8%
+-commutative92.8%
unpow292.8%
unpow292.8%
associate-*l/92.8%
*-commutative92.8%
distribute-lft-out92.8%
Simplified92.8%
if -5.70000000000000032e-145 < t < 1.45000000000000001e-226Initial program 3.3%
associate-*l/3.3%
Simplified3.3%
Taylor expanded in l around inf 2.6%
Taylor expanded in x around inf 49.8%
associate-*r/49.8%
metadata-eval49.8%
associate-*r/49.8%
metadata-eval49.8%
unpow249.8%
Simplified49.8%
if 1.45000000000000001e-226 < t < 6.00000000000000007e-43Initial program 46.9%
associate-*l/46.9%
Simplified46.9%
Taylor expanded in x around inf 83.2%
fma-def83.2%
cancel-sign-sub-inv83.2%
metadata-eval83.2%
distribute-rgt1-in83.2%
metadata-eval83.2%
fma-def83.2%
unpow283.2%
unpow283.2%
associate-*r*83.2%
Simplified83.2%
if 6.00000000000000007e-43 < t Initial program 41.3%
associate-*l/41.3%
Simplified41.3%
Taylor expanded in t around inf 28.3%
+-commutative28.3%
associate-*r/46.3%
sub-neg46.3%
metadata-eval46.3%
unpow246.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in t around 0 96.0%
Final simplification87.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 2.0 (/ 4.0 x))) (t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.55e+140)
(- t_2)
(if (<= t -5.7e-145)
(* t (sqrt (/ 2.0 (* 2.0 (+ (* t (+ t (/ t x))) (* l (/ l x)))))))
(if (<= t 2.7e-226)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 3.7e-41)
(*
t
(/
(sqrt 2.0)
(fma t (sqrt t_1) (* (/ (* l l) (* t x)) (sqrt (/ 1.0 t_1))))))
t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 + (4.0 / x);
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.55e+140) {
tmp = -t_2;
} else if (t <= -5.7e-145) {
tmp = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x))))));
} else if (t <= 2.7e-226) {
tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 3.7e-41) {
tmp = t * (sqrt(2.0) / fma(t, sqrt(t_1), (((l * l) / (t * x)) * sqrt((1.0 / t_1)))));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 + Float64(4.0 / x)) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.55e+140) tmp = Float64(-t_2); elseif (t <= -5.7e-145) tmp = Float64(t * sqrt(Float64(2.0 / Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(l * Float64(l / x))))))); elseif (t <= 2.7e-226) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 3.7e-41) tmp = Float64(t * Float64(sqrt(2.0) / fma(t, sqrt(t_1), Float64(Float64(Float64(l * l) / Float64(t * x)) * sqrt(Float64(1.0 / t_1)))))); else tmp = t_2; 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[(4.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -3.55e+140], (-t$95$2), If[LessEqual[t, -5.7e-145], N[(t * N[Sqrt[N[(2.0 / N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e-226], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / 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, 3.7e-41], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(t * N[Sqrt[t$95$1], $MachinePrecision] + N[(N[(N[(l * l), $MachinePrecision] / N[(t * x), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \frac{4}{x}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.55 \cdot 10^{+140}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-145}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-41}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(t, \sqrt{t_1}, \frac{\ell \cdot \ell}{t \cdot x} \cdot \sqrt{\frac{1}{t_1}}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.55000000000000014e140Initial program 6.4%
associate-*l/6.5%
Simplified6.5%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/9.4%
sub-neg9.4%
metadata-eval9.4%
unpow29.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
if -3.55000000000000014e140 < t < -5.70000000000000032e-145Initial program 65.5%
associate-*l/65.7%
Simplified65.7%
Taylor expanded in x around inf 82.8%
sub-neg82.8%
fma-def82.8%
unpow282.8%
fma-def82.8%
unpow282.8%
unpow282.8%
mul-1-neg82.8%
remove-double-neg82.8%
fma-def82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.0%
unpow282.0%
associate-/l*82.1%
Simplified82.1%
sqrt-undiv82.2%
associate-/l*82.2%
associate-/l*92.8%
associate-/r/92.8%
associate-/r/92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 82.2%
+-commutative82.2%
distribute-lft-out82.2%
unpow282.2%
associate-*r/92.8%
distribute-lft-out92.8%
+-commutative92.8%
unpow292.8%
unpow292.8%
associate-*l/92.8%
*-commutative92.8%
distribute-lft-out92.8%
Simplified92.8%
if -5.70000000000000032e-145 < t < 2.70000000000000014e-226Initial program 3.3%
associate-*l/3.3%
Simplified3.3%
Taylor expanded in l around inf 2.6%
Taylor expanded in x around inf 49.8%
associate-*r/49.8%
metadata-eval49.8%
associate-*r/49.8%
metadata-eval49.8%
unpow249.8%
Simplified49.8%
if 2.70000000000000014e-226 < t < 3.7000000000000002e-41Initial program 46.9%
associate-*l/46.9%
Simplified46.9%
Taylor expanded in x around inf 74.7%
sub-neg74.7%
fma-def74.7%
unpow274.7%
fma-def74.7%
unpow274.7%
unpow274.7%
mul-1-neg74.7%
remove-double-neg74.7%
fma-def74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
Taylor expanded in t around inf 83.2%
fma-def83.2%
associate-*r/83.2%
metadata-eval83.2%
unpow283.2%
*-commutative83.2%
associate-*r/83.2%
metadata-eval83.2%
Simplified83.2%
if 3.7000000000000002e-41 < t Initial program 41.3%
associate-*l/41.3%
Simplified41.3%
Taylor expanded in t around inf 28.3%
+-commutative28.3%
associate-*r/46.3%
sub-neg46.3%
metadata-eval46.3%
unpow246.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in t around 0 96.0%
Final simplification87.8%
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.7e+140)
(- t_1)
(if (<= t -5.7e-145)
(* t (sqrt (/ 2.0 (* 2.0 (+ (* t (+ t (/ t x))) (* l (/ l x)))))))
(if (<= t 5.2e-226)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 7.5e-39)
(*
t
(/
(sqrt 2.0)
(fma
0.5
(/ (* 2.0 (+ (* t t) (* l l))) (* t (* x (sqrt 2.0))))
(* t (sqrt 2.0)))))
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.7e+140) {
tmp = -t_1;
} else if (t <= -5.7e-145) {
tmp = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x))))));
} else if (t <= 5.2e-226) {
tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 7.5e-39) {
tmp = t * (sqrt(2.0) / fma(0.5, ((2.0 * ((t * t) + (l * l))) / (t * (x * sqrt(2.0)))), (t * sqrt(2.0))));
} 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.7e+140) tmp = Float64(-t_1); elseif (t <= -5.7e-145) tmp = Float64(t * sqrt(Float64(2.0 / Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(l * Float64(l / x))))))); elseif (t <= 5.2e-226) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 7.5e-39) tmp = Float64(t * Float64(sqrt(2.0) / fma(0.5, Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(l * l))) / Float64(t * Float64(x * sqrt(2.0)))), Float64(t * sqrt(2.0))))); else tmp = t_1; 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]}, If[LessEqual[t, -3.7e+140], (-t$95$1), If[LessEqual[t, -5.7e-145], N[(t * N[Sqrt[N[(2.0 / N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-226], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / 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, 7.5e-39], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(0.5 * N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t * N[(x * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * N[Sqrt[2.0], $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.7 \cdot 10^{+140}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-145}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{-39}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\mathsf{fma}\left(0.5, \frac{2 \cdot \left(t \cdot t + \ell \cdot \ell\right)}{t \cdot \left(x \cdot \sqrt{2}\right)}, t \cdot \sqrt{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.70000000000000003e140Initial program 6.4%
associate-*l/6.5%
Simplified6.5%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/9.4%
sub-neg9.4%
metadata-eval9.4%
unpow29.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
if -3.70000000000000003e140 < t < -5.70000000000000032e-145Initial program 65.5%
associate-*l/65.7%
Simplified65.7%
Taylor expanded in x around inf 82.8%
sub-neg82.8%
fma-def82.8%
unpow282.8%
fma-def82.8%
unpow282.8%
unpow282.8%
mul-1-neg82.8%
remove-double-neg82.8%
fma-def82.8%
unpow282.8%
unpow282.8%
Simplified82.8%
Taylor expanded in t around 0 82.0%
unpow282.0%
associate-/l*82.1%
Simplified82.1%
sqrt-undiv82.2%
associate-/l*82.2%
associate-/l*92.8%
associate-/r/92.8%
associate-/r/92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 82.2%
+-commutative82.2%
distribute-lft-out82.2%
unpow282.2%
associate-*r/92.8%
distribute-lft-out92.8%
+-commutative92.8%
unpow292.8%
unpow292.8%
associate-*l/92.8%
*-commutative92.8%
distribute-lft-out92.8%
Simplified92.8%
if -5.70000000000000032e-145 < t < 5.1999999999999997e-226Initial program 3.3%
associate-*l/3.3%
Simplified3.3%
Taylor expanded in l around inf 2.6%
Taylor expanded in x around inf 49.8%
associate-*r/49.8%
metadata-eval49.8%
associate-*r/49.8%
metadata-eval49.8%
unpow249.8%
Simplified49.8%
if 5.1999999999999997e-226 < t < 7.49999999999999971e-39Initial program 46.9%
associate-*l/46.9%
Simplified46.9%
Taylor expanded in x around inf 74.7%
sub-neg74.7%
fma-def74.7%
unpow274.7%
fma-def74.7%
unpow274.7%
unpow274.7%
mul-1-neg74.7%
remove-double-neg74.7%
fma-def74.7%
unpow274.7%
unpow274.7%
Simplified74.7%
Taylor expanded in t around 0 73.8%
unpow273.8%
associate-/l*73.8%
Simplified73.8%
Taylor expanded in x around inf 82.3%
fma-def82.3%
distribute-lft-out82.3%
unpow282.3%
unpow282.3%
*-commutative82.3%
*-commutative82.3%
Simplified82.3%
if 7.49999999999999971e-39 < t Initial program 41.3%
associate-*l/41.3%
Simplified41.3%
Taylor expanded in t around inf 28.3%
+-commutative28.3%
associate-*r/46.3%
sub-neg46.3%
metadata-eval46.3%
unpow246.3%
+-commutative46.3%
Simplified46.3%
Taylor expanded in t around 0 96.0%
Final simplification87.7%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(* t (sqrt (/ 2.0 (* 2.0 (+ (* t (+ t (/ t x))) (* l (/ l x))))))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -4e+140)
(- t_2)
(if (<= t -5.7e-145)
t_1
(if (<= t 1.05e-229)
(* t (/ (sqrt 2.0) (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x)))))))
(if (<= t 1e+129) t_1 t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x))))));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4e+140) {
tmp = -t_2;
} else if (t <= -5.7e-145) {
tmp = t_1;
} else if (t <= 1.05e-229) {
tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 1e+129) {
tmp = t_1;
} 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 = t * sqrt((2.0d0 / (2.0d0 * ((t * (t + (t / x))) + (l * (l / x))))))
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-4d+140)) then
tmp = -t_2
else if (t <= (-5.7d-145)) then
tmp = t_1
else if (t <= 1.05d-229) then
tmp = t * (sqrt(2.0d0) / (l * sqrt(((2.0d0 / x) + (2.0d0 / (x * x))))))
else if (t <= 1d+129) then
tmp = t_1
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 = t * Math.sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x))))));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -4e+140) {
tmp = -t_2;
} else if (t <= -5.7e-145) {
tmp = t_1;
} else if (t <= 1.05e-229) {
tmp = t * (Math.sqrt(2.0) / (l * Math.sqrt(((2.0 / x) + (2.0 / (x * x))))));
} else if (t <= 1e+129) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = t * math.sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x)))))) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -4e+140: tmp = -t_2 elif t <= -5.7e-145: tmp = t_1 elif t <= 1.05e-229: tmp = t * (math.sqrt(2.0) / (l * math.sqrt(((2.0 / x) + (2.0 / (x * x)))))) elif t <= 1e+129: tmp = t_1 else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(t * sqrt(Float64(2.0 / Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(l * Float64(l / x))))))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -4e+140) tmp = Float64(-t_2); elseif (t <= -5.7e-145) tmp = t_1; elseif (t <= 1.05e-229) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))))); elseif (t <= 1e+129) tmp = t_1; else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / x)))))); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -4e+140) tmp = -t_2; elseif (t <= -5.7e-145) tmp = t_1; elseif (t <= 1.05e-229) tmp = t * (sqrt(2.0) / (l * sqrt(((2.0 / x) + (2.0 / (x * x)))))); elseif (t <= 1e+129) tmp = t_1; 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[(t * N[Sqrt[N[(2.0 / N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $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, -4e+140], (-t$95$2), If[LessEqual[t, -5.7e-145], t$95$1, If[LessEqual[t, 1.05e-229], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / 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, 1e+129], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+140}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -5.7 \cdot 10^{-145}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-229}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}\\
\mathbf{elif}\;t \leq 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -4.00000000000000024e140Initial program 6.4%
associate-*l/6.5%
Simplified6.5%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/9.4%
sub-neg9.4%
metadata-eval9.4%
unpow29.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
if -4.00000000000000024e140 < t < -5.70000000000000032e-145 or 1.04999999999999992e-229 < t < 1e129Initial program 65.1%
associate-*l/65.1%
Simplified65.1%
Taylor expanded in x around inf 84.3%
sub-neg84.3%
fma-def84.3%
unpow284.3%
fma-def84.3%
unpow284.3%
unpow284.3%
mul-1-neg84.3%
remove-double-neg84.3%
fma-def84.3%
unpow284.3%
unpow284.3%
Simplified84.3%
Taylor expanded in t around 0 83.5%
unpow283.5%
associate-/l*83.5%
Simplified83.5%
sqrt-undiv83.1%
associate-/l*83.1%
associate-/l*89.2%
associate-/r/89.2%
associate-/r/89.2%
Applied egg-rr89.2%
Taylor expanded in x around 0 83.1%
+-commutative83.1%
distribute-lft-out83.1%
unpow283.1%
associate-*r/89.2%
distribute-lft-out89.2%
+-commutative89.2%
unpow289.2%
unpow289.2%
associate-*l/89.2%
*-commutative89.2%
distribute-lft-out89.2%
Simplified89.2%
if -5.70000000000000032e-145 < t < 1.04999999999999992e-229Initial program 3.4%
associate-*l/3.4%
Simplified3.4%
Taylor expanded in l around inf 2.7%
Taylor expanded in x around inf 52.5%
associate-*r/52.5%
metadata-eval52.5%
associate-*r/52.5%
metadata-eval52.5%
unpow252.5%
Simplified52.5%
if 1e129 < t Initial program 10.2%
associate-*l/10.3%
Simplified10.3%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/10.7%
sub-neg10.7%
metadata-eval10.7%
unpow210.7%
+-commutative10.7%
Simplified10.7%
Taylor expanded in t around 0 99.9%
Final simplification88.1%
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.8e+140)
(- t_1)
(if (<= t 9.8e+128)
(* t (sqrt (/ 2.0 (* 2.0 (+ (* t (+ t (/ t x))) (* l (/ l 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.8e+140) {
tmp = -t_1;
} else if (t <= 9.8e+128) {
tmp = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / 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.8d+140)) then
tmp = -t_1
else if (t <= 9.8d+128) then
tmp = t * sqrt((2.0d0 / (2.0d0 * ((t * (t + (t / x))) + (l * (l / 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.8e+140) {
tmp = -t_1;
} else if (t <= 9.8e+128) {
tmp = t * Math.sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / 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.8e+140: tmp = -t_1 elif t <= 9.8e+128: tmp = t * math.sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / 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.8e+140) tmp = Float64(-t_1); elseif (t <= 9.8e+128) tmp = Float64(t * sqrt(Float64(2.0 / Float64(2.0 * Float64(Float64(t * Float64(t + Float64(t / x))) + Float64(l * Float64(l / 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.8e+140) tmp = -t_1; elseif (t <= 9.8e+128) tmp = t * sqrt((2.0 / (2.0 * ((t * (t + (t / x))) + (l * (l / 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.8e+140], (-t$95$1), If[LessEqual[t, 9.8e+128], N[(t * N[Sqrt[N[(2.0 / N[(2.0 * N[(N[(t * N[(t + N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(l * N[(l / x), $MachinePrecision]), $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.8 \cdot 10^{+140}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+128}:\\
\;\;\;\;t \cdot \sqrt{\frac{2}{2 \cdot \left(t \cdot \left(t + \frac{t}{x}\right) + \ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.8000000000000001e140Initial program 6.4%
associate-*l/6.5%
Simplified6.5%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/9.4%
sub-neg9.4%
metadata-eval9.4%
unpow29.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around -inf 97.2%
mul-1-neg97.2%
+-commutative97.2%
sub-neg97.2%
metadata-eval97.2%
Simplified97.2%
if -3.8000000000000001e140 < t < 9.80000000000000035e128Initial program 52.2%
associate-*l/52.2%
Simplified52.2%
Taylor expanded in x around inf 77.9%
sub-neg77.9%
fma-def77.9%
unpow277.9%
fma-def77.9%
unpow277.9%
unpow277.9%
mul-1-neg77.9%
remove-double-neg77.9%
fma-def77.9%
unpow277.9%
unpow277.9%
Simplified77.9%
Taylor expanded in t around 0 77.3%
unpow277.3%
associate-/l*77.3%
Simplified77.3%
sqrt-undiv76.7%
associate-/l*76.7%
associate-/l*83.3%
associate-/r/83.3%
associate-/r/83.3%
Applied egg-rr83.3%
Taylor expanded in x around 0 76.7%
+-commutative76.7%
distribute-lft-out76.7%
unpow276.7%
associate-*r/83.3%
distribute-lft-out83.3%
+-commutative83.3%
unpow283.3%
unpow283.3%
associate-*l/83.3%
*-commutative83.3%
distribute-lft-out83.3%
Simplified83.3%
if 9.80000000000000035e128 < t Initial program 10.2%
associate-*l/10.3%
Simplified10.3%
Taylor expanded in t around inf 3.1%
+-commutative3.1%
associate-*r/10.7%
sub-neg10.7%
metadata-eval10.7%
unpow210.7%
+-commutative10.7%
Simplified10.7%
Taylor expanded in t around 0 99.9%
Final simplification89.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -2.75e-129) (* t (+ (/ 2.0 (* t (* x 2.0))) (/ -1.0 t))) (if (<= t 1.65e-226) (* t (/ (sqrt x) l)) (sqrt (/ (+ x -1.0) (+ x 1.0))))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -2.75e-129) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 1.65e-226) {
tmp = t * (sqrt(x) / 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 <= (-2.75d-129)) then
tmp = t * ((2.0d0 / (t * (x * 2.0d0))) + ((-1.0d0) / t))
else if (t <= 1.65d-226) then
tmp = t * (sqrt(x) / 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 <= -2.75e-129) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 1.65e-226) {
tmp = t * (Math.sqrt(x) / 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 <= -2.75e-129: tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)) elif t <= 1.65e-226: tmp = t * (math.sqrt(x) / 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 <= -2.75e-129) tmp = Float64(t * Float64(Float64(2.0 / Float64(t * Float64(x * 2.0))) + Float64(-1.0 / t))); elseif (t <= 1.65e-226) tmp = Float64(t * Float64(sqrt(x) / 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 <= -2.75e-129) tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)); elseif (t <= 1.65e-226) tmp = t * (sqrt(x) / 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, -2.75e-129], N[(t * N[(N[(2.0 / N[(t * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-226], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $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 -2.75 \cdot 10^{-129}:\\
\;\;\;\;t \cdot \left(\frac{2}{t \cdot \left(x \cdot 2\right)} + \frac{-1}{t}\right)\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -2.75000000000000012e-129Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
Taylor expanded in x around inf 46.4%
sub-neg46.4%
fma-def46.4%
unpow246.4%
fma-def46.4%
unpow246.4%
unpow246.4%
mul-1-neg46.4%
remove-double-neg46.4%
fma-def46.4%
unpow246.4%
unpow246.4%
Simplified46.4%
Taylor expanded in t around -inf 85.9%
mul-1-neg85.9%
distribute-rgt-neg-in85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in x around inf 86.1%
associate-*r/86.1%
metadata-eval86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
associate-*r/86.2%
metadata-eval86.2%
*-commutative86.2%
unpow286.2%
rem-square-sqrt86.2%
distribute-neg-frac86.2%
metadata-eval86.2%
Simplified86.2%
if -2.75000000000000012e-129 < t < 1.65e-226Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in x around inf 55.0%
sub-neg55.0%
fma-def55.0%
unpow255.0%
fma-def55.0%
unpow255.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
fma-def55.0%
unpow255.0%
unpow255.0%
Simplified55.0%
Taylor expanded in t around 0 51.0%
Taylor expanded in l around 0 51.2%
associate-*l/51.0%
*-lft-identity51.0%
Simplified51.0%
if 1.65e-226 < t Initial program 42.6%
associate-*l/42.6%
Simplified42.6%
Taylor expanded in t around inf 35.7%
+-commutative35.7%
associate-*r/49.5%
sub-neg49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
Simplified49.5%
Taylor expanded in t around 0 91.7%
Final simplification83.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -7.2e-128)
(* t (+ (/ 2.0 (* t (* x 2.0))) (/ -1.0 t)))
(if (<= t 7.2e-227)
(* t (* (/ 1.0 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 <= -7.2e-128) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 7.2e-227) {
tmp = t * ((1.0 / 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 <= (-7.2d-128)) then
tmp = t * ((2.0d0 / (t * (x * 2.0d0))) + ((-1.0d0) / t))
else if (t <= 7.2d-227) then
tmp = t * ((1.0d0 / 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 <= -7.2e-128) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 7.2e-227) {
tmp = t * ((1.0 / 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 <= -7.2e-128: tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)) elif t <= 7.2e-227: tmp = t * ((1.0 / 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 <= -7.2e-128) tmp = Float64(t * Float64(Float64(2.0 / Float64(t * Float64(x * 2.0))) + Float64(-1.0 / t))); elseif (t <= 7.2e-227) tmp = Float64(t * Float64(Float64(1.0 / 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 <= -7.2e-128) tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)); elseif (t <= 7.2e-227) tmp = t * ((1.0 / 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, -7.2e-128], N[(t * N[(N[(2.0 / N[(t * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-227], N[(t * N[(N[(1.0 / l), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $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 -7.2 \cdot 10^{-128}:\\
\;\;\;\;t \cdot \left(\frac{2}{t \cdot \left(x \cdot 2\right)} + \frac{-1}{t}\right)\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-227}:\\
\;\;\;\;t \cdot \left(\frac{1}{\ell} \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -7.20000000000000049e-128Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
Taylor expanded in x around inf 46.4%
sub-neg46.4%
fma-def46.4%
unpow246.4%
fma-def46.4%
unpow246.4%
unpow246.4%
mul-1-neg46.4%
remove-double-neg46.4%
fma-def46.4%
unpow246.4%
unpow246.4%
Simplified46.4%
Taylor expanded in t around -inf 85.9%
mul-1-neg85.9%
distribute-rgt-neg-in85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in x around inf 86.1%
associate-*r/86.1%
metadata-eval86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
associate-*r/86.2%
metadata-eval86.2%
*-commutative86.2%
unpow286.2%
rem-square-sqrt86.2%
distribute-neg-frac86.2%
metadata-eval86.2%
Simplified86.2%
if -7.20000000000000049e-128 < t < 7.1999999999999999e-227Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in x around inf 55.0%
sub-neg55.0%
fma-def55.0%
unpow255.0%
fma-def55.0%
unpow255.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
fma-def55.0%
unpow255.0%
unpow255.0%
Simplified55.0%
Taylor expanded in t around 0 51.0%
Taylor expanded in l around 0 51.2%
if 7.1999999999999999e-227 < t Initial program 42.6%
associate-*l/42.6%
Simplified42.6%
Taylor expanded in t around inf 35.7%
+-commutative35.7%
associate-*r/49.5%
sub-neg49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
Simplified49.5%
Taylor expanded in t around 0 91.7%
Final simplification83.8%
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 -9.2e-122)
(- t_1)
(if (<= t 4.2e-226) (* t (* (/ 1.0 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 <= -9.2e-122) {
tmp = -t_1;
} else if (t <= 4.2e-226) {
tmp = t * ((1.0 / 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 <= (-9.2d-122)) then
tmp = -t_1
else if (t <= 4.2d-226) then
tmp = t * ((1.0d0 / 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 <= -9.2e-122) {
tmp = -t_1;
} else if (t <= 4.2e-226) {
tmp = t * ((1.0 / 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 <= -9.2e-122: tmp = -t_1 elif t <= 4.2e-226: tmp = t * ((1.0 / 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 <= -9.2e-122) tmp = Float64(-t_1); elseif (t <= 4.2e-226) tmp = Float64(t * Float64(Float64(1.0 / 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 <= -9.2e-122) tmp = -t_1; elseif (t <= 4.2e-226) tmp = t * ((1.0 / 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, -9.2e-122], (-t$95$1), If[LessEqual[t, 4.2e-226], N[(t * N[(N[(1.0 / l), $MachinePrecision] * N[Sqrt[x], $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 -9.2 \cdot 10^{-122}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \left(\frac{1}{\ell} \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.20000000000000028e-122Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
Taylor expanded in t around inf 33.3%
+-commutative33.3%
associate-*r/46.2%
sub-neg46.2%
metadata-eval46.2%
unpow246.2%
+-commutative46.2%
Simplified46.2%
Taylor expanded in t around -inf 87.6%
mul-1-neg87.6%
+-commutative87.6%
sub-neg87.6%
metadata-eval87.6%
Simplified87.6%
if -9.20000000000000028e-122 < t < 4.2000000000000003e-226Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in x around inf 55.0%
sub-neg55.0%
fma-def55.0%
unpow255.0%
fma-def55.0%
unpow255.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
fma-def55.0%
unpow255.0%
unpow255.0%
Simplified55.0%
Taylor expanded in t around 0 51.0%
Taylor expanded in l around 0 51.2%
if 4.2000000000000003e-226 < t Initial program 42.6%
associate-*l/42.6%
Simplified42.6%
Taylor expanded in t around inf 35.7%
+-commutative35.7%
associate-*r/49.5%
sub-neg49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
Simplified49.5%
Taylor expanded in t around 0 91.7%
Final simplification84.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -5.2e-122)
(* t (+ (/ 2.0 (* t (* x 2.0))) (/ -1.0 t)))
(if (<= t 5.2e-226)
(* (sqrt x) (/ 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 <= -5.2e-122) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 5.2e-226) {
tmp = sqrt(x) * (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 <= (-5.2d-122)) then
tmp = t * ((2.0d0 / (t * (x * 2.0d0))) + ((-1.0d0) / t))
else if (t <= 5.2d-226) then
tmp = sqrt(x) * (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 <= -5.2e-122) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 5.2e-226) {
tmp = Math.sqrt(x) * (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 <= -5.2e-122: tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)) elif t <= 5.2e-226: tmp = math.sqrt(x) * (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 <= -5.2e-122) tmp = Float64(t * Float64(Float64(2.0 / Float64(t * Float64(x * 2.0))) + Float64(-1.0 / t))); elseif (t <= 5.2e-226) tmp = Float64(sqrt(x) * Float64(t / l)); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5.2e-122) tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)); elseif (t <= 5.2e-226) tmp = sqrt(x) * (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, -5.2e-122], N[(t * N[(N[(2.0 / N[(t * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-226], N[(N[Sqrt[x], $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-122}:\\
\;\;\;\;t \cdot \left(\frac{2}{t \cdot \left(x \cdot 2\right)} + \frac{-1}{t}\right)\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-226}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -5.1999999999999995e-122Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
Taylor expanded in x around inf 46.4%
sub-neg46.4%
fma-def46.4%
unpow246.4%
fma-def46.4%
unpow246.4%
unpow246.4%
mul-1-neg46.4%
remove-double-neg46.4%
fma-def46.4%
unpow246.4%
unpow246.4%
Simplified46.4%
Taylor expanded in t around -inf 85.9%
mul-1-neg85.9%
distribute-rgt-neg-in85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in x around inf 86.1%
associate-*r/86.1%
metadata-eval86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
associate-*r/86.2%
metadata-eval86.2%
*-commutative86.2%
unpow286.2%
rem-square-sqrt86.2%
distribute-neg-frac86.2%
metadata-eval86.2%
Simplified86.2%
if -5.1999999999999995e-122 < t < 5.1999999999999997e-226Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in x around inf 55.0%
sub-neg55.0%
fma-def55.0%
unpow255.0%
fma-def55.0%
unpow255.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
fma-def55.0%
unpow255.0%
unpow255.0%
Simplified55.0%
Taylor expanded in t around 0 51.0%
Taylor expanded in l around 0 41.0%
if 5.1999999999999997e-226 < t Initial program 42.6%
associate-*l/42.6%
Simplified42.6%
Taylor expanded in t around inf 35.7%
+-commutative35.7%
associate-*r/49.5%
sub-neg49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
Simplified49.5%
Taylor expanded in x around inf 91.6%
associate--l+91.6%
associate-*r/91.6%
metadata-eval91.6%
unpow291.6%
Simplified91.6%
Final simplification82.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -7.6e-130)
(* t (+ (/ 2.0 (* t (* x 2.0))) (/ -1.0 t)))
(if (<= t 1.5e-226)
(* t (/ (sqrt x) 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 <= -7.6e-130) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 1.5e-226) {
tmp = t * (sqrt(x) / 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 <= (-7.6d-130)) then
tmp = t * ((2.0d0 / (t * (x * 2.0d0))) + ((-1.0d0) / t))
else if (t <= 1.5d-226) then
tmp = t * (sqrt(x) / 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 <= -7.6e-130) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else if (t <= 1.5e-226) {
tmp = t * (Math.sqrt(x) / 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 <= -7.6e-130: tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)) elif t <= 1.5e-226: tmp = t * (math.sqrt(x) / 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 <= -7.6e-130) tmp = Float64(t * Float64(Float64(2.0 / Float64(t * Float64(x * 2.0))) + Float64(-1.0 / t))); elseif (t <= 1.5e-226) tmp = Float64(t * Float64(sqrt(x) / l)); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -7.6e-130) tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)); elseif (t <= 1.5e-226) tmp = t * (sqrt(x) / 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, -7.6e-130], N[(t * N[(N[(2.0 / N[(t * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-226], N[(t * N[(N[Sqrt[x], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{-130}:\\
\;\;\;\;t \cdot \left(\frac{2}{t \cdot \left(x \cdot 2\right)} + \frac{-1}{t}\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-226}:\\
\;\;\;\;t \cdot \frac{\sqrt{x}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -7.5999999999999997e-130Initial program 38.4%
associate-*l/38.5%
Simplified38.5%
Taylor expanded in x around inf 46.4%
sub-neg46.4%
fma-def46.4%
unpow246.4%
fma-def46.4%
unpow246.4%
unpow246.4%
mul-1-neg46.4%
remove-double-neg46.4%
fma-def46.4%
unpow246.4%
unpow246.4%
Simplified46.4%
Taylor expanded in t around -inf 85.9%
mul-1-neg85.9%
distribute-rgt-neg-in85.9%
associate-*r/85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in x around inf 86.1%
associate-*r/86.1%
metadata-eval86.1%
*-commutative86.1%
Simplified86.1%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
associate-*r/86.2%
metadata-eval86.2%
*-commutative86.2%
unpow286.2%
rem-square-sqrt86.2%
distribute-neg-frac86.2%
metadata-eval86.2%
Simplified86.2%
if -7.5999999999999997e-130 < t < 1.49999999999999998e-226Initial program 3.2%
associate-*l/3.2%
Simplified3.2%
Taylor expanded in x around inf 55.0%
sub-neg55.0%
fma-def55.0%
unpow255.0%
fma-def55.0%
unpow255.0%
unpow255.0%
mul-1-neg55.0%
remove-double-neg55.0%
fma-def55.0%
unpow255.0%
unpow255.0%
Simplified55.0%
Taylor expanded in t around 0 51.0%
Taylor expanded in l around 0 51.2%
associate-*l/51.0%
*-lft-identity51.0%
Simplified51.0%
if 1.49999999999999998e-226 < t Initial program 42.6%
associate-*l/42.6%
Simplified42.6%
Taylor expanded in t around inf 35.7%
+-commutative35.7%
associate-*r/49.5%
sub-neg49.5%
metadata-eval49.5%
unpow249.5%
+-commutative49.5%
Simplified49.5%
Taylor expanded in x around inf 91.6%
associate--l+91.6%
associate-*r/91.6%
metadata-eval91.6%
unpow291.6%
Simplified91.6%
Final simplification83.8%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-309) (* t (+ (/ 2.0 (* t (* x 2.0))) (/ -1.0 t))) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-309) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-309)) then
tmp = t * ((2.0d0 / (t * (x * 2.0d0))) + ((-1.0d0) / t))
else
tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-309) {
tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t));
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-309: tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-309) tmp = Float64(t * Float64(Float64(2.0 / Float64(t * Float64(x * 2.0))) + Float64(-1.0 / t))); else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-309) tmp = t * ((2.0 / (t * (x * 2.0))) + (-1.0 / t)); else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-309], N[(t * N[(N[(2.0 / N[(t * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-309}:\\
\;\;\;\;t \cdot \left(\frac{2}{t \cdot \left(x \cdot 2\right)} + \frac{-1}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -4.9999999999999995e-309Initial program 31.2%
associate-*l/31.3%
Simplified31.3%
Taylor expanded in x around inf 47.7%
sub-neg47.7%
fma-def47.7%
unpow247.7%
fma-def47.7%
unpow247.7%
unpow247.7%
mul-1-neg47.7%
remove-double-neg47.7%
fma-def47.7%
unpow247.7%
unpow247.7%
Simplified47.7%
Taylor expanded in t around -inf 75.3%
mul-1-neg75.3%
distribute-rgt-neg-in75.3%
associate-*r/75.3%
metadata-eval75.3%
Simplified75.3%
Taylor expanded in x around inf 75.4%
associate-*r/75.4%
metadata-eval75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in x around inf 75.4%
sub-neg75.4%
associate-*r/75.4%
metadata-eval75.4%
*-commutative75.4%
unpow275.4%
rem-square-sqrt75.4%
distribute-neg-frac75.4%
metadata-eval75.4%
Simplified75.4%
if -4.9999999999999995e-309 < t Initial program 39.5%
associate-*l/39.5%
Simplified39.5%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
associate-*r/45.8%
sub-neg45.8%
metadata-eval45.8%
unpow245.8%
+-commutative45.8%
Simplified45.8%
Taylor expanded in x around inf 85.7%
associate--l+85.7%
associate-*r/85.7%
metadata-eval85.7%
unpow285.7%
Simplified85.7%
Final simplification80.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) -1.0 (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
tmp = -1.0;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-5d-311)) then
tmp = -1.0d0
else
tmp = 1.0d0 + ((0.5d0 / (x * x)) + ((-1.0d0) / x))
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
tmp = -1.0;
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-311: tmp = -1.0 else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-311) tmp = -1.0; else tmp = Float64(1.0 + Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x))); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -5e-311) tmp = -1.0; else tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -5e-311], -1.0, N[(1.0 + N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 31.2%
associate-*l/31.3%
Simplified31.3%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.8%
Simplified73.8%
sqrt-unprod74.9%
metadata-eval74.9%
metadata-eval74.9%
Applied egg-rr74.9%
if -5.00000000000023e-311 < t Initial program 39.5%
associate-*l/39.5%
Simplified39.5%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
associate-*r/45.8%
sub-neg45.8%
metadata-eval45.8%
unpow245.8%
+-commutative45.8%
Simplified45.8%
Taylor expanded in x around inf 85.7%
associate--l+85.7%
associate-*r/85.7%
metadata-eval85.7%
unpow285.7%
Simplified85.7%
Final simplification80.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) -1.0 (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
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-311)) 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-311) {
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-311: 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-311) 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-311) 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-311], -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^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 31.2%
associate-*l/31.3%
Simplified31.3%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.8%
Simplified73.8%
sqrt-unprod74.9%
metadata-eval74.9%
metadata-eval74.9%
Applied egg-rr74.9%
if -5.00000000000023e-311 < t Initial program 39.5%
associate-*l/39.5%
Simplified39.5%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
associate-*r/45.8%
sub-neg45.8%
metadata-eval45.8%
unpow245.8%
+-commutative45.8%
Simplified45.8%
Taylor expanded in x around inf 85.2%
Final simplification80.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -5e-311) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5e-311) {
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-311)) 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-311) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -5e-311: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5e-311) 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-311) 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-311], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-311}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -5.00000000000023e-311Initial program 31.2%
associate-*l/31.3%
Simplified31.3%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt73.8%
Simplified73.8%
sqrt-unprod74.9%
metadata-eval74.9%
metadata-eval74.9%
Applied egg-rr74.9%
if -5.00000000000023e-311 < t Initial program 39.5%
associate-*l/39.5%
Simplified39.5%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
associate-*r/45.8%
sub-neg45.8%
metadata-eval45.8%
unpow245.8%
+-commutative45.8%
Simplified45.8%
Taylor expanded in x around inf 84.0%
Final simplification79.5%
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 35.4%
associate-*l/35.5%
Simplified35.5%
Taylor expanded in t around inf 30.2%
+-commutative30.2%
associate-*r/41.7%
sub-neg41.7%
metadata-eval41.7%
unpow241.7%
+-commutative41.7%
Simplified41.7%
Taylor expanded in x around inf 43.5%
Final simplification43.5%
herbie shell --seed 2023271
(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)))))