Toniolo and Linder, Equation (10-)

Percentage Accurate: 33.8% → 78.0%
Time: 29.6s
Alternatives: 16
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 33.8% 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: 78.0% accurate, 0.5× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} t_1 := {\sin k}^{2}\\ \mathbf{if}\;k \leq 4.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \log \left({\left(e^{t_1}\right)}^{\left({\ell}^{-2}\right)}\right)}\\ \mathbf{elif}\;k \leq 2.8 \cdot 10^{+97}:\\ \;\;\;\;\frac{2}{\frac{t_1 \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (pow (sin k) 2.0)))
   (if (<= k 4.5e-160)
     (/
      2.0
      (* (/ (* t (pow k 2.0)) (cos k)) (log (pow (exp t_1) (pow l -2.0)))))
     (if (<= k 2.8e+97)
       (/ 2.0 (/ (* t_1 (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))
       (/
        2.0
        (pow
         (*
          (/ t (pow (cbrt l) 2.0))
          (cbrt (* (sin k) (* (tan k) (pow (/ k t) 2.0)))))
         3.0))))))
k = abs(k);
double code(double t, double l, double k) {
	double t_1 = pow(sin(k), 2.0);
	double tmp;
	if (k <= 4.5e-160) {
		tmp = 2.0 / (((t * pow(k, 2.0)) / cos(k)) * log(pow(exp(t_1), pow(l, -2.0))));
	} else if (k <= 2.8e+97) {
		tmp = 2.0 / ((t_1 * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
	} else {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((sin(k) * (tan(k) * pow((k / t), 2.0))))), 3.0);
	}
	return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double t_1 = Math.pow(Math.sin(k), 2.0);
	double tmp;
	if (k <= 4.5e-160) {
		tmp = 2.0 / (((t * Math.pow(k, 2.0)) / Math.cos(k)) * Math.log(Math.pow(Math.exp(t_1), Math.pow(l, -2.0))));
	} else if (k <= 2.8e+97) {
		tmp = 2.0 / ((t_1 * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	} else {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))))), 3.0);
	}
	return tmp;
}
k = abs(k)
function code(t, l, k)
	t_1 = sin(k) ^ 2.0
	tmp = 0.0
	if (k <= 4.5e-160)
		tmp = Float64(2.0 / Float64(Float64(Float64(t * (k ^ 2.0)) / cos(k)) * log((exp(t_1) ^ (l ^ -2.0)))));
	elseif (k <= 2.8e+97)
		tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0)));
	else
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))))) ^ 3.0));
	end
	return tmp
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 4.5e-160], N[(2.0 / N[(N[(N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[Log[N[Power[N[Exp[t$95$1], $MachinePrecision], N[Power[l, -2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.8e+97], N[(2.0 / N[(N[(t$95$1 * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 4.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \log \left({\left(e^{t_1}\right)}^{\left({\ell}^{-2}\right)}\right)}\\

\mathbf{elif}\;k \leq 2.8 \cdot 10^{+97}:\\
\;\;\;\;\frac{2}{\frac{t_1 \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 4.50000000000000026e-160

    1. Initial program 40.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. Simplified48.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \frac{{\sin k}^{2}}{{\ell}^{2}}}} \]
    8. Step-by-step derivation
      1. add-log-exp61.6%

        \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \color{blue}{\log \left(e^{\frac{{\sin k}^{2}}{{\ell}^{2}}}\right)}} \]
      2. div-inv61.6%

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

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

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

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

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

    if 4.50000000000000026e-160 < k < 2.7999999999999999e97

    1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7999999999999999e97 < k

    1. Initial program 38.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. Simplified46.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.5 \cdot 10^{-160}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \log \left({\left(e^{{\sin k}^{2}}\right)}^{\left({\ell}^{-2}\right)}\right)}\\ \mathbf{elif}\;k \leq 2.8 \cdot 10^{+97}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\ \end{array} \]

Alternative 2: 77.2% accurate, 0.6× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} \mathbf{if}\;k \leq 4.5 \cdot 10^{-160} \lor \neg \left(k \leq 3.2 \cdot 10^{+97}\right):\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (if (or (<= k 4.5e-160) (not (<= k 3.2e+97)))
   (/
    2.0
    (pow
     (*
      (/ t (pow (cbrt l) 2.0))
      (cbrt (* (sin k) (* (tan k) (pow (/ k t) 2.0)))))
     3.0))
   (/
    2.0
    (/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))))
k = abs(k);
double code(double t, double l, double k) {
	double tmp;
	if ((k <= 4.5e-160) || !(k <= 3.2e+97)) {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((sin(k) * (tan(k) * pow((k / t), 2.0))))), 3.0);
	} else {
		tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
	}
	return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double tmp;
	if ((k <= 4.5e-160) || !(k <= 3.2e+97)) {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))))), 3.0);
	} else {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	}
	return tmp;
}
k = abs(k)
function code(t, l, k)
	tmp = 0.0
	if ((k <= 4.5e-160) || !(k <= 3.2e+97))
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))))) ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0)));
	end
	return tmp
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := If[Or[LessEqual[k, 4.5e-160], N[Not[LessEqual[k, 3.2e+97]], $MachinePrecision]], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-160} \lor \neg \left(k \leq 3.2 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 4.50000000000000026e-160 or 3.20000000000000016e97 < k

    1. Initial program 39.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. Simplified47.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000026e-160 < k < 3.20000000000000016e97

    1. Initial program 27.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.5 \cdot 10^{-160} \lor \neg \left(k \leq 3.2 \cdot 10^{+97}\right):\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\ \end{array} \]

Alternative 3: 72.1% accurate, 0.7× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} \mathbf{if}\;k \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.32e+154)
   (/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0)))
   (/
    2.0
    (*
     (* (sin k) (* (tan k) (pow (/ k t) 2.0)))
     (pow (/ t (pow (cbrt l) 2.0)) 3.0)))))
k = abs(k);
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.32e+154) {
		tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
	} else {
		tmp = 2.0 / ((sin(k) * (tan(k) * pow((k / t), 2.0))) * pow((t / pow(cbrt(l), 2.0)), 3.0));
	}
	return tmp;
}
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.32e+154) {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	} else {
		tmp = 2.0 / ((Math.sin(k) * (Math.tan(k) * Math.pow((k / t), 2.0))) * Math.pow((t / Math.pow(Math.cbrt(l), 2.0)), 3.0));
	}
	return tmp;
}
k = abs(k)
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.32e+154)
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0)));
	else
		tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(tan(k) * (Float64(k / t) ^ 2.0))) * (Float64(t / (cbrt(l) ^ 2.0)) ^ 3.0)));
	end
	return tmp
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := If[LessEqual[k, 1.32e+154], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}}\\


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

    1. Initial program 36.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.31999999999999998e154 < k

    1. Initial program 39.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.6% accurate, 0.8× speedup?

