Toniolo and Linder, Equation (10+)

Percentage Accurate: 55.1% → 83.5%
Time: 23.4s
Alternatives: 21
Speedup: 1.9×

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 21 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: 55.1% 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: 83.5% accurate, 0.5× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := 2 + {\left(\frac{k\_m}{t}\right)}^{2}\\ \mathbf{if}\;k\_m \leq 230000:\\ \;\;\;\;\frac{2}{{\left(\left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right) \cdot \left(\sqrt[3]{\sin k\_m} \cdot \sqrt[3]{\tan k\_m \cdot t\_1}\right)\right)}^{3}}\\ \mathbf{elif}\;k\_m \leq 8.5 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{t\_1 \cdot \left(\sin k\_m \cdot \tan k\_m\right)}\right)}^{3}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (+ 2.0 (pow (/ k_m t) 2.0))))
   (if (<= k_m 230000.0)
     (/
      2.0
      (pow
       (*
        (* t (pow (cbrt l) -2.0))
        (* (cbrt (sin k_m)) (cbrt (* (tan k_m) t_1))))
       3.0))
     (if (<= k_m 8.5e+149)
       (*
        2.0
        (*
         (pow l 2.0)
         (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0)))))
       (/
        2.0
        (pow
         (* (/ t (pow (cbrt l) 2.0)) (cbrt (* t_1 (* (sin k_m) (tan k_m)))))
         3.0))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = 2.0 + pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 230000.0) {
		tmp = 2.0 / pow(((t * pow(cbrt(l), -2.0)) * (cbrt(sin(k_m)) * cbrt((tan(k_m) * t_1)))), 3.0);
	} else if (k_m <= 8.5e+149) {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((t_1 * (sin(k_m) * tan(k_m))))), 3.0);
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = 2.0 + Math.pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 230000.0) {
		tmp = 2.0 / Math.pow(((t * Math.pow(Math.cbrt(l), -2.0)) * (Math.cbrt(Math.sin(k_m)) * Math.cbrt((Math.tan(k_m) * t_1)))), 3.0);
	} else if (k_m <= 8.5e+149) {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((t_1 * (Math.sin(k_m) * Math.tan(k_m))))), 3.0);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(2.0 + (Float64(k_m / t) ^ 2.0))
	tmp = 0.0
	if (k_m <= 230000.0)
		tmp = Float64(2.0 / (Float64(Float64(t * (cbrt(l) ^ -2.0)) * Float64(cbrt(sin(k_m)) * cbrt(Float64(tan(k_m) * t_1)))) ^ 3.0));
	elseif (k_m <= 8.5e+149)
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(t_1 * Float64(sin(k_m) * tan(k_m))))) ^ 3.0));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(2.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 230000.0], N[(2.0 / N[Power[N[(N[(t * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[(N[Tan[k$95$m], $MachinePrecision] * t$95$1), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 8.5e+149], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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[(t$95$1 * N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := 2 + {\left(\frac{k\_m}{t}\right)}^{2}\\
\mathbf{if}\;k\_m \leq 230000:\\
\;\;\;\;\frac{2}{{\left(\left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right) \cdot \left(\sqrt[3]{\sin k\_m} \cdot \sqrt[3]{\tan k\_m \cdot t\_1}\right)\right)}^{3}}\\

\mathbf{elif}\;k\_m \leq 8.5 \cdot 10^{+149}:\\
\;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\

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


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

    1. Initial program 59.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. Simplified59.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3e5 < k < 8.49999999999999956e149

    1. Initial program 45.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. Simplified45.4%

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

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

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

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

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

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

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

    if 8.49999999999999956e149 < k

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 230000:\\ \;\;\;\;\frac{2}{{\left(\left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right) \cdot \left(\sqrt[3]{\sin k} \cdot \sqrt[3]{\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}\right)\right)}^{3}}\\ \mathbf{elif}\;k \leq 8.5 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(2 + {\left(\frac{k}{t}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}\right)}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 72.2% accurate, 0.6× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \sin k\_m \cdot \tan k\_m\\ t_2 := 2 + {\left(\frac{k\_m}{t}\right)}^{2}\\ \mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot t\_2\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3}}\\ \mathbf{elif}\;k\_m \leq 14:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{t\_1}\right)\right)}^{2}}\\ \mathbf{elif}\;k\_m \leq 1.7 \cdot 10^{+150}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{t\_2 \cdot t\_1}\right)}^{3}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (* (sin k_m) (tan k_m))) (t_2 (+ 2.0 (pow (/ k_m t) 2.0))))
   (if (<= k_m 2e-147)
     (/
      2.0
      (*
       (* (tan k_m) t_2)
       (pow (* t (* (pow (cbrt l) -2.0) (cbrt (sin k_m)))) 3.0)))
     (if (<= k_m 14.0)
       (/
        2.0
        (pow
         (* (/ (pow t 1.5) l) (* (hypot 1.0 (hypot 1.0 (/ k_m t))) (sqrt t_1)))
         2.0))
       (if (<= k_m 1.7e+150)
         (*
          2.0
          (*
           (pow l 2.0)
           (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0)))))
         (/ 2.0 (pow (* (/ t (pow (cbrt l) 2.0)) (cbrt (* t_2 t_1))) 3.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = sin(k_m) * tan(k_m);
	double t_2 = 2.0 + pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((tan(k_m) * t_2) * pow((t * (pow(cbrt(l), -2.0) * cbrt(sin(k_m)))), 3.0));
	} else if (k_m <= 14.0) {
		tmp = 2.0 / pow(((pow(t, 1.5) / l) * (hypot(1.0, hypot(1.0, (k_m / t))) * sqrt(t_1))), 2.0);
	} else if (k_m <= 1.7e+150) {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt((t_2 * t_1))), 3.0);
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = Math.sin(k_m) * Math.tan(k_m);
	double t_2 = 2.0 + Math.pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((Math.tan(k_m) * t_2) * Math.pow((t * (Math.pow(Math.cbrt(l), -2.0) * Math.cbrt(Math.sin(k_m)))), 3.0));
	} else if (k_m <= 14.0) {
		tmp = 2.0 / Math.pow(((Math.pow(t, 1.5) / l) * (Math.hypot(1.0, Math.hypot(1.0, (k_m / t))) * Math.sqrt(t_1))), 2.0);
	} else if (k_m <= 1.7e+150) {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((t_2 * t_1))), 3.0);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(sin(k_m) * tan(k_m))
	t_2 = Float64(2.0 + (Float64(k_m / t) ^ 2.0))
	tmp = 0.0
	if (k_m <= 2e-147)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * t_2) * (Float64(t * Float64((cbrt(l) ^ -2.0) * cbrt(sin(k_m)))) ^ 3.0)));
	elseif (k_m <= 14.0)
		tmp = Float64(2.0 / (Float64(Float64((t ^ 1.5) / l) * Float64(hypot(1.0, hypot(1.0, Float64(k_m / t))) * sqrt(t_1))) ^ 2.0));
	elseif (k_m <= 1.7e+150)
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(t_2 * t_1))) ^ 3.0));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 2e-147], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * t$95$2), $MachinePrecision] * N[Power[N[(t * N[(N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 14.0], N[(2.0 / N[Power[N[(N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.7e+150], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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[(t$95$2 * t$95$1), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \sin k\_m \cdot \tan k\_m\\
t_2 := 2 + {\left(\frac{k\_m}{t}\right)}^{2}\\
\mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot t\_2\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3}}\\

\mathbf{elif}\;k\_m \leq 14:\\
\;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{t\_1}\right)\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 1.7 \cdot 10^{+150}:\\
\;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if k < 1.9999999999999999e-147

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-147 < k < 14

    1. Initial program 64.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. Simplified64.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]

    if 14 < k < 1.69999999999999991e150

    1. Initial program 43.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. Simplified43.8%

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

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

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

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

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

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

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

    if 1.69999999999999991e150 < k

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k}\right)\right)}^{3}}\\ \mathbf{elif}\;k \leq 14:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}\\ \mathbf{elif}\;k \leq 1.7 \cdot 10^{+150}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(2 + {\left(\frac{k}{t}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}\right)}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.2% accurate, 0.6× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \sin k\_m \cdot \tan k\_m\\ t_2 := {\left(\frac{k\_m}{t}\right)}^{2}\\ \mathbf{if}\;k\_m \leq 1.55 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \left(t \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3} \cdot \left(\tan k\_m \cdot \left(1 + \left(t\_2 + 1\right)\right)\right)}\\ \mathbf{elif}\;k\_m \leq 46:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{t\_1}\right)\right)}^{2}}\\ \mathbf{elif}\;k\_m \leq 3.7 \cdot 10^{+148}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(2 + t\_2\right) \cdot t\_1}\right)}^{3}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (* (sin k_m) (tan k_m))) (t_2 (pow (/ k_m t) 2.0)))
   (if (<= k_m 1.55e-159)
     (/
      2.0
      (*
       (pow (* (pow (cbrt l) -2.0) (* t (cbrt (sin k_m)))) 3.0)
       (* (tan k_m) (+ 1.0 (+ t_2 1.0)))))
     (if (<= k_m 46.0)
       (/
        2.0
        (pow
         (* (/ (pow t 1.5) l) (* (hypot 1.0 (hypot 1.0 (/ k_m t))) (sqrt t_1)))
         2.0))
       (if (<= k_m 3.7e+148)
         (*
          2.0
          (*
           (pow l 2.0)
           (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0)))))
         (/
          2.0
          (pow
           (* (/ t (pow (cbrt l) 2.0)) (cbrt (* (+ 2.0 t_2) t_1)))
           3.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = sin(k_m) * tan(k_m);
	double t_2 = pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 1.55e-159) {
		tmp = 2.0 / (pow((pow(cbrt(l), -2.0) * (t * cbrt(sin(k_m)))), 3.0) * (tan(k_m) * (1.0 + (t_2 + 1.0))));
	} else if (k_m <= 46.0) {
		tmp = 2.0 / pow(((pow(t, 1.5) / l) * (hypot(1.0, hypot(1.0, (k_m / t))) * sqrt(t_1))), 2.0);
	} else if (k_m <= 3.7e+148) {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * cbrt(((2.0 + t_2) * t_1))), 3.0);
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = Math.sin(k_m) * Math.tan(k_m);
	double t_2 = Math.pow((k_m / t), 2.0);
	double tmp;
	if (k_m <= 1.55e-159) {
		tmp = 2.0 / (Math.pow((Math.pow(Math.cbrt(l), -2.0) * (t * Math.cbrt(Math.sin(k_m)))), 3.0) * (Math.tan(k_m) * (1.0 + (t_2 + 1.0))));
	} else if (k_m <= 46.0) {
		tmp = 2.0 / Math.pow(((Math.pow(t, 1.5) / l) * (Math.hypot(1.0, Math.hypot(1.0, (k_m / t))) * Math.sqrt(t_1))), 2.0);
	} else if (k_m <= 3.7e+148) {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(((2.0 + t_2) * t_1))), 3.0);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(sin(k_m) * tan(k_m))
	t_2 = Float64(k_m / t) ^ 2.0
	tmp = 0.0
	if (k_m <= 1.55e-159)
		tmp = Float64(2.0 / Float64((Float64((cbrt(l) ^ -2.0) * Float64(t * cbrt(sin(k_m)))) ^ 3.0) * Float64(tan(k_m) * Float64(1.0 + Float64(t_2 + 1.0)))));
	elseif (k_m <= 46.0)
		tmp = Float64(2.0 / (Float64(Float64((t ^ 1.5) / l) * Float64(hypot(1.0, hypot(1.0, Float64(k_m / t))) * sqrt(t_1))) ^ 2.0));
	elseif (k_m <= 3.7e+148)
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(Float64(Float64(2.0 + t_2) * t_1))) ^ 3.0));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 1.55e-159], N[(2.0 / N[(N[Power[N[(N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[(t * N[Power[N[Sin[k$95$m], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(N[Tan[k$95$m], $MachinePrecision] * N[(1.0 + N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 46.0], N[(2.0 / N[Power[N[(N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3.7e+148], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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[(2.0 + t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \sin k\_m \cdot \tan k\_m\\
t_2 := {\left(\frac{k\_m}{t}\right)}^{2}\\
\mathbf{if}\;k\_m \leq 1.55 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{{\left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \left(t \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3} \cdot \left(\tan k\_m \cdot \left(1 + \left(t\_2 + 1\right)\right)\right)}\\

\mathbf{elif}\;k\_m \leq 46:\\
\;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{t\_1}\right)\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 3.7 \cdot 10^{+148}:\\
\;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(2 + t\_2\right) \cdot t\_1}\right)}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if k < 1.55e-159

    1. Initial program 59.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. Simplified59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.55e-159 < k < 46

    1. Initial program 66.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. Simplified66.2%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]

    if 46 < k < 3.7000000000000002e148

    1. Initial program 43.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. Simplified43.8%

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

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

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

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

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

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

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

    if 3.7000000000000002e148 < k

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.55 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \left(t \cdot \sqrt[3]{\sin k}\right)\right)}^{3} \cdot \left(\tan k \cdot \left(1 + \left({\left(\frac{k}{t}\right)}^{2} + 1\right)\right)\right)}\\ \mathbf{elif}\;k \leq 46:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}\\ \mathbf{elif}\;k \leq 3.7 \cdot 10^{+148}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\left(2 + {\left(\frac{k}{t}\right)}^{2}\right) \cdot \left(\sin k \cdot \tan k\right)}\right)}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 69.8% accurate, 0.6× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-146}:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(1 + \left({\left(\frac{k\_m}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k\_m}\right)}^{3}}\\ \mathbf{elif}\;k\_m \leq 46:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{\sin k\_m \cdot \tan k\_m}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 1.3e-146)
   (/
    2.0
    (*
     (* (tan k_m) (+ 1.0 (+ (pow (/ k_m t) 2.0) 1.0)))
     (pow (* (/ t (pow (cbrt l) 2.0)) (cbrt k_m)) 3.0)))
   (if (<= k_m 46.0)
     (/
      2.0
      (pow
       (*
        (/ (pow t 1.5) l)
        (* (hypot 1.0 (hypot 1.0 (/ k_m t))) (sqrt (* (sin k_m) (tan k_m)))))
       2.0))
     (*
      2.0
      (*
       (pow l 2.0)
       (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1.3e-146) {
		tmp = 2.0 / ((tan(k_m) * (1.0 + (pow((k_m / t), 2.0) + 1.0))) * pow(((t / pow(cbrt(l), 2.0)) * cbrt(k_m)), 3.0));
	} else if (k_m <= 46.0) {
		tmp = 2.0 / pow(((pow(t, 1.5) / l) * (hypot(1.0, hypot(1.0, (k_m / t))) * sqrt((sin(k_m) * tan(k_m))))), 2.0);
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1.3e-146) {
		tmp = 2.0 / ((Math.tan(k_m) * (1.0 + (Math.pow((k_m / t), 2.0) + 1.0))) * Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(k_m)), 3.0));
	} else if (k_m <= 46.0) {
		tmp = 2.0 / Math.pow(((Math.pow(t, 1.5) / l) * (Math.hypot(1.0, Math.hypot(1.0, (k_m / t))) * Math.sqrt((Math.sin(k_m) * Math.tan(k_m))))), 2.0);
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 1.3e-146)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(1.0 + Float64((Float64(k_m / t) ^ 2.0) + 1.0))) * (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(k_m)) ^ 3.0)));
	elseif (k_m <= 46.0)
		tmp = Float64(2.0 / (Float64(Float64((t ^ 1.5) / l) * Float64(hypot(1.0, hypot(1.0, Float64(k_m / t))) * sqrt(Float64(sin(k_m) * tan(k_m))))) ^ 2.0));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.3e-146], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 46.0], N[(2.0 / N[Power[N[(N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-146}:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(1 + \left({\left(\frac{k\_m}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k\_m}\right)}^{3}}\\

\mathbf{elif}\;k\_m \leq 46:\\
\;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{\sin k\_m \cdot \tan k\_m}\right)\right)}^{2}}\\

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999993e-146 < k < 46

    1. Initial program 64.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. Simplified64.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]

    if 46 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.3 \cdot 10^{-146}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left({\left(\frac{k}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k}\right)}^{3}}\\ \mathbf{elif}\;k \leq 46:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.7% accurate, 0.6× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3}}\\ \mathbf{elif}\;k\_m \leq 13.8:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{\sin k\_m \cdot \tan k\_m}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2e-147)
   (/
    2.0
    (*
     (* (tan k_m) (+ 2.0 (pow (/ k_m t) 2.0)))
     (pow (* t (* (pow (cbrt l) -2.0) (cbrt (sin k_m)))) 3.0)))
   (if (<= k_m 13.8)
     (/
      2.0
      (pow
       (*
        (/ (pow t 1.5) l)
        (* (hypot 1.0 (hypot 1.0 (/ k_m t))) (sqrt (* (sin k_m) (tan k_m)))))
       2.0))
     (*
      2.0
      (*
       (pow l 2.0)
       (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((tan(k_m) * (2.0 + pow((k_m / t), 2.0))) * pow((t * (pow(cbrt(l), -2.0) * cbrt(sin(k_m)))), 3.0));
	} else if (k_m <= 13.8) {
		tmp = 2.0 / pow(((pow(t, 1.5) / l) * (hypot(1.0, hypot(1.0, (k_m / t))) * sqrt((sin(k_m) * tan(k_m))))), 2.0);
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((Math.tan(k_m) * (2.0 + Math.pow((k_m / t), 2.0))) * Math.pow((t * (Math.pow(Math.cbrt(l), -2.0) * Math.cbrt(Math.sin(k_m)))), 3.0));
	} else if (k_m <= 13.8) {
		tmp = 2.0 / Math.pow(((Math.pow(t, 1.5) / l) * (Math.hypot(1.0, Math.hypot(1.0, (k_m / t))) * Math.sqrt((Math.sin(k_m) * Math.tan(k_m))))), 2.0);
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2e-147)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(2.0 + (Float64(k_m / t) ^ 2.0))) * (Float64(t * Float64((cbrt(l) ^ -2.0) * cbrt(sin(k_m)))) ^ 3.0)));
	elseif (k_m <= 13.8)
		tmp = Float64(2.0 / (Float64(Float64((t ^ 1.5) / l) * Float64(hypot(1.0, hypot(1.0, Float64(k_m / t))) * sqrt(Float64(sin(k_m) * tan(k_m))))) ^ 2.0));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2e-147], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(2.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(t * N[(N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 13.8], N[(2.0 / N[Power[N[(N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k$95$m / t), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision] * N[Sqrt[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k\_m}\right)\right)}^{3}}\\

\mathbf{elif}\;k\_m \leq 13.8:\\
\;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right) \cdot \sqrt{\sin k\_m \cdot \tan k\_m}\right)\right)}^{2}}\\

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-147 < k < 13.800000000000001

    1. Initial program 64.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. Simplified64.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]

    if 13.800000000000001 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k}\right)\right)}^{3}}\\ \mathbf{elif}\;k \leq 13.8:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.1% accurate, 0.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 9 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(1 + \left({\left(\frac{k\_m}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k\_m}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 9e-7)
   (/
    2.0
    (*
     (* (tan k_m) (+ 1.0 (+ (pow (/ k_m t) 2.0) 1.0)))
     (pow (* (/ t (pow (cbrt l) 2.0)) (cbrt k_m)) 3.0)))
   (*
    2.0
    (*
     (pow l 2.0)
     (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 9e-7) {
		tmp = 2.0 / ((tan(k_m) * (1.0 + (pow((k_m / t), 2.0) + 1.0))) * pow(((t / pow(cbrt(l), 2.0)) * cbrt(k_m)), 3.0));
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 9e-7) {
		tmp = 2.0 / ((Math.tan(k_m) * (1.0 + (Math.pow((k_m / t), 2.0) + 1.0))) * Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(k_m)), 3.0));
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 9e-7)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(1.0 + Float64((Float64(k_m / t) ^ 2.0) + 1.0))) * (Float64(Float64(t / (cbrt(l) ^ 2.0)) * cbrt(k_m)) ^ 3.0)));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 9e-7], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(1.0 + N[(N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k$95$m, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 9 \cdot 10^{-7}:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(1 + \left({\left(\frac{k\_m}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k\_m}\right)}^{3}}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.99999999999999959e-7 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 9 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(1 + \left({\left(\frac{k}{t}\right)}^{2} + 1\right)\right)\right) \cdot {\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k}\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 56.7% accurate, 0.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.4 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot {\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k\_m}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.4e-6)
   (/
    2.0
    (*
     (* (tan k_m) (+ 2.0 (pow (/ k_m t) 2.0)))
     (pow (* (/ (pow t 1.5) l) (sqrt (sin k_m))) 2.0)))
   (*
    2.0
    (*
     (pow l 2.0)
     (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.4e-6) {
		tmp = 2.0 / ((tan(k_m) * (2.0 + pow((k_m / t), 2.0))) * pow(((pow(t, 1.5) / l) * sqrt(sin(k_m))), 2.0));
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.4d-6) then
        tmp = 2.0d0 / ((tan(k_m) * (2.0d0 + ((k_m / t) ** 2.0d0))) * ((((t ** 1.5d0) / l) * sqrt(sin(k_m))) ** 2.0d0))
    else
        tmp = 2.0d0 * ((l ** 2.0d0) * (cos(k_m) / ((t * (k_m ** 2.0d0)) * (sin(k_m) ** 2.0d0))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.4e-6) {
		tmp = 2.0 / ((Math.tan(k_m) * (2.0 + Math.pow((k_m / t), 2.0))) * Math.pow(((Math.pow(t, 1.5) / l) * Math.sqrt(Math.sin(k_m))), 2.0));
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.4e-6:
		tmp = 2.0 / ((math.tan(k_m) * (2.0 + math.pow((k_m / t), 2.0))) * math.pow(((math.pow(t, 1.5) / l) * math.sqrt(math.sin(k_m))), 2.0))
	else:
		tmp = 2.0 * (math.pow(l, 2.0) * (math.cos(k_m) / ((t * math.pow(k_m, 2.0)) * math.pow(math.sin(k_m), 2.0))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.4e-6)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(2.0 + (Float64(k_m / t) ^ 2.0))) * (Float64(Float64((t ^ 1.5) / l) * sqrt(sin(k_m))) ^ 2.0)));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.4e-6)
		tmp = 2.0 / ((tan(k_m) * (2.0 + ((k_m / t) ^ 2.0))) * ((((t ^ 1.5) / l) * sqrt(sin(k_m))) ^ 2.0));
	else
		tmp = 2.0 * ((l ^ 2.0) * (cos(k_m) / ((t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.4e-6], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(2.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[Sin[k$95$m], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot {\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k\_m}\right)}^{2}}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e-6 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

Alternative 8: 66.3% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{elif}\;k\_m \leq 1.9 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k\_m}^{2}}\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot {\sin k\_m}^{2}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2e-147)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (if (<= k_m 1.9e-5)
     (/
      2.0
      (pow (* t (* (pow (cbrt l) -2.0) (cbrt (* 2.0 (pow k_m 2.0))))) 3.0))
     (*
      2.0
      (*
       (pow l 2.0)
       (/ (cos k_m) (* (* t (pow k_m 2.0)) (pow (sin k_m) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else if (k_m <= 1.9e-5) {
		tmp = 2.0 / pow((t * (pow(cbrt(l), -2.0) * cbrt((2.0 * pow(k_m, 2.0))))), 3.0);
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * pow(sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else if (k_m <= 1.9e-5) {
		tmp = 2.0 / Math.pow((t * (Math.pow(Math.cbrt(l), -2.0) * Math.cbrt((2.0 * Math.pow(k_m, 2.0))))), 3.0);
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * Math.pow(Math.sin(k_m), 2.0))));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2e-147)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	elseif (k_m <= 1.9e-5)
		tmp = Float64(2.0 / (Float64(t * Float64((cbrt(l) ^ -2.0) * cbrt(Float64(2.0 * (k_m ^ 2.0))))) ^ 3.0));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * (sin(k_m) ^ 2.0)))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2e-147], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.9e-5], N[(2.0 / N[Power[N[(t * N[(N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

\mathbf{elif}\;k\_m \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k\_m}^{2}}\right)\right)}^{3}}\\

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-147 < k < 1.9000000000000001e-5

    1. Initial program 64.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. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-5 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k \cdot 2\right)}\\ \mathbf{elif}\;k \leq 1.9 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k}^{2}}\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{\left(t \cdot {k}^{2}\right) \cdot {\sin k}^{2}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 66.2% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{elif}\;k\_m \leq 5.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k\_m}^{2}}\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot \cos k\_m}{{k\_m}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}\right)\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2e-147)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (if (<= k_m 5.8e-5)
     (/
      2.0
      (pow (* t (* (pow (cbrt l) -2.0) (cbrt (* 2.0 (pow k_m 2.0))))) 3.0))
     (*
      2.0
      (/
       (* (pow l 2.0) (cos k_m))
       (* (pow k_m 2.0) (* t (- 0.5 (/ (cos (* k_m 2.0)) 2.0)))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else if (k_m <= 5.8e-5) {
		tmp = 2.0 / pow((t * (pow(cbrt(l), -2.0) * cbrt((2.0 * pow(k_m, 2.0))))), 3.0);
	} else {
		tmp = 2.0 * ((pow(l, 2.0) * cos(k_m)) / (pow(k_m, 2.0) * (t * (0.5 - (cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2e-147) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else if (k_m <= 5.8e-5) {
		tmp = 2.0 / Math.pow((t * (Math.pow(Math.cbrt(l), -2.0) * Math.cbrt((2.0 * Math.pow(k_m, 2.0))))), 3.0);
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) * Math.cos(k_m)) / (Math.pow(k_m, 2.0) * (t * (0.5 - (Math.cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2e-147)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	elseif (k_m <= 5.8e-5)
		tmp = Float64(2.0 / (Float64(t * Float64((cbrt(l) ^ -2.0) * cbrt(Float64(2.0 * (k_m ^ 2.0))))) ^ 3.0));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) * cos(k_m)) / Float64((k_m ^ 2.0) * Float64(t * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0))))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2e-147], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5.8e-5], N[(2.0 / N[Power[N[(t * N[(N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

\mathbf{elif}\;k\_m \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k\_m}^{2}}\right)\right)}^{3}}\\

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


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

    1. Initial program 59.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. Simplified59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-147 < k < 5.8e-5

    1. Initial program 64.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. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8e-5 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. div-sub80.9%

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

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

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

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

        \[\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)} \]
      6. *-commutative80.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k \cdot 2\right)}\\ \mathbf{elif}\;k \leq 5.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{{\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{2 \cdot {k}^{2}}\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 72.1% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 360000:\\ \;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot \left(\sin k\_m \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot \cos k\_m}{{k\_m}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}\right)\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 360000.0)
   (/
    2.0
    (*
     (* (tan k_m) (+ 2.0 (pow (/ k_m t) 2.0)))
     (* (sin k_m) (* (/ (pow t 2.0) l) (/ t l)))))
   (*
    2.0
    (/
     (* (pow l 2.0) (cos k_m))
     (* (pow k_m 2.0) (* t (- 0.5 (/ (cos (* k_m 2.0)) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 360000.0) {
		tmp = 2.0 / ((tan(k_m) * (2.0 + pow((k_m / t), 2.0))) * (sin(k_m) * ((pow(t, 2.0) / l) * (t / l))));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) * cos(k_m)) / (pow(k_m, 2.0) * (t * (0.5 - (cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 360000.0d0) then
        tmp = 2.0d0 / ((tan(k_m) * (2.0d0 + ((k_m / t) ** 2.0d0))) * (sin(k_m) * (((t ** 2.0d0) / l) * (t / l))))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) * cos(k_m)) / ((k_m ** 2.0d0) * (t * (0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 360000.0) {
		tmp = 2.0 / ((Math.tan(k_m) * (2.0 + Math.pow((k_m / t), 2.0))) * (Math.sin(k_m) * ((Math.pow(t, 2.0) / l) * (t / l))));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) * Math.cos(k_m)) / (Math.pow(k_m, 2.0) * (t * (0.5 - (Math.cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 360000.0:
		tmp = 2.0 / ((math.tan(k_m) * (2.0 + math.pow((k_m / t), 2.0))) * (math.sin(k_m) * ((math.pow(t, 2.0) / l) * (t / l))))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) * math.cos(k_m)) / (math.pow(k_m, 2.0) * (t * (0.5 - (math.cos((k_m * 2.0)) / 2.0)))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 360000.0)
		tmp = Float64(2.0 / Float64(Float64(tan(k_m) * Float64(2.0 + (Float64(k_m / t) ^ 2.0))) * Float64(sin(k_m) * Float64(Float64((t ^ 2.0) / l) * Float64(t / l)))));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) * cos(k_m)) / Float64((k_m ^ 2.0) * Float64(t * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 360000.0)
		tmp = 2.0 / ((tan(k_m) * (2.0 + ((k_m / t) ^ 2.0))) * (sin(k_m) * (((t ^ 2.0) / l) * (t / l))));
	else
		tmp = 2.0 * (((l ^ 2.0) * cos(k_m)) / ((k_m ^ 2.0) * (t * (0.5 - (cos((k_m * 2.0)) / 2.0)))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 360000.0], N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(2.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[(N[Power[t, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 360000:\\
\;\;\;\;\frac{2}{\left(\tan k\_m \cdot \left(2 + {\left(\frac{k\_m}{t}\right)}^{2}\right)\right) \cdot \left(\sin k\_m \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)}\\

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


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

    1. Initial program 59.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. Simplified59.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    8. Step-by-step derivation
      1. unpow359.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(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)} \]
      2. times-frac72.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(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)} \]
      3. pow272.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(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)} \]
    9. Applied egg-rr72.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(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)} \]

    if 3.6e5 < k

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

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

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

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. div-sub82.1%

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

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

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

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

        \[\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)} \]
      6. *-commutative82.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 360000:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right) \cdot \left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k \cdot 2\right)}{2}\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 54.3% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k\_m}^{2}} \cdot \frac{\cos k\_m}{t \cdot \left(0.5 - 0.5 \cdot \cos \left(k\_m \cdot 2\right)\right)}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.6e-7)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (*
    2.0
    (*
     (/ (pow l 2.0) (pow k_m 2.0))
     (/ (cos k_m) (* t (- 0.5 (* 0.5 (cos (* k_m 2.0))))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.6e-7) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) / pow(k_m, 2.0)) * (cos(k_m) / (t * (0.5 - (0.5 * cos((k_m * 2.0)))))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.6d-7) then
        tmp = 2.0d0 / ((sin(k_m) * (((t ** 1.5d0) / l) ** 2.0d0)) * (k_m * 2.0d0))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) / (k_m ** 2.0d0)) * (cos(k_m) / (t * (0.5d0 - (0.5d0 * cos((k_m * 2.0d0)))))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.6e-7) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k_m, 2.0)) * (Math.cos(k_m) / (t * (0.5 - (0.5 * Math.cos((k_m * 2.0)))))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.6e-7:
		tmp = 2.0 / ((math.sin(k_m) * math.pow((math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k_m, 2.0)) * (math.cos(k_m) / (t * (0.5 - (0.5 * math.cos((k_m * 2.0)))))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.6e-7)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k_m ^ 2.0)) * Float64(cos(k_m) / Float64(t * Float64(0.5 - Float64(0.5 * cos(Float64(k_m * 2.0))))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.6e-7)
		tmp = 2.0 / ((sin(k_m) * (((t ^ 1.5) / l) ^ 2.0)) * (k_m * 2.0));
	else
		tmp = 2.0 * (((l ^ 2.0) / (k_m ^ 2.0)) * (cos(k_m) / (t * (0.5 - (0.5 * cos((k_m * 2.0)))))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.6e-7], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(t * N[(0.5 - N[(0.5 * N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.59999999999999999e-7 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. div-sub80.9%

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

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

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

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

        \[\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)} \]
      6. *-commutative80.9%

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

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

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

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

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

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

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

Alternative 12: 55.6% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{\left(t \cdot {k\_m}^{2}\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k\_m \cdot 2\right)\right)}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 1.8e-5)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (*
    2.0
    (*
     (pow l 2.0)
     (/
      (cos k_m)
      (* (* t (pow k_m 2.0)) (- 0.5 (* 0.5 (cos (* k_m 2.0))))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1.8e-5) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / ((t * pow(k_m, 2.0)) * (0.5 - (0.5 * cos((k_m * 2.0)))))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 1.8d-5) then
        tmp = 2.0d0 / ((sin(k_m) * (((t ** 1.5d0) / l) ** 2.0d0)) * (k_m * 2.0d0))
    else
        tmp = 2.0d0 * ((l ** 2.0d0) * (cos(k_m) / ((t * (k_m ** 2.0d0)) * (0.5d0 - (0.5d0 * cos((k_m * 2.0d0)))))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1.8e-5) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / ((t * Math.pow(k_m, 2.0)) * (0.5 - (0.5 * Math.cos((k_m * 2.0)))))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 1.8e-5:
		tmp = 2.0 / ((math.sin(k_m) * math.pow((math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0))
	else:
		tmp = 2.0 * (math.pow(l, 2.0) * (math.cos(k_m) / ((t * math.pow(k_m, 2.0)) * (0.5 - (0.5 * math.cos((k_m * 2.0)))))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 1.8e-5)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(Float64(t * (k_m ^ 2.0)) * Float64(0.5 - Float64(0.5 * cos(Float64(k_m * 2.0))))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 1.8e-5)
		tmp = 2.0 / ((sin(k_m) * (((t ^ 1.5) / l) ^ 2.0)) * (k_m * 2.0));
	else
		tmp = 2.0 * ((l ^ 2.0) * (cos(k_m) / ((t * (k_m ^ 2.0)) * (0.5 - (0.5 * cos((k_m * 2.0)))))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.8e-5], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(t * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.80000000000000005e-5 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. div-sub80.9%

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

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

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

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

        \[\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)} \]
      6. *-commutative80.9%

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

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

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

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

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

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

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

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

Alternative 13: 55.6% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 9 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2} \cdot \cos k\_m}{{k\_m}^{2} \cdot \left(t \cdot \left(0.5 - \frac{\cos \left(k\_m \cdot 2\right)}{2}\right)\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 9e-6)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (*
    2.0
    (/
     (* (pow l 2.0) (cos k_m))
     (* (pow k_m 2.0) (* t (- 0.5 (/ (cos (* k_m 2.0)) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 9e-6) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) * cos(k_m)) / (pow(k_m, 2.0) * (t * (0.5 - (cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 9d-6) then
        tmp = 2.0d0 / ((sin(k_m) * (((t ** 1.5d0) / l) ** 2.0d0)) * (k_m * 2.0d0))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) * cos(k_m)) / ((k_m ** 2.0d0) * (t * (0.5d0 - (cos((k_m * 2.0d0)) / 2.0d0)))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 9e-6) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) * Math.cos(k_m)) / (Math.pow(k_m, 2.0) * (t * (0.5 - (Math.cos((k_m * 2.0)) / 2.0)))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 9e-6:
		tmp = 2.0 / ((math.sin(k_m) * math.pow((math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) * math.cos(k_m)) / (math.pow(k_m, 2.0) * (t * (0.5 - (math.cos((k_m * 2.0)) / 2.0)))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 9e-6)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) * cos(k_m)) / Float64((k_m ^ 2.0) * Float64(t * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) / 2.0))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 9e-6)
		tmp = 2.0 / ((sin(k_m) * (((t ^ 1.5) / l) ^ 2.0)) * (k_m * 2.0));
	else
		tmp = 2.0 * (((l ^ 2.0) * cos(k_m)) / ((k_m ^ 2.0) * (t * (0.5 - (cos((k_m * 2.0)) / 2.0)))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 9e-6], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 9 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.00000000000000023e-6 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

      \[\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)} \]
    7. Step-by-step derivation
      1. div-sub80.9%

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

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

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

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

        \[\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)} \]
      6. *-commutative80.9%

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

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

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

Alternative 14: 49.9% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.5 \cdot 10^{-9}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k\_m}^{2}} \cdot \frac{\frac{\cos k\_m}{{k\_m}^{2}}}{t}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.5e-9)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (*
    2.0
    (* (/ (pow l 2.0) (pow k_m 2.0)) (/ (/ (cos k_m) (pow k_m 2.0)) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.5e-9) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) / pow(k_m, 2.0)) * ((cos(k_m) / pow(k_m, 2.0)) / t));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.5d-9) then
        tmp = 2.0d0 / ((sin(k_m) * (((t ** 1.5d0) / l) ** 2.0d0)) * (k_m * 2.0d0))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) / (k_m ** 2.0d0)) * ((cos(k_m) / (k_m ** 2.0d0)) / t))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.5e-9) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k_m, 2.0)) * ((Math.cos(k_m) / Math.pow(k_m, 2.0)) / t));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.5e-9:
		tmp = 2.0 / ((math.sin(k_m) * math.pow((math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k_m, 2.0)) * ((math.cos(k_m) / math.pow(k_m, 2.0)) / t))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.5e-9)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k_m ^ 2.0)) * Float64(Float64(cos(k_m) / (k_m ^ 2.0)) / t)));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.5e-9)
		tmp = 2.0 / ((sin(k_m) * (((t ^ 1.5) / l) ^ 2.0)) * (k_m * 2.0));
	else
		tmp = 2.0 * (((l ^ 2.0) / (k_m ^ 2.0)) * ((cos(k_m) / (k_m ^ 2.0)) / t));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.5e-9], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-9 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 62.2% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-160}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot 2\right) \cdot \left(\sin k\_m \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \mathbf{elif}\;k\_m \leq 1.6 \cdot 10^{-9}:\\ \;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{t \cdot {k\_m}^{4}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.7e-160)
   (/ 2.0 (* (* k_m 2.0) (* (sin k_m) (/ (pow t 3.0) (* l l)))))
   (if (<= k_m 1.6e-9)
     (/ 2.0 (/ (* (* 2.0 (pow k_m 2.0)) (/ (pow t 3.0) l)) l))
     (* 2.0 (* (pow l 2.0) (/ (cos k_m) (* t (pow k_m 4.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.7e-160) {
		tmp = 2.0 / ((k_m * 2.0) * (sin(k_m) * (pow(t, 3.0) / (l * l))));
	} else if (k_m <= 1.6e-9) {
		tmp = 2.0 / (((2.0 * pow(k_m, 2.0)) * (pow(t, 3.0) / l)) / l);
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / (t * pow(k_m, 4.0))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.7d-160) then
        tmp = 2.0d0 / ((k_m * 2.0d0) * (sin(k_m) * ((t ** 3.0d0) / (l * l))))
    else if (k_m <= 1.6d-9) then
        tmp = 2.0d0 / (((2.0d0 * (k_m ** 2.0d0)) * ((t ** 3.0d0) / l)) / l)
    else
        tmp = 2.0d0 * ((l ** 2.0d0) * (cos(k_m) / (t * (k_m ** 4.0d0))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.7e-160) {
		tmp = 2.0 / ((k_m * 2.0) * (Math.sin(k_m) * (Math.pow(t, 3.0) / (l * l))));
	} else if (k_m <= 1.6e-9) {
		tmp = 2.0 / (((2.0 * Math.pow(k_m, 2.0)) * (Math.pow(t, 3.0) / l)) / l);
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / (t * Math.pow(k_m, 4.0))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.7e-160:
		tmp = 2.0 / ((k_m * 2.0) * (math.sin(k_m) * (math.pow(t, 3.0) / (l * l))))
	elif k_m <= 1.6e-9:
		tmp = 2.0 / (((2.0 * math.pow(k_m, 2.0)) * (math.pow(t, 3.0) / l)) / l)
	else:
		tmp = 2.0 * (math.pow(l, 2.0) * (math.cos(k_m) / (t * math.pow(k_m, 4.0))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.7e-160)
		tmp = Float64(2.0 / Float64(Float64(k_m * 2.0) * Float64(sin(k_m) * Float64((t ^ 3.0) / Float64(l * l)))));
	elseif (k_m <= 1.6e-9)
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k_m ^ 2.0)) * Float64((t ^ 3.0) / l)) / l));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(t * (k_m ^ 4.0)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.7e-160)
		tmp = 2.0 / ((k_m * 2.0) * (sin(k_m) * ((t ^ 3.0) / (l * l))));
	elseif (k_m <= 1.6e-9)
		tmp = 2.0 / (((2.0 * (k_m ^ 2.0)) * ((t ^ 3.0) / l)) / l);
	else
		tmp = 2.0 * ((l ^ 2.0) * (cos(k_m) / (t * (k_m ^ 4.0))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.7e-160], N[(2.0 / N[(N[(k$95$m * 2.0), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.6e-9], N[(2.0 / N[(N[(N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(t * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2.7 \cdot 10^{-160}:\\
\;\;\;\;\frac{2}{\left(k\_m \cdot 2\right) \cdot \left(\sin k\_m \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\

\mathbf{elif}\;k\_m \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\

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


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

    1. Initial program 59.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. Simplified59.3%

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

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

    if 2.7000000000000001e-160 < k < 1.60000000000000006e-9

    1. Initial program 66.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. Simplified66.5%

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

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

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

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

    if 1.60000000000000006e-9 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2.7 \cdot 10^{-160}:\\ \;\;\;\;\frac{2}{\left(k \cdot 2\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \mathbf{elif}\;k \leq 1.6 \cdot 10^{-9}:\\ \;\;\;\;\frac{2}{\frac{\left(2 \cdot {k}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{t \cdot {k}^{4}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 48.8% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-8}:\\ \;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{t \cdot {k\_m}^{4}}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 8.5e-8)
   (/ 2.0 (* (* (sin k_m) (pow (/ (pow t 1.5) l) 2.0)) (* k_m 2.0)))
   (* 2.0 (* (pow l 2.0) (/ (cos k_m) (* t (pow k_m 4.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 8.5e-8) {
		tmp = 2.0 / ((sin(k_m) * pow((pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * (pow(l, 2.0) * (cos(k_m) / (t * pow(k_m, 4.0))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 8.5d-8) then
        tmp = 2.0d0 / ((sin(k_m) * (((t ** 1.5d0) / l) ** 2.0d0)) * (k_m * 2.0d0))
    else
        tmp = 2.0d0 * ((l ** 2.0d0) * (cos(k_m) / (t * (k_m ** 4.0d0))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 8.5e-8) {
		tmp = 2.0 / ((Math.sin(k_m) * Math.pow((Math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0));
	} else {
		tmp = 2.0 * (Math.pow(l, 2.0) * (Math.cos(k_m) / (t * Math.pow(k_m, 4.0))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 8.5e-8:
		tmp = 2.0 / ((math.sin(k_m) * math.pow((math.pow(t, 1.5) / l), 2.0)) * (k_m * 2.0))
	else:
		tmp = 2.0 * (math.pow(l, 2.0) * (math.cos(k_m) / (t * math.pow(k_m, 4.0))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 8.5e-8)
		tmp = Float64(2.0 / Float64(Float64(sin(k_m) * (Float64((t ^ 1.5) / l) ^ 2.0)) * Float64(k_m * 2.0)));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(t * (k_m ^ 4.0)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 8.5e-8)
		tmp = 2.0 / ((sin(k_m) * (((t ^ 1.5) / l) ^ 2.0)) * (k_m * 2.0));
	else
		tmp = 2.0 * ((l ^ 2.0) * (cos(k_m) / (t * (k_m ^ 4.0))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 8.5e-8], N[(2.0 / N[(N[(N[Sin[k$95$m], $MachinePrecision] * N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(k$95$m * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(t * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-8}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k\_m \cdot 2\right)}\\

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


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

    1. Initial program 60.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. Simplified60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.49999999999999935e-8 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8.5 \cdot 10^{-8}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot {\left(\frac{{t}^{1.5}}{\ell}\right)}^{2}\right) \cdot \left(k \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k}{t \cdot {k}^{4}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 56.4% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 5.2 \cdot 10^{-35}:\\ \;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k\_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(k\_m \cdot 2\right) \cdot \left(\sin k\_m \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 5.2e-35)
   (* 2.0 (/ (/ (pow l 2.0) t) (pow k_m 4.0)))
   (/ 2.0 (* (* k_m 2.0) (* (sin k_m) (/ (pow t 3.0) (* l l)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 5.2e-35) {
		tmp = 2.0 * ((pow(l, 2.0) / t) / pow(k_m, 4.0));
	} else {
		tmp = 2.0 / ((k_m * 2.0) * (sin(k_m) * (pow(t, 3.0) / (l * l))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t <= 5.2d-35) then
        tmp = 2.0d0 * (((l ** 2.0d0) / t) / (k_m ** 4.0d0))
    else
        tmp = 2.0d0 / ((k_m * 2.0d0) * (sin(k_m) * ((t ** 3.0d0) / (l * l))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 5.2e-35) {
		tmp = 2.0 * ((Math.pow(l, 2.0) / t) / Math.pow(k_m, 4.0));
	} else {
		tmp = 2.0 / ((k_m * 2.0) * (Math.sin(k_m) * (Math.pow(t, 3.0) / (l * l))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if t <= 5.2e-35:
		tmp = 2.0 * ((math.pow(l, 2.0) / t) / math.pow(k_m, 4.0))
	else:
		tmp = 2.0 / ((k_m * 2.0) * (math.sin(k_m) * (math.pow(t, 3.0) / (l * l))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 5.2e-35)
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t) / (k_m ^ 4.0)));
	else
		tmp = Float64(2.0 / Float64(Float64(k_m * 2.0) * Float64(sin(k_m) * Float64((t ^ 3.0) / Float64(l * l)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (t <= 5.2e-35)
		tmp = 2.0 * (((l ^ 2.0) / t) / (k_m ^ 4.0));
	else
		tmp = 2.0 / ((k_m * 2.0) * (sin(k_m) * ((t ^ 3.0) / (l * l))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 5.2e-35], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k$95$m * 2.0), $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.2 \cdot 10^{-35}:\\
\;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k\_m}^{4}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.20000000000000009e-35

    1. Initial program 56.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. Simplified50.0%

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

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

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

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

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

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

    if 5.20000000000000009e-35 < t

    1. Initial program 65.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. Simplified65.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.2 \cdot 10^{-35}:\\ \;\;\;\;2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(k \cdot 2\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 58.4% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k\_m}^{-4}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.2e-5)
   (/ 2.0 (* (* 2.0 (pow k_m 2.0)) (/ (/ (pow t 3.0) l) l)))
   (* 2.0 (* (/ (pow l 2.0) t) (pow k_m -4.0)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.2e-5) {
		tmp = 2.0 / ((2.0 * pow(k_m, 2.0)) * ((pow(t, 3.0) / l) / l));
	} else {
		tmp = 2.0 * ((pow(l, 2.0) / t) * pow(k_m, -4.0));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.2d-5) then
        tmp = 2.0d0 / ((2.0d0 * (k_m ** 2.0d0)) * (((t ** 3.0d0) / l) / l))
    else
        tmp = 2.0d0 * (((l ** 2.0d0) / t) * (k_m ** (-4.0d0)))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.2e-5) {
		tmp = 2.0 / ((2.0 * Math.pow(k_m, 2.0)) * ((Math.pow(t, 3.0) / l) / l));
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) / t) * Math.pow(k_m, -4.0));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.2e-5:
		tmp = 2.0 / ((2.0 * math.pow(k_m, 2.0)) * ((math.pow(t, 3.0) / l) / l))
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) / t) * math.pow(k_m, -4.0))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.2e-5)
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k_m ^ 2.0)) * Float64(Float64((t ^ 3.0) / l) / l)));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t) * (k_m ^ -4.0)));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.2e-5)
		tmp = 2.0 / ((2.0 * (k_m ^ 2.0)) * (((t ^ 3.0) / l) / l));
	else
		tmp = 2.0 * (((l ^ 2.0) / t) * (k_m ^ -4.0));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.2e-5], N[(2.0 / N[(N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 2.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}}\\

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


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

    1. Initial program 60.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. Simplified58.5%

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

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

    if 2.1999999999999999e-5 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(1 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k}^{-4}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity56.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k}^{-4}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 58.8% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k\_m}^{-4}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 8.5e-7)
   (/ 2.0 (/ (* (* 2.0 (pow k_m 2.0)) (/ (pow t 3.0) l)) l))
   (* 2.0 (* (/ (pow l 2.0) t) (pow k_m -4.0)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 8.5e-7) {
		tmp = 2.0 / (((2.0 * pow(k_m, 2.0)) * (pow(t, 3.0) / l)) / l);
	} else {
		tmp = 2.0 * ((pow(l, 2.0) / t) * pow(k_m, -4.0));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 8.5d-7) then
        tmp = 2.0d0 / (((2.0d0 * (k_m ** 2.0d0)) * ((t ** 3.0d0) / l)) / l)
    else
        tmp = 2.0d0 * (((l ** 2.0d0) / t) * (k_m ** (-4.0d0)))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 8.5e-7) {
		tmp = 2.0 / (((2.0 * Math.pow(k_m, 2.0)) * (Math.pow(t, 3.0) / l)) / l);
	} else {
		tmp = 2.0 * ((Math.pow(l, 2.0) / t) * Math.pow(k_m, -4.0));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 8.5e-7:
		tmp = 2.0 / (((2.0 * math.pow(k_m, 2.0)) * (math.pow(t, 3.0) / l)) / l)
	else:
		tmp = 2.0 * ((math.pow(l, 2.0) / t) * math.pow(k_m, -4.0))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 8.5e-7)
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k_m ^ 2.0)) * Float64((t ^ 3.0) / l)) / l));
	else
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / t) * (k_m ^ -4.0)));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 8.5e-7)
		tmp = 2.0 / (((2.0 * (k_m ^ 2.0)) * ((t ^ 3.0) / l)) / l);
	else
		tmp = 2.0 * (((l ^ 2.0) / t) * (k_m ^ -4.0));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 8.5e-7], N[(2.0 / N[(N[(N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\

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


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

    1. Initial program 60.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. Simplified58.5%

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

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

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

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

    if 8.50000000000000014e-7 < k

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(1 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k}^{-4}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity56.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{2}{\frac{\left(2 \cdot {k}^{2}\right) \cdot \frac{{t}^{3}}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k}^{-4}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 52.0% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ 2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k\_m}^{-4}\right) \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (* 2.0 (* (/ (pow l 2.0) t) (pow k_m -4.0))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	return 2.0 * ((pow(l, 2.0) / t) * pow(k_m, -4.0));
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = 2.0d0 * (((l ** 2.0d0) / t) * (k_m ** (-4.0d0)))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	return 2.0 * ((Math.pow(l, 2.0) / t) * Math.pow(k_m, -4.0));
}
k_m = math.fabs(k)
def code(t, l, k_m):
	return 2.0 * ((math.pow(l, 2.0) / t) * math.pow(k_m, -4.0))
k_m = abs(k)
function code(t, l, k_m)
	return Float64(2.0 * Float64(Float64((l ^ 2.0) / t) * (k_m ^ -4.0)))
end
k_m = abs(k);
function tmp = code(t, l, k_m)
	tmp = 2.0 * (((l ^ 2.0) / t) * (k_m ^ -4.0));
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision] * N[Power[k$95$m, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|

\\
2 \cdot \left(\frac{{\ell}^{2}}{t} \cdot {k\_m}^{-4}\right)
\end{array}
Derivation
  1. Initial program 58.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. Simplified52.4%

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

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

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

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

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

    \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
  8. Step-by-step derivation
    1. *-un-lft-identity52.9%

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

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

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

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

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

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

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

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

Alternative 21: 52.1% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ 2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k\_m}^{4}} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (* 2.0 (/ (/ (pow l 2.0) t) (pow k_m 4.0))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	return 2.0 * ((pow(l, 2.0) / t) / pow(k_m, 4.0));
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = 2.0d0 * (((l ** 2.0d0) / t) / (k_m ** 4.0d0))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	return 2.0 * ((Math.pow(l, 2.0) / t) / Math.pow(k_m, 4.0));
}
k_m = math.fabs(k)
def code(t, l, k_m):
	return 2.0 * ((math.pow(l, 2.0) / t) / math.pow(k_m, 4.0))
k_m = abs(k)
function code(t, l, k_m)
	return Float64(2.0 * Float64(Float64((l ^ 2.0) / t) / (k_m ^ 4.0)))
end
k_m = abs(k);
function tmp = code(t, l, k_m)
	tmp = 2.0 * (((l ^ 2.0) / t) / (k_m ^ 4.0));
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / t), $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|

\\
2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k\_m}^{4}}
\end{array}
Derivation
  1. Initial program 58.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. Simplified52.4%

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

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

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

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

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

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

    \[\leadsto 2 \cdot \frac{\frac{{\ell}^{2}}{t}}{{k}^{4}} \]
  9. Add Preprocessing

Reproduce

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