Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.6% → 86.2%
Time: 20.3s
Alternatives: 29
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 29 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: 54.6% accurate, 1.0× speedup?

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

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

Alternative 1: 86.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 50.2%

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

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

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{\cos k \cdot {\ell}^{2}}{\color{blue}{{\sin k}^{2} \cdot t}} \]
      5. times-frac63.8%

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

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

    if 3.1999999999999998e-125 < t

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 82.6% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_m \leq 820000000:\\
\;\;\;\;t\_2 \cdot \left(\frac{\frac{2}{\tan k}}{\sin k \cdot {t\_m}^{3}} \cdot t\_2\right)\\

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


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

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

    if 1.2000000000000001e-114 < t < 8.2e8

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2e8 < t

    1. Initial program 73.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. Simplified73.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.2% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 50.2%

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

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

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{\cos k \cdot {\ell}^{2}}{\color{blue}{{\sin k}^{2} \cdot t}} \]
      5. times-frac63.8%

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

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

    if 4.3000000000000002e-125 < t

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.2% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 50.2%

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

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

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

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

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

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

        \[\leadsto \frac{2}{{k}^{2}} \cdot \frac{\cos k \cdot {\ell}^{2}}{\color{blue}{{\sin k}^{2} \cdot t}} \]
      5. times-frac63.8%

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

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

    if 4.2500000000000001e-125 < t

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 59.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. Simplified57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.043999999999999997 < k

    1. Initial program 50.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. Simplified49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_m \leq 9.5 \cdot 10^{+174}:\\
\;\;\;\;{\left(\sqrt[3]{\frac{2}{\tan k}} \cdot \frac{\sqrt[3]{\frac{\ell}{\sin k}}}{t\_m}\right)}^{3} \cdot \frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\

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


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

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

    if 2.1e-88 < t < 9.4999999999999992e174

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999992e174 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{+102}:\\
\;\;\;\;2 \cdot \frac{\frac{\ell \cdot \frac{\frac{\ell}{\sin k}}{{t\_m}^{3}}}{t\_2}}{\tan k}\\

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

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

    if 2e-79 < t < 5.60000000000000037e102

    1. Initial program 89.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. Simplified86.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000037e102 < t

    1. Initial program 65.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. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.7% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t\_m \leq 1.52 \cdot 10^{+137}:\\
\;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \left(\frac{2}{\tan k} \cdot {\left(\frac{\sqrt[3]{\frac{\ell}{\sin k}}}{t\_m}\right)}^{3}\right)\\

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


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

    1. Initial program 51.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. Simplified51.3%

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

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

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

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

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

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

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

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

    if 7.5000000000000002e-87 < t < 1.52000000000000006e137

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.52000000000000006e137 < t

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e-80 < t < 5.60000000000000037e102

    1. Initial program 89.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. Simplified86.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000037e102 < t

    1. Initial program 65.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. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.11999999999999996e-79 < t < 5.60000000000000037e102

    1. Initial program 89.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. Simplified86.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.60000000000000037e102 < t

    1. Initial program 65.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. Simplified65.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 43.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0999999999999999e-151 < k < 12

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 12 < k

    1. Initial program 50.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. Simplified49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 43.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15000000000000009e-151 < k < 0.0018500000000000001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0018500000000000001 < k

    1. Initial program 50.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. Simplified49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 65.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{2}{\tan k}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.02 \cdot 10^{-162}:\\
\;\;\;\;t\_2 \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t\_m}^{3}}\right)\\

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

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


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

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.01999999999999998e-162 < k < 0.0179999999999999986

    1. Initial program 61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0179999999999999986 < k

    1. Initial program 50.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. Simplified49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 65.2% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+101}:\\