\[\begin{array}{l} k = |k|\\ \\ 2 \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t \cdot {k}^{2}}\right) \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (* 2.0 (* (/ (pow l 2.0) (pow (sin k) 2.0)) (/ (cos k) (* t (pow k 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
	return 2.0 * ((pow(l, 2.0) / pow(sin(k), 2.0)) * (cos(k) / (t * pow(k, 2.0))));
}
NOTE: k should be positive before calling this function
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 * (((l ** 2.0d0) / (sin(k) ** 2.0d0)) * (cos(k) / (t * (k ** 2.0d0))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return 2.0 * ((Math.pow(l, 2.0) / Math.pow(Math.sin(k), 2.0)) * (Math.cos(k) / (t * Math.pow(k, 2.0))));
}
k = abs(k)
def code(t, l, k):
	return 2.0 * ((math.pow(l, 2.0) / math.pow(math.sin(k), 2.0)) * (math.cos(k) / (t * math.pow(k, 2.0))))
k = abs(k)
function code(t, l, k)
	return Float64(2.0 * Float64(Float64((l ^ 2.0) / (sin(k) ^ 2.0)) * Float64(cos(k) / Float64(t * (k ^ 2.0)))))
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = 2.0 * (((l ^ 2.0) / (sin(k) ^ 2.0)) * (cos(k) / (t * (k ^ 2.0))));
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \left(\frac{{\ell}^{2}}{{\sin k}^{2}} \cdot \frac{\cos k}{t \cdot {k}^{2}}\right)
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
    6. clear-num46.0%

      \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\frac{k}{t} \cdot \color{blue}{\frac{1}{\frac{t}{k}}}} \]
    7. clear-num46.0%

      \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{1}{\frac{t}{k}}} \cdot \frac{1}{\frac{t}{k}}} \]
    8. frac-times45.6%

      \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{1 \cdot 1}{\frac{t}{k} \cdot \frac{t}{k}}}} \]
    9. metadata-eval45.6%

      \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\frac{\color{blue}{1}}{\frac{t}{k} \cdot \frac{t}{k}}} \]
  5. Applied egg-rr45.6%

    \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}} \]
  6. Taylor expanded in t around 0 74.9%

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

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

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

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

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

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

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

Alternative 5: 72.0% accurate, 0.8× speedup?

\[\begin{array}{l} k = |k|\\ \\ 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) (* t (pow (sin k) 2.0))))))
k = abs(k);
double code(double t, double l, double k) {
	return 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * (t * pow(sin(k), 2.0))));
}
NOTE: k should be positive before calling this function
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 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * (t * (sin(k) ** 2.0d0))))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * (t * Math.pow(Math.sin(k), 2.0))));
}
k = abs(k)
def code(t, l, k):
	return 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * (t * math.pow(math.sin(k), 2.0))))
k = abs(k)
function code(t, l, k)
	return Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * Float64(t * (sin(k) ^ 2.0)))))
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * (t * (sin(k) ^ 2.0))));
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

Alternative 6: 71.9% accurate, 0.8× speedup?

\[\begin{array}{l} k = |k|\\ \\ \frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ (cos k) (pow k 2.0)))) (pow l 2.0))))
k = abs(k);
double code(double t, double l, double k) {
	return 2.0 / ((pow(sin(k), 2.0) * (t / (cos(k) / pow(k, 2.0)))) / pow(l, 2.0));
}
NOTE: k should be positive before calling this function
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 / (((sin(k) ** 2.0d0) * (t / (cos(k) / (k ** 2.0d0)))) / (l ** 2.0d0))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (Math.cos(k) / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
}
k = abs(k)
def code(t, l, k):
	return 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (math.cos(k) / math.pow(k, 2.0)))) / math.pow(l, 2.0))
k = abs(k)
function code(t, l, k)
	return Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(cos(k) / (k ^ 2.0)))) / (l ^ 2.0)))
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (cos(k) / (k ^ 2.0)))) / (l ^ 2.0));
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{\cos k}{{k}^{2}}}}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.0% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} t_1 := t \cdot {k}^{2}\\ \mathbf{if}\;t \leq -1.5 \cdot 10^{+151}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-140}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* t (pow k 2.0))))
   (if (<= t -1.5e+151)
     (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1)))
     (if (<= t -3.1e-140)
       (/
        2.0
        (*
         (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))
         (* (tan k) (* k (/ (/ k t) t)))))
       (if (<= t 2.4e-116)
         (/ 2.0 (* (/ t_1 (cos k)) (/ (pow k 2.0) (pow l 2.0))))
         (if (<= t 6.5e+83)
           (/
            (/ 2.0 (* (tan k) (* (/ (pow t 3.0) l) (/ (sin k) l))))
            (/ 1.0 (* (/ t k) (/ t k))))
           (/
            2.0
            (/
             (* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0))))
             (pow l 2.0)))))))))
