Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.5% → 90.9%
Time: 18.2s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 54.5% accurate, 1.0× speedup?

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

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

Alternative 1: 90.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;k\_m \leq 4 \cdot 10^{+68}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)}^{2}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l*49.6%

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

        \[\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+57.2%

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

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

        \[\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. add-cube-cbrt57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.29999999999999984e-56 < k < 3.99999999999999981e68

    1. Initial program 59.9%

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt62.8%

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

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

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

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

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

    if 3.99999999999999981e68 < k

    1. Initial program 35.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. Simplified35.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. Applied egg-rr13.0%

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

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

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

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

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

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

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

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

Alternative 2: 90.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;k\_m \leq 1.85 \cdot 10^{+68}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)}^{2}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l*49.6%

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

        \[\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+57.2%

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

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

        \[\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. add-cube-cbrt57.1%

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

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

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

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

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

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

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

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

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

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

    if 7.5999999999999995e-57 < k < 1.84999999999999999e68

    1. Initial program 59.9%

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt62.8%

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

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

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

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

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

    if 1.84999999999999999e68 < k

    1. Initial program 35.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. Simplified35.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. Applied egg-rr13.0%

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

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

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

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

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

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

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

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

Alternative 3: 90.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;k\_m \leq 1.4 \cdot 10^{+68}:\\
\;\;\;\;\frac{2}{\left(\sin k\_m \cdot \tan k\_m\right) \cdot {\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)}^{2}}\\

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


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

    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. Step-by-step derivation
      1. associate-*l*49.6%

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

        \[\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+57.2%

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

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

        \[\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. add-cube-cbrt57.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.60000000000000025e-57 < k < 1.4e68

    1. Initial program 59.9%

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{2}{{\left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2} \cdot \color{blue}{\left(\sqrt{\sin k \cdot \tan k} \cdot \sqrt{\sin k \cdot \tan k}\right)}} \]
      5. add-sqr-sqrt62.8%

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

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

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

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

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

    if 1.4e68 < k

    1. Initial program 35.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. Simplified35.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. Applied egg-rr13.0%

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

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

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

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

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

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

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

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

Alternative 4: 87.9% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 54.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. Simplified54.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. associate-*l*50.5%

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

        \[\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+57.7%

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

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

        \[\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. add-cube-cbrt57.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2000000000000004e-13 < k

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

Alternative 5: 86.8% accurate, 1.0× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 7.6:\\
\;\;\;\;\frac{2}{{\left(\frac{{t\_m}^{1.5}}{\ell} \cdot \left(k\_m \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k\_m}{t\_m}\right)\right)\right)\right)}^{2}}\\

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


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

    1. Initial program 54.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. 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. Applied egg-rr36.5%

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

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

    if 7.5999999999999996 < k

    1. Initial program 38.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. Simplified38.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. Applied egg-rr14.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 80.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 54.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. Simplified54.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. Applied egg-rr34.8%

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

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

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

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

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

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

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

    if 4.7000000000000002e-14 < k

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

Alternative 7: 77.8% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;k\_m \leq 2.5 \cdot 10^{-86}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell} \cdot \left(2 \cdot {k\_m}^{2}\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if k < 2.39999999999999994e-144

    1. Initial program 51.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.39999999999999994e-144 < k < 2.4999999999999999e-86

    1. Initial program 79.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. Simplified80.2%

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

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

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

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

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

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

    if 2.4999999999999999e-86 < k < 7e37

    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.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. div-inv57.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7e37 < k

    1. Initial program 39.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. Simplified39.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. Applied egg-rr13.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 78.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;k\_m \leq 9.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{2} \cdot \frac{t\_m}{\ell}}{\ell} \cdot \left(2 \cdot {k\_m}^{2}\right)}\\

