Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.5% → 89.1%
Time: 18.5s
Alternatives: 22
Speedup: 3.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 35.5% 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: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{e^{\log 2 \cdot 0.5}}{k}\\ t_3 := \sqrt[3]{\sin k \cdot \tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \leq 5.8 \cdot 10^{+71}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_2 \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_3\right)\right)}^{-2}\right)\right) \cdot \left(t\_2 \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_3}\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (/ (exp (* (log 2.0) 0.5)) k)) (t_3 (cbrt (* (sin k) (tan k)))))
   (*
    t_s
    (if (<= l_m 5.5e-159)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= l_m 5.8e+71)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (* t_2 (* t_m (pow (* t_m (* (pow (cbrt l_m) -2.0) t_3)) -2.0)))
         (* t_2 (/ (pow (cbrt l_m) 2.0) t_3))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = exp((log(2.0) * 0.5)) / k;
	double t_3 = cbrt((sin(k) * tan(k)));
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if (l_m <= 5.8e+71) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = (t_2 * (t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * t_3)), -2.0))) * (t_2 * (pow(cbrt(l_m), 2.0) / t_3));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.exp((Math.log(2.0) * 0.5)) / k;
	double t_3 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if (l_m <= 5.8e+71) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = (t_2 * (t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * t_3)), -2.0))) * (t_2 * (Math.pow(Math.cbrt(l_m), 2.0) / t_3));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = Float64(exp(Float64(log(2.0) * 0.5)) / k)
	t_3 = cbrt(Float64(sin(k) * tan(k)))
	tmp = 0.0
	if (l_m <= 5.5e-159)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (l_m <= 5.8e+71)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(t_2 * Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * t_3)) ^ -2.0))) * Float64(t_2 * Float64((cbrt(l_m) ^ 2.0) / t_3)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 5.5e-159], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 5.8e+71], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{e^{\log 2 \cdot 0.5}}{k}\\
