Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.7% → 96.2%
Time: 17.4s
Alternatives: 18
Speedup: 21.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 18 alternatives:

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

Initial Program: 35.7% 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: 96.2% accurate, 1.7× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 3.8 \cdot 10^{+96}:\\ \;\;\;\;\frac{\frac{2 \cdot \ell}{t\_m \cdot k}}{\sin k \cdot \left(k \cdot \frac{\tan k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{2}{k} \cdot \frac{\frac{\ell}{\tan k}}{t\_m \cdot \sin k}}{k}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 3.8e+96)
    (/ (/ (* 2.0 l) (* t_m k)) (* (sin k) (* k (/ (tan k) l))))
    (* l (/ (* (/ 2.0 k) (/ (/ l (tan k)) (* t_m (sin 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 <= 3.8e+96) {
		tmp = ((2.0 * l) / (t_m * k)) / (sin(k) * (k * (tan(k) / l)));
	} else {
		tmp = l * (((2.0 / k) * ((l / tan(k)) / (t_m * sin(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 <= 3.8d+96) then
        tmp = ((2.0d0 * l) / (t_m * k)) / (sin(k) * (k * (tan(k) / l)))
    else
        tmp = l * (((2.0d0 / k) * ((l / tan(k)) / (t_m * sin(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 <= 3.8e+96) {
		tmp = ((2.0 * l) / (t_m * k)) / (Math.sin(k) * (k * (Math.tan(k) / l)));
	} else {
		tmp = l * (((2.0 / k) * ((l / Math.tan(k)) / (t_m * Math.sin(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 <= 3.8e+96:
		tmp = ((2.0 * l) / (t_m * k)) / (math.sin(k) * (k * (math.tan(k) / l)))
	else:
		tmp = l * (((2.0 / k) * ((l / math.tan(k)) / (t_m * math.sin(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 <= 3.8e+96)
		tmp = Float64(Float64(Float64(2.0 * l) / Float64(t_m * k)) / Float64(sin(k) * Float64(k * Float64(tan(k) / l))));
	else
		tmp = Float64(l * Float64(Float64(Float64(2.0 / k) * Float64(Float64(l / tan(k)) / Float64(t_m * sin(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 <= 3.8e+96)
		tmp = ((2.0 * l) / (t_m * k)) / (sin(k) * (k * (tan(k) / l)));
	else
		tmp = l * (((2.0 / k) * ((l / tan(k)) / (t_m * sin(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, 3.8e+96], N[(N[(N[(2.0 * l), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(k * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l / N[Tan[k], $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{\frac{2}{k} \cdot \frac{\frac{\ell}{\tan k}}{t\_m \cdot \sin k}}{k}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 3.8000000000000002e96

    1. Initial program 37.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. Applied egg-rr29.8%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6493.5

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      3. lift-sin.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lift-tan.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}\right)} \cdot \ell \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}\right)} \cdot \ell \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \color{blue}{\left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      8. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      12. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      14. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \ell}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \ell}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      16. lower-*.f6496.0

        \[\leadsto \frac{\frac{\color{blue}{2 \cdot \ell}}{k \cdot t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{\frac{2 \cdot \ell}{k \cdot t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      18. *-commutativeN/A

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

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

    if 3.8000000000000002e96 < t

    1. Initial program 14.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. Applied egg-rr18.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}}{k}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}}{k}} \cdot \ell \]
    6. Applied egg-rr97.6%

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

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

Alternative 2: 92.0% accurate, 1.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\tan k}{\ell}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 1.6 \cdot 10^{+144}:\\ \;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot k}}{t\_m \cdot \left(\sin k \cdot t\_2\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2 \cdot \ell}{t\_m \cdot k}}{\sin k \cdot \left(k \cdot t\_2\right)}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (/ (tan k) l)))
   (*
    t_s
    (if (<= k 1.6e+144)
      (/ (* l (/ 2.0 (* k k))) (* t_m (* (sin k) t_2)))
      (/ (/ (* 2.0 l) (* t_m k)) (* (sin k) (* 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 = tan(k) / l;
	double tmp;
	if (k <= 1.6e+144) {
		tmp = (l * (2.0 / (k * k))) / (t_m * (sin(k) * t_2));
	} else {
		tmp = ((2.0 * l) / (t_m * k)) / (sin(k) * (k * t_2));
	}
	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 = tan(k) / l
    if (k <= 1.6d+144) then
        tmp = (l * (2.0d0 / (k * k))) / (t_m * (sin(k) * t_2))
    else
        tmp = ((2.0d0 * l) / (t_m * k)) / (sin(k) * (k * t_2))
    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.tan(k) / l;
	double tmp;
	if (k <= 1.6e+144) {
		tmp = (l * (2.0 / (k * k))) / (t_m * (Math.sin(k) * t_2));
	} else {
		tmp = ((2.0 * l) / (t_m * k)) / (Math.sin(k) * (k * t_2));
	}
	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.tan(k) / l
	tmp = 0
	if k <= 1.6e+144:
		tmp = (l * (2.0 / (k * k))) / (t_m * (math.sin(k) * t_2))
	else:
		tmp = ((2.0 * l) / (t_m * k)) / (math.sin(k) * (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(tan(k) / l)
	tmp = 0.0
	if (k <= 1.6e+144)
		tmp = Float64(Float64(l * Float64(2.0 / Float64(k * k))) / Float64(t_m * Float64(sin(k) * t_2)));
	else
		tmp = Float64(Float64(Float64(2.0 * l) / Float64(t_m * k)) / Float64(sin(k) * Float64(k * t_2)));
	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 = tan(k) / l;
	tmp = 0.0;
	if (k <= 1.6e+144)
		tmp = (l * (2.0 / (k * k))) / (t_m * (sin(k) * t_2));
	else
		tmp = ((2.0 * l) / (t_m * k)) / (sin(k) * (k * t_2));
	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[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.6e+144], N[(N[(l * N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sin[k], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(k * t$95$2), $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{\tan k}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.6 \cdot 10^{+144}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot k}}{t\_m \cdot \left(\sin k \cdot t\_2\right)}\\

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


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

    1. Initial program 33.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. Add Preprocessing
    3. Applied egg-rr28.2%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k} \cdot \frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      6. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      7. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      9. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\left(\frac{2}{k \cdot k} \cdot \frac{1}{t}\right) \cdot \ell}{\sin k \cdot \frac{\tan k}{\ell}}} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\ell \cdot \left(\frac{2}{k \cdot k} \cdot \frac{1}{t}\right)}}{\sin k \cdot \frac{\tan k}{\ell}} \]
      11. associate-*r/N/A

        \[\leadsto \color{blue}{\ell \cdot \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}} \]
      12. lift-*.f64N/A

        \[\leadsto \ell \cdot \frac{\color{blue}{\frac{2}{k \cdot k} \cdot \frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \]
    6. Applied egg-rr93.9%

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

    if 1.6e144 < k

    1. Initial program 32.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. Applied egg-rr26.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6491.2

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      3. lift-sin.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lift-tan.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}\right)} \cdot \ell \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}\right)} \cdot \ell \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \color{blue}{\left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      8. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      10. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      12. associate-/r*N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      13. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot t}} \cdot \ell}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      14. associate-*l/N/A

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \ell}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \ell}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      16. lower-*.f6494.8

        \[\leadsto \frac{\frac{\color{blue}{2 \cdot \ell}}{k \cdot t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \]
      17. lift-*.f64N/A

        \[\leadsto \frac{\frac{2 \cdot \ell}{k \cdot t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \]
      18. *-commutativeN/A

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

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

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

Alternative 3: 91.6% accurate, 1.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 5 \cdot 10^{+139}:\\ \;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot k}}{t\_m \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_m \cdot k} \cdot \left(\ell \cdot \frac{\frac{\ell}{\sin k \cdot \tan k}}{k}\right)\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= k 5e+139)
    (/ (* l (/ 2.0 (* k k))) (* t_m (* (sin k) (/ (tan k) l))))
    (* (/ 2.0 (* t_m k)) (* l (/ (/ l (* (sin k) (tan 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 (k <= 5e+139) {
		tmp = (l * (2.0 / (k * k))) / (t_m * (sin(k) * (tan(k) / l)));
	} else {
		tmp = (2.0 / (t_m * k)) * (l * ((l / (sin(k) * tan(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 (k <= 5d+139) then
        tmp = (l * (2.0d0 / (k * k))) / (t_m * (sin(k) * (tan(k) / l)))
    else
        tmp = (2.0d0 / (t_m * k)) * (l * ((l / (sin(k) * tan(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 (k <= 5e+139) {
		tmp = (l * (2.0 / (k * k))) / (t_m * (Math.sin(k) * (Math.tan(k) / l)));
	} else {
		tmp = (2.0 / (t_m * k)) * (l * ((l / (Math.sin(k) * Math.tan(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 k <= 5e+139:
		tmp = (l * (2.0 / (k * k))) / (t_m * (math.sin(k) * (math.tan(k) / l)))
	else:
		tmp = (2.0 / (t_m * k)) * (l * ((l / (math.sin(k) * math.tan(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 (k <= 5e+139)
		tmp = Float64(Float64(l * Float64(2.0 / Float64(k * k))) / Float64(t_m * Float64(sin(k) * Float64(tan(k) / l))));
	else
		tmp = Float64(Float64(2.0 / Float64(t_m * k)) * Float64(l * Float64(Float64(l / Float64(sin(k) * tan(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 (k <= 5e+139)
		tmp = (l * (2.0 / (k * k))) / (t_m * (sin(k) * (tan(k) / l)));
	else
		tmp = (2.0 / (t_m * k)) * (l * ((l / (sin(k) * tan(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[k, 5e+139], N[(N[(l * N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(l * N[(N[(l / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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}\;k \leq 5 \cdot 10^{+139}:\\
\;\;\;\;\frac{\ell \cdot \frac{2}{k \cdot k}}{t\_m \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}\\

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


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

    1. Initial program 33.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. Add Preprocessing
    3. Applied egg-rr28.2%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k} \cdot \frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      6. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      7. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      8. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      9. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{\left(\frac{2}{k \cdot k} \cdot \frac{1}{t}\right) \cdot \ell}{\sin k \cdot \frac{\tan k}{\ell}}} \]
      10. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\ell \cdot \left(\frac{2}{k \cdot k} \cdot \frac{1}{t}\right)}}{\sin k \cdot \frac{\tan k}{\ell}} \]
      11. associate-*r/N/A

        \[\leadsto \color{blue}{\ell \cdot \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}} \]
      12. lift-*.f64N/A

        \[\leadsto \ell \cdot \frac{\color{blue}{\frac{2}{k \cdot k} \cdot \frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \]
    6. Applied egg-rr93.9%

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

    if 5.0000000000000003e139 < k

    1. Initial program 32.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. Applied egg-rr26.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6491.2

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      3. lift-sin.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lift-tan.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}\right)} \cdot \ell \]
      5. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}\right)} \cdot \ell \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \color{blue}{\left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      8. div-invN/A

        \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{t} \cdot \frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}\right)} \cdot \ell \]
      9. associate-*l*N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k}}{t} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k}}{t} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right)} \]
      11. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k}}{t}} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right) \]
      12. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k}}}{t} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right) \]
      13. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{2}{k \cdot t}} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right) \]
      14. lift-*.f64N/A

        \[\leadsto \frac{2}{\color{blue}{k \cdot t}} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right) \]
      15. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{2}{k \cdot t}} \cdot \left(\frac{1}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell\right) \]
      16. lower-*.f64N/A

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

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

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

Alternative 4: 80.5% accurate, 1.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 5 \cdot 10^{-9}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t\_m}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\ell}{\tan k \cdot \left(\sin k \cdot \left(\left(k \cdot \left(t\_m \cdot k\right)\right) \cdot \left(--0.5\right)\right)\right)}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= k 5e-9)
    (*
     l
     (/
      (/ (/ 2.0 k) t_m)
      (* k (* (/ (tan k) l) (fma k (* (* k k) -0.16666666666666666) k)))))
    (* l (/ l (* (tan k) (* (sin k) (* (* k (* t_m k)) (- -0.5)))))))))
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 <= 5e-9) {
		tmp = l * (((2.0 / k) / t_m) / (k * ((tan(k) / l) * fma(k, ((k * k) * -0.16666666666666666), k))));
	} else {
		tmp = l * (l / (tan(k) * (sin(k) * ((k * (t_m * k)) * -(-0.5)))));
	}
	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 <= 5e-9)
		tmp = Float64(l * Float64(Float64(Float64(2.0 / k) / t_m) / Float64(k * Float64(Float64(tan(k) / l) * fma(k, Float64(Float64(k * k) * -0.16666666666666666), k)))));
	else
		tmp = Float64(l * Float64(l / Float64(tan(k) * Float64(sin(k) * Float64(Float64(k * Float64(t_m * k)) * Float64(-(-0.5)))))));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 5e-9], N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] / t$95$m), $MachinePrecision] / N[(k * N[(N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision] * N[(k * N[(N[(k * k), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(k * N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * (--0.5)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-9}:\\
\;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t\_m}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\

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


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

    1. Initial program 37.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. Applied egg-rr28.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6493.9

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

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

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \color{blue}{\left(\frac{-1}{6} \cdot {k}^{2} + 1\right)}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. distribute-lft-inN/A

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \left(\frac{-1}{6} \cdot {k}^{2}\right) + \color{blue}{k}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \frac{-1}{6} \cdot {k}^{2}, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      7. unpow2N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot \frac{-1}{6}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      8. lower-*.f6478.8

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot -0.16666666666666666, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    9. Simplified78.8%

      \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]

    if 5.0000000000000001e-9 < k

    1. Initial program 23.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. Applied egg-rr26.2%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Applied egg-rr88.0%

      \[\leadsto \color{blue}{\left(\frac{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(-\ell\right)\right)} \cdot \ell \]
    6. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\sin k} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      2. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\sin k \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      3. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\sin k \cdot \color{blue}{\left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      4. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      5. div-invN/A

        \[\leadsto \left(\frac{\color{blue}{-2 \cdot \frac{1}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      6. lift-tan.f64N/A

        \[\leadsto \left(\frac{-2 \cdot \frac{1}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\color{blue}{\tan k}} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      7. div-invN/A

        \[\leadsto \left(\frac{\color{blue}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      8. lift-/.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      9. clear-numN/A

        \[\leadsto \left(\color{blue}{\frac{1}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      10. lift-neg.f64N/A

        \[\leadsto \left(\frac{1}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}} \cdot \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right) \cdot \ell \]
      11. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\mathsf{neg}\left(\ell\right)\right)}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \ell \]
      12. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\ell\right)}}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\ell\right)}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \ell \]
      14. div-invN/A

        \[\leadsto \frac{\mathsf{neg}\left(\ell\right)}{\color{blue}{\tan k \cdot \frac{1}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \ell \]
    7. Applied egg-rr90.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5 \cdot 10^{-9}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\ell}{\tan k \cdot \left(\sin k \cdot \left(\left(k \cdot \left(t \cdot k\right)\right) \cdot \left(--0.5\right)\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.4% accurate, 1.8× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{-\ell}{\left(\sin k \cdot \left(k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(t\_m \cdot \left(k \cdot -0.5\right)\right)} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (/ (- l) (* (* (sin k) (* k (/ (tan k) l))) (* t_m (* k -0.5))))))
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 * (-l / ((sin(k) * (k * (tan(k) / l))) * (t_m * (k * -0.5))));
}
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 * (-l / ((sin(k) * (k * (tan(k) / l))) * (t_m * (k * (-0.5d0)))))
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 * (-l / ((Math.sin(k) * (k * (Math.tan(k) / l))) * (t_m * (k * -0.5))));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (-l / ((math.sin(k) * (k * (math.tan(k) / l))) * (t_m * (k * -0.5))))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(Float64(-l) / Float64(Float64(sin(k) * Float64(k * Float64(tan(k) / l))) * Float64(t_m * Float64(k * -0.5)))))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (-l / ((sin(k) * (k * (tan(k) / l))) * (t_m * (k * -0.5))));
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[((-l) / N[(N[(N[Sin[k], $MachinePrecision] * N[(k * N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[(k * -0.5), $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{-\ell}{\left(\sin k \cdot \left(k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(t\_m \cdot \left(k \cdot -0.5\right)\right)}
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    2. lift-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    3. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    4. lift-sin.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    5. lift-tan.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
    6. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
    8. associate-/l*N/A

      \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
    9. lift-/.f64N/A

      \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    10. lift-*.f64N/A

      \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    11. associate-/r*N/A

      \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    12. frac-timesN/A

      \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    13. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    14. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    15. un-div-invN/A

      \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    16. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    17. lower-/.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    18. lower-*.f6493.8

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

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

    \[\leadsto \color{blue}{\frac{-\ell}{\left(\sin k \cdot \left(\frac{\tan k}{\ell} \cdot k\right)\right) \cdot \left(t \cdot \left(k \cdot -0.5\right)\right)}} \]
  8. Final simplification92.9%

    \[\leadsto \frac{-\ell}{\left(\sin k \cdot \left(k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(t \cdot \left(k \cdot -0.5\right)\right)} \]
  9. Add Preprocessing

Alternative 6: 78.8% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 37.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. Applied egg-rr28.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6493.9

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

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

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \color{blue}{\left(\frac{-1}{6} \cdot {k}^{2} + 1\right)}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. distribute-lft-inN/A

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \left(\frac{-1}{6} \cdot {k}^{2}\right) + \color{blue}{k}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \frac{-1}{6} \cdot {k}^{2}, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      7. unpow2N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot \frac{-1}{6}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      8. lower-*.f6478.8

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot -0.16666666666666666, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    9. Simplified78.8%

      \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]

    if 4.8000000000000002e-11 < k

    1. Initial program 23.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. Applied egg-rr26.2%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Applied egg-rr88.0%

      \[\leadsto \color{blue}{\left(\frac{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(-\ell\right)\right)} \cdot \ell \]
    6. Step-by-step derivation
      1. lift-sin.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\sin k} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      2. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\sin k \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      3. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\sin k \cdot \color{blue}{\left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      4. lift-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      5. div-invN/A

        \[\leadsto \left(\frac{\color{blue}{-2 \cdot \frac{1}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      6. lift-tan.f64N/A

        \[\leadsto \left(\frac{-2 \cdot \frac{1}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\color{blue}{\tan k}} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      7. div-invN/A

        \[\leadsto \left(\frac{\color{blue}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      8. lift-/.f64N/A

        \[\leadsto \left(\frac{\color{blue}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      9. clear-numN/A

        \[\leadsto \left(\color{blue}{\frac{1}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      10. lift-neg.f64N/A

        \[\leadsto \left(\frac{1}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}} \cdot \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right) \cdot \ell \]
      11. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{1 \cdot \left(\mathsf{neg}\left(\ell\right)\right)}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}}} \cdot \ell \]
      12. *-lft-identityN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\ell\right)}}{\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}} \cdot \ell \]
      13. frac-2negN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)}{\mathsf{neg}\left(\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}\right)}} \cdot \ell \]
      14. lift-neg.f64N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)}{\mathsf{neg}\left(\frac{\tan k}{\frac{-2}{\sin k \cdot \left(\left(k \cdot k\right) \cdot t\right)}}\right)} \cdot \ell \]
      15. remove-double-negN/A

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.8 \cdot 10^{-11}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\ell}{\left(\tan k \cdot 0.5\right) \cdot \left(t \cdot \left(k \cdot \left(k \cdot \sin k\right)\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.2% accurate, 1.9× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \frac{2}{\left(t\_m \cdot k\right) \cdot \left(\sin k \cdot \left(k \cdot \frac{\tan k}{\ell}\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    2. lift-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    3. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    4. lift-sin.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
    5. lift-tan.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
    6. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
    8. associate-/l*N/A

      \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
    9. lift-/.f64N/A

      \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    10. lift-*.f64N/A

      \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    11. associate-/r*N/A

      \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
    12. frac-timesN/A

      \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    13. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    14. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    15. un-div-invN/A

      \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    16. lower-/.f64N/A

      \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    17. lower-/.f64N/A

      \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    18. lower-*.f6493.8

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

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

      \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    3. lift-sin.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot t}}{k \cdot \left(\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    4. lift-tan.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot t}}{k \cdot \left(\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}\right)} \cdot \ell \]
    5. lift-/.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot t}}{k \cdot \left(\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}\right)} \cdot \ell \]
    6. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot t}}{k \cdot \color{blue}{\left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\frac{2}{k \cdot t}}{\color{blue}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
    8. associate-/l/N/A

      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(k \cdot t\right)}} \cdot \ell \]
    9. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(k \cdot t\right)}} \cdot \ell \]
    10. lower-*.f6492.8

      \[\leadsto \frac{2}{\color{blue}{\left(k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)\right) \cdot \left(k \cdot t\right)}} \cdot \ell \]
    11. lift-*.f64N/A

      \[\leadsto \frac{2}{\color{blue}{\left(k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)\right)} \cdot \left(k \cdot t\right)} \cdot \ell \]
    12. *-commutativeN/A

      \[\leadsto \frac{2}{\color{blue}{\left(\left(\sin k \cdot \frac{\tan k}{\ell}\right) \cdot k\right)} \cdot \left(k \cdot t\right)} \cdot \ell \]
    13. lift-*.f64N/A

      \[\leadsto \frac{2}{\left(\color{blue}{\left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot k\right) \cdot \left(k \cdot t\right)} \cdot \ell \]
    14. associate-*l*N/A

      \[\leadsto \frac{2}{\color{blue}{\left(\sin k \cdot \left(\frac{\tan k}{\ell} \cdot k\right)\right)} \cdot \left(k \cdot t\right)} \cdot \ell \]
    15. lower-*.f64N/A

      \[\leadsto \frac{2}{\color{blue}{\left(\sin k \cdot \left(\frac{\tan k}{\ell} \cdot k\right)\right)} \cdot \left(k \cdot t\right)} \cdot \ell \]
    16. lower-*.f6492.8

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

    \[\leadsto \color{blue}{\frac{2}{\left(\sin k \cdot \left(\frac{\tan k}{\ell} \cdot k\right)\right) \cdot \left(k \cdot t\right)}} \cdot \ell \]
  9. Final simplification92.8%

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

Alternative 8: 73.1% accurate, 2.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}\;\ell \leq 4.6 \cdot 10^{+169}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t\_m}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= l 4.6e+169)
    (*
     l
     (/
      (/ (/ 2.0 k) t_m)
      (* k (* (/ (tan k) l) (fma k (* (* k k) -0.16666666666666666) k)))))
    (/ (* (* l (* l l)) (fma (* k k) -0.3333333333333333 2.0)) (* k k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (l <= 4.6e+169) {
		tmp = l * (((2.0 / k) / t_m) / (k * ((tan(k) / l) * fma(k, ((k * k) * -0.16666666666666666), k))));
	} else {
		tmp = ((l * (l * l)) * fma((k * k), -0.3333333333333333, 2.0)) / (k * k);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (l <= 4.6e+169)
		tmp = Float64(l * Float64(Float64(Float64(2.0 / k) / t_m) / Float64(k * Float64(Float64(tan(k) / l) * fma(k, Float64(Float64(k * k) * -0.16666666666666666), k)))));
	else
		tmp = Float64(Float64(Float64(l * Float64(l * l)) * fma(Float64(k * k), -0.3333333333333333, 2.0)) / Float64(k * k));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 4.6e+169], N[(l * N[(N[(N[(2.0 / k), $MachinePrecision] / t$95$m), $MachinePrecision] / N[(k * N[(N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision] * N[(k * N[(N[(k * k), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 2.0), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 4.6 \cdot 10^{+169}:\\
\;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t\_m}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.5999999999999999e169

    1. Initial program 32.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. Applied egg-rr27.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \color{blue}{\frac{1}{t}}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      4. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k} \cdot \frac{\tan k}{\ell}} \cdot \ell \]
      5. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\color{blue}{\tan k}}{\ell}} \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \color{blue}{\frac{\tan k}{\ell}}} \cdot \ell \]
      7. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\color{blue}{\sin k \cdot \frac{\tan k}{\ell}}} \cdot \ell \]
      8. associate-/l*N/A

        \[\leadsto \color{blue}{\left(\frac{2}{k \cdot k} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right)} \cdot \ell \]
      9. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{2}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{2}{\color{blue}{k \cdot k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      11. associate-/r*N/A

        \[\leadsto \left(\color{blue}{\frac{\frac{2}{k}}{k}} \cdot \frac{\frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}}\right) \cdot \ell \]
      12. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      13. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{2}{k} \cdot \frac{1}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)}} \cdot \ell \]
      14. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{k} \cdot \color{blue}{\frac{1}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      15. un-div-invN/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{\frac{2}{k}}{t}}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      17. lower-/.f64N/A

        \[\leadsto \frac{\frac{\color{blue}{\frac{2}{k}}}{t}}{k \cdot \left(\sin k \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      18. lower-*.f6493.5

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

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

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \color{blue}{\left(\frac{-1}{6} \cdot {k}^{2} + 1\right)}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      2. distribute-lft-inN/A

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

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\left(k \cdot \left(\frac{-1}{6} \cdot {k}^{2}\right) + \color{blue}{k}\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      4. lower-fma.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \frac{-1}{6} \cdot {k}^{2}, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      5. *-commutativeN/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      7. unpow2N/A

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot \frac{-1}{6}, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
      8. lower-*.f6475.9

        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot -0.16666666666666666, k\right) \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]
    9. Simplified75.9%

      \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\color{blue}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)} \cdot \frac{\tan k}{\ell}\right)} \cdot \ell \]

    if 4.5999999999999999e169 < l

    1. Initial program 47.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 inf

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

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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. lower-*.f6414.0

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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)} \]
    5. Simplified14.0%

      \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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)} \]
    6. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot \left({k}^{2} \cdot {\ell}^{3}\right) + 2 \cdot {\ell}^{3}}{{k}^{5}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{-1}{3} \cdot \color{blue}{\left({\ell}^{3} \cdot {k}^{2}\right)} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      2. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(\frac{-1}{3} \cdot {\ell}^{3}\right) \cdot {k}^{2}} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(\frac{-1}{3} \cdot {\ell}^{3}\right) \cdot {k}^{2} + 2 \cdot {\ell}^{3}}{{k}^{5}}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left({\ell}^{3} \cdot \frac{-1}{3}\right)} \cdot {k}^{2} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      5. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2}\right)} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2}\right) + \color{blue}{{\ell}^{3} \cdot 2}}{{k}^{5}} \]
      7. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}}{{k}^{5}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}}{{k}^{5}} \]
      9. cube-multN/A

        \[\leadsto \frac{\color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{{\ell}^{2}}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\ell \cdot {\ell}^{2}\right)} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      12. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      14. *-commutativeN/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \left(\color{blue}{{k}^{2} \cdot \frac{-1}{3}} + 2\right)}{{k}^{5}} \]
      15. lower-fma.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \color{blue}{\mathsf{fma}\left({k}^{2}, \frac{-1}{3}, 2\right)}}{{k}^{5}} \]
      16. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(\color{blue}{k \cdot k}, \frac{-1}{3}, 2\right)}{{k}^{5}} \]
      17. lower-*.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(\color{blue}{k \cdot k}, \frac{-1}{3}, 2\right)}{{k}^{5}} \]
      18. lower-pow.f6433.4

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{{k}^{5}}} \]
    8. Simplified33.4%

      \[\leadsto \color{blue}{\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{{k}^{5}}} \]
    9. Taylor expanded in k around inf

      \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, \frac{-1}{3}, 2\right)}{\color{blue}{{k}^{2}}} \]
    10. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, \frac{-1}{3}, 2\right)}{\color{blue}{k \cdot k}} \]
      2. lower-*.f6420.7

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{k \cdot k}} \]
    11. Simplified20.7%

      \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{k \cdot k}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 4.6 \cdot 10^{+169}:\\ \;\;\;\;\ell \cdot \frac{\frac{\frac{2}{k}}{t}}{k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.9% accurate, 2.7× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \left(k \cdot k\right)\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{-2}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right) \cdot \left(-t\_2\right)}}{\tan k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k \cdot t\_2}}{\frac{\tan k}{\ell \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (* t_m (* k k))))
   (*
    t_s
    (if (<= l 2e-147)
      (*
       l
       (*
        l
        (/
         (/ -2.0 (* (fma k (* (* k k) -0.16666666666666666) k) (- t_2)))
         (tan k))))
      (/ (/ 2.0 (* k t_2)) (/ (tan k) (* l l)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = t_m * (k * k);
	double tmp;
	if (l <= 2e-147) {
		tmp = l * (l * ((-2.0 / (fma(k, ((k * k) * -0.16666666666666666), k) * -t_2)) / tan(k)));
	} else {
		tmp = (2.0 / (k * t_2)) / (tan(k) / (l * 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(t_m * Float64(k * k))
	tmp = 0.0
	if (l <= 2e-147)
		tmp = Float64(l * Float64(l * Float64(Float64(-2.0 / Float64(fma(k, Float64(Float64(k * k) * -0.16666666666666666), k) * Float64(-t_2))) / tan(k))));
	else
		tmp = Float64(Float64(2.0 / Float64(k * t_2)) / Float64(tan(k) / Float64(l * l)));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 2e-147], N[(l * N[(l * N[(N[(-2.0 / N[(N[(k * N[(N[(k * k), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + k), $MachinePrecision] * (-t$95$2)), $MachinePrecision]), $MachinePrecision] / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] / N[(l * l), $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 := t\_m \cdot \left(k \cdot k\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2 \cdot 10^{-147}:\\
\;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{-2}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right) \cdot \left(-t\_2\right)}}{\tan k}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{k \cdot t\_2}}{\frac{\tan k}{\ell \cdot \ell}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.9999999999999999e-147

    1. Initial program 32.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr27.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Applied egg-rr84.3%

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

      \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\left(k \cdot \left(1 + \frac{-1}{6} \cdot {k}^{2}\right)\right)} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\frac{\frac{-2}{\left(k \cdot \color{blue}{\left(\frac{-1}{6} \cdot {k}^{2} + 1\right)}\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      2. distribute-lft-inN/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\left(k \cdot \left(\frac{-1}{6} \cdot {k}^{2}\right) + k \cdot 1\right)} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      3. *-rgt-identityN/A

        \[\leadsto \left(\frac{\frac{-2}{\left(k \cdot \left(\frac{-1}{6} \cdot {k}^{2}\right) + \color{blue}{k}\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      4. lower-fma.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\mathsf{fma}\left(k, \frac{-1}{6} \cdot {k}^{2}, k\right)} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      5. *-commutativeN/A

        \[\leadsto \left(\frac{\frac{-2}{\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{\frac{-2}{\mathsf{fma}\left(k, \color{blue}{{k}^{2} \cdot \frac{-1}{6}}, k\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      7. unpow2N/A

        \[\leadsto \left(\frac{\frac{-2}{\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot \frac{-1}{6}, k\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right) \cdot \ell \]
      8. lower-*.f6474.3

        \[\leadsto \left(\frac{\frac{-2}{\mathsf{fma}\left(k, \color{blue}{\left(k \cdot k\right)} \cdot -0.16666666666666666, k\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(-\ell\right)\right) \cdot \ell \]
    8. Simplified74.3%

      \[\leadsto \left(\frac{\frac{-2}{\color{blue}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right)} \cdot \left(\left(k \cdot k\right) \cdot t\right)}}{\tan k} \cdot \left(-\ell\right)\right) \cdot \ell \]

    if 1.9999999999999999e-147 < l

    1. Initial program 34.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. Applied egg-rr28.7%

      \[\leadsto \color{blue}{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{\color{blue}{k \cdot k}}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{\color{blue}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{k \cdot k}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{\frac{k \cdot k}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \color{blue}{\left(t \cdot t\right)}\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\color{blue}{\left(t \cdot \left(t \cdot t\right)\right)} \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      7. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\color{blue}{\sin k} \cdot \tan k}{\ell \cdot \ell}} \]
      8. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \color{blue}{\tan k}}{\ell \cdot \ell}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\color{blue}{\sin k \cdot \tan k}}{\ell \cdot \ell}} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\color{blue}{\ell \cdot \ell}}} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \color{blue}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      12. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\color{blue}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      14. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\frac{\color{blue}{\sin k \cdot \tan k}}{\ell \cdot \ell}} \]
      15. associate-/l*N/A

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k}}{\frac{\tan k}{\ell \cdot \ell}}} \]
    6. Taylor expanded in k around 0

      \[\leadsto \frac{\color{blue}{\frac{2}{{k}^{3} \cdot t}}}{\frac{\tan k}{\ell \cdot \ell}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{{k}^{3} \cdot t}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      2. cube-multN/A

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(k \cdot \left(k \cdot k\right)\right)} \cdot t}}{\frac{\tan k}{\ell \cdot \ell}} \]
      3. unpow2N/A

        \[\leadsto \frac{\frac{2}{\left(k \cdot \color{blue}{{k}^{2}}\right) \cdot t}}{\frac{\tan k}{\ell \cdot \ell}} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\frac{2}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      8. unpow2N/A

        \[\leadsto \frac{\frac{2}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}}{\frac{\tan k}{\ell \cdot \ell}} \]
      9. lower-*.f6472.0

        \[\leadsto \frac{\frac{2}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}}{\frac{\tan k}{\ell \cdot \ell}} \]
    8. Simplified72.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2 \cdot 10^{-147}:\\ \;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{-2}{\mathsf{fma}\left(k, \left(k \cdot k\right) \cdot -0.16666666666666666, k\right) \cdot \left(-t \cdot \left(k \cdot k\right)\right)}}{\tan k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k \cdot \left(t \cdot \left(k \cdot k\right)\right)}}{\frac{\tan k}{\ell \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 70.3% accurate, 2.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 9.99999999999999931e-304

    1. Initial program 25.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. Applied egg-rr28.1%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
      2. lower-/.f64N/A

        \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
      3. lower-*.f64N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{2 \cdot \ell}}{{k}^{4} \cdot t} \cdot \ell \]
      4. *-commutativeN/A

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
      6. metadata-evalN/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot {k}^{\color{blue}{\left(2 \cdot 2\right)}}} \cdot \ell \]
      7. pow-sqrN/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
      8. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
      9. unpow2N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
      10. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
      11. unpow2N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
      12. lower-*.f6480.9

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
    10. Simplified80.9%

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

    if 9.99999999999999931e-304 < (*.f64 l l)

    1. Initial program 36.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. Applied egg-rr27.9%

      \[\leadsto \color{blue}{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{\color{blue}{k \cdot k}}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{\color{blue}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{\frac{k \cdot k}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      4. lift-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{\frac{k \cdot k}{t \cdot t}}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \color{blue}{\left(t \cdot t\right)}\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\color{blue}{\left(t \cdot \left(t \cdot t\right)\right)} \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}} \]
      7. lift-sin.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\color{blue}{\sin k} \cdot \tan k}{\ell \cdot \ell}} \]
      8. lift-tan.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \color{blue}{\tan k}}{\ell \cdot \ell}} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\color{blue}{\sin k \cdot \tan k}}{\ell \cdot \ell}} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k \cdot \tan k}{\color{blue}{\ell \cdot \ell}}} \]
      11. lift-/.f64N/A

        \[\leadsto \frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{\left(t \cdot \left(t \cdot t\right)\right) \cdot \color{blue}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      12. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\color{blue}{\frac{\sin k \cdot \tan k}{\ell \cdot \ell}}} \]
      14. lift-*.f64N/A

        \[\leadsto \frac{\frac{\frac{2}{\frac{k \cdot k}{t \cdot t}}}{t \cdot \left(t \cdot t\right)}}{\frac{\color{blue}{\sin k \cdot \tan k}}{\ell \cdot \ell}} \]
      15. associate-/l*N/A

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k}}{\frac{\tan k}{\ell \cdot \ell}}} \]
    6. Taylor expanded in k around 0

      \[\leadsto \frac{\color{blue}{\frac{2}{{k}^{3} \cdot t}}}{\frac{\tan k}{\ell \cdot \ell}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{2}{{k}^{3} \cdot t}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      2. cube-multN/A

        \[\leadsto \frac{\frac{2}{\color{blue}{\left(k \cdot \left(k \cdot k\right)\right)} \cdot t}}{\frac{\tan k}{\ell \cdot \ell}} \]
      3. unpow2N/A

        \[\leadsto \frac{\frac{2}{\left(k \cdot \color{blue}{{k}^{2}}\right) \cdot t}}{\frac{\tan k}{\ell \cdot \ell}} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\frac{2}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{\frac{2}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      7. lower-*.f64N/A

        \[\leadsto \frac{\frac{2}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}}{\frac{\tan k}{\ell \cdot \ell}} \]
      8. unpow2N/A

        \[\leadsto \frac{\frac{2}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}}{\frac{\tan k}{\ell \cdot \ell}} \]
      9. lower-*.f6470.9

        \[\leadsto \frac{\frac{2}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}}{\frac{\tan k}{\ell \cdot \ell}} \]
    8. Simplified70.9%

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

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

Alternative 11: 69.2% accurate, 9.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 4.6 \cdot 10^{+169}:\\ \;\;\;\;\ell \cdot \frac{2 \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= l 4.6e+169)
    (* l (/ (* 2.0 l) (* t_m (* (* k k) (* k k)))))
    (/ (* (* l (* l l)) (fma (* k k) -0.3333333333333333 2.0)) (* k k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (l <= 4.6e+169) {
		tmp = l * ((2.0 * l) / (t_m * ((k * k) * (k * k))));
	} else {
		tmp = ((l * (l * l)) * fma((k * k), -0.3333333333333333, 2.0)) / (k * k);
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (l <= 4.6e+169)
		tmp = Float64(l * Float64(Float64(2.0 * l) / Float64(t_m * Float64(Float64(k * k) * Float64(k * k)))));
	else
		tmp = Float64(Float64(Float64(l * Float64(l * l)) * fma(Float64(k * k), -0.3333333333333333, 2.0)) / Float64(k * k));
	end
	return Float64(t_s * tmp)
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 4.6e+169], N[(l * N[(N[(2.0 * l), $MachinePrecision] / N[(t$95$m * N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 2.0), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.5999999999999999e169

    1. Initial program 32.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. Applied egg-rr27.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
      2. lower-/.f64N/A

        \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{{k}^{5} \cdot t}}\right) \cdot \ell \]
      4. lower-pow.f6448.9

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

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

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

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{2 \cdot \ell}}{{k}^{4} \cdot t} \cdot \ell \]
      4. *-commutativeN/A

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
      6. metadata-evalN/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot {k}^{\color{blue}{\left(2 \cdot 2\right)}}} \cdot \ell \]
      7. pow-sqrN/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
      8. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
      9. unpow2N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
      10. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
      11. unpow2N/A

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
      12. lower-*.f6471.9

        \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
    10. Simplified71.9%

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

    if 4.5999999999999999e169 < l

    1. Initial program 47.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 inf

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

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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. lower-*.f6414.0

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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)} \]
    5. Simplified14.0%

      \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \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)} \]
    6. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{\frac{-1}{3} \cdot \left({k}^{2} \cdot {\ell}^{3}\right) + 2 \cdot {\ell}^{3}}{{k}^{5}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{-1}{3} \cdot \color{blue}{\left({\ell}^{3} \cdot {k}^{2}\right)} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      2. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(\frac{-1}{3} \cdot {\ell}^{3}\right) \cdot {k}^{2}} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(\frac{-1}{3} \cdot {\ell}^{3}\right) \cdot {k}^{2} + 2 \cdot {\ell}^{3}}{{k}^{5}}} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left({\ell}^{3} \cdot \frac{-1}{3}\right)} \cdot {k}^{2} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      5. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2}\right)} + 2 \cdot {\ell}^{3}}{{k}^{5}} \]
      6. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2}\right) + \color{blue}{{\ell}^{3} \cdot 2}}{{k}^{5}} \]
      7. distribute-lft-inN/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}}{{k}^{5}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{{\ell}^{3} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}}{{k}^{5}} \]
      9. cube-multN/A

        \[\leadsto \frac{\color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      10. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{{\ell}^{2}}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      11. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(\ell \cdot {\ell}^{2}\right)} \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      12. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right) \cdot \left(\frac{-1}{3} \cdot {k}^{2} + 2\right)}{{k}^{5}} \]
      14. *-commutativeN/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \left(\color{blue}{{k}^{2} \cdot \frac{-1}{3}} + 2\right)}{{k}^{5}} \]
      15. lower-fma.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \color{blue}{\mathsf{fma}\left({k}^{2}, \frac{-1}{3}, 2\right)}}{{k}^{5}} \]
      16. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(\color{blue}{k \cdot k}, \frac{-1}{3}, 2\right)}{{k}^{5}} \]
      17. lower-*.f64N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(\color{blue}{k \cdot k}, \frac{-1}{3}, 2\right)}{{k}^{5}} \]
      18. lower-pow.f6433.4

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{{k}^{5}}} \]
    8. Simplified33.4%

      \[\leadsto \color{blue}{\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{{k}^{5}}} \]
    9. Taylor expanded in k around inf

      \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, \frac{-1}{3}, 2\right)}{\color{blue}{{k}^{2}}} \]
    10. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, \frac{-1}{3}, 2\right)}{\color{blue}{k \cdot k}} \]
      2. lower-*.f6420.7

        \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{k \cdot k}} \]
    11. Simplified20.7%

      \[\leadsto \frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{\color{blue}{k \cdot k}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 4.6 \cdot 10^{+169}:\\ \;\;\;\;\ell \cdot \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot \mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{k \cdot k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 69.4% accurate, 11.0× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \frac{2 \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)}\right)
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    2. lower-/.f64N/A

      \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
    3. lower-*.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
    2. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{2 \cdot \ell}{{k}^{4} \cdot t}} \cdot \ell \]
    3. lower-*.f64N/A

      \[\leadsto \frac{\color{blue}{2 \cdot \ell}}{{k}^{4} \cdot t} \cdot \ell \]
    4. *-commutativeN/A

      \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
    5. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \ell}{\color{blue}{t \cdot {k}^{4}}} \cdot \ell \]
    6. metadata-evalN/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot {k}^{\color{blue}{\left(2 \cdot 2\right)}}} \cdot \ell \]
    7. pow-sqrN/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
    8. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \color{blue}{\left({k}^{2} \cdot {k}^{2}\right)}} \cdot \ell \]
    9. unpow2N/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
    10. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\color{blue}{\left(k \cdot k\right)} \cdot {k}^{2}\right)} \cdot \ell \]
    11. unpow2N/A

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
    12. lower-*.f6470.9

      \[\leadsto \frac{2 \cdot \ell}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \cdot \ell \]
  10. Simplified70.9%

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

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

