Toniolo and Linder, Equation (10+)

Percentage Accurate: 55.2% → 90.5%
Time: 17.7s
Alternatives: 20
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 55.2% accurate, 1.0× speedup?

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

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

Alternative 1: 90.5% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 56.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. Simplified55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.45e-47 < k < 2.4999999999999999e87

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. associate-*r*49.6%

        \[\leadsto \frac{2}{{\color{blue}{\left(\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}}^{2}} \]
      2. unpow-prod-down49.6%

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

        \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      4. add-sqr-sqrt66.2%

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

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

    if 2.4999999999999999e87 < k

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity57.3%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.9% accurate, 0.6× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.02 \cdot 10^{-32}:\\
\;\;\;\;\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \sin k\_m}\right)}^{2}\\

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


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

    1. Initial program 50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02000000000000002e-32 < t

    1. Initial program 55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 86.8% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;k\_m \leq 2.7 \cdot 10^{+87}:\\
\;\;\;\;\frac{\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2}}}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(2 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right)}\\

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


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

    1. Initial program 55.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. Simplified54.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000031e-25 < k < 2.70000000000000007e87

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity46.3%

        \[\leadsto \color{blue}{1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
      2. unpow-prod-down39.7%

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

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

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

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

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

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

    if 2.70000000000000007e87 < k

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity57.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.9% accurate, 0.8× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.35 \cdot 10^{-31}:\\
\;\;\;\;\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \sin k\_m}\right)}^{2}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.35000000000000007e-31

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity39.6%

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000007e-31 < t < 1.5e205

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

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

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

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

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

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

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

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

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

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

    if 1.5e205 < t

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{{t\_m}^{1.5}}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{{\left(t\_2 \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 8.2 \cdot 10^{+86}:\\
\;\;\;\;\frac{\frac{2}{{t\_2}^{2}}}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(2 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right)}\\

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


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

    1. Initial program 55.6%

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 35.8%

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

    if 3.00000000000000008e-5 < k < 8.1999999999999998e86

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. *-un-lft-identity27.1%

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

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

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

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

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

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

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

    if 8.1999999999999998e86 < k

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity57.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{{t\_m}^{1.5}}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 8200000:\\
\;\;\;\;\frac{2}{{\left(t\_2 \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

\mathbf{elif}\;k\_m \leq 3.1 \cdot 10^{+86}:\\
\;\;\;\;\frac{2}{{t\_2}^{2} \cdot \left(\left(\sin k\_m \cdot \tan k\_m\right) \cdot \left(2 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right)\right)}\\

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


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

    1. Initial program 55.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. Simplified55.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 36.1%

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

    if 8.2e6 < k < 3.1000000000000002e86

    1. Initial program 29.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. Simplified30.0%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Step-by-step derivation
      1. unpow-prod-down10.0%

        \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell}\right)}^{2} \cdot {\left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
      2. unpow-prod-down10.0%

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

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

    if 3.1000000000000002e86 < k

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity57.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.4% accurate, 0.8× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\cos k\_m}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \sin k\_m}\right)}^{2}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 4.8000000000000003e-32

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Step-by-step derivation
      1. *-un-lft-identity39.6%

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

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

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

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

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

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

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

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

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

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

    if 4.8000000000000003e-32 < t < 5.30000000000000013e150

    1. Initial program 65.6%

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

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

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

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

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

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

    if 5.30000000000000013e150 < t

    1. Initial program 46.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 56.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. Simplified56.3%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 28.2%

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

    if 1.95000000000000002e-143 < k < 1.2999999999999999e-16

    1. Initial program 48.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2999999999999999e-16 < k

    1. Initial program 39.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 86.6% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

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


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

    1. Initial program 55.6%

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 35.8%

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

    if 3.70000000000000015e-10 < k

    1. Initial program 37.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 56.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. Simplified56.5%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 29.6%

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

    if 6.2000000000000002e-45 < k

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 69.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-62 < t

    1. Initial program 55.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. Simplified55.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 53.8%

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

Alternative 12: 68.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\ell \cdot \left(\sqrt{2} \cdot {k}^{-2}\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\frac{1}{t}} \cdot \sqrt{\frac{1}{t}}\right)} \]
      6. add-sqr-sqrt60.5%

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

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

    if 1.65000000000000002e-62 < t

    1. Initial program 55.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. Simplified55.8%

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 53.8%

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

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

