Toniolo and Linder, Equation (10-)

Percentage Accurate: 34.5% → 80.9%
Time: 23.4s
Alternatives: 11
Speedup: 2.0×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 34.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}

Alternative 1: 80.9% accurate, 0.8× speedup?

\[\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 := \frac{l_m}{\sin k}\\ t_3 := \frac{\cos k}{t_m}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;l_m \leq 3.8 \cdot 10^{-169}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{elif}\;l_m \leq 2.7 \cdot 10^{+222}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({t_2}^{2} \cdot t_3\right)\\ \mathbf{elif}\;l_m \leq 5.5 \cdot 10^{+240}:\\ \;\;\;\;{\left(\sqrt{t_3} \cdot \left(t_2 \cdot \frac{\sqrt{2}}{k}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t_m}^{1.5}}{l_m}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (/ l_m (sin k))) (t_3 (/ (cos k) t_m)))
   (*
    t_s
    (if (<= l_m 3.8e-169)
      (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
      (if (<= l_m 2.7e+222)
        (* (* 2.0 (pow k -2.0)) (* (pow t_2 2.0) t_3))
        (if (<= l_m 5.5e+240)
          (pow (* (sqrt t_3) (* t_2 (/ (sqrt 2.0) k))) 2.0)
          (/
           2.0
           (*
            (* (* (sin k) (pow (/ (pow t_m 1.5) l_m) 2.0)) (tan k))
            (* (/ k t_m) (/ k t_m))))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = l_m / sin(k);
	double t_3 = cos(k) / t_m;
	double tmp;
	if (l_m <= 3.8e-169) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else if (l_m <= 2.7e+222) {
		tmp = (2.0 * pow(k, -2.0)) * (pow(t_2, 2.0) * t_3);
	} else if (l_m <= 5.5e+240) {
		tmp = pow((sqrt(t_3) * (t_2 * (sqrt(2.0) / k))), 2.0);
	} else {
		tmp = 2.0 / (((sin(k) * pow((pow(t_m, 1.5) / l_m), 2.0)) * tan(k)) * ((k / t_m) * (k / t_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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = l_m / sin(k)
    t_3 = cos(k) / t_m
    if (l_m <= 3.8d-169) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else if (l_m <= 2.7d+222) then
        tmp = (2.0d0 * (k ** (-2.0d0))) * ((t_2 ** 2.0d0) * t_3)
    else if (l_m <= 5.5d+240) then
        tmp = (sqrt(t_3) * (t_2 * (sqrt(2.0d0) / k))) ** 2.0d0
    else
        tmp = 2.0d0 / (((sin(k) * (((t_m ** 1.5d0) / l_m) ** 2.0d0)) * tan(k)) * ((k / t_m) * (k / t_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 t_m, double l_m, double k) {
	double t_2 = l_m / Math.sin(k);
	double t_3 = Math.cos(k) / t_m;
	double tmp;
	if (l_m <= 3.8e-169) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else if (l_m <= 2.7e+222) {
		tmp = (2.0 * Math.pow(k, -2.0)) * (Math.pow(t_2, 2.0) * t_3);
	} else if (l_m <= 5.5e+240) {
		tmp = Math.pow((Math.sqrt(t_3) * (t_2 * (Math.sqrt(2.0) / k))), 2.0);
	} else {
		tmp = 2.0 / (((Math.sin(k) * Math.pow((Math.pow(t_m, 1.5) / l_m), 2.0)) * Math.tan(k)) * ((k / t_m) * (k / t_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, t_m, l_m, k):
	t_2 = l_m / math.sin(k)
	t_3 = math.cos(k) / t_m
	tmp = 0
	if l_m <= 3.8e-169:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	elif l_m <= 2.7e+222:
		tmp = (2.0 * math.pow(k, -2.0)) * (math.pow(t_2, 2.0) * t_3)
	elif l_m <= 5.5e+240:
		tmp = math.pow((math.sqrt(t_3) * (t_2 * (math.sqrt(2.0) / k))), 2.0)
	else:
		tmp = 2.0 / (((math.sin(k) * math.pow((math.pow(t_m, 1.5) / l_m), 2.0)) * math.tan(k)) * ((k / t_m) * (k / t_m)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = Float64(l_m / sin(k))
	t_3 = Float64(cos(k) / t_m)
	tmp = 0.0
	if (l_m <= 3.8e-169)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	elseif (l_m <= 2.7e+222)
		tmp = Float64(Float64(2.0 * (k ^ -2.0)) * Float64((t_2 ^ 2.0) * t_3));
	elseif (l_m <= 5.5e+240)
		tmp = Float64(sqrt(t_3) * Float64(t_2 * Float64(sqrt(2.0) / k))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * (Float64((t_m ^ 1.5) / l_m) ^ 2.0)) * tan(k)) * Float64(Float64(k / t_m) * Float64(k / t_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, t_m, l_m, k)
	t_2 = l_m / sin(k);
	t_3 = cos(k) / t_m;
	tmp = 0.0;
	if (l_m <= 3.8e-169)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	elseif (l_m <= 2.7e+222)
		tmp = (2.0 * (k ^ -2.0)) * ((t_2 ^ 2.0) * t_3);
	elseif (l_m <= 5.5e+240)
		tmp = (sqrt(t_3) * (t_2 * (sqrt(2.0) / k))) ^ 2.0;
	else
		tmp = 2.0 / (((sin(k) * (((t_m ^ 1.5) / l_m) ^ 2.0)) * tan(k)) * ((k / t_m) * (k / t_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_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[(l$95$m / N[Sin[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 3.8e-169], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.7e+222], N[(N[(2.0 * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[t$95$2, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 5.5e+240], N[Power[N[(N[Sqrt[t$95$3], $MachinePrecision] * N[(t$95$2 * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$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)

\\
\begin{array}{l}
t_2 := \frac{l_m}{\sin k}\\
t_3 := \frac{\cos k}{t_m}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;l_m \leq 3.8 \cdot 10^{-169}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{elif}\;l_m \leq 2.7 \cdot 10^{+222}:\\
\;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({t_2}^{2} \cdot t_3\right)\\

\mathbf{elif}\;l_m \leq 5.5 \cdot 10^{+240}:\\
\;\;\;\;{\left(\sqrt{t_3} \cdot \left(t_2 \cdot \frac{\sqrt{2}}{k}\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t_m}^{1.5}}{l_m}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < 3.8e-169

    1. Initial program 29.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow236.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified36.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 56.2%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt38.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow238.8%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div24.8%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow224.8%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod4.9%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt28.2%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod28.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow131.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval31.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr31.1%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 3.8e-169 < l < 2.70000000000000013e222

    1. Initial program 28.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*28.8%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative28.8%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*28.8%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/31.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative31.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow231.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg31.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg31.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg31.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow231.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+45.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval45.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity45.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow245.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg45.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg45.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified45.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around inf 80.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/80.4%

        \[\leadsto \color{blue}{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. times-frac81.2%

        \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}} \]
      3. associate-/l*81.2%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\frac{{\ell}^{2}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
      4. *-commutative81.2%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{\color{blue}{{\sin k}^{2} \cdot t}}{\cos k}} \]
      5. associate-/l*81.2%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\color{blue}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    6. Simplified81.2%

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    7. Step-by-step derivation
      1. associate-/r/81.6%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    8. Applied egg-rr81.6%

      \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    9. Step-by-step derivation
      1. expm1-log1p-u43.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)\right)} \]
      2. expm1-udef31.3%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)} - 1} \]
    10. Applied egg-rr33.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def41.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)\right)} \]
      2. expm1-log1p80.5%

        \[\leadsto \color{blue}{\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}} \]
      3. associate-*l*84.1%

        \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]
    12. Simplified84.1%

      \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]

    if 2.70000000000000013e222 < l < 5.5e240

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*50.0%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative50.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*50.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow250.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow250.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow250.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg50.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified50.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around inf 50.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/50.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. times-frac50.8%

        \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}} \]
      3. associate-/l*50.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\frac{{\ell}^{2}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
      4. *-commutative50.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{\color{blue}{{\sin k}^{2} \cdot t}}{\cos k}} \]
      5. associate-/l*50.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\color{blue}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    6. Simplified50.8%

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    7. Step-by-step derivation
      1. associate-/r/50.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    8. Applied egg-rr50.8%

      \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \color{blue}{\sqrt{\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \cdot \sqrt{\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)}} \]
      2. pow20.0%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)}\right)}^{2}} \]
    10. Applied egg-rr25.0%

      \[\leadsto \color{blue}{{\left(\left(\frac{\ell}{\sin k} \cdot \sqrt{\frac{\cos k}{t}}\right) \cdot \frac{\sqrt{2}}{k}\right)}^{2}} \]
    11. Step-by-step derivation
      1. *-commutative25.0%

        \[\leadsto {\left(\color{blue}{\left(\sqrt{\frac{\cos k}{t}} \cdot \frac{\ell}{\sin k}\right)} \cdot \frac{\sqrt{2}}{k}\right)}^{2} \]
      2. associate-*l*25.0%

        \[\leadsto {\color{blue}{\left(\sqrt{\frac{\cos k}{t}} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2}}{k}\right)\right)}}^{2} \]
    12. Simplified25.0%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{\cos k}{t}} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2}}{k}\right)\right)}^{2}} \]

    if 5.5e240 < l

    1. Initial program 60.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative60.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+60.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval60.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity60.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow260.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg60.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times30.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr30.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}} \cdot \sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. pow20.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. sqrt-div0.0%

        \[\leadsto \frac{2}{\left(\left({\color{blue}{\left(\frac{\sqrt{{t}^{3}}}{\sqrt{\ell \cdot \ell}}\right)}}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      4. sqrt-pow10.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      5. metadata-eval0.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{\color{blue}{1.5}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      6. sqrt-prod0.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      7. add-sqr-sqrt0.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr0.0%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac10.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{-k}{-t} \cdot \frac{k}{t}\right)}} \]
      2. frac-2neg10.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{k}{t}} \cdot \frac{k}{t}\right)} \]
    7. Applied egg-rr10.0%

      \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification46.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 3.8 \cdot 10^{-169}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{elif}\;\ell \leq 2.7 \cdot 10^{+222}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+240}:\\ \;\;\;\;{\left(\sqrt{\frac{\cos k}{t}} \cdot \left(\frac{\ell}{\sin k} \cdot \frac{\sqrt{2}}{k}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t} \cdot \frac{k}{t}\right)}\\ \end{array} \]

