Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.3% → 90.0%
Time: 17.0s
Alternatives: 17
Speedup: 24.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 54.3% accurate, 1.0× speedup?

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

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

Alternative 1: 90.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}\;t\_m \leq 3.3 \cdot 10^{-11}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\sqrt[3]{\ell \cdot 2}}{t\_m \cdot \left(\sqrt[3]{\tan k} \cdot \sqrt[3]{\sin k}\right)}\right)}^{3} \cdot \frac{\ell}{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 3.3e-11)
    (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))
    (*
     (pow (/ (cbrt (* l 2.0)) (* t_m (* (cbrt (tan k)) (cbrt (sin k))))) 3.0)
     (/ 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 <= 3.3e-11) {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	} else {
		tmp = pow((cbrt((l * 2.0)) / (t_m * (cbrt(tan(k)) * cbrt(sin(k))))), 3.0) * (l / (2.0 + pow((k / t_m), 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 <= 3.3e-11) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	} else {
		tmp = Math.pow((Math.cbrt((l * 2.0)) / (t_m * (Math.cbrt(Math.tan(k)) * Math.cbrt(Math.sin(k))))), 3.0) * (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 <= 3.3e-11)
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	else
		tmp = Float64((Float64(cbrt(Float64(l * 2.0)) / Float64(t_m * Float64(cbrt(tan(k)) * cbrt(sin(k))))) ^ 3.0) * Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 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, 3.3e-11], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[Power[N[(l * 2.0), $MachinePrecision], 1/3], $MachinePrecision] / N[(t$95$m * N[(N[Power[N[Tan[k], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 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 3.3 \cdot 10^{-11}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3000000000000002e-11 < t

    1. Initial program 74.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. Simplified66.9%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr81.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-identity81.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. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 81.9% accurate, 0.5× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := {\left(\frac{k}{t\_m}\right)}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\frac{2}{\left(\tan k \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(1 + \left(t\_2 + 1\right)\right)} \leq 2 \cdot 10^{+270}:\\ \;\;\;\;\frac{\ell}{2 + t\_2} \cdot \left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t\_m}^{3}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \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 (pow (/ k t_m) 2.0)))
   (*
    t_s
    (if (<=
         (/
          2.0
          (*
           (* (tan k) (* (sin k) (/ (pow t_m 3.0) (* l l))))
           (+ 1.0 (+ t_2 1.0))))
         2e+270)
      (* (/ l (+ 2.0 t_2)) (* l (/ 2.0 (* (tan k) (* (sin k) (pow t_m 3.0))))))
      (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))))))
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 = pow((k / t_m), 2.0);
	double tmp;
	if ((2.0 / ((tan(k) * (sin(k) * (pow(t_m, 3.0) / (l * l)))) * (1.0 + (t_2 + 1.0)))) <= 2e+270) {
		tmp = (l / (2.0 + t_2)) * (l * (2.0 / (tan(k) * (sin(k) * pow(t_m, 3.0)))));
	} else {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	}
	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) :: t_2
    real(8) :: tmp
    t_2 = (k / t_m) ** 2.0d0
    if ((2.0d0 / ((tan(k) * (sin(k) * ((t_m ** 3.0d0) / (l * l)))) * (1.0d0 + (t_2 + 1.0d0)))) <= 2d+270) then
        tmp = (l / (2.0d0 + t_2)) * (l * (2.0d0 / (tan(k) * (sin(k) * (t_m ** 3.0d0)))))
    else
        tmp = ((l * (sqrt(2.0d0) / (k * sin(k)))) ** 2.0d0) * (cos(k) / t_m)
    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 t_2 = Math.pow((k / t_m), 2.0);
	double tmp;
	if ((2.0 / ((Math.tan(k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l)))) * (1.0 + (t_2 + 1.0)))) <= 2e+270) {
		tmp = (l / (2.0 + t_2)) * (l * (2.0 / (Math.tan(k) * (Math.sin(k) * Math.pow(t_m, 3.0)))));
	} else {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	t_2 = math.pow((k / t_m), 2.0)
	tmp = 0
	if (2.0 / ((math.tan(k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l)))) * (1.0 + (t_2 + 1.0)))) <= 2e+270:
		tmp = (l / (2.0 + t_2)) * (l * (2.0 / (math.tan(k) * (math.sin(k) * math.pow(t_m, 3.0)))))
	else:
		tmp = math.pow((l * (math.sqrt(2.0) / (k * math.sin(k)))), 2.0) * (math.cos(k) / t_m)
	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(k / t_m) ^ 2.0
	tmp = 0.0
	if (Float64(2.0 / Float64(Float64(tan(k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(1.0 + Float64(t_2 + 1.0)))) <= 2e+270)
		tmp = Float64(Float64(l / Float64(2.0 + t_2)) * Float64(l * Float64(2.0 / Float64(tan(k) * Float64(sin(k) * (t_m ^ 3.0))))));
	else
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	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)
	t_2 = (k / t_m) ^ 2.0;
	tmp = 0.0;
	if ((2.0 / ((tan(k) * (sin(k) * ((t_m ^ 3.0) / (l * l)))) * (1.0 + (t_2 + 1.0)))) <= 2e+270)
		tmp = (l / (2.0 + t_2)) * (l * (2.0 / (tan(k) * (sin(k) * (t_m ^ 3.0)))));
	else
		tmp = ((l * (sqrt(2.0) / (k * sin(k)))) ^ 2.0) * (cos(k) / t_m);
	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_] := Block[{t$95$2 = N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+270], N[(N[(l / N[(2.0 + t$95$2), $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 82.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. Simplified74.9%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr85.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-identity85.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. *-commutative85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 84.3% 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 1.6 \cdot 10^{-10}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{+102}:\\ \;\;\;\;\frac{\ell}{t\_2} \cdot \left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t\_m}^{3}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot t\_2\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 (+ 2.0 (pow (/ k t_m) 2.0))))
   (*
    t_s
    (if (<= t_m 1.6e-10)
      (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))
      (if (<= t_m 5.6e+102)
        (* (/ l t_2) (* l (/ 2.0 (* (tan k) (* (sin k) (pow t_m 3.0))))))
        (/
         2.0
         (*
          (pow (/ t_m (pow (cbrt l) 2.0)) 3.0)
          (* (sin k) (* (tan k) t_2)))))))))
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 <= 1.6e-10) {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	} else if (t_m <= 5.6e+102) {
		tmp = (l / t_2) * (l * (2.0 / (tan(k) * (sin(k) * pow(t_m, 3.0)))));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (sin(k) * (tan(k) * t_2)));
	}
	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 <= 1.6e-10) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	} else if (t_m <= 5.6e+102) {
		tmp = (l / t_2) * (l * (2.0 / (Math.tan(k) * (Math.sin(k) * Math.pow(t_m, 3.0)))));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (Math.sin(k) * (Math.tan(k) * t_2)));
	}
	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 <= 1.6e-10)
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	elseif (t_m <= 5.6e+102)
		tmp = Float64(Float64(l / t_2) * Float64(l * Float64(2.0 / Float64(tan(k) * Float64(sin(k) * (t_m ^ 3.0))))));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(sin(k) * Float64(tan(k) * t_2))));
	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, 1.6e-10], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.6e+102], N[(N[(l / t$95$2), $MachinePrecision] * N[(l * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $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[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * t$95$2), $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 1.6 \cdot 10^{-10}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5999999999999999e-10 < t < 5.60000000000000037e102

    1. Initial program 88.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. Simplified84.4%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr95.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-identity95.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. *-commutative95.8%

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

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

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

    if 5.60000000000000037e102 < t

    1. Initial program 66.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. Simplified64.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. Step-by-step derivation
      1. unpow264.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 83.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6e-11 < t < 5.60000000000000037e102

    1. Initial program 88.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. Simplified84.4%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr95.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-identity95.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. *-commutative95.8%

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

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

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

    if 5.60000000000000037e102 < t

    1. Initial program 66.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. Simplified64.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. Step-by-step derivation
      1. unpow264.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.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 5.6 \cdot 10^{-11}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \left(\ell \cdot \frac{2}{\tan k \cdot {\left(t\_m \cdot \sqrt[3]{\sin k}\right)}^{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 5.6e-11)
    (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))
    (*
     (/ l (+ 2.0 (pow (/ k t_m) 2.0)))
     (* l (/ 2.0 (* (tan k) (pow (* t_m (cbrt (sin k))) 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 <= 5.6e-11) {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	} else {
		tmp = (l / (2.0 + pow((k / t_m), 2.0))) * (l * (2.0 / (tan(k) * pow((t_m * cbrt(sin(k))), 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 <= 5.6e-11) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	} else {
		tmp = (l / (2.0 + Math.pow((k / t_m), 2.0))) * (l * (2.0 / (Math.tan(k) * Math.pow((t_m * Math.cbrt(Math.sin(k))), 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 <= 5.6e-11)
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	else
		tmp = Float64(Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(l * Float64(2.0 / Float64(tan(k) * (Float64(t_m * cbrt(sin(k))) ^ 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, 5.6e-11], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[Power[N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 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 5.6 \cdot 10^{-11}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6e-11 < t

    1. Initial program 74.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. Simplified66.9%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr81.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-identity81.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. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.5% 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 4 \cdot 10^{-11}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \mathbf{elif}\;t\_m \leq 5.6 \cdot 10^{+102} \lor \neg \left(t\_m \leq 3.2 \cdot 10^{+205}\right):\\ \;\;\;\;\frac{\ell}{2 + {\left(\frac{k}{t\_m}\right)}^{2}} \cdot \left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t\_m}^{3}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell}\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 4e-11)
    (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))
    (if (or (<= t_m 5.6e+102) (not (<= t_m 3.2e+205)))
      (*
       (/ l (+ 2.0 (pow (/ k t_m) 2.0)))
       (* l (/ 2.0 (* (tan k) (* (sin k) (pow t_m 3.0))))))
      (/
       2.0
       (*
        (* (* (sin k) (tan k)) (+ 2.0 (/ (/ k t_m) (/ t_m k))))
        (pow (/ (pow t_m 1.5) 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) {
	double tmp;
	if (t_m <= 4e-11) {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	} else if ((t_m <= 5.6e+102) || !(t_m <= 3.2e+205)) {
		tmp = (l / (2.0 + pow((k / t_m), 2.0))) * (l * (2.0 / (tan(k) * (sin(k) * pow(t_m, 3.0)))));
	} else {
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * pow((pow(t_m, 1.5) / l), 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 <= 4d-11) then
        tmp = ((l * (sqrt(2.0d0) / (k * sin(k)))) ** 2.0d0) * (cos(k) / t_m)
    else if ((t_m <= 5.6d+102) .or. (.not. (t_m <= 3.2d+205))) then
        tmp = (l / (2.0d0 + ((k / t_m) ** 2.0d0))) * (l * (2.0d0 / (tan(k) * (sin(k) * (t_m ** 3.0d0)))))
    else
        tmp = 2.0d0 / (((sin(k) * tan(k)) * (2.0d0 + ((k / t_m) / (t_m / k)))) * (((t_m ** 1.5d0) / l) ** 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 <= 4e-11) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	} else if ((t_m <= 5.6e+102) || !(t_m <= 3.2e+205)) {
		tmp = (l / (2.0 + Math.pow((k / t_m), 2.0))) * (l * (2.0 / (Math.tan(k) * (Math.sin(k) * Math.pow(t_m, 3.0)))));
	} else {
		tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * Math.pow((Math.pow(t_m, 1.5) / l), 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 <= 4e-11:
		tmp = math.pow((l * (math.sqrt(2.0) / (k * math.sin(k)))), 2.0) * (math.cos(k) / t_m)
	elif (t_m <= 5.6e+102) or not (t_m <= 3.2e+205):
		tmp = (l / (2.0 + math.pow((k / t_m), 2.0))) * (l * (2.0 / (math.tan(k) * (math.sin(k) * math.pow(t_m, 3.0)))))
	else:
		tmp = 2.0 / (((math.sin(k) * math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * math.pow((math.pow(t_m, 1.5) / l), 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 <= 4e-11)
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	elseif ((t_m <= 5.6e+102) || !(t_m <= 3.2e+205))
		tmp = Float64(Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0))) * Float64(l * Float64(2.0 / Float64(tan(k) * Float64(sin(k) * (t_m ^ 3.0))))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k)))) * (Float64((t_m ^ 1.5) / l) ^ 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 <= 4e-11)
		tmp = ((l * (sqrt(2.0) / (k * sin(k)))) ^ 2.0) * (cos(k) / t_m);
	elseif ((t_m <= 5.6e+102) || ~((t_m <= 3.2e+205)))
		tmp = (l / (2.0 + ((k / t_m) ^ 2.0))) * (l * (2.0 / (tan(k) * (sin(k) * (t_m ^ 3.0)))));
	else
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * (((t_m ^ 1.5) / l) ^ 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, 4e-11], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$m, 5.6e+102], N[Not[LessEqual[t$95$m, 3.2e+205]], $MachinePrecision]], N[(N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $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 4 \cdot 10^{-11}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999976e-11 < t < 5.60000000000000037e102 or 3.19999999999999996e205 < t

    1. Initial program 75.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. Simplified66.2%

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

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

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

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

        \[\leadsto \frac{\frac{2}{\color{blue}{\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-rr85.3%

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

        \[\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. *-commutative85.3%

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

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

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

    if 5.60000000000000037e102 < t < 3.19999999999999996e205

    1. Initial program 68.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. Simplified68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.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.3 \cdot 10^{-10}:\\ \;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\ \mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+164}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\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 1.3e-10)
    (* (pow (* l (/ (sqrt 2.0) (* k (sin k)))) 2.0) (/ (cos k) t_m))
    (if (<= t_m 7.2e+164)
      (/
       2.0
       (*
        (* (* (sin k) (tan k)) (+ 2.0 (/ (/ k t_m) (/ t_m k))))
        (* (/ (pow t_m 2.0) l) (/ t_m l))))
      (/ 2.0 (* (pow (/ t_m (pow (cbrt l) 2.0)) 3.0) (* 2.0 (* k 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.3e-10) {
		tmp = pow((l * (sqrt(2.0) / (k * sin(k)))), 2.0) * (cos(k) / t_m);
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.3e-10) {
		tmp = Math.pow((l * (Math.sqrt(2.0) / (k * Math.sin(k)))), 2.0) * (Math.cos(k) / t_m);
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((Math.pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.3e-10)
		tmp = Float64((Float64(l * Float64(sqrt(2.0) / Float64(k * sin(k)))) ^ 2.0) * Float64(cos(k) / t_m));
	elseif (t_m <= 7.2e+164)
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k)))) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l))));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(2.0 * Float64(k * 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.3e-10], N[(N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.2e+164], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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[(k * k), $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.3 \cdot 10^{-10}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{2}}{k \cdot \sin k}\right)}^{2} \cdot \frac{\cos k}{t\_m}\\

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999991e-10 < t < 7.19999999999999981e164

    1. Initial program 76.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. Simplified76.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. Step-by-step derivation
      1. unpow276.7%

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

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

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

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

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

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

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

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

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

    if 7.19999999999999981e164 < t

    1. Initial program 71.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. Simplified68.9%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 68.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. unpow268.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 \left(k \cdot k\right)\right)} \]
      8. add-cbrt-cube63.4%

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

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

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

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

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

Alternative 8: 80.3% 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.32 \cdot 10^{-10}:\\ \;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\sqrt{2} \cdot \frac{\ell}{k}}{\sin k}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+164}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\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 1.32e-10)
    (* (/ (cos k) t_m) (pow (/ (* (sqrt 2.0) (/ l k)) (sin k)) 2.0))
    (if (<= t_m 7.2e+164)
      (/
       2.0
       (*
        (* (* (sin k) (tan k)) (+ 2.0 (/ (/ k t_m) (/ t_m k))))
        (* (/ (pow t_m 2.0) l) (/ t_m l))))
      (/ 2.0 (* (pow (/ t_m (pow (cbrt l) 2.0)) 3.0) (* 2.0 (* k 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.32e-10) {
		tmp = (cos(k) / t_m) * pow(((sqrt(2.0) * (l / k)) / sin(k)), 2.0);
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.32e-10) {
		tmp = (Math.cos(k) / t_m) * Math.pow(((Math.sqrt(2.0) * (l / k)) / Math.sin(k)), 2.0);
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((Math.pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.32e-10)
		tmp = Float64(Float64(cos(k) / t_m) * (Float64(Float64(sqrt(2.0) * Float64(l / k)) / sin(k)) ^ 2.0));
	elseif (t_m <= 7.2e+164)
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k)))) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l))));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(2.0 * Float64(k * 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.32e-10], N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.2e+164], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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[(k * k), $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.32 \cdot 10^{-10}:\\
\;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\sqrt{2} \cdot \frac{\ell}{k}}{\sin k}\right)}^{2}\\

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3200000000000001e-10 < t < 7.19999999999999981e164

    1. Initial program 76.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. Simplified76.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. Step-by-step derivation
      1. unpow276.7%

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

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

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

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

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

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

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

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

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

    if 7.19999999999999981e164 < t

    1. Initial program 71.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. Simplified68.9%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 68.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. unpow268.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 \left(k \cdot k\right)\right)} \]
      8. add-cbrt-cube63.4%

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

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

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

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

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

Alternative 9: 69.3% 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.9 \cdot 10^{-31}:\\ \;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{{k}^{2}}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 1.68 \cdot 10^{+81}:\\ \;\;\;\;\frac{2}{\frac{k \cdot {t\_m}^{3}}{{\ell}^{2}} \cdot \left(2 \cdot k\right)}\\ \mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+164}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\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 1.9e-31)
    (* (/ (cos k) t_m) (pow (* l (/ (sqrt 2.0) (pow k 2.0))) 2.0))
    (if (<= t_m 1.68e+81)
      (/ 2.0 (* (/ (* k (pow t_m 3.0)) (pow l 2.0)) (* 2.0 k)))
      (if (<= t_m 7.2e+164)
        (/
         2.0
         (*
          (* (* (sin k) (tan k)) (+ 2.0 (/ (/ k t_m) (/ t_m k))))
          (* (/ (pow t_m 2.0) l) (/ t_m l))))
        (/ 2.0 (* (pow (/ t_m (pow (cbrt l) 2.0)) 3.0) (* 2.0 (* k 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.9e-31) {
		tmp = (cos(k) / t_m) * pow((l * (sqrt(2.0) / pow(k, 2.0))), 2.0);
	} else if (t_m <= 1.68e+81) {
		tmp = 2.0 / (((k * pow(t_m, 3.0)) / pow(l, 2.0)) * (2.0 * k));
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.9e-31) {
		tmp = (Math.cos(k) / t_m) * Math.pow((l * (Math.sqrt(2.0) / Math.pow(k, 2.0))), 2.0);
	} else if (t_m <= 1.68e+81) {
		tmp = 2.0 / (((k * Math.pow(t_m, 3.0)) / Math.pow(l, 2.0)) * (2.0 * k));
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((Math.pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.9e-31)
		tmp = Float64(Float64(cos(k) / t_m) * (Float64(l * Float64(sqrt(2.0) / (k ^ 2.0))) ^ 2.0));
	elseif (t_m <= 1.68e+81)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * (t_m ^ 3.0)) / (l ^ 2.0)) * Float64(2.0 * k)));
	elseif (t_m <= 7.2e+164)
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k)))) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l))));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(2.0 * Float64(k * 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.9e-31], N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.68e+81], N[(2.0 / N[(N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.2e+164], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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[(k * k), $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.9 \cdot 10^{-31}:\\
\;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\ell \cdot \frac{\sqrt{2}}{{k}^{2}}\right)}^{2}\\

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9e-31 < t < 1.68000000000000001e81

    1. Initial program 78.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. Simplified78.0%

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

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

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

    if 1.68000000000000001e81 < t < 7.19999999999999981e164

    1. Initial program 69.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. Simplified63.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. Step-by-step derivation
      1. unpow263.4%

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

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

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

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

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

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

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

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

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

    if 7.19999999999999981e164 < t

    1. Initial program 71.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. Simplified68.9%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 68.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. unpow268.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 \left(k \cdot k\right)\right)} \]
      8. add-cbrt-cube63.4%

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

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

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

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

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

Alternative 10: 69.3% accurate, 1.2× 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.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 1.95 \cdot 10^{+80}:\\ \;\;\;\;\frac{2}{\frac{k \cdot {t\_m}^{3}}{{\ell}^{2}} \cdot \left(2 \cdot k\right)}\\ \mathbf{elif}\;t\_m \leq 7.2 \cdot 10^{+164}:\\ \;\;\;\;\frac{2}{\left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k}{t\_m}}{\frac{t\_m}{k}}\right)\right) \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\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 2.6e-27)
    (* (/ (cos k) t_m) (pow (* (/ l k) (/ (sqrt 2.0) k)) 2.0))
    (if (<= t_m 1.95e+80)
      (/ 2.0 (* (/ (* k (pow t_m 3.0)) (pow l 2.0)) (* 2.0 k)))
      (if (<= t_m 7.2e+164)
        (/
         2.0
         (*
          (* (* (sin k) (tan k)) (+ 2.0 (/ (/ k t_m) (/ t_m k))))
          (* (/ (pow t_m 2.0) l) (/ t_m l))))
        (/ 2.0 (* (pow (/ t_m (pow (cbrt l) 2.0)) 3.0) (* 2.0 (* k 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.6e-27) {
		tmp = (cos(k) / t_m) * pow(((l / k) * (sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 1.95e+80) {
		tmp = 2.0 / (((k * pow(t_m, 3.0)) / pow(l, 2.0)) * (2.0 * k));
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((sin(k) * tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.6e-27) {
		tmp = (Math.cos(k) / t_m) * Math.pow(((l / k) * (Math.sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 1.95e+80) {
		tmp = 2.0 / (((k * Math.pow(t_m, 3.0)) / Math.pow(l, 2.0)) * (2.0 * k));
	} else if (t_m <= 7.2e+164) {
		tmp = 2.0 / (((Math.sin(k) * Math.tan(k)) * (2.0 + ((k / t_m) / (t_m / k)))) * ((Math.pow(t_m, 2.0) / l) * (t_m / l)));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.6e-27)
		tmp = Float64(Float64(cos(k) / t_m) * (Float64(Float64(l / k) * Float64(sqrt(2.0) / k)) ^ 2.0));
	elseif (t_m <= 1.95e+80)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * (t_m ^ 3.0)) / (l ^ 2.0)) * Float64(2.0 * k)));
	elseif (t_m <= 7.2e+164)
		tmp = Float64(2.0 / Float64(Float64(Float64(sin(k) * tan(k)) * Float64(2.0 + Float64(Float64(k / t_m) / Float64(t_m / k)))) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l))));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(2.0 * Float64(k * 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.6e-27], N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.95e+80], N[(2.0 / N[(N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.2e+164], N[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(k / t$95$m), $MachinePrecision] / N[(t$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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[(k * k), $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.6 \cdot 10^{-27}:\\
\;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 2.60000000000000017e-27

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.60000000000000017e-27 < t < 1.94999999999999999e80

    1. Initial program 78.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. Simplified78.0%

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

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

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

    if 1.94999999999999999e80 < t < 7.19999999999999981e164

    1. Initial program 69.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. Simplified63.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. Step-by-step derivation
      1. unpow263.4%

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

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

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

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

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

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

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

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

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

    if 7.19999999999999981e164 < t

    1. Initial program 71.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. Simplified68.9%

      \[\leadsto \color{blue}{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)\right)}} \]
    3. Add Preprocessing
    4. Taylor expanded in k around 0 68.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. unpow268.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 \left(k \cdot k\right)\right)} \]
      8. add-cbrt-cube63.4%

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

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

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

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

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

Alternative 11: 67.9% 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.7 \cdot 10^{-32}:\\ \;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 2.4 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{k \cdot {t\_m}^{3}}{{\ell}^{2}} \cdot \left(2 \cdot k\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \left(2 \cdot \left(k \cdot k\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 2.7e-32)
    (* (/ (cos k) t_m) (pow (* (/ l k) (/ (sqrt 2.0) k)) 2.0))
    (if (<= t_m 2.4e+102)
      (/ 2.0 (* (/ (* k (pow t_m 3.0)) (pow l 2.0)) (* 2.0 k)))
      (/ 2.0 (* (pow (/ t_m (pow (cbrt l) 2.0)) 3.0) (* 2.0 (* k 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.7e-32) {
		tmp = (cos(k) / t_m) * pow(((l / k) * (sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 2.4e+102) {
		tmp = 2.0 / (((k * pow(t_m, 3.0)) / pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / (pow((t_m / pow(cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.7e-32) {
		tmp = (Math.cos(k) / t_m) * Math.pow(((l / k) * (Math.sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 2.4e+102) {
		tmp = 2.0 / (((k * Math.pow(t_m, 3.0)) / Math.pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / (Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0) * (2.0 * (k * 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.7e-32)
		tmp = Float64(Float64(cos(k) / t_m) * (Float64(Float64(l / k) * Float64(sqrt(2.0) / k)) ^ 2.0));
	elseif (t_m <= 2.4e+102)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * (t_m ^ 3.0)) / (l ^ 2.0)) * Float64(2.0 * k)));
	else
		tmp = Float64(2.0 / Float64((Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0) * Float64(2.0 * Float64(k * 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.7e-32], N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.4e+102], N[(2.0 / N[(N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $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[(k * k), $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.7 \cdot 10^{-32}:\\
\;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.69999999999999981e-32 < t < 2.39999999999999994e102

    1. Initial program 83.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. Simplified83.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. Taylor expanded in k around 0 79.9%

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

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

    if 2.39999999999999994e102 < t

    1. Initial program 66.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. Simplified64.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 64.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. unpow264.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 \left(k \cdot k\right)\right)} \]
      8. add-cbrt-cube66.3%

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

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

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

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

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

Alternative 12: 67.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.35 \cdot 10^{-32}:\\ \;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\ \mathbf{elif}\;t\_m \leq 3.55 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{k \cdot {t\_m}^{3}}{{\ell}^{2}} \cdot \left(2 \cdot k\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot \left(k \cdot k\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 2.35e-32)
    (* (/ (cos k) t_m) (pow (* (/ l k) (/ (sqrt 2.0) k)) 2.0))
    (if (<= t_m 3.55e+102)
      (/ 2.0 (* (/ (* k (pow t_m 3.0)) (pow l 2.0)) (* 2.0 k)))
      (/ 2.0 (* (pow (/ (pow t_m 1.5) l) 2.0) (* 2.0 (* k 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.35e-32) {
		tmp = (cos(k) / t_m) * pow(((l / k) * (sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 3.55e+102) {
		tmp = 2.0 / (((k * pow(t_m, 3.0)) / pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / (pow((pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * 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 (t_m <= 2.35d-32) then
        tmp = (cos(k) / t_m) * (((l / k) * (sqrt(2.0d0) / k)) ** 2.0d0)
    else if (t_m <= 3.55d+102) then
        tmp = 2.0d0 / (((k * (t_m ** 3.0d0)) / (l ** 2.0d0)) * (2.0d0 * k))
    else
        tmp = 2.0d0 / ((((t_m ** 1.5d0) / l) ** 2.0d0) * (2.0d0 * (k * 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 (t_m <= 2.35e-32) {
		tmp = (Math.cos(k) / t_m) * Math.pow(((l / k) * (Math.sqrt(2.0) / k)), 2.0);
	} else if (t_m <= 3.55e+102) {
		tmp = 2.0 / (((k * Math.pow(t_m, 3.0)) / Math.pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / (Math.pow((Math.pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * 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 t_m <= 2.35e-32:
		tmp = (math.cos(k) / t_m) * math.pow(((l / k) * (math.sqrt(2.0) / k)), 2.0)
	elif t_m <= 3.55e+102:
		tmp = 2.0 / (((k * math.pow(t_m, 3.0)) / math.pow(l, 2.0)) * (2.0 * k))
	else:
		tmp = 2.0 / (math.pow((math.pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * 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.35e-32)
		tmp = Float64(Float64(cos(k) / t_m) * (Float64(Float64(l / k) * Float64(sqrt(2.0) / k)) ^ 2.0));
	elseif (t_m <= 3.55e+102)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * (t_m ^ 3.0)) / (l ^ 2.0)) * Float64(2.0 * k)));
	else
		tmp = Float64(2.0 / Float64((Float64((t_m ^ 1.5) / l) ^ 2.0) * Float64(2.0 * Float64(k * 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 (t_m <= 2.35e-32)
		tmp = (cos(k) / t_m) * (((l / k) * (sqrt(2.0) / k)) ^ 2.0);
	elseif (t_m <= 3.55e+102)
		tmp = 2.0 / (((k * (t_m ^ 3.0)) / (l ^ 2.0)) * (2.0 * k));
	else
		tmp = 2.0 / ((((t_m ^ 1.5) / l) ^ 2.0) * (2.0 * (k * 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[t$95$m, 2.35e-32], N[(N[(N[Cos[k], $MachinePrecision] / t$95$m), $MachinePrecision] * N[Power[N[(N[(l / k), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.55e+102], N[(2.0 / N[(N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(2.0 * N[(k * k), $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.35 \cdot 10^{-32}:\\
\;\;\;\;\frac{\cos k}{t\_m} \cdot {\left(\frac{\ell}{k} \cdot \frac{\sqrt{2}}{k}\right)}^{2}\\

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3500000000000001e-32 < t < 3.5499999999999999e102

    1. Initial program 83.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. Simplified83.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. Taylor expanded in k around 0 79.9%

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

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

    if 3.5499999999999999e102 < t

    1. Initial program 66.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. Simplified64.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 64.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. unpow264.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 61.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 2 \cdot 10^{-36}:\\ \;\;\;\;\frac{2}{{k}^{4} \cdot \frac{t\_m}{{\ell}^{2}}}\\ \mathbf{elif}\;t\_m \leq 3.25 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{k \cdot {t\_m}^{3}}{{\ell}^{2}} \cdot \left(2 \cdot k\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t\_m}^{2} \cdot \frac{t\_m}{\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 2e-36)
    (/ 2.0 (* (pow k 4.0) (/ t_m (pow l 2.0))))
    (if (<= t_m 3.25e+102)
      (/ 2.0 (* (/ (* k (pow t_m 3.0)) (pow l 2.0)) (* 2.0 k)))
      (/ 2.0 (* (* 2.0 (* k k)) (/ (* (pow t_m 2.0) (/ t_m 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 <= 2e-36) {
		tmp = 2.0 / (pow(k, 4.0) * (t_m / pow(l, 2.0)));
	} else if (t_m <= 3.25e+102) {
		tmp = 2.0 / (((k * pow(t_m, 3.0)) / pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / ((2.0 * (k * k)) * ((pow(t_m, 2.0) * (t_m / 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 <= 2d-36) then
        tmp = 2.0d0 / ((k ** 4.0d0) * (t_m / (l ** 2.0d0)))
    else if (t_m <= 3.25d+102) then
        tmp = 2.0d0 / (((k * (t_m ** 3.0d0)) / (l ** 2.0d0)) * (2.0d0 * k))
    else
        tmp = 2.0d0 / ((2.0d0 * (k * k)) * (((t_m ** 2.0d0) * (t_m / 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 <= 2e-36) {
		tmp = 2.0 / (Math.pow(k, 4.0) * (t_m / Math.pow(l, 2.0)));
	} else if (t_m <= 3.25e+102) {
		tmp = 2.0 / (((k * Math.pow(t_m, 3.0)) / Math.pow(l, 2.0)) * (2.0 * k));
	} else {
		tmp = 2.0 / ((2.0 * (k * k)) * ((Math.pow(t_m, 2.0) * (t_m / 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 <= 2e-36:
		tmp = 2.0 / (math.pow(k, 4.0) * (t_m / math.pow(l, 2.0)))
	elif t_m <= 3.25e+102:
		tmp = 2.0 / (((k * math.pow(t_m, 3.0)) / math.pow(l, 2.0)) * (2.0 * k))
	else:
		tmp = 2.0 / ((2.0 * (k * k)) * ((math.pow(t_m, 2.0) * (t_m / 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 <= 2e-36)
		tmp = Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m / (l ^ 2.0))));
	elseif (t_m <= 3.25e+102)
		tmp = Float64(2.0 / Float64(Float64(Float64(k * (t_m ^ 3.0)) / (l ^ 2.0)) * Float64(2.0 * k)));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k * k)) * Float64(Float64((t_m ^ 2.0) * Float64(t_m / 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 <= 2e-36)
		tmp = 2.0 / ((k ^ 4.0) * (t_m / (l ^ 2.0)));
	elseif (t_m <= 3.25e+102)
		tmp = 2.0 / (((k * (t_m ^ 3.0)) / (l ^ 2.0)) * (2.0 * k));
	else
		tmp = 2.0 / ((2.0 * (k * k)) * (((t_m ^ 2.0) * (t_m / 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, 2e-36], N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.25e+102], N[(2.0 / N[(N[(N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $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 2 \cdot 10^{-36}:\\
\;\;\;\;\frac{2}{{k}^{4} \cdot \frac{t\_m}{{\ell}^{2}}}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-36 < t < 3.2500000000000002e102

    1. Initial program 81.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. Simplified81.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. Taylor expanded in k around 0 77.9%

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

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

    if 3.2500000000000002e102 < t

    1. Initial program 66.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. Simplified64.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 64.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. unpow264.4%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 58.5% accurate, 2.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 8 \cdot 10^{+159}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{2}{t\_m}\\ \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 8e+159)
    (/ 2.0 (* (* 2.0 (* k k)) (/ (* (pow t_m 2.0) (/ t_m l)) l)))
    (* (/ (pow l 2.0) (pow k 4.0)) (/ 2.0 t_m)))))
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 <= 8e+159) {
		tmp = 2.0 / ((2.0 * (k * k)) * ((pow(t_m, 2.0) * (t_m / l)) / l));
	} else {
		tmp = (pow(l, 2.0) / pow(k, 4.0)) * (2.0 / t_m);
	}
	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 <= 8d+159) then
        tmp = 2.0d0 / ((2.0d0 * (k * k)) * (((t_m ** 2.0d0) * (t_m / l)) / l))
    else
        tmp = ((l ** 2.0d0) / (k ** 4.0d0)) * (2.0d0 / t_m)
    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 <= 8e+159) {
		tmp = 2.0 / ((2.0 * (k * k)) * ((Math.pow(t_m, 2.0) * (t_m / l)) / l));
	} else {
		tmp = (Math.pow(l, 2.0) / Math.pow(k, 4.0)) * (2.0 / t_m);
	}
	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 <= 8e+159:
		tmp = 2.0 / ((2.0 * (k * k)) * ((math.pow(t_m, 2.0) * (t_m / l)) / l))
	else:
		tmp = (math.pow(l, 2.0) / math.pow(k, 4.0)) * (2.0 / t_m)
	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 <= 8e+159)
		tmp = Float64(2.0 / Float64(Float64(2.0 * Float64(k * k)) * Float64(Float64((t_m ^ 2.0) * Float64(t_m / l)) / l)));
	else
		tmp = Float64(Float64((l ^ 2.0) / (k ^ 4.0)) * Float64(2.0 / t_m));
	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 <= 8e+159)
		tmp = 2.0 / ((2.0 * (k * k)) * (((t_m ^ 2.0) * (t_m / l)) / l));
	else
		tmp = ((l ^ 2.0) / (k ^ 4.0)) * (2.0 / t_m);
	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, 8e+159], N[(2.0 / N[(N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 / t$95$m), $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 8 \cdot 10^{+159}:\\
\;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell}}\\

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


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

    1. Initial program 53.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. Simplified53.2%

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

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

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

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

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

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

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

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

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

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

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

    if 7.9999999999999994e159 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{\color{blue}{\sqrt{2} \cdot \sqrt{2}}}{t} \]
      3. rem-square-sqrt77.0%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{2}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8 \cdot 10^{+159}:\\ \;\;\;\;\frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t}^{2} \cdot \frac{t}{\ell}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\ell}^{2}}{{k}^{4}} \cdot \frac{2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 59.2% accurate, 2.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot \left(k \cdot k\right)\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 (* (pow (/ (pow t_m 1.5) l) 2.0) (* 2.0 (* k k))))))
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 / (pow((pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * k))));
}
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 ** 1.5d0) / l) ** 2.0d0) * (2.0d0 * (k * k))))
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 / (Math.pow((Math.pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * k))));
}
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 / (math.pow((math.pow(t_m, 1.5) / l), 2.0) * (2.0 * (k * k))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 / Float64((Float64((t_m ^ 1.5) / l) ^ 2.0) * Float64(2.0 * Float64(k * k)))))
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 ^ 1.5) / l) ^ 2.0) * (2.0 * (k * k))));
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[(2.0 / N[(N[Power[N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(2.0 * N[(k * k), $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{2}{{\left(\frac{{t\_m}^{1.5}}{\ell}\right)}^{2} \cdot \left(2 \cdot \left(k \cdot k\right)\right)}
\end{array}
Derivation
  1. Initial program 53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 57.4% accurate, 3.6× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell}} \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 (* (* 2.0 (* k k)) (/ (* (pow t_m 2.0) (/ t_m l)) l)))))
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 / ((2.0 * (k * k)) * ((pow(t_m, 2.0) * (t_m / l)) / l)));
}
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 / ((2.0d0 * (k * k)) * (((t_m ** 2.0d0) * (t_m / l)) / l)))
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 / ((2.0 * (k * k)) * ((Math.pow(t_m, 2.0) * (t_m / l)) / l)));
}
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 / ((2.0 * (k * k)) * ((math.pow(t_m, 2.0) * (t_m / l)) / l)))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * Float64(k * k)) * Float64(Float64((t_m ^ 2.0) * Float64(t_m / l)) / l))))
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 / ((2.0 * (k * k)) * (((t_m ^ 2.0) * (t_m / l)) / l)));
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[(2.0 / N[(N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $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 \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell}}
\end{array}
Derivation
  1. Initial program 53.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 57.7% accurate, 24.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m \cdot t\_m}{\ell}\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 (* (* 2.0 (* k k)) (* (/ t_m l) (/ (* t_m t_m) l))))))
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 / ((2.0 * (k * k)) * ((t_m / l) * ((t_m * t_m) / l))));
}
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 / ((2.0d0 * (k * k)) * ((t_m / l) * ((t_m * t_m) / l))))
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 / ((2.0 * (k * k)) * ((t_m / l) * ((t_m * t_m) / l))));
}
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 / ((2.0 * (k * k)) * ((t_m / l) * ((t_m * t_m) / l))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 / Float64(Float64(2.0 * Float64(k * k)) * Float64(Float64(t_m / l) * Float64(Float64(t_m * t_m) / l)))))
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 / ((2.0 * (k * k)) * ((t_m / l) * ((t_m * t_m) / l))));
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[(2.0 / N[(N[(2.0 * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $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{2}{\left(2 \cdot \left(k \cdot k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m \cdot t\_m}{\ell}\right)}
\end{array}
Derivation
  1. Initial program 53.6%

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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