Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.1% → 89.2%
Time: 23.2s
Alternatives: 21
Speedup: 2.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 54.1% 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: 89.2% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 2.05e-54 < t

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.9% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 4.80000000000000026e-54 < t

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_m \leq 7.4 \cdot 10^{+136}:\\
\;\;\;\;t\_3 \cdot \frac{{\left(\frac{\sqrt[3]{\ell \cdot \frac{2}{\sin k}}}{t\_m}\right)}^{3}}{2 + t\_2}\\

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


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

    1. Initial program 46.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. Simplified52.4%

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

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

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

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

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

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

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

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

    if 2.15000000000000005e-55 < t < 7.4000000000000002e136

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.4000000000000002e136 < t

    1. Initial program 83.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*88.2%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.3% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;t\_m \leq 6.6 \cdot 10^{+136}:\\
\;\;\;\;t\_3 \cdot \frac{{\left(\frac{\sqrt[3]{\ell \cdot t\_4}}{t\_m}\right)}^{3}}{t\_2}\\

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


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

    1. Initial program 46.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. Simplified52.4%

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

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

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

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

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

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

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

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

    if 1.15999999999999996e-55 < t < 6.59999999999999984e136

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.59999999999999984e136 < t

    1. Initial program 83.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. Simplified88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 2.8000000000000002e-54 < t < 1.25e207

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e207 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 4.2e-54 < t < 3.9e189

    1. Initial program 76.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. Simplified80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9e189 < t

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

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. add-cube-cbrt55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 46.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. Simplified52.4%

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

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

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

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

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

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

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

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

    if 1.35000000000000002e-55 < t < 8.00000000000000047e136

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.00000000000000047e136 < t

    1. Initial program 83.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. Simplified88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 85.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;t\_m \leq 2.9 \cdot 10^{+74}:\\
\;\;\;\;t\_3 \cdot \frac{\frac{2}{\sin k} \cdot \frac{\ell}{{t\_m}^{3}}}{2 + t\_2}\\

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 3.8000000000000002e-54 < t < 2.9000000000000002e74

    1. Initial program 80.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. Simplified83.3%

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

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

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

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

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

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

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

    if 2.9000000000000002e74 < t < 5.80000000000000004e153

    1. Initial program 74.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow374.9%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\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. times-frac95.9%

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

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

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

    if 5.80000000000000004e153 < t

    1. Initial program 80.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. Simplified85.8%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. add-cube-cbrt55.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3.8 \cdot 10^{-54}:\\ \;\;\;\;\left(2 \cdot \frac{\ell}{{k}^{2} \cdot \left(t \cdot \sin k\right)}\right) \cdot \frac{\ell}{\tan k}\\ \mathbf{elif}\;t \leq 2.9 \cdot 10^{+74}:\\ \;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\frac{2}{\sin k} \cdot \frac{\ell}{{t}^{3}}}{2 + {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+153}:\\ \;\;\;\;\frac{2}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} + 1\right)\right) \cdot \left(\tan k \cdot \left(\sin k \cdot \left(\frac{{t}^{2}}{\ell} \cdot \frac{t}{\ell}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{{\left(\sqrt[3]{k}\right)}^{2}}}{t}\right)}^{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 79.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t\_m \leq 1.12 \cdot 10^{+74}:\\
\;\;\;\;t\_3 \cdot \frac{\frac{2}{\sin k} \cdot \frac{\ell}{{t\_m}^{3}}}{2 + t\_2}\\

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-55 < t < 1.12000000000000003e74

    1. Initial program 80.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. Simplified83.3%

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

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

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

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

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

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

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

    if 1.12000000000000003e74 < t

    1. Initial program 77.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. Add Preprocessing
    3. Step-by-step derivation
      1. unpow377.4%

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right) \cdot t}}{\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. times-frac91.2%

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

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

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

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

Alternative 10: 81.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 3.49999999999999982e-54 < t < 2.85000000000000019e87

    1. Initial program 80.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. Simplified85.2%

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

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

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

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

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

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

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

    if 2.85000000000000019e87 < t

    1. Initial program 76.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative76.8%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 73.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.6%

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

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

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

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

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

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

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

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

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

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

    if 1.20000000000000003e-4 < k < 3.4e151

    1. Initial program 39.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. Simplified44.5%

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

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

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

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

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

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

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

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

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

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

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

    if 3.4e151 < k

    1. Initial program 46.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. Add Preprocessing
    3. Step-by-step derivation
      1. +-commutative46.5%

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right) \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 62.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*62.2%

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

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

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

Alternative 12: 77.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 6.00000000000000018e-54 < t < 5.49999999999999981e102

    1. Initial program 82.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. Simplified86.8%

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

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

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

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

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

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

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

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

    if 5.49999999999999981e102 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 78.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 6.39999999999999997e-54 < t

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 74.1% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 5.50000000000000046e-54 < t

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 73.1% accurate, 1.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \frac{\ell}{k \cdot {t\_m}^{3}}\\


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

    1. Initial program 47.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. Simplified52.9%

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

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

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

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

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

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

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

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

    if 6.39999999999999997e-54 < t

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

Alternative 16: 62.5% accurate, 1.3× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 5.6 \cdot 10^{+139}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t\_m}^{3}}\\

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


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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999997e139 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 62.4% accurate, 1.3× speedup?

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 2.1 \cdot 10^{+145}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\ell}{\sin k \cdot {t\_m}^{3}}\\

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


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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999989e145 < k

    1. Initial program 42.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. Add Preprocessing
    3. Taylor expanded in t around 0 55.0%

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

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

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

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

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

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

Alternative 18: 63.5% accurate, 2.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{\tan k} \cdot \frac{\ell}{k \cdot {t\_m}^{3}}\\


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

    1. Initial program 45.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. Add Preprocessing
    3. Taylor expanded in t around 0 62.0%

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

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

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

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

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

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

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

    if 1.44999999999999995e-58 < t

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

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

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

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

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

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

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

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

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

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

Alternative 19: 56.7% accurate, 2.0× speedup?

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

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

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


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

    1. Initial program 47.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. Add Preprocessing
    3. Taylor expanded in t around 0 62.7%

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

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

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

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

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

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

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

    if 1.1200000000000001e-38 < t

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

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

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

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

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

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

Alternative 20: 50.9% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(2 \cdot \frac{{\ell}^{2}}{t\_m \cdot {k}^{4}}\right)
\end{array}
Derivation
  1. Initial program 55.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. Add Preprocessing
  3. Taylor expanded in t around 0 59.9%

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

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

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

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

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

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

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

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

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

Alternative 21: 51.7% accurate, 2.0× speedup?

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

\\
t\_s \cdot \frac{2}{{k}^{4} \cdot \frac{t\_m}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 55.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. Add Preprocessing
  3. Taylor expanded in t around 0 59.9%

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

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

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

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

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

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

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

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

Reproduce

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