Alternative 2: 80.4% accurate, 1.0× speedup?

\[\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 2.55 \cdot 10^{-169}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{elif}\;l_m \leq 2.4 \cdot 10^{+229}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t_m}^{1.5}}{l_m}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= l_m 2.55e-169)
    (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
    (if (<= l_m 2.4e+229)
      (* (* 2.0 (pow k -2.0)) (* (pow (/ l_m (sin k)) 2.0) (/ (cos k) t_m)))
      (/
       2.0
       (*
        (* (* (sin k) (pow (/ (pow t_m 1.5) l_m) 2.0)) (tan k))
        (* (/ k t_m) (/ k t_m))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 2.55e-169) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else if (l_m <= 2.4e+229) {
		tmp = (2.0 * pow(k, -2.0)) * (pow((l_m / sin(k)), 2.0) * (cos(k) / t_m));
	} else {
		tmp = 2.0 / (((sin(k) * pow((pow(t_m, 1.5) / l_m), 2.0)) * tan(k)) * ((k / t_m) * (k / t_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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l_m <= 2.55d-169) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else if (l_m <= 2.4d+229) then
        tmp = (2.0d0 * (k ** (-2.0d0))) * (((l_m / sin(k)) ** 2.0d0) * (cos(k) / t_m))
    else
        tmp = 2.0d0 / (((sin(k) * (((t_m ** 1.5d0) / l_m) ** 2.0d0)) * tan(k)) * ((k / t_m) * (k / t_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 t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 2.55e-169) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else if (l_m <= 2.4e+229) {
		tmp = (2.0 * Math.pow(k, -2.0)) * (Math.pow((l_m / Math.sin(k)), 2.0) * (Math.cos(k) / t_m));
	} else {
		tmp = 2.0 / (((Math.sin(k) * Math.pow((Math.pow(t_m, 1.5) / l_m), 2.0)) * Math.tan(k)) * ((k / t_m) * (k / t_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, t_m, l_m, k):
	tmp = 0
	if l_m <= 2.55e-169:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	elif l_m <= 2.4e+229:
		tmp = (2.0 * math.pow(k, -2.0)) * (math.pow((l_m / math.sin(k)), 2.0) * (math.cos(k) / t_m))
	else:
		tmp = 2.0 / (((math.sin(k) * math.pow((math.pow(t_m, 1.5) / l_m), 2.0)) * math.tan(k)) * ((k / t_m) * (k / t_m)))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (l_m <= 2.55e-169)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	elseif (l_m <= 2.4e+229)
		tmp = Float64(Float64(2.0 * (k ^ -2.0)) * Float64((Float64(l_m / sin(k)) ^ 2.0) * Float64(cos(k) / t_m)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * (Float64((t_m ^ 1.5) / l_m) ^ 2.0)) * tan(k)) * Float64(Float64(k / t_m) * Float64(k / t_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, t_m, l_m, k)
	tmp = 0.0;
	if (l_m <= 2.55e-169)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	elseif (l_m <= 2.4e+229)
		tmp = (2.0 * (k ^ -2.0)) * (((l_m / sin(k)) ^ 2.0) * (cos(k) / t_m));
	else
		tmp = 2.0 / (((sin(k) * (((t_m ^ 1.5) / l_m) ^ 2.0)) * tan(k)) * ((k / t_m) * (k / t_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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[l$95$m, 2.55e-169], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.4e+229], N[(N[(2.0 * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(l$95$m / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$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 \leq 2.55 \cdot 10^{-169}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{elif}\;l_m \leq 2.4 \cdot 10^{+229}:\\
\;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t_m}^{1.5}}{l_m}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.54999999999999999e-169

    1. Initial program 29.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow236.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified36.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 56.2%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt38.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow238.8%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div24.8%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow224.8%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod4.9%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt28.2%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod28.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow131.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval31.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr31.1%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 2.54999999999999999e-169 < l < 2.4000000000000001e229

    1. Initial program 29.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.3%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/32.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative32.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow232.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg32.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg32.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg32.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow232.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+45.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval45.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity45.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow245.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg45.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg45.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified45.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around inf 79.7%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/79.7%

        \[\leadsto \color{blue}{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. times-frac80.5%

        \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}} \]
      3. associate-/l*80.5%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\frac{{\ell}^{2}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
      4. *-commutative80.5%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{\color{blue}{{\sin k}^{2} \cdot t}}{\cos k}} \]
      5. associate-/l*80.5%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\color{blue}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    6. Simplified80.5%

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    7. Step-by-step derivation
      1. associate-/r/80.9%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    8. Applied egg-rr80.9%

      \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    9. Step-by-step derivation
      1. expm1-log1p-u42.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)\right)} \]
      2. expm1-udef30.6%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)} - 1} \]
    10. Applied egg-rr32.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def40.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)\right)} \]
      2. expm1-log1p79.8%

        \[\leadsto \color{blue}{\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}} \]
      3. associate-*l*83.3%

        \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]
    12. Simplified83.3%

      \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]

    if 2.4000000000000001e229 < l

    1. Initial program 58.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative58.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+58.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval58.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity58.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow258.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg58.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times25.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr25.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}} \cdot \sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. pow20.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. sqrt-div0.0%

        \[\leadsto \frac{2}{\left(\left({\color{blue}{\left(\frac{\sqrt{{t}^{3}}}{\sqrt{\ell \cdot \ell}}\right)}}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      4. sqrt-pow10.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      5. metadata-eval0.0%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{\color{blue}{1.5}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      6. sqrt-prod0.3%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      7. add-sqr-sqrt0.3%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr0.3%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac8.6%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{-k}{-t} \cdot \frac{k}{t}\right)}} \]
      2. frac-2neg8.6%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{k}{t}} \cdot \frac{k}{t}\right)} \]
    7. Applied egg-rr8.6%

      \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification46.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.55 \cdot 10^{-169}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{elif}\;\ell \leq 2.4 \cdot 10^{+229}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \tan k\right) \cdot \left(\frac{k}{t} \cdot \frac{k}{t}\right)}\\ \end{array} \]