Alternative 13: 63.2% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2599999999999999e-61 < t

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

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

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

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

Alternative 14: 65.7% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 4.0000000000000001e-59

    1. Initial program 50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000001e-59 < t < 2.6e148

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified49.3%

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

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

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

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

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

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

    if 2.6e148 < t

    1. Initial program 46.4%

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

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

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

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

Alternative 15: 65.7% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.6999999999999999e-59

    1. Initial program 50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6999999999999999e-59 < t < 4.79999999999999989e148

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified49.3%

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

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

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

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

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

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

    if 4.79999999999999989e148 < t

    1. Initial program 46.4%

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

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

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

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

Alternative 16: 61.5% accurate, 1.9× speedup?

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

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

\mathbf{elif}\;t\_m \leq 1.4 \cdot 10^{+145}:\\
\;\;\;\;\frac{2}{\left({t\_m}^{2} \cdot \frac{t\_m}{\ell}\right) \cdot \frac{2 \cdot {k\_m}^{2}}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 3.4000000000000001e-138

    1. Initial program 47.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{{k}^{4} \cdot t} \]
      3. rem-square-sqrt52.7%

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

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

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

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

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

    if 3.4000000000000001e-138 < t < 1.3999999999999999e145

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified47.9%

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

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

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

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

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

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

    if 1.3999999999999999e145 < t

    1. Initial program 46.4%

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

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

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

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

