Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.7% → 87.3%
Time: 23.8s
Alternatives: 18
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 18 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.7% 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: 87.3% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 35.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. Simplified44.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. Taylor expanded in k around 0 65.7%

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

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

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

      \[\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. div-inv66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999999e-132 < l < 4.59999999999999991e159

    1. Initial program 44.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. *-commutative44.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*45.1%

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

      \[\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. associate-/r*56.1%

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

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

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

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

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

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

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

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

    if 4.59999999999999991e159 < l

    1. Initial program 18.4%

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

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

        \[\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. Simplified18.4%

      \[\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-sqrt18.4%

        \[\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-cbrt18.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-frac18.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-rr78.0%

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

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

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

      \[\leadsto \frac{\frac{\sqrt{2}}{\frac{k}{t}}}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \color{blue}{\left(\sqrt[3]{\tan k} \cdot \sqrt[3]{\sin k}\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 3 regimes into one program.
  4. Final simplification57.7%

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

Alternative 2: 87.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;l\_m \leq 4.6 \cdot 10^{+159}:\\
\;\;\;\;2 \cdot \frac{\frac{\cos k \cdot {l\_m}^{2}}{{k}^{2}}}{t\_m \cdot {\sin k}^{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 3 regimes
  2. if l < 5.0000000000000002e-135

    1. Initial program 35.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. Simplified44.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. Taylor expanded in k around 0 65.7%

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

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

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

      \[\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. div-inv66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-135 < l < 4.59999999999999991e159

    1. Initial program 44.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. *-commutative44.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*45.1%

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

      \[\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. associate-/r*56.1%

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

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

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

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

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

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

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

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

    if 4.59999999999999991e159 < l

    1. Initial program 18.4%

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

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

        \[\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. Simplified18.4%

      \[\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-sqrt18.4%

        \[\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-cbrt18.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-frac18.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-rr78.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 5 \cdot 10^{-135}:\\ \;\;\;\;{\left(\ell \cdot \left(\sqrt{\frac{2}{t}} \cdot {k}^{-2}\right)\right)}^{2}\\ \mathbf{elif}\;\ell \leq 4.6 \cdot 10^{+159}:\\ \;\;\;\;2 \cdot \frac{\frac{\cos k \cdot {\ell}^{2}}{{k}^{2}}}{t \cdot {\sin k}^{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 3: 87.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 35.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. Simplified44.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. Taylor expanded in k around 0 65.7%

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

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

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

      \[\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. div-inv66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.19999999999999994e-129 < l < 4.59999999999999991e159

    1. Initial program 44.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. *-commutative44.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*45.1%

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

      \[\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. associate-/r*56.1%

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

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

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

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

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

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

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

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

    if 4.59999999999999991e159 < l

    1. Initial program 18.4%

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

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

        \[\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. Simplified18.4%

      \[\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-sqrt18.4%

        \[\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-cbrt18.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-frac18.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-rr78.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\frac{\sqrt{2}}{k} \cdot t\right) \cdot {\left(\sqrt[3]{\sin k \cdot \tan k} \cdot \left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)\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}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

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

Alternative 4: 79.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 36.9%

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

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

        \[\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. Simplified43.0%

      \[\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. associate-/r*46.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{\cos k \cdot {\ell}^{2}}{{k}^{2}}}{{\sin k}^{2} \cdot t}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt42.2%

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

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

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

    if 1.2200000000000001e-68 < k

    1. Initial program 29.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. *-commutative29.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*30.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. Simplified39.3%

      \[\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. associate-/r*42.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 36.9%

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

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

        \[\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. Simplified43.0%

      \[\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. associate-/r*46.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{\cos k \cdot {\ell}^{2}}{{k}^{2}}}{{\sin k}^{2} \cdot t}} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt42.2%

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

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

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

    if 1.2200000000000001e-68 < k

    1. Initial program 29.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. Simplified44.6%

      \[\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-log-exp28.5%

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

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative25.0%

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

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

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

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

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

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

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

Alternative 6: 79.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 37.1%

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

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

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

      \[\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. associate-/r*46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000001e-59 < k

    1. Initial program 29.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. Simplified44.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-log-exp27.9%

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod24.3%

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

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

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

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

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

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

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

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

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

Alternative 7: 82.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 35.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. Simplified44.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. Taylor expanded in k around 0 65.7%

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

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

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

      \[\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. div-inv66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e-132 < l

    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. Simplified41.6%

      \[\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-log-exp17.2%

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod28.7%

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative28.7%

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

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

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

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

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

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

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

Alternative 8: 77.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 36.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. Simplified43.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. Taylor expanded in k around 0 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999999e-6 < k

    1. Initial program 30.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. Simplified42.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-log-exp34.1%

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod24.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 76.9% accurate, 1.3× speedup?

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

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

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


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

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

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

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

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

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

      \[\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. div-inv63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2200000000000001e-68 < k

    1. Initial program 29.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. Simplified44.6%

      \[\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-log-exp28.5%

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

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative25.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.9% accurate, 1.3× speedup?

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

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

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


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

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

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

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

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

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

      \[\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. div-inv63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2200000000000001e-68 < k

    1. Initial program 29.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. Simplified44.6%

      \[\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-log-exp28.5%

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

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative25.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 76.8% accurate, 1.3× speedup?

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

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

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


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

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

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

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

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

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

      \[\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. div-inv63.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2200000000000001e-68 < k

    1. Initial program 29.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. Simplified44.6%

      \[\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-log-exp28.5%

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

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative25.0%

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

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

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

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

Alternative 12: 75.6% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(l\_m \cdot l\_m\right) \cdot \frac{2}{\left(\sin k \cdot \tan k\right) \cdot 0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 8.80000000000000027e151

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.80000000000000027e151 < l

    1. Initial program 18.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. Simplified18.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. Step-by-step derivation
      1. add-log-exp4.3%

        \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
      2. exp-prod24.5%

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

        \[\leadsto \frac{2}{\log \left({\left(e^{{t}^{3}}\right)}^{\color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}\right)}}\right)} \cdot \left(\ell \cdot \ell\right) \]
      4. *-commutative24.5%

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

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

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

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

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

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

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

Alternative 13: 73.4% accurate, 1.4× speedup?

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

\\
t\_s \cdot {\left(l\_m \cdot \left(\sqrt{\frac{2}{t\_m}} \cdot {k}^{-2}\right)\right)}^{2}
\end{array}
Derivation
  1. Initial program 34.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 64.2% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{\frac{2}{{k}^{2}}}{t\_m \cdot {k}^{2}}\right)
\end{array}
Derivation
  1. Initial program 34.9%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Simplified43.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. Step-by-step derivation
    1. add-log-exp22.6%

      \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    2. exp-prod28.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 64.2% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{2}{{k}^{2} \cdot \left(t\_m \cdot {k}^{2}\right)}\right)
\end{array}
Derivation
  1. Initial program 34.9%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Simplified43.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. Step-by-step derivation
    1. add-log-exp22.6%

      \[\leadsto \frac{2}{\color{blue}{\log \left(e^{{t}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\left(\frac{k}{t}\right)}^{2}\right)\right)}\right)}} \cdot \left(\ell \cdot \ell\right) \]
    2. exp-prod28.3%

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

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

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

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

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

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

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

Alternative 16: 62.5% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{\frac{2}{t\_m}}{{k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 34.9%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 62.6% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \left(\frac{2}{t\_m} \cdot {k}^{-4}\right)\right)
\end{array}
Derivation
  1. Initial program 34.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 62.5% accurate, 3.8× speedup?

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

\\
t\_s \cdot \left(\left(l\_m \cdot l\_m\right) \cdot \frac{2}{t\_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 34.9%

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

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

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

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

Reproduce

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