Alternative 3: 79.2% accurate, 1.0× speedup?

\[\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 2.4 \cdot 10^{-161}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{elif}\;l_m \leq 1.72 \cdot 10^{+208}:\\ \;\;\;\;2 \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{{k}^{2} \cdot t_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= l_m 2.4e-161)
    (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
    (if (<= l_m 1.72e+208)
      (* 2.0 (* (pow (/ l_m (sin k)) 2.0) (/ (cos k) (* (pow k 2.0) t_m))))
      (/
       2.0
       (*
        (* (/ k t_m) (/ k t_m))
        (* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l_m) (/ t_m l_m))))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 2.4e-161) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else if (l_m <= 1.72e+208) {
		tmp = 2.0 * (pow((l_m / sin(k)), 2.0) * (cos(k) / (pow(k, 2.0) * t_m)));
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l_m <= 2.4d-161) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else if (l_m <= 1.72d+208) then
        tmp = 2.0d0 * (((l_m / sin(k)) ** 2.0d0) * (cos(k) / ((k ** 2.0d0) * t_m)))
    else
        tmp = 2.0d0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l_m) * (t_m / 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 t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 2.4e-161) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else if (l_m <= 1.72e+208) {
		tmp = 2.0 * (Math.pow((l_m / Math.sin(k)), 2.0) * (Math.cos(k) / (Math.pow(k, 2.0) * t_m)));
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k):
	tmp = 0
	if l_m <= 2.4e-161:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	elif l_m <= 1.72e+208:
		tmp = 2.0 * (math.pow((l_m / math.sin(k)), 2.0) * (math.cos(k) / (math.pow(k, 2.0) * t_m)))
	else:
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (l_m <= 2.4e-161)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	elseif (l_m <= 1.72e+208)
		tmp = Float64(2.0 * Float64((Float64(l_m / sin(k)) ^ 2.0) * Float64(cos(k) / Float64((k ^ 2.0) * t_m))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k / t_m) * Float64(k / t_m)) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l_m) * Float64(t_m / 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, t_m, l_m, k)
	tmp = 0.0;
	if (l_m <= 2.4e-161)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	elseif (l_m <= 1.72e+208)
		tmp = 2.0 * (((l_m / sin(k)) ^ 2.0) * (cos(k) / ((k ^ 2.0) * t_m)));
	else
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l_m) * (t_m / 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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[l$95$m, 2.4e-161], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 1.72e+208], N[(2.0 * N[(N[Power[N[(l$95$m / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $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 \leq 2.4 \cdot 10^{-161}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{elif}\;l_m \leq 1.72 \cdot 10^{+208}:\\
\;\;\;\;2 \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{{k}^{2} \cdot t_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 2.39999999999999999e-161

    1. Initial program 29.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.3%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow229.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow229.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow236.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified36.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 55.7%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt38.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow238.7%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div25.0%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow225.0%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod5.4%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt28.3%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod29.4%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow131.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval31.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr31.7%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 2.39999999999999999e-161 < l < 1.7199999999999999e208

    1. Initial program 29.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.0%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/32.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative32.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow232.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg32.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg32.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg32.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow232.2%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+46.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval46.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity46.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow246.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg46.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg46.7%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified46.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around inf 82.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/82.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. times-frac82.8%

        \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}} \]
      3. associate-/l*82.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\frac{{\ell}^{2}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
      4. *-commutative82.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{\color{blue}{{\sin k}^{2} \cdot t}}{\cos k}} \]
      5. associate-/l*82.9%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\color{blue}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    6. Simplified82.9%

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    7. Step-by-step derivation
      1. associate-/r/83.3%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    8. Applied egg-rr83.3%

      \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    9. Taylor expanded in k around inf 82.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    10. Step-by-step derivation
      1. *-commutative82.0%

        \[\leadsto 2 \cdot \frac{\color{blue}{\cos k \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      2. associate-*r*82.0%

        \[\leadsto 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}} \]
      3. times-frac82.0%

        \[\leadsto 2 \cdot \color{blue}{\left(\frac{\cos k}{{k}^{2} \cdot t} \cdot \frac{{\ell}^{2}}{{\sin k}^{2}}\right)} \]
      4. *-commutative82.0%

        \[\leadsto 2 \cdot \left(\frac{\cos k}{\color{blue}{t \cdot {k}^{2}}} \cdot \frac{{\ell}^{2}}{{\sin k}^{2}}\right) \]
      5. unpow282.0%

        \[\leadsto 2 \cdot \left(\frac{\cos k}{t \cdot {k}^{2}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{{\sin k}^{2}}\right) \]
      6. unpow282.0%

        \[\leadsto 2 \cdot \left(\frac{\cos k}{t \cdot {k}^{2}} \cdot \frac{\ell \cdot \ell}{\color{blue}{\sin k \cdot \sin k}}\right) \]
      7. times-frac82.1%

        \[\leadsto 2 \cdot \left(\frac{\cos k}{t \cdot {k}^{2}} \cdot \color{blue}{\left(\frac{\ell}{\sin k} \cdot \frac{\ell}{\sin k}\right)}\right) \]
      8. unpow282.1%

        \[\leadsto 2 \cdot \left(\frac{\cos k}{t \cdot {k}^{2}} \cdot \color{blue}{{\left(\frac{\ell}{\sin k}\right)}^{2}}\right) \]
    11. Simplified82.1%

      \[\leadsto \color{blue}{2 \cdot \left(\frac{\cos k}{t \cdot {k}^{2}} \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right)} \]

    if 1.7199999999999999e208 < l

    1. Initial program 53.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow253.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times20.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr20.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. unpow320.0%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. times-frac40.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. pow240.0%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{\color{blue}{{t}^{2}}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr40.0%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac6.9%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{-k}{-t} \cdot \frac{k}{t}\right)}} \]
      2. frac-2neg6.9%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{k}{t}} \cdot \frac{k}{t}\right)} \]
    7. Applied egg-rr73.6%

      \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2.4 \cdot 10^{-161}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{elif}\;\ell \leq 1.72 \cdot 10^{+208}:\\ \;\;\;\;2 \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{{k}^{2} \cdot t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t} \cdot \frac{k}{t}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)\right)}\\ \end{array} \]