k = abs(k);
double code(double t, double l, double k) {
	double t_1 = t * pow(k, 2.0);
	double tmp;
	if (t <= -1.5e+151) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
	} else if (t <= -3.1e-140) {
		tmp = 2.0 / ((sin(k) * ((pow(t, 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
	} else if (t <= 2.4e-116) {
		tmp = 2.0 / ((t_1 / cos(k)) * (pow(k, 2.0) / pow(l, 2.0)));
	} else if (t <= 6.5e+83) {
		tmp = (2.0 / (tan(k) * ((pow(t, 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	} else {
		tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * (k ** 2.0d0)
    if (t <= (-1.5d+151)) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
    else if (t <= (-3.1d-140)) then
        tmp = 2.0d0 / ((sin(k) * (((t ** 2.0d0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))))
    else if (t <= 2.4d-116) then
        tmp = 2.0d0 / ((t_1 / cos(k)) * ((k ** 2.0d0) / (l ** 2.0d0)))
    else if (t <= 6.5d+83) then
        tmp = (2.0d0 / (tan(k) * (((t ** 3.0d0) / l) * (sin(k) / l)))) / (1.0d0 / ((t / k) * (t / k)))
    else
        tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double t_1 = t * Math.pow(k, 2.0);
	double tmp;
	if (t <= -1.5e+151) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
	} else if (t <= -3.1e-140) {
		tmp = 2.0 / ((Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l))) * (Math.tan(k) * (k * ((k / t) / t))));
	} else if (t <= 2.4e-116) {
		tmp = 2.0 / ((t_1 / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 2.0)));
	} else if (t <= 6.5e+83) {
		tmp = (2.0 / (Math.tan(k) * ((Math.pow(t, 3.0) / l) * (Math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	} else {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	t_1 = t * math.pow(k, 2.0)
	tmp = 0
	if t <= -1.5e+151:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1))
	elif t <= -3.1e-140:
		tmp = 2.0 / ((math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))) * (math.tan(k) * (k * ((k / t) / t))))
	elif t <= 2.4e-116:
		tmp = 2.0 / ((t_1 / math.cos(k)) * (math.pow(k, 2.0) / math.pow(l, 2.0)))
	elif t <= 6.5e+83:
		tmp = (2.0 / (math.tan(k) * ((math.pow(t, 3.0) / l) * (math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)))
	else:
		tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0))
	return tmp
k = abs(k)
function code(t, l, k)
	t_1 = Float64(t * (k ^ 2.0))
	tmp = 0.0
	if (t <= -1.5e+151)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1)));
	elseif (t <= -3.1e-140)
		tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t)))));
	elseif (t <= 2.4e-116)
		tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64((k ^ 2.0) / (l ^ 2.0))));
	elseif (t <= 6.5e+83)
		tmp = Float64(Float64(2.0 / Float64(tan(k) * Float64(Float64((t ^ 3.0) / l) * Float64(sin(k) / l)))) / Float64(1.0 / Float64(Float64(t / k) * Float64(t / k))));
	else
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0)));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	t_1 = t * (k ^ 2.0);
	tmp = 0.0;
	if (t <= -1.5e+151)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1));
	elseif (t <= -3.1e-140)
		tmp = 2.0 / ((sin(k) * (((t ^ 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
	elseif (t <= 2.4e-116)
		tmp = 2.0 / ((t_1 / cos(k)) * ((k ^ 2.0) / (l ^ 2.0)));
	elseif (t <= 6.5e+83)
		tmp = (2.0 / (tan(k) * (((t ^ 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	else
		tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.5e+151], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -3.1e-140], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-116], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.5e+83], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(t / k), $MachinePrecision] * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
\mathbf{if}\;t \leq -1.5 \cdot 10^{+151}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\

\mathbf{elif}\;t \leq -3.1 \cdot 10^{-140}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\

\mathbf{elif}\;t \leq 2.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\

\mathbf{elif}\;t \leq 6.5 \cdot 10^{+83}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -1.5e151

    1. Initial program 13.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. Simplified34.6%

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

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

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

    if -1.5e151 < t < -3.0999999999999999e-140

    1. Initial program 52.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. Simplified58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0999999999999999e-140 < t < 2.39999999999999993e-116

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \frac{{\sin k}^{2}}{{\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 64.5%

      \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]

    if 2.39999999999999993e-116 < t < 6.5000000000000003e83

    1. Initial program 55.5%

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

        \[\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. associate-*l/55.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      6. clear-num71.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\frac{k}{t} \cdot \color{blue}{\frac{1}{\frac{t}{k}}}} \]
      7. clear-num71.0%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{1 \cdot 1}{\frac{t}{k} \cdot \frac{t}{k}}}} \]
      9. metadata-eval71.1%

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

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

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

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

    if 6.5000000000000003e83 < t

    1. Initial program 21.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. Simplified31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 72.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.5 \cdot 10^{+151}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {k}^{2}\right)}\\ \mathbf{elif}\;t \leq -3.1 \cdot 10^{-140}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 2.4 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{+83}:\\ \;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\ \end{array} \]

Alternative 8: 71.8% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} \mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)\right)}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (if (<= k 5.6e-5)
   (/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0)))) (pow l 2.0)))
   (*
    2.0
    (/
     (* (cos k) (pow l 2.0))
     (* (pow k 2.0) (* t (- 0.5 (/ (cos (* k 2.0)) 2.0))))))))
k = abs(k);
double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.6e-5) {
		tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
	} else {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * (t * (0.5 - (cos((k * 2.0)) / 2.0)))));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 5.6d-5) then
        tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
    else
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * (t * (0.5d0 - (cos((k * 2.0d0)) / 2.0d0)))))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.6e-5) {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	} else {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * (t * (0.5 - (Math.cos((k * 2.0)) / 2.0)))));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	tmp = 0
	if k <= 5.6e-5:
		tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0))
	else:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * (t * (0.5 - (math.cos((k * 2.0)) / 2.0)))))
	return tmp
k = abs(k)
function code(t, l, k)
	tmp = 0.0
	if (k <= 5.6e-5)
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0)));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * Float64(t * Float64(0.5 - Float64(cos(Float64(k * 2.0)) / 2.0))))));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 5.6e-5)
		tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0));
	else
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * (t * (0.5 - (cos((k * 2.0)) / 2.0)))));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := If[LessEqual[k, 5.6e-5], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t * N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\

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


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

    1. Initial program 38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 71.5%

      \[\leadsto \frac{2}{\frac{\frac{t}{\color{blue}{\frac{1}{{k}^{2}}}} \cdot {\sin k}^{2}}{{\ell}^{2}}} \]

    if 5.59999999999999992e-5 < k

    1. Initial program 34.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 71.7% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} \mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)}{{\ell}^{2}}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (if (<= k 5.6e-5)
   (/ 2.0 (/ (* (pow (sin k) 2.0) (/ t (/ 1.0 (pow k 2.0)))) (pow l 2.0)))
   (/
    2.0
    (/
     (* (/ t (/ (cos k) (pow k 2.0))) (- 0.5 (/ (cos (* k 2.0)) 2.0)))
     (pow l 2.0)))))