\mathbf{elif}\;k\_m \leq 5 \cdot 10^{+34}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 5.49999999999999998e-146 or 9.19999999999999985e-86 < k < 4.9999999999999998e34

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.49999999999999998e-146 < k < 9.19999999999999985e-86

    1. Initial program 79.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. Simplified80.2%

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

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

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

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

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

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

    if 4.9999999999999998e34 < k

    1. Initial program 39.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. Simplified39.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. Applied egg-rr13.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.5 \cdot 10^{-146}:\\ \;\;\;\;\ell \cdot \left(\left(\frac{{t}^{-3}}{\sin k} \cdot \frac{2}{\tan k}\right) \cdot \left(\ell \cdot 0.5\right)\right)\\ \mathbf{elif}\;k \leq 9.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{2}{\frac{{t}^{2} \cdot \frac{t}{\ell}}{\ell} \cdot \left(2 \cdot {k}^{2}\right)}\\ \mathbf{elif}\;k \leq 5 \cdot 10^{+34}:\\ \;\;\;\;\ell \cdot \left(\left(\frac{{t}^{-3}}{\sin k} \cdot \frac{2}{\tan k}\right) \cdot \left(\ell \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2} \cdot \frac{t}{\cos k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 75.5% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;k\_m \leq 8.4 \cdot 10^{-13}:\\
\;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t\_m}^{3}}{\ell}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{t\_2}^{2} \cdot \frac{t\_m}{\cos k\_m}}\\


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

    1. Initial program 51.0%

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

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

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

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

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

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

    if 1.59999999999999988e-162 < k < 8.39999999999999955e-13

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

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

      \[\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/80.7%

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

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

    if 8.39999999999999955e-13 < k

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 75.5% accurate, 1.3× speedup?

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

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

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

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


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

    1. Initial program 51.0%

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

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

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

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

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

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

    if 1.59999999999999988e-162 < k < 6.5000000000000002e-12

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

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

      \[\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/80.7%

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

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

    if 6.5000000000000002e-12 < k

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(\color{blue}{\left(\frac{\sin k}{\ell} \cdot \frac{\sin k}{\ell}\right)} \cdot \frac{t}{\cos k}\right)} \]
      8. rem-square-sqrt27.4%

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

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

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

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

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

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

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

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

Alternative 11: 64.9% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

    if 1.35999999999999998e-69 < t

    1. Initial program 61.3%

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

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

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

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

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

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

Alternative 12: 63.5% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

    if 1.82e-69 < t

    1. Initial program 61.3%

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

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

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

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

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

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

Alternative 13: 59.1% accurate, 1.9× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 2.4 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{\frac{\left(2 \cdot {k\_m}^{2}\right) \cdot \frac{{t\_m}^{3}}{\ell}}{\ell}}\\

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


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

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

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

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

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

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

    if 2.4000000000000001e24 < k

    1. Initial program 40.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. Simplified40.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 65.3%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 56.2%

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

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

Alternative 14: 58.9% accurate, 1.9× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k\_m \leq 3.6 \cdot 10^{+24}:\\
\;\;\;\;\frac{2}{\frac{{t\_m}^{3}}{\ell} \cdot \frac{2 \cdot {k\_m}^{2}}{\ell}}\\

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


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

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

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

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

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

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

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

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

    if 3.59999999999999983e24 < k

    1. Initial program 40.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. Simplified40.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 65.3%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 56.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.6 \cdot 10^{+24}:\\ \;\;\;\;\frac{2}{\frac{{t}^{3}}{\ell} \cdot \frac{2 \cdot {k}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 58.5% accurate, 1.9× speedup?

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

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

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


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

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

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

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

    if 2.00000000000000018e25 < k

    1. Initial program 40.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. Simplified40.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 65.3%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
    8. Taylor expanded in k around 0 56.2%

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

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

Alternative 16: 58.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 45.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. Simplified45.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. Applied egg-rr18.3%

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

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

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

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

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

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

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

    if 6.39999999999999998e-72 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 52.3% accurate, 2.0× speedup?

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

\\
t\_s \cdot \frac{2}{{k\_m}^{4} \cdot \frac{t\_m}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 50.4%

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

    \[\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. Applied egg-rr30.6%

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

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

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

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

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

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

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

Alternative 18: 51.6% accurate, 2.0× speedup?

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

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

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

    \[\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.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*61.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 52.5%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
  8. Taylor expanded in k around 0 52.5%

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

    \[\leadsto 2 \cdot \frac{{\ell}^{2}}{t \cdot {k}^{4}} \]
  10. Add Preprocessing

Reproduce

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