Alternative 13: 46.4% accurate, 12.2× speedup?

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

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

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


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

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

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

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
    5. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    6. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
      2. lower-/.f64N/A

        \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
      3. lower-*.f64N/A

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

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

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    8. Taylor expanded in k around -inf

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{{k}^{3}}}\right) \cdot \ell \]
    9. Step-by-step derivation
      1. cube-multN/A

        \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot \left(k \cdot k\right)}}\right) \cdot \ell \]
      2. unpow2N/A

        \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \color{blue}{{k}^{2}}}\right) \cdot \ell \]
      3. lower-*.f64N/A

        \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot {k}^{2}}}\right) \cdot \ell \]
      4. unpow2N/A

        \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \color{blue}{\left(k \cdot k\right)}}\right) \cdot \ell \]
      5. lower-*.f6443.2

        \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \color{blue}{\left(k \cdot k\right)}}\right) \cdot \ell \]
    10. Simplified43.2%

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

    if 1.70000000000000001e-103 < k

    1. Initial program 24.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 k around 0

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{3}}{{k}^{5} \cdot t}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{2 \cdot {\ell}^{3}}}{{k}^{5} \cdot t} \]
      4. cube-multN/A

        \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)}{{k}^{5} \cdot t} \]
      7. *-commutativeN/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
      9. lower-pow.f6454.5

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

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

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{{k}^{2} \cdot t}} \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{\left(k \cdot k\right)} \cdot t} \]
      2. associate-*l*N/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
      4. lower-*.f6457.9

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

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    9. Taylor expanded in l around inf

      \[\leadsto \frac{\color{blue}{{\ell}^{2}}}{k \cdot \left(k \cdot t\right)} \]
    10. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
      2. lower-*.f6460.1

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

      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
    12. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{k \cdot \color{blue}{\left(k \cdot t\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
      3. associate-/l*N/A

        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \ell} \]
      5. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \ell} \]
      6. lower-/.f6460.9

        \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)}} \cdot \ell \]
    13. Applied egg-rr60.9%

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

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