\;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t\_m}^{3}}\right)\\

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


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

    1. Initial program 50.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

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

    if 1.2000000000000001e-114 < t < 1.05e101

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e101 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 65.2% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+101}:\\
\;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t\_m}^{3}}\right)\\

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


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

    1. Initial program 50.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

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

    if 1.2000000000000001e-114 < t < 1.05e101

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e101 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 1.05 \cdot 10^{+101}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t}^{3}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(t \cdot {\left(\sqrt[3]{\ell}\right)}^{-2}\right)}^{3} \cdot \left(2 \cdot {k}^{2}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 43.1% accurate, 1.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 0.7:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot \left(t\_m \cdot \sin k\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= k 0.7)
    (/ 2.0 (* (* 2.0 k) (pow (* (/ (pow t_m 1.5) l) (sqrt (sin k))) 2.0)))
    (* (/ 2.0 (tan k)) (/ (pow l 2.0) (* (pow k 2.0) (* t_m (sin k))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (k <= 0.7) {
		tmp = 2.0 / ((2.0 * k) * pow(((pow(t_m, 1.5) / l) * sqrt(sin(k))), 2.0));
	} else {
		tmp = (2.0 / tan(k)) * (pow(l, 2.0) / (pow(k, 2.0) * (t_m * sin(k))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 0.7d0) then
        tmp = 2.0d0 / ((2.0d0 * k) * ((((t_m ** 1.5d0) / l) * sqrt(sin(k))) ** 2.0d0))
    else
        tmp = (2.0d0 / tan(k)) * ((l ** 2.0d0) / ((k ** 2.0d0) * (t_m * sin(k))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (k <= 0.7) {
		tmp = 2.0 / ((2.0 * k) * Math.pow(((Math.pow(t_m, 1.5) / l) * Math.sqrt(Math.sin(k))), 2.0));
	} else {
		tmp = (2.0 / Math.tan(k)) * (Math.pow(l, 2.0) / (Math.pow(k, 2.0) * (t_m * Math.sin(k))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if k <= 0.7:
		tmp = 2.0 / ((2.0 * k) * math.pow(((math.pow(t_m, 1.5) / l) * math.sqrt(math.sin(k))), 2.0))
	else:
		tmp = (2.0 / math.tan(k)) * (math.pow(l, 2.0) / (math.pow(k, 2.0) * (t_m * math.sin(k))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (k <= 0.7)
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * (Float64(Float64((t_m ^ 1.5) / l) * sqrt(sin(k))) ^ 2.0)));
	else
		tmp = Float64(Float64(2.0 / tan(k)) * Float64((l ^ 2.0) / Float64((k ^ 2.0) * Float64(t_m * sin(k)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (k <= 0.7)
		tmp = 2.0 / ((2.0 * k) * ((((t_m ^ 1.5) / l) * sqrt(sin(k))) ^ 2.0));
	else
		tmp = (2.0 / tan(k)) * ((l ^ 2.0) / ((k ^ 2.0) * (t_m * sin(k))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.7], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[Power[N[(N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision] * N[Sqrt[N[Sin[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.7:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\tan k} \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot \left(t\_m \cdot \sin k\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 0.69999999999999996

    1. Initial program 59.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. Simplified59.6%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. add-sqr-sqrt29.6%

        \[\leadsto \frac{2}{\color{blue}{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k} \cdot \sqrt{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}\right)} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      2. pow229.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}\right)}^{2}} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      3. *-commutative29.6%

        \[\leadsto \frac{2}{{\left(\sqrt{\color{blue}{\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      4. sqrt-prod14.0%

        \[\leadsto \frac{2}{{\color{blue}{\left(\sqrt{\sin k} \cdot \sqrt{\frac{{t}^{3}}{\ell \cdot \ell}}\right)}}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      5. sqrt-div14.0%

        \[\leadsto \frac{2}{{\left(\sqrt{\sin k} \cdot \color{blue}{\frac{\sqrt{{t}^{3}}}{\sqrt{\ell \cdot \ell}}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      6. sqrt-pow115.5%

        \[\leadsto \frac{2}{{\left(\sqrt{\sin k} \cdot \frac{\color{blue}{{t}^{\left(\frac{3}{2}\right)}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      7. metadata-eval15.5%

        \[\leadsto \frac{2}{{\left(\sqrt{\sin k} \cdot \frac{{t}^{\color{blue}{1.5}}}{\sqrt{\ell \cdot \ell}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      8. sqrt-prod9.8%

        \[\leadsto \frac{2}{{\left(\sqrt{\sin k} \cdot \frac{{t}^{1.5}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{\ell}}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
      9. add-sqr-sqrt17.5%

        \[\leadsto \frac{2}{{\left(\sqrt{\sin k} \cdot \frac{{t}^{1.5}}{\color{blue}{\ell}}\right)}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
    5. Applied egg-rr17.5%

      \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\sin k} \cdot \frac{{t}^{1.5}}{\ell}\right)}^{2}} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative17.5%

        \[\leadsto \frac{2}{{\color{blue}{\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}}^{2} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
    7. Simplified17.5%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2}} \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)} \]
    8. Taylor expanded in k around 0 16.1%

      \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2} \cdot \color{blue}{\left(2 \cdot k\right)}} \]
    9. Step-by-step derivation
      1. *-commutative76.3%

        \[\leadsto \frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \color{blue}{\left(k \cdot 2\right)}} \]
    10. Simplified16.1%

      \[\leadsto \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2} \cdot \color{blue}{\left(k \cdot 2\right)}} \]

    if 0.69999999999999996 < k

    1. Initial program 50.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. Simplified49.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*52.5%

        \[\leadsto \frac{\color{blue}{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. *-un-lft-identity52.5%

        \[\leadsto \frac{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}{\color{blue}{1 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}} \]
      3. times-frac55.8%

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      4. associate-/l/55.8%

        \[\leadsto \frac{\color{blue}{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Applied egg-rr55.8%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity55.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. associate-*l/55.8%

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      3. *-commutative55.8%

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      4. times-frac55.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{{t}^{3} \cdot \sin k}\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      5. *-commutative55.8%

        \[\leadsto \left(\frac{2}{\tan k} \cdot \frac{\ell}{\color{blue}{\sin k \cdot {t}^{3}}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    7. Simplified55.8%

      \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. associate-*r/52.5%

        \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    9. Applied egg-rr52.5%

      \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    10. Step-by-step derivation
      1. associate-/l*55.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      2. associate-*r*55.8%

        \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{\sin k \cdot {t}^{3}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
      3. *-commutative55.8%

        \[\leadsto \frac{2}{\tan k} \cdot \left(\frac{\ell}{\color{blue}{{t}^{3} \cdot \sin k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
    11. Simplified55.8%

      \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{{t}^{3} \cdot \sin k} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
    12. Taylor expanded in t around 0 74.3%

      \[\leadsto \frac{2}{\tan k} \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot \left(t \cdot \sin k\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.7:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot \left(t \cdot \sin k\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 65.2% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t\_m}^{3}}\right)\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.2e-114)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (*
     (/ 2.0 (tan k))
     (* (/ l (+ 2.0 (pow (/ k t_m) 2.0))) (/ (/ l k) (pow t_m 3.0)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else {
		tmp = (2.0 / tan(k)) * ((l / (2.0 + pow((k / t_m), 2.0))) * ((l / k) / pow(t_m, 3.0)));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 1.2d-114) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else
        tmp = (2.0d0 / tan(k)) * ((l / (2.0d0 + ((k / t_m) ** 2.0d0))) * ((l / k) / (t_m ** 3.0d0)))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else {
		tmp = (2.0 / Math.tan(k)) * ((l / (2.0 + Math.pow((k / t_m), 2.0))) * ((l / k) / Math.pow(t_m, 3.0)));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 1.2e-114:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	else:
		tmp = (2.0 / math.tan(k)) * ((l / (2.0 + math.pow((k / t_m), 2.0))) * ((l / k) / math.pow(t_m, 3.0)))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.2e-114)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	else
		tmp = Float64(Float64(2.0 / tan(k)) * Float64(Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(Float64(l / k) / (t_m ^ 3.0))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 1.2e-114)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	else
		tmp = (2.0 / tan(k)) * ((l / (2.0 + ((k / t_m) ^ 2.0))) * ((l / k) / (t_m ^ 3.0)));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.2e-114], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t\_m}^{3}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.2000000000000001e-114

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 1.2000000000000001e-114 < t

    1. Initial program 77.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. Simplified75.7%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*78.8%

        \[\leadsto \frac{\color{blue}{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. *-un-lft-identity78.8%

        \[\leadsto \frac{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}{\color{blue}{1 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}} \]
      3. times-frac78.8%

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      4. associate-/l/78.8%

        \[\leadsto \frac{\color{blue}{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity78.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. associate-*l/78.8%

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      3. *-commutative78.8%

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      4. times-frac78.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{{t}^{3} \cdot \sin k}\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      5. *-commutative78.8%

        \[\leadsto \left(\frac{2}{\tan k} \cdot \frac{\ell}{\color{blue}{\sin k \cdot {t}^{3}}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    7. Simplified78.8%

      \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. associate-*r/78.8%

        \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    9. Applied egg-rr78.8%

      \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    10. Step-by-step derivation
      1. associate-/l*78.8%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      2. associate-*r*80.2%

        \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{\sin k \cdot {t}^{3}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
      3. *-commutative80.2%

        \[\leadsto \frac{2}{\tan k} \cdot \left(\frac{\ell}{\color{blue}{{t}^{3} \cdot \sin k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
    11. Simplified80.2%

      \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{{t}^{3} \cdot \sin k} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
    12. Taylor expanded in k around 0 71.4%

      \[\leadsto \frac{2}{\tan k} \cdot \left(\color{blue}{\frac{\ell}{k \cdot {t}^{3}}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
    13. Step-by-step derivation
      1. associate-/r*72.6%

        \[\leadsto \frac{2}{\tan k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{{t}^{3}}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
    14. Simplified72.6%

      \[\leadsto \frac{2}{\tan k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{{t}^{3}}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \left(\frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \cdot \frac{\frac{\ell}{k}}{{t}^{3}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 64.3% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \left(\frac{2}{k} \cdot \frac{\ell}{\sin k \cdot {t\_m}^{3}}\right)\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.3e-14)
    (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t_m (pow k 4.0))))
    (*
     (/ l (+ 2.0 (pow (/ k t_m) 2.0)))
     (* (/ 2.0 k) (/ l (* (sin k) (pow t_m 3.0))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (t_m * pow(k, 4.0)));
	} else {
		tmp = (l / (2.0 + pow((k / t_m), 2.0))) * ((2.0 / k) * (l / (sin(k) * pow(t_m, 3.0))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 2.3d-14) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / (t_m * (k ** 4.0d0)))
    else
        tmp = (l / (2.0d0 + ((k / t_m) ** 2.0d0))) * ((2.0d0 / k) * (l / (sin(k) * (t_m ** 3.0d0))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t_m * Math.pow(k, 4.0)));
	} else {
		tmp = (l / (2.0 + Math.pow((k / t_m), 2.0))) * ((2.0 / k) * (l / (Math.sin(k) * Math.pow(t_m, 3.0))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 2.3e-14:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t_m * math.pow(k, 4.0)))
	else:
		tmp = (l / (2.0 + math.pow((k / t_m), 2.0))) * ((2.0 / k) * (l / (math.sin(k) * math.pow(t_m, 3.0))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 2.3e-14)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t_m * (k ^ 4.0))));
	else
		tmp = Float64(Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(Float64(2.0 / k) * Float64(l / Float64(sin(k) * (t_m ^ 3.0)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 2.3e-14)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t_m * (k ^ 4.0)));
	else
		tmp = (l / (2.0 + ((k / t_m) ^ 2.0))) * ((2.0 / k) * (l / (sin(k) * (t_m ^ 3.0))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-14], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 / k), $MachinePrecision] * N[(l / N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \left(\frac{2}{k} \cdot \frac{\ell}{\sin k \cdot {t\_m}^{3}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.29999999999999998e-14

    1. Initial program 52.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified52.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 63.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 54.6%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]

    if 2.29999999999999998e-14 < t

    1. Initial program 75.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified75.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*79.6%

        \[\leadsto \frac{\color{blue}{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. *-un-lft-identity79.6%

        \[\leadsto \frac{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}{\color{blue}{1 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}} \]
      3. times-frac79.6%

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      4. associate-/l/79.6%

        \[\leadsto \frac{\color{blue}{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Applied egg-rr79.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity79.6%

        \[\leadsto \color{blue}{\left(\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. associate-*l/79.7%

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      3. *-commutative79.7%

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      4. times-frac79.7%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{{t}^{3} \cdot \sin k}\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      5. *-commutative79.7%

        \[\leadsto \left(\frac{2}{\tan k} \cdot \frac{\ell}{\color{blue}{\sin k \cdot {t}^{3}}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    7. Simplified79.7%

      \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    8. Taylor expanded in k around 0 71.4%

      \[\leadsto \left(\frac{2}{\color{blue}{k}} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \cdot \left(\frac{2}{k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 61.2% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \left(0.5 \cdot \frac{{\ell}^{2}}{k \cdot {t\_m}^{3}}\right)\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.3e-14)
    (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t_m (pow k 4.0))))
    (* (/ 2.0 (tan k)) (* 0.5 (/ (pow l 2.0) (* k (pow t_m 3.0))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (t_m * pow(k, 4.0)));
	} else {
		tmp = (2.0 / tan(k)) * (0.5 * (pow(l, 2.0) / (k * pow(t_m, 3.0))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 2.3d-14) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / (t_m * (k ** 4.0d0)))
    else
        tmp = (2.0d0 / tan(k)) * (0.5d0 * ((l ** 2.0d0) / (k * (t_m ** 3.0d0))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t_m * Math.pow(k, 4.0)));
	} else {
		tmp = (2.0 / Math.tan(k)) * (0.5 * (Math.pow(l, 2.0) / (k * Math.pow(t_m, 3.0))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 2.3e-14:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t_m * math.pow(k, 4.0)))
	else:
		tmp = (2.0 / math.tan(k)) * (0.5 * (math.pow(l, 2.0) / (k * math.pow(t_m, 3.0))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 2.3e-14)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t_m * (k ^ 4.0))));
	else
		tmp = Float64(Float64(2.0 / tan(k)) * Float64(0.5 * Float64((l ^ 2.0) / Float64(k * (t_m ^ 3.0)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 2.3e-14)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t_m * (k ^ 4.0)));
	else
		tmp = (2.0 / tan(k)) * (0.5 * ((l ^ 2.0) / (k * (t_m ^ 3.0))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-14], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(0.5 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\tan k} \cdot \left(0.5 \cdot \frac{{\ell}^{2}}{k \cdot {t\_m}^{3}}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.29999999999999998e-14

    1. Initial program 52.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified52.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 63.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 54.6%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]

    if 2.29999999999999998e-14 < t

    1. Initial program 75.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified75.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*79.6%

        \[\leadsto \frac{\color{blue}{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. *-un-lft-identity79.6%

        \[\leadsto \frac{\left(\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell\right) \cdot \ell}{\color{blue}{1 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}} \]
      3. times-frac79.6%

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      4. associate-/l/79.6%

        \[\leadsto \frac{\color{blue}{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Applied egg-rr79.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell}{1} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    6. Step-by-step derivation
      1. /-rgt-identity79.6%

        \[\leadsto \color{blue}{\left(\frac{2}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k} \cdot \ell\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. associate-*l/79.7%

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{\left({t}^{3} \cdot \sin k\right) \cdot \tan k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      3. *-commutative79.7%

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      4. times-frac79.7%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{{t}^{3} \cdot \sin k}\right)} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      5. *-commutative79.7%

        \[\leadsto \left(\frac{2}{\tan k} \cdot \frac{\ell}{\color{blue}{\sin k \cdot {t}^{3}}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    7. Simplified79.7%

      \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    8. Step-by-step derivation
      1. associate-*r/79.7%

        \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    9. Applied egg-rr79.7%

      \[\leadsto \color{blue}{\frac{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    10. Step-by-step derivation
      1. associate-/l*79.7%

        \[\leadsto \color{blue}{\left(\frac{2}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t}^{3}}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
      2. associate-*r*81.4%

        \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{\sin k \cdot {t}^{3}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
      3. *-commutative81.4%

        \[\leadsto \frac{2}{\tan k} \cdot \left(\frac{\ell}{\color{blue}{{t}^{3} \cdot \sin k}} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right) \]
    11. Simplified81.4%

      \[\leadsto \color{blue}{\frac{2}{\tan k} \cdot \left(\frac{\ell}{{t}^{3} \cdot \sin k} \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\right)} \]
    12. Taylor expanded in k around 0 70.9%

      \[\leadsto \frac{2}{\tan k} \cdot \color{blue}{\left(0.5 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\tan k} \cdot \left(0.5 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 61.2% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{k \cdot {t\_m}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.3e-14)
    (* 2.0 (/ (* (cos k) (pow l 2.0)) (* t_m (pow k 4.0))))
    (/
     (* (/ (/ 2.0 k) (* k (pow t_m 3.0))) (* l l))
     (+ 2.0 (pow (/ k t_m) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (t_m * pow(k, 4.0)));
	} else {
		tmp = (((2.0 / k) / (k * pow(t_m, 3.0))) * (l * l)) / (2.0 + pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 2.3d-14) then
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / (t_m * (k ** 4.0d0)))
    else
        tmp = (((2.0d0 / k) / (k * (t_m ** 3.0d0))) * (l * l)) / (2.0d0 + ((k / t_m) ** 2.0d0))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.3e-14) {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (t_m * Math.pow(k, 4.0)));
	} else {
		tmp = (((2.0 / k) / (k * Math.pow(t_m, 3.0))) * (l * l)) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 2.3e-14:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (t_m * math.pow(k, 4.0)))
	else:
		tmp = (((2.0 / k) / (k * math.pow(t_m, 3.0))) * (l * l)) / (2.0 + math.pow((k / t_m), 2.0))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 2.3e-14)
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64(t_m * (k ^ 4.0))));
	else
		tmp = Float64(Float64(Float64(Float64(2.0 / k) / Float64(k * (t_m ^ 3.0))) * Float64(l * l)) / Float64(2.0 + (Float64(k / t_m) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 2.3e-14)
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / (t_m * (k ^ 4.0)));
	else
		tmp = (((2.0 / k) / (k * (t_m ^ 3.0))) * (l * l)) / (2.0 + ((k / t_m) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-14], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k), $MachinePrecision] / N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-14}:\\
\;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t\_m \cdot {k}^{4}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{2}{k}}{k \cdot {t\_m}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.29999999999999998e-14

    1. Initial program 52.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified52.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 63.0%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 54.6%

      \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{k}^{4} \cdot t}} \]

    if 2.29999999999999998e-14 < t

    1. Initial program 75.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified75.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 69.3%

      \[\leadsto \frac{\frac{\frac{2}{\tan k}}{\color{blue}{k \cdot {t}^{3}}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Taylor expanded in k around 0 69.0%

      \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{k \cdot {t}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.3 \cdot 10^{-14}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{t \cdot {k}^{4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{k \cdot {t}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 60.3% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 8 \cdot 10^{-150}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t\_m \leq 2.1 \cdot 10^{+25}:\\ \;\;\;\;\frac{2}{\left(t\_m \cdot \frac{{t\_m}^{2}}{\ell}\right) \cdot \frac{2 \cdot {k}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 8e-150)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (if (<= t_m 2.1e+25)
      (/ 2.0 (* (* t_m (/ (pow t_m 2.0) l)) (/ (* 2.0 (pow k 2.0)) l)))
      (/ 2.0 (* (* 2.0 k) (* (sin k) (/ (pow t_m 3.0) (* l l)))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 8e-150) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else if (t_m <= 2.1e+25) {
		tmp = 2.0 / ((t_m * (pow(t_m, 2.0) / l)) * ((2.0 * pow(k, 2.0)) / l));
	} else {
		tmp = 2.0 / ((2.0 * k) * (sin(k) * (pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 8d-150) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else if (t_m <= 2.1d+25) then
        tmp = 2.0d0 / ((t_m * ((t_m ** 2.0d0) / l)) * ((2.0d0 * (k ** 2.0d0)) / l))
    else
        tmp = 2.0d0 / ((2.0d0 * k) * (sin(k) * ((t_m ** 3.0d0) / (l * l))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 8e-150) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else if (t_m <= 2.1e+25) {
		tmp = 2.0 / ((t_m * (Math.pow(t_m, 2.0) / l)) * ((2.0 * Math.pow(k, 2.0)) / l));
	} else {
		tmp = 2.0 / ((2.0 * k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 8e-150:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	elif t_m <= 2.1e+25:
		tmp = 2.0 / ((t_m * (math.pow(t_m, 2.0) / l)) * ((2.0 * math.pow(k, 2.0)) / l))
	else:
		tmp = 2.0 / ((2.0 * k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 8e-150)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	elseif (t_m <= 2.1e+25)
		tmp = Float64(2.0 / Float64(Float64(t_m * Float64((t_m ^ 2.0) / l)) * Float64(Float64(2.0 * (k ^ 2.0)) / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 8e-150)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	elseif (t_m <= 2.1e+25)
		tmp = 2.0 / ((t_m * ((t_m ^ 2.0) / l)) * ((2.0 * (k ^ 2.0)) / l));
	else
		tmp = 2.0 / ((2.0 * k) * (sin(k) * ((t_m ^ 3.0) / (l * l))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 8e-150], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.1e+25], N[(2.0 / N[(N[(t$95$m * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8 \cdot 10^{-150}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 2.1 \cdot 10^{+25}:\\
\;\;\;\;\frac{2}{\left(t\_m \cdot \frac{{t\_m}^{2}}{\ell}\right) \cdot \frac{2 \cdot {k}^{2}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.00000000000000005e-150

    1. Initial program 50.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified51.1%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 60.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 51.3%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/51.3%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative51.3%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified51.3%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num51.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow51.3%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr51.3%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-151.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac52.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified52.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 8.00000000000000005e-150 < t < 2.0999999999999999e25

    1. Initial program 71.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified74.4%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 57.8%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/55.4%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr55.4%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    7. Step-by-step derivation
      1. associate-/l*58.0%

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified58.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    9. Step-by-step derivation
      1. cube-mult58.0%

        \[\leadsto \frac{2}{\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]
      2. *-un-lft-identity58.0%

        \[\leadsto \frac{2}{\frac{t \cdot \left(t \cdot t\right)}{\color{blue}{1 \cdot \ell}} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]
      3. times-frac69.4%

        \[\leadsto \frac{2}{\color{blue}{\left(\frac{t}{1} \cdot \frac{t \cdot t}{\ell}\right)} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]
      4. pow269.4%

        \[\leadsto \frac{2}{\left(\frac{t}{1} \cdot \frac{\color{blue}{{t}^{2}}}{\ell}\right) \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]
    10. Applied egg-rr69.4%

      \[\leadsto \frac{2}{\color{blue}{\left(\frac{t}{1} \cdot \frac{{t}^{2}}{\ell}\right)} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]

    if 2.0999999999999999e25 < t

    1. Initial program 72.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. Simplified72.6%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(2 \cdot k\right)}} \]
    5. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \color{blue}{\left(k \cdot 2\right)}} \]
    6. Simplified70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(k \cdot 2\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8 \cdot 10^{-150}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 2.1 \cdot 10^{+25}:\\ \;\;\;\;\frac{2}{\left(t \cdot \frac{{t}^{2}}{\ell}\right) \cdot \frac{2 \cdot {k}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 60.5% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t\_m \leq 8 \cdot 10^{+25}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \left({t\_m}^{3} \cdot \frac{1}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.2e-114)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (if (<= t_m 8e+25)
      (/ 2.0 (* (/ (* 2.0 (pow k 2.0)) l) (* (pow t_m 3.0) (/ 1.0 l))))
      (/ 2.0 (* (* 2.0 k) (* (sin k) (/ (pow t_m 3.0) (* l l)))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else if (t_m <= 8e+25) {
		tmp = 2.0 / (((2.0 * pow(k, 2.0)) / l) * (pow(t_m, 3.0) * (1.0 / l)));
	} else {
		tmp = 2.0 / ((2.0 * k) * (sin(k) * (pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 1.2d-114) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else if (t_m <= 8d+25) then
        tmp = 2.0d0 / (((2.0d0 * (k ** 2.0d0)) / l) * ((t_m ** 3.0d0) * (1.0d0 / l)))
    else
        tmp = 2.0d0 / ((2.0d0 * k) * (sin(k) * ((t_m ** 3.0d0) / (l * l))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else if (t_m <= 8e+25) {
		tmp = 2.0 / (((2.0 * Math.pow(k, 2.0)) / l) * (Math.pow(t_m, 3.0) * (1.0 / l)));
	} else {
		tmp = 2.0 / ((2.0 * k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 1.2e-114:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	elif t_m <= 8e+25:
		tmp = 2.0 / (((2.0 * math.pow(k, 2.0)) / l) * (math.pow(t_m, 3.0) * (1.0 / l)))
	else:
		tmp = 2.0 / ((2.0 * k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.2e-114)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	elseif (t_m <= 8e+25)
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k ^ 2.0)) / l) * Float64((t_m ^ 3.0) * Float64(1.0 / l))));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 1.2e-114)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	elseif (t_m <= 8e+25)
		tmp = 2.0 / (((2.0 * (k ^ 2.0)) / l) * ((t_m ^ 3.0) * (1.0 / l)));
	else
		tmp = 2.0 / ((2.0 * k) * (sin(k) * ((t_m ^ 3.0) / (l * l))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.2e-114], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 8e+25], N[(2.0 / N[(N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 8 \cdot 10^{+25}:\\
\;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \left({t\_m}^{3} \cdot \frac{1}{\ell}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.2000000000000001e-114

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 1.2000000000000001e-114 < t < 8.00000000000000072e25

    1. Initial program 84.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified84.7%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 62.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/59.1%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr59.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    7. Step-by-step derivation
      1. associate-/l*62.6%

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified62.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    9. Step-by-step derivation
      1. div-inv62.7%

        \[\leadsto \frac{2}{\color{blue}{\left({t}^{3} \cdot \frac{1}{\ell}\right)} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]
    10. Applied egg-rr62.7%

      \[\leadsto \frac{2}{\color{blue}{\left({t}^{3} \cdot \frac{1}{\ell}\right)} \cdot \frac{2 \cdot {k}^{2}}{\ell}} \]

    if 8.00000000000000072e25 < t

    1. Initial program 72.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. Simplified72.6%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(2 \cdot k\right)}} \]
    5. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \color{blue}{\left(k \cdot 2\right)}} \]
    6. Simplified70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(k \cdot 2\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{+25}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \left({t}^{3} \cdot \frac{1}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 60.5% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t\_m \leq 9 \cdot 10^{+24}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.2e-114)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (if (<= t_m 9e+24)
      (/ 2.0 (* (/ (* 2.0 (pow k 2.0)) l) (/ (pow t_m 3.0) l)))
      (/ 2.0 (* (* 2.0 k) (* (sin k) (/ (pow t_m 3.0) (* l l)))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else if (t_m <= 9e+24) {
		tmp = 2.0 / (((2.0 * pow(k, 2.0)) / l) * (pow(t_m, 3.0) / l));
	} else {
		tmp = 2.0 / ((2.0 * k) * (sin(k) * (pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 1.2d-114) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else if (t_m <= 9d+24) then
        tmp = 2.0d0 / (((2.0d0 * (k ** 2.0d0)) / l) * ((t_m ** 3.0d0) / l))
    else
        tmp = 2.0d0 / ((2.0d0 * k) * (sin(k) * ((t_m ** 3.0d0) / (l * l))))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else if (t_m <= 9e+24) {
		tmp = 2.0 / (((2.0 * Math.pow(k, 2.0)) / l) * (Math.pow(t_m, 3.0) / l));
	} else {
		tmp = 2.0 / ((2.0 * k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l))));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 1.2e-114:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	elif t_m <= 9e+24:
		tmp = 2.0 / (((2.0 * math.pow(k, 2.0)) / l) * (math.pow(t_m, 3.0) / l))
	else:
		tmp = 2.0 / ((2.0 * k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.2e-114)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	elseif (t_m <= 9e+24)
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k ^ 2.0)) / l) * Float64((t_m ^ 3.0) / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 1.2e-114)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	elseif (t_m <= 9e+24)
		tmp = 2.0 / (((2.0 * (k ^ 2.0)) / l) * ((t_m ^ 3.0) / l));
	else
		tmp = 2.0 / ((2.0 * k) * (sin(k) * ((t_m ^ 3.0) / (l * l))));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.2e-114], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 9e+24], N[(2.0 / N[(N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{elif}\;t\_m \leq 9 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.2000000000000001e-114

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 1.2000000000000001e-114 < t < 9.00000000000000039e24

    1. Initial program 84.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified84.7%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 62.3%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/59.1%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr59.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    7. Step-by-step derivation
      1. associate-/l*62.6%

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified62.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]

    if 9.00000000000000039e24 < t

    1. Initial program 72.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. Simplified72.6%

      \[\leadsto \color{blue}{\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(1 + \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(2 \cdot k\right)}} \]
    5. Step-by-step derivation
      1. *-commutative87.1%

        \[\leadsto \frac{2}{{\left(\sqrt[3]{\sin k} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \color{blue}{\left(k \cdot 2\right)}} \]
    6. Simplified70.6%

      \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(k \cdot 2\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{elif}\;t \leq 9 \cdot 10^{+24}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t}^{3}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot \left(\sin k \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 60.6% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{k \cdot {t\_m}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.2e-114)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (/
     (* (/ (/ 2.0 k) (* k (pow t_m 3.0))) (* l l))
     (+ 2.0 (pow (/ k t_m) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else {
		tmp = (((2.0 / k) / (k * pow(t_m, 3.0))) * (l * l)) / (2.0 + pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 1.2d-114) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else
        tmp = (((2.0d0 / k) / (k * (t_m ** 3.0d0))) * (l * l)) / (2.0d0 + ((k / t_m) ** 2.0d0))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else {
		tmp = (((2.0 / k) / (k * Math.pow(t_m, 3.0))) * (l * l)) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 1.2e-114:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	else:
		tmp = (((2.0 / k) / (k * math.pow(t_m, 3.0))) * (l * l)) / (2.0 + math.pow((k / t_m), 2.0))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.2e-114)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	else
		tmp = Float64(Float64(Float64(Float64(2.0 / k) / Float64(k * (t_m ^ 3.0))) * Float64(l * l)) / Float64(2.0 + (Float64(k / t_m) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 1.2e-114)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	else
		tmp = (((2.0 / k) / (k * (t_m ^ 3.0))) * (l * l)) / (2.0 + ((k / t_m) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.2e-114], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k), $MachinePrecision] / N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{2}{k}}{k \cdot {t\_m}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.2000000000000001e-114

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 1.2000000000000001e-114 < t

    1. Initial program 77.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. Simplified75.7%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 68.2%

      \[\leadsto \frac{\frac{\frac{2}{\tan k}}{\color{blue}{k \cdot {t}^{3}}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Taylor expanded in k around 0 66.4%

      \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{k \cdot {t}^{3}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 25: 58.6% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.2e-114)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (/ 2.0 (* (/ (* 2.0 (pow k 2.0)) l) (/ (pow t_m 3.0) l))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else {
		tmp = 2.0 / (((2.0 * pow(k, 2.0)) / l) * (pow(t_m, 3.0) / l));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 1.2d-114) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else
        tmp = 2.0d0 / (((2.0d0 * (k ** 2.0d0)) / l) * ((t_m ** 3.0d0) / l))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.2e-114) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else {
		tmp = 2.0 / (((2.0 * Math.pow(k, 2.0)) / l) * (Math.pow(t_m, 3.0) / l));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 1.2e-114:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	else:
		tmp = 2.0 / (((2.0 * math.pow(k, 2.0)) / l) * (math.pow(t_m, 3.0) / l))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.2e-114)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(2.0 * (k ^ 2.0)) / l) * Float64((t_m ^ 3.0) / l)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 1.2e-114)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	else
		tmp = 2.0 / (((2.0 * (k ^ 2.0)) / l) * ((t_m ^ 3.0) / l));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.2e-114], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t\_m}^{3}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.2000000000000001e-114

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 1.2000000000000001e-114 < t

    1. Initial program 77.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. Simplified70.0%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 60.7%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/58.2%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr58.2%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    7. Step-by-step derivation
      1. associate-/l*59.4%

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
    8. Simplified59.4%

      \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.2 \cdot 10^{-114}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{2 \cdot {k}^{2}}{\ell} \cdot \frac{{t}^{3}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 57.9% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 4.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 4.6e-116)
    (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))
    (/ 2.0 (* (* 2.0 (pow k 2.0)) (/ (/ (pow t_m 3.0) l) l))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 4.6e-116) {
		tmp = 1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0)));
	} else {
		tmp = 2.0 / ((2.0 * pow(k, 2.0)) * ((pow(t_m, 3.0) / l) / l));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 4.6d-116) then
        tmp = 1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0)))
    else
        tmp = 2.0d0 / ((2.0d0 * (k ** 2.0d0)) * (((t_m ** 3.0d0) / l) / l))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 4.6e-116) {
		tmp = 1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0)));
	} else {
		tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * ((Math.pow(t_m, 3.0) / l) / l));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 4.6e-116:
		tmp = 1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0)))
	else:
		tmp = 2.0 / ((2.0 * math.pow(k, 2.0)) * ((math.pow(t_m, 3.0) / l) / l))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 4.6e-116)
		tmp = Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * Float64(Float64((t_m ^ 3.0) / l) / l)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 4.6e-116)
		tmp = 1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0)));
	else
		tmp = 2.0 / ((2.0 * (k ^ 2.0)) * (((t_m ^ 3.0) / l) / l));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.6e-116], N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.6 \cdot 10^{-116}:\\
\;\;\;\;\frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.60000000000000003e-116

    1. Initial program 50.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified50.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around inf 61.4%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    5. Taylor expanded in k around 0 52.6%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    6. Step-by-step derivation
      1. associate-*r/52.6%

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
      2. *-commutative52.6%

        \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
    7. Simplified52.6%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
    8. Step-by-step derivation
      1. clear-num52.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. inv-pow52.6%

        \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    9. Applied egg-rr52.6%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-152.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
      2. times-frac53.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
    11. Simplified53.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]

    if 4.60000000000000003e-116 < t

    1. Initial program 77.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. Simplified70.0%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 60.7%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 4.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 27: 51.9% accurate, 2.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (/ 1.0 (* (/ t_m 2.0) (/ (pow k 4.0) (pow l 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * (1.0 / ((t_m / 2.0) * (pow(k, 4.0) / pow(l, 2.0))));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * (1.0d0 / ((t_m / 2.0d0) * ((k ** 4.0d0) / (l ** 2.0d0))))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * (1.0 / ((t_m / 2.0) * (Math.pow(k, 4.0) / Math.pow(l, 2.0))));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (1.0 / ((t_m / 2.0) * (math.pow(k, 4.0) / math.pow(l, 2.0))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(1.0 / Float64(Float64(t_m / 2.0) * Float64((k ^ 4.0) / (l ^ 2.0)))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (1.0 / ((t_m / 2.0) * ((k ^ 4.0) / (l ^ 2.0))));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(1.0 / N[(N[(t$95$m / 2.0), $MachinePrecision] * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{1}{\frac{t\_m}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 57.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. Simplified57.4%

    \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
  3. Add Preprocessing
  4. Taylor expanded in k around inf 59.1%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
  5. Taylor expanded in k around 0 50.3%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  6. Step-by-step derivation
    1. associate-*r/50.3%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
    2. *-commutative50.3%

      \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
  7. Simplified50.3%

    \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
  8. Step-by-step derivation
    1. clear-num50.3%

      \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
    2. inv-pow50.3%

      \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
  9. Applied egg-rr50.3%

    \[\leadsto \color{blue}{{\left(\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}\right)}^{-1}} \]
  10. Step-by-step derivation
    1. unpow-150.3%

      \[\leadsto \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{2 \cdot {\ell}^{2}}}} \]
    2. times-frac51.1%

      \[\leadsto \frac{1}{\color{blue}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
  11. Simplified51.1%

    \[\leadsto \color{blue}{\frac{1}{\frac{t}{2} \cdot \frac{{k}^{4}}{{\ell}^{2}}}} \]
  12. Add Preprocessing

Alternative 28: 51.8% accurate, 2.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{2}{t\_m} \cdot \frac{{\ell}^{2}}{{k}^{4}}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (/ 2.0 t_m) (/ (pow l 2.0) (pow k 4.0)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 / t_m) * (pow(l, 2.0) / pow(k, 4.0)));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * ((2.0d0 / t_m) * ((l ** 2.0d0) / (k ** 4.0d0)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 / t_m) * (Math.pow(l, 2.0) / Math.pow(k, 4.0)));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * ((2.0 / t_m) * (math.pow(l, 2.0) / math.pow(k, 4.0)))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(Float64(2.0 / t_m) * Float64((l ^ 2.0) / (k ^ 4.0))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * ((2.0 / t_m) * ((l ^ 2.0) / (k ^ 4.0)));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(2.0 / t$95$m), $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \left(\frac{2}{t\_m} \cdot \frac{{\ell}^{2}}{{k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 57.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. Simplified57.4%

    \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
  3. Add Preprocessing
  4. Taylor expanded in k around inf 59.1%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
  5. Taylor expanded in k around 0 50.3%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  6. Step-by-step derivation
    1. associate-*r/50.3%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
    2. *-commutative50.3%

      \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
  7. Simplified50.3%

    \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
  8. Step-by-step derivation
    1. pow250.3%

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{t \cdot {k}^{4}} \]
    2. times-frac51.1%

      \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{\ell \cdot \ell}{{k}^{4}}} \]
    3. pow251.1%

      \[\leadsto \frac{2}{t} \cdot \frac{\color{blue}{{\ell}^{2}}}{{k}^{4}} \]
  9. Applied egg-rr51.1%

    \[\leadsto \color{blue}{\frac{2}{t} \cdot \frac{{\ell}^{2}}{{k}^{4}}} \]
  10. Add Preprocessing

Alternative 29: 51.7% accurate, 3.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2 \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k}^{4}} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (/ (* 2.0 (* l l)) (* t_m (pow k 4.0)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 * (l * l)) / (t_m * pow(k, 4.0)));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * ((2.0d0 * (l * l)) / (t_m * (k ** 4.0d0)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 * (l * l)) / (t_m * Math.pow(k, 4.0)));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * ((2.0 * (l * l)) / (t_m * math.pow(k, 4.0)))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(Float64(2.0 * Float64(l * l)) / Float64(t_m * (k ^ 4.0))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * ((2.0 * (l * l)) / (t_m * (k ^ 4.0)));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(2.0 * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2 \cdot \left(\ell \cdot \ell\right)}{t\_m \cdot {k}^{4}}
\end{array}
Derivation
  1. Initial program 57.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. Simplified57.4%

    \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\tan k}}{{t}^{3} \cdot \sin k} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
  3. Add Preprocessing
  4. Taylor expanded in k around inf 59.1%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
  5. Taylor expanded in k around 0 50.3%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  6. Step-by-step derivation
    1. associate-*r/50.3%

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{{k}^{4} \cdot t}} \]
    2. *-commutative50.3%

      \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{t \cdot {k}^{4}}} \]
  7. Simplified50.3%

    \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{2}}{t \cdot {k}^{4}}} \]
  8. Step-by-step derivation
    1. unpow250.3%

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{t \cdot {k}^{4}} \]
  9. Applied egg-rr50.3%

    \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{t \cdot {k}^{4}} \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2024139 
(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))))