
(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 12 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}
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0)))
(t_3 (* 2.0 (pow t_m 2.0)))
(t_4 (+ (pow l_m 2.0) t_3)))
(*
t_s
(if (<= t_m 3.5e-246)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(if (<= t_m 2.8e-157)
(/
t_2
(fma
0.5
(/
(* 2.0 (fma 2.0 (pow t_m 2.0) (pow l_m 2.0)))
(* t_m (* (sqrt 2.0) x)))
t_2))
(if (<= t_m 4e+28)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(+
t_3
(/
(+
(+ (* 2.0 (/ (pow t_m 2.0) x)) (/ (pow l_m 2.0) x))
(+ (+ t_4 t_4) (/ t_4 x)))
x)))))
(sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double t_4 = pow(l_m, 2.0) + t_3;
double tmp;
if (t_m <= 3.5e-246) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else if (t_m <= 2.8e-157) {
tmp = t_2 / fma(0.5, ((2.0 * fma(2.0, pow(t_m, 2.0), pow(l_m, 2.0))) / (t_m * (sqrt(2.0) * x))), t_2);
} else if (t_m <= 4e+28) {
tmp = sqrt(2.0) * (t_m / sqrt((t_3 + ((((2.0 * (pow(t_m, 2.0) / x)) + (pow(l_m, 2.0) / x)) + ((t_4 + t_4) + (t_4 / x))) / x))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) t_4 = Float64((l_m ^ 2.0) + t_3) tmp = 0.0 if (t_m <= 3.5e-246) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); elseif (t_m <= 2.8e-157) tmp = Float64(t_2 / fma(0.5, Float64(Float64(2.0 * fma(2.0, (t_m ^ 2.0), (l_m ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x))), t_2)); elseif (t_m <= 4e+28) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(t_3 + Float64(Float64(Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64((l_m ^ 2.0) / x)) + Float64(Float64(t_4 + t_4) + Float64(t_4 / x))) / x))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[l$95$m, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 3.5e-246], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.8e-157], N[(t$95$2 / N[(0.5 * N[(N[(2.0 * N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4e+28], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(t$95$3 + N[(N[(N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 + t$95$4), $MachinePrecision] + N[(t$95$4 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t_4 := {l\_m}^{2} + t\_3\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 3.5 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{-157}:\\
\;\;\;\;\frac{t\_2}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, {t\_m}^{2}, {l\_m}^{2}\right)}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}, t\_2\right)}\\
\mathbf{elif}\;t\_m \leq 4 \cdot 10^{+28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{t\_3 + \frac{\left(2 \cdot \frac{{t\_m}^{2}}{x} + \frac{{l\_m}^{2}}{x}\right) + \left(\left(t\_4 + t\_4\right) + \frac{t\_4}{x}\right)}{x}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 3.5000000000000002e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in l around 0 19.8%
if 3.5000000000000002e-246 < t < 2.8000000000000001e-157Initial program 7.5%
Simplified7.5%
Taylor expanded in x around inf 73.1%
associate-*r/73.1%
fma-define73.1%
Applied egg-rr73.1%
*-commutative73.1%
count-273.1%
*-commutative73.1%
Simplified73.1%
if 2.8000000000000001e-157 < t < 3.99999999999999983e28Initial program 56.3%
Simplified56.3%
Taylor expanded in x around -inf 91.0%
if 3.99999999999999983e28 < t Initial program 30.1%
Simplified30.1%
Taylor expanded in t around inf 91.2%
Taylor expanded in t around 0 91.3%
Final simplification53.8%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* t_m (sqrt 2.0))) (t_3 (* 2.0 (pow t_m 2.0))))
(*
t_s
(if (<= t_m 1.95e-246)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x)))))
(if (<= t_m 1.45e-156)
(/
t_2
(fma
0.5
(/
(* 2.0 (fma 2.0 (pow t_m 2.0) (pow l_m 2.0)))
(* t_m (* (sqrt 2.0) x)))
t_2))
(if (<= t_m 6.2e+28)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(+
(/ (+ (pow l_m 2.0) t_3) x)
(+ (* 2.0 (/ (pow t_m 2.0) x)) (+ t_3 (/ (pow l_m 2.0) x)))))))
(sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = t_m * sqrt(2.0);
double t_3 = 2.0 * pow(t_m, 2.0);
double tmp;
if (t_m <= 1.95e-246) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * sqrt((1.0 / x))));
} else if (t_m <= 1.45e-156) {
tmp = t_2 / fma(0.5, ((2.0 * fma(2.0, pow(t_m, 2.0), pow(l_m, 2.0))) / (t_m * (sqrt(2.0) * x))), t_2);
} else if (t_m <= 6.2e+28) {
tmp = sqrt(2.0) * (t_m / sqrt((((pow(l_m, 2.0) + t_3) / x) + ((2.0 * (pow(t_m, 2.0) / x)) + (t_3 + (pow(l_m, 2.0) / x))))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = Float64(t_m * sqrt(2.0)) t_3 = Float64(2.0 * (t_m ^ 2.0)) tmp = 0.0 if (t_m <= 1.95e-246) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))))); elseif (t_m <= 1.45e-156) tmp = Float64(t_2 / fma(0.5, Float64(Float64(2.0 * fma(2.0, (t_m ^ 2.0), (l_m ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x))), t_2)); elseif (t_m <= 6.2e+28) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(Float64(Float64((l_m ^ 2.0) + t_3) / x) + Float64(Float64(2.0 * Float64((t_m ^ 2.0) / x)) + Float64(t_3 + Float64((l_m ^ 2.0) / x))))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.95e-246], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.45e-156], N[(t$95$2 / N[(0.5 * N[(N[(2.0 * N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 6.2e+28], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] + t$95$3), $MachinePrecision] / x), $MachinePrecision] + N[(N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := t\_m \cdot \sqrt{2}\\
t_3 := 2 \cdot {t\_m}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.95 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}\\
\mathbf{elif}\;t\_m \leq 1.45 \cdot 10^{-156}:\\
\;\;\;\;\frac{t\_2}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, {t\_m}^{2}, {l\_m}^{2}\right)}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}, t\_2\right)}\\
\mathbf{elif}\;t\_m \leq 6.2 \cdot 10^{+28}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\frac{{l\_m}^{2} + t\_3}{x} + \left(2 \cdot \frac{{t\_m}^{2}}{x} + \left(t\_3 + \frac{{l\_m}^{2}}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.94999999999999989e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in l around 0 19.8%
if 1.94999999999999989e-246 < t < 1.4500000000000001e-156Initial program 7.5%
Simplified7.5%
Taylor expanded in x around inf 73.1%
associate-*r/73.1%
fma-define73.1%
Applied egg-rr73.1%
*-commutative73.1%
count-273.1%
*-commutative73.1%
Simplified73.1%
if 1.4500000000000001e-156 < t < 6.2000000000000001e28Initial program 56.3%
Simplified56.3%
Taylor expanded in x around inf 90.8%
if 6.2000000000000001e28 < t Initial program 30.1%
Simplified30.1%
Taylor expanded in t around inf 91.2%
Taylor expanded in t around 0 91.3%
Final simplification53.8%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (sqrt (/ 1.0 x))) (t_3 (* t_m (sqrt 2.0))))
(*
t_s
(if (<= t_m 8.4e-246)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) t_2)))
(if (<= t_m 1.2e-155)
(/
t_3
(fma
0.5
(/
(* 2.0 (fma 2.0 (pow t_m 2.0) (pow l_m 2.0)))
(* t_m (* (sqrt 2.0) x)))
t_3))
(if (<= t_m 3.5e-136)
(* (sqrt 2.0) (/ t_m (* l_m (* (sqrt 2.0) t_2))))
(sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = sqrt((1.0 / x));
double t_3 = t_m * sqrt(2.0);
double tmp;
if (t_m <= 8.4e-246) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * t_2));
} else if (t_m <= 1.2e-155) {
tmp = t_3 / fma(0.5, ((2.0 * fma(2.0, pow(t_m, 2.0), pow(l_m, 2.0))) / (t_m * (sqrt(2.0) * x))), t_3);
} else if (t_m <= 3.5e-136) {
tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * t_2)));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = sqrt(Float64(1.0 / x)) t_3 = Float64(t_m * sqrt(2.0)) tmp = 0.0 if (t_m <= 8.4e-246) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * t_2))); elseif (t_m <= 1.2e-155) tmp = Float64(t_3 / fma(0.5, Float64(Float64(2.0 * fma(2.0, (t_m ^ 2.0), (l_m ^ 2.0))) / Float64(t_m * Float64(sqrt(2.0) * x))), t_3)); elseif (t_m <= 3.5e-136) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * Float64(sqrt(2.0) * t_2)))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.4e-246], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.2e-155], N[(t$95$3 / N[(0.5 * N[(N[(2.0 * N[(2.0 * N[Power[t$95$m, 2.0], $MachinePrecision] + N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.5e-136], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{\frac{1}{x}}\\
t_3 := t\_m \cdot \sqrt{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.4 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot t\_2}\\
\mathbf{elif}\;t\_m \leq 1.2 \cdot 10^{-155}:\\
\;\;\;\;\frac{t\_3}{\mathsf{fma}\left(0.5, \frac{2 \cdot \mathsf{fma}\left(2, {t\_m}^{2}, {l\_m}^{2}\right)}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}, t\_3\right)}\\
\mathbf{elif}\;t\_m \leq 3.5 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \left(\sqrt{2} \cdot t\_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 8.39999999999999978e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in l around 0 19.8%
if 8.39999999999999978e-246 < t < 1.2e-155Initial program 7.5%
Simplified7.5%
Taylor expanded in x around inf 73.1%
associate-*r/73.1%
fma-define73.1%
Applied egg-rr73.1%
*-commutative73.1%
count-273.1%
*-commutative73.1%
Simplified73.1%
if 1.2e-155 < t < 3.50000000000000029e-136Initial program 22.8%
Simplified23.1%
Taylor expanded in l around inf 23.6%
associate--l+43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in x around inf 48.9%
associate-*l*48.9%
Simplified48.9%
if 3.50000000000000029e-136 < t Initial program 41.9%
Simplified32.3%
Taylor expanded in t around inf 88.2%
Taylor expanded in t around 0 88.3%
Final simplification51.2%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (sqrt (/ 1.0 x))))
(*
t_s
(if (<= t_m 1.08e-246)
(* (sqrt 2.0) (/ t_m (* (* (sqrt 2.0) l_m) t_2)))
(if (<= t_m 1e-155)
(*
(sqrt 2.0)
(/
t_m
(+ (* t_m (sqrt 2.0)) (/ (pow l_m 2.0) (* t_m (* (sqrt 2.0) x))))))
(if (<= t_m 1.4e-136)
(* (sqrt 2.0) (/ t_m (* l_m (* (sqrt 2.0) t_2))))
(sqrt (/ (+ x -1.0) (+ 1.0 x)))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double t_2 = sqrt((1.0 / x));
double tmp;
if (t_m <= 1.08e-246) {
tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * t_2));
} else if (t_m <= 1e-155) {
tmp = sqrt(2.0) * (t_m / ((t_m * sqrt(2.0)) + (pow(l_m, 2.0) / (t_m * (sqrt(2.0) * x)))));
} else if (t_m <= 1.4e-136) {
tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * t_2)));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = sqrt((1.0d0 / x))
if (t_m <= 1.08d-246) then
tmp = sqrt(2.0d0) * (t_m / ((sqrt(2.0d0) * l_m) * t_2))
else if (t_m <= 1d-155) then
tmp = sqrt(2.0d0) * (t_m / ((t_m * sqrt(2.0d0)) + ((l_m ** 2.0d0) / (t_m * (sqrt(2.0d0) * x)))))
else if (t_m <= 1.4d-136) then
tmp = sqrt(2.0d0) * (t_m / (l_m * (sqrt(2.0d0) * t_2)))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double t_2 = Math.sqrt((1.0 / x));
double tmp;
if (t_m <= 1.08e-246) {
tmp = Math.sqrt(2.0) * (t_m / ((Math.sqrt(2.0) * l_m) * t_2));
} else if (t_m <= 1e-155) {
tmp = Math.sqrt(2.0) * (t_m / ((t_m * Math.sqrt(2.0)) + (Math.pow(l_m, 2.0) / (t_m * (Math.sqrt(2.0) * x)))));
} else if (t_m <= 1.4e-136) {
tmp = Math.sqrt(2.0) * (t_m / (l_m * (Math.sqrt(2.0) * t_2)));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): t_2 = math.sqrt((1.0 / x)) tmp = 0 if t_m <= 1.08e-246: tmp = math.sqrt(2.0) * (t_m / ((math.sqrt(2.0) * l_m) * t_2)) elif t_m <= 1e-155: tmp = math.sqrt(2.0) * (t_m / ((t_m * math.sqrt(2.0)) + (math.pow(l_m, 2.0) / (t_m * (math.sqrt(2.0) * x))))) elif t_m <= 1.4e-136: tmp = math.sqrt(2.0) * (t_m / (l_m * (math.sqrt(2.0) * t_2))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) t_2 = sqrt(Float64(1.0 / x)) tmp = 0.0 if (t_m <= 1.08e-246) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(sqrt(2.0) * l_m) * t_2))); elseif (t_m <= 1e-155) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(Float64(t_m * sqrt(2.0)) + Float64((l_m ^ 2.0) / Float64(t_m * Float64(sqrt(2.0) * x)))))); elseif (t_m <= 1.4e-136) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * Float64(sqrt(2.0) * t_2)))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) t_2 = sqrt((1.0 / x)); tmp = 0.0; if (t_m <= 1.08e-246) tmp = sqrt(2.0) * (t_m / ((sqrt(2.0) * l_m) * t_2)); elseif (t_m <= 1e-155) tmp = sqrt(2.0) * (t_m / ((t_m * sqrt(2.0)) + ((l_m ^ 2.0) / (t_m * (sqrt(2.0) * x))))); elseif (t_m <= 1.4e-136) tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * t_2))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := Block[{t$95$2 = N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.08e-246], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1e-155], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(N[(t$95$m * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.4e-136], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sqrt{\frac{1}{x}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.08 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\left(\sqrt{2} \cdot l\_m\right) \cdot t\_2}\\
\mathbf{elif}\;t\_m \leq 10^{-155}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{t\_m \cdot \sqrt{2} + \frac{{l\_m}^{2}}{t\_m \cdot \left(\sqrt{2} \cdot x\right)}}\\
\mathbf{elif}\;t\_m \leq 1.4 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \left(\sqrt{2} \cdot t\_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.08000000000000003e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in l around 0 19.8%
if 1.08000000000000003e-246 < t < 1.00000000000000001e-155Initial program 7.5%
Simplified7.5%
Taylor expanded in x around inf 73.1%
Taylor expanded in l around inf 73.1%
*-commutative73.1%
Simplified73.1%
if 1.00000000000000001e-155 < t < 1.4e-136Initial program 22.8%
Simplified23.1%
Taylor expanded in l around inf 23.6%
associate--l+43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in x around inf 48.9%
associate-*l*48.9%
Simplified48.9%
if 1.4e-136 < t Initial program 41.9%
Simplified32.3%
Taylor expanded in t around inf 88.2%
Taylor expanded in t around 0 88.3%
Final simplification51.2%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.3e-135)
(* (sqrt 2.0) (/ t_m (* l_m (* (sqrt 2.0) (sqrt (/ 1.0 x))))))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.3e-135) {
tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * sqrt((1.0 / x)))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.3d-135) then
tmp = sqrt(2.0d0) * (t_m / (l_m * (sqrt(2.0d0) * sqrt((1.0d0 / x)))))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.3e-135) {
tmp = Math.sqrt(2.0) * (t_m / (l_m * (Math.sqrt(2.0) * Math.sqrt((1.0 / x)))));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.3e-135: tmp = math.sqrt(2.0) * (t_m / (l_m * (math.sqrt(2.0) * math.sqrt((1.0 / x))))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.3e-135) tmp = Float64(sqrt(2.0) * Float64(t_m / Float64(l_m * Float64(sqrt(2.0) * sqrt(Float64(1.0 / x)))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.3e-135) tmp = sqrt(2.0) * (t_m / (l_m * (sqrt(2.0) * sqrt((1.0 / x))))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.3e-135], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[(l$95$m * N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.3 \cdot 10^{-135}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{l\_m \cdot \left(\sqrt{2} \cdot \sqrt{\frac{1}{x}}\right)}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.30000000000000002e-135Initial program 28.8%
Simplified28.8%
Taylor expanded in l around inf 4.1%
associate--l+12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in x around inf 22.2%
associate-*l*22.2%
Simplified22.2%
if 1.30000000000000002e-135 < t Initial program 41.9%
Simplified32.3%
Taylor expanded in t around inf 88.2%
Taylor expanded in t around 0 88.3%
Final simplification48.3%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.7e-136)
(* (sqrt 2.0) (/ (* (* t_m (sqrt 0.5)) (sqrt x)) l_m))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.7e-136) {
tmp = sqrt(2.0) * (((t_m * sqrt(0.5)) * sqrt(x)) / l_m);
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.7d-136) then
tmp = sqrt(2.0d0) * (((t_m * sqrt(0.5d0)) * sqrt(x)) / l_m)
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.7e-136) {
tmp = Math.sqrt(2.0) * (((t_m * Math.sqrt(0.5)) * Math.sqrt(x)) / l_m);
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.7e-136: tmp = math.sqrt(2.0) * (((t_m * math.sqrt(0.5)) * math.sqrt(x)) / l_m) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.7e-136) tmp = Float64(sqrt(2.0) * Float64(Float64(Float64(t_m * sqrt(0.5)) * sqrt(x)) / l_m)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.7e-136) tmp = sqrt(2.0) * (((t_m * sqrt(0.5)) * sqrt(x)) / l_m); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.7e-136], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[(t$95$m * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.7 \cdot 10^{-136}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\left(t\_m \cdot \sqrt{0.5}\right) \cdot \sqrt{x}}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.7e-136Initial program 28.8%
Simplified28.8%
Taylor expanded in l around inf 4.1%
associate--l+12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
sub-neg12.9%
metadata-eval12.9%
+-commutative12.9%
Simplified12.9%
Taylor expanded in x around inf 20.2%
associate-*l/22.1%
Simplified22.1%
if 1.7e-136 < t Initial program 41.9%
Simplified32.3%
Taylor expanded in t around inf 88.2%
Taylor expanded in t around 0 88.3%
Final simplification48.3%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.9e-246)
(* (sqrt x) (/ t_m l_m))
(if (<= t_m 3.9e-156)
(+ 1.0 (/ -1.0 x))
(if (<= t_m 1.06e-135)
(* (sqrt 2.0) (/ t_m (sqrt (* 2.0 (* l_m (/ l_m x))))))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.9e-246) {
tmp = sqrt(x) * (t_m / l_m);
} else if (t_m <= 3.9e-156) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.06e-135) {
tmp = sqrt(2.0) * (t_m / sqrt((2.0 * (l_m * (l_m / x)))));
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.9d-246) then
tmp = sqrt(x) * (t_m / l_m)
else if (t_m <= 3.9d-156) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (t_m <= 1.06d-135) then
tmp = sqrt(2.0d0) * (t_m / sqrt((2.0d0 * (l_m * (l_m / x)))))
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.9e-246) {
tmp = Math.sqrt(x) * (t_m / l_m);
} else if (t_m <= 3.9e-156) {
tmp = 1.0 + (-1.0 / x);
} else if (t_m <= 1.06e-135) {
tmp = Math.sqrt(2.0) * (t_m / Math.sqrt((2.0 * (l_m * (l_m / x)))));
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.9e-246: tmp = math.sqrt(x) * (t_m / l_m) elif t_m <= 3.9e-156: tmp = 1.0 + (-1.0 / x) elif t_m <= 1.06e-135: tmp = math.sqrt(2.0) * (t_m / math.sqrt((2.0 * (l_m * (l_m / x))))) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.9e-246) tmp = Float64(sqrt(x) * Float64(t_m / l_m)); elseif (t_m <= 3.9e-156) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (t_m <= 1.06e-135) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(Float64(2.0 * Float64(l_m * Float64(l_m / x)))))); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.9e-246) tmp = sqrt(x) * (t_m / l_m); elseif (t_m <= 3.9e-156) tmp = 1.0 + (-1.0 / x); elseif (t_m <= 1.06e-135) tmp = sqrt(2.0) * (t_m / sqrt((2.0 * (l_m * (l_m / x))))); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.9e-246], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.9e-156], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.06e-135], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(l$95$m * N[(l$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.9 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{elif}\;t\_m \leq 3.9 \cdot 10^{-156}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;t\_m \leq 1.06 \cdot 10^{-135}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{2 \cdot \left(l\_m \cdot \frac{l\_m}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.89999999999999988e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in t around 0 17.7%
if 1.89999999999999988e-246 < t < 3.9000000000000001e-156Initial program 7.5%
Simplified2.4%
Taylor expanded in t around inf 56.8%
Taylor expanded in x around inf 56.8%
if 3.9000000000000001e-156 < t < 1.06000000000000004e-135Initial program 22.8%
Simplified23.1%
Taylor expanded in l around inf 23.6%
associate--l+43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
sub-neg43.7%
metadata-eval43.7%
+-commutative43.7%
Simplified43.7%
Taylor expanded in x around inf 69.9%
unpow269.9%
*-un-lft-identity69.9%
times-frac79.8%
Applied egg-rr79.8%
if 1.06000000000000004e-135 < t Initial program 41.9%
Simplified32.3%
Taylor expanded in t around inf 88.2%
Taylor expanded in t around 0 88.3%
Final simplification50.2%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.7e-246)
(* (sqrt x) (/ t_m l_m))
(sqrt (/ (+ x -1.0) (+ 1.0 x))))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.7e-246) {
tmp = sqrt(x) * (t_m / l_m);
} else {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.7d-246) then
tmp = sqrt(x) * (t_m / l_m)
else
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.7e-246) {
tmp = Math.sqrt(x) * (t_m / l_m);
} else {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.7e-246: tmp = math.sqrt(x) * (t_m / l_m) else: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.7e-246) tmp = Float64(sqrt(x) * Float64(t_m / l_m)); else tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.7e-246) tmp = sqrt(x) * (t_m / l_m); else tmp = sqrt(((x + -1.0) / (1.0 + x))); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.7e-246], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.7 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 1.7000000000000001e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in t around 0 17.7%
if 1.7000000000000001e-246 < t Initial program 36.2%
Simplified28.0%
Taylor expanded in t around inf 79.0%
Taylor expanded in t around 0 79.1%
Final simplification47.9%
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 1.1e-246)
(* (sqrt x) (/ t_m l_m))
(- 1.0 (/ (+ 1.0 (/ -0.5 x)) x)))))l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.1e-246) {
tmp = sqrt(x) * (t_m / l_m);
} else {
tmp = 1.0 - ((1.0 + (-0.5 / x)) / x);
}
return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.1d-246) then
tmp = sqrt(x) * (t_m / l_m)
else
tmp = 1.0d0 - ((1.0d0 + ((-0.5d0) / x)) / x)
end if
code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
double tmp;
if (t_m <= 1.1e-246) {
tmp = Math.sqrt(x) * (t_m / l_m);
} else {
tmp = 1.0 - ((1.0 + (-0.5 / x)) / x);
}
return t_s * tmp;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): tmp = 0 if t_m <= 1.1e-246: tmp = math.sqrt(x) * (t_m / l_m) else: tmp = 1.0 - ((1.0 + (-0.5 / x)) / x) return t_s * tmp
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) tmp = 0.0 if (t_m <= 1.1e-246) tmp = Float64(sqrt(x) * Float64(t_m / l_m)); else tmp = Float64(1.0 - Float64(Float64(1.0 + Float64(-0.5 / x)) / x)); end return Float64(t_s * tmp) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, x, l_m, t_m) tmp = 0.0; if (t_m <= 1.1e-246) tmp = sqrt(x) * (t_m / l_m); else tmp = 1.0 - ((1.0 + (-0.5 / x)) / x); end tmp_2 = t_s * tmp; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.1e-246], N[(N[Sqrt[x], $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(1.0 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.1 \cdot 10^{-246}:\\
\;\;\;\;\sqrt{x} \cdot \frac{t\_m}{l\_m}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{1 + \frac{-0.5}{x}}{x}\\
\end{array}
\end{array}
if t < 1.09999999999999999e-246Initial program 31.8%
Simplified31.8%
Taylor expanded in l around inf 3.0%
associate--l+9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
sub-neg9.6%
metadata-eval9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in x around inf 18.6%
Taylor expanded in t around 0 17.7%
if 1.09999999999999999e-246 < t Initial program 36.2%
Simplified28.0%
Taylor expanded in t around inf 79.0%
add-exp-log36.6%
expm1-define36.6%
Applied egg-rr36.6%
Taylor expanded in x around -inf 0.0%
Simplified79.1%
Final simplification47.9%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (- 1.0 (/ (+ 1.0 (/ -0.5 x)) x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - ((1.0 + (-0.5 / x)) / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 - ((1.0d0 + ((-0.5d0) / x)) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 - ((1.0 + (-0.5 / x)) / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 - ((1.0 + (-0.5 / x)) / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 - Float64(Float64(1.0 + Float64(-0.5 / x)) / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 - ((1.0 + (-0.5 / x)) / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 - N[(N[(1.0 + N[(-0.5 / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 - \frac{1 + \frac{-0.5}{x}}{x}\right)
\end{array}
Initial program 34.0%
Simplified28.6%
Taylor expanded in t around inf 39.8%
add-exp-log18.7%
expm1-define18.7%
Applied egg-rr18.7%
Taylor expanded in x around -inf 0.0%
Simplified39.9%
Final simplification39.9%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s (+ 1.0 (/ -1.0 x))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * (1.0d0 + ((-1.0d0) / x))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * (1.0 + (-1.0 / x));
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * (1.0 + (-1.0 / x))
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * Float64(1.0 + Float64(-1.0 / x))) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * (1.0 + (-1.0 / x)); end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(1 + \frac{-1}{x}\right)
\end{array}
Initial program 34.0%
Simplified28.6%
Taylor expanded in t around inf 39.8%
Taylor expanded in x around inf 39.9%
Final simplification39.9%
l_m = (fabs.f64 l) t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s x l_m t_m) :precision binary64 (* t_s 1.0))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, x, l_m, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: l_m
real(8), intent (in) :: t_m
code = t_s * 1.0d0
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double x, double l_m, double t_m) {
return t_s * 1.0;
}
l_m = math.fabs(l) t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, x, l_m, t_m): return t_s * 1.0
l_m = abs(l) t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, x, l_m, t_m) return Float64(t_s * 1.0) end
l_m = abs(l); t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, x, l_m, t_m) tmp = t_s * 1.0; end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, x_, l$95$m_, t$95$m_] := N[(t$95$s * 1.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot 1
\end{array}
Initial program 34.0%
Simplified28.6%
Taylor expanded in t around inf 39.8%
Taylor expanded in x around inf 39.6%
herbie shell --seed 2024166
(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)))))