Alternative 14: 47.5% accurate, 12.5× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \left(2 \cdot \frac{\ell}{k \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}\right)\right)
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    2. lower-/.f64N/A

      \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
    3. lower-*.f64N/A

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

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

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

    \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{3} \cdot t}}\right) \cdot \ell \]
  9. Step-by-step derivation
    1. lower-/.f64N/A

      \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{3} \cdot t}}\right) \cdot \ell \]
    2. cube-multN/A

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{\left(k \cdot \left(k \cdot k\right)\right)} \cdot t}\right) \cdot \ell \]
    3. unpow2N/A

      \[\leadsto \left(2 \cdot \frac{\ell}{\left(k \cdot \color{blue}{{k}^{2}}\right) \cdot t}\right) \cdot \ell \]
    4. associate-*l*N/A

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}\right) \cdot \ell \]
    5. lower-*.f64N/A

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot \left({k}^{2} \cdot t\right)}}\right) \cdot \ell \]
    6. *-commutativeN/A

      \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}\right) \cdot \ell \]
    7. lower-*.f64N/A

      \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \color{blue}{\left(t \cdot {k}^{2}\right)}}\right) \cdot \ell \]
    8. unpow2N/A

      \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}\right) \cdot \ell \]
    9. lower-*.f6448.6

      \[\leadsto \left(2 \cdot \frac{\ell}{k \cdot \left(t \cdot \color{blue}{\left(k \cdot k\right)}\right)}\right) \cdot \ell \]
  10. Simplified48.6%

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

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