k = abs(k);
double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.6e-5) {
		tmp = 2.0 / ((pow(sin(k), 2.0) * (t / (1.0 / pow(k, 2.0)))) / pow(l, 2.0));
	} else {
		tmp = 2.0 / (((t / (cos(k) / pow(k, 2.0))) * (0.5 - (cos((k * 2.0)) / 2.0))) / pow(l, 2.0));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 5.6d-5) then
        tmp = 2.0d0 / (((sin(k) ** 2.0d0) * (t / (1.0d0 / (k ** 2.0d0)))) / (l ** 2.0d0))
    else
        tmp = 2.0d0 / (((t / (cos(k) / (k ** 2.0d0))) * (0.5d0 - (cos((k * 2.0d0)) / 2.0d0))) / (l ** 2.0d0))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.6e-5) {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t / (1.0 / Math.pow(k, 2.0)))) / Math.pow(l, 2.0));
	} else {
		tmp = 2.0 / (((t / (Math.cos(k) / Math.pow(k, 2.0))) * (0.5 - (Math.cos((k * 2.0)) / 2.0))) / Math.pow(l, 2.0));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	tmp = 0
	if k <= 5.6e-5:
		tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * (t / (1.0 / math.pow(k, 2.0)))) / math.pow(l, 2.0))
	else:
		tmp = 2.0 / (((t / (math.cos(k) / math.pow(k, 2.0))) * (0.5 - (math.cos((k * 2.0)) / 2.0))) / math.pow(l, 2.0))
	return tmp
k = abs(k)
function code(t, l, k)
	tmp = 0.0
	if (k <= 5.6e-5)
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t / Float64(1.0 / (k ^ 2.0)))) / (l ^ 2.0)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / Float64(cos(k) / (k ^ 2.0))) * Float64(0.5 - Float64(cos(Float64(k * 2.0)) / 2.0))) / (l ^ 2.0)));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 5.6e-5)
		tmp = 2.0 / (((sin(k) ^ 2.0) * (t / (1.0 / (k ^ 2.0)))) / (l ^ 2.0));
	else
		tmp = 2.0 / (((t / (cos(k) / (k ^ 2.0))) * (0.5 - (cos((k * 2.0)) / 2.0))) / (l ^ 2.0));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := If[LessEqual[k, 5.6e-5], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[(1.0 / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq 5.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \frac{t}{\frac{1}{{k}^{2}}}}{{\ell}^{2}}}\\

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


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

    1. Initial program 38.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 71.5%

      \[\leadsto \frac{2}{\frac{\frac{t}{\color{blue}{\frac{1}{{k}^{2}}}} \cdot {\sin k}^{2}}{{\ell}^{2}}} \]

    if 5.59999999999999992e-5 < k

    1. Initial program 34.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 65.5% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} t_1 := \frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\ t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\ \mathbf{if}\;t \leq -3.2 \cdot 10^{+159}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-143}:\\ \;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-122} \lor \neg \left(t \leq 1.42 \cdot 10^{+196}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ 2.0 (/ (* (pow (sin k) 2.0) (* t (pow k 2.0))) (pow l 2.0))))
        (t_2 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
   (if (<= t -3.2e+159)
     t_1
     (if (<= t -2e-143)
       (/ 2.0 (* t_2 (* (tan k) (* k (/ (/ k t) t)))))
       (if (or (<= t 3.2e-122) (not (<= t 1.42e+196)))
         t_1
         (/ 2.0 (* t_2 (* (tan k) (/ k (* t (/ t k)))))))))))
k = abs(k);
double code(double t, double l, double k) {
	double t_1 = 2.0 / ((pow(sin(k), 2.0) * (t * pow(k, 2.0))) / pow(l, 2.0));
	double t_2 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -3.2e+159) {
		tmp = t_1;
	} else if (t <= -2e-143) {
		tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
	} else if ((t <= 3.2e-122) || !(t <= 1.42e+196)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 / (((sin(k) ** 2.0d0) * (t * (k ** 2.0d0))) / (l ** 2.0d0))
    t_2 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
    if (t <= (-3.2d+159)) then
        tmp = t_1
    else if (t <= (-2d-143)) then
        tmp = 2.0d0 / (t_2 * (tan(k) * (k * ((k / t) / t))))
    else if ((t <= 3.2d-122) .or. (.not. (t <= 1.42d+196))) then
        tmp = t_1
    else
        tmp = 2.0d0 / (t_2 * (tan(k) * (k / (t * (t / k)))))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double t_1 = 2.0 / ((Math.pow(Math.sin(k), 2.0) * (t * Math.pow(k, 2.0))) / Math.pow(l, 2.0));
	double t_2 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -3.2e+159) {
		tmp = t_1;
	} else if (t <= -2e-143) {
		tmp = 2.0 / (t_2 * (Math.tan(k) * (k * ((k / t) / t))));
	} else if ((t <= 3.2e-122) || !(t <= 1.42e+196)) {
		tmp = t_1;
	} else {
		tmp = 2.0 / (t_2 * (Math.tan(k) * (k / (t * (t / k)))));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	t_1 = 2.0 / ((math.pow(math.sin(k), 2.0) * (t * math.pow(k, 2.0))) / math.pow(l, 2.0))
	t_2 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))
	tmp = 0
	if t <= -3.2e+159:
		tmp = t_1
	elif t <= -2e-143:
		tmp = 2.0 / (t_2 * (math.tan(k) * (k * ((k / t) / t))))
	elif (t <= 3.2e-122) or not (t <= 1.42e+196):
		tmp = t_1
	else:
		tmp = 2.0 / (t_2 * (math.tan(k) * (k / (t * (t / k)))))
	return tmp
k = abs(k)
function code(t, l, k)
	t_1 = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(t * (k ^ 2.0))) / (l ^ 2.0)))
	t_2 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l)))
	tmp = 0.0
	if (t <= -3.2e+159)
		tmp = t_1;
	elseif (t <= -2e-143)
		tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t)))));
	elseif ((t <= 3.2e-122) || !(t <= 1.42e+196))
		tmp = t_1;
	else
		tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k))))));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	t_1 = 2.0 / (((sin(k) ^ 2.0) * (t * (k ^ 2.0))) / (l ^ 2.0));
	t_2 = sin(k) * (((t ^ 2.0) / l) * (t / l));
	tmp = 0.0;
	if (t <= -3.2e+159)
		tmp = t_1;
	elseif (t <= -2e-143)
		tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
	elseif ((t <= 3.2e-122) || ~((t <= 1.42e+196)))
		tmp = t_1;
	else
		tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+159], t$95$1, If[LessEqual[t, -2e-143], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.2e-122], N[Not[LessEqual[t, 1.42e+196]], $MachinePrecision]], t$95$1, N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := \frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\