Alternative 17: 58.4% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 56.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. Simplified56.5%

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

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

    if 1.39999999999999996e-47 < k

    1. Initial program 37.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{k \cdot \sin k} \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    8. Step-by-step derivation
      1. associate-/l*53.9%

        \[\leadsto {\left(\color{blue}{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)} \cdot \sqrt{\frac{\cos k}{t}}\right)}^{2} \]
    9. Simplified53.9%

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Taylor expanded in k around 0 44.5%

      \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
    11. Step-by-step derivation
      1. associate-/l*44.5%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
      2. unpow244.5%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{{k}^{4} \cdot t} \]
      3. rem-square-sqrt44.5%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{2}}{{k}^{4} \cdot t} \]
      4. *-commutative44.5%

        \[\leadsto {\ell}^{2} \cdot \frac{2}{\color{blue}{t \cdot {k}^{4}}} \]
    12. Simplified44.5%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{2}{t \cdot {k}^{4}}} \]
    13. Step-by-step derivation
      1. unpow244.5%

        \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
    14. Applied egg-rr44.5%

      \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.4 \cdot 10^{-47}:\\ \;\;\;\;\frac{2}{\left(k \cdot 2\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 58.6% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k\_m}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 9.2e-69)
    (* (* l l) (/ 2.0 (* t_m (pow k_m 4.0))))
    (/ 2.0 (* (/ (* 2.0 (pow k_m 2.0)) l) (/ (pow t_m 3.0) l))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 9.2e-69) {
		tmp = (l * l) * (2.0 / (t_m * pow(k_m, 4.0)));
	} else {
		tmp = 2.0 / (((2.0 * pow(k_m, 2.0)) / l) * (pow(t_m, 3.0) / l));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t_m <= 9.2d-69) then
        tmp = (l * l) * (2.0d0 / (t_m * (k_m ** 4.0d0)))
    else
        tmp = 2.0d0 / (((2.0d0 * (k_m ** 2.0d0)) / l) * ((t_m ** 3.0d0) / l))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 9.2e-69) {
		tmp = (l * l) * (2.0 / (t_m * Math.pow(k_m, 4.0)));
	} else {
		tmp = 2.0 / (((2.0 * Math.pow(k_m, 2.0)) / l) * (Math.pow(t_m, 3.0) / l));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if t_m <= 9.2e-69:
		tmp = (l * l) * (2.0 / (t_m * math.pow(k_m, 4.0)))
	else:
		tmp = 2.0 / (((2.0 * math.pow(k_m, 2.0)) / l) * (math.pow(t_m, 3.0) / l))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (t_m <= 9.2e-69)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(t_m * (k_m ^ 4.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k_m ^ 2.0)) / l) * Float64((t_m ^ 3.0) / l)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (t_m <= 9.2e-69)
		tmp = (l * l) * (2.0 / (t_m * (k_m ^ 4.0)));
	else
		tmp = 2.0 / (((2.0 * (k_m ^ 2.0)) / l) * ((t_m ^ 3.0) / l));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 9.2e-69], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.2 \cdot 10^{-69}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{2 \cdot {k\_m}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 9.2000000000000003e-69

    1. Initial program 49.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*49.6%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1}} \]
      2. +-commutative49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1} \]
      3. unpow249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1} \]
      4. sqr-neg49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) + 1} \]
      5. distribute-frac-neg249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{-t}} \cdot \left(-\frac{k}{t}\right) + 1\right) + 1} \]
      6. distribute-frac-neg249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\frac{k}{-t} \cdot \color{blue}{\frac{k}{-t}} + 1\right) + 1} \]
      7. unpow249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{{\left(\frac{k}{-t}\right)}^{2}} + 1\right) + 1} \]
      8. +-commutative49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)} + 1} \]
      9. associate-*l*45.6%

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      10. associate-*l/43.4%

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      11. associate-/r/43.3%

        \[\leadsto \frac{\color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      12. +-commutative43.3%

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{1 + \left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)}} \]
      13. associate-+r+43.3%

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{\left(1 + 1\right) + {\left(\frac{k}{-t}\right)}^{2}}} \]
    3. Simplified43.3%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt26.5%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \cdot \sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}} \]
      2. pow226.5%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}\right)}^{2}} \]
    6. Applied egg-rr29.5%

      \[\leadsto \color{blue}{{\left(\frac{\ell \cdot \sqrt{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2}} \]
    7. Taylor expanded in t around 0 39.9%

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{k \cdot \sin k} \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    8. Step-by-step derivation
      1. associate-/l*39.9%

        \[\leadsto {\left(\color{blue}{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)} \cdot \sqrt{\frac{\cos k}{t}}\right)}^{2} \]
    9. Simplified39.9%

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Taylor expanded in k around 0 55.1%

      \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
    11. Step-by-step derivation
      1. associate-/l*55.1%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
      2. unpow255.1%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{{k}^{4} \cdot t} \]
      3. rem-square-sqrt55.1%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{2}}{{k}^{4} \cdot t} \]
      4. *-commutative55.1%

        \[\leadsto {\ell}^{2} \cdot \frac{2}{\color{blue}{t \cdot {k}^{4}}} \]
    12. Simplified55.1%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{2}{t \cdot {k}^{4}}} \]
    13. Step-by-step derivation
      1. unpow255.1%

        \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
    14. Applied egg-rr55.1%

      \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]

    if 9.2000000000000003e-69 < t

    1. Initial program 55.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. Simplified56.4%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 45.0%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/45.2%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr45.2%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    7. Step-by-step derivation
      1. associate-/l*44.9%

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified44.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t}^{3}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 58.1% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.6 \cdot 10^{-62}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.6e-62)
    (* (* l l) (/ 2.0 (* t_m (pow k_m 4.0))))
    (/ 2.0 (* (* 2.0 (pow k_m 2.0)) (/ (/ (pow t_m 3.0) l) l))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 1.6e-62) {
		tmp = (l * l) * (2.0 / (t_m * pow(k_m, 4.0)));
	} else {
		tmp = 2.0 / ((2.0 * pow(k_m, 2.0)) * ((pow(t_m, 3.0) / l) / l));
	}
	return t_s * tmp;
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t_m <= 1.6d-62) then
        tmp = (l * l) * (2.0d0 / (t_m * (k_m ** 4.0d0)))
    else
        tmp = 2.0d0 / ((2.0d0 * (k_m ** 2.0d0)) * (((t_m ** 3.0d0) / l) / l))
    end if
    code = t_s * tmp
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	double tmp;
	if (t_m <= 1.6e-62) {
		tmp = (l * l) * (2.0 / (t_m * Math.pow(k_m, 4.0)));
	} else {
		tmp = 2.0 / ((2.0 * Math.pow(k_m, 2.0)) * ((Math.pow(t_m, 3.0) / l) / l));
	}
	return t_s * tmp;
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	tmp = 0
	if t_m <= 1.6e-62:
		tmp = (l * l) * (2.0 / (t_m * math.pow(k_m, 4.0)))
	else:
		tmp = 2.0 / ((2.0 * math.pow(k_m, 2.0)) * ((math.pow(t_m, 3.0) / l) / l))
	return t_s * tmp
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	tmp = 0.0
	if (t_m <= 1.6e-62)
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(t_m * (k_m ^ 4.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k_m ^ 2.0)) * Float64(Float64((t_m ^ 3.0) / l) / l)));
	end
	return Float64(t_s * tmp)
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k_m)
	tmp = 0.0;
	if (t_m <= 1.6e-62)
		tmp = (l * l) * (2.0 / (t_m * (k_m ^ 4.0)));
	else
		tmp = 2.0 / ((2.0 * (k_m ^ 2.0)) * (((t_m ^ 3.0) / l) / l));
	end
	tmp_2 = t_s * tmp;
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.6e-62], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.6 \cdot 10^{-62}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.60000000000000011e-62

    1. Initial program 49.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*49.6%

        \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1}} \]
      2. +-commutative49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1} \]
      3. unpow249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1} \]
      4. sqr-neg49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) + 1} \]
      5. distribute-frac-neg249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{-t}} \cdot \left(-\frac{k}{t}\right) + 1\right) + 1} \]
      6. distribute-frac-neg249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\frac{k}{-t} \cdot \color{blue}{\frac{k}{-t}} + 1\right) + 1} \]
      7. unpow249.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{{\left(\frac{k}{-t}\right)}^{2}} + 1\right) + 1} \]
      8. +-commutative49.6%

        \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)} + 1} \]
      9. associate-*l*45.6%

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      10. associate-*l/43.4%

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      11. associate-/r/43.3%

        \[\leadsto \frac{\color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
      12. +-commutative43.3%

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{1 + \left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)}} \]
      13. associate-+r+43.3%

        \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{\left(1 + 1\right) + {\left(\frac{k}{-t}\right)}^{2}}} \]
    3. Simplified43.3%

      \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt26.5%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \cdot \sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}} \]
      2. pow226.5%

        \[\leadsto \color{blue}{{\left(\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}\right)}^{2}} \]
    6. Applied egg-rr29.5%

      \[\leadsto \color{blue}{{\left(\frac{\ell \cdot \sqrt{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2}} \]
    7. Taylor expanded in t around 0 39.9%

      \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{k \cdot \sin k} \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    8. Step-by-step derivation
      1. associate-/l*39.9%

        \[\leadsto {\left(\color{blue}{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)} \cdot \sqrt{\frac{\cos k}{t}}\right)}^{2} \]
    9. Simplified39.9%

      \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
    10. Taylor expanded in k around 0 55.1%

      \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
    11. Step-by-step derivation
      1. associate-/l*55.1%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
      2. unpow255.1%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{{k}^{4} \cdot t} \]
      3. rem-square-sqrt55.1%

        \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{2}}{{k}^{4} \cdot t} \]
      4. *-commutative55.1%

        \[\leadsto {\ell}^{2} \cdot \frac{2}{\color{blue}{t \cdot {k}^{4}}} \]
    12. Simplified55.1%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{2}{t \cdot {k}^{4}}} \]
    13. Step-by-step derivation
      1. unpow255.1%

        \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
    14. Applied egg-rr55.1%

      \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]

    if 1.60000000000000011e-62 < t

    1. Initial program 55.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. Simplified56.4%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 45.0%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification51.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.6 \cdot 10^{-62}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 52.2% accurate, 3.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\right) \end{array} \]