Alternative 4: 79.2% accurate, 1.0× speedup?

\[\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 6.3 \cdot 10^{-161}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{elif}\;l_m \leq 1.3 \cdot 10^{+208}:\\ \;\;\;\;2 \cdot \frac{{\left(\frac{l_m}{\sin k}\right)}^{2}}{\frac{{k}^{2}}{\frac{\cos k}{t_m}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= l_m 6.3e-161)
    (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
    (if (<= l_m 1.3e+208)
      (* 2.0 (/ (pow (/ l_m (sin k)) 2.0) (/ (pow k 2.0) (/ (cos k) t_m))))
      (/
       2.0
       (*
        (* (/ k t_m) (/ k t_m))
        (* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l_m) (/ t_m l_m))))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 6.3e-161) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else if (l_m <= 1.3e+208) {
		tmp = 2.0 * (pow((l_m / sin(k)), 2.0) / (pow(k, 2.0) / (cos(k) / t_m)));
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l_m <= 6.3d-161) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else if (l_m <= 1.3d+208) then
        tmp = 2.0d0 * (((l_m / sin(k)) ** 2.0d0) / ((k ** 2.0d0) / (cos(k) / t_m)))
    else
        tmp = 2.0d0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l_m) * (t_m / 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 t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 6.3e-161) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else if (l_m <= 1.3e+208) {
		tmp = 2.0 * (Math.pow((l_m / Math.sin(k)), 2.0) / (Math.pow(k, 2.0) / (Math.cos(k) / t_m)));
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k):
	tmp = 0
	if l_m <= 6.3e-161:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	elif l_m <= 1.3e+208:
		tmp = 2.0 * (math.pow((l_m / math.sin(k)), 2.0) / (math.pow(k, 2.0) / (math.cos(k) / t_m)))
	else:
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (l_m <= 6.3e-161)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	elseif (l_m <= 1.3e+208)
		tmp = Float64(2.0 * Float64((Float64(l_m / sin(k)) ^ 2.0) / Float64((k ^ 2.0) / Float64(cos(k) / t_m))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k / t_m) * Float64(k / t_m)) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l_m) * Float64(t_m / 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, t_m, l_m, k)
	tmp = 0.0;
	if (l_m <= 6.3e-161)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	elseif (l_m <= 1.3e+208)
		tmp = 2.0 * (((l_m / sin(k)) ^ 2.0) / ((k ^ 2.0) / (cos(k) / t_m)));
	else
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l_m) * (t_m / 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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[l$95$m, 6.3e-161], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 1.3e+208], N[(2.0 * N[(N[Power[N[(l$95$m / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $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 \leq 6.3 \cdot 10^{-161}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{elif}\;l_m \leq 1.3 \cdot 10^{+208}:\\
\;\;\;\;2 \cdot \frac{{\left(\frac{l_m}{\sin k}\right)}^{2}}{\frac{{k}^{2}}{\frac{\cos k}{t_m}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 6.3000000000000001e-161

    1. Initial program 29.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.3%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.3%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow229.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg29.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow229.9%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow236.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified36.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 55.7%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt38.7%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow238.7%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div25.0%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow225.0%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod5.4%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt28.3%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod29.4%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow131.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval31.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr31.7%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 6.3000000000000001e-161 < l < 1.3e208

    1. Initial program 29.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative29.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+42.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval42.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity42.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow242.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg42.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times26.2%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr26.2%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt10.3%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}} \cdot \sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. pow210.3%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. sqrt-div10.2%

        \[\leadsto \frac{2}{\left(\left({\color{blue}{\left(\frac{\sqrt{{t}^{3}}}{\sqrt{\ell \cdot \ell}}\right)}}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      4. sqrt-pow110.7%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      5. metadata-eval10.7%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{\color{blue}{1.5}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      6. sqrt-prod12.8%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      7. add-sqr-sqrt12.8%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\color{blue}{\ell}}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr12.8%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Taylor expanded in t around 0 82.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
    7. Step-by-step derivation
      1. associate-/l*82.9%

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{\frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}}}} \]
      2. unpow282.9%

        \[\leadsto \frac{2}{\frac{\color{blue}{k \cdot k}}{\frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}}} \]
      3. *-commutative82.9%

        \[\leadsto \frac{2}{\frac{k \cdot k}{\frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{\sin k}^{2} \cdot t}}}} \]
      4. times-frac83.3%

        \[\leadsto \frac{2}{\frac{k \cdot k}{\color{blue}{\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}}}} \]
      5. times-frac85.8%

        \[\leadsto \frac{2}{\color{blue}{\frac{k}{\frac{{\ell}^{2}}{{\sin k}^{2}}} \cdot \frac{k}{\frac{\cos k}{t}}}} \]
      6. unpow285.8%

        \[\leadsto \frac{2}{\frac{k}{\frac{\color{blue}{\ell \cdot \ell}}{{\sin k}^{2}}} \cdot \frac{k}{\frac{\cos k}{t}}} \]
      7. unpow285.8%

        \[\leadsto \frac{2}{\frac{k}{\frac{\ell \cdot \ell}{\color{blue}{\sin k \cdot \sin k}}} \cdot \frac{k}{\frac{\cos k}{t}}} \]
      8. times-frac85.7%

        \[\leadsto \frac{2}{\frac{k}{\color{blue}{\frac{\ell}{\sin k} \cdot \frac{\ell}{\sin k}}} \cdot \frac{k}{\frac{\cos k}{t}}} \]
      9. unpow285.7%

        \[\leadsto \frac{2}{\frac{k}{\color{blue}{{\left(\frac{\ell}{\sin k}\right)}^{2}}} \cdot \frac{k}{\frac{\cos k}{t}}} \]
      10. times-frac83.2%

        \[\leadsto \frac{2}{\color{blue}{\frac{k \cdot k}{{\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}}}} \]
      11. unpow283.2%

        \[\leadsto \frac{2}{\frac{\color{blue}{{k}^{2}}}{{\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}}} \]
    8. Simplified83.2%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}}}} \]
    9. Step-by-step derivation
      1. div-inv83.2%

        \[\leadsto \color{blue}{2 \cdot \frac{1}{\frac{{k}^{2}}{{\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}}}} \]
    10. Applied egg-rr83.2%

      \[\leadsto \color{blue}{2 \cdot \frac{1}{\frac{{k}^{2}}{{\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}}}} \]
    11. Step-by-step derivation
      1. associate-/r/83.2%

        \[\leadsto 2 \cdot \color{blue}{\left(\frac{1}{{k}^{2}} \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)\right)} \]
      2. associate-*l/83.2%

        \[\leadsto 2 \cdot \color{blue}{\frac{1 \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)}{{k}^{2}}} \]
      3. associate-*l*83.2%

        \[\leadsto 2 \cdot \frac{\color{blue}{\left(1 \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}}}{{k}^{2}} \]
      4. *-lft-identity83.2%

        \[\leadsto 2 \cdot \frac{\color{blue}{{\left(\frac{\ell}{\sin k}\right)}^{2}} \cdot \frac{\cos k}{t}}{{k}^{2}} \]
      5. associate-/l*83.0%

        \[\leadsto 2 \cdot \color{blue}{\frac{{\left(\frac{\ell}{\sin k}\right)}^{2}}{\frac{{k}^{2}}{\frac{\cos k}{t}}}} \]
    12. Simplified83.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\left(\frac{\ell}{\sin k}\right)}^{2}}{\frac{{k}^{2}}{\frac{\cos k}{t}}}} \]

    if 1.3e208 < l

    1. Initial program 53.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow253.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg53.3%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times20.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr20.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. unpow320.0%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. times-frac40.0%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. pow240.0%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{\color{blue}{{t}^{2}}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr40.0%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac6.9%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{-k}{-t} \cdot \frac{k}{t}\right)}} \]
      2. frac-2neg6.9%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{k}{t}} \cdot \frac{k}{t}\right)} \]
    7. Applied egg-rr73.6%

      \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification49.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 6.3 \cdot 10^{-161}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{elif}\;\ell \leq 1.3 \cdot 10^{+208}:\\ \;\;\;\;2 \cdot \frac{{\left(\frac{\ell}{\sin k}\right)}^{2}}{\frac{{k}^{2}}{\frac{\cos k}{t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t} \cdot \frac{k}{t}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)\right)}\\ \end{array} \]