t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+159}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq -2 \cdot 10^{-143}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{-122} \lor \neg \left(t \leq 1.42 \cdot 10^{+196}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.19999999999999985e159 or -1.9999999999999999e-143 < t < 3.2000000000000002e-122 or 1.42000000000000002e196 < t

    1. Initial program 26.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. Simplified32.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 71.8%

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

    if -3.19999999999999985e159 < t < -1.9999999999999999e-143

    1. Initial program 51.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. Simplified56.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000002e-122 < t < 1.42000000000000002e196

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\color{blue}{{k}^{2} \cdot {\left(\frac{1}{t}\right)}^{2}} + 0\right)\right)} \]
    7. Step-by-step derivation
      1. pow-prod-down77.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.2 \cdot 10^{+159}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq -2 \cdot 10^{-143}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{-122} \lor \neg \left(t \leq 1.42 \cdot 10^{+196}\right):\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \end{array} \]

Alternative 11: 66.2% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} t_1 := t \cdot {k}^{2}\\ t_2 := 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\ t_3 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\ \mathbf{if}\;t \leq -3.1 \cdot 10^{+152}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-145}:\\ \;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-123}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\ \;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* t (pow k 2.0)))
        (t_2 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1))))
        (t_3 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
   (if (<= t -3.1e+152)
     t_2
     (if (<= t -5.5e-145)
       (/ 2.0 (* t_3 (* (tan k) (* k (/ (/ k t) t)))))
       (if (<= t 1.9e-123)
         t_2
         (if (<= t 1.42e+196)
           (/ 2.0 (* t_3 (* (tan k) (/ k (* t (/ t k))))))
           (/ 2.0 (/ (* (pow (sin k) 2.0) t_1) (pow l 2.0)))))))))
k = abs(k);
double code(double t, double l, double k) {
	double t_1 = t * pow(k, 2.0);
	double t_2 = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
	double t_3 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -3.1e+152) {
		tmp = t_2;
	} else if (t <= -5.5e-145) {
		tmp = 2.0 / (t_3 * (tan(k) * (k * ((k / t) / t))));
	} else if (t <= 1.9e-123) {
		tmp = t_2;
	} else if (t <= 1.42e+196) {
		tmp = 2.0 / (t_3 * (tan(k) * (k / (t * (t / k)))));
	} else {
		tmp = 2.0 / ((pow(sin(k), 2.0) * t_1) / pow(l, 2.0));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = t * (k ** 2.0d0)
    t_2 = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
    t_3 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
    if (t <= (-3.1d+152)) then
        tmp = t_2
    else if (t <= (-5.5d-145)) then
        tmp = 2.0d0 / (t_3 * (tan(k) * (k * ((k / t) / t))))
    else if (t <= 1.9d-123) then
        tmp = t_2
    else if (t <= 1.42d+196) then
        tmp = 2.0d0 / (t_3 * (tan(k) * (k / (t * (t / k)))))
    else
        tmp = 2.0d0 / (((sin(k) ** 2.0d0) * t_1) / (l ** 2.0d0))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double t_1 = t * Math.pow(k, 2.0);
	double t_2 = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
	double t_3 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -3.1e+152) {
		tmp = t_2;
	} else if (t <= -5.5e-145) {
		tmp = 2.0 / (t_3 * (Math.tan(k) * (k * ((k / t) / t))));
	} else if (t <= 1.9e-123) {
		tmp = t_2;
	} else if (t <= 1.42e+196) {
		tmp = 2.0 / (t_3 * (Math.tan(k) * (k / (t * (t / k)))));
	} else {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * t_1) / Math.pow(l, 2.0));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	t_1 = t * math.pow(k, 2.0)
	t_2 = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1))
	t_3 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))
	tmp = 0
	if t <= -3.1e+152:
		tmp = t_2
	elif t <= -5.5e-145:
		tmp = 2.0 / (t_3 * (math.tan(k) * (k * ((k / t) / t))))
	elif t <= 1.9e-123:
		tmp = t_2
	elif t <= 1.42e+196:
		tmp = 2.0 / (t_3 * (math.tan(k) * (k / (t * (t / k)))))
	else:
		tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * t_1) / math.pow(l, 2.0))
	return tmp
k = abs(k)
function code(t, l, k)
	t_1 = Float64(t * (k ^ 2.0))
	t_2 = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1)))
	t_3 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l)))
	tmp = 0.0
	if (t <= -3.1e+152)
		tmp = t_2;
	elseif (t <= -5.5e-145)
		tmp = Float64(2.0 / Float64(t_3 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t)))));
	elseif (t <= 1.9e-123)
		tmp = t_2;
	elseif (t <= 1.42e+196)
		tmp = Float64(2.0 / Float64(t_3 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k))))));
	else
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * t_1) / (l ^ 2.0)));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	t_1 = t * (k ^ 2.0);
	t_2 = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1));
	t_3 = sin(k) * (((t ^ 2.0) / l) * (t / l));
	tmp = 0.0;
	if (t <= -3.1e+152)
		tmp = t_2;
	elseif (t <= -5.5e-145)
		tmp = 2.0 / (t_3 * (tan(k) * (k * ((k / t) / t))));
	elseif (t <= 1.9e-123)
		tmp = t_2;
	elseif (t <= 1.42e+196)
		tmp = 2.0 / (t_3 * (tan(k) * (k / (t * (t / k)))));
	else
		tmp = 2.0 / (((sin(k) ^ 2.0) * t_1) / (l ^ 2.0));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.1e+152], t$95$2, If[LessEqual[t, -5.5e-145], N[(2.0 / N[(t$95$3 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e-123], t$95$2, If[LessEqual[t, 1.42e+196], N[(2.0 / N[(t$95$3 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
t_2 := 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\
t_3 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{+152}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq -5.5 \cdot 10^{-145}:\\
\;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\

\mathbf{elif}\;t \leq 1.9 \cdot 10^{-123}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\
\;\;\;\;\frac{2}{t_3 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -3.1e152 or -5.50000000000000015e-145 < t < 1.89999999999999998e-123

    1. Initial program 28.3%

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

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

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

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

    if -3.1e152 < t < -5.50000000000000015e-145

    1. Initial program 52.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. Simplified58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999998e-123 < t < 1.42000000000000002e196

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\color{blue}{{k}^{2} \cdot {\left(\frac{1}{t}\right)}^{2}} + 0\right)\right)} \]
    7. Step-by-step derivation
      1. pow-prod-down77.0%

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

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

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

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

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

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

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

    if 1.42000000000000002e196 < t

    1. Initial program 11.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. Simplified11.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{\frac{\cos k}{{k}^{2}}}} \cdot {\sin k}^{2}}{{\ell}^{2}}} \]
    9. Applied egg-rr74.4%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.1 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {k}^{2}\right)}\\ \mathbf{elif}\;t \leq -5.5 \cdot 10^{-145}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 1.9 \cdot 10^{-123}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {k}^{2}\right)}\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\ \end{array} \]