Alternative 15: 64.1% accurate, 14.4× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \left(2 \cdot \frac{\ell}{t\_m \cdot \left(k \cdot k\right)}\right)\right)
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    2. lower-/.f64N/A

      \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
    3. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{\left(k \cdot k\right)} \cdot t}\right) \cdot \ell \]
    2. lower-*.f6466.1

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

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

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

Alternative 16: 62.5% accurate, 17.1× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \frac{\ell}{k \cdot \left(t\_m \cdot k\right)}\right)
\end{array}
Derivation
  1. Initial program 33.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. Taylor expanded in k around 0

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{3}}{{k}^{5} \cdot t}} \]
  4. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
    2. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
    3. lower-*.f64N/A

      \[\leadsto \frac{\color{blue}{2 \cdot {\ell}^{3}}}{{k}^{5} \cdot t} \]
    4. cube-multN/A

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
    6. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)}{{k}^{5} \cdot t} \]
    7. *-commutativeN/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
    8. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
    9. lower-pow.f6445.1

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

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

    \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{{k}^{2} \cdot t}} \]
  7. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{\left(k \cdot k\right)} \cdot t} \]
    2. associate-*l*N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    3. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    4. lower-*.f6444.7

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

    \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
  9. Taylor expanded in l around inf

    \[\leadsto \frac{\color{blue}{{\ell}^{2}}}{k \cdot \left(k \cdot t\right)} \]
  10. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
    2. lower-*.f6459.7

      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
  11. Simplified59.7%

    \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
  12. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{\ell \cdot \ell}{k \cdot \color{blue}{\left(k \cdot t\right)}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    3. associate-/l*N/A

      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \ell} \]
    5. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \ell} \]
    6. lower-/.f6465.3

      \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)}} \cdot \ell \]
  13. Applied egg-rr65.3%

    \[\leadsto \color{blue}{\frac{\ell}{k \cdot \left(k \cdot t\right)} \cdot \ell} \]
  14. Final simplification65.3%

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