Alternative 5: 81.6% accurate, 1.0× speedup?

\[\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 1.7 \cdot 10^{-170}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t_m}\right)\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= l_m 1.7e-170)
    (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
    (* (* 2.0 (pow k -2.0)) (* (pow (/ l_m (sin k)) 2.0) (/ (cos k) t_m))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 1.7e-170) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else {
		tmp = (2.0 * pow(k, -2.0)) * (pow((l_m / sin(k)), 2.0) * (cos(k) / t_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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l_m <= 1.7d-170) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else
        tmp = (2.0d0 * (k ** (-2.0d0))) * (((l_m / sin(k)) ** 2.0d0) * (cos(k) / t_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 t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 1.7e-170) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else {
		tmp = (2.0 * Math.pow(k, -2.0)) * (Math.pow((l_m / Math.sin(k)), 2.0) * (Math.cos(k) / t_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, t_m, l_m, k):
	tmp = 0
	if l_m <= 1.7e-170:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	else:
		tmp = (2.0 * math.pow(k, -2.0)) * (math.pow((l_m / math.sin(k)), 2.0) * (math.cos(k) / t_m))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (l_m <= 1.7e-170)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	else
		tmp = Float64(Float64(2.0 * (k ^ -2.0)) * Float64((Float64(l_m / sin(k)) ^ 2.0) * Float64(cos(k) / t_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, t_m, l_m, k)
	tmp = 0.0;
	if (l_m <= 1.7e-170)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	else
		tmp = (2.0 * (k ^ -2.0)) * (((l_m / sin(k)) ^ 2.0) * (cos(k) / t_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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[l$95$m, 1.7e-170], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Power[k, -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(l$95$m / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$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 1.7 \cdot 10^{-170}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{l_m}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.70000000000000006e-170

    1. Initial program 29.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.2%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.2%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg29.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow229.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow236.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg36.0%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified36.0%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 56.2%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt38.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow238.8%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div24.8%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow224.8%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod4.9%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt28.2%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod28.7%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow131.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval31.1%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr31.1%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 1.70000000000000006e-170 < l

    1. Initial program 33.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*33.0%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative33.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*33.0%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/35.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative35.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow235.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg35.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg35.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg35.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow235.6%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+47.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval47.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity47.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow247.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg47.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg47.3%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified47.3%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around inf 77.1%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*r/77.1%

        \[\leadsto \color{blue}{\frac{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. times-frac77.8%

        \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2} \cdot \cos k}{t \cdot {\sin k}^{2}}} \]
      3. associate-/l*77.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\frac{{\ell}^{2}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
      4. *-commutative77.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{\color{blue}{{\sin k}^{2} \cdot t}}{\cos k}} \]
      5. associate-/l*77.8%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\color{blue}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    6. Simplified77.8%

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{{\ell}^{2}}{\frac{{\sin k}^{2}}{\frac{\cos k}{t}}}} \]
    7. Step-by-step derivation
      1. associate-/r/78.2%

        \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    8. Applied egg-rr78.2%

      \[\leadsto \frac{2}{{k}^{2}} \cdot \color{blue}{\left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)} \]
    9. Step-by-step derivation
      1. expm1-log1p-u39.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)\right)} \]
      2. expm1-udef28.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{k}^{2}} \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t}\right)\right)} - 1} \]
    10. Applied egg-rr30.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def37.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}\right)\right)} \]
      2. expm1-log1p77.2%

        \[\leadsto \color{blue}{\left(\left(2 \cdot {k}^{-2}\right) \cdot {\left(\frac{\ell}{\sin k}\right)}^{2}\right) \cdot \frac{\cos k}{t}} \]
      3. associate-*l*80.3%

        \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]
    12. Simplified80.3%

      \[\leadsto \color{blue}{\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 1.7 \cdot 10^{-170}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot {k}^{-2}\right) \cdot \left({\left(\frac{\ell}{\sin k}\right)}^{2} \cdot \frac{\cos k}{t}\right)\\ \end{array} \]

