Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.2% → 98.3%
Time: 19.9s
Alternatives: 12
Speedup: 3.8×

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 12 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.2% 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: 98.3% 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 4.8 \cdot 10^{-18}:\\ \;\;\;\;\frac{2}{{\left(\frac{k_m \cdot \sqrt{\frac{t_m}{\cos k_m}}}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\left(\frac{1}{\frac{k_m}{\frac{\ell}{\sqrt{t_m}}}}\right)}^{2} \cdot \frac{\cos k_m}{{\sin k_m}^{2}}\right)\\ \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 4.8e-18)
    (/ 2.0 (pow (/ (* k_m (sqrt (/ t_m (cos k_m)))) (/ l (sin k_m))) 2.0))
    (*
     2.0
     (*
      (pow (/ 1.0 (/ k_m (/ l (sqrt t_m)))) 2.0)
      (/ (cos k_m) (pow (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 <= 4.8e-18) {
		tmp = 2.0 / pow(((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))), 2.0);
	} else {
		tmp = 2.0 * (pow((1.0 / (k_m / (l / sqrt(t_m)))), 2.0) * (cos(k_m) / pow(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 <= 4.8d-18) then
        tmp = 2.0d0 / (((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))) ** 2.0d0)
    else
        tmp = 2.0d0 * (((1.0d0 / (k_m / (l / sqrt(t_m)))) ** 2.0d0) * (cos(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 <= 4.8e-18) {
		tmp = 2.0 / Math.pow(((k_m * Math.sqrt((t_m / Math.cos(k_m)))) / (l / Math.sin(k_m))), 2.0);
	} else {
		tmp = 2.0 * (Math.pow((1.0 / (k_m / (l / Math.sqrt(t_m)))), 2.0) * (Math.cos(k_m) / Math.pow(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 <= 4.8e-18:
		tmp = 2.0 / math.pow(((k_m * math.sqrt((t_m / math.cos(k_m)))) / (l / math.sin(k_m))), 2.0)
	else:
		tmp = 2.0 * (math.pow((1.0 / (k_m / (l / math.sqrt(t_m)))), 2.0) * (math.cos(k_m) / math.pow(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 <= 4.8e-18)
		tmp = Float64(2.0 / (Float64(Float64(k_m * sqrt(Float64(t_m / cos(k_m)))) / Float64(l / sin(k_m))) ^ 2.0));
	else
		tmp = Float64(2.0 * Float64((Float64(1.0 / Float64(k_m / Float64(l / sqrt(t_m)))) ^ 2.0) * Float64(cos(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 <= 4.8e-18)
		tmp = 2.0 / (((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))) ^ 2.0);
	else
		tmp = 2.0 * (((1.0 / (k_m / (l / sqrt(t_m)))) ^ 2.0) * (cos(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, 4.8e-18], N[(2.0 / N[Power[N[(N[(k$95$m * N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[N[(1.0 / N[(k$95$m / N[(l / N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[N[Sin[k$95$m], $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 4.8 \cdot 10^{-18}:\\
\;\;\;\;\frac{2}{{\left(\frac{k_m \cdot \sqrt{\frac{t_m}{\cos k_m}}}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\

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


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

    1. Initial program 39.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*39.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/39.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+39.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. Simplified39.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. add-sqr-sqrt13.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow213.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr14.8%

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

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

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

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

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

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

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

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

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

    if 4.79999999999999988e-18 < k

    1. Initial program 34.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*34.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. *-commutative34.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*34.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/34.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. +-commutative34.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. unpow234.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-neg34.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-neg34.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-neg34.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. unpow234.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+41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(e^{\mathsf{log1p}\left({\left(\frac{\ell}{\color{blue}{\left(\sqrt{k} \cdot \sqrt{k}\right)} \cdot \sqrt{t}}\right)}^{2}\right)} - 1\right) \cdot \frac{\cos k}{{\sin k}^{2}}\right) \]
      13. add-sqr-sqrt37.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.4% 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 3.7 \cdot 10^{-17}:\\ \;\;\;\;\frac{2}{{\left(\frac{k_m \cdot \sqrt{\frac{t_m}{\cos k_m}}}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{\cos k_m}{{\sin k_m}^{2}} \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}}\right)}^{2}\right)\\ \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 3.7e-17)
    (/ 2.0 (pow (/ (* k_m (sqrt (/ t_m (cos k_m)))) (/ l (sin k_m))) 2.0))
    (*
     2.0
     (*
      (/ (cos k_m) (pow (sin k_m) 2.0))
      (pow (/ l (* k_m (sqrt t_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 <= 3.7e-17) {
		tmp = 2.0 / pow(((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))), 2.0);
	} else {
		tmp = 2.0 * ((cos(k_m) / pow(sin(k_m), 2.0)) * pow((l / (k_m * sqrt(t_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 <= 3.7d-17) then
        tmp = 2.0d0 / (((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))) ** 2.0d0)
    else
        tmp = 2.0d0 * ((cos(k_m) / (sin(k_m) ** 2.0d0)) * ((l / (k_m * sqrt(t_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 <= 3.7e-17) {
		tmp = 2.0 / Math.pow(((k_m * Math.sqrt((t_m / Math.cos(k_m)))) / (l / Math.sin(k_m))), 2.0);
	} else {
		tmp = 2.0 * ((Math.cos(k_m) / Math.pow(Math.sin(k_m), 2.0)) * Math.pow((l / (k_m * Math.sqrt(t_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 <= 3.7e-17:
		tmp = 2.0 / math.pow(((k_m * math.sqrt((t_m / math.cos(k_m)))) / (l / math.sin(k_m))), 2.0)
	else:
		tmp = 2.0 * ((math.cos(k_m) / math.pow(math.sin(k_m), 2.0)) * math.pow((l / (k_m * math.sqrt(t_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 <= 3.7e-17)
		tmp = Float64(2.0 / (Float64(Float64(k_m * sqrt(Float64(t_m / cos(k_m)))) / Float64(l / sin(k_m))) ^ 2.0));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k_m) / (sin(k_m) ^ 2.0)) * (Float64(l / Float64(k_m * sqrt(t_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 <= 3.7e-17)
		tmp = 2.0 / (((k_m * sqrt((t_m / cos(k_m)))) / (l / sin(k_m))) ^ 2.0);
	else
		tmp = 2.0 * ((cos(k_m) / (sin(k_m) ^ 2.0)) * ((l / (k_m * sqrt(t_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, 3.7e-17], N[(2.0 / N[Power[N[(N[(k$95$m * N[Sqrt[N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(l / N[(k$95$m * N[Sqrt[t$95$m], $MachinePrecision]), $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}\;k_m \leq 3.7 \cdot 10^{-17}:\\
\;\;\;\;\frac{2}{{\left(\frac{k_m \cdot \sqrt{\frac{t_m}{\cos k_m}}}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\

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


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

    1. Initial program 39.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*39.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/39.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+39.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. Simplified39.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. add-sqr-sqrt13.7%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow213.7%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr14.8%

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

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

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

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

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

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

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

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

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

    if 3.6999999999999997e-17 < k

    1. Initial program 34.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*34.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. *-commutative34.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*34.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/34.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. +-commutative34.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. unpow234.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-neg34.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-neg34.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-neg34.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. unpow234.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+41.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(e^{\mathsf{log1p}\left({\left(\frac{\ell}{\color{blue}{\left(\sqrt{k} \cdot \sqrt{k}\right)} \cdot \sqrt{t}}\right)}^{2}\right)} - 1\right) \cdot \frac{\cos k}{{\sin k}^{2}}\right) \]
      13. add-sqr-sqrt37.0%

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

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

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

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

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

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

Alternative 3: 94.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) \\ \begin{array}{l} t_2 := \frac{t_m}{\cos k_m}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 14:\\ \;\;\;\;2 \cdot {\left(\sin k_m \cdot \left(\sqrt{t_2} \cdot \frac{k_m}{\ell}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t_2 \cdot {\left(\sin k_m \cdot \frac{k_m}{\ell}\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 (/ t_m (cos k_m))))
   (*
    t_s
    (if (<= k_m 14.0)
      (* 2.0 (pow (* (sin k_m) (* (sqrt t_2) (/ k_m l))) -2.0))
      (/ 2.0 (* t_2 (pow (* (sin k_m) (/ k_m l)) 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 = t_m / cos(k_m);
	double tmp;
	if (k_m <= 14.0) {
		tmp = 2.0 * pow((sin(k_m) * (sqrt(t_2) * (k_m / l))), -2.0);
	} else {
		tmp = 2.0 / (t_2 * pow((sin(k_m) * (k_m / l)), 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) :: tmp
    t_2 = t_m / cos(k_m)
    if (k_m <= 14.0d0) then
        tmp = 2.0d0 * ((sin(k_m) * (sqrt(t_2) * (k_m / l))) ** (-2.0d0))
    else
        tmp = 2.0d0 / (t_2 * ((sin(k_m) * (k_m / l)) ** 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 = t_m / Math.cos(k_m);
	double tmp;
	if (k_m <= 14.0) {
		tmp = 2.0 * Math.pow((Math.sin(k_m) * (Math.sqrt(t_2) * (k_m / l))), -2.0);
	} else {
		tmp = 2.0 / (t_2 * Math.pow((Math.sin(k_m) * (k_m / l)), 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 = t_m / math.cos(k_m)
	tmp = 0
	if k_m <= 14.0:
		tmp = 2.0 * math.pow((math.sin(k_m) * (math.sqrt(t_2) * (k_m / l))), -2.0)
	else:
		tmp = 2.0 / (t_2 * math.pow((math.sin(k_m) * (k_m / l)), 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(t_m / cos(k_m))
	tmp = 0.0
	if (k_m <= 14.0)
		tmp = Float64(2.0 * (Float64(sin(k_m) * Float64(sqrt(t_2) * Float64(k_m / l))) ^ -2.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(sin(k_m) * Float64(k_m / l)) ^ 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 = t_m / cos(k_m);
	tmp = 0.0;
	if (k_m <= 14.0)
		tmp = 2.0 * ((sin(k_m) * (sqrt(t_2) * (k_m / l))) ^ -2.0);
	else
		tmp = 2.0 / (t_2 * ((sin(k_m) * (k_m / l)) ^ 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[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 14.0], N[(2.0 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(k$95$m / l), $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)

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

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


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

    1. Initial program 40.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-*l*40.1%

        \[\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/40.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+40.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. Simplified40.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. Step-by-step derivation
      1. add-sqr-sqrt13.6%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow213.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr14.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 14 < k

    1. Initial program 32.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-*l*32.5%

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

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

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

      \[\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. add-sqr-sqrt18.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow218.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 94.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) \\ \begin{array}{l} t_2 := \frac{t_m}{\cos k_m}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 0.65:\\ \;\;\;\;\frac{2}{{\left(\sqrt{t_2} \cdot \frac{k_m}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t_2 \cdot {\left(\sin k_m \cdot \frac{k_m}{\ell}\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 (/ t_m (cos k_m))))
   (*
    t_s
    (if (<= k_m 0.65)
      (/ 2.0 (pow (* (sqrt t_2) (/ k_m (/ l (sin k_m)))) 2.0))
      (/ 2.0 (* t_2 (pow (* (sin k_m) (/ k_m l)) 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 = t_m / cos(k_m);
	double tmp;
	if (k_m <= 0.65) {
		tmp = 2.0 / pow((sqrt(t_2) * (k_m / (l / sin(k_m)))), 2.0);
	} else {
		tmp = 2.0 / (t_2 * pow((sin(k_m) * (k_m / l)), 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) :: tmp
    t_2 = t_m / cos(k_m)
    if (k_m <= 0.65d0) then
        tmp = 2.0d0 / ((sqrt(t_2) * (k_m / (l / sin(k_m)))) ** 2.0d0)
    else
        tmp = 2.0d0 / (t_2 * ((sin(k_m) * (k_m / l)) ** 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 = t_m / Math.cos(k_m);
	double tmp;
	if (k_m <= 0.65) {
		tmp = 2.0 / Math.pow((Math.sqrt(t_2) * (k_m / (l / Math.sin(k_m)))), 2.0);
	} else {
		tmp = 2.0 / (t_2 * Math.pow((Math.sin(k_m) * (k_m / l)), 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 = t_m / math.cos(k_m)
	tmp = 0
	if k_m <= 0.65:
		tmp = 2.0 / math.pow((math.sqrt(t_2) * (k_m / (l / math.sin(k_m)))), 2.0)
	else:
		tmp = 2.0 / (t_2 * math.pow((math.sin(k_m) * (k_m / l)), 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(t_m / cos(k_m))
	tmp = 0.0
	if (k_m <= 0.65)
		tmp = Float64(2.0 / (Float64(sqrt(t_2) * Float64(k_m / Float64(l / sin(k_m)))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(sin(k_m) * Float64(k_m / l)) ^ 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 = t_m / cos(k_m);
	tmp = 0.0;
	if (k_m <= 0.65)
		tmp = 2.0 / ((sqrt(t_2) * (k_m / (l / sin(k_m)))) ^ 2.0);
	else
		tmp = 2.0 / (t_2 * ((sin(k_m) * (k_m / l)) ^ 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[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.65], N[(2.0 / N[Power[N[(N[Sqrt[t$95$2], $MachinePrecision] * N[(k$95$m / N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(k$95$m / l), $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)

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

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


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

    1. Initial program 40.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-*l*40.1%

        \[\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/40.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+40.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. Simplified40.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. Step-by-step derivation
      1. add-sqr-sqrt13.6%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow213.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr14.7%

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

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

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

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

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

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

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

    if 0.650000000000000022 < k

    1. Initial program 32.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-*l*32.5%

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

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

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

      \[\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. add-sqr-sqrt18.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow218.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 94.8% 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 := \frac{t_m}{\cos k_m}\\ t_s \cdot \begin{array}{l} \mathbf{if}\;k_m \leq 14:\\ \;\;\;\;\frac{2}{{\left(\frac{k_m \cdot \sqrt{t_2}}{\frac{\ell}{\sin k_m}}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t_2 \cdot {\left(\sin k_m \cdot \frac{k_m}{\ell}\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 (/ t_m (cos k_m))))
   (*
    t_s
    (if (<= k_m 14.0)
      (/ 2.0 (pow (/ (* k_m (sqrt t_2)) (/ l (sin k_m))) 2.0))
      (/ 2.0 (* t_2 (pow (* (sin k_m) (/ k_m l)) 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 = t_m / cos(k_m);
	double tmp;
	if (k_m <= 14.0) {
		tmp = 2.0 / pow(((k_m * sqrt(t_2)) / (l / sin(k_m))), 2.0);
	} else {
		tmp = 2.0 / (t_2 * pow((sin(k_m) * (k_m / l)), 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) :: tmp
    t_2 = t_m / cos(k_m)
    if (k_m <= 14.0d0) then
        tmp = 2.0d0 / (((k_m * sqrt(t_2)) / (l / sin(k_m))) ** 2.0d0)
    else
        tmp = 2.0d0 / (t_2 * ((sin(k_m) * (k_m / l)) ** 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 = t_m / Math.cos(k_m);
	double tmp;
	if (k_m <= 14.0) {
		tmp = 2.0 / Math.pow(((k_m * Math.sqrt(t_2)) / (l / Math.sin(k_m))), 2.0);
	} else {
		tmp = 2.0 / (t_2 * Math.pow((Math.sin(k_m) * (k_m / l)), 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 = t_m / math.cos(k_m)
	tmp = 0
	if k_m <= 14.0:
		tmp = 2.0 / math.pow(((k_m * math.sqrt(t_2)) / (l / math.sin(k_m))), 2.0)
	else:
		tmp = 2.0 / (t_2 * math.pow((math.sin(k_m) * (k_m / l)), 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(t_m / cos(k_m))
	tmp = 0.0
	if (k_m <= 14.0)
		tmp = Float64(2.0 / (Float64(Float64(k_m * sqrt(t_2)) / Float64(l / sin(k_m))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * (Float64(sin(k_m) * Float64(k_m / l)) ^ 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 = t_m / cos(k_m);
	tmp = 0.0;
	if (k_m <= 14.0)
		tmp = 2.0 / (((k_m * sqrt(t_2)) / (l / sin(k_m))) ^ 2.0);
	else
		tmp = 2.0 / (t_2 * ((sin(k_m) * (k_m / l)) ^ 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[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 14.0], N[(2.0 / N[Power[N[(N[(k$95$m * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] / N[(l / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(k$95$m / l), $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)

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

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


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

    1. Initial program 40.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-*l*40.1%

        \[\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/40.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+40.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. Simplified40.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. Step-by-step derivation
      1. add-sqr-sqrt13.6%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow213.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr14.7%

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

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

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

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

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

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

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

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

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

    if 14 < k

    1. Initial program 32.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-*l*32.5%

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

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

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

      \[\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. add-sqr-sqrt18.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow218.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 94.9% 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}\;k_m \leq 0.055:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \left(k_m \cdot -0.08333333333333333 + \left(-0.03263888888888889 \cdot {k_m}^{3} + \frac{1}{k_m}\right)\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_m}{\cos k_m} \cdot {\left(\sin k_m \cdot \frac{k_m}{\ell}\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 0.055)
    (*
     2.0
     (pow
      (*
       (/ l (* k_m (sqrt t_m)))
       (+
        (* k_m -0.08333333333333333)
        (+ (* -0.03263888888888889 (pow k_m 3.0)) (/ 1.0 k_m))))
      2.0))
    (/ 2.0 (* (/ t_m (cos k_m)) (pow (* (sin k_m) (/ k_m l)) 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 <= 0.055) {
		tmp = 2.0 * pow(((l / (k_m * sqrt(t_m))) * ((k_m * -0.08333333333333333) + ((-0.03263888888888889 * pow(k_m, 3.0)) + (1.0 / k_m)))), 2.0);
	} else {
		tmp = 2.0 / ((t_m / cos(k_m)) * pow((sin(k_m) * (k_m / l)), 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 <= 0.055d0) then
        tmp = 2.0d0 * (((l / (k_m * sqrt(t_m))) * ((k_m * (-0.08333333333333333d0)) + (((-0.03263888888888889d0) * (k_m ** 3.0d0)) + (1.0d0 / k_m)))) ** 2.0d0)
    else
        tmp = 2.0d0 / ((t_m / cos(k_m)) * ((sin(k_m) * (k_m / l)) ** 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 <= 0.055) {
		tmp = 2.0 * Math.pow(((l / (k_m * Math.sqrt(t_m))) * ((k_m * -0.08333333333333333) + ((-0.03263888888888889 * Math.pow(k_m, 3.0)) + (1.0 / k_m)))), 2.0);
	} else {
		tmp = 2.0 / ((t_m / Math.cos(k_m)) * Math.pow((Math.sin(k_m) * (k_m / l)), 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 <= 0.055:
		tmp = 2.0 * math.pow(((l / (k_m * math.sqrt(t_m))) * ((k_m * -0.08333333333333333) + ((-0.03263888888888889 * math.pow(k_m, 3.0)) + (1.0 / k_m)))), 2.0)
	else:
		tmp = 2.0 / ((t_m / math.cos(k_m)) * math.pow((math.sin(k_m) * (k_m / l)), 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 <= 0.055)
		tmp = Float64(2.0 * (Float64(Float64(l / Float64(k_m * sqrt(t_m))) * Float64(Float64(k_m * -0.08333333333333333) + Float64(Float64(-0.03263888888888889 * (k_m ^ 3.0)) + Float64(1.0 / k_m)))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / cos(k_m)) * (Float64(sin(k_m) * Float64(k_m / l)) ^ 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 <= 0.055)
		tmp = 2.0 * (((l / (k_m * sqrt(t_m))) * ((k_m * -0.08333333333333333) + ((-0.03263888888888889 * (k_m ^ 3.0)) + (1.0 / k_m)))) ^ 2.0);
	else
		tmp = 2.0 / ((t_m / cos(k_m)) * ((sin(k_m) * (k_m / l)) ^ 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, 0.055], N[(2.0 * N[Power[N[(N[(l / N[(k$95$m * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m * -0.08333333333333333), $MachinePrecision] + N[(N[(-0.03263888888888889 * N[Power[k$95$m, 3.0], $MachinePrecision]), $MachinePrecision] + N[(1.0 / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(k$95$m / l), $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}\;k_m \leq 0.055:\\
\;\;\;\;2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \left(k_m \cdot -0.08333333333333333 + \left(-0.03263888888888889 \cdot {k_m}^{3} + \frac{1}{k_m}\right)\right)\right)}^{2}\\

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


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

    1. Initial program 40.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*40.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. *-commutative40.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*40.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/40.6%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+46.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-eval46.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-identity46.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. unpow246.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-neg46.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-neg46.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. Simplified46.3%

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

      \[\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. expm1-log1p-u45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0550000000000000003 < k

    1. Initial program 32.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-*l*32.5%

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

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

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

      \[\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. add-sqr-sqrt18.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow218.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 94.9% 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}\;k_m \leq 0.014:\\ \;\;\;\;2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \left(k_m \cdot -0.08333333333333333 + \frac{1}{k_m}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_m}{\cos k_m} \cdot {\left(\sin k_m \cdot \frac{k_m}{\ell}\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 0.014)
    (*
     2.0
     (pow
      (* (/ l (* k_m (sqrt t_m))) (+ (* k_m -0.08333333333333333) (/ 1.0 k_m)))
      2.0))
    (/ 2.0 (* (/ t_m (cos k_m)) (pow (* (sin k_m) (/ k_m l)) 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 <= 0.014) {
		tmp = 2.0 * pow(((l / (k_m * sqrt(t_m))) * ((k_m * -0.08333333333333333) + (1.0 / k_m))), 2.0);
	} else {
		tmp = 2.0 / ((t_m / cos(k_m)) * pow((sin(k_m) * (k_m / l)), 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 <= 0.014d0) then
        tmp = 2.0d0 * (((l / (k_m * sqrt(t_m))) * ((k_m * (-0.08333333333333333d0)) + (1.0d0 / k_m))) ** 2.0d0)
    else
        tmp = 2.0d0 / ((t_m / cos(k_m)) * ((sin(k_m) * (k_m / l)) ** 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 <= 0.014) {
		tmp = 2.0 * Math.pow(((l / (k_m * Math.sqrt(t_m))) * ((k_m * -0.08333333333333333) + (1.0 / k_m))), 2.0);
	} else {
		tmp = 2.0 / ((t_m / Math.cos(k_m)) * Math.pow((Math.sin(k_m) * (k_m / l)), 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 <= 0.014:
		tmp = 2.0 * math.pow(((l / (k_m * math.sqrt(t_m))) * ((k_m * -0.08333333333333333) + (1.0 / k_m))), 2.0)
	else:
		tmp = 2.0 / ((t_m / math.cos(k_m)) * math.pow((math.sin(k_m) * (k_m / l)), 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 <= 0.014)
		tmp = Float64(2.0 * (Float64(Float64(l / Float64(k_m * sqrt(t_m))) * Float64(Float64(k_m * -0.08333333333333333) + Float64(1.0 / k_m))) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / cos(k_m)) * (Float64(sin(k_m) * Float64(k_m / l)) ^ 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 <= 0.014)
		tmp = 2.0 * (((l / (k_m * sqrt(t_m))) * ((k_m * -0.08333333333333333) + (1.0 / k_m))) ^ 2.0);
	else
		tmp = 2.0 / ((t_m / cos(k_m)) * ((sin(k_m) * (k_m / l)) ^ 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, 0.014], N[(2.0 * N[Power[N[(N[(l / N[(k$95$m * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m * -0.08333333333333333), $MachinePrecision] + N[(1.0 / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(k$95$m / l), $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}\;k_m \leq 0.014:\\
\;\;\;\;2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \left(k_m \cdot -0.08333333333333333 + \frac{1}{k_m}\right)\right)}^{2}\\

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


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

    1. Initial program 40.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*40.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. *-commutative40.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*40.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/40.6%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\sin k \cdot \frac{{t}^{3} \cdot \tan k}{\ell \cdot \ell}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+46.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-eval46.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-identity46.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. unpow246.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-neg46.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-neg46.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. Simplified46.3%

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

      \[\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. expm1-log1p-u45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0140000000000000003 < k

    1. Initial program 32.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-*l*32.5%

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

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

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

      \[\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. add-sqr-sqrt18.0%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
      2. pow218.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    5. Applied egg-rr8.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 76.1% 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 \left(2 \cdot {\left(\sin k_m \cdot \left(\sqrt{t_m} \cdot \frac{k_m}{\ell}\right)\right)}^{-2}\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 (* 2.0 (pow (* (sin k_m) (* (sqrt t_m) (/ k_m l))) -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) {
	return t_s * (2.0 * pow((sin(k_m) * (sqrt(t_m) * (k_m / l))), -2.0));
}
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 * (2.0d0 * ((sin(k_m) * (sqrt(t_m) * (k_m / l))) ** (-2.0d0)))
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 * (2.0 * Math.pow((Math.sin(k_m) * (Math.sqrt(t_m) * (k_m / l))), -2.0));
}
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 * (2.0 * math.pow((math.sin(k_m) * (math.sqrt(t_m) * (k_m / l))), -2.0))
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(2.0 * (Float64(sin(k_m) * Float64(sqrt(t_m) * Float64(k_m / l))) ^ -2.0)))
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 * (2.0 * ((sin(k_m) * (sqrt(t_m) * (k_m / l))) ^ -2.0));
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[(2.0 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $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 \left(2 \cdot {\left(\sin k_m \cdot \left(\sqrt{t_m} \cdot \frac{k_m}{\ell}\right)\right)}^{-2}\right)
\end{array}
Derivation
  1. Initial program 37.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-*l*37.8%

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

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

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

    \[\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. add-sqr-sqrt14.9%

      \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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)}}} \]
    2. pow214.9%

      \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
  5. Applied egg-rr12.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 61.5% 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(2 \cdot \frac{\cos k_m \cdot \left(\ell \cdot \ell\right)}{t_m \cdot {k_m}^{4}}\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 (* 2.0 (/ (* (cos k_m) (* l l)) (* 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) {
	return t_s * (2.0 * ((cos(k_m) * (l * l)) / (t_m * pow(k_m, 4.0))));
}
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 * (2.0d0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ** 4.0d0))))
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 * (2.0 * ((Math.cos(k_m) * (l * l)) / (t_m * Math.pow(k_m, 4.0))));
}
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 * (2.0 * ((math.cos(k_m) * (l * l)) / (t_m * math.pow(k_m, 4.0))))
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(2.0 * Float64(Float64(cos(k_m) * Float64(l * l)) / Float64(t_m * (k_m ^ 4.0)))))
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 * (2.0 * ((cos(k_m) * (l * l)) / (t_m * (k_m ^ 4.0))));
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[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k$95$m, 4.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 \left(2 \cdot \frac{\cos k_m \cdot \left(\ell \cdot \ell\right)}{t_m \cdot {k_m}^{4}}\right)
\end{array}
Derivation
  1. Initial program 37.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*37.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. *-commutative37.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*37.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/38.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. +-commutative38.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. unpow238.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-neg38.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-neg38.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-neg38.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. unpow238.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+44.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.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(2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \frac{1}{k_m}\right)}^{2}\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 (* 2.0 (pow (* (/ l (* k_m (sqrt t_m))) (/ 1.0 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) {
	return t_s * (2.0 * pow(((l / (k_m * sqrt(t_m))) * (1.0 / k_m)), 2.0));
}
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 * (2.0d0 * (((l / (k_m * sqrt(t_m))) * (1.0d0 / k_m)) ** 2.0d0))
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 * (2.0 * Math.pow(((l / (k_m * Math.sqrt(t_m))) * (1.0 / k_m)), 2.0));
}
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 * (2.0 * math.pow(((l / (k_m * math.sqrt(t_m))) * (1.0 / k_m)), 2.0))
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(2.0 * (Float64(Float64(l / Float64(k_m * sqrt(t_m))) * Float64(1.0 / k_m)) ^ 2.0)))
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 * (2.0 * (((l / (k_m * sqrt(t_m))) * (1.0 / k_m)) ^ 2.0));
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[(2.0 * N[Power[N[(N[(l / N[(k$95$m * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / 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 \left(2 \cdot {\left(\frac{\ell}{k_m \cdot \sqrt{t_m}} \cdot \frac{1}{k_m}\right)}^{2}\right)
\end{array}
Derivation
  1. Initial program 37.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*37.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. *-commutative37.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*37.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/38.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. +-commutative38.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. unpow238.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-neg38.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-neg38.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-neg38.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. unpow238.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+44.5%

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

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

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

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

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

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

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

    \[\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. expm1-log1p-u50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 60.4% 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(2 \cdot \frac{{\ell}^{2} \cdot {k_m}^{-4}}{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 (* 2.0 (/ (* (pow l 2.0) (pow k_m -4.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 * (2.0 * ((pow(l, 2.0) * pow(k_m, -4.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 * (2.0d0 * (((l ** 2.0d0) * (k_m ** (-4.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 * (2.0 * ((Math.pow(l, 2.0) * Math.pow(k_m, -4.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 * (2.0 * ((math.pow(l, 2.0) * math.pow(k_m, -4.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(2.0 * Float64(Float64((l ^ 2.0) * (k_m ^ -4.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 * (2.0 * (((l ^ 2.0) * (k_m ^ -4.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[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $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(2 \cdot \frac{{\ell}^{2} \cdot {k_m}^{-4}}{t_m}\right)
\end{array}
Derivation
  1. Initial program 37.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*37.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. *-commutative37.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*37.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/38.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. +-commutative38.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. unpow238.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-neg38.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-neg38.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-neg38.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. unpow238.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+44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2} \cdot {k}^{-4}}{t}} \]
  10. Applied egg-rr64.0%

    \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2} \cdot {k}^{-4}}{t}} \]
  11. Final simplification64.0%

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

Alternative 12: 59.1% accurate, 3.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 \left(2 \cdot \left({k_m}^{-4} \cdot \frac{\ell \cdot \ell}{t_m}\right)\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 (* 2.0 (* (pow k_m -4.0) (/ (* l l) 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 * (2.0 * (pow(k_m, -4.0) * ((l * l) / 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 * (2.0d0 * ((k_m ** (-4.0d0)) * ((l * l) / 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 * (2.0 * (Math.pow(k_m, -4.0) * ((l * l) / 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 * (2.0 * (math.pow(k_m, -4.0) * ((l * l) / 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(2.0 * Float64((k_m ^ -4.0) * Float64(Float64(l * l) / 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 * (2.0 * ((k_m ^ -4.0) * ((l * l) / 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[(2.0 * N[(N[Power[k$95$m, -4.0], $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / t$95$m), $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 \left(2 \cdot \left({k_m}^{-4} \cdot \frac{\ell \cdot \ell}{t_m}\right)\right)
\end{array}
Derivation
  1. Initial program 37.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*37.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. *-commutative37.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*37.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/38.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. +-commutative38.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. unpow238.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-neg38.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-neg38.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-neg38.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. unpow238.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+44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023333 
(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))))