Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.0% → 94.7%
Time: 27.8s
Alternatives: 16
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 16 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: 35.0% 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: 94.7% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 560000000:\\ \;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_m \cdot {\sin k_m}^{2}}{\cos k_m \cdot {\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 560000000.0)
    (pow
     (* (/ l (/ (sin k_m) (sqrt 2.0))) (/ (sqrt (/ (cos k_m) t_m)) k_m))
     2.0)
    (/
     2.0
     (/
      (* t_m (pow (sin k_m) 2.0))
      (* (cos k_m) (pow (/ l (fabs k_m)) 2.0)))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 560000000.0) {
		tmp = pow(((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / ((t_m * pow(sin(k_m), 2.0)) / (cos(k_m) * pow((l / fabs(k_m)), 2.0)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 560000000.0d0) then
        tmp = ((l / (sin(k_m) / sqrt(2.0d0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ** 2.0d0
    else
        tmp = 2.0d0 / ((t_m * (sin(k_m) ** 2.0d0)) / (cos(k_m) * ((l / abs(k_m)) ** 2.0d0)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 560000000.0) {
		tmp = Math.pow(((l / (Math.sin(k_m) / Math.sqrt(2.0))) * (Math.sqrt((Math.cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / ((t_m * Math.pow(Math.sin(k_m), 2.0)) / (Math.cos(k_m) * Math.pow((l / Math.abs(k_m)), 2.0)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 560000000.0:
		tmp = math.pow(((l / (math.sin(k_m) / math.sqrt(2.0))) * (math.sqrt((math.cos(k_m) / t_m)) / k_m)), 2.0)
	else:
		tmp = 2.0 / ((t_m * math.pow(math.sin(k_m), 2.0)) / (math.cos(k_m) * math.pow((l / math.fabs(k_m)), 2.0)))
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 560000000.0)
		tmp = Float64(Float64(l / Float64(sin(k_m) / sqrt(2.0))) * Float64(sqrt(Float64(cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64(t_m * (sin(k_m) ^ 2.0)) / Float64(cos(k_m) * (Float64(l / abs(k_m)) ^ 2.0))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 560000000.0)
		tmp = ((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = 2.0 / ((t_m * (sin(k_m) ^ 2.0)) / (cos(k_m) * ((l / abs(k_m)) ^ 2.0)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 560000000.0], N[Power[N[(N[(l / N[(N[Sin[k$95$m], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 560000000:\\
\;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_m \cdot {\sin k_m}^{2}}{\cos k_m \cdot {\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 5.6e8

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6e8 < k

    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-*l*29.3%

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Step-by-step derivation
      1. clear-num76.3%

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      2. inv-pow76.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    10. Simplified76.3%

      \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    11. Step-by-step derivation
      1. inv-pow76.3%

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

        \[\leadsto \frac{2}{{\color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}}^{-1} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. unpow-prod-down76.1%

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

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

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

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

        \[\leadsto \frac{2}{\left({\left(\color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)} \cdot \sqrt{\frac{1}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      8. add-sqr-sqrt62.6%

        \[\leadsto \frac{2}{\left({\left(\color{blue}{\ell} \cdot \sqrt{\frac{1}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      9. pow-flip62.6%

        \[\leadsto \frac{2}{\left({\left(\ell \cdot \sqrt{\color{blue}{{k}^{\left(-2\right)}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      10. metadata-eval62.6%

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

      \[\leadsto \frac{2}{\color{blue}{\left({\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1} \cdot {\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1}\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    13. Step-by-step derivation
      1. pow-sqr82.5%

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \sqrt{\color{blue}{{k}^{\left(\frac{-2}{2}\right)} \cdot {k}^{\left(\frac{-2}{2}\right)}}}\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. rem-sqrt-square93.9%

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

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \left|\color{blue}{\frac{1}{k}}\right|\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      6. metadata-eval93.9%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\ell \cdot \left|\frac{1}{k}\right|\right)}^{-2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    15. Taylor expanded in l around 0 77.5%

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \left(\cos k \cdot \left(\left|\color{blue}{{k}^{-1}}\right| \cdot \left|\frac{1}{k}\right|\right)\right)}} \]
      3. metadata-eval77.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.1% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\cos k_m}{t_m}\\ t_3 := \ell \cdot \sqrt{2}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-323}:\\ \;\;\;\;{\left(\frac{t_3}{{k_m}^{2}} \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\ \mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+252}:\\ \;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}}\right)}^{2} \cdot \left(t_2 \cdot {k_m}^{-2}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{t_2} \cdot \frac{t_3}{k_m \cdot \sin k_m}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (/ (cos k_m) t_m)) (t_3 (* l (sqrt 2.0))))
   (*
    t_s
    (if (<= (* l l) 2e-323)
      (pow (* (/ t_3 (pow k_m 2.0)) (sqrt (/ 1.0 t_m))) 2.0)
      (if (<= (* l l) 2e+252)
        (* (pow (/ l (/ (sin k_m) (sqrt 2.0))) 2.0) (* t_2 (pow k_m -2.0)))
        (pow (* (sqrt t_2) (/ t_3 (* k_m (sin k_m)))) 2.0))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = cos(k_m) / t_m;
	double t_3 = l * sqrt(2.0);
	double tmp;
	if ((l * l) <= 2e-323) {
		tmp = pow(((t_3 / pow(k_m, 2.0)) * sqrt((1.0 / t_m))), 2.0);
	} else if ((l * l) <= 2e+252) {
		tmp = pow((l / (sin(k_m) / sqrt(2.0))), 2.0) * (t_2 * pow(k_m, -2.0));
	} else {
		tmp = pow((sqrt(t_2) * (t_3 / (k_m * sin(k_m)))), 2.0);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = cos(k_m) / t_m
    t_3 = l * sqrt(2.0d0)
    if ((l * l) <= 2d-323) then
        tmp = ((t_3 / (k_m ** 2.0d0)) * sqrt((1.0d0 / t_m))) ** 2.0d0
    else if ((l * l) <= 2d+252) then
        tmp = ((l / (sin(k_m) / sqrt(2.0d0))) ** 2.0d0) * (t_2 * (k_m ** (-2.0d0)))
    else
        tmp = (sqrt(t_2) * (t_3 / (k_m * sin(k_m)))) ** 2.0d0
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.cos(k_m) / t_m;
	double t_3 = l * Math.sqrt(2.0);
	double tmp;
	if ((l * l) <= 2e-323) {
		tmp = Math.pow(((t_3 / Math.pow(k_m, 2.0)) * Math.sqrt((1.0 / t_m))), 2.0);
	} else if ((l * l) <= 2e+252) {
		tmp = Math.pow((l / (Math.sin(k_m) / Math.sqrt(2.0))), 2.0) * (t_2 * Math.pow(k_m, -2.0));
	} else {
		tmp = Math.pow((Math.sqrt(t_2) * (t_3 / (k_m * Math.sin(k_m)))), 2.0);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.cos(k_m) / t_m
	t_3 = l * math.sqrt(2.0)
	tmp = 0
	if (l * l) <= 2e-323:
		tmp = math.pow(((t_3 / math.pow(k_m, 2.0)) * math.sqrt((1.0 / t_m))), 2.0)
	elif (l * l) <= 2e+252:
		tmp = math.pow((l / (math.sin(k_m) / math.sqrt(2.0))), 2.0) * (t_2 * math.pow(k_m, -2.0))
	else:
		tmp = math.pow((math.sqrt(t_2) * (t_3 / (k_m * math.sin(k_m)))), 2.0)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(cos(k_m) / t_m)
	t_3 = Float64(l * sqrt(2.0))
	tmp = 0.0
	if (Float64(l * l) <= 2e-323)
		tmp = Float64(Float64(t_3 / (k_m ^ 2.0)) * sqrt(Float64(1.0 / t_m))) ^ 2.0;
	elseif (Float64(l * l) <= 2e+252)
		tmp = Float64((Float64(l / Float64(sin(k_m) / sqrt(2.0))) ^ 2.0) * Float64(t_2 * (k_m ^ -2.0)));
	else
		tmp = Float64(sqrt(t_2) * Float64(t_3 / Float64(k_m * sin(k_m)))) ^ 2.0;
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	t_2 = cos(k_m) / t_m;
	t_3 = l * sqrt(2.0);
	tmp = 0.0;
	if ((l * l) <= 2e-323)
		tmp = ((t_3 / (k_m ^ 2.0)) * sqrt((1.0 / t_m))) ^ 2.0;
	elseif ((l * l) <= 2e+252)
		tmp = ((l / (sin(k_m) / sqrt(2.0))) ^ 2.0) * (t_2 * (k_m ^ -2.0));
	else
		tmp = (sqrt(t_2) * (t_3 / (k_m * sin(k_m)))) ^ 2.0;
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := Block[{t$95$2 = N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]}, Block[{t$95$3 = N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-323], N[Power[N[(N[(t$95$3 / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 2e+252], N[(N[Power[N[(l / N[(N[Sin[k$95$m], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$2 * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(t$95$3 / N[(k$95$m * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{\cos k_m}{t_m}\\
t_3 := \ell \cdot \sqrt{2}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-323}:\\
\;\;\;\;{\left(\frac{t_3}{{k_m}^{2}} \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 2 \cdot 10^{+252}:\\
\;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}}\right)}^{2} \cdot \left(t_2 \cdot {k_m}^{-2}\right)\\

\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t_2} \cdot \frac{t_3}{k_m \cdot \sin k_m}\right)}^{2}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 l l) < 1.97626e-323

    1. Initial program 19.7%

      \[\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*19.7%

        \[\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. *-commutative19.7%

        \[\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*19.7%

        \[\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/19.7%

        \[\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. +-commutative19.7%

        \[\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. unpow219.7%

        \[\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-neg19.7%

        \[\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-neg19.7%

        \[\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-neg19.7%

        \[\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. unpow219.7%

        \[\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+30.1%

        \[\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-eval30.1%

        \[\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-identity30.1%

        \[\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. unpow230.1%

        \[\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-neg30.1%

        \[\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-neg30.1%

        \[\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. Simplified30.1%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt29.7%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow211.0%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/11.0%

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

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

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

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

    if 1.97626e-323 < (*.f64 l l) < 2.0000000000000002e252

    1. Initial program 42.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*42.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. *-commutative42.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*42.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/42.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. +-commutative42.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. unpow242.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-neg42.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-neg42.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-neg42.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. unpow242.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+56.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-eval56.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-identity56.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. unpow256.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-neg56.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-neg56.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. Simplified56.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. Step-by-step derivation
      1. add-sqr-sqrt41.8%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.4%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\frac{\ell}{\frac{\sin k}{\sqrt{2}}}\right)}^{2} \cdot {\color{blue}{\left(\sqrt{\frac{\cos k}{t}} \cdot \frac{1}{k}\right)}}^{2} \]
      4. unpow-prod-down44.5%

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

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

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

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

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

        \[\leadsto {\left(\frac{\ell}{\frac{\sin k}{\sqrt{2}}}\right)}^{2} \cdot \left(\frac{\cos k}{t} \cdot \left({k}^{-1} \cdot \color{blue}{{k}^{-1}}\right)\right) \]
      10. pow-prod-up96.2%

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

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

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

    if 2.0000000000000002e252 < (*.f64 l l)

    1. Initial program 21.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*21.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. *-commutative21.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*21.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/21.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. +-commutative21.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. unpow221.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-neg21.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-neg21.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-neg21.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. unpow221.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+22.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-eval22.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-identity22.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. unpow222.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-neg22.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-neg22.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. Simplified22.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. Step-by-step derivation
      1. add-sqr-sqrt7.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow225.3%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/25.4%

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

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

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

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

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

Alternative 3: 94.6% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 620000000:\\ \;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{-2} \cdot \frac{t_m \cdot {\sin k_m}^{2}}{\cos k_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 620000000.0)
    (pow
     (* (/ l (/ (sin k_m) (sqrt 2.0))) (/ (sqrt (/ (cos k_m) t_m)) k_m))
     2.0)
    (/
     2.0
     (*
      (pow (/ l (fabs k_m)) -2.0)
      (/ (* t_m (pow (sin k_m) 2.0)) (cos k_m)))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 620000000.0) {
		tmp = pow(((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / (pow((l / fabs(k_m)), -2.0) * ((t_m * pow(sin(k_m), 2.0)) / cos(k_m)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 620000000.0d0) then
        tmp = ((l / (sin(k_m) / sqrt(2.0d0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ** 2.0d0
    else
        tmp = 2.0d0 / (((l / abs(k_m)) ** (-2.0d0)) * ((t_m * (sin(k_m) ** 2.0d0)) / cos(k_m)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 620000000.0) {
		tmp = Math.pow(((l / (Math.sin(k_m) / Math.sqrt(2.0))) * (Math.sqrt((Math.cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / (Math.pow((l / Math.abs(k_m)), -2.0) * ((t_m * Math.pow(Math.sin(k_m), 2.0)) / Math.cos(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 620000000.0:
		tmp = math.pow(((l / (math.sin(k_m) / math.sqrt(2.0))) * (math.sqrt((math.cos(k_m) / t_m)) / k_m)), 2.0)
	else:
		tmp = 2.0 / (math.pow((l / math.fabs(k_m)), -2.0) * ((t_m * math.pow(math.sin(k_m), 2.0)) / math.cos(k_m)))
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 620000000.0)
		tmp = Float64(Float64(l / Float64(sin(k_m) / sqrt(2.0))) * Float64(sqrt(Float64(cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64((Float64(l / abs(k_m)) ^ -2.0) * Float64(Float64(t_m * (sin(k_m) ^ 2.0)) / cos(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 620000000.0)
		tmp = ((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = 2.0 / (((l / abs(k_m)) ^ -2.0) * ((t_m * (sin(k_m) ^ 2.0)) / cos(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 620000000.0], N[Power[N[(N[(l / N[(N[Sin[k$95$m], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 620000000:\\
\;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{-2} \cdot \frac{t_m \cdot {\sin k_m}^{2}}{\cos k_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 6.2e8

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2e8 < k

    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-*l*29.3%

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Step-by-step derivation
      1. clear-num76.3%

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      2. inv-pow76.3%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    10. Simplified76.3%

      \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    11. Step-by-step derivation
      1. inv-pow76.3%

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

        \[\leadsto \frac{2}{{\color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}}^{-1} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. unpow-prod-down76.1%

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

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

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

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

        \[\leadsto \frac{2}{\left({\left(\color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)} \cdot \sqrt{\frac{1}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      8. add-sqr-sqrt62.6%

        \[\leadsto \frac{2}{\left({\left(\color{blue}{\ell} \cdot \sqrt{\frac{1}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      9. pow-flip62.6%

        \[\leadsto \frac{2}{\left({\left(\ell \cdot \sqrt{\color{blue}{{k}^{\left(-2\right)}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      10. metadata-eval62.6%

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

      \[\leadsto \frac{2}{\color{blue}{\left({\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1} \cdot {\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1}\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    13. Step-by-step derivation
      1. pow-sqr82.5%

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \sqrt{\color{blue}{{k}^{\left(\frac{-2}{2}\right)} \cdot {k}^{\left(\frac{-2}{2}\right)}}}\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. rem-sqrt-square93.9%

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

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \left|\color{blue}{\frac{1}{k}}\right|\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      6. metadata-eval93.9%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \left|\frac{1}{k}\right|\right)}^{-2}\right)} - 1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. fabs-div75.3%

        \[\leadsto \frac{2}{\left(e^{\mathsf{log1p}\left({\left(\ell \cdot \color{blue}{\frac{\left|1\right|}{\left|k\right|}}\right)}^{-2}\right)} - 1\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      4. metadata-eval75.3%

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

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

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

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

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

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

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

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

Alternative 4: 83.0% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 500000000:\\ \;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{k_m}^{2}}{{\ell}^{2}} \cdot \frac{t_m \cdot \left(0.5 - \frac{\cos \left(k_m \cdot 2\right)}{2}\right)}{\cos k_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 500000000.0)
    (pow
     (* (/ l (/ (sin k_m) (sqrt 2.0))) (/ (sqrt (/ (cos k_m) t_m)) k_m))
     2.0)
    (/
     2.0
     (*
      (/ (pow k_m 2.0) (pow l 2.0))
      (/ (* t_m (- 0.5 (/ (cos (* k_m 2.0)) 2.0))) (cos k_m)))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 500000000.0) {
		tmp = pow(((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / ((pow(k_m, 2.0) / pow(l, 2.0)) * ((t_m * (0.5 - (cos((k_m * 2.0)) / 2.0))) / cos(k_m)));
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 500000000.0d0) then
        tmp = ((l / (sin(k_m) / sqrt(2.0d0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ** 2.0d0
    else
        tmp = 2.0d0 / (((k_m ** 2.0d0) / (l ** 2.0d0)) * ((t_m * (0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0))) / cos(k_m)))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 500000000.0) {
		tmp = Math.pow(((l / (Math.sin(k_m) / Math.sqrt(2.0))) * (Math.sqrt((Math.cos(k_m) / t_m)) / k_m)), 2.0);
	} else {
		tmp = 2.0 / ((Math.pow(k_m, 2.0) / Math.pow(l, 2.0)) * ((t_m * (0.5 - (Math.cos((k_m * 2.0)) / 2.0))) / Math.cos(k_m)));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 500000000.0:
		tmp = math.pow(((l / (math.sin(k_m) / math.sqrt(2.0))) * (math.sqrt((math.cos(k_m) / t_m)) / k_m)), 2.0)
	else:
		tmp = 2.0 / ((math.pow(k_m, 2.0) / math.pow(l, 2.0)) * ((t_m * (0.5 - (math.cos((k_m * 2.0)) / 2.0))) / math.cos(k_m)))
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 500000000.0)
		tmp = Float64(Float64(l / Float64(sin(k_m) / sqrt(2.0))) * Float64(sqrt(Float64(cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64((k_m ^ 2.0) / (l ^ 2.0)) * Float64(Float64(t_m * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0))) / cos(k_m))));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 500000000.0)
		tmp = ((l / (sin(k_m) / sqrt(2.0))) * (sqrt((cos(k_m) / t_m)) / k_m)) ^ 2.0;
	else
		tmp = 2.0 / (((k_m ^ 2.0) / (l ^ 2.0)) * ((t_m * (0.5 - (cos((k_m * 2.0)) / 2.0))) / cos(k_m)));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 500000000.0], N[Power[N[(N[(l / N[(N[Sin[k$95$m], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 500000000:\\
\;\;\;\;{\left(\frac{\ell}{\frac{\sin k_m}{\sqrt{2}}} \cdot \frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{k_m}^{2}}{{\ell}^{2}} \cdot \frac{t_m \cdot \left(0.5 - \frac{\cos \left(k_m \cdot 2\right)}{2}\right)}{\cos k_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 5e8

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5e8 < k

    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-*l*29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot \left(\color{blue}{0.5} - \frac{\cos \left(k + k\right)}{2}\right)}{\cos k}} \]
      5. count-276.3%

        \[\leadsto \frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot \left(0.5 - \frac{\cos \color{blue}{\left(2 \cdot k\right)}}{2}\right)}{\cos k}} \]
      6. *-commutative76.3%

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

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

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

Alternative 5: 74.5% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 4000000:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m} \cdot \frac{\ell \cdot \sqrt{2}}{k_m}\right)}^{2}\\ \mathbf{elif}\;k_m \leq 1.8 \cdot 10^{+18}:\\ \;\;\;\;\frac{2}{\frac{\sin k_m \cdot {t_m}^{3}}{\ell \cdot \ell} \cdot t_2}\\ \mathbf{elif}\;k_m \leq 1.6 \cdot 10^{+25}:\\ \;\;\;\;-0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left({k_m}^{-2} \cdot \frac{{\ell}^{2}}{t_m}\right)} + -1\right)\\ \mathbf{elif}\;k_m \leq 9.2 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{t_2 \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (let* ((t_2 (* (tan k_m) (/ k_m (* t_m (/ t_m k_m))))))
   (*
    t_s
    (if (<= k_m 4000000.0)
      (pow (* (/ (sqrt (/ (cos k_m) t_m)) k_m) (/ (* l (sqrt 2.0)) k_m)) 2.0)
      (if (<= k_m 1.8e+18)
        (/ 2.0 (* (/ (* (sin k_m) (pow t_m 3.0)) (* l l)) t_2))
        (if (<= k_m 1.6e+25)
          (*
           -0.3333333333333333
           (+ (exp (log1p (* (pow k_m -2.0) (/ (pow l 2.0) t_m)))) -1.0))
          (if (<= k_m 9.2e+53)
            (/ 2.0 (* t_2 (* (/ (pow t_m 3.0) l) (/ (sin k_m) l))))
            (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m)))))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = tan(k_m) * (k_m / (t_m * (t_m / k_m)));
	double tmp;
	if (k_m <= 4000000.0) {
		tmp = pow(((sqrt((cos(k_m) / t_m)) / k_m) * ((l * sqrt(2.0)) / k_m)), 2.0);
	} else if (k_m <= 1.8e+18) {
		tmp = 2.0 / (((sin(k_m) * pow(t_m, 3.0)) / (l * l)) * t_2);
	} else if (k_m <= 1.6e+25) {
		tmp = -0.3333333333333333 * (exp(log1p((pow(k_m, -2.0) * (pow(l, 2.0) / t_m)))) + -1.0);
	} else if (k_m <= 9.2e+53) {
		tmp = 2.0 / (t_2 * ((pow(t_m, 3.0) / l) * (sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double t_2 = Math.tan(k_m) * (k_m / (t_m * (t_m / k_m)));
	double tmp;
	if (k_m <= 4000000.0) {
		tmp = Math.pow(((Math.sqrt((Math.cos(k_m) / t_m)) / k_m) * ((l * Math.sqrt(2.0)) / k_m)), 2.0);
	} else if (k_m <= 1.8e+18) {
		tmp = 2.0 / (((Math.sin(k_m) * Math.pow(t_m, 3.0)) / (l * l)) * t_2);
	} else if (k_m <= 1.6e+25) {
		tmp = -0.3333333333333333 * (Math.exp(Math.log1p((Math.pow(k_m, -2.0) * (Math.pow(l, 2.0) / t_m)))) + -1.0);
	} else if (k_m <= 9.2e+53) {
		tmp = 2.0 / (t_2 * ((Math.pow(t_m, 3.0) / l) * (Math.sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	t_2 = math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))
	tmp = 0
	if k_m <= 4000000.0:
		tmp = math.pow(((math.sqrt((math.cos(k_m) / t_m)) / k_m) * ((l * math.sqrt(2.0)) / k_m)), 2.0)
	elif k_m <= 1.8e+18:
		tmp = 2.0 / (((math.sin(k_m) * math.pow(t_m, 3.0)) / (l * l)) * t_2)
	elif k_m <= 1.6e+25:
		tmp = -0.3333333333333333 * (math.exp(math.log1p((math.pow(k_m, -2.0) * (math.pow(l, 2.0) / t_m)))) + -1.0)
	elif k_m <= 9.2e+53:
		tmp = 2.0 / (t_2 * ((math.pow(t_m, 3.0) / l) * (math.sin(k_m) / l)))
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	t_2 = Float64(tan(k_m) * Float64(k_m / Float64(t_m * Float64(t_m / k_m))))
	tmp = 0.0
	if (k_m <= 4000000.0)
		tmp = Float64(Float64(sqrt(Float64(cos(k_m) / t_m)) / k_m) * Float64(Float64(l * sqrt(2.0)) / k_m)) ^ 2.0;
	elseif (k_m <= 1.8e+18)
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k_m) * (t_m ^ 3.0)) / Float64(l * l)) * t_2));
	elseif (k_m <= 1.6e+25)
		tmp = Float64(-0.3333333333333333 * Float64(exp(log1p(Float64((k_m ^ -2.0) * Float64((l ^ 2.0) / t_m)))) + -1.0));
	elseif (k_m <= 9.2e+53)
		tmp = Float64(2.0 / Float64(t_2 * Float64(Float64((t_m ^ 3.0) / l) * Float64(sin(k_m) / l))));
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = N[Abs[k], $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_, k$95$m_] := Block[{t$95$2 = N[(N[Tan[k$95$m], $MachinePrecision] * N[(k$95$m / N[(t$95$m * N[(t$95$m / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 4000000.0], N[Power[N[(N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 1.8e+18], N[(2.0 / N[(N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.6e+25], N[(-0.3333333333333333 * N[(N[Exp[N[Log[1 + N[(N[Power[k$95$m, -2.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 9.2e+53], N[(2.0 / N[(t$95$2 * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 4000000:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m} \cdot \frac{\ell \cdot \sqrt{2}}{k_m}\right)}^{2}\\

\mathbf{elif}\;k_m \leq 1.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{2}{\frac{\sin k_m \cdot {t_m}^{3}}{\ell \cdot \ell} \cdot t_2}\\

\mathbf{elif}\;k_m \leq 1.6 \cdot 10^{+25}:\\
\;\;\;\;-0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left({k_m}^{-2} \cdot \frac{{\ell}^{2}}{t_m}\right)} + -1\right)\\

\mathbf{elif}\;k_m \leq 9.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if k < 4e6

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{\sin k} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k}\right)}}^{2} \]
    11. Taylor expanded in k around 0 36.1%

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

    if 4e6 < k < 1.8e18

    1. Initial program 2.4%

      \[\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-*l*2.4%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \left(e^{\color{blue}{\mathsf{log1p}\left({\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)\right)} \]
      4. expm1-udef98.8%

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

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

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

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

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

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

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

    if 1.8e18 < k < 1.6e25

    1. Initial program 0.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*0.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. *-commutative0.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*0.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/0.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. +-commutative0.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. unpow20.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-neg0.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-neg0.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-neg0.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. unpow20.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+0.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-eval0.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-identity0.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. unpow20.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-neg0.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-neg0.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. Simplified0.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 0 17.4%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 50.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative50.7%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified50.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv50.7%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot \frac{1}{{k}^{2}}\right)} \]
      2. pow-flip50.7%

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative17.4%

        \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
    11. Applied egg-rr17.4%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]

    if 1.6e25 < k < 9.20000000000000079e53

    1. Initial program 30.7%

      \[\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-*l*30.7%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \left(e^{\color{blue}{\mathsf{log1p}\left({\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)\right)} \]
      4. expm1-udef55.7%

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

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

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

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

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

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

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

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

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

    if 9.20000000000000079e53 < k

    1. Initial program 34.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*34.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. *-commutative34.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*34.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/34.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. +-commutative34.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. unpow234.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-neg34.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-neg34.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-neg34.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. unpow234.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+48.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-eval48.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-identity48.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. unpow248.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-neg48.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-neg48.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. Simplified48.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 0 59.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 61.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative61.9%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified61.8%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv61.8%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot \frac{1}{{k}^{2}}\right)} \]
      2. pow-flip61.9%

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} \]
    10. Step-by-step derivation
      1. expm1-log1p-u61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative60.9%

        \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
    11. Applied egg-rr60.9%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/61.8%

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

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified63.4%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification42.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4000000:\\ \;\;\;\;{\left(\frac{\sqrt{\frac{\cos k}{t}}}{k} \cdot \frac{\ell \cdot \sqrt{2}}{k}\right)}^{2}\\ \mathbf{elif}\;k \leq 1.8 \cdot 10^{+18}:\\ \;\;\;\;\frac{2}{\frac{\sin k \cdot {t}^{3}}{\ell \cdot \ell} \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \mathbf{elif}\;k \leq 1.6 \cdot 10^{+25}:\\ \;\;\;\;-0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} + -1\right)\\ \mathbf{elif}\;k \leq 9.2 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right) \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 6: 82.9% accurate, 1.0× speedup?

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

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 1.5 \cdot 10^{-28}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m} \cdot \frac{\ell \cdot \sqrt{2}}{k_m}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(k_m \cdot \sin k_m\right)}^{2}}{\cos k_m \cdot \frac{{\ell}^{2}}{t_m}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 1.50000000000000001e-28

    1. Initial program 32.1%

      \[\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*32.1%

        \[\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. *-commutative32.1%

        \[\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*32.1%

        \[\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+39.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-eval39.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-identity39.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. unpow239.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-neg39.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-neg39.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. Simplified39.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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow220.9%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/20.9%

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{\sin k} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k}\right)}}^{2} \]
    11. Taylor expanded in k around 0 35.8%

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

    if 1.50000000000000001e-28 < k

    1. Initial program 29.1%

      \[\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.1%

        \[\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.1%

        \[\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/29.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. +-commutative29.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. unpow229.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-neg29.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-neg29.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-neg29.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. unpow229.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+46.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-eval46.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-identity46.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. unpow246.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-neg46.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-neg46.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. Simplified46.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 78.8%

      \[\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/78.8%

        \[\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-frac78.8%

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

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

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{\frac{{\ell}^{2} \cdot \cos k}{t}}{{\sin k}^{2}}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u71.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.1% accurate, 1.0× speedup?

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

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 1.9 \cdot 10^{-28}:\\
\;\;\;\;{\left(\frac{\sqrt{\frac{\cos k_m}{t_m}}}{k_m} \cdot \frac{\ell \cdot \sqrt{2}}{k_m}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \frac{{\ell}^{2}}{\frac{t_m}{\cos k_m}}}{{\left(k_m \cdot \sin k_m\right)}^{2}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 1.90000000000000005e-28

    1. Initial program 32.1%

      \[\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*32.1%

        \[\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. *-commutative32.1%

        \[\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*32.1%

        \[\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+39.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-eval39.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-identity39.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. unpow239.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-neg39.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-neg39.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. Simplified39.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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow220.9%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/20.9%

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{\sin k} \cdot \frac{\sqrt{\frac{\cos k}{t}}}{k}\right)}}^{2} \]
    11. Taylor expanded in k around 0 35.8%

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

    if 1.90000000000000005e-28 < k

    1. Initial program 29.1%

      \[\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.1%

        \[\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.1%

        \[\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/29.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. +-commutative29.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. unpow229.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-neg29.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-neg29.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-neg29.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. unpow229.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+46.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-eval46.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-identity46.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. unpow246.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-neg46.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-neg46.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. Simplified46.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 78.8%

      \[\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/78.8%

        \[\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-frac78.8%

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

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

      \[\leadsto \color{blue}{\frac{2}{{k}^{2}} \cdot \frac{\frac{{\ell}^{2} \cdot \cos k}{t}}{{\sin k}^{2}}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u71.1%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 21000000:\\ \;\;\;\;{\left(\frac{\ell \cdot \sqrt{2}}{{k_m}^{2}} \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\ \mathbf{elif}\;k_m \leq 1.3 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 21000000.0)
    (pow (* (/ (* l (sqrt 2.0)) (pow k_m 2.0)) (sqrt (/ 1.0 t_m))) 2.0)
    (if (<= k_m 1.3e+53)
      (/
       2.0
       (*
        (* (tan k_m) (/ k_m (* t_m (/ t_m k_m))))
        (* (/ (pow t_m 3.0) l) (/ (sin k_m) l))))
      (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 21000000.0) {
		tmp = pow((((l * sqrt(2.0)) / pow(k_m, 2.0)) * sqrt((1.0 / t_m))), 2.0);
	} else if (k_m <= 1.3e+53) {
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((pow(t_m, 3.0) / l) * (sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 21000000.0d0) then
        tmp = (((l * sqrt(2.0d0)) / (k_m ** 2.0d0)) * sqrt((1.0d0 / t_m))) ** 2.0d0
    else if (k_m <= 1.3d+53) then
        tmp = 2.0d0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ** 3.0d0) / l) * (sin(k_m) / l)))
    else
        tmp = (-0.3333333333333333d0) * (((l / abs(k_m)) ** 2.0d0) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 21000000.0) {
		tmp = Math.pow((((l * Math.sqrt(2.0)) / Math.pow(k_m, 2.0)) * Math.sqrt((1.0 / t_m))), 2.0);
	} else if (k_m <= 1.3e+53) {
		tmp = 2.0 / ((Math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((Math.pow(t_m, 3.0) / l) * (Math.sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 21000000.0:
		tmp = math.pow((((l * math.sqrt(2.0)) / math.pow(k_m, 2.0)) * math.sqrt((1.0 / t_m))), 2.0)
	elif k_m <= 1.3e+53:
		tmp = 2.0 / ((math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((math.pow(t_m, 3.0) / l) * (math.sin(k_m) / l)))
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 21000000.0)
		tmp = Float64(Float64(Float64(l * sqrt(2.0)) / (k_m ^ 2.0)) * sqrt(Float64(1.0 / t_m))) ^ 2.0;
	elseif (k_m <= 1.3e+53)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(k_m / Float64(t_m * Float64(t_m / k_m)))) * Float64(Float64((t_m ^ 3.0) / l) * Float64(sin(k_m) / l))));
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 21000000.0)
		tmp = (((l * sqrt(2.0)) / (k_m ^ 2.0)) * sqrt((1.0 / t_m))) ^ 2.0;
	elseif (k_m <= 1.3e+53)
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ^ 3.0) / l) * (sin(k_m) / l)));
	else
		tmp = -0.3333333333333333 * (((l / abs(k_m)) ^ 2.0) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 21000000.0], N[Power[N[(N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 1.3e+53], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(k$95$m / N[(t$95$m * N[(t$95$m / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 21000000:\\
\;\;\;\;{\left(\frac{\ell \cdot \sqrt{2}}{{k_m}^{2}} \cdot \sqrt{\frac{1}{t_m}}\right)}^{2}\\

\mathbf{elif}\;k_m \leq 1.3 \cdot 10^{+53}:\\
\;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 2.1e7

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

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

    if 2.1e7 < k < 1.29999999999999999e53

    1. Initial program 13.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-*l*13.9%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \left(e^{\color{blue}{\mathsf{log1p}\left({\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)\right)} \]
      4. expm1-udef43.2%

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

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

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

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

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

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

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

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

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

    if 1.29999999999999999e53 < k

    1. Initial program 34.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*34.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. *-commutative34.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*34.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/34.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. +-commutative34.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. unpow234.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-neg34.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-neg34.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-neg34.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. unpow234.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+48.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-eval48.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-identity48.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. unpow248.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-neg48.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-neg48.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. Simplified48.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 0 59.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 61.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative61.9%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified61.8%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv61.8%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot \frac{1}{{k}^{2}}\right)} \]
      2. pow-flip61.9%

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} \]
    10. Step-by-step derivation
      1. expm1-log1p-u61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative60.9%

        \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
    11. Applied egg-rr60.9%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/61.8%

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

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified63.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 21000000:\\ \;\;\;\;{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}^{2}\\ \mathbf{elif}\;k \leq 1.3 \cdot 10^{+53}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right) \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 9: 72.9% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 48000000:\\ \;\;\;\;{\left({t_m}^{-0.5} \cdot \left(\ell \cdot \left(\sqrt{2} \cdot {k_m}^{-2}\right)\right)\right)}^{2}\\ \mathbf{elif}\;k_m \leq 6.8 \cdot 10^{+52}:\\ \;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 48000000.0)
    (pow (* (pow t_m -0.5) (* l (* (sqrt 2.0) (pow k_m -2.0)))) 2.0)
    (if (<= k_m 6.8e+52)
      (/
       2.0
       (*
        (* (tan k_m) (/ k_m (* t_m (/ t_m k_m))))
        (* (/ (pow t_m 3.0) l) (/ (sin k_m) l))))
      (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 48000000.0) {
		tmp = pow((pow(t_m, -0.5) * (l * (sqrt(2.0) * pow(k_m, -2.0)))), 2.0);
	} else if (k_m <= 6.8e+52) {
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((pow(t_m, 3.0) / l) * (sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 48000000.0d0) then
        tmp = ((t_m ** (-0.5d0)) * (l * (sqrt(2.0d0) * (k_m ** (-2.0d0))))) ** 2.0d0
    else if (k_m <= 6.8d+52) then
        tmp = 2.0d0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ** 3.0d0) / l) * (sin(k_m) / l)))
    else
        tmp = (-0.3333333333333333d0) * (((l / abs(k_m)) ** 2.0d0) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 48000000.0) {
		tmp = Math.pow((Math.pow(t_m, -0.5) * (l * (Math.sqrt(2.0) * Math.pow(k_m, -2.0)))), 2.0);
	} else if (k_m <= 6.8e+52) {
		tmp = 2.0 / ((Math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((Math.pow(t_m, 3.0) / l) * (Math.sin(k_m) / l)));
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 48000000.0:
		tmp = math.pow((math.pow(t_m, -0.5) * (l * (math.sqrt(2.0) * math.pow(k_m, -2.0)))), 2.0)
	elif k_m <= 6.8e+52:
		tmp = 2.0 / ((math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((math.pow(t_m, 3.0) / l) * (math.sin(k_m) / l)))
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 48000000.0)
		tmp = Float64((t_m ^ -0.5) * Float64(l * Float64(sqrt(2.0) * (k_m ^ -2.0)))) ^ 2.0;
	elseif (k_m <= 6.8e+52)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(k_m / Float64(t_m * Float64(t_m / k_m)))) * Float64(Float64((t_m ^ 3.0) / l) * Float64(sin(k_m) / l))));
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 48000000.0)
		tmp = ((t_m ^ -0.5) * (l * (sqrt(2.0) * (k_m ^ -2.0)))) ^ 2.0;
	elseif (k_m <= 6.8e+52)
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ^ 3.0) / l) * (sin(k_m) / l)));
	else
		tmp = -0.3333333333333333 * (((l / abs(k_m)) ^ 2.0) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 48000000.0], N[Power[N[(N[Power[t$95$m, -0.5], $MachinePrecision] * N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 6.8e+52], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(k$95$m / N[(t$95$m * N[(t$95$m / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 48000000:\\
\;\;\;\;{\left({t_m}^{-0.5} \cdot \left(\ell \cdot \left(\sqrt{2} \cdot {k_m}^{-2}\right)\right)\right)}^{2}\\

\mathbf{elif}\;k_m \leq 6.8 \cdot 10^{+52}:\\
\;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 4.8e7

    1. Initial program 32.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*32.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. *-commutative32.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*32.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.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. +-commutative32.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. unpow232.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-neg32.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-neg32.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-neg32.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. unpow232.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+39.4%

        \[\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-eval39.4%

        \[\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-identity39.4%

        \[\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. unpow239.4%

        \[\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-neg39.4%

        \[\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-neg39.4%

        \[\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. Simplified39.4%

      \[\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. Step-by-step derivation
      1. add-sqr-sqrt25.2%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/21.5%

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}}^{2} \]
    9. Step-by-step derivation
      1. add-log-exp28.8%

        \[\leadsto {\color{blue}{\log \left(e^{\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}}\right)}}^{2} \]
      2. exp-prod38.6%

        \[\leadsto {\log \color{blue}{\left({\left(e^{\frac{\ell \cdot \sqrt{2}}{{k}^{2}}}\right)}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}}^{2} \]
      3. div-inv38.6%

        \[\leadsto {\log \left({\left(e^{\color{blue}{\left(\ell \cdot \sqrt{2}\right) \cdot \frac{1}{{k}^{2}}}}\right)}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}^{2} \]
      4. pow-flip38.6%

        \[\leadsto {\log \left({\left(e^{\left(\ell \cdot \sqrt{2}\right) \cdot \color{blue}{{k}^{\left(-2\right)}}}\right)}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}^{2} \]
      5. metadata-eval38.6%

        \[\leadsto {\log \left({\left(e^{\left(\ell \cdot \sqrt{2}\right) \cdot {k}^{\color{blue}{-2}}}\right)}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}^{2} \]
      6. exp-prod34.1%

        \[\leadsto {\log \left({\color{blue}{\left({\left(e^{\ell \cdot \sqrt{2}}\right)}^{\left({k}^{-2}\right)}\right)}}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}^{2} \]
      7. exp-prod34.1%

        \[\leadsto {\log \left({\left({\color{blue}{\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}}^{\left({k}^{-2}\right)}\right)}^{\left(\sqrt{\frac{1}{t}}\right)}\right)}^{2} \]
      8. pow1/234.1%

        \[\leadsto {\log \left({\left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)}^{\color{blue}{\left({\left(\frac{1}{t}\right)}^{0.5}\right)}}\right)}^{2} \]
      9. inv-pow34.1%

        \[\leadsto {\log \left({\left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)}^{\left({\color{blue}{\left({t}^{-1}\right)}}^{0.5}\right)}\right)}^{2} \]
      10. pow-pow34.1%

        \[\leadsto {\log \left({\left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)}^{\color{blue}{\left({t}^{\left(-1 \cdot 0.5\right)}\right)}}\right)}^{2} \]
      11. metadata-eval34.1%

        \[\leadsto {\log \left({\left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)}^{\left({t}^{\color{blue}{-0.5}}\right)}\right)}^{2} \]
    10. Applied egg-rr34.1%

      \[\leadsto {\color{blue}{\log \left({\left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)}^{\left({t}^{-0.5}\right)}\right)}}^{2} \]
    11. Step-by-step derivation
      1. log-pow23.4%

        \[\leadsto {\color{blue}{\left({t}^{-0.5} \cdot \log \left({\left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)}^{\left({k}^{-2}\right)}\right)\right)}}^{2} \]
      2. log-pow21.3%

        \[\leadsto {\left({t}^{-0.5} \cdot \color{blue}{\left({k}^{-2} \cdot \log \left({\left(e^{\ell}\right)}^{\left(\sqrt{2}\right)}\right)\right)}\right)}^{2} \]
      3. log-pow21.3%

        \[\leadsto {\left({t}^{-0.5} \cdot \left({k}^{-2} \cdot \color{blue}{\left(\sqrt{2} \cdot \log \left(e^{\ell}\right)\right)}\right)\right)}^{2} \]
      4. rem-log-exp35.0%

        \[\leadsto {\left({t}^{-0.5} \cdot \left({k}^{-2} \cdot \left(\sqrt{2} \cdot \color{blue}{\ell}\right)\right)\right)}^{2} \]
      5. *-commutative35.0%

        \[\leadsto {\left({t}^{-0.5} \cdot \left({k}^{-2} \cdot \color{blue}{\left(\ell \cdot \sqrt{2}\right)}\right)\right)}^{2} \]
      6. *-commutative35.0%

        \[\leadsto {\left({t}^{-0.5} \cdot \color{blue}{\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k}^{-2}\right)}\right)}^{2} \]
      7. associate-*l*35.0%

        \[\leadsto {\left({t}^{-0.5} \cdot \color{blue}{\left(\ell \cdot \left(\sqrt{2} \cdot {k}^{-2}\right)\right)}\right)}^{2} \]
    12. Simplified35.0%

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

    if 4.8e7 < k < 6.8e52

    1. Initial program 13.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-*l*13.9%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \left(\tan k \cdot \left(e^{\color{blue}{\mathsf{log1p}\left({\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)\right)} \]
      4. expm1-udef43.2%

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

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

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

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

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

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

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

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

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

    if 6.8e52 < k

    1. Initial program 34.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*34.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. *-commutative34.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*34.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/34.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. +-commutative34.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. unpow234.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-neg34.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-neg34.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-neg34.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. unpow234.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+48.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-eval48.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-identity48.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. unpow248.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-neg48.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-neg48.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. Simplified48.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 0 59.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 61.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative61.9%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified61.8%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv61.8%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot \frac{1}{{k}^{2}}\right)} \]
      2. pow-flip61.9%

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} \]
    10. Step-by-step derivation
      1. expm1-log1p-u61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative60.9%

        \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
    11. Applied egg-rr60.9%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def61.0%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/61.8%

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

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified63.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 48000000:\\ \;\;\;\;{\left({t}^{-0.5} \cdot \left(\ell \cdot \left(\sqrt{2} \cdot {k}^{-2}\right)\right)\right)}^{2}\\ \mathbf{elif}\;k \leq 6.8 \cdot 10^{+52}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right) \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 10: 72.8% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 5.4 \cdot 10^{-93}:\\ \;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\ \mathbf{elif}\;t_m \leq 1.28 \cdot 10^{+95}:\\ \;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{2}}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 5.4e-93)
    (* (/ 1.0 t_m) (pow (* (* l (sqrt 2.0)) (pow k_m -2.0)) 2.0))
    (if (<= t_m 1.28e+95)
      (/
       2.0
       (*
        (* (tan k_m) (/ k_m (* t_m (/ t_m k_m))))
        (* (/ (pow t_m 3.0) l) (/ (sin k_m) l))))
      (/ 2.0 (/ (* t_m (pow k_m 2.0)) (pow (/ l (fabs k_m)) 2.0)))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 5.4e-93) {
		tmp = (1.0 / t_m) * pow(((l * sqrt(2.0)) * pow(k_m, -2.0)), 2.0);
	} else if (t_m <= 1.28e+95) {
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((pow(t_m, 3.0) / l) * (sin(k_m) / l)));
	} else {
		tmp = 2.0 / ((t_m * pow(k_m, 2.0)) / pow((l / fabs(k_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t_m <= 5.4d-93) then
        tmp = (1.0d0 / t_m) * (((l * sqrt(2.0d0)) * (k_m ** (-2.0d0))) ** 2.0d0)
    else if (t_m <= 1.28d+95) then
        tmp = 2.0d0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ** 3.0d0) / l) * (sin(k_m) / l)))
    else
        tmp = 2.0d0 / ((t_m * (k_m ** 2.0d0)) / ((l / abs(k_m)) ** 2.0d0))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 5.4e-93) {
		tmp = (1.0 / t_m) * Math.pow(((l * Math.sqrt(2.0)) * Math.pow(k_m, -2.0)), 2.0);
	} else if (t_m <= 1.28e+95) {
		tmp = 2.0 / ((Math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((Math.pow(t_m, 3.0) / l) * (Math.sin(k_m) / l)));
	} else {
		tmp = 2.0 / ((t_m * Math.pow(k_m, 2.0)) / Math.pow((l / Math.abs(k_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if t_m <= 5.4e-93:
		tmp = (1.0 / t_m) * math.pow(((l * math.sqrt(2.0)) * math.pow(k_m, -2.0)), 2.0)
	elif t_m <= 1.28e+95:
		tmp = 2.0 / ((math.tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * ((math.pow(t_m, 3.0) / l) * (math.sin(k_m) / l)))
	else:
		tmp = 2.0 / ((t_m * math.pow(k_m, 2.0)) / math.pow((l / math.fabs(k_m)), 2.0))
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (t_m <= 5.4e-93)
		tmp = Float64(Float64(1.0 / t_m) * (Float64(Float64(l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0));
	elseif (t_m <= 1.28e+95)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(k_m / Float64(t_m * Float64(t_m / k_m)))) * Float64(Float64((t_m ^ 3.0) / l) * Float64(sin(k_m) / l))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m * (k_m ^ 2.0)) / (Float64(l / abs(k_m)) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (t_m <= 5.4e-93)
		tmp = (1.0 / t_m) * (((l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0);
	elseif (t_m <= 1.28e+95)
		tmp = 2.0 / ((tan(k_m) * (k_m / (t_m * (t_m / k_m)))) * (((t_m ^ 3.0) / l) * (sin(k_m) / l)));
	else
		tmp = 2.0 / ((t_m * (k_m ^ 2.0)) / ((l / abs(k_m)) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 5.4e-93], N[(N[(1.0 / t$95$m), $MachinePrecision] * N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.28e+95], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(k$95$m / N[(t$95$m * N[(t$95$m / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 5.4 \cdot 10^{-93}:\\
\;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\

\mathbf{elif}\;t_m \leq 1.28 \cdot 10^{+95}:\\
\;\;\;\;\frac{2}{\left(\tan k_m \cdot \frac{k_m}{t_m \cdot \frac{t_m}{k_m}}\right) \cdot \left(\frac{{t_m}^{3}}{\ell} \cdot \frac{\sin k_m}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{2}}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 5.4000000000000002e-93

    1. Initial program 30.7%

      \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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/30.7%

        \[\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. +-commutative30.7%

        \[\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. unpow230.7%

        \[\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-neg30.7%

        \[\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-neg30.7%

        \[\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-neg30.7%

        \[\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. unpow230.7%

        \[\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+39.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-eval39.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-identity39.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. unpow239.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-neg39.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-neg39.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. Simplified39.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. Step-by-step derivation
      1. add-sqr-sqrt23.3%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow27.9%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/7.9%

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}}^{2} \]
    9. Step-by-step derivation
      1. unpow-prod-down12.6%

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

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

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

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

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

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

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

    if 5.4000000000000002e-93 < t < 1.28000000000000006e95

    1. Initial program 52.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-*l*52.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.28000000000000006e95 < t

    1. Initial program 14.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-*l*14.6%

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Step-by-step derivation
      1. clear-num74.0%

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      2. inv-pow74.0%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    10. Simplified74.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    11. Step-by-step derivation
      1. inv-pow74.0%

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

        \[\leadsto \frac{2}{{\color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}}^{-1} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. unpow-prod-down73.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \sqrt{\color{blue}{{k}^{\left(\frac{-2}{2}\right)} \cdot {k}^{\left(\frac{-2}{2}\right)}}}\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. rem-sqrt-square87.9%

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

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

        \[\leadsto \frac{2}{{\left(\ell \cdot \left|\color{blue}{\frac{1}{k}}\right|\right)}^{\left(2 \cdot -1\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      6. metadata-eval87.9%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\ell \cdot \left|\frac{1}{k}\right|\right)}^{-2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    15. Taylor expanded in k around 0 67.0%

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

        \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{2}}}{{\ell}^{2} \cdot {\left(\left|\frac{1}{k}\right|\right)}^{2}}} \]
      2. unpow267.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot {\left(\left|\frac{1}{k}\right|\right)}^{2}}} \]
      3. fabs-div67.0%

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

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\left(\ell \cdot \ell\right) \cdot {\left(\frac{\color{blue}{1}}{\left|k\right|}\right)}^{2}}} \]
      5. unpow267.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\left(\ell \cdot \ell\right) \cdot \color{blue}{\left(\frac{1}{\left|k\right|} \cdot \frac{1}{\left|k\right|}\right)}}} \]
      6. swap-sqr76.6%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{\left(\ell \cdot \frac{1}{\left|k\right|}\right) \cdot \left(\ell \cdot \frac{1}{\left|k\right|}\right)}}} \]
      7. unpow176.6%

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

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{{\left(\ell \cdot \frac{1}{\left|k\right|}\right)}^{\left(1 + 1\right)}}}} \]
      9. associate-*r/76.6%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\color{blue}{\left(\frac{\ell \cdot 1}{\left|k\right|}\right)}}^{\left(1 + 1\right)}}} \]
      10. *-rgt-identity76.6%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\color{blue}{\ell}}{\left|k\right|}\right)}^{\left(1 + 1\right)}}} \]
      11. metadata-eval76.6%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\ell}{\left|k\right|}\right)}^{\color{blue}{2}}}} \]
    17. Simplified76.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.4 \cdot 10^{-93}:\\ \;\;\;\;\frac{1}{t} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k}^{-2}\right)}^{2}\\ \mathbf{elif}\;t \leq 1.28 \cdot 10^{+95}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right) \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}}\\ \end{array} \]

Alternative 11: 69.6% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-49}:\\ \;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\ell}^{2} \cdot \frac{2}{t_m}}{{k_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= (* l l) 2e-49)
    (* (/ 1.0 t_m) (pow (* (* l (sqrt 2.0)) (pow k_m -2.0)) 2.0))
    (/ (* (pow l 2.0) (/ 2.0 t_m)) (pow k_m 4.0)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if ((l * l) <= 2e-49) {
		tmp = (1.0 / t_m) * pow(((l * sqrt(2.0)) * pow(k_m, -2.0)), 2.0);
	} else {
		tmp = (pow(l, 2.0) * (2.0 / t_m)) / pow(k_m, 4.0);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if ((l * l) <= 2d-49) then
        tmp = (1.0d0 / t_m) * (((l * sqrt(2.0d0)) * (k_m ** (-2.0d0))) ** 2.0d0)
    else
        tmp = ((l ** 2.0d0) * (2.0d0 / t_m)) / (k_m ** 4.0d0)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if ((l * l) <= 2e-49) {
		tmp = (1.0 / t_m) * Math.pow(((l * Math.sqrt(2.0)) * Math.pow(k_m, -2.0)), 2.0);
	} else {
		tmp = (Math.pow(l, 2.0) * (2.0 / t_m)) / Math.pow(k_m, 4.0);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if (l * l) <= 2e-49:
		tmp = (1.0 / t_m) * math.pow(((l * math.sqrt(2.0)) * math.pow(k_m, -2.0)), 2.0)
	else:
		tmp = (math.pow(l, 2.0) * (2.0 / t_m)) / math.pow(k_m, 4.0)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (Float64(l * l) <= 2e-49)
		tmp = Float64(Float64(1.0 / t_m) * (Float64(Float64(l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0));
	else
		tmp = Float64(Float64((l ^ 2.0) * Float64(2.0 / t_m)) / (k_m ^ 4.0));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if ((l * l) <= 2e-49)
		tmp = (1.0 / t_m) * (((l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0);
	else
		tmp = ((l ^ 2.0) * (2.0 / t_m)) / (k_m ^ 4.0);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 2e-49], N[(N[(1.0 / t$95$m), $MachinePrecision] * N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / t$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{-49}:\\
\;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{2} \cdot \frac{2}{t_m}}{{k_m}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 1.99999999999999987e-49

    1. Initial program 28.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*28.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. *-commutative28.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*28.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/28.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. +-commutative28.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. unpow228.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-neg28.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-neg28.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-neg28.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. unpow228.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+41.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-eval41.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-identity41.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. unpow241.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-neg41.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-neg41.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. Simplified41.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. Step-by-step derivation
      1. add-sqr-sqrt37.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow213.8%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/13.8%

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}}^{2} \]
    9. Step-by-step derivation
      1. unpow-prod-down39.3%

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

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

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

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

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

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

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

    if 1.99999999999999987e-49 < (*.f64 l l)

    1. Initial program 34.4%

      \[\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-*l*34.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{t} \cdot {\ell}^{2}}{{k}^{4}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.1%

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

Alternative 12: 70.8% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;t_m \leq 2.1 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{2}}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.1e+76)
    (* (/ 1.0 t_m) (pow (* (* l (sqrt 2.0)) (pow k_m -2.0)) 2.0))
    (/ 2.0 (/ (* t_m (pow k_m 2.0)) (pow (/ l (fabs k_m)) 2.0))))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 2.1e+76) {
		tmp = (1.0 / t_m) * pow(((l * sqrt(2.0)) * pow(k_m, -2.0)), 2.0);
	} else {
		tmp = 2.0 / ((t_m * pow(k_m, 2.0)) / pow((l / fabs(k_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t_m <= 2.1d+76) then
        tmp = (1.0d0 / t_m) * (((l * sqrt(2.0d0)) * (k_m ** (-2.0d0))) ** 2.0d0)
    else
        tmp = 2.0d0 / ((t_m * (k_m ** 2.0d0)) / ((l / abs(k_m)) ** 2.0d0))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 2.1e+76) {
		tmp = (1.0 / t_m) * Math.pow(((l * Math.sqrt(2.0)) * Math.pow(k_m, -2.0)), 2.0);
	} else {
		tmp = 2.0 / ((t_m * Math.pow(k_m, 2.0)) / Math.pow((l / Math.abs(k_m)), 2.0));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if t_m <= 2.1e+76:
		tmp = (1.0 / t_m) * math.pow(((l * math.sqrt(2.0)) * math.pow(k_m, -2.0)), 2.0)
	else:
		tmp = 2.0 / ((t_m * math.pow(k_m, 2.0)) / math.pow((l / math.fabs(k_m)), 2.0))
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (t_m <= 2.1e+76)
		tmp = Float64(Float64(1.0 / t_m) * (Float64(Float64(l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m * (k_m ^ 2.0)) / (Float64(l / abs(k_m)) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (t_m <= 2.1e+76)
		tmp = (1.0 / t_m) * (((l * sqrt(2.0)) * (k_m ^ -2.0)) ^ 2.0);
	else
		tmp = 2.0 / ((t_m * (k_m ^ 2.0)) / ((l / abs(k_m)) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 2.1e+76], N[(N[(1.0 / t$95$m), $MachinePrecision] * N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, -2.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;t_m \leq 2.1 \cdot 10^{+76}:\\
\;\;\;\;\frac{1}{t_m} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k_m}^{-2}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{2}}{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.10000000000000007e76

    1. Initial program 33.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*33.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. *-commutative33.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*33.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/33.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. +-commutative33.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. unpow233.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-neg33.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-neg33.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-neg33.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. unpow233.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+42.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-eval42.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-identity42.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. unpow242.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-neg42.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-neg42.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. Simplified42.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. Step-by-step derivation
      1. add-sqr-sqrt29.0%

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}} \cdot \frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}} \]
    6. Step-by-step derivation
      1. unpow214.7%

        \[\leadsto \color{blue}{{\left(\frac{\frac{\sqrt{\frac{2}{\sin k}}}{\frac{{t}^{1.5} \cdot \sqrt{\tan k}}{\ell}}}{\frac{k}{t}}\right)}^{2}} \]
      2. associate-/l/14.7%

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{{k}^{2}} \cdot \sqrt{\frac{1}{t}}\right)}}^{2} \]
    9. Step-by-step derivation
      1. unpow-prod-down21.0%

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

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

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

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

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

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

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

    if 2.10000000000000007e76 < t

    1. Initial program 19.7%

      \[\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-*l*19.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      2. inv-pow76.7%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{1}{\frac{{\ell}^{2}}{{k}^{2}}}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    11. Step-by-step derivation
      1. inv-pow76.7%

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

        \[\leadsto \frac{2}{{\color{blue}{\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}} \cdot \sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}}^{-1} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      3. unpow-prod-down76.5%

        \[\leadsto \frac{2}{\color{blue}{\left({\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      4. div-inv76.6%

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

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

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

        \[\leadsto \frac{2}{\left({\left(\color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)} \cdot \sqrt{\frac{1}{{k}^{2}}}\right)}^{-1} \cdot {\left(\sqrt{\frac{{\ell}^{2}}{{k}^{2}}}\right)}^{-1}\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
      8. add-sqr-sqrt50.9%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left({\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1} \cdot {\left(\ell \cdot \sqrt{{k}^{-2}}\right)}^{-1}\right)} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    13. Step-by-step derivation
      1. pow-sqr85.8%

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\ell \cdot \left|\frac{1}{k}\right|\right)}^{-2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}} \]
    15. Taylor expanded in k around 0 66.5%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2} \cdot {\left(\left|\frac{1}{k}\right|\right)}^{2}}}} \]
    16. Step-by-step derivation
      1. *-commutative66.5%

        \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot {k}^{2}}}{{\ell}^{2} \cdot {\left(\left|\frac{1}{k}\right|\right)}^{2}}} \]
      2. unpow266.5%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot {\left(\left|\frac{1}{k}\right|\right)}^{2}}} \]
      3. fabs-div66.5%

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

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\left(\ell \cdot \ell\right) \cdot {\left(\frac{\color{blue}{1}}{\left|k\right|}\right)}^{2}}} \]
      5. unpow266.5%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\left(\ell \cdot \ell\right) \cdot \color{blue}{\left(\frac{1}{\left|k\right|} \cdot \frac{1}{\left|k\right|}\right)}}} \]
      6. swap-sqr75.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{\left(\ell \cdot \frac{1}{\left|k\right|}\right) \cdot \left(\ell \cdot \frac{1}{\left|k\right|}\right)}}} \]
      7. unpow175.0%

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

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\color{blue}{{\left(\ell \cdot \frac{1}{\left|k\right|}\right)}^{\left(1 + 1\right)}}}} \]
      9. associate-*r/75.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\color{blue}{\left(\frac{\ell \cdot 1}{\left|k\right|}\right)}}^{\left(1 + 1\right)}}} \]
      10. *-rgt-identity75.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\color{blue}{\ell}}{\left|k\right|}\right)}^{\left(1 + 1\right)}}} \]
      11. metadata-eval75.0%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\ell}{\left|k\right|}\right)}^{\color{blue}{2}}}} \]
    17. Simplified75.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.1 \cdot 10^{+76}:\\ \;\;\;\;\frac{1}{t} \cdot {\left(\left(\ell \cdot \sqrt{2}\right) \cdot {k}^{-2}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}}\\ \end{array} \]

Alternative 13: 68.7% accurate, 1.4× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 5.4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t_m \cdot {k_m}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 5.4e+14)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k_m 4.0))))) 2.0)
    (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 5.4e+14) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k_m, 4.0))))), 2.0);
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 5.4d+14) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k_m ** 4.0d0))))) ** 2.0d0
    else
        tmp = (-0.3333333333333333d0) * (((l / abs(k_m)) ** 2.0d0) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 5.4e+14) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k_m, 4.0))))), 2.0);
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 5.4e+14:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k_m, 4.0))))), 2.0)
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 5.4e+14)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k_m ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 5.4e+14)
		tmp = (l * sqrt((2.0 / (t_m * (k_m ^ 4.0))))) ^ 2.0;
	else
		tmp = -0.3333333333333333 * (((l / abs(k_m)) ^ 2.0) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 5.4e+14], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 5.4 \cdot 10^{+14}:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t_m \cdot {k_m}^{4}}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 5.4e14

    1. Initial program 31.7%

      \[\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-*l*31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.4e14 < k

    1. Initial program 30.1%

      \[\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.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. *-commutative30.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*30.1%

        \[\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/30.1%

        \[\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. +-commutative30.1%

        \[\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. unpow230.1%

        \[\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-neg30.1%

        \[\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-neg30.1%

        \[\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-neg30.1%

        \[\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. unpow230.1%

        \[\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 0 50.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 55.8%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}} \]
    6. Step-by-step derivation
      1. *-commutative55.8%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified55.7%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv55.7%

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

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} \]
    10. Step-by-step derivation
      1. expm1-log1p-u51.5%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative51.1%

        \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
    11. Applied egg-rr51.1%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def51.5%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/55.6%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{k}^{-2} \cdot {\ell}^{2}}{t}} \]
      4. *-commutative55.6%

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified56.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.4 \cdot 10^{+14}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 14: 63.2% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 2.25 \cdot 10^{+48}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{2}{t_m \cdot {k_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 2.25e+48)
    (* (pow l 2.0) (/ 2.0 (* t_m (pow k_m 4.0))))
    (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.25e+48) {
		tmp = pow(l, 2.0) * (2.0 / (t_m * pow(k_m, 4.0)));
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.25d+48) then
        tmp = (l ** 2.0d0) * (2.0d0 / (t_m * (k_m ** 4.0d0)))
    else
        tmp = (-0.3333333333333333d0) * (((l / abs(k_m)) ** 2.0d0) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.25e+48) {
		tmp = Math.pow(l, 2.0) * (2.0 / (t_m * Math.pow(k_m, 4.0)));
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 2.25e+48:
		tmp = math.pow(l, 2.0) * (2.0 / (t_m * math.pow(k_m, 4.0)))
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 2.25e+48)
		tmp = Float64((l ^ 2.0) * Float64(2.0 / Float64(t_m * (k_m ^ 4.0))));
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.25e+48)
		tmp = (l ^ 2.0) * (2.0 / (t_m * (k_m ^ 4.0)));
	else
		tmp = -0.3333333333333333 * (((l / abs(k_m)) ^ 2.0) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.25e+48], N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 2.25 \cdot 10^{+48}:\\
\;\;\;\;{\ell}^{2} \cdot \frac{2}{t_m \cdot {k_m}^{4}}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 2.24999999999999998e48

    1. Initial program 30.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-*l*30.3%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{t \cdot {k}^{4}}} \cdot {\ell}^{2} \]
    6. Applied egg-rr57.3%

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

    if 2.24999999999999998e48 < k

    1. Initial program 35.5%

      \[\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*35.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. *-commutative35.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*35.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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+49.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-eval49.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-identity49.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. unpow249.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-neg49.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-neg49.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. Simplified49.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 0 58.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 61.1%

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

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified61.0%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv61.0%

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

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative59.7%

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def59.8%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/60.9%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{k}^{-2} \cdot {\ell}^{2}}{t}} \]
      4. *-commutative60.9%

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified62.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2.25 \cdot 10^{+48}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{2}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 15: 63.3% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 2.25 \cdot 10^{+48}:\\ \;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= k_m 2.25e+48)
    (/ 2.0 (/ (* t_m (pow k_m 4.0)) (pow l 2.0)))
    (* -0.3333333333333333 (/ (pow (/ l (fabs k_m)) 2.0) t_m)))))
k_m = fabs(k);
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.25e+48) {
		tmp = 2.0 / ((t_m * pow(k_m, 4.0)) / pow(l, 2.0));
	} else {
		tmp = -0.3333333333333333 * (pow((l / fabs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.25d+48) then
        tmp = 2.0d0 / ((t_m * (k_m ** 4.0d0)) / (l ** 2.0d0))
    else
        tmp = (-0.3333333333333333d0) * (((l / abs(k_m)) ** 2.0d0) / t_m)
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (k_m <= 2.25e+48) {
		tmp = 2.0 / ((t_m * Math.pow(k_m, 4.0)) / Math.pow(l, 2.0));
	} else {
		tmp = -0.3333333333333333 * (Math.pow((l / Math.abs(k_m)), 2.0) / t_m);
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if k_m <= 2.25e+48:
		tmp = 2.0 / ((t_m * math.pow(k_m, 4.0)) / math.pow(l, 2.0))
	else:
		tmp = -0.3333333333333333 * (math.pow((l / math.fabs(k_m)), 2.0) / t_m)
	return t_s * tmp
k_m = abs(k)
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (k_m <= 2.25e+48)
		tmp = Float64(2.0 / Float64(Float64(t_m * (k_m ^ 4.0)) / (l ^ 2.0)));
	else
		tmp = Float64(-0.3333333333333333 * Float64((Float64(l / abs(k_m)) ^ 2.0) / t_m));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.25e+48)
		tmp = 2.0 / ((t_m * (k_m ^ 4.0)) / (l ^ 2.0));
	else
		tmp = -0.3333333333333333 * (((l / abs(k_m)) ^ 2.0) / t_m);
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $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_, k$95$m_] := N[(t$95$s * If[LessEqual[k$95$m, 2.25e+48], N[(2.0 / N[(N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.3333333333333333 * N[(N[Power[N[(l / N[Abs[k$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \begin{array}{l}
\mathbf{if}\;k_m \leq 2.25 \cdot 10^{+48}:\\
\;\;\;\;\frac{2}{\frac{t_m \cdot {k_m}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 2.24999999999999998e48

    1. Initial program 30.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-*l*30.3%

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

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

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

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

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

    if 2.24999999999999998e48 < k

    1. Initial program 35.5%

      \[\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*35.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. *-commutative35.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*35.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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.5%

        \[\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+49.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-eval49.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-identity49.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. unpow249.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-neg49.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-neg49.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. Simplified49.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 0 58.9%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    5. Taylor expanded in k around inf 61.1%

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

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    7. Simplified61.0%

      \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
    8. Step-by-step derivation
      1. div-inv61.0%

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

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
      3. *-commutative59.7%

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
    12. Step-by-step derivation
      1. expm1-def59.8%

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

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
      3. associate-*r/60.9%

        \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{k}^{-2} \cdot {\ell}^{2}}{t}} \]
      4. *-commutative60.9%

        \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
    13. Simplified62.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2.25 \cdot 10^{+48}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}\\ \end{array} \]

Alternative 16: 34.3% accurate, 2.0× speedup?

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

\\
t_s \cdot \left(-0.3333333333333333 \cdot \frac{{\left(\frac{\ell}{\left|k_m\right|}\right)}^{2}}{t_m}\right)
\end{array}
Derivation
  1. Initial program 31.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*31.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. *-commutative31.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*31.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/31.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. +-commutative31.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. unpow231.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-neg31.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-neg31.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-neg31.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. unpow231.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+41.4%

      \[\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-eval41.4%

      \[\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-identity41.4%

      \[\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. unpow241.4%

      \[\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-neg41.4%

      \[\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-neg41.4%

      \[\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. Simplified41.4%

    \[\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 39.4%

    \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  5. Taylor expanded in k around inf 33.3%

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
  7. Simplified33.2%

    \[\leadsto \color{blue}{-0.3333333333333333 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{2}}} \]
  8. Step-by-step derivation
    1. div-inv33.2%

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

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

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

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{{\ell}^{2}}{t} \cdot {k}^{-2}\right)} - 1\right)} \]
    3. *-commutative31.4%

      \[\leadsto -0.3333333333333333 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{{k}^{-2} \cdot \frac{{\ell}^{2}}{t}}\right)} - 1\right) \]
  11. Applied egg-rr31.4%

    \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} - 1\right)} \]
  12. Step-by-step derivation
    1. expm1-def31.8%

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\left({k}^{-2} \cdot \frac{{\ell}^{2}}{t}\right)} \]
    3. associate-*r/33.3%

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{k}^{-2} \cdot {\ell}^{2}}{t}} \]
    4. *-commutative33.3%

      \[\leadsto -0.3333333333333333 \cdot \frac{\color{blue}{{\ell}^{2} \cdot {k}^{-2}}}{t} \]
  13. Simplified34.7%

    \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{{\left(\frac{\ell}{\left|k\right|}\right)}^{2}}{t}} \]
  14. Final simplification34.7%

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

Reproduce

?
herbie shell --seed 2023332 
(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))))