Alternative 12: 66.5% accurate, 1.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} t_1 := t \cdot {k}^{2}\\ t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\ \mathbf{if}\;t \leq -5.2 \cdot 10^{+153}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-141}:\\ \;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-120}:\\ \;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\ \;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* t (pow k 2.0)))
        (t_2 (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))))
   (if (<= t -5.2e+153)
     (* 2.0 (/ (* (cos k) (pow l 2.0)) (* (pow k 2.0) t_1)))
     (if (<= t -4.2e-141)
       (/ 2.0 (* t_2 (* (tan k) (* k (/ (/ k t) t)))))
       (if (<= t 9e-120)
         (/ 2.0 (* (/ t_1 (cos k)) (/ (pow k 2.0) (pow l 2.0))))
         (if (<= t 1.42e+196)
           (/ 2.0 (* t_2 (* (tan k) (/ k (* t (/ t k))))))
           (/ 2.0 (/ (* (pow (sin k) 2.0) t_1) (pow l 2.0)))))))))
k = abs(k);
double code(double t, double l, double k) {
	double t_1 = t * pow(k, 2.0);
	double t_2 = sin(k) * ((pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -5.2e+153) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(k, 2.0) * t_1));
	} else if (t <= -4.2e-141) {
		tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
	} else if (t <= 9e-120) {
		tmp = 2.0 / ((t_1 / cos(k)) * (pow(k, 2.0) / pow(l, 2.0)));
	} else if (t <= 1.42e+196) {
		tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
	} else {
		tmp = 2.0 / ((pow(sin(k), 2.0) * t_1) / pow(l, 2.0));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (k ** 2.0d0)
    t_2 = sin(k) * (((t ** 2.0d0) / l) * (t / l))
    if (t <= (-5.2d+153)) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((k ** 2.0d0) * t_1))
    else if (t <= (-4.2d-141)) then
        tmp = 2.0d0 / (t_2 * (tan(k) * (k * ((k / t) / t))))
    else if (t <= 9d-120) then
        tmp = 2.0d0 / ((t_1 / cos(k)) * ((k ** 2.0d0) / (l ** 2.0d0)))
    else if (t <= 1.42d+196) then
        tmp = 2.0d0 / (t_2 * (tan(k) * (k / (t * (t / k)))))
    else
        tmp = 2.0d0 / (((sin(k) ** 2.0d0) * t_1) / (l ** 2.0d0))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double t_1 = t * Math.pow(k, 2.0);
	double t_2 = Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l));
	double tmp;
	if (t <= -5.2e+153) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(k, 2.0) * t_1));
	} else if (t <= -4.2e-141) {
		tmp = 2.0 / (t_2 * (Math.tan(k) * (k * ((k / t) / t))));
	} else if (t <= 9e-120) {
		tmp = 2.0 / ((t_1 / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 2.0)));
	} else if (t <= 1.42e+196) {
		tmp = 2.0 / (t_2 * (Math.tan(k) * (k / (t * (t / k)))));
	} else {
		tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * t_1) / Math.pow(l, 2.0));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	t_1 = t * math.pow(k, 2.0)
	t_2 = math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))
	tmp = 0
	if t <= -5.2e+153:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(k, 2.0) * t_1))
	elif t <= -4.2e-141:
		tmp = 2.0 / (t_2 * (math.tan(k) * (k * ((k / t) / t))))
	elif t <= 9e-120:
		tmp = 2.0 / ((t_1 / math.cos(k)) * (math.pow(k, 2.0) / math.pow(l, 2.0)))
	elif t <= 1.42e+196:
		tmp = 2.0 / (t_2 * (math.tan(k) * (k / (t * (t / k)))))
	else:
		tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * t_1) / math.pow(l, 2.0))
	return tmp
k = abs(k)
function code(t, l, k)
	t_1 = Float64(t * (k ^ 2.0))
	t_2 = Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l)))
	tmp = 0.0
	if (t <= -5.2e+153)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((k ^ 2.0) * t_1)));
	elseif (t <= -4.2e-141)
		tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t)))));
	elseif (t <= 9e-120)
		tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64((k ^ 2.0) / (l ^ 2.0))));
	elseif (t <= 1.42e+196)
		tmp = Float64(2.0 / Float64(t_2 * Float64(tan(k) * Float64(k / Float64(t * Float64(t / k))))));
	else
		tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * t_1) / (l ^ 2.0)));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	t_1 = t * (k ^ 2.0);
	t_2 = sin(k) * (((t ^ 2.0) / l) * (t / l));
	tmp = 0.0;
	if (t <= -5.2e+153)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((k ^ 2.0) * t_1));
	elseif (t <= -4.2e-141)
		tmp = 2.0 / (t_2 * (tan(k) * (k * ((k / t) / t))));
	elseif (t <= 9e-120)
		tmp = 2.0 / ((t_1 / cos(k)) * ((k ^ 2.0) / (l ^ 2.0)));
	elseif (t <= 1.42e+196)
		tmp = 2.0 / (t_2 * (tan(k) * (k / (t * (t / k)))));
	else
		tmp = 2.0 / (((sin(k) ^ 2.0) * t_1) / (l ^ 2.0));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := Block[{t$95$1 = N[(t * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+153], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-141], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-120], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.42e+196], N[(2.0 / N[(t$95$2 * N[(N[Tan[k], $MachinePrecision] * N[(k / N[(t * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$1), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
t_1 := t \cdot {k}^{2}\\
t_2 := \sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+153}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot t_1}\\

\mathbf{elif}\;t \leq -4.2 \cdot 10^{-141}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\

\mathbf{elif}\;t \leq 9 \cdot 10^{-120}:\\
\;\;\;\;\frac{2}{\frac{t_1}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\

\mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\
\;\;\;\;\frac{2}{t_2 \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot t_1}{{\ell}^{2}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -5.1999999999999998e153

    1. Initial program 13.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. Simplified34.6%

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

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

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

    if -5.1999999999999998e153 < t < -4.1999999999999999e-141

    1. Initial program 52.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. Simplified58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999999e-141 < t < 9e-120

    1. Initial program 36.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \frac{{\sin k}^{2}}{{\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 64.1%

      \[\leadsto \frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]

    if 9e-120 < t < 1.42000000000000002e196

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\color{blue}{{k}^{2} \cdot {\left(\frac{1}{t}\right)}^{2}} + 0\right)\right)} \]
    7. Step-by-step derivation
      1. pow-prod-down77.0%

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

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

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

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

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

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

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

    if 1.42000000000000002e196 < t

    1. Initial program 11.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. Simplified11.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\frac{t}{\frac{\cos k}{{k}^{2}}}} \cdot {\sin k}^{2}}{{\ell}^{2}}} \]
    9. Applied egg-rr74.4%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{t}{\frac{\cos k}{{k}^{2}}} \cdot {\sin k}^{2}}{{\ell}^{2}}}} \]
    10. Taylor expanded in k around 0 70.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.2 \cdot 10^{+153}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{k}^{2} \cdot \left(t \cdot {k}^{2}\right)}\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{-141}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{-120}:\\ \;\;\;\;\frac{2}{\frac{t \cdot {k}^{2}}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 1.42 \cdot 10^{+196}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \frac{k}{t \cdot \frac{t}{k}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{\sin k}^{2} \cdot \left(t \cdot {k}^{2}\right)}{{\ell}^{2}}}\\ \end{array} \]

