
(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 9 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 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(let* ((t_2 (* (sqrt 2.0) l_m)))
(*
t_s
(if (<= t_m 1.2e-198)
(/ (sqrt 2.0) (/ (* t_2 (sqrt (/ 1.0 x))) t_m))
(if (<= t_m 2.05e-167)
1.0
(if (<= t_m 2.7e+147)
(*
(sqrt 2.0)
(/
t_m
(sqrt
(fma
2.0
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)))
(* t_2 (/ t_2 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 = sqrt(2.0) * l_m;
double tmp;
if (t_m <= 1.2e-198) {
tmp = sqrt(2.0) / ((t_2 * sqrt((1.0 / x))) / t_m);
} else if (t_m <= 2.05e-167) {
tmp = 1.0;
} else if (t_m <= 2.7e+147) {
tmp = sqrt(2.0) * (t_m / sqrt(fma(2.0, (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0))), (t_2 * (t_2 / 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(sqrt(2.0) * l_m) tmp = 0.0 if (t_m <= 1.2e-198) tmp = Float64(sqrt(2.0) / Float64(Float64(t_2 * sqrt(Float64(1.0 / x))) / t_m)); elseif (t_m <= 2.05e-167) tmp = 1.0; elseif (t_m <= 2.7e+147) tmp = Float64(sqrt(2.0) * Float64(t_m / sqrt(fma(2.0, Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0))), Float64(t_2 * Float64(t_2 / 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[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.2e-198], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(t$95$2 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.05e-167], 1.0, If[LessEqual[t$95$m, 2.7e+147], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * N[(t$95$2 / 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)
\\
\begin{array}{l}
t_2 := \sqrt{2} \cdot l\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-198}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{t\_2 \cdot \sqrt{\frac{1}{x}}}{t\_m}}\\
\mathbf{elif}\;t\_m \leq 2.05 \cdot 10^{-167}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 2.7 \cdot 10^{+147}:\\
\;\;\;\;\sqrt{2} \cdot \frac{t\_m}{\sqrt{\mathsf{fma}\left(2, {t\_m}^{2} \cdot \frac{1 + x}{x + -1}, t\_2 \cdot \frac{t\_2}{x}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
\end{array}
if t < 1.19999999999999993e-198Initial program 33.6%
Simplified33.5%
Taylor expanded in l around 0 25.9%
fma-define25.9%
+-commutative25.9%
associate-*r/35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
associate--l+41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
Simplified41.8%
Taylor expanded in x around inf 50.3%
associate-*r/50.3%
Simplified50.3%
clear-num50.4%
un-div-inv50.4%
fma-undefine50.4%
associate-/l*50.4%
distribute-lft-out50.4%
+-commutative50.4%
Applied egg-rr50.4%
Taylor expanded in t around 0 15.4%
*-commutative15.4%
Simplified15.4%
if 1.19999999999999993e-198 < t < 2.05000000000000009e-167Initial program 2.7%
Simplified2.7%
Taylor expanded in l around 0 71.5%
+-commutative71.5%
sub-neg71.5%
metadata-eval71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in x around inf 71.6%
if 2.05000000000000009e-167 < t < 2.69999999999999998e147Initial program 62.5%
Simplified62.4%
Taylor expanded in l around 0 46.7%
fma-define46.7%
+-commutative46.7%
associate-*r/71.8%
sub-neg71.8%
metadata-eval71.8%
+-commutative71.8%
associate--l+76.6%
sub-neg76.6%
metadata-eval76.6%
+-commutative76.6%
sub-neg76.6%
metadata-eval76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in x around inf 82.9%
associate-*r/82.9%
Simplified82.9%
add-sqr-sqrt82.9%
*-un-lft-identity82.9%
times-frac82.9%
sqrt-prod82.9%
unpow282.9%
sqrt-prod42.3%
add-sqr-sqrt74.6%
sqrt-prod74.6%
unpow274.6%
sqrt-prod45.0%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
if 2.69999999999999998e147 < t Initial program 4.8%
Simplified4.8%
Taylor expanded in l around 0 92.9%
+-commutative92.9%
sub-neg92.9%
metadata-eval92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around 0 93.2%
Final simplification50.9%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 3.2e-198)
(/ (sqrt 2.0) (/ (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x))) t_m))
(if (<= t_m 5.2e-166)
1.0
(if (<= t_m 5e+94)
(*
(/
1.0
(sqrt
(*
2.0
(fma (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0)) (/ (pow l_m 2.0) x)))))
(* t_m (sqrt 2.0)))
(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 <= 3.2e-198) {
tmp = sqrt(2.0) / (((sqrt(2.0) * l_m) * sqrt((1.0 / x))) / t_m);
} else if (t_m <= 5.2e-166) {
tmp = 1.0;
} else if (t_m <= 5e+94) {
tmp = (1.0 / sqrt((2.0 * fma(pow(t_m, 2.0), ((1.0 + x) / (x + -1.0)), (pow(l_m, 2.0) / x))))) * (t_m * sqrt(2.0));
} 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) tmp = 0.0 if (t_m <= 3.2e-198) tmp = Float64(sqrt(2.0) / Float64(Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))) / t_m)); elseif (t_m <= 5.2e-166) tmp = 1.0; elseif (t_m <= 5e+94) tmp = Float64(Float64(1.0 / sqrt(Float64(2.0 * fma((t_m ^ 2.0), Float64(Float64(1.0 + x) / Float64(x + -1.0)), Float64((l_m ^ 2.0) / x))))) * Float64(t_m * sqrt(2.0))); 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_] := N[(t$95$s * If[LessEqual[t$95$m, 3.2e-198], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.2e-166], 1.0, If[LessEqual[t$95$m, 5e+94], N[(N[(1.0 / N[Sqrt[N[(2.0 * N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Sqrt[2.0], $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 3.2 \cdot 10^{-198}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}{t\_m}}\\
\mathbf{elif}\;t\_m \leq 5.2 \cdot 10^{-166}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 5 \cdot 10^{+94}:\\
\;\;\;\;\frac{1}{\sqrt{2 \cdot \mathsf{fma}\left({t\_m}^{2}, \frac{1 + x}{x + -1}, \frac{{l\_m}^{2}}{x}\right)}} \cdot \left(t\_m \cdot \sqrt{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 3.19999999999999994e-198Initial program 33.6%
Simplified33.5%
Taylor expanded in l around 0 25.9%
fma-define25.9%
+-commutative25.9%
associate-*r/35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
associate--l+41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
Simplified41.8%
Taylor expanded in x around inf 50.3%
associate-*r/50.3%
Simplified50.3%
clear-num50.4%
un-div-inv50.4%
fma-undefine50.4%
associate-/l*50.4%
distribute-lft-out50.4%
+-commutative50.4%
Applied egg-rr50.4%
Taylor expanded in t around 0 15.4%
*-commutative15.4%
Simplified15.4%
if 3.19999999999999994e-198 < t < 5.19999999999999979e-166Initial program 2.7%
Simplified2.7%
Taylor expanded in l around 0 71.5%
+-commutative71.5%
sub-neg71.5%
metadata-eval71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in x around inf 71.6%
if 5.19999999999999979e-166 < t < 5.0000000000000001e94Initial program 53.3%
Simplified53.3%
Taylor expanded in l around 0 56.6%
fma-define56.6%
+-commutative56.6%
associate-*r/65.9%
sub-neg65.9%
metadata-eval65.9%
+-commutative65.9%
associate--l+72.3%
sub-neg72.3%
metadata-eval72.3%
+-commutative72.3%
sub-neg72.3%
metadata-eval72.3%
+-commutative72.3%
Simplified72.3%
Taylor expanded in x around inf 80.9%
associate-*r/80.9%
Simplified80.9%
associate-*r/80.9%
clear-num81.0%
fma-undefine81.0%
associate-/l*81.0%
distribute-lft-out81.0%
+-commutative81.0%
Applied egg-rr81.0%
associate-/r/81.0%
fma-define81.0%
+-commutative81.0%
Simplified81.0%
if 5.0000000000000001e94 < t Initial program 30.4%
Simplified30.2%
Taylor expanded in l around 0 92.9%
+-commutative92.9%
sub-neg92.9%
metadata-eval92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around 0 93.2%
Final simplification48.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= t_m 2.25e-206)
(/ (sqrt 2.0) (/ (* (* (sqrt 2.0) l_m) (sqrt (/ 1.0 x))) t_m))
(if (<= t_m 3.7e-167)
1.0
(if (<= t_m 3.5e+94)
(/
(sqrt 2.0)
(/
(sqrt
(*
2.0
(+
(/ (pow l_m 2.0) x)
(* (pow t_m 2.0) (/ (+ 1.0 x) (+ x -1.0))))))
t_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 <= 2.25e-206) {
tmp = sqrt(2.0) / (((sqrt(2.0) * l_m) * sqrt((1.0 / x))) / t_m);
} else if (t_m <= 3.7e-167) {
tmp = 1.0;
} else if (t_m <= 3.5e+94) {
tmp = sqrt(2.0) / (sqrt((2.0 * ((pow(l_m, 2.0) / x) + (pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0)))))) / t_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 <= 2.25d-206) then
tmp = sqrt(2.0d0) / (((sqrt(2.0d0) * l_m) * sqrt((1.0d0 / x))) / t_m)
else if (t_m <= 3.7d-167) then
tmp = 1.0d0
else if (t_m <= 3.5d+94) then
tmp = sqrt(2.0d0) / (sqrt((2.0d0 * (((l_m ** 2.0d0) / x) + ((t_m ** 2.0d0) * ((1.0d0 + x) / (x + (-1.0d0))))))) / t_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 <= 2.25e-206) {
tmp = Math.sqrt(2.0) / (((Math.sqrt(2.0) * l_m) * Math.sqrt((1.0 / x))) / t_m);
} else if (t_m <= 3.7e-167) {
tmp = 1.0;
} else if (t_m <= 3.5e+94) {
tmp = Math.sqrt(2.0) / (Math.sqrt((2.0 * ((Math.pow(l_m, 2.0) / x) + (Math.pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0)))))) / t_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 <= 2.25e-206: tmp = math.sqrt(2.0) / (((math.sqrt(2.0) * l_m) * math.sqrt((1.0 / x))) / t_m) elif t_m <= 3.7e-167: tmp = 1.0 elif t_m <= 3.5e+94: tmp = math.sqrt(2.0) / (math.sqrt((2.0 * ((math.pow(l_m, 2.0) / x) + (math.pow(t_m, 2.0) * ((1.0 + x) / (x + -1.0)))))) / t_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 <= 2.25e-206) tmp = Float64(sqrt(2.0) / Float64(Float64(Float64(sqrt(2.0) * l_m) * sqrt(Float64(1.0 / x))) / t_m)); elseif (t_m <= 3.7e-167) tmp = 1.0; elseif (t_m <= 3.5e+94) tmp = Float64(sqrt(2.0) / Float64(sqrt(Float64(2.0 * Float64(Float64((l_m ^ 2.0) / x) + Float64((t_m ^ 2.0) * Float64(Float64(1.0 + x) / Float64(x + -1.0)))))) / t_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 <= 2.25e-206) tmp = sqrt(2.0) / (((sqrt(2.0) * l_m) * sqrt((1.0 / x))) / t_m); elseif (t_m <= 3.7e-167) tmp = 1.0; elseif (t_m <= 3.5e+94) tmp = sqrt(2.0) / (sqrt((2.0 * (((l_m ^ 2.0) / x) + ((t_m ^ 2.0) * ((1.0 + x) / (x + -1.0)))))) / t_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, 2.25e-206], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(N[(N[Sqrt[2.0], $MachinePrecision] * l$95$m), $MachinePrecision] * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.7e-167], 1.0, If[LessEqual[t$95$m, 3.5e+94], N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[Sqrt[N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / x), $MachinePrecision] + N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$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 2.25 \cdot 10^{-206}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\left(\sqrt{2} \cdot l\_m\right) \cdot \sqrt{\frac{1}{x}}}{t\_m}}\\
\mathbf{elif}\;t\_m \leq 3.7 \cdot 10^{-167}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_m \leq 3.5 \cdot 10^{+94}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{\sqrt{2 \cdot \left(\frac{{l\_m}^{2}}{x} + {t\_m}^{2} \cdot \frac{1 + x}{x + -1}\right)}}{t\_m}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\end{array}
\end{array}
if t < 2.2499999999999999e-206Initial program 33.6%
Simplified33.5%
Taylor expanded in l around 0 25.9%
fma-define25.9%
+-commutative25.9%
associate-*r/35.1%
sub-neg35.1%
metadata-eval35.1%
+-commutative35.1%
associate--l+41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
sub-neg41.8%
metadata-eval41.8%
+-commutative41.8%
Simplified41.8%
Taylor expanded in x around inf 50.3%
associate-*r/50.3%
Simplified50.3%
clear-num50.4%
un-div-inv50.4%
fma-undefine50.4%
associate-/l*50.4%
distribute-lft-out50.4%
+-commutative50.4%
Applied egg-rr50.4%
Taylor expanded in t around 0 15.4%
*-commutative15.4%
Simplified15.4%
if 2.2499999999999999e-206 < t < 3.7000000000000003e-167Initial program 2.7%
Simplified2.7%
Taylor expanded in l around 0 71.5%
+-commutative71.5%
sub-neg71.5%
metadata-eval71.5%
+-commutative71.5%
Simplified71.5%
Taylor expanded in x around inf 71.6%
if 3.7000000000000003e-167 < t < 3.4999999999999997e94Initial program 53.3%
Simplified53.3%
Taylor expanded in l around 0 56.6%
fma-define56.6%
+-commutative56.6%
associate-*r/65.9%
sub-neg65.9%
metadata-eval65.9%
+-commutative65.9%
associate--l+72.3%
sub-neg72.3%
metadata-eval72.3%
+-commutative72.3%
sub-neg72.3%
metadata-eval72.3%
+-commutative72.3%
Simplified72.3%
Taylor expanded in x around inf 80.9%
associate-*r/80.9%
Simplified80.9%
clear-num81.0%
un-div-inv80.9%
fma-undefine80.9%
associate-/l*80.9%
distribute-lft-out80.9%
+-commutative80.9%
Applied egg-rr80.9%
if 3.4999999999999997e94 < t Initial program 30.4%
Simplified30.2%
Taylor expanded in l around 0 92.9%
+-commutative92.9%
sub-neg92.9%
metadata-eval92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in t around 0 93.2%
Final simplification48.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 3e+134)
(sqrt (/ (+ x -1.0) (+ 1.0 x)))
(if (<= l_m 1.26e+151)
(* (/ t_m l_m) (sqrt x))
(if (<= l_m 2.3e+226)
(+ 1.0 (/ -1.0 x))
(* (sqrt (- (* x 0.5) 0.5)) (* t_m (/ (sqrt 2.0) l_m))))))))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 (l_m <= 3e+134) {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
} else if (l_m <= 1.26e+151) {
tmp = (t_m / l_m) * sqrt(x);
} else if (l_m <= 2.3e+226) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = sqrt(((x * 0.5) - 0.5)) * (t_m * (sqrt(2.0) / l_m));
}
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 (l_m <= 3d+134) then
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
else if (l_m <= 1.26d+151) then
tmp = (t_m / l_m) * sqrt(x)
else if (l_m <= 2.3d+226) then
tmp = 1.0d0 + ((-1.0d0) / x)
else
tmp = sqrt(((x * 0.5d0) - 0.5d0)) * (t_m * (sqrt(2.0d0) / l_m))
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 (l_m <= 3e+134) {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
} else if (l_m <= 1.26e+151) {
tmp = (t_m / l_m) * Math.sqrt(x);
} else if (l_m <= 2.3e+226) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = Math.sqrt(((x * 0.5) - 0.5)) * (t_m * (Math.sqrt(2.0) / l_m));
}
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 l_m <= 3e+134: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) elif l_m <= 1.26e+151: tmp = (t_m / l_m) * math.sqrt(x) elif l_m <= 2.3e+226: tmp = 1.0 + (-1.0 / x) else: tmp = math.sqrt(((x * 0.5) - 0.5)) * (t_m * (math.sqrt(2.0) / l_m)) 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 (l_m <= 3e+134) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); elseif (l_m <= 1.26e+151) tmp = Float64(Float64(t_m / l_m) * sqrt(x)); elseif (l_m <= 2.3e+226) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(sqrt(Float64(Float64(x * 0.5) - 0.5)) * Float64(t_m * Float64(sqrt(2.0) / l_m))); 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 (l_m <= 3e+134) tmp = sqrt(((x + -1.0) / (1.0 + x))); elseif (l_m <= 1.26e+151) tmp = (t_m / l_m) * sqrt(x); elseif (l_m <= 2.3e+226) tmp = 1.0 + (-1.0 / x); else tmp = sqrt(((x * 0.5) - 0.5)) * (t_m * (sqrt(2.0) / l_m)); 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[l$95$m, 3e+134], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l$95$m, 1.26e+151], N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.3e+226], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(N[(x * 0.5), $MachinePrecision] - 0.5), $MachinePrecision]], $MachinePrecision] * N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / l$95$m), $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}\;l\_m \leq 3 \cdot 10^{+134}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{elif}\;l\_m \leq 1.26 \cdot 10^{+151}:\\
\;\;\;\;\frac{t\_m}{l\_m} \cdot \sqrt{x}\\
\mathbf{elif}\;l\_m \leq 2.3 \cdot 10^{+226}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 0.5 - 0.5} \cdot \left(t\_m \cdot \frac{\sqrt{2}}{l\_m}\right)\\
\end{array}
\end{array}
if l < 2.99999999999999997e134Initial program 41.2%
Simplified41.1%
Taylor expanded in l around 0 43.8%
+-commutative43.8%
sub-neg43.8%
metadata-eval43.8%
+-commutative43.8%
Simplified43.8%
Taylor expanded in t around 0 43.9%
if 2.99999999999999997e134 < l < 1.26000000000000006e151Initial program 2.6%
Simplified2.6%
Taylor expanded in l around 0 6.1%
fma-define6.1%
+-commutative6.1%
associate-*r/6.1%
sub-neg6.1%
metadata-eval6.1%
+-commutative6.1%
associate--l+20.4%
sub-neg20.4%
metadata-eval20.4%
+-commutative20.4%
sub-neg20.4%
metadata-eval20.4%
+-commutative20.4%
Simplified20.4%
Taylor expanded in x around inf 99.2%
associate-*r/99.2%
Simplified99.2%
clear-num98.8%
un-div-inv98.8%
fma-undefine98.8%
associate-/l*98.8%
distribute-lft-out98.8%
+-commutative98.8%
Applied egg-rr98.8%
Taylor expanded in t around 0 100.0%
if 1.26000000000000006e151 < l < 2.29999999999999995e226Initial program 0.0%
Simplified0.0%
Taylor expanded in l around 0 24.7%
+-commutative24.7%
sub-neg24.7%
metadata-eval24.7%
+-commutative24.7%
Simplified24.7%
Taylor expanded in x around inf 24.7%
if 2.29999999999999995e226 < l Initial program 0.0%
Simplified0.0%
Taylor expanded in l around inf 2.2%
*-commutative2.2%
associate--l+29.8%
sub-neg29.8%
metadata-eval29.8%
+-commutative29.8%
sub-neg29.8%
metadata-eval29.8%
+-commutative29.8%
associate-/l*29.8%
Simplified29.8%
Taylor expanded in x around 0 58.9%
Final simplification44.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= (* l_m l_m) 1e+267)
(sqrt (/ (+ x -1.0) (+ 1.0 x)))
(*
(sqrt 2.0)
(*
t_m
(* (sqrt (/ 1.0 (+ (/ 1.0 x) (/ 1.0 (+ x -1.0))))) (/ 1.0 l_m)))))))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 ((l_m * l_m) <= 1e+267) {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = sqrt(2.0) * (t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (1.0 / l_m)));
}
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 ((l_m * l_m) <= 1d+267) then
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
else
tmp = sqrt(2.0d0) * (t_m * (sqrt((1.0d0 / ((1.0d0 / x) + (1.0d0 / (x + (-1.0d0)))))) * (1.0d0 / l_m)))
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 ((l_m * l_m) <= 1e+267) {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
} else {
tmp = Math.sqrt(2.0) * (t_m * (Math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (1.0 / l_m)));
}
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 (l_m * l_m) <= 1e+267: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) else: tmp = math.sqrt(2.0) * (t_m * (math.sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (1.0 / l_m))) 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 (Float64(l_m * l_m) <= 1e+267) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); else tmp = Float64(sqrt(2.0) * Float64(t_m * Float64(sqrt(Float64(1.0 / Float64(Float64(1.0 / x) + Float64(1.0 / Float64(x + -1.0))))) * Float64(1.0 / l_m)))); 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 ((l_m * l_m) <= 1e+267) tmp = sqrt(((x + -1.0) / (1.0 + x))); else tmp = sqrt(2.0) * (t_m * (sqrt((1.0 / ((1.0 / x) + (1.0 / (x + -1.0))))) * (1.0 / l_m))); 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[N[(l$95$m * l$95$m), $MachinePrecision], 1e+267], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(t$95$m * N[(N[Sqrt[N[(1.0 / N[(N[(1.0 / x), $MachinePrecision] + N[(1.0 / N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / l$95$m), $MachinePrecision]), $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}\;l\_m \cdot l\_m \leq 10^{+267}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(t\_m \cdot \left(\sqrt{\frac{1}{\frac{1}{x} + \frac{1}{x + -1}}} \cdot \frac{1}{l\_m}\right)\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 9.9999999999999997e266Initial program 47.6%
Simplified47.5%
Taylor expanded in l around 0 48.8%
+-commutative48.8%
sub-neg48.8%
metadata-eval48.8%
+-commutative48.8%
Simplified48.8%
Taylor expanded in t around 0 48.9%
if 9.9999999999999997e266 < (*.f64 l l) Initial program 0.2%
Simplified0.2%
Taylor expanded in t around 0 0.3%
Taylor expanded in l around 0 2.0%
*-commutative2.0%
associate--l+19.6%
sub-neg19.6%
metadata-eval19.6%
sub-neg19.6%
metadata-eval19.6%
Simplified19.6%
Taylor expanded in x around inf 35.7%
Final simplification45.6%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (or (<= l_m 3e+134) (and (not (<= l_m 2.3e+151)) (<= l_m 2e+226)))
(+ 1.0 (/ -1.0 x))
(* (/ t_m l_m) (sqrt 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 ((l_m <= 3e+134) || (!(l_m <= 2.3e+151) && (l_m <= 2e+226))) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = (t_m / l_m) * sqrt(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 ((l_m <= 3d+134) .or. (.not. (l_m <= 2.3d+151)) .and. (l_m <= 2d+226)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else
tmp = (t_m / l_m) * sqrt(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 ((l_m <= 3e+134) || (!(l_m <= 2.3e+151) && (l_m <= 2e+226))) {
tmp = 1.0 + (-1.0 / x);
} else {
tmp = (t_m / l_m) * Math.sqrt(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 (l_m <= 3e+134) or (not (l_m <= 2.3e+151) and (l_m <= 2e+226)): tmp = 1.0 + (-1.0 / x) else: tmp = (t_m / l_m) * math.sqrt(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 ((l_m <= 3e+134) || (!(l_m <= 2.3e+151) && (l_m <= 2e+226))) tmp = Float64(1.0 + Float64(-1.0 / x)); else tmp = Float64(Float64(t_m / l_m) * sqrt(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 ((l_m <= 3e+134) || (~((l_m <= 2.3e+151)) && (l_m <= 2e+226))) tmp = 1.0 + (-1.0 / x); else tmp = (t_m / l_m) * sqrt(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[Or[LessEqual[l$95$m, 3e+134], And[N[Not[LessEqual[l$95$m, 2.3e+151]], $MachinePrecision], LessEqual[l$95$m, 2e+226]]], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[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}\;l\_m \leq 3 \cdot 10^{+134} \lor \neg \left(l\_m \leq 2.3 \cdot 10^{+151}\right) \land l\_m \leq 2 \cdot 10^{+226}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_m}{l\_m} \cdot \sqrt{x}\\
\end{array}
\end{array}
if l < 2.99999999999999997e134 or 2.3000000000000001e151 < l < 1.99999999999999992e226Initial program 38.9%
Simplified38.8%
Taylor expanded in l around 0 42.7%
+-commutative42.7%
sub-neg42.7%
metadata-eval42.7%
+-commutative42.7%
Simplified42.7%
Taylor expanded in x around inf 42.8%
if 2.99999999999999997e134 < l < 2.3000000000000001e151 or 1.99999999999999992e226 < l Initial program 0.2%
Simplified0.2%
Taylor expanded in l around 0 0.6%
fma-define0.6%
+-commutative0.6%
associate-*r/0.6%
sub-neg0.6%
metadata-eval0.6%
+-commutative0.6%
associate--l+22.3%
sub-neg22.3%
metadata-eval22.3%
+-commutative22.3%
sub-neg22.3%
metadata-eval22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in x around inf 29.5%
associate-*r/29.5%
Simplified29.5%
clear-num29.4%
un-div-inv29.4%
fma-undefine29.4%
associate-/l*29.4%
distribute-lft-out29.4%
+-commutative29.4%
Applied egg-rr29.4%
Taylor expanded in t around 0 62.9%
Final simplification44.5%
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s x l_m t_m)
:precision binary64
(*
t_s
(if (<= l_m 3e+134)
(sqrt (/ (+ x -1.0) (+ 1.0 x)))
(if (or (<= l_m 7.6e+152) (not (<= l_m 2.3e+226)))
(* (/ 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 (l_m <= 3e+134) {
tmp = sqrt(((x + -1.0) / (1.0 + x)));
} else if ((l_m <= 7.6e+152) || !(l_m <= 2.3e+226)) {
tmp = (t_m / l_m) * sqrt(x);
} else {
tmp = 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 (l_m <= 3d+134) then
tmp = sqrt(((x + (-1.0d0)) / (1.0d0 + x)))
else if ((l_m <= 7.6d+152) .or. (.not. (l_m <= 2.3d+226))) then
tmp = (t_m / l_m) * sqrt(x)
else
tmp = 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 (l_m <= 3e+134) {
tmp = Math.sqrt(((x + -1.0) / (1.0 + x)));
} else if ((l_m <= 7.6e+152) || !(l_m <= 2.3e+226)) {
tmp = (t_m / l_m) * Math.sqrt(x);
} else {
tmp = 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 l_m <= 3e+134: tmp = math.sqrt(((x + -1.0) / (1.0 + x))) elif (l_m <= 7.6e+152) or not (l_m <= 2.3e+226): tmp = (t_m / l_m) * math.sqrt(x) else: tmp = 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 (l_m <= 3e+134) tmp = sqrt(Float64(Float64(x + -1.0) / Float64(1.0 + x))); elseif ((l_m <= 7.6e+152) || !(l_m <= 2.3e+226)) tmp = Float64(Float64(t_m / l_m) * sqrt(x)); else tmp = Float64(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 (l_m <= 3e+134) tmp = sqrt(((x + -1.0) / (1.0 + x))); elseif ((l_m <= 7.6e+152) || ~((l_m <= 2.3e+226))) tmp = (t_m / l_m) * sqrt(x); else tmp = 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[l$95$m, 3e+134], N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[l$95$m, 7.6e+152], N[Not[LessEqual[l$95$m, 2.3e+226]], $MachinePrecision]], N[(N[(t$95$m / l$95$m), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 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 \begin{array}{l}
\mathbf{if}\;l\_m \leq 3 \cdot 10^{+134}:\\
\;\;\;\;\sqrt{\frac{x + -1}{1 + x}}\\
\mathbf{elif}\;l\_m \leq 7.6 \cdot 10^{+152} \lor \neg \left(l\_m \leq 2.3 \cdot 10^{+226}\right):\\
\;\;\;\;\frac{t\_m}{l\_m} \cdot \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{-1}{x}\\
\end{array}
\end{array}
if l < 2.99999999999999997e134Initial program 41.2%
Simplified41.1%
Taylor expanded in l around 0 43.8%
+-commutative43.8%
sub-neg43.8%
metadata-eval43.8%
+-commutative43.8%
Simplified43.8%
Taylor expanded in t around 0 43.9%
if 2.99999999999999997e134 < l < 7.6000000000000001e152 or 2.29999999999999995e226 < l Initial program 0.2%
Simplified0.2%
Taylor expanded in l around 0 0.6%
fma-define0.6%
+-commutative0.6%
associate-*r/0.6%
sub-neg0.6%
metadata-eval0.6%
+-commutative0.6%
associate--l+22.3%
sub-neg22.3%
metadata-eval22.3%
+-commutative22.3%
sub-neg22.3%
metadata-eval22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in x around inf 29.5%
associate-*r/29.5%
Simplified29.5%
clear-num29.4%
un-div-inv29.4%
fma-undefine29.4%
associate-/l*29.4%
distribute-lft-out29.4%
+-commutative29.4%
Applied egg-rr29.4%
Taylor expanded in t around 0 62.9%
if 7.6000000000000001e152 < l < 2.29999999999999995e226Initial program 0.0%
Simplified0.0%
Taylor expanded in l around 0 24.7%
+-commutative24.7%
sub-neg24.7%
metadata-eval24.7%
+-commutative24.7%
Simplified24.7%
Taylor expanded in x around inf 24.7%
Final simplification44.5%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 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 35.6%
Simplified35.5%
Taylor expanded in l around 0 39.7%
+-commutative39.7%
sub-neg39.7%
metadata-eval39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 39.8%
Final simplification39.8%
l_m = (fabs.f64 l) t_m = (fabs.f64 t) t_s = (copysign.f64 1 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 35.6%
Simplified35.5%
Taylor expanded in l around 0 39.7%
+-commutative39.7%
sub-neg39.7%
metadata-eval39.7%
+-commutative39.7%
Simplified39.7%
Taylor expanded in x around inf 39.5%
Final simplification39.5%
herbie shell --seed 2024043
(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)))))