k_m = (fabs.f64 k)
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k_m)
 :precision binary64
 (* t_s (* (* l l) (/ 2.0 (* t_m (pow k_m 4.0))))))
k_m = fabs(k);
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((l * l) * (2.0 / (t_m * pow(k_m, 4.0))));
}
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k_m)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    code = t_s * ((l * l) * (2.0d0 / (t_m * (k_m ** 4.0d0))))
end function
k_m = Math.abs(k);
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k_m) {
	return t_s * ((l * l) * (2.0 / (t_m * Math.pow(k_m, 4.0))));
}
k_m = math.fabs(k)
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k_m):
	return t_s * ((l * l) * (2.0 / (t_m * math.pow(k_m, 4.0))))
k_m = abs(k)
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k_m)
	return Float64(t_s * Float64(Float64(l * l) * Float64(2.0 / Float64(t_m * (k_m ^ 4.0)))))
end
k_m = abs(k);
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k_m)
	tmp = t_s * ((l * l) * (2.0 / (t_m * (k_m ^ 4.0))));
end
k_m = N[Abs[k], $MachinePrecision]
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k$95$m_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(\left(\ell \cdot \ell\right) \cdot \frac{2}{t\_m \cdot {k\_m}^{4}}\right)
\end{array}
Derivation
  1. Initial program 51.6%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*51.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1}} \]
    2. +-commutative51.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1} \]
    3. unpow251.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1} \]
    4. sqr-neg51.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) + 1} \]
    5. distribute-frac-neg251.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{\frac{k}{-t}} \cdot \left(-\frac{k}{t}\right) + 1\right) + 1} \]
    6. distribute-frac-neg251.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\frac{k}{-t} \cdot \color{blue}{\frac{k}{-t}} + 1\right) + 1} \]
    7. unpow251.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\left(\color{blue}{{\left(\frac{k}{-t}\right)}^{2}} + 1\right) + 1} \]
    8. +-commutative51.6%

      \[\leadsto \frac{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k}}{\color{blue}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)} + 1} \]
    9. associate-*l*47.1%

      \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
    10. associate-*l/45.7%

      \[\leadsto \frac{\frac{2}{\color{blue}{\frac{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}{\ell \cdot \ell}}}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
    11. associate-/r/45.6%

      \[\leadsto \frac{\color{blue}{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}}{\left(1 + {\left(\frac{k}{-t}\right)}^{2}\right) + 1} \]
    12. +-commutative45.6%

      \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{1 + \left(1 + {\left(\frac{k}{-t}\right)}^{2}\right)}} \]
    13. associate-+r+45.6%

      \[\leadsto \frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{\color{blue}{\left(1 + 1\right) + {\left(\frac{k}{-t}\right)}^{2}}} \]
  3. Simplified45.6%

    \[\leadsto \color{blue}{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-sqr-sqrt31.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \cdot \sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}} \]
    2. pow231.7%

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}}\right)}^{2}} \]
  6. Applied egg-rr34.2%

    \[\leadsto \color{blue}{{\left(\frac{\ell \cdot \sqrt{\frac{2}{{t}^{3} \cdot \left(\sin k \cdot \tan k\right)}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)}\right)}^{2}} \]
  7. Taylor expanded in t around 0 38.0%

    \[\leadsto {\color{blue}{\left(\frac{\ell \cdot \sqrt{2}}{k \cdot \sin k} \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
  8. Step-by-step derivation
    1. associate-/l*38.0%

      \[\leadsto {\left(\color{blue}{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)} \cdot \sqrt{\frac{\cos k}{t}}\right)}^{2} \]
  9. Simplified38.0%

    \[\leadsto {\color{blue}{\left(\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right) \cdot \sqrt{\frac{\cos k}{t}}\right)}}^{2} \]
  10. Taylor expanded in k around 0 49.7%

    \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
  11. Step-by-step derivation
    1. associate-/l*49.7%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{\left(\sqrt{2}\right)}^{2}}{{k}^{4} \cdot t}} \]
    2. unpow249.7%

      \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{{k}^{4} \cdot t} \]
    3. rem-square-sqrt49.7%

      \[\leadsto {\ell}^{2} \cdot \frac{\color{blue}{2}}{{k}^{4} \cdot t} \]
    4. *-commutative49.7%

      \[\leadsto {\ell}^{2} \cdot \frac{2}{\color{blue}{t \cdot {k}^{4}}} \]
  12. Simplified49.7%

    \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{2}{t \cdot {k}^{4}}} \]
  13. Step-by-step derivation
    1. unpow249.7%

      \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
  14. Applied egg-rr49.7%

    \[\leadsto \color{blue}{\left(\ell \cdot \ell\right)} \cdot \frac{2}{t \cdot {k}^{4}} \]
  15. Add Preprocessing

Reproduce

?
herbie shell --seed 2024117 
(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))))