
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\end{array}
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (fma l l (* 2.0 (* t t))))
(t_2 (/ t_1 x))
(t_3 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_4 (/ (* l l) x))
(t_5 (* 2.0 (+ (* t t) (/ (* t t) x)))))
(if (<= t -5e+18)
(- t_3)
(if (<= t -5.8e-161)
(* t (/ (sqrt 2.0) (sqrt (+ (+ t_4 t_5) t_2))))
(if (<= t 2.4e-181)
(*
(sqrt 2.0)
(* t (* (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x)))) (/ 1.0 l))))
(if (<= t 6000000.0)
(*
t
(/
(sqrt 2.0)
(sqrt (+ (+ t_5 (+ t_4 (/ (+ t_1 t_1) (* x x)))) t_2))))
t_3))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = fma(l, l, (2.0 * (t * t)));
double t_2 = t_1 / x;
double t_3 = sqrt(((x + -1.0) / (x + 1.0)));
double t_4 = (l * l) / x;
double t_5 = 2.0 * ((t * t) + ((t * t) / x));
double tmp;
if (t <= -5e+18) {
tmp = -t_3;
} else if (t <= -5.8e-161) {
tmp = t * (sqrt(2.0) / sqrt(((t_4 + t_5) + t_2)));
} else if (t <= 2.4e-181) {
tmp = sqrt(2.0) * (t * (sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) * (1.0 / l)));
} else if (t <= 6000000.0) {
tmp = t * (sqrt(2.0) / sqrt(((t_5 + (t_4 + ((t_1 + t_1) / (x * x)))) + t_2)));
} else {
tmp = t_3;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = fma(l, l, Float64(2.0 * Float64(t * t))) t_2 = Float64(t_1 / x) t_3 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_4 = Float64(Float64(l * l) / x) t_5 = Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) tmp = 0.0 if (t <= -5e+18) tmp = Float64(-t_3); elseif (t <= -5.8e-161) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(t_4 + t_5) + t_2)))); elseif (t <= 2.4e-181) tmp = Float64(sqrt(2.0) * Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))) * Float64(1.0 / l)))); elseif (t <= 6000000.0) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(t_5 + Float64(t_4 + Float64(Float64(t_1 + t_1) / Float64(x * x)))) + t_2)))); else tmp = t_3; end return tmp end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[(l * l + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / x), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$5 = N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5e+18], (-t$95$3), If[LessEqual[t, -5.8e-161], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(t$95$4 + t$95$5), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-181], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6000000.0], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(t$95$5 + N[(t$95$4 + N[(N[(t$95$1 + t$95$1), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)\\
t_2 := \frac{t_1}{x}\\
t_3 := \sqrt{\frac{x + -1}{x + 1}}\\
t_4 := \frac{\ell \cdot \ell}{x}\\
t_5 := 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\\
\mathbf{if}\;t \leq -5 \cdot 10^{+18}:\\
\;\;\;\;-t_3\\
\mathbf{elif}\;t \leq -5.8 \cdot 10^{-161}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\left(t_4 + t_5\right) + t_2}}\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-181}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \left(\sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}} \cdot \frac{1}{\ell}\right)\right)\\
\mathbf{elif}\;t \leq 6000000:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\left(t_5 + \left(t_4 + \frac{t_1 + t_1}{x \cdot x}\right)\right) + t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -5e18Initial program 35.8%
associate-*l/35.9%
*-commutative35.9%
fma-neg35.9%
sqr-neg35.9%
fma-neg35.9%
Simplified35.9%
Applied egg-rr81.9%
Taylor expanded in t around -inf 95.7%
mul-1-neg95.7%
sub-neg95.7%
metadata-eval95.7%
Simplified95.7%
if -5e18 < t < -5.8e-161Initial program 54.1%
associate-*l/54.2%
Simplified54.2%
Taylor expanded in x around inf 82.7%
unpow282.7%
distribute-lft-out82.7%
unpow282.7%
unpow282.7%
associate-*r/82.7%
mul-1-neg82.7%
unpow282.7%
fma-udef82.7%
unpow282.7%
Simplified82.7%
if -5.8e-161 < t < 2.4000000000000001e-181Initial program 4.3%
associate-*l/4.3%
*-commutative4.3%
fma-neg4.3%
sqr-neg4.3%
fma-neg4.3%
Simplified4.3%
Taylor expanded in t around 0 5.7%
associate-*l*5.7%
metadata-eval5.7%
unpow25.7%
cancel-sign-sub-inv5.7%
Simplified5.6%
Taylor expanded in x around -inf 50.2%
associate--l+50.2%
unpow250.2%
sub-neg50.2%
mul-1-neg50.2%
remove-double-neg50.2%
+-commutative50.2%
mul-1-neg50.2%
unsub-neg50.2%
unpow250.2%
mul-1-neg50.2%
unpow250.2%
distribute-rgt-neg-out50.2%
unpow250.2%
unpow250.2%
Simplified50.2%
Taylor expanded in l around 0 42.3%
associate-*r/42.3%
metadata-eval42.3%
unpow242.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
if 2.4000000000000001e-181 < t < 6e6Initial program 35.1%
associate-*l/35.3%
Simplified35.3%
Taylor expanded in x around -inf 83.3%
sub-neg83.3%
Simplified83.3%
if 6e6 < t Initial program 31.1%
associate-*l/31.2%
*-commutative31.2%
fma-neg31.2%
sqr-neg31.2%
fma-neg31.2%
Simplified31.2%
Applied egg-rr85.2%
Taylor expanded in t around inf 94.8%
Final simplification82.6%
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 l l (* 2.0 (* t t))) x))))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -9.6e+14)
(- t_2)
(if (<= t -4e-161)
t_1
(if (<= t 2.05e-181)
(*
(sqrt 2.0)
(* t (* (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x)))) (/ 1.0 l))))
(if (<= t 5500000.0) t_1 t_2))))))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(l, l, (2.0 * (t * t))) / x))));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -9.6e+14) {
tmp = -t_2;
} else if (t <= -4e-161) {
tmp = t_1;
} else if (t <= 2.05e-181) {
tmp = sqrt(2.0) * (t * (sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) * (1.0 / l)));
} else if (t <= 5500000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(Float64(l * l) / x) + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))) + Float64(fma(l, l, Float64(2.0 * Float64(t * t))) / x))))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -9.6e+14) tmp = Float64(-t_2); elseif (t <= -4e-161) tmp = t_1; elseif (t <= 2.05e-181) tmp = Float64(sqrt(2.0) * Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))) * Float64(1.0 / l)))); elseif (t <= 5500000.0) tmp = 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[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(l * l + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -9.6e+14], (-t$95$2), If[LessEqual[t, -4e-161], t$95$1, If[LessEqual[t, 2.05e-181], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5500000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := t \cdot \frac{\sqrt{2}}{\sqrt{\left(\frac{\ell \cdot \ell}{x} + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right) + \frac{\mathsf{fma}\left(\ell, \ell, 2 \cdot \left(t \cdot t\right)\right)}{x}}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -9.6 \cdot 10^{+14}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -4 \cdot 10^{-161}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-181}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \left(\sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}} \cdot \frac{1}{\ell}\right)\right)\\
\mathbf{elif}\;t \leq 5500000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -9.6e14Initial program 35.8%
associate-*l/35.9%
*-commutative35.9%
fma-neg35.9%
sqr-neg35.9%
fma-neg35.9%
Simplified35.9%
Applied egg-rr81.9%
Taylor expanded in t around -inf 95.7%
mul-1-neg95.7%
sub-neg95.7%
metadata-eval95.7%
Simplified95.7%
if -9.6e14 < t < -4.00000000000000011e-161 or 2.0500000000000001e-181 < t < 5.5e6Initial program 45.0%
associate-*l/45.1%
Simplified45.1%
Taylor expanded in x around inf 83.0%
unpow283.0%
distribute-lft-out83.0%
unpow283.0%
unpow283.0%
associate-*r/83.0%
mul-1-neg83.0%
unpow283.0%
fma-udef83.0%
unpow283.0%
Simplified83.0%
if -4.00000000000000011e-161 < t < 2.0500000000000001e-181Initial program 4.3%
associate-*l/4.3%
*-commutative4.3%
fma-neg4.3%
sqr-neg4.3%
fma-neg4.3%
Simplified4.3%
Taylor expanded in t around 0 5.7%
associate-*l*5.7%
metadata-eval5.7%
unpow25.7%
cancel-sign-sub-inv5.7%
Simplified5.6%
Taylor expanded in x around -inf 50.2%
associate--l+50.2%
unpow250.2%
sub-neg50.2%
mul-1-neg50.2%
remove-double-neg50.2%
+-commutative50.2%
mul-1-neg50.2%
unsub-neg50.2%
unpow250.2%
mul-1-neg50.2%
unpow250.2%
distribute-rgt-neg-out50.2%
unpow250.2%
unpow250.2%
Simplified50.2%
Taylor expanded in l around 0 42.3%
associate-*r/42.3%
metadata-eval42.3%
unpow242.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
if 5.5e6 < t Initial program 31.1%
associate-*l/31.2%
*-commutative31.2%
fma-neg31.2%
sqr-neg31.2%
fma-neg31.2%
Simplified31.2%
Applied egg-rr85.2%
Taylor expanded in t around inf 94.8%
Final simplification82.5%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0))))
(t_2 (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x)))))
(t_3 (/ (+ x 1.0) (+ x -1.0))))
(if (<= t -5.8e-63)
(- t_1)
(if (<= t -1.8e-114)
(* (sqrt 2.0) (* t (/ t_2 l)))
(if (<= t -1e-155)
(*
t
(/
(sqrt 2.0)
(sqrt (+ (* (* l l) t_3) (+ (* l l) (* t_3 (* t (* t 2.0))))))))
(if (<= t 1.65e-56) (* (sqrt 2.0) (* t (* t_2 (/ 1.0 l)))) t_1))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))));
double t_3 = (x + 1.0) / (x + -1.0);
double tmp;
if (t <= -5.8e-63) {
tmp = -t_1;
} else if (t <= -1.8e-114) {
tmp = sqrt(2.0) * (t * (t_2 / l));
} else if (t <= -1e-155) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) * t_3) + ((l * l) + (t_3 * (t * (t * 2.0)))))));
} else if (t <= 1.65e-56) {
tmp = sqrt(2.0) * (t * (t_2 * (1.0 / l)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = sqrt((1.0d0 / ((2.0d0 / (x * x)) + (2.0d0 / x))))
t_3 = (x + 1.0d0) / (x + (-1.0d0))
if (t <= (-5.8d-63)) then
tmp = -t_1
else if (t <= (-1.8d-114)) then
tmp = sqrt(2.0d0) * (t * (t_2 / l))
else if (t <= (-1d-155)) then
tmp = t * (sqrt(2.0d0) / sqrt((((l * l) * t_3) + ((l * l) + (t_3 * (t * (t * 2.0d0)))))))
else if (t <= 1.65d-56) then
tmp = sqrt(2.0d0) * (t * (t_2 * (1.0d0 / l)))
else
tmp = t_1
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = Math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))));
double t_3 = (x + 1.0) / (x + -1.0);
double tmp;
if (t <= -5.8e-63) {
tmp = -t_1;
} else if (t <= -1.8e-114) {
tmp = Math.sqrt(2.0) * (t * (t_2 / l));
} else if (t <= -1e-155) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((((l * l) * t_3) + ((l * l) + (t_3 * (t * (t * 2.0)))))));
} else if (t <= 1.65e-56) {
tmp = Math.sqrt(2.0) * (t * (t_2 * (1.0 / l)));
} else {
tmp = t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) t_3 = (x + 1.0) / (x + -1.0) tmp = 0 if t <= -5.8e-63: tmp = -t_1 elif t <= -1.8e-114: tmp = math.sqrt(2.0) * (t * (t_2 / l)) elif t <= -1e-155: tmp = t * (math.sqrt(2.0) / math.sqrt((((l * l) * t_3) + ((l * l) + (t_3 * (t * (t * 2.0))))))) elif t <= 1.65e-56: tmp = math.sqrt(2.0) * (t * (t_2 * (1.0 / l))) else: tmp = t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) tmp = 0.0 if (t <= -5.8e-63) tmp = Float64(-t_1); elseif (t <= -1.8e-114) tmp = Float64(sqrt(2.0) * Float64(t * Float64(t_2 / l))); elseif (t <= -1e-155) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) * t_3) + Float64(Float64(l * l) + Float64(t_3 * Float64(t * Float64(t * 2.0)))))))); elseif (t <= 1.65e-56) tmp = Float64(sqrt(2.0) * Float64(t * Float64(t_2 * Float64(1.0 / l)))); else tmp = t_1; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))); t_3 = (x + 1.0) / (x + -1.0); tmp = 0.0; if (t <= -5.8e-63) tmp = -t_1; elseif (t <= -1.8e-114) tmp = sqrt(2.0) * (t * (t_2 / l)); elseif (t <= -1e-155) tmp = t * (sqrt(2.0) / sqrt((((l * l) * t_3) + ((l * l) + (t_3 * (t * (t * 2.0))))))); elseif (t <= 1.65e-56) tmp = sqrt(2.0) * (t * (t_2 * (1.0 / l))); else tmp = t_1; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e-63], (-t$95$1), If[LessEqual[t, -1.8e-114], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(t$95$2 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1e-155], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(N[(l * l), $MachinePrecision] + N[(t$95$3 * N[(t * N[(t * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-56], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(t$95$2 * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\\
t_3 := \frac{x + 1}{x + -1}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-114}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{t_2}{\ell}\right)\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-155}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\left(\ell \cdot \ell\right) \cdot t_3 + \left(\ell \cdot \ell + t_3 \cdot \left(t \cdot \left(t \cdot 2\right)\right)\right)}}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-56}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \left(t_2 \cdot \frac{1}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.7999999999999995e-63Initial program 41.6%
associate-*l/41.7%
*-commutative41.7%
fma-neg41.7%
sqr-neg41.7%
fma-neg41.7%
Simplified41.7%
Applied egg-rr79.0%
Taylor expanded in t around -inf 94.2%
mul-1-neg94.2%
sub-neg94.2%
metadata-eval94.2%
Simplified94.2%
if -5.7999999999999995e-63 < t < -1.80000000000000009e-114Initial program 18.7%
associate-*l/18.7%
*-commutative18.7%
fma-neg18.7%
sqr-neg18.7%
fma-neg18.7%
Simplified18.7%
Taylor expanded in t around 0 1.4%
associate-*l*1.4%
metadata-eval1.4%
unpow21.4%
cancel-sign-sub-inv1.4%
Simplified1.4%
Taylor expanded in x around -inf 21.1%
associate--l+21.1%
unpow221.1%
sub-neg21.1%
mul-1-neg21.1%
remove-double-neg21.1%
+-commutative21.1%
mul-1-neg21.1%
unsub-neg21.1%
unpow221.1%
mul-1-neg21.1%
unpow221.1%
distribute-rgt-neg-out21.1%
unpow221.1%
unpow221.1%
Simplified21.1%
Taylor expanded in l around 0 38.0%
associate-*r/38.2%
*-rgt-identity38.2%
associate-*r/38.2%
metadata-eval38.2%
unpow238.2%
associate-*r/38.2%
metadata-eval38.2%
Simplified38.2%
if -1.80000000000000009e-114 < t < -1.00000000000000001e-155Initial program 69.2%
associate-*l/69.4%
*-commutative69.4%
fma-neg69.4%
sqr-neg69.4%
fma-neg69.4%
Simplified69.4%
metadata-eval69.4%
sub-neg69.4%
fma-def69.4%
fma-udef69.4%
+-commutative69.4%
distribute-lft-in69.4%
associate-+l+69.4%
sub-neg69.4%
metadata-eval69.4%
Applied egg-rr90.4%
if -1.00000000000000001e-155 < t < 1.64999999999999992e-56Initial program 10.8%
associate-*l/10.8%
*-commutative10.8%
fma-neg10.8%
sqr-neg10.8%
fma-neg10.8%
Simplified10.8%
Taylor expanded in t around 0 5.1%
associate-*l*5.1%
metadata-eval5.1%
unpow25.1%
cancel-sign-sub-inv5.1%
Simplified4.9%
Taylor expanded in x around -inf 50.5%
associate--l+50.5%
unpow250.5%
sub-neg50.5%
mul-1-neg50.5%
remove-double-neg50.5%
+-commutative50.5%
mul-1-neg50.5%
unsub-neg50.5%
unpow250.5%
mul-1-neg50.5%
unpow250.5%
distribute-rgt-neg-out50.5%
unpow250.5%
unpow250.5%
Simplified50.5%
Taylor expanded in l around 0 42.5%
associate-*r/42.5%
metadata-eval42.5%
unpow242.5%
associate-*r/42.5%
metadata-eval42.5%
Simplified42.5%
if 1.64999999999999992e-56 < t Initial program 35.9%
associate-*l/36.0%
*-commutative36.0%
fma-neg36.0%
sqr-neg36.0%
fma-neg36.0%
Simplified36.0%
Applied egg-rr83.5%
Taylor expanded in t around inf 93.8%
Final simplification77.3%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x)))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -5.8e-63)
(- t_2)
(if (<= t -2.7e-114)
(* (sqrt 2.0) (* t (/ t_1 l)))
(if (<= t -3.3e-163)
-1.0
(if (<= t 1.65e-56) (* (sqrt 2.0) (* t (* t_1 (/ 1.0 l)))) t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -5.8e-63) {
tmp = -t_2;
} else if (t <= -2.7e-114) {
tmp = sqrt(2.0) * (t * (t_1 / l));
} else if (t <= -3.3e-163) {
tmp = -1.0;
} else if (t <= 1.65e-56) {
tmp = sqrt(2.0) * (t * (t_1 * (1.0 / l)));
} 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 = sqrt((1.0d0 / ((2.0d0 / (x * x)) + (2.0d0 / x))))
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-5.8d-63)) then
tmp = -t_2
else if (t <= (-2.7d-114)) then
tmp = sqrt(2.0d0) * (t * (t_1 / l))
else if (t <= (-3.3d-163)) then
tmp = -1.0d0
else if (t <= 1.65d-56) then
tmp = sqrt(2.0d0) * (t * (t_1 * (1.0d0 / l)))
else
tmp = t_2
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x))));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -5.8e-63) {
tmp = -t_2;
} else if (t <= -2.7e-114) {
tmp = Math.sqrt(2.0) * (t * (t_1 / l));
} else if (t <= -3.3e-163) {
tmp = -1.0;
} else if (t <= 1.65e-56) {
tmp = Math.sqrt(2.0) * (t * (t_1 * (1.0 / l)));
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -5.8e-63: tmp = -t_2 elif t <= -2.7e-114: tmp = math.sqrt(2.0) * (t * (t_1 / l)) elif t <= -3.3e-163: tmp = -1.0 elif t <= 1.65e-56: tmp = math.sqrt(2.0) * (t * (t_1 * (1.0 / l))) else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -5.8e-63) tmp = Float64(-t_2); elseif (t <= -2.7e-114) tmp = Float64(sqrt(2.0) * Float64(t * Float64(t_1 / l))); elseif (t <= -3.3e-163) tmp = -1.0; elseif (t <= 1.65e-56) tmp = Float64(sqrt(2.0) * Float64(t * Float64(t_1 * Float64(1.0 / l)))); else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -5.8e-63) tmp = -t_2; elseif (t <= -2.7e-114) tmp = sqrt(2.0) * (t * (t_1 / l)); elseif (t <= -3.3e-163) tmp = -1.0; elseif (t <= 1.65e-56) tmp = sqrt(2.0) * (t * (t_1 * (1.0 / l))); else tmp = t_2; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $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, -5.8e-63], (-t$95$2), If[LessEqual[t, -2.7e-114], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(t$95$1 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.3e-163], -1.0, If[LessEqual[t, 1.65e-56], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(t$95$1 * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{-114}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \frac{t_1}{\ell}\right)\\
\mathbf{elif}\;t \leq -3.3 \cdot 10^{-163}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-56}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \left(t_1 \cdot \frac{1}{\ell}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -5.7999999999999995e-63Initial program 41.6%
associate-*l/41.7%
*-commutative41.7%
fma-neg41.7%
sqr-neg41.7%
fma-neg41.7%
Simplified41.7%
Applied egg-rr79.0%
Taylor expanded in t around -inf 94.2%
mul-1-neg94.2%
sub-neg94.2%
metadata-eval94.2%
Simplified94.2%
if -5.7999999999999995e-63 < t < -2.7e-114Initial program 18.7%
associate-*l/18.7%
*-commutative18.7%
fma-neg18.7%
sqr-neg18.7%
fma-neg18.7%
Simplified18.7%
Taylor expanded in t around 0 1.4%
associate-*l*1.4%
metadata-eval1.4%
unpow21.4%
cancel-sign-sub-inv1.4%
Simplified1.4%
Taylor expanded in x around -inf 21.1%
associate--l+21.1%
unpow221.1%
sub-neg21.1%
mul-1-neg21.1%
remove-double-neg21.1%
+-commutative21.1%
mul-1-neg21.1%
unsub-neg21.1%
unpow221.1%
mul-1-neg21.1%
unpow221.1%
distribute-rgt-neg-out21.1%
unpow221.1%
unpow221.1%
Simplified21.1%
Taylor expanded in l around 0 38.0%
associate-*r/38.2%
*-rgt-identity38.2%
associate-*r/38.2%
metadata-eval38.2%
unpow238.2%
associate-*r/38.2%
metadata-eval38.2%
Simplified38.2%
if -2.7e-114 < t < -3.30000000000000001e-163Initial program 64.5%
associate-*l/64.6%
*-commutative64.6%
fma-neg64.6%
sqr-neg64.6%
fma-neg64.6%
Simplified64.6%
Applied egg-rr91.2%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
sub-neg79.2%
metadata-eval79.2%
Simplified79.2%
Taylor expanded in x around inf 79.2%
if -3.30000000000000001e-163 < t < 1.64999999999999992e-56Initial program 10.9%
associate-*l/10.9%
*-commutative10.9%
fma-neg10.9%
sqr-neg10.9%
fma-neg10.9%
Simplified10.9%
Taylor expanded in t around 0 5.1%
associate-*l*5.1%
metadata-eval5.1%
unpow25.1%
cancel-sign-sub-inv5.1%
Simplified5.0%
Taylor expanded in x around -inf 51.2%
associate--l+51.2%
unpow251.2%
sub-neg51.2%
mul-1-neg51.2%
remove-double-neg51.2%
+-commutative51.2%
mul-1-neg51.2%
unsub-neg51.2%
unpow251.2%
mul-1-neg51.2%
unpow251.2%
distribute-rgt-neg-out51.2%
unpow251.2%
unpow251.2%
Simplified51.2%
Taylor expanded in l around 0 43.0%
associate-*r/43.0%
metadata-eval43.0%
unpow243.0%
associate-*r/43.0%
metadata-eval43.0%
Simplified43.0%
if 1.64999999999999992e-56 < t Initial program 35.9%
associate-*l/36.0%
*-commutative36.0%
fma-neg36.0%
sqr-neg36.0%
fma-neg36.0%
Simplified36.0%
Applied egg-rr83.5%
Taylor expanded in t around inf 93.8%
Final simplification77.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1
(*
(sqrt 2.0)
(* t (/ (sqrt (/ 1.0 (+ (/ 2.0 (* x x)) (/ 2.0 x)))) l))))
(t_2 (sqrt (/ (+ x -1.0) (+ x 1.0)))))
(if (<= t -3.9e-62)
(- t_2)
(if (<= t -2.05e-113)
t_1
(if (<= t -4.6e-163) -1.0 (if (<= t 3.1e-56) t_1 t_2))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) * (t * (sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) / l));
double t_2 = sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.9e-62) {
tmp = -t_2;
} else if (t <= -2.05e-113) {
tmp = t_1;
} else if (t <= -4.6e-163) {
tmp = -1.0;
} else if (t <= 3.1e-56) {
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 = sqrt(2.0d0) * (t * (sqrt((1.0d0 / ((2.0d0 / (x * x)) + (2.0d0 / x)))) / l))
t_2 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
if (t <= (-3.9d-62)) then
tmp = -t_2
else if (t <= (-2.05d-113)) then
tmp = t_1
else if (t <= (-4.6d-163)) then
tmp = -1.0d0
else if (t <= 3.1d-56) 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 = Math.sqrt(2.0) * (t * (Math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) / l));
double t_2 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double tmp;
if (t <= -3.9e-62) {
tmp = -t_2;
} else if (t <= -2.05e-113) {
tmp = t_1;
} else if (t <= -4.6e-163) {
tmp = -1.0;
} else if (t <= 3.1e-56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) * (t * (math.sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) / l)) t_2 = math.sqrt(((x + -1.0) / (x + 1.0))) tmp = 0 if t <= -3.9e-62: tmp = -t_2 elif t <= -2.05e-113: tmp = t_1 elif t <= -4.6e-163: tmp = -1.0 elif t <= 3.1e-56: tmp = t_1 else: tmp = t_2 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(sqrt(2.0) * Float64(t * Float64(sqrt(Float64(1.0 / Float64(Float64(2.0 / Float64(x * x)) + Float64(2.0 / x)))) / l))) t_2 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) tmp = 0.0 if (t <= -3.9e-62) tmp = Float64(-t_2); elseif (t <= -2.05e-113) tmp = t_1; elseif (t <= -4.6e-163) tmp = -1.0; elseif (t <= 3.1e-56) tmp = t_1; else tmp = t_2; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = sqrt(2.0) * (t * (sqrt((1.0 / ((2.0 / (x * x)) + (2.0 / x)))) / l)); t_2 = sqrt(((x + -1.0) / (x + 1.0))); tmp = 0.0; if (t <= -3.9e-62) tmp = -t_2; elseif (t <= -2.05e-113) tmp = t_1; elseif (t <= -4.6e-163) tmp = -1.0; elseif (t <= 3.1e-56) 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[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[(N[Sqrt[N[(1.0 / N[(N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $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, -3.9e-62], (-t$95$2), If[LessEqual[t, -2.05e-113], t$95$1, If[LessEqual[t, -4.6e-163], -1.0, If[LessEqual[t, 3.1e-56], t$95$1, t$95$2]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \sqrt{2} \cdot \left(t \cdot \frac{\sqrt{\frac{1}{\frac{2}{x \cdot x} + \frac{2}{x}}}}{\ell}\right)\\
t_2 := \sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{-62}:\\
\;\;\;\;-t_2\\
\mathbf{elif}\;t \leq -2.05 \cdot 10^{-113}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.6 \cdot 10^{-163}:\\
\;\;\;\;-1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-56}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -3.9000000000000003e-62Initial program 41.6%
associate-*l/41.7%
*-commutative41.7%
fma-neg41.7%
sqr-neg41.7%
fma-neg41.7%
Simplified41.7%
Applied egg-rr79.0%
Taylor expanded in t around -inf 94.2%
mul-1-neg94.2%
sub-neg94.2%
metadata-eval94.2%
Simplified94.2%
if -3.9000000000000003e-62 < t < -2.05e-113 or -4.5999999999999999e-163 < t < 3.09999999999999987e-56Initial program 11.9%
associate-*l/12.0%
*-commutative12.0%
fma-neg12.0%
sqr-neg12.0%
fma-neg12.0%
Simplified12.0%
Taylor expanded in t around 0 4.6%
associate-*l*4.6%
metadata-eval4.6%
unpow24.6%
cancel-sign-sub-inv4.6%
Simplified4.5%
Taylor expanded in x around -inf 47.0%
associate--l+47.0%
unpow247.0%
sub-neg47.0%
mul-1-neg47.0%
remove-double-neg47.0%
+-commutative47.0%
mul-1-neg47.0%
unsub-neg47.0%
unpow247.0%
mul-1-neg47.0%
unpow247.0%
distribute-rgt-neg-out47.0%
unpow247.0%
unpow247.0%
Simplified47.0%
Taylor expanded in l around 0 42.3%
associate-*r/42.3%
*-rgt-identity42.3%
associate-*r/42.3%
metadata-eval42.3%
unpow242.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
if -2.05e-113 < t < -4.5999999999999999e-163Initial program 64.5%
associate-*l/64.6%
*-commutative64.6%
fma-neg64.6%
sqr-neg64.6%
fma-neg64.6%
Simplified64.6%
Applied egg-rr91.2%
Taylor expanded in t around -inf 79.2%
mul-1-neg79.2%
sub-neg79.2%
metadata-eval79.2%
Simplified79.2%
Taylor expanded in x around inf 79.2%
if 3.09999999999999987e-56 < t Initial program 35.9%
associate-*l/36.0%
*-commutative36.0%
fma-neg36.0%
sqr-neg36.0%
fma-neg36.0%
Simplified36.0%
Applied egg-rr83.5%
Taylor expanded in t around inf 93.8%
Final simplification77.0%
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 -4.5e-207)
(- t_1)
(if (<= t 5.4e-87)
(* (sqrt 2.0) (* t (sqrt (/ 1.0 (/ (+ (* l l) (* 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 <= -4.5e-207) {
tmp = -t_1;
} else if (t <= 5.4e-87) {
tmp = sqrt(2.0) * (t * sqrt((1.0 / (((l * l) + (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 <= (-4.5d-207)) then
tmp = -t_1
else if (t <= 5.4d-87) then
tmp = sqrt(2.0d0) * (t * sqrt((1.0d0 / (((l * l) + (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 <= -4.5e-207) {
tmp = -t_1;
} else if (t <= 5.4e-87) {
tmp = Math.sqrt(2.0) * (t * Math.sqrt((1.0 / (((l * l) + (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 <= -4.5e-207: tmp = -t_1 elif t <= 5.4e-87: tmp = math.sqrt(2.0) * (t * math.sqrt((1.0 / (((l * l) + (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 <= -4.5e-207) tmp = Float64(-t_1); elseif (t <= 5.4e-87) tmp = Float64(sqrt(2.0) * Float64(t * sqrt(Float64(1.0 / Float64(Float64(Float64(l * l) + Float64(l * 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 <= -4.5e-207) tmp = -t_1; elseif (t <= 5.4e-87) tmp = sqrt(2.0) * (t * sqrt((1.0 / (((l * l) + (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, -4.5e-207], (-t$95$1), If[LessEqual[t, 5.4e-87], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t * N[Sqrt[N[(1.0 / N[(N[(N[(l * l), $MachinePrecision] + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $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 -4.5 \cdot 10^{-207}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-87}:\\
\;\;\;\;\sqrt{2} \cdot \left(t \cdot \sqrt{\frac{1}{\frac{\ell \cdot \ell + \ell \cdot \ell}{x}}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.49999999999999992e-207Initial program 38.5%
associate-*l/38.5%
*-commutative38.5%
fma-neg38.6%
sqr-neg38.6%
fma-neg38.5%
Simplified38.6%
Applied egg-rr71.8%
Taylor expanded in t around -inf 82.0%
mul-1-neg82.0%
sub-neg82.0%
metadata-eval82.0%
Simplified82.0%
if -4.49999999999999992e-207 < t < 5.39999999999999967e-87Initial program 10.2%
associate-*l/10.2%
*-commutative10.2%
fma-neg10.2%
sqr-neg10.2%
fma-neg10.2%
Simplified10.2%
Taylor expanded in t around 0 6.0%
associate-*l*6.0%
metadata-eval6.0%
unpow26.0%
cancel-sign-sub-inv6.0%
Simplified6.0%
Taylor expanded in x around inf 58.3%
sub-neg58.3%
unpow258.3%
mul-1-neg58.3%
remove-double-neg58.3%
unpow258.3%
Simplified58.3%
if 5.39999999999999967e-87 < t Initial program 35.4%
associate-*l/35.5%
*-commutative35.5%
fma-neg35.5%
sqr-neg35.5%
fma-neg35.5%
Simplified35.5%
Applied egg-rr79.5%
Taylor expanded in t around inf 89.8%
Final simplification80.0%
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 -1e-310) (- 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 <= -1e-310) {
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 <= (-1d-310)) 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 <= -1e-310) {
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 <= -1e-310: 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 <= -1e-310) 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 <= -1e-310) 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, -1e-310], (-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 -1 \cdot 10^{-310}:\\
\;\;\;\;-t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
*-commutative28.4%
fma-neg28.4%
sqr-neg28.4%
fma-neg28.4%
Simplified28.4%
Applied egg-rr66.1%
Taylor expanded in t around inf 72.8%
Final simplification74.1%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (- -1.0 (+ (/ 0.5 (* x x)) (/ -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 <= -1e-310) {
tmp = -1.0 - ((0.5 / (x * x)) + (-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 <= (-1d-310)) then
tmp = (-1.0d0) - ((0.5d0 / (x * x)) + ((-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 <= -1e-310) {
tmp = -1.0 - ((0.5 / (x * x)) + (-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 <= -1e-310: tmp = -1.0 - ((0.5 / (x * x)) + (-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 <= -1e-310) tmp = Float64(-1.0 - Float64(Float64(0.5 / Float64(x * x)) + 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 <= -1e-310) tmp = -1.0 - ((0.5 / (x * x)) + (-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, -1e-310], N[(-1.0 - N[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / 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 -1 \cdot 10^{-310}:\\
\;\;\;\;-1 - \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{x + 1}}\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 74.6%
associate--l+74.6%
associate-*r/74.6%
metadata-eval74.6%
unpow274.6%
Simplified74.6%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
*-commutative28.4%
fma-neg28.4%
sqr-neg28.4%
fma-neg28.4%
Simplified28.4%
Applied egg-rr66.1%
Taylor expanded in t around inf 72.8%
Final simplification73.7%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (+ -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 <= -1e-310) {
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 <= (-1d-310)) 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 <= -1e-310) {
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 <= -1e-310: 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 <= -1e-310) 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 <= -1e-310) 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, -1e-310], 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 -1 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\frac{0.5}{x \cdot x} + \frac{-1}{x}\right)\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt74.3%
Simplified74.3%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
*-commutative28.4%
fma-neg28.4%
sqr-neg28.4%
fma-neg28.4%
Simplified28.4%
Applied egg-rr66.1%
Taylor expanded in t around inf 72.8%
Taylor expanded in x around inf 71.6%
associate--l+71.6%
associate-*r/71.6%
metadata-eval71.6%
unpow271.6%
Simplified71.6%
Final simplification73.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (let* ((t_1 (+ (/ 0.5 (* x x)) (/ -1.0 x)))) (if (<= t -1e-310) (- -1.0 t_1) (+ 1.0 t_1))))
l = abs(l);
double code(double x, double l, double t) {
double t_1 = (0.5 / (x * x)) + (-1.0 / x);
double tmp;
if (t <= -1e-310) {
tmp = -1.0 - t_1;
} else {
tmp = 1.0 + 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 = (0.5d0 / (x * x)) + ((-1.0d0) / x)
if (t <= (-1d-310)) then
tmp = (-1.0d0) - t_1
else
tmp = 1.0d0 + 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 = (0.5 / (x * x)) + (-1.0 / x);
double tmp;
if (t <= -1e-310) {
tmp = -1.0 - t_1;
} else {
tmp = 1.0 + t_1;
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = (0.5 / (x * x)) + (-1.0 / x) tmp = 0 if t <= -1e-310: tmp = -1.0 - t_1 else: tmp = 1.0 + t_1 return tmp
l = abs(l) function code(x, l, t) t_1 = Float64(Float64(0.5 / Float64(x * x)) + Float64(-1.0 / x)) tmp = 0.0 if (t <= -1e-310) tmp = Float64(-1.0 - t_1); else tmp = Float64(1.0 + t_1); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) t_1 = (0.5 / (x * x)) + (-1.0 / x); tmp = 0.0; if (t <= -1e-310) tmp = -1.0 - t_1; else tmp = 1.0 + 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[(N[(0.5 / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1e-310], N[(-1.0 - t$95$1), $MachinePrecision], N[(1.0 + t$95$1), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{0.5}{x \cdot x} + \frac{-1}{x}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1 - t_1\\
\mathbf{else}:\\
\;\;\;\;1 + t_1\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 74.6%
associate--l+74.6%
associate-*r/74.6%
metadata-eval74.6%
unpow274.6%
Simplified74.6%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
*-commutative28.4%
fma-neg28.4%
sqr-neg28.4%
fma-neg28.4%
Simplified28.4%
Applied egg-rr66.1%
Taylor expanded in t around inf 72.8%
Taylor expanded in x around inf 71.6%
associate--l+71.6%
associate-*r/71.6%
metadata-eval71.6%
unpow271.6%
Simplified71.6%
Final simplification73.2%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (+ -1.0 (/ 1.0 x)) 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
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 <= (-1d-310)) 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 <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: 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 <= -1e-310) 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 <= -1e-310) 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, -1e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt74.3%
Simplified74.3%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
Simplified28.4%
Taylor expanded in x around inf 69.6%
sqrt-unprod70.7%
metadata-eval70.7%
metadata-eval70.7%
Applied egg-rr70.7%
Final simplification72.5%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) (+ -1.0 (/ 1.0 x)) (+ 1.0 (/ -1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-310)) then
tmp = (-1.0d0) + (1.0d0 / x)
else
tmp = 1.0d0 + ((-1.0d0) / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0 + (1.0 / x);
} else {
tmp = 1.0 + (-1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 + (1.0 / x) else: tmp = 1.0 + (-1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-310) tmp = Float64(-1.0 + Float64(1.0 / x)); else tmp = Float64(1.0 + Float64(-1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0 + (1.0 / x); else tmp = 1.0 + (-1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-310], N[(-1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1 + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around inf 1.8%
Taylor expanded in x around -inf 0.0%
unpow20.0%
rem-square-sqrt74.3%
Simplified74.3%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
*-commutative28.4%
fma-neg28.4%
sqr-neg28.4%
fma-neg28.4%
Simplified28.4%
Applied egg-rr66.1%
Taylor expanded in t around inf 72.8%
Taylor expanded in x around inf 71.3%
Final simplification72.9%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t -1e-310) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1d-310)) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1e-310) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1e-310: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1e-310) tmp = -1.0; else tmp = 1.0; end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1e-310) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1e-310], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -9.999999999999969e-311Initial program 35.1%
associate-*l/35.1%
*-commutative35.1%
fma-neg35.1%
sqr-neg35.1%
fma-neg35.1%
Simplified35.1%
Applied egg-rr68.6%
Taylor expanded in t around -inf 75.4%
mul-1-neg75.4%
sub-neg75.4%
metadata-eval75.4%
Simplified75.4%
Taylor expanded in x around inf 73.3%
if -9.999999999999969e-311 < t Initial program 28.3%
associate-*l/28.4%
Simplified28.4%
Taylor expanded in x around inf 69.6%
sqrt-unprod70.7%
metadata-eval70.7%
metadata-eval70.7%
Applied egg-rr70.7%
Final simplification72.0%
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 31.8%
associate-*l/31.9%
Simplified31.9%
Taylor expanded in x around inf 34.7%
sqrt-unprod35.2%
metadata-eval35.2%
metadata-eval35.2%
Applied egg-rr35.2%
Final simplification35.2%
herbie shell --seed 2023264
(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)))))