Toniolo and Linder, Equation (10+)

Percentage Accurate: 55.0% → 85.9%
Time: 16.8s
Alternatives: 14
Speedup: 24.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 85.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;k\_m \leq 7.5 \cdot 10^{+99}:\\
\;\;\;\;\frac{2}{t \cdot \mathsf{fma}\left({k\_m}^{2}, \frac{t\_2}{{\ell}^{2} \cdot \cos k\_m}, \frac{2}{\cos k\_m} \cdot \left(t\_2 \cdot {\left(\frac{t}{\ell}\right)}^{2}\right)\right)}\\

\mathbf{elif}\;k\_m \leq 2.1 \cdot 10^{+203}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{2 \cdot {\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right)}\right)}^{2}}}{t \cdot \sqrt[3]{\sin k\_m \cdot \tan k\_m}}\right)}^{3}\\

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


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

    1. Initial program 63.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. Simplified63.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{{\left(\frac{t}{\sqrt[3]{\color{blue}{\ell \cdot \ell}}} \cdot \sqrt[3]{2 \cdot {k}^{2}}\right)}^{3}} \]
      10. cbrt-prod73.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}} \]
      11. pow273.1%

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

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

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

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

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

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

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

    if 3.2999999999999999e-66 < k < 7.49999999999999963e99

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

      \[\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. Step-by-step derivation
      1. associate-/r*40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999963e99 < k < 2.09999999999999984e203

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

      \[\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. Step-by-step derivation
      1. associate-*r*52.7%

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

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

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

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

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

        \[\leadsto \left(\frac{2}{\color{blue}{\left(\sin k \cdot {t}^{3}\right)} \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \]
    7. Simplified65.6%

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

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

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

        \[\leadsto {\left(\frac{2}{\left(\sin k \cdot {t}^{3}\right) \cdot \tan k} \cdot \color{blue}{{\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2}}\right)}^{1} \]
    9. Applied egg-rr65.6%

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

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

        \[\leadsto \frac{2}{\color{blue}{\left({t}^{3} \cdot \sin k\right)} \cdot \tan k} \cdot {\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2} \]
    11. Simplified65.6%

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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999984e203 < k

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\left(\sqrt[3]{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}}} \]
      2. pow328.6%

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

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

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

Alternative 2: 82.4% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;k\_m \leq 1.15 \cdot 10^{+205}:\\
\;\;\;\;{\left(\frac{\sqrt[3]{2 \cdot {\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t}\right)\right)}\right)}^{2}}}{t \cdot \sqrt[3]{\sin k\_m \cdot \tan k\_m}}\right)}^{3}\\

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3499999999999998e-10 < k < 7.49999999999999963e99

    1. Initial program 42.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. Simplified42.4%

      \[\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 t around 0 84.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. associate-*r/84.9%

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

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

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

    if 7.49999999999999963e99 < k < 1.15000000000000004e205

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

      \[\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. Step-by-step derivation
      1. associate-*r*52.7%

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

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

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

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

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

        \[\leadsto \left(\frac{2}{\color{blue}{\left(\sin k \cdot {t}^{3}\right)} \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \]
    7. Simplified65.6%

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

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

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

        \[\leadsto {\left(\frac{2}{\left(\sin k \cdot {t}^{3}\right) \cdot \tan k} \cdot \color{blue}{{\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2}}\right)}^{1} \]
    9. Applied egg-rr65.6%

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

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

        \[\leadsto \frac{2}{\color{blue}{\left({t}^{3} \cdot \sin k\right)} \cdot \tan k} \cdot {\left(\frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2} \]
    11. Simplified65.6%

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000004e205 < k

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\left(\sqrt[3]{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}}} \]
      2. pow328.6%

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

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

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

Alternative 3: 81.7% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.8000000000000003e-10 < k < 1.12e80

    1. Initial program 43.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. Simplified43.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. Taylor expanded in t around 0 87.3%

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

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

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

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

    if 1.12e80 < k

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\left(\sqrt[3]{\frac{\frac{{t}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\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}^{1.5}}{1} \cdot \frac{{t}^{1.5}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}}} \]
      2. pow335.9%

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

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

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

Alternative 4: 80.2% accurate, 0.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 7.9 \cdot 10^{-10}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \left(\sqrt[3]{k\_m} \cdot \left(\sqrt[3]{k\_m} \cdot \sqrt[3]{2}\right)\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{t \cdot \left({k\_m}^{2} \cdot {\sin k\_m}^{2}\right)}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 7.9e-10)
   (/
    2.0
    (pow
     (* (/ t (pow (cbrt l) 2.0)) (* (cbrt k_m) (* (cbrt k_m) (cbrt 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 <= 7.9e-10) {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * (cbrt(k_m) * (cbrt(k_m) * cbrt(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 <= 7.9e-10) {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * (Math.cbrt(k_m) * (Math.cbrt(k_m) * Math.cbrt(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 <= 7.9e-10)
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * Float64(cbrt(k_m) * Float64(cbrt(k_m) * cbrt(2.0)))) ^ 3.0));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(t * Float64((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, 7.9e-10], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k$95$m, 1/3], $MachinePrecision] * N[(N[Power[k$95$m, 1/3], $MachinePrecision] * N[Power[2.0, 1/3], $MachinePrecision]), $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[(t * N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[Power[N[Sin[k$95$m], $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 7.9 \cdot 10^{-10}:\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \left(\sqrt[3]{k\_m} \cdot \left(\sqrt[3]{k\_m} \cdot \sqrt[3]{2}\right)\right)\right)}^{3}}\\

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.8999999999999996e-10 < k

    1. Initial program 48.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. Simplified46.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. Step-by-step derivation
      1. associate-*r*50.3%

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

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

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

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

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

        \[\leadsto \left(\frac{2}{\color{blue}{\left(\sin k \cdot {t}^{3}\right)} \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \]
    7. Simplified55.3%

      \[\leadsto \color{blue}{\left(\frac{2}{\left(\sin k \cdot {t}^{3}\right) \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}} \]
    8. Taylor expanded in k around inf 75.8%

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

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

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

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

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

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

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

Alternative 5: 80.2% accurate, 0.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 8.8 \cdot 10^{-10}:\\ \;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \left(\sqrt[3]{k\_m} \cdot \sqrt[3]{k\_m \cdot 2}\right)\right)}^{3}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left({\ell}^{2} \cdot \frac{\cos k\_m}{t \cdot \left({k\_m}^{2} \cdot {\sin k\_m}^{2}\right)}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 8.8e-10)
   (/
    2.0
    (pow (* (/ t (pow (cbrt l) 2.0)) (* (cbrt k_m) (cbrt (* 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 <= 8.8e-10) {
		tmp = 2.0 / pow(((t / pow(cbrt(l), 2.0)) * (cbrt(k_m) * cbrt((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 <= 8.8e-10) {
		tmp = 2.0 / Math.pow(((t / Math.pow(Math.cbrt(l), 2.0)) * (Math.cbrt(k_m) * Math.cbrt((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 <= 8.8e-10)
		tmp = Float64(2.0 / (Float64(Float64(t / (cbrt(l) ^ 2.0)) * Float64(cbrt(k_m) * cbrt(Float64(k_m * 2.0)))) ^ 3.0));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) * Float64(cos(k_m) / Float64(t * Float64((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, 8.8e-10], N[(2.0 / N[Power[N[(N[(t / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k$95$m, 1/3], $MachinePrecision] * N[Power[N[(k$95$m * 2.0), $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[(t * N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[Power[N[Sin[k$95$m], $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 8.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{2}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \left(\sqrt[3]{k\_m} \cdot \sqrt[3]{k\_m \cdot 2}\right)\right)}^{3}}\\

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.7999999999999996e-10 < k

    1. Initial program 48.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. Simplified46.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. Step-by-step derivation
      1. associate-*r*50.3%

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

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

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

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

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

        \[\leadsto \left(\frac{2}{\color{blue}{\left(\sin k \cdot {t}^{3}\right)} \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)} \]
    7. Simplified55.3%

      \[\leadsto \color{blue}{\left(\frac{2}{\left(\sin k \cdot {t}^{3}\right) \cdot \tan k} \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right) \cdot \frac{\ell}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}} \]
    8. Taylor expanded in k around inf 75.8%

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

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

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

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

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

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

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

Alternative 6: 80.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7e-12 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

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

Alternative 7: 77.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0999999999999996e-10 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

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

Alternative 8: 72.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0500000000000001e-13 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 9: 70.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.89999999999999966e-13 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 10: 67.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000028e-11 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 11: 66.5% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 8.2 \cdot 10^{-11}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(\left(k\_m \cdot 2\right) \cdot {\left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)}^{3}\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 8.2e-11)
   (/ 2.0 (* k_m (* (* k_m 2.0) (pow (* t (pow (cbrt l) -2.0)) 3.0))))
   (* 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.2e-11) {
		tmp = 2.0 / (k_m * ((k_m * 2.0) * pow((t * pow(cbrt(l), -2.0)), 3.0)));
	} else {
		tmp = 2.0 * (pow(l, 2.0) / (t * pow(k_m, 4.0)));
	}
	return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 8.2e-11) {
		tmp = 2.0 / (k_m * ((k_m * 2.0) * Math.pow((t * Math.pow(Math.cbrt(l), -2.0)), 3.0)));
	} 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.2e-11)
		tmp = Float64(2.0 / Float64(k_m * Float64(Float64(k_m * 2.0) * (Float64(t * (cbrt(l) ^ -2.0)) ^ 3.0))));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) / Float64(t * (k_m ^ 4.0))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 8.2e-11], N[(2.0 / N[(k$95$m * N[(N[(k$95$m * 2.0), $MachinePrecision] * N[Power[N[(t * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 62.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. Simplified62.7%

      \[\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 64.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-cbrt64.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. pow364.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2000000000000001e-11 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 12: 44.5% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.14 \cdot 10^{-10}:\\ \;\;\;\;\frac{2}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 1.14e-10)
   (/ 2.0 (* (pow (/ (pow t 1.5) l) 2.0) (* 2.0 (* k_m k_m))))
   (* 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 <= 1.14e-10) {
		tmp = 2.0 / (pow((pow(t, 1.5) / l), 2.0) * (2.0 * (k_m * k_m)));
	} 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 <= 1.14d-10) then
        tmp = 2.0d0 / ((((t ** 1.5d0) / l) ** 2.0d0) * (2.0d0 * (k_m * k_m)))
    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 <= 1.14e-10) {
		tmp = 2.0 / (Math.pow((Math.pow(t, 1.5) / l), 2.0) * (2.0 * (k_m * k_m)));
	} 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 <= 1.14e-10:
		tmp = 2.0 / (math.pow((math.pow(t, 1.5) / l), 2.0) * (2.0 * (k_m * k_m)))
	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 <= 1.14e-10)
		tmp = Float64(2.0 / Float64((Float64((t ^ 1.5) / l) ^ 2.0) * Float64(2.0 * Float64(k_m * k_m))));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) / 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 <= 1.14e-10)
		tmp = 2.0 / ((((t ^ 1.5) / l) ^ 2.0) * (2.0 * (k_m * k_m)));
	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, 1.14e-10], N[(2.0 / N[(N[Power[N[(N[Power[t, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 62.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. Simplified62.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1399999999999999e-10 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 13: 59.9% accurate, 2.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 9.5 \cdot 10^{-10}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t \cdot {k\_m}^{4}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 9.5e-10)
   (/ 2.0 (* (* 2.0 (* k_m k_m)) (* (/ t l) (/ (* t t) 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 <= 9.5e-10) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / 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 <= 9.5d-10) then
        tmp = 2.0d0 / ((2.0d0 * (k_m * k_m)) * ((t / l) * ((t * t) / 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 <= 9.5e-10) {
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / 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 <= 9.5e-10:
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / 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 <= 9.5e-10)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t / l) * Float64(Float64(t * t) / l))));
	else
		tmp = Float64(2.0 * Float64((l ^ 2.0) / 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 <= 9.5e-10)
		tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / 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, 9.5e-10], N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 62.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. Simplified62.7%

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000028e-10 < k

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

      \[\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 t around 0 75.8%

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

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

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

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

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

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

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

Alternative 14: 57.9% accurate, 24.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \frac{2}{\left(2 \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (/ 2.0 (* (* 2.0 (* k_m k_m)) (* (/ t l) (/ (* t t) l)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	return 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / l)));
}
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 / ((2.0d0 * (k_m * k_m)) * ((t / l) * ((t * t) / l)))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	return 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / l)));
}
k_m = math.fabs(k)
def code(t, l, k_m):
	return 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / l)))
k_m = abs(k)
function code(t, l, k_m)
	return Float64(2.0 / Float64(Float64(2.0 * Float64(k_m * k_m)) * Float64(Float64(t / l) * Float64(Float64(t * t) / l))))
end
k_m = abs(k);
function tmp = code(t, l, k_m)
	tmp = 2.0 / ((2.0 * (k_m * k_m)) * ((t / l) * ((t * t) / l)));
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(2.0 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(t / l), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{2}{\left(\frac{\color{blue}{t \cdot t}}{\ell} \cdot \frac{t}{\ell}\right) \cdot \left(2 \cdot \left(k \cdot k\right)\right)} \]
  11. Final simplification63.0%

    \[\leadsto \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)} \]
  12. Add Preprocessing

Reproduce

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