Alternative 6: 70.6% accurate, 1.3× speedup?

\[\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 1.25 \cdot 10^{+145}:\\ \;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= l_m 1.25e+145)
    (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))
    (/
     2.0
     (*
      (* (/ k t_m) (/ k t_m))
      (* (tan k) (* (sin k) (* (/ (pow t_m 2.0) l_m) (/ t_m l_m)))))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 1.25e+145) {
		tmp = 2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0);
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * ((pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l_m <= 1.25d+145) then
        tmp = 2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.0d0)
    else
        tmp = 2.0d0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ** 2.0d0) / l_m) * (t_m / 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 t_m, double l_m, double k) {
	double tmp;
	if (l_m <= 1.25e+145) {
		tmp = 2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0);
	} else {
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (Math.tan(k) * (Math.sin(k) * ((Math.pow(t_m, 2.0) / l_m) * (t_m / 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, t_m, l_m, k):
	tmp = 0
	if l_m <= 1.25e+145:
		tmp = 2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0)
	else:
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (math.tan(k) * (math.sin(k) * ((math.pow(t_m, 2.0) / l_m) * (t_m / l_m)))))
	return t_s * tmp
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (l_m <= 1.25e+145)
		tmp = Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k / t_m) * Float64(k / t_m)) * Float64(tan(k) * Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l_m) * Float64(t_m / 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, t_m, l_m, k)
	tmp = 0.0;
	if (l_m <= 1.25e+145)
		tmp = 2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.0);
	else
		tmp = 2.0 / (((k / t_m) * (k / t_m)) * (tan(k) * (sin(k) * (((t_m ^ 2.0) / l_m) * (t_m / 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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[l$95$m, 1.25e+145], N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t$95$m / l$95$m), $MachinePrecision]), $MachinePrecision]), $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 \leq 1.25 \cdot 10^{+145}:\\
