Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.6% → 92.5%
Time: 19.8s
Alternatives: 17
Speedup: 3.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 35.6% 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: 92.5% accurate, 0.3× 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{\sqrt{2}}{k\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.0185:\\ \;\;\;\;{\left(\frac{\ell \cdot t\_2}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt{t\_2 \cdot t\_m}}{\sqrt[3]{\frac{{\sin k\_m}^{2}}{\cos k\_m}} \cdot \left(t\_m \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)}\right)}^{2} \cdot \frac{\frac{\sqrt{2}}{\frac{k\_m}{t\_m}}}{\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k\_m \cdot \tan k\_m}}\\ \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 (/ (sqrt 2.0) k_m)))
   (*
    t_s
    (if (<= k_m 0.0185)
      (pow (* (/ (* l t_2) (sin k_m)) (sqrt (/ (cos k_m) t_m))) 2.0)
      (*
       (pow
        (/
         (sqrt (* t_2 t_m))
         (*
          (cbrt (/ (pow (sin k_m) 2.0) (cos k_m)))
          (* t_m (pow (cbrt l) -2.0))))
        2.0)
       (/
        (/ (sqrt 2.0) (/ k_m t_m))
        (* (/ t_m (pow (cbrt l) 2.0)) (cbrt (* (sin k_m) (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 t_2 = sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.0185) {
		tmp = pow((((l * t_2) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
	} else {
		tmp = pow((sqrt((t_2 * t_m)) / (cbrt((pow(sin(k_m), 2.0) / cos(k_m))) * (t_m * pow(cbrt(l), -2.0)))), 2.0) * ((sqrt(2.0) / (k_m / t_m)) / ((t_m / pow(cbrt(l), 2.0)) * cbrt((sin(k_m) * tan(k_m)))));
	}
	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.sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.0185) {
		tmp = Math.pow((((l * t_2) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
	} else {
		tmp = Math.pow((Math.sqrt((t_2 * t_m)) / (Math.cbrt((Math.pow(Math.sin(k_m), 2.0) / Math.cos(k_m))) * (t_m * Math.pow(Math.cbrt(l), -2.0)))), 2.0) * ((Math.sqrt(2.0) / (k_m / t_m)) / ((t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k_m) * 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)
	t_2 = Float64(sqrt(2.0) / k_m)
	tmp = 0.0
	if (k_m <= 0.0185)
		tmp = Float64(Float64(Float64(l * t_2) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0;
	else
		tmp = Float64((Float64(sqrt(Float64(t_2 * t_m)) / Float64(cbrt(Float64((sin(k_m) ^ 2.0) / cos(k_m))) * Float64(t_m * (cbrt(l) ^ -2.0)))) ^ 2.0) * Float64(Float64(sqrt(2.0) / Float64(k_m / t_m)) / Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k_m) * tan(k_m))))));
	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_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.0185], N[Power[N[(N[(N[(l * t$95$2), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[Power[N[(N[Sqrt[N[(t$95$2 * t$95$m), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * N[(t$95$m * N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $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)

\\
\begin{array}{l}
t_2 := \frac{\sqrt{2}}{k\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.0185:\\
\;\;\;\;{\left(\frac{\ell \cdot t\_2}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0184999999999999991 < k

    1. Initial program 33.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. *-commutative33.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.1% accurate, 0.3× 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{\sqrt{2}}{\frac{k\_m}{t\_m}}\\ t_3 := \frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.0185:\\ \;\;\;\;{\left(\frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_2}{t\_3 \cdot \sqrt[3]{\sin k\_m \cdot \tan k\_m}} \cdot \frac{t\_2}{{\left(\sqrt[3]{\frac{{\sin k\_m}^{2}}{\cos k\_m}} \cdot t\_3\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 (/ (sqrt 2.0) (/ k_m t_m))) (t_3 (/ t_m (pow (cbrt l) 2.0))))
   (*
    t_s
    (if (<= k_m 0.0185)
      (pow
       (* (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m)) (sqrt (/ (cos k_m) t_m)))
       2.0)
      (*
       (/ t_2 (* t_3 (cbrt (* (sin k_m) (tan k_m)))))
       (/ t_2 (pow (* (cbrt (/ (pow (sin k_m) 2.0) (cos k_m))) t_3) 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 = sqrt(2.0) / (k_m / t_m);
	double t_3 = t_m / pow(cbrt(l), 2.0);
	double tmp;
	if (k_m <= 0.0185) {
		tmp = pow((((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (t_2 / (t_3 * cbrt((sin(k_m) * tan(k_m))))) * (t_2 / pow((cbrt((pow(sin(k_m), 2.0) / cos(k_m))) * t_3), 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.sqrt(2.0) / (k_m / t_m);
	double t_3 = t_m / Math.pow(Math.cbrt(l), 2.0);
	double tmp;
	if (k_m <= 0.0185) {
		tmp = Math.pow((((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (t_2 / (t_3 * Math.cbrt((Math.sin(k_m) * Math.tan(k_m))))) * (t_2 / Math.pow((Math.cbrt((Math.pow(Math.sin(k_m), 2.0) / Math.cos(k_m))) * t_3), 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(sqrt(2.0) / Float64(k_m / t_m))
	t_3 = Float64(t_m / (cbrt(l) ^ 2.0))
	tmp = 0.0
	if (k_m <= 0.0185)
		tmp = Float64(Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0;
	else
		tmp = Float64(Float64(t_2 / Float64(t_3 * cbrt(Float64(sin(k_m) * tan(k_m))))) * Float64(t_2 / (Float64(cbrt(Float64((sin(k_m) ^ 2.0) / cos(k_m))) * t_3) ^ 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_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m / t$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.0185], N[Power[N[(N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(t$95$2 / N[(t$95$3 * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / N[Power[N[(N[Power[N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * t$95$3), $MachinePrecision], 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)

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0184999999999999991 < k

    1. Initial program 33.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. *-commutative33.6%

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

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

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

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

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

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

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

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

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

Alternative 3: 89.1% accurate, 0.3× 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{\sqrt{2}}{\frac{k\_m}{t\_m}}\\ t_3 := \frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{\sin k\_m \cdot \tan k\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.0185:\\ \;\;\;\;{\left(\frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_2}{t\_3} \cdot \frac{t\_2}{{t\_3}^{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 (/ (sqrt 2.0) (/ k_m t_m)))
        (t_3 (* (/ t_m (pow (cbrt l) 2.0)) (cbrt (* (sin k_m) (tan k_m))))))
   (*
    t_s
    (if (<= k_m 0.0185)
      (pow
       (* (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m)) (sqrt (/ (cos k_m) t_m)))
       2.0)
      (* (/ t_2 t_3) (/ t_2 (pow t_3 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 = sqrt(2.0) / (k_m / t_m);
	double t_3 = (t_m / pow(cbrt(l), 2.0)) * cbrt((sin(k_m) * tan(k_m)));
	double tmp;
	if (k_m <= 0.0185) {
		tmp = pow((((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (t_2 / t_3) * (t_2 / pow(t_3, 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.sqrt(2.0) / (k_m / t_m);
	double t_3 = (t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt((Math.sin(k_m) * Math.tan(k_m)));
	double tmp;
	if (k_m <= 0.0185) {
		tmp = Math.pow((((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (t_2 / t_3) * (t_2 / Math.pow(t_3, 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(sqrt(2.0) / Float64(k_m / t_m))
	t_3 = Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(Float64(sin(k_m) * tan(k_m))))
	tmp = 0.0
	if (k_m <= 0.0185)
		tmp = Float64(Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0;
	else
		tmp = Float64(Float64(t_2 / t_3) * Float64(t_2 / (t_3 ^ 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_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m / t$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.0185], N[Power[N[(N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(t$95$2 / t$95$3), $MachinePrecision] * N[(t$95$2 / N[Power[t$95$3, 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)

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{t\_3} \cdot \frac{t\_2}{{t\_3}^{2}}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0184999999999999991 < k

    1. Initial program 33.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. *-commutative33.6%

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

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

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

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

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

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

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

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

Alternative 4: 89.1% accurate, 0.3× 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 := \sqrt[3]{\sin k\_m \cdot \tan k\_m}\\ t_3 := \frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\\ t_4 := \frac{\sqrt{2}}{k\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.0185:\\ \;\;\;\;{\left(\frac{\ell \cdot t\_4}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{\frac{k\_m}{t\_m} \cdot {\left(t\_3 \cdot t\_2\right)}^{2}} \cdot \frac{\frac{t\_4 \cdot t\_m}{t\_3}}{t\_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 (cbrt (* (sin k_m) (tan k_m))))
        (t_3 (/ t_m (pow (cbrt l) 2.0)))
        (t_4 (/ (sqrt 2.0) k_m)))
   (*
    t_s
    (if (<= k_m 0.0185)
      (pow (* (/ (* l t_4) (sin k_m)) (sqrt (/ (cos k_m) t_m))) 2.0)
      (*
       (/ (sqrt 2.0) (* (/ k_m t_m) (pow (* t_3 t_2) 2.0)))
       (/ (/ (* t_4 t_m) t_3) t_2))))))
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 = cbrt((sin(k_m) * tan(k_m)));
	double t_3 = t_m / pow(cbrt(l), 2.0);
	double t_4 = sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.0185) {
		tmp = pow((((l * t_4) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (sqrt(2.0) / ((k_m / t_m) * pow((t_3 * t_2), 2.0))) * (((t_4 * t_m) / t_3) / t_2);
	}
	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.cbrt((Math.sin(k_m) * Math.tan(k_m)));
	double t_3 = t_m / Math.pow(Math.cbrt(l), 2.0);
	double t_4 = Math.sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.0185) {
		tmp = Math.pow((((l * t_4) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
	} else {
		tmp = (Math.sqrt(2.0) / ((k_m / t_m) * Math.pow((t_3 * t_2), 2.0))) * (((t_4 * t_m) / t_3) / t_2);
	}
	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 = cbrt(Float64(sin(k_m) * tan(k_m)))
	t_3 = Float64(t_m / (cbrt(l) ^ 2.0))
	t_4 = Float64(sqrt(2.0) / k_m)
	tmp = 0.0
	if (k_m <= 0.0185)
		tmp = Float64(Float64(Float64(l * t_4) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0;
	else
		tmp = Float64(Float64(sqrt(2.0) / Float64(Float64(k_m / t_m) * (Float64(t_3 * t_2) ^ 2.0))) * Float64(Float64(Float64(t_4 * t_m) / t_3) / t_2));
	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_] := Block[{t$95$2 = N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.0185], N[Power[N[(N[(N[(l * t$95$4), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(N[(k$95$m / t$95$m), $MachinePrecision] * N[Power[N[(t$95$3 * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$4 * t$95$m), $MachinePrecision] / t$95$3), $MachinePrecision] / t$95$2), $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 := \sqrt[3]{\sin k\_m \cdot \tan k\_m}\\
t_3 := \frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\\
t_4 := \frac{\sqrt{2}}{k\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.0185:\\
\;\;\;\;{\left(\frac{\ell \cdot t\_4}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{\frac{k\_m}{t\_m} \cdot {\left(t\_3 \cdot t\_2\right)}^{2}} \cdot \frac{\frac{t\_4 \cdot t\_m}{t\_3}}{t\_2}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0184999999999999991 < k

    1. Initial program 33.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. *-commutative33.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.2% accurate, 0.4× 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}\;\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right) \leq 2 \cdot 10^{+47}:\\ \;\;\;\;\frac{2}{t\_m \cdot {k\_m}^{2}} \cdot \frac{\cos k\_m \cdot {\ell}^{2}}{{\sin k\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_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 (<=
       (*
        (* (tan k_m) (* (sin k_m) (/ (pow t_m 3.0) (* l l))))
        (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) -1.0))
       2e+47)
    (*
     (/ 2.0 (* t_m (pow k_m 2.0)))
     (/ (* (cos k_m) (pow l 2.0)) (pow (sin k_m) 2.0)))
    (pow
     (* (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m)) (sqrt (/ (cos 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 (((tan(k_m) * (sin(k_m) * (pow(t_m, 3.0) / (l * l)))) * ((1.0 + pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47) {
		tmp = (2.0 / (t_m * pow(k_m, 2.0))) * ((cos(k_m) * pow(l, 2.0)) / pow(sin(k_m), 2.0));
	} else {
		tmp = pow((((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 (((tan(k_m) * (sin(k_m) * ((t_m ** 3.0d0) / (l * l)))) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + (-1.0d0))) <= 2d+47) then
        tmp = (2.0d0 / (t_m * (k_m ** 2.0d0))) * ((cos(k_m) * (l ** 2.0d0)) / (sin(k_m) ** 2.0d0))
    else
        tmp = (((l * (sqrt(2.0d0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 (((Math.tan(k_m) * (Math.sin(k_m) * (Math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47) {
		tmp = (2.0 / (t_m * Math.pow(k_m, 2.0))) * ((Math.cos(k_m) * Math.pow(l, 2.0)) / Math.pow(Math.sin(k_m), 2.0));
	} else {
		tmp = Math.pow((((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_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 ((math.tan(k_m) * (math.sin(k_m) * (math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + math.pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47:
		tmp = (2.0 / (t_m * math.pow(k_m, 2.0))) * ((math.cos(k_m) * math.pow(l, 2.0)) / math.pow(math.sin(k_m), 2.0))
	else:
		tmp = math.pow((((l * (math.sqrt(2.0) / k_m)) / math.sin(k_m)) * math.sqrt((math.cos(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 (Float64(Float64(tan(k_m) * Float64(sin(k_m) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + -1.0)) <= 2e+47)
		tmp = Float64(Float64(2.0 / Float64(t_m * (k_m ^ 2.0))) * Float64(Float64(cos(k_m) * (l ^ 2.0)) / (sin(k_m) ^ 2.0)));
	else
		tmp = Float64(Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_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 (((tan(k_m) * (sin(k_m) * ((t_m ^ 3.0) / (l * l)))) * ((1.0 + ((k_m / t_m) ^ 2.0)) + -1.0)) <= 2e+47)
		tmp = (2.0 / (t_m * (k_m ^ 2.0))) * ((cos(k_m) * (l ^ 2.0)) / (sin(k_m) ^ 2.0));
	else
		tmp = (((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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[N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], 2e+47], N[(N[(2.0 / N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k$95$m], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right) \leq 2 \cdot 10^{+47}:\\
\;\;\;\;\frac{2}{t\_m \cdot {k\_m}^{2}} \cdot \frac{\cos k\_m \cdot {\ell}^{2}}{{\sin k\_m}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < 2.0000000000000001e47

    1. Initial program 84.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. Simplified87.0%

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

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

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

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

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

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

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

    if 2.0000000000000001e47 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))

    1. Initial program 15.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. Simplified24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.3% accurate, 0.4× 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}\;\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right) \leq 2 \cdot 10^{+47}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k\_m}^{2}} \cdot \frac{\cos k\_m}{t\_m \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_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 (<=
       (*
        (* (tan k_m) (* (sin k_m) (/ (pow t_m 3.0) (* l l))))
        (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) -1.0))
       2e+47)
    (*
     2.0
     (*
      (/ (pow l 2.0) (pow k_m 2.0))
      (/ (cos k_m) (* t_m (pow (sin k_m) 2.0)))))
    (pow
     (* (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m)) (sqrt (/ (cos 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 (((tan(k_m) * (sin(k_m) * (pow(t_m, 3.0) / (l * l)))) * ((1.0 + pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47) {
		tmp = 2.0 * ((pow(l, 2.0) / pow(k_m, 2.0)) * (cos(k_m) / (t_m * pow(sin(k_m), 2.0))));
	} else {
		tmp = pow((((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 (((tan(k_m) * (sin(k_m) * ((t_m ** 3.0d0) / (l * l)))) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + (-1.0d0))) <= 2d+47) then
        tmp = 2.0d0 * (((l ** 2.0d0) / (k_m ** 2.0d0)) * (cos(k_m) / (t_m * (sin(k_m) ** 2.0d0))))
    else
        tmp = (((l * (sqrt(2.0d0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 (((Math.tan(k_m) * (Math.sin(k_m) * (Math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47) {
		tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k_m, 2.0)) * (Math.cos(k_m) / (t_m * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = Math.pow((((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_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 ((math.tan(k_m) * (math.sin(k_m) * (math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + math.pow((k_m / t_m), 2.0)) + -1.0)) <= 2e+47:
		tmp = 2.0 * ((math.pow(l, 2.0) / math.pow(k_m, 2.0)) * (math.cos(k_m) / (t_m * math.pow(math.sin(k_m), 2.0))))
	else:
		tmp = math.pow((((l * (math.sqrt(2.0) / k_m)) / math.sin(k_m)) * math.sqrt((math.cos(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 (Float64(Float64(tan(k_m) * Float64(sin(k_m) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + -1.0)) <= 2e+47)
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k_m ^ 2.0)) * Float64(cos(k_m) / Float64(t_m * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64(Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_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 (((tan(k_m) * (sin(k_m) * ((t_m ^ 3.0) / (l * l)))) * ((1.0 + ((k_m / t_m) ^ 2.0)) + -1.0)) <= 2e+47)
		tmp = 2.0 * (((l ^ 2.0) / (k_m ^ 2.0)) * (cos(k_m) / (t_m * (sin(k_m) ^ 2.0))));
	else
		tmp = (((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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[N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], 2e+47], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right) \leq 2 \cdot 10^{+47}:\\
\;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k\_m}^{2}} \cdot \frac{\cos k\_m}{t\_m \cdot {\sin k\_m}^{2}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < 2.0000000000000001e47

    1. Initial program 84.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. Simplified87.0%

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

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

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

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

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

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

    if 2.0000000000000001e47 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))

    1. Initial program 15.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. Simplified24.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 82.3% accurate, 0.4× 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}\;\frac{2}{\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right)} \leq 2 \cdot 10^{-47}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \left(2 \cdot \frac{\frac{\cos k\_m}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\ell \cdot \frac{\sqrt{2}}{k\_m}}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_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 (<=
       (/
        2.0
        (*
         (* (tan k_m) (* (sin k_m) (/ (pow t_m 3.0) (* l l))))
         (+ (+ 1.0 (pow (/ k_m t_m) 2.0)) -1.0)))
       2e-47)
    (*
     (* l l)
     (* 2.0 (/ (/ (cos k_m) (pow k_m 2.0)) (* t_m (pow (sin k_m) 2.0)))))
    (pow
     (* (/ (* l (/ (sqrt 2.0) k_m)) (sin k_m)) (sqrt (/ (cos 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 ((2.0 / ((tan(k_m) * (sin(k_m) * (pow(t_m, 3.0) / (l * l)))) * ((1.0 + pow((k_m / t_m), 2.0)) + -1.0))) <= 2e-47) {
		tmp = (l * l) * (2.0 * ((cos(k_m) / pow(k_m, 2.0)) / (t_m * pow(sin(k_m), 2.0))));
	} else {
		tmp = pow((((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 ((2.0d0 / ((tan(k_m) * (sin(k_m) * ((t_m ** 3.0d0) / (l * l)))) * ((1.0d0 + ((k_m / t_m) ** 2.0d0)) + (-1.0d0)))) <= 2d-47) then
        tmp = (l * l) * (2.0d0 * ((cos(k_m) / (k_m ** 2.0d0)) / (t_m * (sin(k_m) ** 2.0d0))))
    else
        tmp = (((l * (sqrt(2.0d0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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 ((2.0 / ((Math.tan(k_m) * (Math.sin(k_m) * (Math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + Math.pow((k_m / t_m), 2.0)) + -1.0))) <= 2e-47) {
		tmp = (l * l) * (2.0 * ((Math.cos(k_m) / Math.pow(k_m, 2.0)) / (t_m * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = Math.pow((((l * (Math.sqrt(2.0) / k_m)) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_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 (2.0 / ((math.tan(k_m) * (math.sin(k_m) * (math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + math.pow((k_m / t_m), 2.0)) + -1.0))) <= 2e-47:
		tmp = (l * l) * (2.0 * ((math.cos(k_m) / math.pow(k_m, 2.0)) / (t_m * math.pow(math.sin(k_m), 2.0))))
	else:
		tmp = math.pow((((l * (math.sqrt(2.0) / k_m)) / math.sin(k_m)) * math.sqrt((math.cos(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 (Float64(2.0 / Float64(Float64(tan(k_m) * Float64(sin(k_m) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(Float64(1.0 + (Float64(k_m / t_m) ^ 2.0)) + -1.0))) <= 2e-47)
		tmp = Float64(Float64(l * l) * Float64(2.0 * Float64(Float64(cos(k_m) / (k_m ^ 2.0)) / Float64(t_m * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64(Float64(Float64(l * Float64(sqrt(2.0) / k_m)) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_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 ((2.0 / ((tan(k_m) * (sin(k_m) * ((t_m ^ 3.0) / (l * l)))) * ((1.0 + ((k_m / t_m) ^ 2.0)) + -1.0))) <= 2e-47)
		tmp = (l * l) * (2.0 * ((cos(k_m) / (k_m ^ 2.0)) / (t_m * (sin(k_m) ^ 2.0))));
	else
		tmp = (((l * (sqrt(2.0) / k_m)) / sin(k_m)) * sqrt((cos(k_m) / t_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[N[(2.0 / N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[(N[Sin[k$95$m], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-47], N[(N[(l * l), $MachinePrecision] * N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\frac{2}{\left(\tan k\_m \cdot \left(\sin k\_m \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t\_m}\right)}^{2}\right) + -1\right)} \leq 2 \cdot 10^{-47}:\\
\;\;\;\;\left(\ell \cdot \ell\right) \cdot \left(2 \cdot \frac{\frac{\cos k\_m}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{2}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < 1.9999999999999999e-47

    1. Initial program 87.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. Simplified87.2%

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

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

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

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

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

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

    if 1.9999999999999999e-47 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))))

    1. Initial program 15.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. Simplified25.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 87.3% accurate, 0.5× 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{\sqrt{2}}{k\_m}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k\_m \leq 0.054:\\ \;\;\;\;{\left(\frac{\ell \cdot t\_2}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\ \mathbf{elif}\;k\_m \leq 6.5 \cdot 10^{+149}:\\ \;\;\;\;2 \cdot \left(\frac{{\ell}^{2}}{{k\_m}^{2}} \cdot \frac{\cos k\_m}{t\_m \cdot {\sin k\_m}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt[3]{t\_2 \cdot t\_m}}{t\_m \cdot \sqrt[3]{{\ell}^{-2}}}\right)}^{3} \cdot \frac{\frac{\sqrt{2}}{\frac{k\_m}{t\_m}}}{\sin k\_m \cdot \tan k\_m}\\ \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 (/ (sqrt 2.0) k_m)))
   (*
    t_s
    (if (<= k_m 0.054)
      (pow (* (/ (* l t_2) (sin k_m)) (sqrt (/ (cos k_m) t_m))) 2.0)
      (if (<= k_m 6.5e+149)
        (*
         2.0
         (*
          (/ (pow l 2.0) (pow k_m 2.0))
          (/ (cos k_m) (* t_m (pow (sin k_m) 2.0)))))
        (*
         (pow (/ (cbrt (* t_2 t_m)) (* t_m (cbrt (pow l -2.0)))) 3.0)
         (/ (/ (sqrt 2.0) (/ k_m t_m)) (* (sin k_m) (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 t_2 = sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.054) {
		tmp = pow((((l * t_2) / sin(k_m)) * sqrt((cos(k_m) / t_m))), 2.0);
	} else if (k_m <= 6.5e+149) {
		tmp = 2.0 * ((pow(l, 2.0) / pow(k_m, 2.0)) * (cos(k_m) / (t_m * pow(sin(k_m), 2.0))));
	} else {
		tmp = pow((cbrt((t_2 * t_m)) / (t_m * cbrt(pow(l, -2.0)))), 3.0) * ((sqrt(2.0) / (k_m / t_m)) / (sin(k_m) * tan(k_m)));
	}
	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.sqrt(2.0) / k_m;
	double tmp;
	if (k_m <= 0.054) {
		tmp = Math.pow((((l * t_2) / Math.sin(k_m)) * Math.sqrt((Math.cos(k_m) / t_m))), 2.0);
	} else if (k_m <= 6.5e+149) {
		tmp = 2.0 * ((Math.pow(l, 2.0) / Math.pow(k_m, 2.0)) * (Math.cos(k_m) / (t_m * Math.pow(Math.sin(k_m), 2.0))));
	} else {
		tmp = Math.pow((Math.cbrt((t_2 * t_m)) / (t_m * Math.cbrt(Math.pow(l, -2.0)))), 3.0) * ((Math.sqrt(2.0) / (k_m / t_m)) / (Math.sin(k_m) * 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)
	t_2 = Float64(sqrt(2.0) / k_m)
	tmp = 0.0
	if (k_m <= 0.054)
		tmp = Float64(Float64(Float64(l * t_2) / sin(k_m)) * sqrt(Float64(cos(k_m) / t_m))) ^ 2.0;
	elseif (k_m <= 6.5e+149)
		tmp = Float64(2.0 * Float64(Float64((l ^ 2.0) / (k_m ^ 2.0)) * Float64(cos(k_m) / Float64(t_m * (sin(k_m) ^ 2.0)))));
	else
		tmp = Float64((Float64(cbrt(Float64(t_2 * t_m)) / Float64(t_m * cbrt((l ^ -2.0)))) ^ 3.0) * Float64(Float64(sqrt(2.0) / Float64(k_m / t_m)) / Float64(sin(k_m) * tan(k_m))));
	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_] := Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k$95$m, 0.054], N[Power[N[(N[(N[(l * t$95$2), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[k$95$m, 6.5e+149], N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Power[N[(t$95$2 * t$95$m), $MachinePrecision], 1/3], $MachinePrecision] / N[(t$95$m * N[Power[N[Power[l, -2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k$95$m], $MachinePrecision] * 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)

\\
\begin{array}{l}
t_2 := \frac{\sqrt{2}}{k\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 0.054:\\
\;\;\;\;{\left(\frac{\ell \cdot t\_2}{\sin k\_m} \cdot \sqrt{\frac{\cos k\_m}{t\_m}}\right)}^{2}\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0539999999999999994 < k < 6.50000000000000015e149

    1. Initial program 19.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. Simplified39.1%

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

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

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

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

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

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

    if 6.50000000000000015e149 < k

    1. Initial program 42.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. *-commutative42.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{2}}{\frac{k}{t}}}{{t}^{3} \cdot {\ell}^{-2}} \cdot \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{\sin k \cdot \tan k}} \]
    7. Step-by-step derivation
      1. add-cube-cbrt52.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 80.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) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 4 \cdot 10^{-47}:\\ \;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\sqrt{\frac{\cos k\_m}{t\_m}} \cdot \left(\ell \cdot \frac{\frac{\sqrt{2}}{k\_m}}{\sin k\_m}\right)\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 (<= (* l l) 4e-47)
    (pow (* (* l (sqrt 2.0)) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.0))) 2.0)
    (pow
     (* (sqrt (/ (cos k_m) t_m)) (* 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 ((l * l) <= 4e-47) {
		tmp = pow(((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0))), 2.0);
	} else {
		tmp = pow((sqrt((cos(k_m) / t_m)) * (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 ((l * l) <= 4d-47) then
        tmp = ((l * sqrt(2.0d0)) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0))) ** 2.0d0
    else
        tmp = (sqrt((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 ((l * l) <= 4e-47) {
		tmp = Math.pow(((l * Math.sqrt(2.0)) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0))), 2.0);
	} else {
		tmp = Math.pow((Math.sqrt((Math.cos(k_m) / t_m)) * (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 (l * l) <= 4e-47:
		tmp = math.pow(((l * math.sqrt(2.0)) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0))), 2.0)
	else:
		tmp = math.pow((math.sqrt((math.cos(k_m) / t_m)) * (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 (Float64(l * l) <= 4e-47)
		tmp = Float64(Float64(l * sqrt(2.0)) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = Float64(sqrt(Float64(cos(k_m) / t_m)) * Float64(l * Float64(Float64(sqrt(2.0) / 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 ((l * l) <= 4e-47)
		tmp = ((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = (sqrt((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[N[(l * l), $MachinePrecision], 4e-47], N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(l * N[(N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\ell \cdot \ell \leq 4 \cdot 10^{-47}:\\
\;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\

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


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

    1. Initial program 36.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. Simplified47.3%

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-47 < (*.f64 l l)

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.3% 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}\;\ell \cdot \ell \leq 4 \cdot 10^{-47}:\\ \;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \left(\sqrt{\frac{\cos k\_m}{t\_m}} \cdot \frac{\frac{\sqrt{2}}{k\_m}}{\sin k\_m}\right)\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 (<= (* l l) 4e-47)
    (pow (* (* l (sqrt 2.0)) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.0))) 2.0)
    (pow
     (* l (* (sqrt (/ (cos k_m) t_m)) (/ (/ (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 ((l * l) <= 4e-47) {
		tmp = pow(((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0))), 2.0);
	} else {
		tmp = pow((l * (sqrt((cos(k_m) / t_m)) * ((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 ((l * l) <= 4d-47) then
        tmp = ((l * sqrt(2.0d0)) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0))) ** 2.0d0
    else
        tmp = (l * (sqrt((cos(k_m) / t_m)) * ((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 ((l * l) <= 4e-47) {
		tmp = Math.pow(((l * Math.sqrt(2.0)) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0))), 2.0);
	} else {
		tmp = Math.pow((l * (Math.sqrt((Math.cos(k_m) / t_m)) * ((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 (l * l) <= 4e-47:
		tmp = math.pow(((l * math.sqrt(2.0)) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0))), 2.0)
	else:
		tmp = math.pow((l * (math.sqrt((math.cos(k_m) / t_m)) * ((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 (Float64(l * l) <= 4e-47)
		tmp = Float64(Float64(l * sqrt(2.0)) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = Float64(l * Float64(sqrt(Float64(cos(k_m) / t_m)) * Float64(Float64(sqrt(2.0) / 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 ((l * l) <= 4e-47)
		tmp = ((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = (l * (sqrt((cos(k_m) / t_m)) * ((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[N[(l * l), $MachinePrecision], 4e-47], N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(l * N[(N[Sqrt[N[(N[Cos[k$95$m], $MachinePrecision] / t$95$m), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / k$95$m), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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}\;\ell \cdot \ell \leq 4 \cdot 10^{-47}:\\
\;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\

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


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

    1. Initial program 36.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. Simplified47.3%

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-47 < (*.f64 l l)

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 83.5% 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 0.019:\\ \;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{t\_m \cdot \left({\sin k\_m}^{2} \cdot {k\_m}^{2}\right)}{\cos k\_m}}\\ \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 0.019)
    (pow (* (* l (sqrt 2.0)) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.0))) 2.0)
    (*
     (* l l)
     (/ 2.0 (/ (* t_m (* (pow (sin k_m) 2.0) (pow k_m 2.0))) (cos 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 (k_m <= 0.019) {
		tmp = pow(((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((t_m * (pow(sin(k_m), 2.0) * pow(k_m, 2.0))) / cos(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 (k_m <= 0.019d0) then
        tmp = ((l * sqrt(2.0d0)) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0))) ** 2.0d0
    else
        tmp = (l * l) * (2.0d0 / ((t_m * ((sin(k_m) ** 2.0d0) * (k_m ** 2.0d0))) / cos(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 (k_m <= 0.019) {
		tmp = Math.pow(((l * Math.sqrt(2.0)) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((t_m * (Math.pow(Math.sin(k_m), 2.0) * Math.pow(k_m, 2.0))) / Math.cos(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 k_m <= 0.019:
		tmp = math.pow(((l * math.sqrt(2.0)) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0))), 2.0)
	else:
		tmp = (l * l) * (2.0 / ((t_m * (math.pow(math.sin(k_m), 2.0) * math.pow(k_m, 2.0))) / math.cos(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 (k_m <= 0.019)
		tmp = Float64(Float64(l * sqrt(2.0)) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64(t_m * Float64((sin(k_m) ^ 2.0) * (k_m ^ 2.0))) / cos(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 (k_m <= 0.019)
		tmp = ((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = (l * l) * (2.0 / ((t_m * ((sin(k_m) ^ 2.0) * (k_m ^ 2.0))) / cos(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[k$95$m, 0.019], N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(t$95$m * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[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}\;k\_m \leq 0.019:\\
\;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0189999999999999995 < k

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

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

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

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

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

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

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

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

Alternative 12: 83.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 0.019:\\ \;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \left(2 \cdot \frac{\frac{\cos k\_m}{{k\_m}^{2}}}{t\_m \cdot {\sin k\_m}^{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 (<= k_m 0.019)
    (pow (* (* l (sqrt 2.0)) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.0))) 2.0)
    (*
     (* l l)
     (* 2.0 (/ (/ (cos k_m) (pow k_m 2.0)) (* t_m (pow (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 <= 0.019) {
		tmp = pow(((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0))), 2.0);
	} else {
		tmp = (l * l) * (2.0 * ((cos(k_m) / pow(k_m, 2.0)) / (t_m * pow(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 <= 0.019d0) then
        tmp = ((l * sqrt(2.0d0)) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0))) ** 2.0d0
    else
        tmp = (l * l) * (2.0d0 * ((cos(k_m) / (k_m ** 2.0d0)) / (t_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 <= 0.019) {
		tmp = Math.pow(((l * Math.sqrt(2.0)) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0))), 2.0);
	} else {
		tmp = (l * l) * (2.0 * ((Math.cos(k_m) / Math.pow(k_m, 2.0)) / (t_m * Math.pow(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 <= 0.019:
		tmp = math.pow(((l * math.sqrt(2.0)) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0))), 2.0)
	else:
		tmp = (l * l) * (2.0 * ((math.cos(k_m) / math.pow(k_m, 2.0)) / (t_m * math.pow(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 <= 0.019)
		tmp = Float64(Float64(l * sqrt(2.0)) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 * Float64(Float64(cos(k_m) / (k_m ^ 2.0)) / Float64(t_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 <= 0.019)
		tmp = ((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.0;
	else
		tmp = (l * l) * (2.0 * ((cos(k_m) / (k_m ^ 2.0)) / (t_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, 0.019], N[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $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}\;k\_m \leq 0.019:\\
\;\;\;\;{\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0189999999999999995 < k

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

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

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

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

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

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

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

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

Alternative 13: 74.5% 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 {\left(\left(\ell \cdot \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2} \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 (pow (* (* l (sqrt 2.0)) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.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) {
	return t_s * pow(((l * sqrt(2.0)) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0))), 2.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 * sqrt(2.0d0)) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0))) ** 2.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 * Math.pow(((l * Math.sqrt(2.0)) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0))), 2.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 * math.pow(((l * math.sqrt(2.0)) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0))), 2.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 * sqrt(2.0)) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.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 * sqrt(2.0)) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0))) ^ 2.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[Power[N[(N[(l * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 \sqrt{2}\right) \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 34.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. Simplified42.1%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 74.5% 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 {\left(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2} \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 (pow (* l (* (sqrt 2.0) (/ (sqrt (/ 1.0 t_m)) (pow k_m 2.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) {
	return t_s * pow((l * (sqrt(2.0) * (sqrt((1.0 / t_m)) / pow(k_m, 2.0)))), 2.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 * (sqrt(2.0d0) * (sqrt((1.0d0 / t_m)) / (k_m ** 2.0d0)))) ** 2.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 * Math.pow((l * (Math.sqrt(2.0) * (Math.sqrt((1.0 / t_m)) / Math.pow(k_m, 2.0)))), 2.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 * math.pow((l * (math.sqrt(2.0) * (math.sqrt((1.0 / t_m)) / math.pow(k_m, 2.0)))), 2.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(l * Float64(sqrt(2.0) * Float64(sqrt(Float64(1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.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 * (sqrt(2.0) * (sqrt((1.0 / t_m)) / (k_m ^ 2.0)))) ^ 2.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[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(1.0 / t$95$m), $MachinePrecision]], $MachinePrecision] / N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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(\ell \cdot \left(\sqrt{2} \cdot \frac{\sqrt{\frac{1}{t\_m}}}{{k\_m}^{2}}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 34.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. Simplified42.1%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 72.8% 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.5 \cdot 10^{-146}:\\ \;\;\;\;\ell \cdot \frac{\ell \cdot \frac{2}{t\_m}}{{k\_m}^{4}}\\ \mathbf{elif}\;t\_m \leq 1.55 \cdot 10^{+193}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \left(\frac{k\_m}{t\_m} \cdot {t\_m}^{1.5}\right)}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k\_m}^{4}}}\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 2.5e-146)
    (* l (/ (* l (/ 2.0 t_m)) (pow k_m 4.0)))
    (if (<= t_m 1.55e+193)
      (pow (* l (/ (sqrt 2.0) (* k_m (* (/ k_m t_m) (pow t_m 1.5))))) 2.0)
      (pow (* l (sqrt (/ 2.0 (* t_m (pow k_m 4.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 <= 2.5e-146) {
		tmp = l * ((l * (2.0 / t_m)) / pow(k_m, 4.0));
	} else if (t_m <= 1.55e+193) {
		tmp = pow((l * (sqrt(2.0) / (k_m * ((k_m / t_m) * pow(t_m, 1.5))))), 2.0);
	} else {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k_m, 4.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 <= 2.5d-146) then
        tmp = l * ((l * (2.0d0 / t_m)) / (k_m ** 4.0d0))
    else if (t_m <= 1.55d+193) then
        tmp = (l * (sqrt(2.0d0) / (k_m * ((k_m / t_m) * (t_m ** 1.5d0))))) ** 2.0d0
    else
        tmp = (l * sqrt((2.0d0 / (t_m * (k_m ** 4.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 <= 2.5e-146) {
		tmp = l * ((l * (2.0 / t_m)) / Math.pow(k_m, 4.0));
	} else if (t_m <= 1.55e+193) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k_m * ((k_m / t_m) * Math.pow(t_m, 1.5))))), 2.0);
	} else {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k_m, 4.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 <= 2.5e-146:
		tmp = l * ((l * (2.0 / t_m)) / math.pow(k_m, 4.0))
	elif t_m <= 1.55e+193:
		tmp = math.pow((l * (math.sqrt(2.0) / (k_m * ((k_m / t_m) * math.pow(t_m, 1.5))))), 2.0)
	else:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k_m, 4.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 <= 2.5e-146)
		tmp = Float64(l * Float64(Float64(l * Float64(2.0 / t_m)) / (k_m ^ 4.0)));
	elseif (t_m <= 1.55e+193)
		tmp = Float64(l * Float64(sqrt(2.0) / Float64(k_m * Float64(Float64(k_m / t_m) * (t_m ^ 1.5))))) ^ 2.0;
	else
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k_m ^ 4.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 <= 2.5e-146)
		tmp = l * ((l * (2.0 / t_m)) / (k_m ^ 4.0));
	elseif (t_m <= 1.55e+193)
		tmp = (l * (sqrt(2.0) / (k_m * ((k_m / t_m) * (t_m ^ 1.5))))) ^ 2.0;
	else
		tmp = (l * sqrt((2.0 / (t_m * (k_m ^ 4.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, 2.5e-146], N[(l * N[(N[(l * N[(2.0 / t$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.55e+193], N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[(N[(k$95$m / t$95$m), $MachinePrecision] * N[Power[t$95$m, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $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.5 \cdot 10^{-146}:\\
\;\;\;\;\ell \cdot \frac{\ell \cdot \frac{2}{t\_m}}{{k\_m}^{4}}\\

\mathbf{elif}\;t\_m \leq 1.55 \cdot 10^{+193}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \left(\frac{k\_m}{t\_m} \cdot {t\_m}^{1.5}\right)}\right)}^{2}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.49999999999999979e-146 < t < 1.54999999999999993e193

    1. Initial program 51.9%

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

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

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

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

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

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

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

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

    if 1.54999999999999993e193 < t

    1. Initial program 10.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. Simplified31.3%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{{k}^{4}}}{t} \cdot \color{blue}{{\ell}^{2}} \]
      3. rem-cbrt-cube66.6%

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

        \[\leadsto \color{blue}{{\left({\left(\frac{\frac{2}{{k}^{4}}}{t} \cdot {\ell}^{2}\right)}^{3}\right)}^{0.3333333333333333}} \]
      5. add-sqr-sqrt66.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 71.3% 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}\;\ell \cdot \ell \leq 10^{-310}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \left(\frac{k\_m}{t\_m} \cdot {t\_m}^{1.5}\right)}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell \cdot \ell\right) \cdot \frac{2}{\frac{{k\_m}^{2} \cdot \left(t\_m \cdot {k\_m}^{2}\right)}{\cos k\_m}}\\ \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 (<= (* l l) 1e-310)
    (pow (* l (/ (sqrt 2.0) (* k_m (* (/ k_m t_m) (pow t_m 1.5))))) 2.0)
    (*
     (* l l)
     (/ 2.0 (/ (* (pow k_m 2.0) (* t_m (pow k_m 2.0))) (cos 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 ((l * l) <= 1e-310) {
		tmp = pow((l * (sqrt(2.0) / (k_m * ((k_m / t_m) * pow(t_m, 1.5))))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((pow(k_m, 2.0) * (t_m * pow(k_m, 2.0))) / cos(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 ((l * l) <= 1d-310) then
        tmp = (l * (sqrt(2.0d0) / (k_m * ((k_m / t_m) * (t_m ** 1.5d0))))) ** 2.0d0
    else
        tmp = (l * l) * (2.0d0 / (((k_m ** 2.0d0) * (t_m * (k_m ** 2.0d0))) / cos(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 ((l * l) <= 1e-310) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k_m * ((k_m / t_m) * Math.pow(t_m, 1.5))))), 2.0);
	} else {
		tmp = (l * l) * (2.0 / ((Math.pow(k_m, 2.0) * (t_m * Math.pow(k_m, 2.0))) / Math.cos(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 (l * l) <= 1e-310:
		tmp = math.pow((l * (math.sqrt(2.0) / (k_m * ((k_m / t_m) * math.pow(t_m, 1.5))))), 2.0)
	else:
		tmp = (l * l) * (2.0 / ((math.pow(k_m, 2.0) * (t_m * math.pow(k_m, 2.0))) / math.cos(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 (Float64(l * l) <= 1e-310)
		tmp = Float64(l * Float64(sqrt(2.0) / Float64(k_m * Float64(Float64(k_m / t_m) * (t_m ^ 1.5))))) ^ 2.0;
	else
		tmp = Float64(Float64(l * l) * Float64(2.0 / Float64(Float64((k_m ^ 2.0) * Float64(t_m * (k_m ^ 2.0))) / cos(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 ((l * l) <= 1e-310)
		tmp = (l * (sqrt(2.0) / (k_m * ((k_m / t_m) * (t_m ^ 1.5))))) ^ 2.0;
	else
		tmp = (l * l) * (2.0 / (((k_m ^ 2.0) * (t_m * (k_m ^ 2.0))) / cos(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[N[(l * l), $MachinePrecision], 1e-310], N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k$95$m * N[(N[(k$95$m / t$95$m), $MachinePrecision] * N[Power[t$95$m, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[(N[(N[Power[k$95$m, 2.0], $MachinePrecision] * N[(t$95$m * N[Power[k$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[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}\;\ell \cdot \ell \leq 10^{-310}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k\_m \cdot \left(\frac{k\_m}{t\_m} \cdot {t\_m}^{1.5}\right)}\right)}^{2}\\

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


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

    1. Initial program 32.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. Simplified42.9%

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

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

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

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

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

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

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

    if 9.999999999999969e-311 < (*.f64 l l)

    1. Initial program 35.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. Simplified41.9%

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

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

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

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

Alternative 17: 69.7% 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(\ell \cdot \left(2 \cdot \frac{\frac{\ell}{{k\_m}^{4}}}{t\_m}\right)\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 (* 2.0 (/ (/ l (pow k_m 4.0)) t_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) {
	return t_s * (l * (2.0 * ((l / pow(k_m, 4.0)) / t_m)));
}
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 * (2.0d0 * ((l / (k_m ** 4.0d0)) / t_m)))
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 * (2.0 * ((l / Math.pow(k_m, 4.0)) / t_m)));
}
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 * (2.0 * ((l / math.pow(k_m, 4.0)) / t_m)))
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(l * Float64(2.0 * Float64(Float64(l / (k_m ^ 4.0)) / t_m))))
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 * (2.0 * ((l / (k_m ^ 4.0)) / t_m)));
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[(l * N[(2.0 * N[(N[(l / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $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(\ell \cdot \left(2 \cdot \frac{\frac{\ell}{{k\_m}^{4}}}{t\_m}\right)\right)
\end{array}
Derivation
  1. Initial program 34.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. Simplified42.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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