Alternative 17: 59.3% accurate, 17.1× speedup?

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

\\
t\_s \cdot \left(\ell \cdot \left(2 \cdot \frac{\ell}{k \cdot k}\right)\right)
\end{array}
Derivation
  1. Initial program 33.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. Applied egg-rr28.0%

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

    \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot k} \cdot \frac{1}{t}}{\sin k \cdot \frac{\tan k}{\ell}} \cdot \ell} \]
  5. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
  6. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(2 \cdot \frac{\ell}{{k}^{5} \cdot t}\right)} \cdot \ell \]
    2. lower-/.f64N/A

      \[\leadsto \left(2 \cdot \color{blue}{\frac{\ell}{{k}^{5} \cdot t}}\right) \cdot \ell \]
    3. lower-*.f64N/A

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

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

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

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

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot k}}\right) \cdot \ell \]
    2. lower-*.f6447.5

      \[\leadsto \left(2 \cdot \frac{\ell}{\color{blue}{k \cdot k}}\right) \cdot \ell \]
  10. Simplified47.5%

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

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

Alternative 18: 55.0% accurate, 21.0× speedup?

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

\\
t\_s \cdot \frac{\ell \cdot \ell}{k \cdot k}
\end{array}
Derivation
  1. Initial program 33.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. Taylor expanded in k around 0

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{3}}{{k}^{5} \cdot t}} \]
  4. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
    2. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{2 \cdot {\ell}^{3}}{{k}^{5} \cdot t}} \]
    3. lower-*.f64N/A

      \[\leadsto \frac{\color{blue}{2 \cdot {\ell}^{3}}}{{k}^{5} \cdot t} \]
    4. cube-multN/A

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \color{blue}{\left(\ell \cdot \left(\ell \cdot \ell\right)\right)}}{{k}^{5} \cdot t} \]
    6. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)}{{k}^{5} \cdot t} \]
    7. *-commutativeN/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
    8. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{t \cdot {k}^{5}}} \]
    9. lower-pow.f6445.1

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

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

    \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{{k}^{2} \cdot t}} \]
  7. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{\left(k \cdot k\right)} \cdot t} \]
    2. associate-*l*N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    3. lower-*.f64N/A

      \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
    4. lower-*.f6444.7

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

    \[\leadsto \frac{2 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)}{\color{blue}{k \cdot \left(k \cdot t\right)}} \]
  9. Taylor expanded in l around inf

    \[\leadsto \frac{\color{blue}{{\ell}^{2}}}{k \cdot \left(k \cdot t\right)} \]
  10. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
    2. lower-*.f6459.7

      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
  11. Simplified59.7%

    \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{k \cdot \left(k \cdot t\right)} \]
  12. Taylor expanded in k around inf

    \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}}} \]
  13. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{k \cdot k}} \]
    2. lower-*.f6446.7

      \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{k \cdot k}} \]
  14. Simplified46.7%

    \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{k \cdot k}} \]
  15. Add Preprocessing

Reproduce

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