
(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 11 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 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x))))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ (+ x 1.0) (+ x -1.0)))
(t_4 (/ t_2 (sqrt (- (* t_3 (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(t_5 (fma (* 2.0 t) t (* l l))))
(if (<= t_4 -1.000000000000001)
(*
t
(/
(sqrt 2.0)
(-
(* (/ (* 2.0 (* l (/ l x))) t) (* (sqrt (/ 1.0 t_1)) -0.5))
(* t (sqrt t_1)))))
(if (<= t_4 0.0)
(cbrt
(pow (/ t (/ (hypot (* (hypot l t_2) (sqrt t_3)) l) (sqrt 2.0))) 3.0))
(if (<= t_4 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(+ (* 2.0 (+ (* t t) (/ (* t t) x))) (/ (+ t_5 t_5) (* x x)))
(/ t_5 x))))))
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_2 = sqrt(2.0) * t;
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_2 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double t_5 = fma((2.0 * t), t, (l * l));
double tmp;
if (t_4 <= -1.000000000000001) {
tmp = t * (sqrt(2.0) / ((((2.0 * (l * (l / x))) / t) * (sqrt((1.0 / t_1)) * -0.5)) - (t * sqrt(t_1))));
} else if (t_4 <= 0.0) {
tmp = cbrt(pow((t / (hypot((hypot(l, t_2) * sqrt(t_3)), l) / sqrt(2.0))), 3.0));
} else if (t_4 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + (((2.0 * ((t * t) + ((t * t) / x))) + ((t_5 + t_5) / (x * x))) + (t_5 / x)))));
} else {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_4 = Float64(t_2 / sqrt(Float64(Float64(t_3 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) t_5 = fma(Float64(2.0 * t), t, Float64(l * l)) tmp = 0.0 if (t_4 <= -1.000000000000001) tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(Float64(Float64(2.0 * Float64(l * Float64(l / x))) / t) * Float64(sqrt(Float64(1.0 / t_1)) * -0.5)) - Float64(t * sqrt(t_1))))); elseif (t_4 <= 0.0) tmp = cbrt((Float64(t / Float64(hypot(Float64(hypot(l, t_2) * sqrt(t_3)), l) / sqrt(2.0))) ^ 3.0)); elseif (t_4 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(Float64(t_5 + t_5) / Float64(x * x))) + Float64(t_5 / x)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(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[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / N[Sqrt[N[(N[(t$95$3 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1.000000000000001], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[Power[N[Power[N[(t / N[(N[Sqrt[N[(N[Sqrt[l ^ 2 + t$95$2 ^ 2], $MachinePrecision] * N[Sqrt[t$95$3], $MachinePrecision]), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 + t$95$5), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{x + 1}{x + -1}\\
t_4 := \frac{t_2}{\sqrt{t_3 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
t_5 := \mathsf{fma}\left(2 \cdot t, t, \ell \cdot \ell\right)\\
\mathbf{if}\;t_4 \leq -1.000000000000001:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}{t} \cdot \left(\sqrt{\frac{1}{t_1}} \cdot -0.5\right) - t \cdot \sqrt{t_1}}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\sqrt[3]{{\left(\frac{t}{\frac{\mathsf{hypot}\left(\mathsf{hypot}\left(\ell, t_2\right) \cdot \sqrt{t_3}, \ell\right)}{\sqrt{2}}}\right)}^{3}}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{t_5 + t_5}{x \cdot x}\right) + \frac{t_5}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1.00000000000000111Initial program 6.4%
associate-*l/6.4%
Simplified6.4%
Taylor expanded in x around inf 50.0%
associate--l+50.0%
unpow250.0%
distribute-lft-out50.0%
unpow250.0%
unpow250.0%
associate-*r/50.0%
mul-1-neg50.0%
+-commutative50.0%
unpow250.0%
associate-*l*50.0%
unpow250.0%
fma-udef50.0%
Simplified50.0%
Taylor expanded in t around -inf 70.0%
mul-1-neg70.0%
*-commutative70.0%
unsub-neg70.0%
Simplified70.0%
if -1.00000000000000111 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.0Initial program 34.1%
associate-*r/34.1%
fma-neg34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
fma-def34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Applied egg-rr99.0%
if 0.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 58.8%
associate-*l/58.9%
Simplified58.9%
Taylor expanded in x around -inf 86.5%
associate--l+86.5%
unpow286.5%
sub-neg86.5%
Simplified86.5%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in x around inf 21.6%
associate--l+21.6%
unpow221.6%
distribute-lft-out21.6%
unpow221.6%
unpow221.6%
associate-*r/21.6%
mul-1-neg21.6%
+-commutative21.6%
unpow221.6%
associate-*l*21.6%
unpow221.6%
fma-udef21.6%
Simplified21.6%
Taylor expanded in l around inf 39.1%
*-commutative39.1%
associate-*l*39.2%
Simplified39.2%
Final simplification81.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (fma (* 2.0 t) t (* l l)))
(t_2 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x))))
(t_3 (* (sqrt 2.0) t))
(t_4 (/ (+ x 1.0) (+ x -1.0)))
(t_5 (/ t_3 (sqrt (- (* t_4 (+ (* l l) (* 2.0 (* t t)))) (* l l))))))
(if (<= t_5 -1.000000000000001)
(*
t
(/
(sqrt 2.0)
(-
(* (/ (* 2.0 (* l (/ l x))) t) (* (sqrt (/ 1.0 t_2)) -0.5))
(* t (sqrt t_2)))))
(if (<= t_5 0.0)
(/ 1.0 (/ (hypot (* t_3 (- (sqrt t_4))) l) t_3))
(if (<= t_5 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(+ (* 2.0 (+ (* t t) (/ (* t t) x))) (/ (+ t_1 t_1) (* x x)))
(/ t_1 x))))))
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = fma((2.0 * t), t, (l * l));
double t_2 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_3 = sqrt(2.0) * t;
double t_4 = (x + 1.0) / (x + -1.0);
double t_5 = t_3 / sqrt(((t_4 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_5 <= -1.000000000000001) {
tmp = t * (sqrt(2.0) / ((((2.0 * (l * (l / x))) / t) * (sqrt((1.0 / t_2)) * -0.5)) - (t * sqrt(t_2))));
} else if (t_5 <= 0.0) {
tmp = 1.0 / (hypot((t_3 * -sqrt(t_4)), l) / t_3);
} else if (t_5 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + (((2.0 * ((t * t) + ((t * t) / x))) + ((t_1 + t_1) / (x * x))) + (t_1 / x)))));
} else {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = fma(Float64(2.0 * t), t, Float64(l * l)) t_2 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_3 = Float64(sqrt(2.0) * t) t_4 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_5 = Float64(t_3 / sqrt(Float64(Float64(t_4 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) tmp = 0.0 if (t_5 <= -1.000000000000001) tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(Float64(Float64(2.0 * Float64(l * Float64(l / x))) / t) * Float64(sqrt(Float64(1.0 / t_2)) * -0.5)) - Float64(t * sqrt(t_2))))); elseif (t_5 <= 0.0) tmp = Float64(1.0 / Float64(hypot(Float64(t_3 * Float64(-sqrt(t_4))), l) / t_3)); elseif (t_5 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(Float64(t_1 + t_1) / Float64(x * x))) + Float64(t_1 / x)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(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[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 / N[Sqrt[N[(N[(t$95$4 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -1.000000000000001], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$2), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 0.0], N[(1.0 / N[(N[Sqrt[N[(t$95$3 * (-N[Sqrt[t$95$4], $MachinePrecision])), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 + t$95$1), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(2 \cdot t, t, \ell \cdot \ell\right)\\
t_2 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_3 := \sqrt{2} \cdot t\\
t_4 := \frac{x + 1}{x + -1}\\
t_5 := \frac{t_3}{\sqrt{t_4 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_5 \leq -1.000000000000001:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}{t} \cdot \left(\sqrt{\frac{1}{t_2}} \cdot -0.5\right) - t \cdot \sqrt{t_2}}\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(t_3 \cdot \left(-\sqrt{t_4}\right), \ell\right)}{t_3}}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\left(2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right) + \frac{t_1 + t_1}{x \cdot x}\right) + \frac{t_1}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1.00000000000000111Initial program 6.4%
associate-*l/6.4%
Simplified6.4%
Taylor expanded in x around inf 50.0%
associate--l+50.0%
unpow250.0%
distribute-lft-out50.0%
unpow250.0%
unpow250.0%
associate-*r/50.0%
mul-1-neg50.0%
+-commutative50.0%
unpow250.0%
associate-*l*50.0%
unpow250.0%
fma-udef50.0%
Simplified50.0%
Taylor expanded in t around -inf 70.0%
mul-1-neg70.0%
*-commutative70.0%
unsub-neg70.0%
Simplified70.0%
if -1.00000000000000111 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.0Initial program 34.1%
associate-*r/34.1%
fma-neg34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
fma-def34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Applied egg-rr99.0%
Taylor expanded in t around -inf 99.0%
associate-*r*99.0%
mul-1-neg99.0%
Simplified99.0%
if 0.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 58.8%
associate-*l/58.9%
Simplified58.9%
Taylor expanded in x around -inf 86.5%
associate--l+86.5%
unpow286.5%
sub-neg86.5%
Simplified86.5%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in x around inf 21.6%
associate--l+21.6%
unpow221.6%
distribute-lft-out21.6%
unpow221.6%
unpow221.6%
associate-*r/21.6%
mul-1-neg21.6%
+-commutative21.6%
unpow221.6%
associate-*l*21.6%
unpow221.6%
fma-udef21.6%
Simplified21.6%
Taylor expanded in l around inf 39.1%
*-commutative39.1%
associate-*l*39.2%
Simplified39.2%
Final simplification81.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (+ 2.0 (+ (/ 2.0 x) (/ 2.0 x))))
(t_2 (* (sqrt 2.0) t))
(t_3 (/ (+ x 1.0) (+ x -1.0)))
(t_4 (/ t_2 (sqrt (- (* t_3 (+ (* l l) (* 2.0 (* t t)))) (* l l))))))
(if (<= t_4 -1.000000000000001)
(*
t
(/
(sqrt 2.0)
(-
(* (/ (* 2.0 (* l (/ l x))) t) (* (sqrt (/ 1.0 t_1)) -0.5))
(* t (sqrt t_1)))))
(if (<= t_4 0.0)
(/ 1.0 (/ (hypot (* t_2 (- (sqrt t_3))) l) t_2))
(if (<= t_4 INFINITY)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma (* 2.0 t) t (* l l)) x))))))
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x)))))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = 2.0 + ((2.0 / x) + (2.0 / x));
double t_2 = sqrt(2.0) * t;
double t_3 = (x + 1.0) / (x + -1.0);
double t_4 = t_2 / sqrt(((t_3 * ((l * l) + (2.0 * (t * t)))) - (l * l)));
double tmp;
if (t_4 <= -1.000000000000001) {
tmp = t * (sqrt(2.0) / ((((2.0 * (l * (l / x))) / t) * (sqrt((1.0 / t_1)) * -0.5)) - (t * sqrt(t_1))));
} else if (t_4 <= 0.0) {
tmp = 1.0 / (hypot((t_2 * -sqrt(t_3)), l) / t_2);
} else if (t_4 <= ((double) INFINITY)) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((2.0 * t), t, (l * l)) / x)))));
} else {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
}
return tmp;
}
l = abs(l) function code(x, l, t) t_1 = Float64(2.0 + Float64(Float64(2.0 / x) + Float64(2.0 / x))) t_2 = Float64(sqrt(2.0) * t) t_3 = Float64(Float64(x + 1.0) / Float64(x + -1.0)) t_4 = Float64(t_2 / sqrt(Float64(Float64(t_3 * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) tmp = 0.0 if (t_4 <= -1.000000000000001) tmp = Float64(t * Float64(sqrt(2.0) / Float64(Float64(Float64(Float64(2.0 * Float64(l * Float64(l / x))) / t) * Float64(sqrt(Float64(1.0 / t_1)) * -0.5)) - Float64(t * sqrt(t_1))))); elseif (t_4 <= 0.0) tmp = Float64(1.0 / Float64(hypot(Float64(t_2 * Float64(-sqrt(t_3))), l) / t_2)); elseif (t_4 <= Inf) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(Float64(2.0 * t), t, Float64(l * l)) / x)))))); else tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(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[(2.0 + N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + 1.0), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / N[Sqrt[N[(N[(t$95$3 * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -1.000000000000001], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(t * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[(1.0 / N[(N[Sqrt[N[(t$95$2 * (-N[Sqrt[t$95$3], $MachinePrecision])), $MachinePrecision] ^ 2 + l ^ 2], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := 2 + \left(\frac{2}{x} + \frac{2}{x}\right)\\
t_2 := \sqrt{2} \cdot t\\
t_3 := \frac{x + 1}{x + -1}\\
t_4 := \frac{t_2}{\sqrt{t_3 \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\\
\mathbf{if}\;t_4 \leq -1.000000000000001:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\frac{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}{t} \cdot \left(\sqrt{\frac{1}{t_1}} \cdot -0.5\right) - t \cdot \sqrt{t_1}}\\
\mathbf{elif}\;t_4 \leq 0:\\
\;\;\;\;\frac{1}{\frac{\mathsf{hypot}\left(t_2 \cdot \left(-\sqrt{t_3}\right), \ell\right)}{t_2}}\\
\mathbf{elif}\;t_4 \leq \infty:\\
\;\;\;\;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 \cdot t, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < -1.00000000000000111Initial program 6.4%
associate-*l/6.4%
Simplified6.4%
Taylor expanded in x around inf 50.0%
associate--l+50.0%
unpow250.0%
distribute-lft-out50.0%
unpow250.0%
unpow250.0%
associate-*r/50.0%
mul-1-neg50.0%
+-commutative50.0%
unpow250.0%
associate-*l*50.0%
unpow250.0%
fma-udef50.0%
Simplified50.0%
Taylor expanded in t around -inf 70.0%
mul-1-neg70.0%
*-commutative70.0%
unsub-neg70.0%
Simplified70.0%
if -1.00000000000000111 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < 0.0Initial program 34.1%
associate-*r/34.1%
fma-neg34.1%
sub-neg34.1%
metadata-eval34.1%
+-commutative34.1%
fma-def34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
Applied egg-rr99.0%
Taylor expanded in t around -inf 99.0%
associate-*r*99.0%
mul-1-neg99.0%
Simplified99.0%
if 0.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) < +inf.0Initial program 58.8%
associate-*l/58.9%
Simplified58.9%
Taylor expanded in x around inf 86.5%
associate--l+86.5%
unpow286.5%
distribute-lft-out86.5%
unpow286.5%
unpow286.5%
associate-*r/86.5%
mul-1-neg86.5%
+-commutative86.5%
unpow286.5%
associate-*l*86.5%
unpow286.5%
fma-udef86.5%
Simplified86.5%
if +inf.0 < (/.f64 (*.f64 (sqrt.f64 2) t) (sqrt.f64 (-.f64 (*.f64 (/.f64 (+.f64 x 1) (-.f64 x 1)) (+.f64 (*.f64 l l) (*.f64 2 (*.f64 t t)))) (*.f64 l l)))) Initial program 0.0%
associate-*l/0.0%
Simplified0.0%
Taylor expanded in x around inf 21.6%
associate--l+21.6%
unpow221.6%
distribute-lft-out21.6%
unpow221.6%
unpow221.6%
associate-*r/21.6%
mul-1-neg21.6%
+-commutative21.6%
unpow221.6%
associate-*l*21.6%
unpow221.6%
fma-udef21.6%
Simplified21.6%
Taylor expanded in l around inf 39.1%
*-commutative39.1%
associate-*l*39.2%
Simplified39.2%
Final simplification81.0%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -5.7e-293)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.46e+57)
(*
t
(/
(sqrt 2.0)
(sqrt
(+
(/ (* l l) x)
(+
(* 2.0 (+ (* t t) (/ (* t t) x)))
(/ (fma (* 2.0 t) t (* l l)) x))))))
(- 1.0 (/ 1.0 x)))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -5.7e-293) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.46e+57) {
tmp = t * (sqrt(2.0) / sqrt((((l * l) / x) + ((2.0 * ((t * t) + ((t * t) / x))) + (fma((2.0 * t), t, (l * l)) / x)))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -5.7e-293) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.46e+57) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(Float64(Float64(l * l) / x) + Float64(Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x))) + Float64(fma(Float64(2.0 * t), t, Float64(l * l)) / x)))))); 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_] := If[LessEqual[t, -5.7e-293], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.46e+57], 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[(N[(2.0 * t), $MachinePrecision] * t + N[(l * l), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.7 \cdot 10^{-293}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.46 \cdot 10^{+57}:\\
\;\;\;\;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 \cdot t, t, \ell \cdot \ell\right)}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -5.7e-293Initial program 29.6%
associate-*r/29.5%
fma-neg29.6%
sub-neg29.6%
metadata-eval29.6%
+-commutative29.6%
fma-def29.6%
distribute-rgt-neg-in29.6%
Simplified29.6%
Applied egg-rr71.2%
Taylor expanded in t around -inf 82.9%
mul-1-neg82.9%
sub-neg82.9%
metadata-eval82.9%
+-commutative82.9%
Simplified82.9%
if -5.7e-293 < t < 1.46e57Initial program 41.0%
associate-*l/41.0%
Simplified41.0%
Taylor expanded in x around inf 78.4%
associate--l+78.4%
unpow278.4%
distribute-lft-out78.4%
unpow278.4%
unpow278.4%
associate-*r/78.4%
mul-1-neg78.4%
+-commutative78.4%
unpow278.4%
associate-*l*78.4%
unpow278.4%
fma-udef78.4%
Simplified78.4%
if 1.46e57 < t Initial program 31.2%
associate-*r/31.1%
fma-neg31.1%
sub-neg31.1%
metadata-eval31.1%
+-commutative31.1%
fma-def31.1%
distribute-rgt-neg-in31.1%
Simplified31.1%
Taylor expanded in t around inf 15.0%
associate-/l*36.9%
+-commutative36.9%
sub-neg36.9%
metadata-eval36.9%
+-commutative36.9%
unpow236.9%
Simplified36.9%
Taylor expanded in x around inf 88.2%
Final simplification82.8%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t -1.8e-243)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 2.15e-203)
(* t (/ (sqrt 2.0) (* l (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(if (<= t 1.9e-117)
1.0
(if (<= t 2.2e-101)
(/ (sqrt 2.0) (/ (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x))))) t))
(- 1.0 (/ 1.0 x)))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-243) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2.15e-203) {
tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x)))));
} else if (t <= 1.9e-117) {
tmp = 1.0;
} else if (t <= 2.2e-101) {
tmp = sqrt(2.0) / ((l * sqrt(((2.0 / x) + (2.0 / (x * x))))) / t);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= (-1.8d-243)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 2.15d-203) then
tmp = t * (sqrt(2.0d0) / (l * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
else if (t <= 1.9d-117) then
tmp = 1.0d0
else if (t <= 2.2d-101) then
tmp = sqrt(2.0d0) / ((l * sqrt(((2.0d0 / x) + (2.0d0 / (x * x))))) / t)
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= -1.8e-243) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 2.15e-203) {
tmp = t * (Math.sqrt(2.0) / (l * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
} else if (t <= 1.9e-117) {
tmp = 1.0;
} else if (t <= 2.2e-101) {
tmp = Math.sqrt(2.0) / ((l * Math.sqrt(((2.0 / x) + (2.0 / (x * x))))) / t);
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= -1.8e-243: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 2.15e-203: tmp = t * (math.sqrt(2.0) / (l * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) elif t <= 1.9e-117: tmp = 1.0 elif t <= 2.2e-101: tmp = math.sqrt(2.0) / ((l * math.sqrt(((2.0 / x) + (2.0 / (x * x))))) / t) else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= -1.8e-243) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 2.15e-203) tmp = Float64(t * Float64(sqrt(2.0) / Float64(l * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); elseif (t <= 1.9e-117) tmp = 1.0; elseif (t <= 2.2e-101) tmp = Float64(sqrt(2.0) / Float64(Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))) / t)); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= -1.8e-243) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 2.15e-203) tmp = t * (sqrt(2.0) / (l * (sqrt(2.0) * sqrt((1.0 / x))))); elseif (t <= 1.9e-117) tmp = 1.0; elseif (t <= 2.2e-101) tmp = sqrt(2.0) / ((l * sqrt(((2.0 / x) + (2.0 / (x * x))))) / t); else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, -1.8e-243], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 2.15e-203], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-117], 1.0, If[LessEqual[t, 2.2e-101], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-243}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-203}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\ell \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-117}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-101}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}{t}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-243Initial program 33.2%
associate-*r/33.2%
fma-neg33.2%
sub-neg33.2%
metadata-eval33.2%
+-commutative33.2%
fma-def33.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Applied egg-rr76.4%
Taylor expanded in t around -inf 87.6%
mul-1-neg87.6%
sub-neg87.6%
metadata-eval87.6%
+-commutative87.6%
Simplified87.6%
if -1.8000000000000001e-243 < t < 2.15000000000000014e-203Initial program 2.3%
associate-*l/2.3%
Simplified2.3%
Taylor expanded in x around inf 52.2%
associate--l+52.2%
unpow252.2%
distribute-lft-out52.2%
unpow252.2%
unpow252.2%
associate-*r/52.2%
mul-1-neg52.2%
+-commutative52.2%
unpow252.2%
associate-*l*52.2%
unpow252.2%
fma-udef52.2%
Simplified52.2%
Taylor expanded in l around inf 48.7%
*-commutative48.7%
associate-*l*48.8%
Simplified48.8%
if 2.15000000000000014e-203 < t < 1.89999999999999986e-117Initial program 38.9%
associate-/l*38.9%
fma-neg38.9%
remove-double-neg38.9%
fma-neg38.9%
sub-neg38.9%
metadata-eval38.9%
remove-double-neg38.9%
fma-def38.9%
Simplified38.9%
Taylor expanded in x around inf 62.4%
associate-*r/62.4%
Simplified62.4%
Taylor expanded in x around inf 75.8%
if 1.89999999999999986e-117 < t < 2.1999999999999999e-101Initial program 1.2%
associate-/l*1.2%
fma-neg1.2%
remove-double-neg1.2%
fma-neg1.2%
sub-neg1.2%
metadata-eval1.2%
remove-double-neg1.2%
fma-def1.2%
Simplified1.2%
Taylor expanded in t around 0 2.1%
associate-*l/2.1%
*-lft-identity2.1%
*-commutative2.1%
unpow22.1%
+-commutative2.1%
sub-neg2.1%
metadata-eval2.1%
+-commutative2.1%
unpow22.1%
Simplified2.1%
Taylor expanded in x around -inf 59.0%
associate--l+59.0%
unpow259.0%
sub-neg59.0%
mul-1-neg59.0%
remove-double-neg59.0%
+-commutative59.0%
mul-1-neg59.0%
unsub-neg59.0%
unpow259.0%
neg-mul-159.0%
unpow259.0%
distribute-rgt-neg-in59.0%
unpow259.0%
unpow259.0%
Simplified59.0%
Taylor expanded in l around 0 58.2%
*-commutative58.2%
associate-*r/58.2%
metadata-eval58.2%
unpow258.2%
associate-*r/58.2%
metadata-eval58.2%
Simplified58.2%
if 2.1999999999999999e-101 < t Initial program 43.2%
associate-*r/43.1%
fma-neg43.1%
sub-neg43.1%
metadata-eval43.1%
+-commutative43.1%
fma-def43.1%
distribute-rgt-neg-in43.1%
Simplified43.1%
Taylor expanded in t around inf 39.1%
associate-/l*47.1%
+-commutative47.1%
sub-neg47.1%
metadata-eval47.1%
+-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x around inf 87.4%
Final simplification81.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(let* ((t_1 (/ (sqrt 2.0) (/ (* l (sqrt (+ (/ 2.0 x) (/ 2.0 (* x x))))) t))))
(if (<= t -3.7e-243)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.12e-204)
t_1
(if (<= t 6.5e-118) 1.0 (if (<= t 2.2e-101) t_1 (- 1.0 (/ 1.0 x))))))))l = abs(l);
double code(double x, double l, double t) {
double t_1 = sqrt(2.0) / ((l * sqrt(((2.0 / x) + (2.0 / (x * x))))) / t);
double tmp;
if (t <= -3.7e-243) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.12e-204) {
tmp = t_1;
} else if (t <= 6.5e-118) {
tmp = 1.0;
} else if (t <= 2.2e-101) {
tmp = t_1;
} 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 = sqrt(2.0d0) / ((l * sqrt(((2.0d0 / x) + (2.0d0 / (x * x))))) / t)
if (t <= (-3.7d-243)) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.12d-204) then
tmp = t_1
else if (t <= 6.5d-118) then
tmp = 1.0d0
else if (t <= 2.2d-101) then
tmp = t_1
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 = Math.sqrt(2.0) / ((l * Math.sqrt(((2.0 / x) + (2.0 / (x * x))))) / t);
double tmp;
if (t <= -3.7e-243) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.12e-204) {
tmp = t_1;
} else if (t <= 6.5e-118) {
tmp = 1.0;
} else if (t <= 2.2e-101) {
tmp = t_1;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): t_1 = math.sqrt(2.0) / ((l * math.sqrt(((2.0 / x) + (2.0 / (x * x))))) / t) tmp = 0 if t <= -3.7e-243: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.12e-204: tmp = t_1 elif t <= 6.5e-118: tmp = 1.0 elif t <= 2.2e-101: 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(Float64(l * sqrt(Float64(Float64(2.0 / x) + Float64(2.0 / Float64(x * x))))) / t)) tmp = 0.0 if (t <= -3.7e-243) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.12e-204) tmp = t_1; elseif (t <= 6.5e-118) tmp = 1.0; elseif (t <= 2.2e-101) tmp = t_1; 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 = sqrt(2.0) / ((l * sqrt(((2.0 / x) + (2.0 / (x * x))))) / t); tmp = 0.0; if (t <= -3.7e-243) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.12e-204) tmp = t_1; elseif (t <= 6.5e-118) tmp = 1.0; elseif (t <= 2.2e-101) tmp = t_1; 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[Sqrt[2.0], $MachinePrecision] / N[(N[(l * N[Sqrt[N[(N[(2.0 / x), $MachinePrecision] + N[(2.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.7e-243], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.12e-204], t$95$1, If[LessEqual[t, 6.5e-118], 1.0, If[LessEqual[t, 2.2e-101], t$95$1, N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
t_1 := \frac{\sqrt{2}}{\frac{\ell \cdot \sqrt{\frac{2}{x} + \frac{2}{x \cdot x}}}{t}}\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{-243}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-204}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-118}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < -3.7e-243Initial program 33.2%
associate-*r/33.2%
fma-neg33.2%
sub-neg33.2%
metadata-eval33.2%
+-commutative33.2%
fma-def33.2%
distribute-rgt-neg-in33.2%
Simplified33.2%
Applied egg-rr76.4%
Taylor expanded in t around -inf 87.6%
mul-1-neg87.6%
sub-neg87.6%
metadata-eval87.6%
+-commutative87.6%
Simplified87.6%
if -3.7e-243 < t < 1.11999999999999997e-204 or 6.49999999999999958e-118 < t < 2.1999999999999999e-101Initial program 2.0%
associate-/l*2.0%
fma-neg2.0%
remove-double-neg2.0%
fma-neg2.0%
sub-neg2.0%
metadata-eval2.0%
remove-double-neg2.0%
fma-def2.0%
Simplified2.0%
Taylor expanded in t around 0 5.6%
associate-*l/5.6%
*-lft-identity5.6%
*-commutative5.6%
unpow25.6%
+-commutative5.6%
sub-neg5.6%
metadata-eval5.6%
+-commutative5.6%
unpow25.6%
Simplified5.6%
Taylor expanded in x around -inf 50.7%
associate--l+50.7%
unpow250.7%
sub-neg50.7%
mul-1-neg50.7%
remove-double-neg50.7%
+-commutative50.7%
mul-1-neg50.7%
unsub-neg50.7%
unpow250.7%
neg-mul-150.7%
unpow250.7%
distribute-rgt-neg-in50.7%
unpow250.7%
unpow250.7%
Simplified50.7%
Taylor expanded in l around 0 50.6%
*-commutative50.6%
associate-*r/50.6%
metadata-eval50.6%
unpow250.6%
associate-*r/50.6%
metadata-eval50.6%
Simplified50.6%
if 1.11999999999999997e-204 < t < 6.49999999999999958e-118Initial program 38.9%
associate-/l*38.9%
fma-neg38.9%
remove-double-neg38.9%
fma-neg38.9%
sub-neg38.9%
metadata-eval38.9%
remove-double-neg38.9%
fma-def38.9%
Simplified38.9%
Taylor expanded in x around inf 62.4%
associate-*r/62.4%
Simplified62.4%
Taylor expanded in x around inf 75.8%
if 2.1999999999999999e-101 < t Initial program 43.2%
associate-*r/43.1%
fma-neg43.1%
sub-neg43.1%
metadata-eval43.1%
+-commutative43.1%
fma-def43.1%
distribute-rgt-neg-in43.1%
Simplified43.1%
Taylor expanded in t around inf 39.1%
associate-/l*47.1%
+-commutative47.1%
sub-neg47.1%
metadata-eval47.1%
+-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x around inf 87.4%
Final simplification81.6%
NOTE: l should be positive before calling this function
(FPCore (x l t)
:precision binary64
(if (<= t 1e-293)
(- (sqrt (/ (+ x -1.0) (+ x 1.0))))
(if (<= t 1.5e-116)
1.0
(if (<= t 1.26e-99)
(* t (/ (sqrt 2.0) (sqrt (* 2.0 (* l (/ l x))))))
(- 1.0 (/ 1.0 x))))))l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.5e-116) {
tmp = 1.0;
} else if (t <= 1.26e-99) {
tmp = t * (sqrt(2.0) / sqrt((2.0 * (l * (l / 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-293) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else if (t <= 1.5d-116) then
tmp = 1.0d0
else if (t <= 1.26d-99) then
tmp = t * (sqrt(2.0d0) / sqrt((2.0d0 * (l * (l / 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-293) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else if (t <= 1.5e-116) {
tmp = 1.0;
} else if (t <= 1.26e-99) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((2.0 * (l * (l / x)))));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 1e-293: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) elif t <= 1.5e-116: tmp = 1.0 elif t <= 1.26e-99: tmp = t * (math.sqrt(2.0) / math.sqrt((2.0 * (l * (l / x))))) else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 1e-293) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); elseif (t <= 1.5e-116) tmp = 1.0; elseif (t <= 1.26e-99) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(2.0 * Float64(l * Float64(l / 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-293) tmp = -sqrt(((x + -1.0) / (x + 1.0))); elseif (t <= 1.5e-116) tmp = 1.0; elseif (t <= 1.26e-99) tmp = t * (sqrt(2.0) / sqrt((2.0 * (l * (l / 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-293], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), If[LessEqual[t, 1.5e-116], 1.0, If[LessEqual[t, 1.26e-99], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(2.0 * N[(l * N[(l / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-293}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-116}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-99}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{2 \cdot \left(\ell \cdot \frac{\ell}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < 1.0000000000000001e-293Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr71.2%
Taylor expanded in t around -inf 81.2%
mul-1-neg81.2%
sub-neg81.2%
metadata-eval81.2%
+-commutative81.2%
Simplified81.2%
if 1.0000000000000001e-293 < t < 1.50000000000000013e-116Initial program 26.4%
associate-/l*26.3%
fma-neg26.3%
remove-double-neg26.3%
fma-neg26.3%
sub-neg26.3%
metadata-eval26.3%
remove-double-neg26.3%
fma-def26.3%
Simplified26.3%
Taylor expanded in x around inf 45.0%
associate-*r/45.0%
Simplified45.0%
Taylor expanded in x around inf 63.3%
if 1.50000000000000013e-116 < t < 1.2599999999999999e-99Initial program 1.2%
associate-*l/1.2%
Simplified1.2%
Taylor expanded in x around inf 60.0%
associate--l+60.0%
unpow260.0%
distribute-lft-out60.0%
unpow260.0%
unpow260.0%
associate-*r/60.0%
mul-1-neg60.0%
+-commutative60.0%
unpow260.0%
associate-*l*60.0%
unpow260.0%
fma-udef60.0%
Simplified60.0%
Taylor expanded in t around 0 60.0%
cancel-sign-sub-inv60.0%
metadata-eval60.0%
distribute-rgt1-in60.0%
metadata-eval60.0%
unpow260.0%
associate-*r/86.5%
Simplified86.5%
if 1.2599999999999999e-99 < t Initial program 43.2%
associate-*r/43.1%
fma-neg43.1%
sub-neg43.1%
metadata-eval43.1%
+-commutative43.1%
fma-def43.1%
distribute-rgt-neg-in43.1%
Simplified43.1%
Taylor expanded in t around inf 39.1%
associate-/l*47.1%
+-commutative47.1%
sub-neg47.1%
metadata-eval47.1%
+-commutative47.1%
unpow247.1%
Simplified47.1%
Taylor expanded in x around inf 87.4%
Final simplification81.6%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 1e-293) (- (sqrt (/ (+ x -1.0) (+ x 1.0)))) (- 1.0 (/ 1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
tmp = -sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1d-293) then
tmp = -sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
tmp = -Math.sqrt(((x + -1.0) / (x + 1.0)));
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 1e-293: tmp = -math.sqrt(((x + -1.0) / (x + 1.0))) else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 1e-293) tmp = Float64(-sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0)))); else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 1e-293) tmp = -sqrt(((x + -1.0) / (x + 1.0))); else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, 1e-293], (-N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-293}:\\
\;\;\;\;-\sqrt{\frac{x + -1}{x + 1}}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < 1.0000000000000001e-293Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Applied egg-rr71.2%
Taylor expanded in t around -inf 81.2%
mul-1-neg81.2%
sub-neg81.2%
metadata-eval81.2%
+-commutative81.2%
Simplified81.2%
if 1.0000000000000001e-293 < t Initial program 37.4%
associate-*r/37.3%
fma-neg37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
fma-def37.3%
distribute-rgt-neg-in37.3%
Simplified37.3%
Taylor expanded in t around inf 35.2%
associate-/l*35.8%
+-commutative35.8%
sub-neg35.8%
metadata-eval35.8%
+-commutative35.8%
unpow235.8%
Simplified35.8%
Taylor expanded in x around inf 78.0%
Final simplification79.4%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 1e-293) -1.0 (- 1.0 (/ 1.0 x))))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
tmp = -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
NOTE: l should be positive before calling this function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1d-293) then
tmp = -1.0d0
else
tmp = 1.0d0 - (1.0d0 / x)
end if
code = tmp
end function
l = Math.abs(l);
public static double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
tmp = -1.0;
} else {
tmp = 1.0 - (1.0 / x);
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 1e-293: tmp = -1.0 else: tmp = 1.0 - (1.0 / x) return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 1e-293) tmp = -1.0; else tmp = Float64(1.0 - Float64(1.0 / x)); end return tmp end
l = abs(l) function tmp_2 = code(x, l, t) tmp = 0.0; if (t <= 1e-293) tmp = -1.0; else tmp = 1.0 - (1.0 / x); end tmp_2 = tmp; end
NOTE: l should be positive before calling this function code[x_, l_, t_] := If[LessEqual[t, 1e-293], -1.0, N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-293}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1}{x}\\
\end{array}
\end{array}
if t < 1.0000000000000001e-293Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Taylor expanded in t around inf 25.7%
associate-/l*28.4%
+-commutative28.4%
sub-neg28.4%
metadata-eval28.4%
+-commutative28.4%
unpow228.4%
Simplified28.4%
Taylor expanded in x around inf 34.0%
unpow234.0%
Simplified34.0%
Taylor expanded in t around -inf 80.2%
if 1.0000000000000001e-293 < t Initial program 37.4%
associate-*r/37.3%
fma-neg37.3%
sub-neg37.3%
metadata-eval37.3%
+-commutative37.3%
fma-def37.3%
distribute-rgt-neg-in37.3%
Simplified37.3%
Taylor expanded in t around inf 35.2%
associate-/l*35.8%
+-commutative35.8%
sub-neg35.8%
metadata-eval35.8%
+-commutative35.8%
unpow235.8%
Simplified35.8%
Taylor expanded in x around inf 78.0%
Final simplification79.0%
NOTE: l should be positive before calling this function (FPCore (x l t) :precision binary64 (if (<= t 1e-293) -1.0 1.0))
l = abs(l);
double code(double x, double l, double t) {
double tmp;
if (t <= 1e-293) {
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-293) 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-293) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
l = abs(l) def code(x, l, t): tmp = 0 if t <= 1e-293: tmp = -1.0 else: tmp = 1.0 return tmp
l = abs(l) function code(x, l, t) tmp = 0.0 if (t <= 1e-293) 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-293) 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-293], -1.0, 1.0]
\begin{array}{l}
l = |l|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-293}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < 1.0000000000000001e-293Initial program 28.8%
associate-*r/28.8%
fma-neg28.8%
sub-neg28.8%
metadata-eval28.8%
+-commutative28.8%
fma-def28.8%
distribute-rgt-neg-in28.8%
Simplified28.8%
Taylor expanded in t around inf 25.7%
associate-/l*28.4%
+-commutative28.4%
sub-neg28.4%
metadata-eval28.4%
+-commutative28.4%
unpow228.4%
Simplified28.4%
Taylor expanded in x around inf 34.0%
unpow234.0%
Simplified34.0%
Taylor expanded in t around -inf 80.2%
if 1.0000000000000001e-293 < t Initial program 37.4%
associate-/l*37.4%
fma-neg37.4%
remove-double-neg37.4%
fma-neg37.4%
sub-neg37.4%
metadata-eval37.4%
remove-double-neg37.4%
fma-def37.4%
Simplified37.4%
Taylor expanded in x around inf 50.2%
associate-*r/50.2%
Simplified50.2%
Taylor expanded in x around inf 77.0%
Final simplification78.4%
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 33.6%
associate-*r/33.6%
fma-neg33.6%
sub-neg33.6%
metadata-eval33.6%
+-commutative33.6%
fma-def33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
Taylor expanded in t around inf 31.0%
associate-/l*32.5%
+-commutative32.5%
sub-neg32.5%
metadata-eval32.5%
+-commutative32.5%
unpow232.5%
Simplified32.5%
Taylor expanded in x around inf 40.8%
unpow240.8%
Simplified40.8%
Taylor expanded in t around -inf 36.0%
Final simplification36.0%
herbie shell --seed 2023243
(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)))))