Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.8% → 82.3%
Time: 22.1s
Alternatives: 21
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 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.8% 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: 82.3% 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 1.7 \cdot 10^{-92}:\\ \;\;\;\;\frac{2}{\left(t\_m \cdot \left({k}^{2} \cdot {\ell}^{-2}\right)\right) \cdot \frac{{\sin k}^{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t\_m \cdot \sqrt[3]{\sin k}}\right)}^{3} \cdot \frac{2}{\tan k}}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.7e-92)
    (/
     2.0
     (* (* t_m (* (pow k 2.0) (pow l -2.0))) (/ (pow (sin k) 2.0) (cos k))))
    (/
     (*
      (pow (/ (pow (cbrt l) 2.0) (* t_m (cbrt (sin k)))) 3.0)
      (/ 2.0 (tan k)))
     (+ 2.0 (pow (/ k t_m) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.7e-92) {
		tmp = 2.0 / ((t_m * (pow(k, 2.0) * pow(l, -2.0))) * (pow(sin(k), 2.0) / cos(k)));
	} else {
		tmp = (pow((pow(cbrt(l), 2.0) / (t_m * cbrt(sin(k)))), 3.0) * (2.0 / tan(k))) / (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 <= 1.7e-92) {
		tmp = 2.0 / ((t_m * (Math.pow(k, 2.0) * Math.pow(l, -2.0))) * (Math.pow(Math.sin(k), 2.0) / Math.cos(k)));
	} else {
		tmp = (Math.pow((Math.pow(Math.cbrt(l), 2.0) / (t_m * Math.cbrt(Math.sin(k)))), 3.0) * (2.0 / Math.tan(k))) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.7e-92)
		tmp = Float64(2.0 / Float64(Float64(t_m * Float64((k ^ 2.0) * (l ^ -2.0))) * Float64((sin(k) ^ 2.0) / cos(k))));
	else
		tmp = Float64(Float64((Float64((cbrt(l) ^ 2.0) / Float64(t_m * cbrt(sin(k)))) ^ 3.0) * Float64(2.0 / tan(k))) / 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, 1.7e-92], N[(2.0 / N[(N[(t$95$m * N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000001e-92 < t

    1. Initial program 65.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. Simplified61.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. associate-*l/61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 78.8% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;t\_m \leq 6.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{{\left(\frac{\ell \cdot \sqrt{2}}{k} \cdot \sqrt{\frac{1}{{t\_m}^{3}}}\right)}^{2}}{t\_3}\\

\mathbf{elif}\;t\_m \leq 1.65 \cdot 10^{-55}:\\
\;\;\;\;{\left(\ell \cdot \frac{\sqrt{\frac{\frac{2}{{t\_m}^{3}}}{t\_2}}}{\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t\_m}\right)\right)}\right)}^{2}\\

\mathbf{elif}\;t\_m \leq 6.6 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{\frac{\frac{{t\_m}^{3}}{\ell} \cdot \left(t\_3 \cdot t\_2\right)}{\ell}}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if t < 3.6e-94

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e-94 < t < 6.6999999999999996e-68

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

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

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

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

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

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

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

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

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

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

    if 6.6999999999999996e-68 < t < 1.65e-55

    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. Simplified80.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. add-sqr-sqrt61.2%

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

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

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

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

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

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

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

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

    if 1.65e-55 < t < 6.6e16

    1. Initial program 67.8%

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

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

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

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

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

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

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

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

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

    if 6.6e16 < t

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

      \[\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-*l/59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 78.6% accurate, 0.7× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.5 \cdot 10^{-94}:\\ \;\;\;\;\frac{2}{\left(t\_m \cdot \left({k}^{2} \cdot {\ell}^{-2}\right)\right) \cdot \frac{{\sin k}^{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{\tan k} \cdot \frac{{\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t\_m}\right)}^{3}}{\sin k}}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 2.5e-94)
    (/
     2.0
     (* (* t_m (* (pow k 2.0) (pow l -2.0))) (/ (pow (sin k) 2.0) (cos k))))
    (/
     (* (/ 2.0 (tan k)) (/ (pow (/ (pow (cbrt l) 2.0) t_m) 3.0) (sin k)))
     (+ 2.0 (pow (/ k t_m) 2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.5e-94) {
		tmp = 2.0 / ((t_m * (pow(k, 2.0) * pow(l, -2.0))) * (pow(sin(k), 2.0) / cos(k)));
	} else {
		tmp = ((2.0 / tan(k)) * (pow((pow(cbrt(l), 2.0) / t_m), 3.0) / sin(k))) / (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 <= 2.5e-94) {
		tmp = 2.0 / ((t_m * (Math.pow(k, 2.0) * Math.pow(l, -2.0))) * (Math.pow(Math.sin(k), 2.0) / Math.cos(k)));
	} else {
		tmp = ((2.0 / Math.tan(k)) * (Math.pow((Math.pow(Math.cbrt(l), 2.0) / t_m), 3.0) / Math.sin(k))) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 2.5e-94)
		tmp = Float64(2.0 / Float64(Float64(t_m * Float64((k ^ 2.0) * (l ^ -2.0))) * Float64((sin(k) ^ 2.0) / cos(k))));
	else
		tmp = Float64(Float64(Float64(2.0 / tan(k)) * Float64((Float64((cbrt(l) ^ 2.0) / t_m) ^ 3.0) / sin(k))) / 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, 2.5e-94], N[(2.0 / N[(N[(t$95$m * N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision], 3.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4999999999999998e-94 < t

    1. Initial program 65.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. Simplified61.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. associate-*l/61.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 78.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e-96 < t < 3.19999999999999996e205

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999996e205 < t

    1. Initial program 76.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. Simplified76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.1% accurate, 0.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 3.1 \cdot 10^{-98}:\\ \;\;\;\;\frac{2}{\left(t\_m \cdot \left({k}^{2} \cdot {\ell}^{-2}\right)\right) \cdot \frac{{\sin k}^{2}}{\cos k}}\\ \mathbf{elif}\;t\_m \leq 2.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{{\left(\sqrt{\frac{1}{{t\_m}^{3}}} \cdot \left(\ell \cdot \frac{\sqrt{2}}{k}\right)\right)}^{2}}{2 + {\left(\frac{k}{t\_m}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k}\right)}^{3}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 3.1e-98)
    (/
     2.0
     (* (* t_m (* (pow k 2.0) (pow l -2.0))) (/ (pow (sin k) 2.0) (cos k))))
    (if (<= t_m 2.8e+102)
      (/
       (pow (* (sqrt (/ 1.0 (pow t_m 3.0))) (* l (/ (sqrt 2.0) k))) 2.0)
       (+ 2.0 (pow (/ k t_m) 2.0)))
      (/
       2.0
       (* (* 2.0 k) (pow (* (/ t_m (pow (cbrt l) 2.0)) (cbrt 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 <= 3.1e-98) {
		tmp = 2.0 / ((t_m * (pow(k, 2.0) * pow(l, -2.0))) * (pow(sin(k), 2.0) / cos(k)));
	} else if (t_m <= 2.8e+102) {
		tmp = pow((sqrt((1.0 / pow(t_m, 3.0))) * (l * (sqrt(2.0) / k))), 2.0) / (2.0 + pow((k / t_m), 2.0));
	} else {
		tmp = 2.0 / ((2.0 * k) * pow(((t_m / pow(cbrt(l), 2.0)) * cbrt(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 <= 3.1e-98) {
		tmp = 2.0 / ((t_m * (Math.pow(k, 2.0) * Math.pow(l, -2.0))) * (Math.pow(Math.sin(k), 2.0) / Math.cos(k)));
	} else if (t_m <= 2.8e+102) {
		tmp = Math.pow((Math.sqrt((1.0 / Math.pow(t_m, 3.0))) * (l * (Math.sqrt(2.0) / k))), 2.0) / (2.0 + Math.pow((k / t_m), 2.0));
	} else {
		tmp = 2.0 / ((2.0 * k) * Math.pow(((t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(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 <= 3.1e-98)
		tmp = Float64(2.0 / Float64(Float64(t_m * Float64((k ^ 2.0) * (l ^ -2.0))) * Float64((sin(k) ^ 2.0) / cos(k))));
	elseif (t_m <= 2.8e+102)
		tmp = Float64((Float64(sqrt(Float64(1.0 / (t_m ^ 3.0))) * Float64(l * Float64(sqrt(2.0) / k))) ^ 2.0) / Float64(2.0 + (Float64(k / t_m) ^ 2.0)));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * (Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(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, 3.1e-98], N[(2.0 / N[(N[(t$95$m * N[(N[Power[k, 2.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.8e+102], N[(N[Power[N[(N[Sqrt[N[(1.0 / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(l * N[(N[Sqrt[2.0], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[Power[N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1e-98 < t < 2.80000000000000018e102

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.80000000000000018e102 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 46.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. 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. associate-*l/43.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e-99 < t < 4.19999999999999979e145

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

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

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

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

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

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

    if 4.19999999999999979e145 < t

    1. Initial program 62.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. Simplified62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9e-95 < t < 4.19999999999999979e145

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

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

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

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

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

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

    if 4.19999999999999979e145 < t

    1. Initial program 62.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. Simplified62.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 13500000000000:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k}\right)}^{3}}\\ \mathbf{elif}\;k \leq 1.35 \cdot 10^{+142}:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{0.5 - \frac{\cos \left(2 \cdot k\right)}{2}}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\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 (<= k 13500000000000.0)
    (/ 2.0 (* (* 2.0 k) (pow (* (/ t_m (pow (cbrt l) 2.0)) (cbrt k)) 3.0)))
    (if (<= k 1.35e+142)
      (/
       2.0
       (*
        (/ (* t_m (pow k 2.0)) (pow l 2.0))
        (/ (- 0.5 (/ (cos (* 2.0 k)) 2.0)) (cos k))))
      (/ 2.0 (pow (* (pow k 2.0) (/ (sqrt t_m) 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 (k <= 13500000000000.0) {
		tmp = 2.0 / ((2.0 * k) * pow(((t_m / pow(cbrt(l), 2.0)) * cbrt(k)), 3.0));
	} else if (k <= 1.35e+142) {
		tmp = 2.0 / (((t_m * pow(k, 2.0)) / pow(l, 2.0)) * ((0.5 - (cos((2.0 * k)) / 2.0)) / cos(k)));
	} else {
		tmp = 2.0 / pow((pow(k, 2.0) * (sqrt(t_m) / l)), 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 (k <= 13500000000000.0) {
		tmp = 2.0 / ((2.0 * k) * Math.pow(((t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(k)), 3.0));
	} else if (k <= 1.35e+142) {
		tmp = 2.0 / (((t_m * Math.pow(k, 2.0)) / Math.pow(l, 2.0)) * ((0.5 - (Math.cos((2.0 * k)) / 2.0)) / Math.cos(k)));
	} else {
		tmp = 2.0 / Math.pow((Math.pow(k, 2.0) * (Math.sqrt(t_m) / 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 (k <= 13500000000000.0)
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * (Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(k)) ^ 3.0)));
	elseif (k <= 1.35e+142)
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (k ^ 2.0)) / (l ^ 2.0)) * Float64(Float64(0.5 - Float64(cos(Float64(2.0 * k)) / 2.0)) / cos(k))));
	else
		tmp = Float64(2.0 / (Float64((k ^ 2.0) * Float64(sqrt(t_m) / l)) ^ 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[k, 13500000000000.0], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[Power[N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.35e+142], N[(2.0 / N[(N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[Power[N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{elif}\;k \leq 1.35 \cdot 10^{+142}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {k}^{2}}{{\ell}^{2}} \cdot \frac{0.5 - \frac{\cos \left(2 \cdot k\right)}{2}}{\cos k}}\\

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


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

    1. Initial program 55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.35e13 < k < 1.34999999999999991e142

    1. Initial program 45.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. Simplified46.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 t around 0 82.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*82.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{\color{blue}{0.5} - \frac{\cos \left(k + k\right)}{2}}{\cos k}} \]
      5. count-282.3%

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

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

    if 1.34999999999999991e142 < k

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow227.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 1.50000000000000007e233

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000007e233 < (*.f64 l l)

    1. Initial program 32.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified42.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 47.2%

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

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

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

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

        \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\sqrt[3]{{t}^{3}}}{\sqrt[3]{\ell \cdot \ell}}\right)}}^{3} \cdot \left(2 \cdot {k}^{2}\right)} \]
      5. unpow338.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 {k}^{2}\right)} \]
      6. add-cbrt-cube45.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.7% 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^{-113}:\\ \;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot k\right) \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}} \cdot \sqrt[3]{k}\right)}^{3}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 4e-113)
    (/ 2.0 (pow (* (pow k 2.0) (/ (sqrt t_m) l)) 2.0))
    (/ 2.0 (* (* 2.0 k) (pow (* (/ t_m (pow (cbrt l) 2.0)) (cbrt 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 <= 4e-113) {
		tmp = 2.0 / pow((pow(k, 2.0) * (sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * k) * pow(((t_m / pow(cbrt(l), 2.0)) * cbrt(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 <= 4e-113) {
		tmp = 2.0 / Math.pow((Math.pow(k, 2.0) * (Math.sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * k) * Math.pow(((t_m / Math.pow(Math.cbrt(l), 2.0)) * Math.cbrt(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 <= 4e-113)
		tmp = Float64(2.0 / (Float64((k ^ 2.0) * Float64(sqrt(t_m) / l)) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * k) * (Float64(Float64(t_m / (cbrt(l) ^ 2.0)) * cbrt(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, 4e-113], N[(2.0 / N[Power[N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * k), $MachinePrecision] * N[Power[N[(N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[k, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow215.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999991e-113 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 67.8% 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 4 \cdot 10^{-113}:\\ \;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\ \mathbf{elif}\;t\_m \leq 2.3 \cdot 10^{+85}:\\ \;\;\;\;\frac{2}{\frac{{t\_m}^{3} \cdot \left(2 \cdot \frac{{k}^{2}}{\ell}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot \frac{2}{{\left(k \cdot {t\_m}^{1.5}\right)}^{2}}}{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 4e-113)
    (/ 2.0 (pow (* (pow k 2.0) (/ (sqrt t_m) l)) 2.0))
    (if (<= t_m 2.3e+85)
      (/ 2.0 (/ (* (pow t_m 3.0) (* 2.0 (/ (pow k 2.0) l))) l))
      (/
       (* (* l l) (/ 2.0 (pow (* k (pow t_m 1.5)) 2.0)))
       (+ 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 <= 4e-113) {
		tmp = 2.0 / pow((pow(k, 2.0) * (sqrt(t_m) / l)), 2.0);
	} else if (t_m <= 2.3e+85) {
		tmp = 2.0 / ((pow(t_m, 3.0) * (2.0 * (pow(k, 2.0) / l))) / l);
	} else {
		tmp = ((l * l) * (2.0 / pow((k * pow(t_m, 1.5)), 2.0))) / (2.0 + pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 4d-113) then
        tmp = 2.0d0 / (((k ** 2.0d0) * (sqrt(t_m) / l)) ** 2.0d0)
    else if (t_m <= 2.3d+85) then
        tmp = 2.0d0 / (((t_m ** 3.0d0) * (2.0d0 * ((k ** 2.0d0) / l))) / l)
    else
        tmp = ((l * l) * (2.0d0 / ((k * (t_m ** 1.5d0)) ** 2.0d0))) / (2.0d0 + ((k / t_m) ** 2.0d0))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 4e-113) {
		tmp = 2.0 / Math.pow((Math.pow(k, 2.0) * (Math.sqrt(t_m) / l)), 2.0);
	} else if (t_m <= 2.3e+85) {
		tmp = 2.0 / ((Math.pow(t_m, 3.0) * (2.0 * (Math.pow(k, 2.0) / l))) / l);
	} else {
		tmp = ((l * l) * (2.0 / Math.pow((k * Math.pow(t_m, 1.5)), 2.0))) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 4e-113:
		tmp = 2.0 / math.pow((math.pow(k, 2.0) * (math.sqrt(t_m) / l)), 2.0)
	elif t_m <= 2.3e+85:
		tmp = 2.0 / ((math.pow(t_m, 3.0) * (2.0 * (math.pow(k, 2.0) / l))) / l)
	else:
		tmp = ((l * l) * (2.0 / math.pow((k * math.pow(t_m, 1.5)), 2.0))) / (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 <= 4e-113)
		tmp = Float64(2.0 / (Float64((k ^ 2.0) * Float64(sqrt(t_m) / l)) ^ 2.0));
	elseif (t_m <= 2.3e+85)
		tmp = Float64(2.0 / Float64(Float64((t_m ^ 3.0) * Float64(2.0 * Float64((k ^ 2.0) / l))) / l));
	else
		tmp = Float64(Float64(Float64(l * l) * Float64(2.0 / (Float64(k * (t_m ^ 1.5)) ^ 2.0))) / Float64(2.0 + (Float64(k / t_m) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 4e-113)
		tmp = 2.0 / (((k ^ 2.0) * (sqrt(t_m) / l)) ^ 2.0);
	elseif (t_m <= 2.3e+85)
		tmp = 2.0 / (((t_m ^ 3.0) * (2.0 * ((k ^ 2.0) / l))) / l);
	else
		tmp = ((l * l) * (2.0 / ((k * (t_m ^ 1.5)) ^ 2.0))) / (2.0 + ((k / t_m) ^ 2.0));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4e-113], N[(2.0 / N[Power[N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.3e+85], N[(2.0 / N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] * N[(2.0 * N[(N[Power[k, 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] * N[(2.0 / N[Power[N[(k * N[Power[t$95$m, 1.5], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow215.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999991e-113 < t < 2.2999999999999999e85

    1. Initial program 68.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. Simplified70.3%

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{t}^{3} \cdot \frac{2 \cdot {k}^{2}}{\ell}}{\ell}}} \]
      2. associate-/l*66.5%

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

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

    if 2.2999999999999999e85 < t

    1. Initial program 61.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. Simplified54.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 64.0% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.1 \cdot 10^{-26}:\\ \;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{{\left(\frac{t\_m}{\sqrt[3]{\ell}}\right)}^{3}}{\ell}}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.1e-26)
    (/ 2.0 (pow (* (pow k 2.0) (/ (sqrt t_m) l)) 2.0))
    (/ 2.0 (* (* 2.0 (pow k 2.0)) (/ (pow (/ t_m (cbrt l)) 3.0) l))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.1e-26) {
		tmp = 2.0 / pow((pow(k, 2.0) * (sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * pow(k, 2.0)) * (pow((t_m / cbrt(l)), 3.0) / l));
	}
	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.1e-26) {
		tmp = 2.0 / Math.pow((Math.pow(k, 2.0) * (Math.sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * (Math.pow((t_m / Math.cbrt(l)), 3.0) / l));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.1e-26)
		tmp = Float64(2.0 / (Float64((k ^ 2.0) * Float64(sqrt(t_m) / l)) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * Float64((Float64(t_m / cbrt(l)) ^ 3.0) / l)));
	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.1e-26], N[(2.0 / N[Power[N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(t$95$m / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow221.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e-26 < t

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow221.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.0000000000000002e-27 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 61.8% accurate, 1.3× speedup?

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000007e-92 < t

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

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

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

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

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

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

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

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

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

Alternative 15: 63.7% 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 3 \cdot 10^{-26}:\\ \;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{t\_m \cdot \frac{{t\_m}^{2}}{\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 3e-26)
    (/ 2.0 (pow (* (pow k 2.0) (/ (sqrt t_m) l)) 2.0))
    (/ 2.0 (* (* 2.0 (pow k 2.0)) (/ (* t_m (/ (pow t_m 2.0) l)) l))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 3e-26) {
		tmp = 2.0 / pow((pow(k, 2.0) * (sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * pow(k, 2.0)) * ((t_m * (pow(t_m, 2.0) / l)) / l));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 3d-26) then
        tmp = 2.0d0 / (((k ** 2.0d0) * (sqrt(t_m) / l)) ** 2.0d0)
    else
        tmp = 2.0d0 / ((2.0d0 * (k ** 2.0d0)) * ((t_m * ((t_m ** 2.0d0) / l)) / l))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 3e-26) {
		tmp = 2.0 / Math.pow((Math.pow(k, 2.0) * (Math.sqrt(t_m) / l)), 2.0);
	} else {
		tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * ((t_m * (Math.pow(t_m, 2.0) / l)) / l));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 3e-26:
		tmp = 2.0 / math.pow((math.pow(k, 2.0) * (math.sqrt(t_m) / l)), 2.0)
	else:
		tmp = 2.0 / ((2.0 * math.pow(k, 2.0)) * ((t_m * (math.pow(t_m, 2.0) / l)) / l))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 3e-26)
		tmp = Float64(2.0 / (Float64((k ^ 2.0) * Float64(sqrt(t_m) / l)) ^ 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * Float64(Float64(t_m * Float64((t_m ^ 2.0) / l)) / l)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 3e-26)
		tmp = 2.0 / (((k ^ 2.0) * (sqrt(t_m) / l)) ^ 2.0);
	else
		tmp = 2.0 / ((2.0 * (k ^ 2.0)) * ((t_m * ((t_m ^ 2.0) / l)) / l));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 3e-26], N[(2.0 / N[Power[N[(N[Power[k, 2.0], $MachinePrecision] * N[(N[Sqrt[t$95$m], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / 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 3 \cdot 10^{-26}:\\
\;\;\;\;\frac{2}{{\left({k}^{2} \cdot \frac{\sqrt{t\_m}}{\ell}\right)}^{2}}\\

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


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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}} \cdot \sqrt{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}}} \]
      2. pow221.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000012e-26 < t

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

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

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

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

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

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

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

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

Alternative 16: 59.6% accurate, 1.9× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 2.7 \cdot 10^{-96}:\\ \;\;\;\;\frac{2}{{k}^{4} \cdot \left(t\_m \cdot {\ell}^{-2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(2 \cdot {k}^{2}\right) \cdot \frac{t\_m \cdot \frac{{t\_m}^{2}}{\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 2.7e-96)
    (/ 2.0 (* (pow k 4.0) (* t_m (pow l -2.0))))
    (/ 2.0 (* (* 2.0 (pow k 2.0)) (/ (* t_m (/ (pow t_m 2.0) l)) l))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.7e-96) {
		tmp = 2.0 / (pow(k, 4.0) * (t_m * pow(l, -2.0)));
	} else {
		tmp = 2.0 / ((2.0 * pow(k, 2.0)) * ((t_m * (pow(t_m, 2.0) / l)) / l));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 2.7d-96) then
        tmp = 2.0d0 / ((k ** 4.0d0) * (t_m * (l ** (-2.0d0))))
    else
        tmp = 2.0d0 / ((2.0d0 * (k ** 2.0d0)) * ((t_m * ((t_m ** 2.0d0) / l)) / l))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 2.7e-96) {
		tmp = 2.0 / (Math.pow(k, 4.0) * (t_m * Math.pow(l, -2.0)));
	} else {
		tmp = 2.0 / ((2.0 * Math.pow(k, 2.0)) * ((t_m * (Math.pow(t_m, 2.0) / l)) / l));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 2.7e-96:
		tmp = 2.0 / (math.pow(k, 4.0) * (t_m * math.pow(l, -2.0)))
	else:
		tmp = 2.0 / ((2.0 * math.pow(k, 2.0)) * ((t_m * (math.pow(t_m, 2.0) / l)) / l))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 2.7e-96)
		tmp = Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m * (l ^ -2.0))));
	else
		tmp = Float64(2.0 / Float64(Float64(2.0 * (k ^ 2.0)) * Float64(Float64(t_m * Float64((t_m ^ 2.0) / l)) / l)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 2.7e-96)
		tmp = 2.0 / ((k ^ 4.0) * (t_m * (l ^ -2.0)));
	else
		tmp = 2.0 / ((2.0 * (k ^ 2.0)) * ((t_m * ((t_m ^ 2.0) / l)) / l));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.7e-96], N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(2.0 * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[(N[Power[t$95$m, 2.0], $MachinePrecision] / 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.7 \cdot 10^{-96}:\\
\;\;\;\;\frac{2}{{k}^{4} \cdot \left(t\_m \cdot {\ell}^{-2}\right)}\\

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Step-by-step derivation
      1. pow155.7%

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

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

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

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

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

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

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

    if 2.7e-96 < t

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

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

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

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

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

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

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

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

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

Alternative 17: 58.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Step-by-step derivation
      1. pow155.7%

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

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

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

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

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

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

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

    if 5.49999999999999968e-93 < t

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

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

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

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

Alternative 18: 58.8% accurate, 1.9× speedup?

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Step-by-step derivation
      1. pow155.7%

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

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

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

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

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

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

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

    if 4.5000000000000003e-99 < t

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

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

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

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

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

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

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

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

Alternative 19: 58.7% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 46.8%

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
    8. Step-by-step derivation
      1. associate-/l*55.7%

        \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
    9. Simplified55.7%

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
    10. Step-by-step derivation
      1. pow155.7%

        \[\leadsto \frac{2}{\color{blue}{{\left({k}^{4} \cdot \frac{t}{{\ell}^{2}}\right)}^{1}}} \]
      2. div-inv55.7%

        \[\leadsto \frac{2}{{\left({k}^{4} \cdot \color{blue}{\left(t \cdot \frac{1}{{\ell}^{2}}\right)}\right)}^{1}} \]
      3. pow-flip56.4%

        \[\leadsto \frac{2}{{\left({k}^{4} \cdot \left(t \cdot \color{blue}{{\ell}^{\left(-2\right)}}\right)\right)}^{1}} \]
      4. metadata-eval56.4%

        \[\leadsto \frac{2}{{\left({k}^{4} \cdot \left(t \cdot {\ell}^{\color{blue}{-2}}\right)\right)}^{1}} \]
    11. Applied egg-rr56.4%

      \[\leadsto \frac{2}{\color{blue}{{\left({k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)\right)}^{1}}} \]
    12. Step-by-step derivation
      1. unpow156.4%

        \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)}} \]
    13. Simplified56.4%

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)}} \]

    if 8.7999999999999996e-97 < t

    1. Initial program 65.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. Simplified65.5%

      \[\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 61.2%

      \[\leadsto \frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \color{blue}{\left(2 \cdot {k}^{2}\right)}} \]
    5. Step-by-step derivation
      1. associate-*l/62.3%

        \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
    6. Applied egg-rr62.3%

      \[\leadsto \frac{2}{\color{blue}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.8 \cdot 10^{-97}:\\ \;\;\;\;\frac{2}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{{t}^{3}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 50.8% accurate, 2.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(2 \cdot \frac{{\ell}^{2}}{t\_m \cdot {k}^{4}}\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* 2.0 (/ (pow l 2.0) (* t_m (pow k 4.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 * (pow(l, 2.0) / (t_m * pow(k, 4.0))));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * (2.0d0 * ((l ** 2.0d0) / (t_m * (k ** 4.0d0))))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 * (Math.pow(l, 2.0) / (t_m * Math.pow(k, 4.0))));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (2.0 * (math.pow(l, 2.0) / (t_m * math.pow(k, 4.0))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 * Float64((l ^ 2.0) / Float64(t_m * (k ^ 4.0)))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (2.0 * ((l ^ 2.0) / (t_m * (k ^ 4.0))));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 * N[(N[Power[l, 2.0], $MachinePrecision] / N[(t$95$m * N[Power[k, 4.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 \left(2 \cdot \frac{{\ell}^{2}}{t\_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 53.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. Simplified53.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 58.5%

    \[\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*58.5%

      \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
    2. times-frac60.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
  6. Simplified60.9%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
  7. Taylor expanded in k around 0 52.4%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
  8. Step-by-step derivation
    1. associate-/l*53.7%

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
  9. Simplified53.7%

    \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
  10. Taylor expanded in k around 0 52.4%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  11. Final simplification52.4%

    \[\leadsto 2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}} \]
  12. Add Preprocessing

Alternative 21: 51.6% 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}{{k}^{4} \cdot \left(t\_m \cdot {\ell}^{-2}\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 k 4.0) (* t_m (pow l -2.0))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 / (pow(k, 4.0) * (t_m * pow(l, -2.0))));
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * (2.0d0 / ((k ** 4.0d0) * (t_m * (l ** (-2.0d0)))))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 / (Math.pow(k, 4.0) * (t_m * Math.pow(l, -2.0))));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (2.0 / (math.pow(k, 4.0) * (t_m * math.pow(l, -2.0))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 / Float64((k ^ 4.0) * Float64(t_m * (l ^ -2.0)))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (2.0 / ((k ^ 4.0) * (t_m * (l ^ -2.0))));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[Power[k, 4.0], $MachinePrecision] * N[(t$95$m * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{{k}^{4} \cdot \left(t\_m \cdot {\ell}^{-2}\right)}
\end{array}
Derivation
  1. Initial program 53.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. Simplified53.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 58.5%

    \[\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*58.5%

      \[\leadsto \frac{2}{\frac{\color{blue}{\left({k}^{2} \cdot t\right) \cdot {\sin k}^{2}}}{{\ell}^{2} \cdot \cos k}} \]
    2. times-frac60.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
  6. Simplified60.9%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot t}{{\ell}^{2}} \cdot \frac{{\sin k}^{2}}{\cos k}}} \]
  7. Taylor expanded in k around 0 52.4%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
  8. Step-by-step derivation
    1. associate-/l*53.7%

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
  9. Simplified53.7%

    \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \frac{t}{{\ell}^{2}}}} \]
  10. Step-by-step derivation
    1. pow153.7%

      \[\leadsto \frac{2}{\color{blue}{{\left({k}^{4} \cdot \frac{t}{{\ell}^{2}}\right)}^{1}}} \]
    2. div-inv53.7%

      \[\leadsto \frac{2}{{\left({k}^{4} \cdot \color{blue}{\left(t \cdot \frac{1}{{\ell}^{2}}\right)}\right)}^{1}} \]
    3. pow-flip54.1%

      \[\leadsto \frac{2}{{\left({k}^{4} \cdot \left(t \cdot \color{blue}{{\ell}^{\left(-2\right)}}\right)\right)}^{1}} \]
    4. metadata-eval54.1%

      \[\leadsto \frac{2}{{\left({k}^{4} \cdot \left(t \cdot {\ell}^{\color{blue}{-2}}\right)\right)}^{1}} \]
  11. Applied egg-rr54.1%

    \[\leadsto \frac{2}{\color{blue}{{\left({k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)\right)}^{1}}} \]
  12. Step-by-step derivation
    1. unpow154.1%

      \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)}} \]
  13. Simplified54.1%

    \[\leadsto \frac{2}{\color{blue}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)}} \]
  14. Final simplification54.1%

    \[\leadsto \frac{2}{{k}^{4} \cdot \left(t \cdot {\ell}^{-2}\right)} \]
  15. Add Preprocessing

Reproduce

?
herbie shell --seed 2024067 
(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))))