Alternative 13: 64.8% accurate, 1.3× speedup?

\[\begin{array}{l} k = |k|\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-146}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-116}:\\ \;\;\;\;{k}^{-4} \cdot \left({\ell}^{2} \cdot \frac{2}{t}\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+89}:\\ \;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}\\ \end{array} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (if (<= t -8e+149)
   (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t (pow k 4.0))))
   (if (<= t -2.1e-146)
     (/
      2.0
      (*
       (* (sin k) (* (/ (pow t 2.0) l) (/ t l)))
       (* (tan k) (* k (/ (/ k t) t)))))
     (if (<= t 2.35e-116)
       (* (pow k -4.0) (* (pow l 2.0) (/ 2.0 t)))
       (if (<= t 4.5e+89)
         (/
          (/ 2.0 (* (tan k) (* (/ (pow t 3.0) l) (/ (sin k) l))))
          (/ 1.0 (* (/ t k) (/ t k))))
         (* (/ 2.0 t) (/ (pow l 2.0) (pow k 4.0))))))))
k = abs(k);
double code(double t, double l, double k) {
	double tmp;
	if (t <= -8e+149) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (t * pow(k, 4.0)));
	} else if (t <= -2.1e-146) {
		tmp = 2.0 / ((sin(k) * ((pow(t, 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
	} else if (t <= 2.35e-116) {
		tmp = pow(k, -4.0) * (pow(l, 2.0) * (2.0 / t));
	} else if (t <= 4.5e+89) {
		tmp = (2.0 / (tan(k) * ((pow(t, 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	} else {
		tmp = (2.0 / t) * (pow(l, 2.0) / pow(k, 4.0));
	}
	return tmp;
}
NOTE: k should be positive before calling this function
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t <= (-8d+149)) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / (t * (k ** 4.0d0)))
    else if (t <= (-2.1d-146)) then
        tmp = 2.0d0 / ((sin(k) * (((t ** 2.0d0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))))
    else if (t <= 2.35d-116) then
        tmp = (k ** (-4.0d0)) * ((l ** 2.0d0) * (2.0d0 / t))
    else if (t <= 4.5d+89) then
        tmp = (2.0d0 / (tan(k) * (((t ** 3.0d0) / l) * (sin(k) / l)))) / (1.0d0 / ((t / k) * (t / k)))
    else
        tmp = (2.0d0 / t) * ((l ** 2.0d0) / (k ** 4.0d0))
    end if
    code = tmp
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	double tmp;
	if (t <= -8e+149) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t * Math.pow(k, 4.0)));
	} else if (t <= -2.1e-146) {
		tmp = 2.0 / ((Math.sin(k) * ((Math.pow(t, 2.0) / l) * (t / l))) * (Math.tan(k) * (k * ((k / t) / t))));
	} else if (t <= 2.35e-116) {
		tmp = Math.pow(k, -4.0) * (Math.pow(l, 2.0) * (2.0 / t));
	} else if (t <= 4.5e+89) {
		tmp = (2.0 / (Math.tan(k) * ((Math.pow(t, 3.0) / l) * (Math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	} else {
		tmp = (2.0 / t) * (Math.pow(l, 2.0) / Math.pow(k, 4.0));
	}
	return tmp;
}
k = abs(k)
def code(t, l, k):
	tmp = 0
	if t <= -8e+149:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t * math.pow(k, 4.0)))
	elif t <= -2.1e-146:
		tmp = 2.0 / ((math.sin(k) * ((math.pow(t, 2.0) / l) * (t / l))) * (math.tan(k) * (k * ((k / t) / t))))
	elif t <= 2.35e-116:
		tmp = math.pow(k, -4.0) * (math.pow(l, 2.0) * (2.0 / t))
	elif t <= 4.5e+89:
		tmp = (2.0 / (math.tan(k) * ((math.pow(t, 3.0) / l) * (math.sin(k) / l)))) / (1.0 / ((t / k) * (t / k)))
	else:
		tmp = (2.0 / t) * (math.pow(l, 2.0) / math.pow(k, 4.0))
	return tmp
k = abs(k)
function code(t, l, k)
	tmp = 0.0
	if (t <= -8e+149)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t * (k ^ 4.0))));
	elseif (t <= -2.1e-146)
		tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l))) * Float64(tan(k) * Float64(k * Float64(Float64(k / t) / t)))));
	elseif (t <= 2.35e-116)
		tmp = Float64((k ^ -4.0) * Float64((l ^ 2.0) * Float64(2.0 / t)));
	elseif (t <= 4.5e+89)
		tmp = Float64(Float64(2.0 / Float64(tan(k) * Float64(Float64((t ^ 3.0) / l) * Float64(sin(k) / l)))) / Float64(1.0 / Float64(Float64(t / k) * Float64(t / k))));
	else
		tmp = Float64(Float64(2.0 / t) * Float64((l ^ 2.0) / (k ^ 4.0)));
	end
	return tmp
