
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))))
(if (<= t -1.15e+26)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -1.15e-161)
t_2
(if (<= t -1.1e-203)
-1.0
(if (<= t 3.5e-130)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 1.6e+32) t_2 (+ 1.0 (/ -1.0 x)))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -1.15e+26) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -1.15e-161) {
tmp = t_2;
} else if (t <= -1.1e-203) {
tmp = -1.0;
} else if (t <= 3.5e-130) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 1.6e+32) {
tmp = t_2;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (l * l) / x
t_2 = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
if (t <= (-1.15d+26)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= (-1.15d-161)) then
tmp = t_2
else if (t <= (-1.1d-203)) then
tmp = -1.0d0
else if (t <= 3.5d-130) then
tmp = t * (sqrt(2.0d0) / (sqrt(2.0d0) * (l * sqrt((1.0d0 / x)))))
else if (t <= 1.6d+32) then
tmp = t_2
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
double tmp;
if (t <= -1.15e+26) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -1.15e-161) {
tmp = t_2;
} else if (t <= -1.1e-203) {
tmp = -1.0;
} else if (t <= 3.5e-130) {
tmp = t * (Math.sqrt(2.0) / (Math.sqrt(2.0) * (l * Math.sqrt((1.0 / x)))));
} else if (t <= 1.6e+32) {
tmp = t_2;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x t_2 = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) tmp = 0 if t <= -1.15e+26: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= -1.15e-161: tmp = t_2 elif t <= -1.1e-203: tmp = -1.0 elif t <= 3.5e-130: tmp = t * (math.sqrt(2.0) / (math.sqrt(2.0) * (l * math.sqrt((1.0 / x))))) elif t <= 1.6e+32: tmp = t_2 else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))) tmp = 0.0 if (t <= -1.15e+26) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -1.15e-161) tmp = t_2; elseif (t <= -1.1e-203) tmp = -1.0; elseif (t <= 3.5e-130) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 1.6e+32) tmp = t_2; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l * l) / x; t_2 = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); tmp = 0.0; if (t <= -1.15e+26) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= -1.15e-161) tmp = t_2; elseif (t <= -1.1e-203) tmp = -1.0; elseif (t <= 3.5e-130) tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x))))); elseif (t <= 1.6e+32) tmp = t_2; else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.15e+26], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -1.15e-161], t$95$2, If[LessEqual[t, -1.1e-203], -1.0, If[LessEqual[t, 3.5e-130], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.6e+32], t$95$2, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+26}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-161}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-203}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-130}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+32}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.15e26Initial program 40.1%
associate-*r/40.1%
fma-neg40.1%
remove-double-neg40.1%
fma-neg40.1%
sub-neg40.1%
metadata-eval40.1%
remove-double-neg40.1%
+-commutative40.1%
fma-def40.1%
Simplified40.1%
Applied egg-rr80.4%
Taylor expanded in t around -inf 94.4%
mul-1-neg94.4%
sub-neg94.4%
metadata-eval94.4%
Simplified94.4%
if -1.15e26 < t < -1.15e-161 or 3.4999999999999999e-130 < t < 1.5999999999999999e32Initial program 56.6%
associate-*l/56.7%
Simplified56.7%
Taylor expanded in x around inf 94.4%
associate--l+94.4%
unpow294.4%
distribute-lft-out94.4%
unpow294.4%
unpow294.4%
associate-*r/94.4%
mul-1-neg94.4%
unpow294.4%
+-commutative94.4%
unpow294.4%
fma-udef94.4%
Simplified94.4%
Taylor expanded in t around 0 93.5%
associate-*r/93.5%
neg-mul-193.5%
unpow293.5%
distribute-rgt-neg-in93.5%
Simplified93.5%
if -1.15e-161 < t < -1.1e-203Initial program 2.6%
associate-*r/2.6%
fma-neg2.6%
remove-double-neg2.6%
fma-neg2.6%
sub-neg2.6%
metadata-eval2.6%
remove-double-neg2.6%
+-commutative2.6%
fma-def2.6%
Simplified2.6%
Applied egg-rr53.0%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt68.6%
Simplified68.6%
if -1.1e-203 < t < 3.4999999999999999e-130Initial program 4.4%
associate-*l/4.4%
Simplified4.4%
Taylor expanded in x around inf 56.7%
associate--l+56.7%
unpow256.7%
distribute-lft-out56.7%
unpow256.7%
unpow256.7%
associate-*r/56.7%
mul-1-neg56.7%
unpow256.7%
+-commutative56.7%
unpow256.7%
fma-udef56.7%
Simplified56.7%
Taylor expanded in l around inf 46.7%
associate-*l*46.7%
Simplified46.7%
if 1.5999999999999999e32 < t Initial program 37.7%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr86.0%
Taylor expanded in t around inf 98.8%
Taylor expanded in x around inf 98.8%
Final simplification87.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x))
(t_2 (+ (* t t) (* t t)))
(t_3
(*
t
(/
(sqrt 2.0)
(sqrt
(+
t_1
(+
(fma 2.0 (/ t_2 x) (* 2.0 (+ (* t t) (/ t_2 (* x x)))))
(+ t_1 (/ (+ (* l l) (* l l)) (* x x))))))))))
(if (<= t -3.2e+28)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -1e-171)
t_3
(if (<= t 3.5e-130)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 5.8e+32) t_3 (+ 1.0 (/ -1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double t_2 = (t * t) + (t * t);
double t_3 = t * (sqrt(2.0) / sqrt((t_1 + (fma(2.0, (t_2 / x), (2.0 * ((t * t) + (t_2 / (x * x))))) + (t_1 + (((l * l) + (l * l)) / (x * x)))))));
double tmp;
if (t <= -3.2e+28) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -1e-171) {
tmp = t_3;
} else if (t <= 3.5e-130) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 5.8e+32) {
tmp = t_3;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) t_2 = Float64(Float64(t * t) + Float64(t * t)) t_3 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(fma(2.0, Float64(t_2 / x), Float64(2.0 * Float64(Float64(t * t) + Float64(t_2 / Float64(x * x))))) + Float64(t_1 + Float64(Float64(Float64(l * l) + Float64(l * l)) / Float64(x * x)))))))) tmp = 0.0 if (t <= -3.2e+28) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -1e-171) tmp = t_3; elseif (t <= 3.5e-130) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 5.8e+32) tmp = t_3; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t * t), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(N[(2.0 * N[(t$95$2 / x), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(t$95$2 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(N[(l * l), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+28], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -1e-171], t$95$3, If[LessEqual[t, 3.5e-130], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+32], t$95$3, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
t_2 := t \cdot t + t \cdot t\\
t_3 := t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(\mathsf{fma}\left(2, \frac{t_2}{x}, 2 \cdot \left(t \cdot t + \frac{t_2}{x \cdot x}\right)\right) + \left(t_1 + \frac{\ell \cdot \ell + \ell \cdot \ell}{x \cdot x}\right)\right)}}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+28}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-171}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-130}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+32}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.2e28Initial program 40.1%
associate-*r/40.1%
fma-neg40.1%
remove-double-neg40.1%
fma-neg40.1%
sub-neg40.1%
metadata-eval40.1%
remove-double-neg40.1%
+-commutative40.1%
fma-def40.1%
Simplified40.1%
Applied egg-rr80.4%
Taylor expanded in t around -inf 94.4%
mul-1-neg94.4%
sub-neg94.4%
metadata-eval94.4%
Simplified94.4%
if -3.2e28 < t < -9.9999999999999998e-172 or 3.4999999999999999e-130 < t < 5.80000000000000006e32Initial program 54.2%
associate-*l/54.3%
Simplified54.3%
fma-neg54.3%
metadata-eval54.3%
sub-neg54.3%
fma-udef54.3%
+-commutative54.3%
fma-neg54.3%
distribute-rgt-in54.3%
associate--l+54.3%
clear-num54.3%
un-div-inv54.4%
sub-neg54.4%
metadata-eval54.4%
Applied egg-rr54.4%
Taylor expanded in x around inf 92.3%
associate--l+92.3%
unpow292.3%
Simplified92.3%
if -9.9999999999999998e-172 < t < 3.4999999999999999e-130Initial program 4.3%
associate-*l/4.3%
Simplified4.3%
Taylor expanded in x around inf 53.9%
associate--l+53.9%
unpow253.9%
distribute-lft-out53.9%
unpow253.9%
unpow253.9%
associate-*r/53.9%
mul-1-neg53.9%
unpow253.9%
+-commutative53.9%
unpow253.9%
fma-udef53.9%
Simplified53.9%
Taylor expanded in l around inf 43.5%
associate-*l*43.5%
Simplified43.5%
if 5.80000000000000006e32 < t Initial program 37.7%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr86.0%
Taylor expanded in t around inf 98.8%
Taylor expanded in x around inf 98.8%
Final simplification86.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
(sqrt 2.0)
(/
t
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma 2.0 (* t t) (* l l)) x))))))))
(if (<= t -96000000000.0)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -4.5e-176)
t_1
(if (<= t 3.5e-130)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 1.3e+32) t_1 (+ 1.0 (/ -1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * (t / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma(2.0, (t * t), (l * l)) / x)))));
double tmp;
if (t <= -96000000000.0) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -4.5e-176) {
tmp = t_1;
} else if (t <= 3.5e-130) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 1.3e+32) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * Float64(t / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x)))))) tmp = 0.0 if (t <= -96000000000.0) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -4.5e-176) tmp = t_1; elseif (t <= 3.5e-130) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 1.3e+32) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * N[(t / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -96000000000.0], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -4.5e-176], t$95$1, If[LessEqual[t, 3.5e-130], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+32], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot \frac{t}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{if}\;t \leq -96000000000:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-176}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-130}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -9.6e10Initial program 41.2%
associate-*r/41.2%
fma-neg41.2%
remove-double-neg41.2%
fma-neg41.2%
sub-neg41.2%
metadata-eval41.2%
remove-double-neg41.2%
+-commutative41.2%
fma-def41.2%
Simplified41.2%
Applied egg-rr79.9%
Taylor expanded in t around -inf 94.6%
mul-1-neg94.6%
sub-neg94.6%
metadata-eval94.6%
Simplified94.6%
if -9.6e10 < t < -4.5e-176 or 3.4999999999999999e-130 < t < 1.3000000000000001e32Initial program 53.6%
associate-*r/53.5%
fma-neg53.6%
remove-double-neg53.6%
fma-neg53.5%
sub-neg53.5%
metadata-eval53.5%
remove-double-neg53.5%
+-commutative53.5%
fma-def53.5%
Simplified53.5%
Taylor expanded in x around inf 91.2%
associate--l+91.4%
unpow291.4%
distribute-lft-out91.4%
unpow291.4%
unpow291.4%
associate-*r/91.4%
mul-1-neg91.4%
unpow291.4%
+-commutative91.4%
unpow291.4%
fma-udef91.4%
Simplified91.2%
if -4.5e-176 < t < 3.4999999999999999e-130Initial program 4.3%
associate-*l/4.3%
Simplified4.3%
Taylor expanded in x around inf 53.9%
associate--l+53.9%
unpow253.9%
distribute-lft-out53.9%
unpow253.9%
unpow253.9%
associate-*r/53.9%
mul-1-neg53.9%
unpow253.9%
+-commutative53.9%
unpow253.9%
fma-udef53.9%
Simplified53.9%
Taylor expanded in l around inf 43.5%
associate-*l*43.5%
Simplified43.5%
if 1.3000000000000001e32 < t Initial program 37.7%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr86.0%
Taylor expanded in t around inf 98.8%
Taylor expanded in x around inf 98.8%
Final simplification86.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma 2.0 (* t t) (* l l)) x))))))))
(if (<= t -1e+28)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t -1.1e-171)
t_1
(if (<= t 3.5e-130)
(* t (/ (sqrt 2.0) (* (sqrt 2.0) (* l (sqrt (/ 1.0 x))))))
(if (<= t 5.6e+32) t_1 (+ 1.0 (/ -1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma(2.0, (t * t), (l * l)) / x)))));
double tmp;
if (t <= -1e+28) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= -1.1e-171) {
tmp = t_1;
} else if (t <= 3.5e-130) {
tmp = t * (sqrt(2.0) / (sqrt(2.0) * (l * sqrt((1.0 / x)))));
} else if (t <= 5.6e+32) {
tmp = t_1;
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(2.0, Float64(t * t), Float64(l * l)) / x)))))) tmp = 0.0 if (t <= -1e+28) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= -1.1e-171) tmp = t_1; elseif (t <= 3.5e-130) tmp = Float64(t * Float64(sqrt(2.0) / Float64(sqrt(2.0) * Float64(l * sqrt(Float64(1.0 / x)))))); elseif (t <= 5.6e+32) tmp = t_1; else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(t * t), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e+28], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, -1.1e-171], t$95$1, If[LessEqual[t, 3.5e-130], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[(l * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+32], t$95$1, N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{if}\;t \leq -1 \cdot 10^{+28}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-171}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-130}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2} \cdot \left(\ell \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -9.99999999999999958e27Initial program 40.1%
associate-*r/40.1%
fma-neg40.1%
remove-double-neg40.1%
fma-neg40.1%
sub-neg40.1%
metadata-eval40.1%
remove-double-neg40.1%
+-commutative40.1%
fma-def40.1%
Simplified40.1%
Applied egg-rr80.4%
Taylor expanded in t around -inf 94.4%
mul-1-neg94.4%
sub-neg94.4%
metadata-eval94.4%
Simplified94.4%
if -9.99999999999999958e27 < t < -1.1000000000000001e-171 or 3.4999999999999999e-130 < t < 5.6e32Initial program 54.2%
associate-*l/54.3%
Simplified54.3%
Taylor expanded in x around inf 91.8%
associate--l+91.8%
unpow291.8%
distribute-lft-out91.8%
unpow291.8%
unpow291.8%
associate-*r/91.8%
mul-1-neg91.8%
unpow291.8%
+-commutative91.8%
unpow291.8%
fma-udef91.8%
Simplified91.8%
if -1.1000000000000001e-171 < t < 3.4999999999999999e-130Initial program 4.3%
associate-*l/4.3%
Simplified4.3%
Taylor expanded in x around inf 53.9%
associate--l+53.9%
unpow253.9%
distribute-lft-out53.9%
unpow253.9%
unpow253.9%
associate-*r/53.9%
mul-1-neg53.9%
unpow253.9%
+-commutative53.9%
unpow253.9%
fma-udef53.9%
Simplified53.9%
Taylor expanded in l around inf 43.5%
associate-*l*43.5%
Simplified43.5%
if 5.6e32 < t Initial program 37.7%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr86.0%
Taylor expanded in t around inf 98.8%
Taylor expanded in x around inf 98.8%
Final simplification86.4%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -1.7e+29)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 5.5e+32)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_1 (+ t_1 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
(+ 1.0 (/ -1.0 x))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -1.7e+29) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 5.5e+32) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-1.7d+29)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 5.5d+32) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + (t_1 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -1.7e+29) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 5.5e+32) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -1.7e+29: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 5.5e+32: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1.7e+29) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 5.5e+32) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + Float64(t_1 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (l * l) / x; tmp = 0.0; if (t <= -1.7e+29) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 5.5e+32) tmp = t * (sqrt(2.0) / sqrt((t_1 + (t_1 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.7e+29], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 5.5e+32], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + N[(t$95$1 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{+29}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+32}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + \left(t_1 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -1.69999999999999991e29Initial program 40.1%
associate-*r/40.1%
fma-neg40.1%
remove-double-neg40.1%
fma-neg40.1%
sub-neg40.1%
metadata-eval40.1%
remove-double-neg40.1%
+-commutative40.1%
fma-def40.1%
Simplified40.1%
Applied egg-rr80.4%
Taylor expanded in t around -inf 94.4%
mul-1-neg94.4%
sub-neg94.4%
metadata-eval94.4%
Simplified94.4%
if -1.69999999999999991e29 < t < 5.49999999999999984e32Initial program 34.8%
associate-*l/34.9%
Simplified34.9%
Taylor expanded in x around inf 77.1%
associate--l+77.1%
unpow277.1%
distribute-lft-out77.1%
unpow277.1%
unpow277.1%
associate-*r/77.1%
mul-1-neg77.1%
unpow277.1%
+-commutative77.1%
unpow277.1%
fma-udef77.1%
Simplified77.1%
Taylor expanded in t around 0 76.6%
associate-*r/76.6%
neg-mul-176.6%
unpow276.6%
distribute-rgt-neg-in76.6%
Simplified76.6%
if 5.49999999999999984e32 < t Initial program 37.7%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr86.0%
Taylor expanded in t around inf 98.8%
Taylor expanded in x around inf 98.8%
Final simplification88.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (* l l) x)))
(if (<= t -1.7e-214)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.9e-143)
(* t (/ (sqrt 2.0) (sqrt (+ t_1 t_1))))
(+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = (l * l) / x;
double tmp;
if (t <= -1.7e-214) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.9e-143) {
tmp = t * (sqrt(2.0) / sqrt((t_1 + t_1)));
} 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) :: t_1
real(8) :: tmp
t_1 = (l * l) / x
if (t <= (-1.7d-214)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.9d-143) then
tmp = t * (sqrt(2.0d0) / sqrt((t_1 + t_1)))
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 t_1 = (l * l) / x;
double tmp;
if (t <= -1.7e-214) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.9e-143) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_1 + t_1)));
} else {
tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x));
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (l * l) / x tmp = 0 if t <= -1.7e-214: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.9e-143: tmp = t * (math.sqrt(2.0) / math.sqrt((t_1 + t_1))) else: tmp = 1.0 + ((0.5 / (x * x)) + (-1.0 / x)) return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1.7e-214) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.9e-143) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_1 + t_1)))); 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) t_1 = (l * l) / x; tmp = 0.0; if (t <= -1.7e-214) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.9e-143) tmp = t * (sqrt(2.0) / sqrt((t_1 + t_1))); 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_] := Block[{t$95$1 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.7e-214], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.9e-143], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$1 + t$95$1), $MachinePrecision]], $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}
t_1 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-214}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-143}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_1 + t_1}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -1.7e-214Initial program 40.9%
associate-*r/40.9%
fma-neg41.0%
remove-double-neg41.0%
fma-neg40.9%
sub-neg40.9%
metadata-eval40.9%
remove-double-neg40.9%
+-commutative40.9%
fma-def40.9%
Simplified40.9%
Applied egg-rr70.4%
Taylor expanded in t around -inf 86.4%
mul-1-neg86.4%
sub-neg86.4%
metadata-eval86.4%
Simplified86.4%
if -1.7e-214 < t < 1.89999999999999991e-143Initial program 4.7%
associate-*l/4.7%
Simplified4.7%
Taylor expanded in x around inf 59.7%
associate--l+59.7%
unpow259.7%
distribute-lft-out59.7%
unpow259.7%
unpow259.7%
associate-*r/59.7%
mul-1-neg59.7%
unpow259.7%
+-commutative59.7%
unpow259.7%
fma-udef59.7%
Simplified59.7%
Taylor expanded in t around 0 56.8%
sub-neg56.8%
unpow256.8%
mul-1-neg56.8%
remove-double-neg56.8%
unpow256.8%
Simplified56.8%
if 1.89999999999999991e-143 < t Initial program 44.0%
associate-*r/43.9%
fma-neg43.9%
remove-double-neg43.9%
fma-neg43.9%
sub-neg43.9%
metadata-eval43.9%
remove-double-neg43.9%
+-commutative43.9%
fma-def43.9%
Simplified43.9%
Applied egg-rr79.0%
Taylor expanded in t around inf 92.2%
Taylor expanded in x around inf 92.2%
associate--l+92.2%
associate-*r/92.2%
metadata-eval92.2%
unpow292.2%
Simplified92.2%
Final simplification84.7%
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 -4e-311) (- t_1) 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 <= -4e-311) {
tmp = -t_1;
} 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 <= (-4d-311)) then
tmp = -t_1
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 <= -4e-311) {
tmp = -t_1;
} 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 <= -4e-311: tmp = -t_1 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 <= -4e-311) tmp = Float64(-t_1); 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 <= -4e-311) tmp = -t_1; 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, -4e-311], (-t$95$1), t$95$1]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -4 \cdot 10^{-311}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.99999999999979e-311Initial program 36.3%
associate-*r/36.3%
fma-neg36.3%
remove-double-neg36.3%
fma-neg36.3%
sub-neg36.3%
metadata-eval36.3%
remove-double-neg36.3%
+-commutative36.3%
fma-def36.3%
Simplified36.3%
Applied egg-rr67.8%
Taylor expanded in t around -inf 78.3%
mul-1-neg78.3%
sub-neg78.3%
metadata-eval78.3%
Simplified78.3%
if -3.99999999999979e-311 < t Initial program 37.9%
associate-*r/37.9%
fma-neg37.9%
remove-double-neg37.9%
fma-neg37.9%
sub-neg37.9%
metadata-eval37.9%
remove-double-neg37.9%
+-commutative37.9%
fma-def37.9%
Simplified37.9%
Applied egg-rr70.9%
Taylor expanded in t around inf 82.3%
Final simplification80.3%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-311) (+ -1.0 (/ 1.0 x)) (sqrt (/ (+ x -1.0) (+ x 1.0)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-311) {
tmp = -1.0 + (1.0 / 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 <= (-4d-311)) then
tmp = (-1.0d0) + (1.0d0 / 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 <= -4e-311) {
tmp = -1.0 + (1.0 / 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 <= -4e-311: tmp = -1.0 + (1.0 / 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 <= -4e-311) tmp = Float64(-1.0 + Float64(1.0 / 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 <= -4e-311) tmp = -1.0 + (1.0 / 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, -4e-311], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -3.99999999999979e-311Initial program 36.3%
associate-*r/36.3%
fma-neg36.3%
remove-double-neg36.3%
fma-neg36.3%
sub-neg36.3%
metadata-eval36.3%
remove-double-neg36.3%
+-commutative36.3%
fma-def36.3%
Simplified36.3%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt78.1%
Simplified78.1%
if -3.99999999999979e-311 < t Initial program 37.9%
associate-*r/37.9%
fma-neg37.9%
remove-double-neg37.9%
fma-neg37.9%
sub-neg37.9%
metadata-eval37.9%
remove-double-neg37.9%
+-commutative37.9%
fma-def37.9%
Simplified37.9%
Applied egg-rr70.9%
Taylor expanded in t around inf 82.3%
Final simplification80.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-311) (+ -1.0 (/ 1.0 x)) (+ 1.0 (+ (/ 0.5 (* x x)) (/ -1.0 x)))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} 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 <= (-4d-311)) then
tmp = (-1.0d0) + (1.0d0 / x)
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 <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} 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 <= -4e-311: tmp = -1.0 + (1.0 / x) 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 <= -4e-311) tmp = Float64(-1.0 + Float64(1.0 / x)); 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 <= -4e-311) tmp = -1.0 + (1.0 / x); 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, -4e-311], N[(-1.0 + N[(1.0 / x), $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 -4 \cdot 10^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -3.99999999999979e-311Initial program 36.3%
associate-*r/36.3%
fma-neg36.3%
remove-double-neg36.3%
fma-neg36.3%
sub-neg36.3%
metadata-eval36.3%
remove-double-neg36.3%
+-commutative36.3%
fma-def36.3%
Simplified36.3%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt78.1%
Simplified78.1%
if -3.99999999999979e-311 < t Initial program 37.9%
associate-*r/37.9%
fma-neg37.9%
remove-double-neg37.9%
fma-neg37.9%
sub-neg37.9%
metadata-eval37.9%
remove-double-neg37.9%
+-commutative37.9%
fma-def37.9%
Simplified37.9%
Applied egg-rr70.9%
Taylor expanded in t around inf 82.3%
Taylor expanded in x around inf 82.3%
associate--l+82.3%
associate-*r/82.3%
metadata-eval82.3%
unpow282.3%
Simplified82.3%
Final simplification80.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-311) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} 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 <= (-4d-311)) then
tmp = (-1.0d0) + (1.0d0 / x)
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 <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-311: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4e-311) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4e-311) tmp = -1.0 + (1.0 / x); 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, -4e-311], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -3.99999999999979e-311Initial program 36.3%
associate-*r/36.3%
fma-neg36.3%
remove-double-neg36.3%
fma-neg36.3%
sub-neg36.3%
metadata-eval36.3%
remove-double-neg36.3%
+-commutative36.3%
fma-def36.3%
Simplified36.3%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt78.1%
Simplified78.1%
if -3.99999999999979e-311 < t Initial program 37.9%
associate-*r/37.9%
fma-neg37.9%
remove-double-neg37.9%
fma-neg37.9%
sub-neg37.9%
metadata-eval37.9%
remove-double-neg37.9%
+-commutative37.9%
fma-def37.9%
Simplified37.9%
Applied egg-rr70.9%
Taylor expanded in t around inf 82.3%
Taylor expanded in x around inf 81.7%
Final simplification79.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -4e-311) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-4d-311)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -4e-311) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -4e-311: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -4e-311) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -4e-311) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -4e-311], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-311}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -3.99999999999979e-311Initial program 36.3%
associate-*r/36.3%
fma-neg36.3%
remove-double-neg36.3%
fma-neg36.3%
sub-neg36.3%
metadata-eval36.3%
remove-double-neg36.3%
+-commutative36.3%
fma-def36.3%
Simplified36.3%
Applied egg-rr67.8%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt78.1%
Simplified78.1%
if -3.99999999999979e-311 < t Initial program 37.9%
associate-*r/37.9%
fma-neg37.9%
remove-double-neg37.9%
fma-neg37.9%
sub-neg37.9%
metadata-eval37.9%
remove-double-neg37.9%
+-commutative37.9%
fma-def37.9%
Simplified37.9%
Applied egg-rr70.9%
Taylor expanded in t around inf 82.3%
Taylor expanded in x around inf 82.1%
Final simplification80.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1.05e-304) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.05e-304) {
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 <= (-1.05d-304)) 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 <= -1.05e-304) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.05e-304: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.05e-304) 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 <= -1.05e-304) 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, -1.05e-304], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-304}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -1.05000000000000004e-304Initial program 36.6%
associate-*r/36.6%
fma-neg36.6%
remove-double-neg36.6%
fma-neg36.6%
sub-neg36.6%
metadata-eval36.6%
remove-double-neg36.6%
+-commutative36.6%
fma-def36.6%
Simplified36.6%
Applied egg-rr67.5%
Taylor expanded in t around inf 1.7%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt77.3%
Simplified77.3%
if -1.05000000000000004e-304 < t Initial program 37.6%
associate-*r/37.6%
fma-neg37.6%
remove-double-neg37.6%
fma-neg37.6%
sub-neg37.6%
metadata-eval37.6%
remove-double-neg37.6%
+-commutative37.6%
fma-def37.6%
Simplified37.6%
Applied egg-rr71.1%
Taylor expanded in t around inf 81.7%
Taylor expanded in x around inf 81.1%
Final simplification79.2%
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 37.1%
associate-*r/37.1%
fma-neg37.1%
remove-double-neg37.1%
fma-neg37.1%
sub-neg37.1%
metadata-eval37.1%
remove-double-neg37.1%
+-commutative37.1%
fma-def37.1%
Simplified37.1%
Applied egg-rr69.3%
Taylor expanded in t around inf 42.0%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt39.2%
Simplified39.2%
Final simplification39.2%
herbie shell --seed 2023200
(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)))))