t_3 := \sqrt[3]{\sin k \cdot \tan k}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \leq 5.8 \cdot 10^{+71}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_2 \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_3\right)\right)}^{-2}\right)\right) \cdot \left(t\_2 \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_3}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 5.5000000000000003e-159

    1. Initial program 36.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. Simplified36.2%

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

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

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

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

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

    if 5.5000000000000003e-159 < l < 5.80000000000000014e71

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

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

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

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

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

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

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

    if 5.80000000000000014e71 < l

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{\color{blue}{e^{\log 2 \cdot 0.5}}}{k} \cdot \left(t \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k \cdot \tan k}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := {\sin k}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \leq 1.55 \cdot 10^{+72}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{t\_2}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \cdot \left(\frac{\sqrt{2}}{k} \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot \sqrt[3]{\frac{t\_2}{\cos k}}\right)\right)}^{-2}\right)\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (pow (sin k) 2.0)))
   (*
    t_s
    (if (<= l_m 5.5e-159)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= l_m 1.55e+72)
        (/ 2.0 (* (/ (* (pow k 2.0) t_m) (cos k)) (/ t_2 (pow l_m 2.0))))
        (*
         (*
          (/ (exp (* (log 2.0) 0.5)) k)
          (/ (pow (cbrt l_m) 2.0) (cbrt (* (sin k) (tan k)))))
         (*
          (/ (sqrt 2.0) k)
          (*
           t_m
           (pow
            (* t_m (* (pow (cbrt l_m) -2.0) (cbrt (/ t_2 (cos k)))))
            -2.0)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = pow(sin(k), 2.0);
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if (l_m <= 1.55e+72) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (t_2 / pow(l_m, 2.0)));
	} else {
		tmp = ((exp((log(2.0) * 0.5)) / k) * (pow(cbrt(l_m), 2.0) / cbrt((sin(k) * tan(k))))) * ((sqrt(2.0) / k) * (t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * cbrt((t_2 / cos(k))))), -2.0)));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.pow(Math.sin(k), 2.0);
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if (l_m <= 1.55e+72) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (t_2 / Math.pow(l_m, 2.0)));
	} else {
		tmp = ((Math.exp((Math.log(2.0) * 0.5)) / k) * (Math.pow(Math.cbrt(l_m), 2.0) / Math.cbrt((Math.sin(k) * Math.tan(k))))) * ((Math.sqrt(2.0) / k) * (t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * Math.cbrt((t_2 / Math.cos(k))))), -2.0)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = sin(k) ^ 2.0
	tmp = 0.0
	if (l_m <= 5.5e-159)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (l_m <= 1.55e+72)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64(t_2 / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(exp(Float64(log(2.0) * 0.5)) / k) * Float64((cbrt(l_m) ^ 2.0) / cbrt(Float64(sin(k) * tan(k))))) * Float64(Float64(sqrt(2.0) / k) * Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * cbrt(Float64(t_2 / cos(k))))) ^ -2.0))));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 5.5e-159], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 1.55e+72], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision] * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision] * N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[(t$95$2 / N[Cos[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := {\sin k}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \leq 1.55 \cdot 10^{+72}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{t\_2}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \cdot \left(\frac{\sqrt{2}}{k} \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot \sqrt[3]{\frac{t\_2}{\cos k}}\right)\right)}^{-2}\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 5.5000000000000003e-159

    1. Initial program 36.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. Simplified36.2%

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

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

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

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

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

    if 5.5000000000000003e-159 < l < 1.54999999999999994e72

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

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

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

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

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

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

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

    if 1.54999999999999994e72 < l

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{\sqrt{2}}{k} \cdot \left(t \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k \cdot \tan k}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{\color{blue}{e^{\log 2 \cdot 0.5}}}{k} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \]
    13. Taylor expanded in k around inf 89.9%

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

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

Alternative 3: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt[3]{\sin k \cdot \tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \leq 2.15 \cdot 10^{+71}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2}\right) \cdot \left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot \frac{\sqrt{2}}{k}\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (cbrt (* (sin k) (tan k)))))
   (*
    t_s
    (if (<= l_m 5.5e-159)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= l_m 2.15e+71)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (* (/ (exp (* (log 2.0) 0.5)) k) (/ (pow (cbrt l_m) 2.0) t_2))
         (*
          (* t_m (pow (* t_m (* (pow (cbrt l_m) -2.0) t_2)) -2.0))
          (/ (sqrt 2.0) k))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = cbrt((sin(k) * tan(k)));
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if (l_m <= 2.15e+71) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = ((exp((log(2.0) * 0.5)) / k) * (pow(cbrt(l_m), 2.0) / t_2)) * ((t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * t_2)), -2.0)) * (sqrt(2.0) / k));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if (l_m <= 2.15e+71) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = ((Math.exp((Math.log(2.0) * 0.5)) / k) * (Math.pow(Math.cbrt(l_m), 2.0) / t_2)) * ((t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * t_2)), -2.0)) * (Math.sqrt(2.0) / k));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = cbrt(Float64(sin(k) * tan(k)))
	tmp = 0.0
	if (l_m <= 5.5e-159)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (l_m <= 2.15e+71)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(exp(Float64(log(2.0) * 0.5)) / k) * Float64((cbrt(l_m) ^ 2.0) / t_2)) * Float64(Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * t_2)) ^ -2.0)) * Float64(sqrt(2.0) / k)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 5.5e-159], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 2.15e+71], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Exp[N[(N[Log[2.0], $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / k), $MachinePrecision] * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;l\_m \leq 2.15 \cdot 10^{+71}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2}\right) \cdot \left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot \frac{\sqrt{2}}{k}\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 5.5000000000000003e-159

    1. Initial program 36.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. Simplified36.2%

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

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

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

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

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

    if 5.5000000000000003e-159 < l < 2.14999999999999992e71

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

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

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

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

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

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

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

    if 2.14999999999999992e71 < l

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\sqrt{2}}{k}\\ t_3 := {\sin k}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \leq 5.6 \cdot 10^{+70}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{t\_3}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_2 \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot \sqrt[3]{\frac{t\_3}{\cos k}}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}} \cdot t\_2\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (/ (sqrt 2.0) k)) (t_3 (pow (sin k) 2.0)))
   (*
    t_s
    (if (<= l_m 5.5e-159)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= l_m 5.6e+70)
        (/ 2.0 (* (/ (* (pow k 2.0) t_m) (cos k)) (/ t_3 (pow l_m 2.0))))
        (*
         (*
          t_2
          (*
           t_m
           (pow
            (* t_m (* (pow (cbrt l_m) -2.0) (cbrt (/ t_3 (cos k)))))
            -2.0)))
         (* (/ (pow (cbrt l_m) 2.0) (cbrt (* (sin k) (tan k)))) t_2)))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = sqrt(2.0) / k;
	double t_3 = pow(sin(k), 2.0);
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if (l_m <= 5.6e+70) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (t_3 / pow(l_m, 2.0)));
	} else {
		tmp = (t_2 * (t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * cbrt((t_3 / cos(k))))), -2.0))) * ((pow(cbrt(l_m), 2.0) / cbrt((sin(k) * tan(k)))) * t_2);
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.sqrt(2.0) / k;
	double t_3 = Math.pow(Math.sin(k), 2.0);
	double tmp;
	if (l_m <= 5.5e-159) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if (l_m <= 5.6e+70) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (t_3 / Math.pow(l_m, 2.0)));
	} else {
		tmp = (t_2 * (t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * Math.cbrt((t_3 / Math.cos(k))))), -2.0))) * ((Math.pow(Math.cbrt(l_m), 2.0) / Math.cbrt((Math.sin(k) * Math.tan(k)))) * t_2);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = Float64(sqrt(2.0) / k)
	t_3 = sin(k) ^ 2.0
	tmp = 0.0
	if (l_m <= 5.5e-159)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (l_m <= 5.6e+70)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64(t_3 / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(t_2 * Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * cbrt(Float64(t_3 / cos(k))))) ^ -2.0))) * Float64(Float64((cbrt(l_m) ^ 2.0) / cbrt(Float64(sin(k) * tan(k)))) * t_2));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[l$95$m, 5.5e-159], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 5.6e+70], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$3 / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * N[Power[N[(t$95$3 / N[Cos[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := \frac{\sqrt{2}}{k}\\
t_3 := {\sin k}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 5.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \leq 5.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{t\_3}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_2 \cdot \left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot \sqrt[3]{\frac{t\_3}{\cos k}}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}} \cdot t\_2\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 5.5000000000000003e-159

    1. Initial program 36.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. Simplified36.2%

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

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

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

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

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

    if 5.5000000000000003e-159 < l < 5.59999999999999979e70

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

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

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

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

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

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

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

    if 5.59999999999999979e70 < l

    1. Initial program 38.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt[3]{\sin k \cdot \tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-317}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot \frac{\sqrt{2}}{k}\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot \frac{1}{\frac{k}{\sqrt{2}}}\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (cbrt (* (sin k) (tan k)))))
   (*
    t_s
    (if (<= (* l_m l_m) 2e-317)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= (* l_m l_m) 5e+140)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (*
          (* t_m (pow (* t_m (* (pow (cbrt l_m) -2.0) t_2)) -2.0))
          (/ (sqrt 2.0) k))
         (* (/ (pow (cbrt l_m) 2.0) t_2) (/ 1.0 (/ k (sqrt 2.0))))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = cbrt((sin(k) * tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = ((t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * t_2)), -2.0)) * (sqrt(2.0) / k)) * ((pow(cbrt(l_m), 2.0) / t_2) * (1.0 / (k / sqrt(2.0))));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = ((t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * t_2)), -2.0)) * (Math.sqrt(2.0) / k)) * ((Math.pow(Math.cbrt(l_m), 2.0) / t_2) * (1.0 / (k / Math.sqrt(2.0))));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = cbrt(Float64(sin(k) * tan(k)))
	tmp = 0.0
	if (Float64(l_m * l_m) <= 2e-317)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+140)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * t_2)) ^ -2.0)) * Float64(sqrt(2.0) / k)) * Float64(Float64((cbrt(l_m) ^ 2.0) / t_2) * Float64(1.0 / Float64(k / sqrt(2.0)))));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e-317], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+140], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] * N[(1.0 / N[(k / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot \frac{\sqrt{2}}{k}\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot \frac{1}{\frac{k}{\sqrt{2}}}\right)\\


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

    1. Initial program 23.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. Simplified23.4%

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

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

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

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

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

    if 1.99999997e-317 < (*.f64 l l) < 5.00000000000000008e140

    1. Initial program 49.7%

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

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

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

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

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

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

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

    if 5.00000000000000008e140 < (*.f64 l l)

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt[3]{\sin k \cdot \tan k}\\ t_3 := \frac{\sqrt{2}}{k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-317}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot t\_3\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot t\_3\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (cbrt (* (sin k) (tan k)))) (t_3 (/ (sqrt 2.0) k)))
   (*
    t_s
    (if (<= (* l_m l_m) 2e-317)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= (* l_m l_m) 5e+140)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (* (* t_m (pow (* t_m (* (pow (cbrt l_m) -2.0) t_2)) -2.0)) t_3)
         (* (/ (pow (cbrt l_m) 2.0) t_2) t_3)))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = cbrt((sin(k) * tan(k)));
	double t_3 = sqrt(2.0) / k;
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = ((t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * t_2)), -2.0)) * t_3) * ((pow(cbrt(l_m), 2.0) / t_2) * t_3);
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double t_3 = Math.sqrt(2.0) / k;
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = ((t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * t_2)), -2.0)) * t_3) * ((Math.pow(Math.cbrt(l_m), 2.0) / t_2) * t_3);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = cbrt(Float64(sin(k) * tan(k)))
	t_3 = Float64(sqrt(2.0) / k)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 2e-317)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+140)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * t_2)) ^ -2.0)) * t_3) * Float64(Float64((cbrt(l_m) ^ 2.0) / t_2) * t_3));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e-317], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+140], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision] * N[(N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}\right) \cdot t\_3\right) \cdot \left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot t\_3\right)\\


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

    1. Initial program 23.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. Simplified23.4%

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

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

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

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

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

    if 1.99999997e-317 < (*.f64 l l) < 5.00000000000000008e140

    1. Initial program 49.7%

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

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

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

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

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

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

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

    if 5.00000000000000008e140 < (*.f64 l l)

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 89.1% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt[3]{\sin k \cdot \tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-317}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot \frac{\sqrt{2}}{k}\right) \cdot \left(\sqrt{2} \cdot \frac{t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}}{k}\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (cbrt (* (sin k) (tan k)))))
   (*
    t_s
    (if (<= (* l_m l_m) 2e-317)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= (* l_m l_m) 5e+140)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (* (/ (pow (cbrt l_m) 2.0) t_2) (/ (sqrt 2.0) k))
         (*
          (sqrt 2.0)
          (/ (* t_m (pow (* t_m (* (pow (cbrt l_m) -2.0) t_2)) -2.0)) k))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = cbrt((sin(k) * tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = ((pow(cbrt(l_m), 2.0) / t_2) * (sqrt(2.0) / k)) * (sqrt(2.0) * ((t_m * pow((t_m * (pow(cbrt(l_m), -2.0) * t_2)), -2.0)) / k));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = ((Math.pow(Math.cbrt(l_m), 2.0) / t_2) * (Math.sqrt(2.0) / k)) * (Math.sqrt(2.0) * ((t_m * Math.pow((t_m * (Math.pow(Math.cbrt(l_m), -2.0) * t_2)), -2.0)) / k));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = cbrt(Float64(sin(k) * tan(k)))
	tmp = 0.0
	if (Float64(l_m * l_m) <= 2e-317)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+140)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(Float64((cbrt(l_m) ^ 2.0) / t_2) * Float64(sqrt(2.0) / k)) * Float64(sqrt(2.0) * Float64(Float64(t_m * (Float64(t_m * Float64((cbrt(l_m) ^ -2.0) * t_2)) ^ -2.0)) / k)));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e-317], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+140], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[N[(t$95$m * N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2} \cdot \frac{\sqrt{2}}{k}\right) \cdot \left(\sqrt{2} \cdot \frac{t\_m \cdot {\left(t\_m \cdot \left({\left(\sqrt[3]{l\_m}\right)}^{-2} \cdot t\_2\right)\right)}^{-2}}{k}\right)\\


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

    1. Initial program 23.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. Simplified23.4%

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

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

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

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

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

    if 1.99999997e-317 < (*.f64 l l) < 5.00000000000000008e140

    1. Initial program 49.7%

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

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

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

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

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

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

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

    if 5.00000000000000008e140 < (*.f64 l l)

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 87.7% accurate, 0.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sqrt[3]{\sin k \cdot \tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-317}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{k}\right) \cdot \left({\left(t\_2 \cdot \left(t\_m \cdot {\left(\sqrt[3]{l\_m}\right)}^{-2}\right)\right)}^{-2} \cdot \left(\sqrt{2} \cdot \frac{\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2}}{k}\right)\right)\\ \end{array} \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (let* ((t_2 (cbrt (* (sin k) (tan k)))))
   (*
    t_s
    (if (<= (* l_m l_m) 2e-317)
      (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
      (if (<= (* l_m l_m) 5e+140)
        (/
         2.0
         (*
          (/ (* (pow k 2.0) t_m) (cos k))
          (/ (pow (sin k) 2.0) (pow l_m 2.0))))
        (*
         (* t_m (/ (sqrt 2.0) k))
         (*
          (pow (* t_2 (* t_m (pow (cbrt l_m) -2.0))) -2.0)
          (* (sqrt 2.0) (/ (/ (pow (cbrt l_m) 2.0) t_2) k)))))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = cbrt((sin(k) * tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((pow(k, 2.0) * t_m) / cos(k)) * (pow(sin(k), 2.0) / pow(l_m, 2.0)));
	} else {
		tmp = (t_m * (sqrt(2.0) / k)) * (pow((t_2 * (t_m * pow(cbrt(l_m), -2.0))), -2.0) * (sqrt(2.0) * ((pow(cbrt(l_m), 2.0) / t_2) / k)));
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double t_2 = Math.cbrt((Math.sin(k) * Math.tan(k)));
	double tmp;
	if ((l_m * l_m) <= 2e-317) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+140) {
		tmp = 2.0 / (((Math.pow(k, 2.0) * t_m) / Math.cos(k)) * (Math.pow(Math.sin(k), 2.0) / Math.pow(l_m, 2.0)));
	} else {
		tmp = (t_m * (Math.sqrt(2.0) / k)) * (Math.pow((t_2 * (t_m * Math.pow(Math.cbrt(l_m), -2.0))), -2.0) * (Math.sqrt(2.0) * ((Math.pow(Math.cbrt(l_m), 2.0) / t_2) / k)));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	t_2 = cbrt(Float64(sin(k) * tan(k)))
	tmp = 0.0
	if (Float64(l_m * l_m) <= 2e-317)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+140)
		tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 2.0) * t_m) / cos(k)) * Float64((sin(k) ^ 2.0) / (l_m ^ 2.0))));
	else
		tmp = Float64(Float64(t_m * Float64(sqrt(2.0) / k)) * Float64((Float64(t_2 * Float64(t_m * (cbrt(l_m) ^ -2.0))) ^ -2.0) * Float64(sqrt(2.0) * Float64(Float64((cbrt(l_m) ^ 2.0) / t_2) / k))));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := Block[{t$95$2 = N[Power[N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e-317], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+140], N[(2.0 / N[(N[(N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$m * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(t$95$2 * N[(t$95$m * N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[(N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$2), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+140}:\\
\;\;\;\;\frac{2}{\frac{{k}^{2} \cdot t\_m}{\cos k} \cdot \frac{{\sin k}^{2}}{{l\_m}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\left(t\_m \cdot \frac{\sqrt{2}}{k}\right) \cdot \left({\left(t\_2 \cdot \left(t\_m \cdot {\left(\sqrt[3]{l\_m}\right)}^{-2}\right)\right)}^{-2} \cdot \left(\sqrt{2} \cdot \frac{\frac{{\left(\sqrt[3]{l\_m}\right)}^{2}}{t\_2}}{k}\right)\right)\\


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

    1. Initial program 23.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. Simplified23.4%

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

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

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

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

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

    if 1.99999997e-317 < (*.f64 l l) < 5.00000000000000008e140

    1. Initial program 49.7%

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

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

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

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

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

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

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

    if 5.00000000000000008e140 < (*.f64 l l)

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\sqrt{2}}{k} \cdot \left(t \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k \cdot \tan k}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{\color{blue}{e^{\log 2 \cdot 0.5}}}{k} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \]
    12. Applied egg-rr90.1%

      \[\leadsto \left(\frac{\sqrt{2}}{k} \cdot \left(t \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k \cdot \tan k}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{\color{blue}{e^{\log 2 \cdot 0.5}}}{k} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right) \]
    13. Step-by-step derivation
      1. pow190.1%

        \[\leadsto \color{blue}{{\left(\left(\frac{\sqrt{2}}{k} \cdot \left(t \cdot {\left(t \cdot \left({\left(\sqrt[3]{\ell}\right)}^{-2} \cdot \sqrt[3]{\sin k \cdot \tan k}\right)\right)}^{-2}\right)\right) \cdot \left(\frac{e^{\log 2 \cdot 0.5}}{k} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\sin k \cdot \tan k}}\right)\right)}^{1}} \]
    14. Applied egg-rr86.6%

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

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

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

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

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

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

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

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

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

Alternative 9: 79.4% accurate, 0.6× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 1.9 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;k \leq 9.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{2}{{k}^{2} \cdot \left(\frac{{\sin k}^{2}}{\cos k} \cdot \frac{t\_m}{{l\_m}^{2}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{l\_m}\right)}^{2}} \cdot \sqrt[3]{\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t\_m}\right)}^{2}\right)}\right)}^{3}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= k 1.9e-6)
    (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
    (if (<= k 9.5e+85)
      (/
       2.0
       (* (pow k 2.0) (* (/ (pow (sin k) 2.0) (cos k)) (/ t_m (pow l_m 2.0)))))
      (/
       2.0
       (pow
        (*
         (/ t_m (pow (cbrt l_m) 2.0))
         (cbrt (* (sin k) (* (tan k) (pow (/ k t_m) 2.0)))))
        3.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (k <= 1.9e-6) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if (k <= 9.5e+85) {
		tmp = 2.0 / (pow(k, 2.0) * ((pow(sin(k), 2.0) / cos(k)) * (t_m / pow(l_m, 2.0))));
	} else {
		tmp = 2.0 / pow(((t_m / pow(cbrt(l_m), 2.0)) * cbrt((sin(k) * (tan(k) * pow((k / t_m), 2.0))))), 3.0);
	}
	return t_s * tmp;
}
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if (k <= 1.9e-6) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if (k <= 9.5e+85) {
		tmp = 2.0 / (Math.pow(k, 2.0) * ((Math.pow(Math.sin(k), 2.0) / Math.cos(k)) * (t_m / Math.pow(l_m, 2.0))));
	} else {
		tmp = 2.0 / Math.pow(((t_m / Math.pow(Math.cbrt(l_m), 2.0)) * Math.cbrt((Math.sin(k) * (Math.tan(k) * Math.pow((k / t_m), 2.0))))), 3.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (k <= 1.9e-6)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (k <= 9.5e+85)
		tmp = Float64(2.0 / Float64((k ^ 2.0) * Float64(Float64((sin(k) ^ 2.0) / cos(k)) * Float64(t_m / (l_m ^ 2.0)))));
	else
		tmp = Float64(2.0 / (Float64(Float64(t_m / (cbrt(l_m) ^ 2.0)) * cbrt(Float64(sin(k) * Float64(tan(k) * (Float64(k / t_m) ^ 2.0))))) ^ 3.0));
	end
	return Float64(t_s * tmp)
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[k, 1.9e-6], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.5e+85], N[(2.0 / N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$m / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(t$95$m / N[Power[N[Power[l$95$m, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;k \leq 9.5 \cdot 10^{+85}:\\
\;\;\;\;\frac{2}{{k}^{2} \cdot \left(\frac{{\sin k}^{2}}{\cos k} \cdot \frac{t\_m}{{l\_m}^{2}}\right)}\\

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


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

    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. Simplified40.4%

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

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

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

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

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

    if 1.9e-6 < k < 9.49999999999999945e85

    1. Initial program 10.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. Simplified10.4%

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

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

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

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

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

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

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

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

    if 9.49999999999999945e85 < k

    1. Initial program 42.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.9 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{\ell} \cdot \sqrt{t}\right)}^{2}}\\ \mathbf{elif}\;k \leq 9.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{2}{{k}^{2} \cdot \left(\frac{{\sin k}^{2}}{\cos k} \cdot \frac{t}{{\ell}^{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(\frac{k}{t}\right)}^{2}\right)}\right)}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 78.6% accurate, 0.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot {k}^{-2}}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k \cdot {l\_m}^{2}}}\\


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

    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. Simplified40.4%

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

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

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

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

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

    if 3.1e-7 < k

    1. Initial program 32.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 84.7% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 0:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k \cdot {l\_m}^{2}} \cdot \left(k \cdot k\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t\_m}{\cos k}}}{l\_m}\right)}^{2}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 0.0)
    (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
    (if (<= (* l_m l_m) 5e+251)
      (/
       2.0
       (* (/ (* t_m (pow (sin k) 2.0)) (* (cos k) (pow l_m 2.0))) (* k k)))
      (/ 2.0 (pow (/ (* (* k (sin k)) (sqrt (/ t_m (cos k)))) l_m) 2.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = 2.0 / (((t_m * pow(sin(k), 2.0)) / (cos(k) * pow(l_m, 2.0))) * (k * k));
	} else {
		tmp = 2.0 / pow((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((l_m * l_m) <= 0.0d0) then
        tmp = 2.0d0 / ((((k ** 2.0d0) / l_m) * sqrt(t_m)) ** 2.0d0)
    else if ((l_m * l_m) <= 5d+251) then
        tmp = 2.0d0 / (((t_m * (sin(k) ** 2.0d0)) / (cos(k) * (l_m ** 2.0d0))) * (k * k))
    else
        tmp = 2.0d0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ** 2.0d0)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = 2.0 / (((t_m * Math.pow(Math.sin(k), 2.0)) / (Math.cos(k) * Math.pow(l_m, 2.0))) * (k * k));
	} else {
		tmp = 2.0 / Math.pow((((k * Math.sin(k)) * Math.sqrt((t_m / Math.cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	tmp = 0
	if (l_m * l_m) <= 0.0:
		tmp = 2.0 / math.pow(((math.pow(k, 2.0) / l_m) * math.sqrt(t_m)), 2.0)
	elif (l_m * l_m) <= 5e+251:
		tmp = 2.0 / (((t_m * math.pow(math.sin(k), 2.0)) / (math.cos(k) * math.pow(l_m, 2.0))) * (k * k))
	else:
		tmp = 2.0 / math.pow((((k * math.sin(k)) * math.sqrt((t_m / math.cos(k)))) / l_m), 2.0)
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 0.0)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+251)
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (sin(k) ^ 2.0)) / Float64(cos(k) * (l_m ^ 2.0))) * Float64(k * k)));
	else
		tmp = Float64(2.0 / (Float64(Float64(Float64(k * sin(k)) * sqrt(Float64(t_m / cos(k)))) / l_m) ^ 2.0));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k)
	tmp = 0.0;
	if ((l_m * l_m) <= 0.0)
		tmp = 2.0 / ((((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0);
	elseif ((l_m * l_m) <= 5e+251)
		tmp = 2.0 / (((t_m * (sin(k) ^ 2.0)) / (cos(k) * (l_m ^ 2.0))) * (k * k));
	else
		tmp = 2.0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ^ 2.0);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+251], N[(2.0 / N[(N[(N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 0:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k \cdot {l\_m}^{2}} \cdot \left(k \cdot k\right)}\\

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


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

    1. Initial program 22.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. Simplified22.5%

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

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

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

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

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

    if 0.0 < (*.f64 l l) < 5.0000000000000005e251

    1. Initial program 48.2%

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

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

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

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

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

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

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

    if 5.0000000000000005e251 < (*.f64 l l)

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

Alternative 12: 83.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 0:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\ \;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \left(2 \cdot \frac{\frac{\cos k}{{k}^{2}}}{t\_m \cdot {\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t\_m}{\cos k}}}{l\_m}\right)}^{2}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 0.0)
    (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
    (if (<= (* l_m l_m) 5e+251)
      (*
       (* l_m l_m)
       (* 2.0 (/ (/ (cos k) (pow k 2.0)) (* t_m (pow (sin k) 2.0)))))
      (/ 2.0 (pow (/ (* (* k (sin k)) (sqrt (/ t_m (cos k)))) l_m) 2.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = (l_m * l_m) * (2.0 * ((cos(k) / pow(k, 2.0)) / (t_m * pow(sin(k), 2.0))));
	} else {
		tmp = 2.0 / pow((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((l_m * l_m) <= 0.0d0) then
        tmp = 2.0d0 / ((((k ** 2.0d0) / l_m) * sqrt(t_m)) ** 2.0d0)
    else if ((l_m * l_m) <= 5d+251) then
        tmp = (l_m * l_m) * (2.0d0 * ((cos(k) / (k ** 2.0d0)) / (t_m * (sin(k) ** 2.0d0))))
    else
        tmp = 2.0d0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ** 2.0d0)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = (l_m * l_m) * (2.0 * ((Math.cos(k) / Math.pow(k, 2.0)) / (t_m * Math.pow(Math.sin(k), 2.0))));
	} else {
		tmp = 2.0 / Math.pow((((k * Math.sin(k)) * Math.sqrt((t_m / Math.cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	tmp = 0
	if (l_m * l_m) <= 0.0:
		tmp = 2.0 / math.pow(((math.pow(k, 2.0) / l_m) * math.sqrt(t_m)), 2.0)
	elif (l_m * l_m) <= 5e+251:
		tmp = (l_m * l_m) * (2.0 * ((math.cos(k) / math.pow(k, 2.0)) / (t_m * math.pow(math.sin(k), 2.0))))
	else:
		tmp = 2.0 / math.pow((((k * math.sin(k)) * math.sqrt((t_m / math.cos(k)))) / l_m), 2.0)
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 0.0)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+251)
		tmp = Float64(Float64(l_m * l_m) * Float64(2.0 * Float64(Float64(cos(k) / (k ^ 2.0)) / Float64(t_m * (sin(k) ^ 2.0)))));
	else
		tmp = Float64(2.0 / (Float64(Float64(Float64(k * sin(k)) * sqrt(Float64(t_m / cos(k)))) / l_m) ^ 2.0));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k)
	tmp = 0.0;
	if ((l_m * l_m) <= 0.0)
		tmp = 2.0 / ((((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0);
	elseif ((l_m * l_m) <= 5e+251)
		tmp = (l_m * l_m) * (2.0 * ((cos(k) / (k ^ 2.0)) / (t_m * (sin(k) ^ 2.0))));
	else
		tmp = 2.0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ^ 2.0);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+251], N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 0:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\
\;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \left(2 \cdot \frac{\frac{\cos k}{{k}^{2}}}{t\_m \cdot {\sin k}^{2}}\right)\\

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


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

    1. Initial program 22.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. Simplified22.5%

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

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

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

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

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

    if 0.0 < (*.f64 l l) < 5.0000000000000005e251

    1. Initial program 48.2%

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

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

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

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

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

    if 5.0000000000000005e251 < (*.f64 l l)

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

Alternative 13: 83.8% accurate, 1.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 0:\\ \;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\ \mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\ \;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \left(2 \cdot \frac{\cos k}{{k}^{2} \cdot \left(t\_m \cdot {\sin k}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t\_m}{\cos k}}}{l\_m}\right)}^{2}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 0.0)
    (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))
    (if (<= (* l_m l_m) 5e+251)
      (*
       (* l_m l_m)
       (* 2.0 (/ (cos k) (* (pow k 2.0) (* t_m (pow (sin k) 2.0))))))
      (/ 2.0 (pow (/ (* (* k (sin k)) (sqrt (/ t_m (cos k)))) l_m) 2.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = (l_m * l_m) * (2.0 * (cos(k) / (pow(k, 2.0) * (t_m * pow(sin(k), 2.0)))));
	} else {
		tmp = 2.0 / pow((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((l_m * l_m) <= 0.0d0) then
        tmp = 2.0d0 / ((((k ** 2.0d0) / l_m) * sqrt(t_m)) ** 2.0d0)
    else if ((l_m * l_m) <= 5d+251) then
        tmp = (l_m * l_m) * (2.0d0 * (cos(k) / ((k ** 2.0d0) * (t_m * (sin(k) ** 2.0d0)))))
    else
        tmp = 2.0d0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ** 2.0d0)
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0);
	} else if ((l_m * l_m) <= 5e+251) {
		tmp = (l_m * l_m) * (2.0 * (Math.cos(k) / (Math.pow(k, 2.0) * (t_m * Math.pow(Math.sin(k), 2.0)))));
	} else {
		tmp = 2.0 / Math.pow((((k * Math.sin(k)) * Math.sqrt((t_m / Math.cos(k)))) / l_m), 2.0);
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	tmp = 0
	if (l_m * l_m) <= 0.0:
		tmp = 2.0 / math.pow(((math.pow(k, 2.0) / l_m) * math.sqrt(t_m)), 2.0)
	elif (l_m * l_m) <= 5e+251:
		tmp = (l_m * l_m) * (2.0 * (math.cos(k) / (math.pow(k, 2.0) * (t_m * math.pow(math.sin(k), 2.0)))))
	else:
		tmp = 2.0 / math.pow((((k * math.sin(k)) * math.sqrt((t_m / math.cos(k)))) / l_m), 2.0)
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 0.0)
		tmp = Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
	elseif (Float64(l_m * l_m) <= 5e+251)
		tmp = Float64(Float64(l_m * l_m) * Float64(2.0 * Float64(cos(k) / Float64((k ^ 2.0) * Float64(t_m * (sin(k) ^ 2.0))))));
	else
		tmp = Float64(2.0 / (Float64(Float64(Float64(k * sin(k)) * sqrt(Float64(t_m / cos(k)))) / l_m) ^ 2.0));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k)
	tmp = 0.0;
	if ((l_m * l_m) <= 0.0)
		tmp = 2.0 / ((((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0);
	elseif ((l_m * l_m) <= 5e+251)
		tmp = (l_m * l_m) * (2.0 * (cos(k) / ((k ^ 2.0) * (t_m * (sin(k) ^ 2.0)))));
	else
		tmp = 2.0 / ((((k * sin(k)) * sqrt((t_m / cos(k)))) / l_m) ^ 2.0);
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 5e+251], N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(2.0 * N[(N[Cos[k], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[(N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 0:\\
\;\;\;\;\frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}\\

\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+251}:\\
\;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \left(2 \cdot \frac{\cos k}{{k}^{2} \cdot \left(t\_m \cdot {\sin k}^{2}\right)}\right)\\

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


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

    1. Initial program 22.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. Simplified22.5%

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

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

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

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

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

    if 0.0 < (*.f64 l l) < 5.0000000000000005e251

    1. Initial program 48.2%

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

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

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

    if 5.0000000000000005e251 < (*.f64 l l)

    1. Initial program 33.3%

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

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

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

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

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

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

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

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

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

Alternative 14: 80.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 37.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. Simplified37.4%

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

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

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

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

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

    if 4.3999999999999999e-5 < l

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

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

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

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

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

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

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

Alternative 15: 74.4% accurate, 1.4× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (/ 2.0 (pow (* (/ (pow k 2.0) l_m) (sqrt t_m)) 2.0))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 / pow(((pow(k, 2.0) / l_m) * sqrt(t_m)), 2.0));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 / ((((k ** 2.0d0) / l_m) * sqrt(t_m)) ** 2.0d0))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 / Math.pow(((Math.pow(k, 2.0) / l_m) * Math.sqrt(t_m)), 2.0));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 / math.pow(((math.pow(k, 2.0) / l_m) * math.sqrt(t_m)), 2.0))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 / (Float64(Float64((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0)))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 / ((((k ^ 2.0) / l_m) * sqrt(t_m)) ^ 2.0));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[Power[N[(N[(N[Power[k, 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{{\left(\frac{{k}^{2}}{l\_m} \cdot \sqrt{t\_m}\right)}^{2}}
\end{array}
Derivation
  1. Initial program 38.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. Simplified38.5%

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

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

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

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

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

Alternative 16: 65.8% accurate, 1.9× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot l\_m \leq 0:\\ \;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{l\_m} \cdot \left(k \cdot \frac{k}{t\_m}\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot {l\_m}^{2}}{t\_m \cdot {k}^{4}}\\ \end{array} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (*
  t_s
  (if (<= (* l_m l_m) 0.0)
    (/ 2.0 (pow (* (/ (pow t_m 1.5) l_m) (* k (/ k t_m))) 2.0))
    (/ (* 2.0 (pow l_m 2.0)) (* t_m (pow k 4.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / pow(((pow(t_m, 1.5) / l_m) * (k * (k / t_m))), 2.0);
	} else {
		tmp = (2.0 * pow(l_m, 2.0)) / (t_m * pow(k, 4.0));
	}
	return t_s * tmp;
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    real(8) :: tmp
    if ((l_m * l_m) <= 0.0d0) then
        tmp = 2.0d0 / ((((t_m ** 1.5d0) / l_m) * (k * (k / t_m))) ** 2.0d0)
    else
        tmp = (2.0d0 * (l_m ** 2.0d0)) / (t_m * (k ** 4.0d0))
    end if
    code = t_s * tmp
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	double tmp;
	if ((l_m * l_m) <= 0.0) {
		tmp = 2.0 / Math.pow(((Math.pow(t_m, 1.5) / l_m) * (k * (k / t_m))), 2.0);
	} else {
		tmp = (2.0 * Math.pow(l_m, 2.0)) / (t_m * Math.pow(k, 4.0));
	}
	return t_s * tmp;
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	tmp = 0
	if (l_m * l_m) <= 0.0:
		tmp = 2.0 / math.pow(((math.pow(t_m, 1.5) / l_m) * (k * (k / t_m))), 2.0)
	else:
		tmp = (2.0 * math.pow(l_m, 2.0)) / (t_m * math.pow(k, 4.0))
	return t_s * tmp
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	tmp = 0.0
	if (Float64(l_m * l_m) <= 0.0)
		tmp = Float64(2.0 / (Float64(Float64((t_m ^ 1.5) / l_m) * Float64(k * Float64(k / t_m))) ^ 2.0));
	else
		tmp = Float64(Float64(2.0 * (l_m ^ 2.0)) / Float64(t_m * (k ^ 4.0)));
	end
	return Float64(t_s * tmp)
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l_m, k)
	tmp = 0.0;
	if ((l_m * l_m) <= 0.0)
		tmp = 2.0 / ((((t_m ^ 1.5) / l_m) * (k * (k / t_m))) ^ 2.0);
	else
		tmp = (2.0 * (l_m ^ 2.0)) / (t_m * (k ^ 4.0));
	end
	tmp_2 = t_s * tmp;
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 0.0], N[(2.0 / N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[(k / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 0:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{l\_m} \cdot \left(k \cdot \frac{k}{t\_m}\right)\right)}^{2}}\\

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


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

    1. Initial program 22.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. Simplified22.5%

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

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

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

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

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

    if 0.0 < (*.f64 l l)

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

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

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

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

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

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    6. Applied egg-rr70.7%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 62.4% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2 \cdot {l\_m}^{2}}{t\_m \cdot {k}^{4}} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (/ (* 2.0 (pow l_m 2.0)) (* t_m (pow k 4.0)))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((2.0 * pow(l_m, 2.0)) / (t_m * pow(k, 4.0)));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * ((2.0d0 * (l_m ** 2.0d0)) / (t_m * (k ** 4.0d0)))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((2.0 * Math.pow(l_m, 2.0)) / (t_m * Math.pow(k, 4.0)));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * ((2.0 * math.pow(l_m, 2.0)) / (t_m * math.pow(k, 4.0)))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(Float64(2.0 * (l_m ^ 2.0)) / Float64(t_m * (k ^ 4.0))))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * ((2.0 * (l_m ^ 2.0)) / (t_m * (k ^ 4.0)));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(N[(2.0 * N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2 \cdot {l\_m}^{2}}{t\_m \cdot {k}^{4}}
\end{array}
Derivation
  1. Initial program 38.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. Simplified45.2%

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

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

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

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

      \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
  6. Applied egg-rr66.5%

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

Alternative 18: 62.4% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\frac{t\_m \cdot {k}^{4}}{{l\_m}^{2}}} \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (/ 2.0 (/ (* t_m (pow k 4.0)) (pow l_m 2.0)))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 / ((t_m * pow(k, 4.0)) / pow(l_m, 2.0)));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 / ((t_m * (k ** 4.0d0)) / (l_m ** 2.0d0)))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 / ((t_m * Math.pow(k, 4.0)) / Math.pow(l_m, 2.0)));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 / ((t_m * math.pow(k, 4.0)) / math.pow(l_m, 2.0)))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 / Float64(Float64(t_m * (k ^ 4.0)) / (l_m ^ 2.0))))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 / ((t_m * (k ^ 4.0)) / (l_m ^ 2.0)));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 / N[(N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / N[Power[l$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{\frac{t\_m \cdot {k}^{4}}{{l\_m}^{2}}}
\end{array}
Derivation
  1. Initial program 38.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. Simplified38.5%

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

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

    \[\leadsto \frac{2}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}} \]
  6. Add Preprocessing

Alternative 19: 62.3% accurate, 2.0× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(2 \cdot \frac{\frac{{l\_m}^{2}}{{k}^{4}}}{t\_m}\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* 2.0 (/ (/ (pow l_m 2.0) (pow k 4.0)) t_m))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 * ((pow(l_m, 2.0) / pow(k, 4.0)) / t_m));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * (2.0d0 * (((l_m ** 2.0d0) / (k ** 4.0d0)) / t_m))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * (2.0 * ((Math.pow(l_m, 2.0) / Math.pow(k, 4.0)) / t_m));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * (2.0 * ((math.pow(l_m, 2.0) / math.pow(k, 4.0)) / t_m))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(2.0 * Float64(Float64((l_m ^ 2.0) / (k ^ 4.0)) / t_m)))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * (2.0 * (((l_m ^ 2.0) / (k ^ 4.0)) / t_m));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(2.0 * N[(N[(N[Power[l$95$m, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

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

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

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

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

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

Alternative 20: 62.4% accurate, 3.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{2}{t\_m \cdot {k}^{4}}\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* (* l_m l_m) (/ 2.0 (* t_m (pow k 4.0))))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * (2.0 / (t_m * pow(k, 4.0))));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * ((l_m * l_m) * (2.0d0 / (t_m * (k ** 4.0d0))))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * (2.0 / (t_m * Math.pow(k, 4.0))));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * ((l_m * l_m) * (2.0 / (t_m * math.pow(k, 4.0))))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(Float64(l_m * l_m) * Float64(2.0 / Float64(t_m * (k ^ 4.0)))))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * ((l_m * l_m) * (2.0 / (t_m * (k ^ 4.0))));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

Alternative 21: 62.3% accurate, 3.8× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \left(\frac{2}{t\_m} \cdot {k}^{-4}\right)\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* (* l_m l_m) (* (/ 2.0 t_m) (pow k -4.0)))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * ((2.0 / t_m) * pow(k, -4.0)));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * ((l_m * l_m) * ((2.0d0 / t_m) * (k ** (-4.0d0))))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * ((2.0 / t_m) * Math.pow(k, -4.0)));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * ((l_m * l_m) * ((2.0 / t_m) * math.pow(k, -4.0)))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(Float64(l_m * l_m) * Float64(Float64(2.0 / t_m) * (k ^ -4.0))))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * ((l_m * l_m) * ((2.0 / t_m) * (k ^ -4.0)));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(N[(2.0 / t$95$m), $MachinePrecision] * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

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

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

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

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

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

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

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

Alternative 22: 19.8% accurate, 60.1× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{-0.11666666666666667}{t\_m}\right) \end{array} \]
l_m = (fabs.f64 l)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l_m k)
 :precision binary64
 (* t_s (* (* l_m l_m) (/ -0.11666666666666667 t_m))))
l_m = fabs(l);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * (-0.11666666666666667 / t_m));
}
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l_m, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l_m
    real(8), intent (in) :: k
    code = t_s * ((l_m * l_m) * ((-0.11666666666666667d0) / t_m))
end function
l_m = Math.abs(l);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l_m, double k) {
	return t_s * ((l_m * l_m) * (-0.11666666666666667 / t_m));
}
l_m = math.fabs(l)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l_m, k):
	return t_s * ((l_m * l_m) * (-0.11666666666666667 / t_m))
l_m = abs(l)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l_m, k)
	return Float64(t_s * Float64(Float64(l_m * l_m) * Float64(-0.11666666666666667 / t_m)))
end
l_m = abs(l);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l_m, k)
	tmp = t_s * ((l_m * l_m) * (-0.11666666666666667 / t_m));
end
l_m = N[Abs[l], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l$95$m_, k_] := N[(t$95$s * N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(-0.11666666666666667 / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{-0.11666666666666667}{t\_m}\right)
\end{array}
Derivation
  1. Initial program 38.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. Simplified45.2%

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

    \[\leadsto \color{blue}{\frac{{k}^{2} \cdot \left(-0.11666666666666667 \cdot \frac{{k}^{2}}{t} - 0.3333333333333333 \cdot \frac{1}{t}\right) + 2 \cdot \frac{1}{t}}{{k}^{4}}} \cdot \left(\ell \cdot \ell\right) \]
  5. Taylor expanded in k around inf 20.9%

    \[\leadsto \color{blue}{\frac{-0.11666666666666667}{t}} \cdot \left(\ell \cdot \ell\right) \]
  6. Final simplification20.9%

    \[\leadsto \left(\ell \cdot \ell\right) \cdot \frac{-0.11666666666666667}{t} \]
  7. Add Preprocessing

Reproduce

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