end
k = abs(k)
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (t <= -8e+149)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t * (k ^ 4.0)));
	elseif (t <= -2.1e-146)
		tmp = 2.0 / ((sin(k) * (((t ^ 2.0) / l) * (t / l))) * (tan(k) * (k * ((k / t) / t))));
	elseif (t <= 2.35e-116)
		tmp = (k ^ -4.0) * ((l ^ 2.0) * (2.0 / t));
	elseif (t <= 4.5e+89)
		tmp = (2.0 / (tan(k) * (((t ^ 3.0) / l) * (sin(k) / l)))) / (1.0 / ((t / k) * (t / k)));
	else
		tmp = (2.0 / t) * ((l ^ 2.0) / (k ^ 4.0));
	end
	tmp_2 = tmp;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := If[LessEqual[t, -8e+149], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.1e-146], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(N[(k / t), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.35e-116], N[(N[Power[k, -4.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] * N[(2.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+89], N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(t / k), $MachinePrecision] * N[(t / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k = |k|\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\

\mathbf{elif}\;t \leq -2.1 \cdot 10^{-146}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\

\mathbf{elif}\;t \leq 2.35 \cdot 10^{-116}:\\
\;\;\;\;{k}^{-4} \cdot \left({\ell}^{2} \cdot \frac{2}{t}\right)\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < -8.00000000000000039e149

    1. Initial program 13.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. Simplified34.6%

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

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

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

    if -8.00000000000000039e149 < t < -2.0999999999999999e-146

    1. Initial program 52.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. Simplified58.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0999999999999999e-146 < t < 2.34999999999999997e-116

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\left({\ell}^{2} \cdot \color{blue}{{k}^{\left(-4\right)}}\right) \cdot \frac{2}{t}\right)} - 1 \]
      6. metadata-eval31.5%

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

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

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

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

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

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

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

    if 2.34999999999999997e-116 < t < 4.5e89

    1. Initial program 55.5%

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

        \[\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. associate-*l/55.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      6. clear-num71.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\frac{k}{t} \cdot \color{blue}{\frac{1}{\frac{t}{k}}}} \]
      7. clear-num71.0%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3} \cdot \sin k}{\ell \cdot \ell} \cdot \tan k}}{\color{blue}{\frac{1 \cdot 1}{\frac{t}{k} \cdot \frac{t}{k}}}} \]
      9. metadata-eval71.1%

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

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

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

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

    if 4.5e89 < t

    1. Initial program 21.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. Simplified31.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\ \mathbf{elif}\;t \leq -2.1 \cdot 10^{-146}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right) \cdot \left(\tan k \cdot \left(k \cdot \frac{\frac{k}{t}}{t}\right)\right)}\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{-116}:\\ \;\;\;\;{k}^{-4} \cdot \left({\ell}^{2} \cdot \frac{2}{t}\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+89}:\\ \;\;\;\;\frac{\frac{2}{\tan k \cdot \left(\frac{{t}^{3}}{\ell} \cdot \frac{\sin k}{\ell}\right)}}{\frac{1}{\frac{t}{k} \cdot \frac{t}{k}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}\\ \end{array} \]

Alternative 14: 60.9% accurate, 1.4× speedup?

\[\begin{array}{l} k = |k|\\ \\ 2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k)
 :precision binary64
 (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t (pow k 4.0)))))
k = abs(k);
double code(double t, double l, double k) {
	return 2.0 * ((cos(k) * pow(l, 2.0)) / (t * pow(k, 4.0)));
}
NOTE: k should be positive before calling this function
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 * ((cos(k) * (l ** 2.0d0)) / (t * (k ** 4.0d0)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t * Math.pow(k, 4.0)));
}
k = abs(k)
def code(t, l, k):
	return 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t * math.pow(k, 4.0)))
k = abs(k)
function code(t, l, k)
	return Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t * (k ^ 4.0))))
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t * (k ^ 4.0)));
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

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

Alternative 15: 59.5% accurate, 2.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ 2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k) :precision binary64 (* 2.0 (/ (pow l 2.0) (* t (pow k 4.0)))))
k = abs(k);
double code(double t, double l, double k) {
	return 2.0 * (pow(l, 2.0) / (t * pow(k, 4.0)));
}
NOTE: k should be positive before calling this function
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 * ((l ** 2.0d0) / (t * (k ** 4.0d0)))
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return 2.0 * (Math.pow(l, 2.0) / (t * Math.pow(k, 4.0)));
}
k = abs(k)
def code(t, l, k):
	return 2.0 * (math.pow(l, 2.0) / (t * math.pow(k, 4.0)))
k = abs(k)
function code(t, l, k)
	return Float64(2.0 * Float64((l ^ 2.0) / Float64(t * (k ^ 4.0))))
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = 2.0 * ((l ^ 2.0) / (t * (k ^ 4.0)));
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}}
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

Alternative 16: 59.6% accurate, 2.0× speedup?

\[\begin{array}{l} k = |k|\\ \\ \frac{2 \cdot \left({\ell}^{2} \cdot {k}^{-4}\right)}{t} \end{array} \]
NOTE: k should be positive before calling this function
(FPCore (t l k) :precision binary64 (/ (* 2.0 (* (pow l 2.0) (pow k -4.0))) t))
k = abs(k);
double code(double t, double l, double k) {
	return (2.0 * (pow(l, 2.0) * pow(k, -4.0))) / t;
}
NOTE: k should be positive before calling this function
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 * ((l ** 2.0d0) * (k ** (-4.0d0)))) / t
end function
k = Math.abs(k);
public static double code(double t, double l, double k) {
	return (2.0 * (Math.pow(l, 2.0) * Math.pow(k, -4.0))) / t;
}
k = abs(k)
def code(t, l, k):
	return (2.0 * (math.pow(l, 2.0) * math.pow(k, -4.0))) / t
k = abs(k)
function code(t, l, k)
	return Float64(Float64(2.0 * Float64((l ^ 2.0) * (k ^ -4.0))) / t)
end
k = abs(k)
function tmp = code(t, l, k)
	tmp = (2.0 * ((l ^ 2.0) * (k ^ -4.0))) / t;
end
NOTE: k should be positive before calling this function
code[t_, l_, k_] := N[(N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
k = |k|\\
\\
\frac{2 \cdot \left({\ell}^{2} \cdot {k}^{-4}\right)}{t}
\end{array}
Derivation
  1. Initial program 37.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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