\;\;\;\;2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{t_m} \cdot \frac{k}{t_m}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t_m}^{2}}{l_m} \cdot \frac{t_m}{l_m}\right)\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.24999999999999992e145

    1. Initial program 29.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*29.9%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
      2. *-commutative29.9%

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      3. associate-*l*29.9%

        \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      4. associate-*l/31.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
      5. +-commutative31.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
      6. unpow231.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg31.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg31.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg31.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
      10. unpow231.4%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+40.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval40.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity40.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow240.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg40.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
      16. distribute-frac-neg40.8%

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
    3. Simplified40.8%

      \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Taylor expanded in k around 0 59.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt37.6%

        \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
      2. pow237.6%

        \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
      3. sqrt-div22.9%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
      4. unpow222.9%

        \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      5. sqrt-prod8.6%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      6. add-sqr-sqrt25.4%

        \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
      7. sqrt-prod26.2%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
      8. sqrt-pow127.9%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
      9. metadata-eval27.9%

        \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
    6. Applied egg-rr27.9%

      \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]

    if 1.24999999999999992e145 < l

    1. Initial program 35.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative35.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1\right)} \]
      2. associate--l+35.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + \left(1 - 1\right)\right)}} \]
      3. metadata-eval35.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left({\left(\frac{k}{t}\right)}^{2} + \color{blue}{0}\right)} \]
      4. +-rgt-identity35.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{{\left(\frac{k}{t}\right)}^{2}}} \]
      5. unpow235.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
      6. frac-2neg35.9%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{-k}{-t}} \cdot \frac{k}{t}\right)} \]
      7. frac-times19.7%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    3. Applied egg-rr19.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}}} \]
    4. Step-by-step derivation
      1. unpow319.7%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      2. times-frac35.6%

        \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
      3. pow235.6%

        \[\leadsto \frac{2}{\left(\left(\left(\frac{\color{blue}{{t}^{2}}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    5. Applied egg-rr35.6%

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{\left(-k\right) \cdot k}{\left(-t\right) \cdot t}} \]
    6. Step-by-step derivation
      1. times-frac18.4%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{-k}{-t} \cdot \frac{k}{t}\right)}} \]
      2. frac-2neg18.4%

        \[\leadsto \frac{2}{\left(\left({\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{k}{t}} \cdot \frac{k}{t}\right)} \]
    7. Applied egg-rr61.2%

      \[\leadsto \frac{2}{\left(\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \color{blue}{\left(\frac{k}{t} \cdot \frac{k}{t}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification31.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 1.25 \cdot 10^{+145}:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{k}{t} \cdot \frac{k}{t}\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)\right)}\\ \end{array} \]

Alternative 7: 72.2% accurate, 1.4× speedup?

\[\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(2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\right) \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* 2.0 (pow (/ l_m (* (pow k 2.0) (sqrt t_m))) 2.0))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 * pow((l_m / (pow(k, 2.0) * sqrt(t_m))), 2.0));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 * ((l_m / ((k ** 2.0d0) * sqrt(t_m))) ** 2.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 t_m, double l_m, double k) {
	return t_s * (2.0 * Math.pow((l_m / (Math.pow(k, 2.0) * Math.sqrt(t_m))), 2.0));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 * math.pow((l_m / (math.pow(k, 2.0) * math.sqrt(t_m))), 2.0))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 * (Float64(l_m / Float64((k ^ 2.0) * sqrt(t_m))) ^ 2.0)))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 * ((l_m / ((k ^ 2.0) * sqrt(t_m))) ^ 2.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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 * N[Power[N[(l$95$m / N[(N[Power[k, 2.0], $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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(2 \cdot {\left(\frac{l_m}{{k}^{2} \cdot \sqrt{t_m}}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 30.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*30.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
    2. *-commutative30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    3. associate-*l*30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    4. associate-*l/31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    5. +-commutative31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
    6. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
    7. sqr-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
    8. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
    9. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
    10. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
    11. associate--l+40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
    12. metadata-eval40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
    13. +-rgt-identity40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
    14. unpow240.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
    15. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
    16. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
  3. Simplified40.2%

    \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
  4. Taylor expanded in k around 0 57.4%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  5. Step-by-step derivation
    1. add-sqr-sqrt33.8%

      \[\leadsto 2 \cdot \color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)} \]
    2. pow233.8%

      \[\leadsto 2 \cdot \color{blue}{{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{4} \cdot t}}\right)}^{2}} \]
    3. sqrt-div21.0%

      \[\leadsto 2 \cdot {\color{blue}{\left(\frac{\sqrt{{\ell}^{2}}}{\sqrt{{k}^{4} \cdot t}}\right)}}^{2} \]
    4. unpow221.0%

      \[\leadsto 2 \cdot {\left(\frac{\sqrt{\color{blue}{\ell \cdot \ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
    5. sqrt-prod8.5%

      \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
    6. add-sqr-sqrt23.2%

      \[\leadsto 2 \cdot {\left(\frac{\color{blue}{\ell}}{\sqrt{{k}^{4} \cdot t}}\right)}^{2} \]
    7. sqrt-prod23.9%

      \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{\sqrt{{k}^{4}} \cdot \sqrt{t}}}\right)}^{2} \]
    8. sqrt-pow125.4%

      \[\leadsto 2 \cdot {\left(\frac{\ell}{\color{blue}{{k}^{\left(\frac{4}{2}\right)}} \cdot \sqrt{t}}\right)}^{2} \]
    9. metadata-eval25.4%

      \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{\color{blue}{2}} \cdot \sqrt{t}}\right)}^{2} \]
  6. Applied egg-rr25.4%

    \[\leadsto 2 \cdot \color{blue}{{\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2}} \]
  7. Final simplification25.4%

    \[\leadsto 2 \cdot {\left(\frac{\ell}{{k}^{2} \cdot \sqrt{t}}\right)}^{2} \]

Alternative 8: 60.5% accurate, 2.0× speedup?

\[\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(2 \cdot \frac{\frac{{l_m}^{2}}{t_m}}{{k}^{4}}\right) \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* 2.0 (/ (/ (pow l_m 2.0) t_m) (pow k 4.0)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 * ((pow(l_m, 2.0) / t_m) / pow(k, 4.0)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 * (((l_m ** 2.0d0) / t_m) / (k ** 4.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 t_m, double l_m, double k) {
	return t_s * (2.0 * ((Math.pow(l_m, 2.0) / t_m) / Math.pow(k, 4.0)));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 * ((math.pow(l_m, 2.0) / t_m) / math.pow(k, 4.0)))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) / t_m) / (k ^ 4.0))))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 * (((l_m ^ 2.0) / t_m) / (k ^ 4.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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[k, 4.0], $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 \left(2 \cdot \frac{\frac{{l_m}^{2}}{t_m}}{{k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 30.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*30.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
    2. *-commutative30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    3. associate-*l*30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    4. associate-*l/31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    5. +-commutative31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
    6. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
    7. sqr-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
    8. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
    9. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
    10. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
    11. associate--l+40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
    12. metadata-eval40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
    13. +-rgt-identity40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
    14. unpow240.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
    15. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
    16. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
  3. Simplified40.2%

    \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
  4. Taylor expanded in k around 0 57.4%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  5. Step-by-step derivation
    1. *-commutative57.4%

      \[\leadsto 2 \cdot \frac{{\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    2. associate-/r*56.6%

      \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
  6. Simplified56.6%

    \[\leadsto \color{blue}{2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
  7. Final simplification56.6%

    \[\leadsto 2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{4}} \]

Alternative 9: 61.7% accurate, 2.0× speedup?

\[\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(2 \cdot \frac{{l_m}^{2}}{t_m \cdot {k}^{4}}\right) \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* 2.0 (/ (pow l_m 2.0) (* t_m (pow k 4.0))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 * (pow(l_m, 2.0) / (t_m * pow(k, 4.0))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 * ((l_m ** 2.0d0) / (t_m * (k ** 4.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 t_m, double l_m, double k) {
	return t_s * (2.0 * (Math.pow(l_m, 2.0) / (t_m * Math.pow(k, 4.0))));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 * (math.pow(l_m, 2.0) / (t_m * math.pow(k, 4.0))))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 * Float64((l_m ^ 2.0) / Float64(t_m * (k ^ 4.0)))))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 * ((l_m ^ 2.0) / (t_m * (k ^ 4.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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $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 \left(2 \cdot \frac{{l_m}^{2}}{t_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 30.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*30.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1}} \]
    2. *-commutative30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)} \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    3. associate-*l*30.6%

      \[\leadsto \frac{\frac{2}{\color{blue}{\sin k \cdot \left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    4. associate-*l/31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \color{blue}{\frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1} \]
    5. +-commutative31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} - 1} \]
    6. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
    7. sqr-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
    8. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
    9. distribute-frac-neg31.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\frac{-k}{t} \cdot \color{blue}{\frac{-k}{t}} + 1\right) - 1} \]
    10. unpow231.9%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
    11. associate--l+40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
    12. metadata-eval40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
    13. +-rgt-identity40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
    14. unpow240.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
    15. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \frac{-k}{t}} \]
    16. distribute-frac-neg40.2%

      \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(-\frac{k}{t}\right) \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
  3. Simplified40.2%

    \[\leadsto \color{blue}{\frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
  4. Taylor expanded in k around 0 57.4%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  5. Final simplification57.4%

    \[\leadsto 2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}} \]

Alternative 10: 61.4% accurate, 2.0× speedup?

\[\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(\frac{2}{t_m} \cdot \left({l_m}^{2} \cdot {k}^{-4}\right)\right) \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* (/ 2.0 t_m) (* (pow l_m 2.0) (pow k -4.0)))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((2.0 / t_m) * (pow(l_m, 2.0) * pow(k, -4.0)));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * ((2.0d0 / t_m) * ((l_m ** 2.0d0) * (k ** (-4.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 t_m, double l_m, double k) {
	return t_s * ((2.0 / t_m) * (Math.pow(l_m, 2.0) * Math.pow(k, -4.0)));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * ((2.0 / t_m) * (math.pow(l_m, 2.0) * math.pow(k, -4.0)))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(Float64(2.0 / t_m) * Float64((l_m ^ 2.0) * (k ^ -4.0))))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * ((2.0 / t_m) * ((l_m ^ 2.0) * (k ^ -4.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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(N[(2.0 / t$95$m), $MachinePrecision] * N[(N[Power[l$95$m, 2.0], $MachinePrecision] * N[Power[k, -4.0], $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 \left(\frac{2}{t_m} \cdot \left({l_m}^{2} \cdot {k}^{-4}\right)\right)
\end{array}
Derivation
  1. Initial program 30.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Taylor expanded in k around 0 57.4%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
  3. Step-by-step derivation
    1. *-commutative57.4%

      \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{4}}}{{\ell}^{2}}} \]
    2. associate-/l*57.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  4. Simplified57.9%

    \[\leadsto \frac{2}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  5. Step-by-step derivation
    1. associate-/r/57.9%

      \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}} \]
    2. div-inv57.8%

      \[\leadsto \frac{2}{t} \cdot \color{blue}{\left({\ell}^{2} \cdot \frac{1}{{k}^{4}}\right)} \]
    3. pow-flip57.8%

      \[\leadsto \frac{2}{t} \cdot \left({\ell}^{2} \cdot \color{blue}{{k}^{\left(-4\right)}}\right) \]
    4. metadata-eval57.8%

      \[\leadsto \frac{2}{t} \cdot \left({\ell}^{2} \cdot {k}^{\color{blue}{-4}}\right) \]
  6. Applied egg-rr57.8%

    \[\leadsto \color{blue}{\frac{2}{t} \cdot \left({\ell}^{2} \cdot {k}^{-4}\right)} \]
  7. Final simplification57.8%

    \[\leadsto \frac{2}{t} \cdot \left({\ell}^{2} \cdot {k}^{-4}\right) \]

Alternative 11: 61.5% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \frac{2}{\frac{t_m}{\frac{{l_m}^{2}}{{k}^{4}}}} \end{array} \]
l_m = (fabs.f64 l)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (/ 2.0 (/ t_m (/ (pow l_m 2.0) (pow k 4.0))))))
l_m = fabs(l);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 / (t_m / (pow(l_m, 2.0) / pow(k, 4.0))));
}
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 / (t_m / ((l_m ** 2.0d0) / (k ** 4.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 t_m, double l_m, double k) {
	return t_s * (2.0 / (t_m / (Math.pow(l_m, 2.0) / Math.pow(k, 4.0))));
}
l_m = math.fabs(l)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 / (t_m / (math.pow(l_m, 2.0) / math.pow(k, 4.0))))
l_m = abs(l)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 / Float64(t_m / Float64((l_m ^ 2.0) / (k ^ 4.0)))))
end
l_m = abs(l);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 / (t_m / ((l_m ^ 2.0) / (k ^ 4.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_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[(t$95$m / N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 4.0], $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 \frac{2}{\frac{t_m}{\frac{{l_m}^{2}}{{k}^{4}}}}
\end{array}
Derivation
  1. Initial program 30.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Taylor expanded in k around 0 57.4%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
  3. Step-by-step derivation
    1. *-commutative57.4%

      \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{4}}}{{\ell}^{2}}} \]
    2. associate-/l*57.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  4. Simplified57.9%

    \[\leadsto \frac{2}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  5. Final simplification57.9%

    \[\leadsto \frac{2}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}} \]

Reproduce

?
herbie shell --seed 2023319 
(FPCore (t l k)
  :name "Toniolo and Linder, Equation (10-)"
  :precision binary64
  (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))