Toniolo and Linder, Equation (10+)

Percentage Accurate: 53.2% → 88.2%
Time: 38.1s
Alternatives: 13
Speedup: 32.4×

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 13 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: 53.2% 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: 88.2% accurate, 1.3× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 1.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \frac{{\sin k}^{2}}{\ell}}{\cos k} \cdot \frac{t\_m}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{k}{\frac{t\_m \cdot t\_m}{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 (<= t_m 1.5e-40)
    (/ 2.0 (* (/ (* (* k k) (/ (pow (sin k) 2.0) l)) (cos k)) (/ t_m l)))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ k (/ (* t_m t_m) k))))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 1.5e-40) {
		tmp = 2.0 / ((((k * k) * (pow(sin(k), 2.0) / l)) / cos(k)) * (t_m / l));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + (k / ((t_m * 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 (t_m <= 1.5d-40) then
        tmp = 2.0d0 / ((((k * k) * ((sin(k) ** 2.0d0) / l)) / cos(k)) * (t_m / l))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + (k / ((t_m * 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 (t_m <= 1.5e-40) {
		tmp = 2.0 / ((((k * k) * (Math.pow(Math.sin(k), 2.0) / l)) / Math.cos(k)) * (t_m / l));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + (k / ((t_m * 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 t_m <= 1.5e-40:
		tmp = 2.0 / ((((k * k) * (math.pow(math.sin(k), 2.0) / l)) / math.cos(k)) * (t_m / l))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + (k / ((t_m * t_m) / k))))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 1.5e-40)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64((sin(k) ^ 2.0) / l)) / cos(k)) * Float64(t_m / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(k / Float64(Float64(t_m * 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 (t_m <= 1.5e-40)
		tmp = 2.0 / ((((k * k) * ((sin(k) ^ 2.0) / l)) / cos(k)) * (t_m / l));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + (k / ((t_m * 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[t$95$m, 1.5e-40], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(k / N[(N[(t$95$m * t$95$m), $MachinePrecision] / 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}\;t\_m \leq 1.5 \cdot 10^{-40}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \frac{{\sin k}^{2}}{\ell}}{\cos k} \cdot \frac{t\_m}{\ell}}\\

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


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

    1. Initial program 47.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{\frac{{k}^{2} \cdot {\sin k}^{2}}{\ell}}{\cos k}\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{{k}^{2} \cdot {\sin k}^{2}}{\ell}\right), \cos k\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({k}^{2} \cdot \frac{{\sin k}^{2}}{\ell}\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. cos-lowering-cos.f6472.2%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified72.2%

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

    if 1.5000000000000001e-40 < t

    1. Initial program 67.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\left(2 + \frac{\frac{k \cdot k}{t}}{t}\right) \cdot \left(\sin k \cdot \tan k\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k \cdot k}{t}}{t}\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k \cdot k}{t}}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t} \cdot k}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      5. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(\left(t \cdot \sin k\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(t \cdot \left(\frac{t \cdot \sin k}{\ell} \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\left(t \cdot \frac{t \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
    5. Applied egg-rr94.2%

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

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

Alternative 2: 73.0% 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^{-123}:\\ \;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\\ \mathbf{elif}\;k \leq 235000:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \left(t\_m \cdot \left(\left(2 + \frac{k}{\frac{t\_m \cdot t\_m}{k}}\right) \cdot \frac{\sin k \cdot \tan k}{\ell}\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-123)
    (* (/ l t_m) (/ (/ l (* t_m (* t_m k))) k))
    (if (<= k 235000.0)
      (/
       2.0
       (*
        (/ t_m l)
        (*
         (* k k)
         (+
          (/ (* 2.0 (* t_m t_m)) l)
          (/ (* k (* k (+ 1.0 (* (* t_m t_m) 0.3333333333333333)))) l)))))
      (/
       2.0
       (*
        (/ t_m l)
        (*
         t_m
         (*
          t_m
          (* (+ 2.0 (/ k (/ (* t_m t_m) k))) (/ (* (sin 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) {
	double tmp;
	if (k <= 5e-123) {
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	} else if (k <= 235000.0) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	} else {
		tmp = 2.0 / ((t_m / l) * (t_m * (t_m * ((2.0 + (k / ((t_m * t_m) / k))) * ((sin(k) * tan(k)) / 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 (k <= 5d-123) then
        tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k)
    else if (k <= 235000.0d0) then
        tmp = 2.0d0 / ((t_m / l) * ((k * k) * (((2.0d0 * (t_m * t_m)) / l) + ((k * (k * (1.0d0 + ((t_m * t_m) * 0.3333333333333333d0)))) / l))))
    else
        tmp = 2.0d0 / ((t_m / l) * (t_m * (t_m * ((2.0d0 + (k / ((t_m * t_m) / k))) * ((sin(k) * tan(k)) / 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 (k <= 5e-123) {
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	} else if (k <= 235000.0) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	} else {
		tmp = 2.0 / ((t_m / l) * (t_m * (t_m * ((2.0 + (k / ((t_m * t_m) / k))) * ((Math.sin(k) * Math.tan(k)) / 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 k <= 5e-123:
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k)
	elif k <= 235000.0:
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))))
	else:
		tmp = 2.0 / ((t_m / l) * (t_m * (t_m * ((2.0 + (k / ((t_m * t_m) / k))) * ((math.sin(k) * math.tan(k)) / 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 (k <= 5e-123)
		tmp = Float64(Float64(l / t_m) * Float64(Float64(l / Float64(t_m * Float64(t_m * k))) / k));
	elseif (k <= 235000.0)
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(k * k) * Float64(Float64(Float64(2.0 * Float64(t_m * t_m)) / l) + Float64(Float64(k * Float64(k * Float64(1.0 + Float64(Float64(t_m * t_m) * 0.3333333333333333)))) / l)))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(t_m * Float64(t_m * Float64(Float64(2.0 + Float64(k / Float64(Float64(t_m * t_m) / k))) * Float64(Float64(sin(k) * tan(k)) / 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 (k <= 5e-123)
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	elseif (k <= 235000.0)
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	else
		tmp = 2.0 / ((t_m / l) * (t_m * (t_m * ((2.0 + (k / ((t_m * t_m) / k))) * ((sin(k) * tan(k)) / 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[k, 5e-123], N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(l / N[(t$95$m * N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 235000.0], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(N[(N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + N[(N[(k * N[(k * N[(1.0 + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[(t$95$m * N[(N[(2.0 + N[(k / N[(N[(t$95$m * t$95$m), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $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 \begin{array}{l}
\mathbf{if}\;k \leq 5 \cdot 10^{-123}:\\
\;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\\

\mathbf{elif}\;k \leq 235000:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\

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


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

    1. Initial program 58.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified57.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6468.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr68.2%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6470.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr70.1%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \frac{\ell \cdot \frac{\frac{\ell}{k}}{t \cdot t}}{\color{blue}{t \cdot k}} \]
      2. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{\frac{\ell}{k}}{t \cdot t}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\left(\frac{\ell}{\left(t \cdot t\right) \cdot k}\right), k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(\left(t \cdot t\right) \cdot k\right)\right), k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot k\right)\right)\right), k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot k\right)\right)\right), k\right)\right) \]
      10. *-lowering-*.f6474.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, k\right)\right)\right), k\right)\right) \]
    11. Applied egg-rr74.3%

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

    if 5.0000000000000003e-123 < k < 235000

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)}, \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left(\frac{2 \cdot {t}^{2}}{\ell}\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {t}^{2}\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({t}^{2}\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(t \cdot t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \mathsf{/.f64}\left(\left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \ell\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified91.9%

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

    if 235000 < k

    1. Initial program 34.2%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \left(\frac{\left(2 + \frac{\frac{k \cdot k}{t}}{t}\right) \cdot \left(\sin k \cdot \tan k\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \left(\left(2 + \frac{\frac{k \cdot k}{t}}{t}\right) \cdot \frac{\sin k \cdot \tan k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \left(\left(2 + \frac{\frac{k}{t} \cdot k}{t}\right) \cdot \frac{\sin k \cdot \tan k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \left(\left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right) \cdot \frac{\sin k \cdot \tan k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\frac{k}{\frac{t}{k}}}{t}\right)\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{k}{t \cdot \frac{t}{k}}\right)\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      11. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(k, \left(\frac{t \cdot t}{k}\right)\right)\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(t \cdot t\right), k\right)\right)\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, t\right), k\right)\right)\right), \left(\frac{\sin k \cdot \tan k}{\ell}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Applied egg-rr63.9%

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

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

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

\\
\begin{array}{l}
t_2 := \frac{\ell}{t\_m \cdot k}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 3.5 \cdot 10^{-58}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_2 \cdot t\_2}{t\_m}\\


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

    1. Initial program 46.8%

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)}, \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left(\frac{2 \cdot {t}^{2}}{\ell}\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {t}^{2}\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({t}^{2}\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(t \cdot t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \mathsf{/.f64}\left(\left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \ell\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified68.0%

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

    if 3.4999999999999999e-58 < t < 2.80000000000000008e34

    1. Initial program 69.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-rr88.2%

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

    if 2.80000000000000008e34 < t

    1. Initial program 65.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. Taylor expanded in k around 0

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6464.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified64.3%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6470.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr70.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6474.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr74.6%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      6. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
      11. *-lowering-*.f6481.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
    11. Applied egg-rr81.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3.5 \cdot 10^{-58}:\\ \;\;\;\;\frac{2}{\frac{t}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t \cdot t\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t \cdot t\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+34}:\\ \;\;\;\;\ell \cdot \left(\ell \cdot \frac{\frac{2}{t}}{\left(t \cdot t\right) \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k \cdot k}{t}}{t}\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\ell}{t \cdot k} \cdot \frac{\ell}{t \cdot k}}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 83.1% 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}\;t\_m \leq 4.7 \cdot 10^{-58}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(t\_m \cdot \frac{t\_m \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{k}{\frac{t\_m \cdot t\_m}{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 (<= t_m 4.7e-58)
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* k k)
       (+
        (/ (* 2.0 (* t_m t_m)) l)
        (/ (* k (* k (+ 1.0 (* (* t_m t_m) 0.3333333333333333)))) l)))))
    (/
     2.0
     (*
      (/ t_m l)
      (*
       (* t_m (/ (* t_m (sin k)) l))
       (* (tan k) (+ 2.0 (/ k (/ (* t_m t_m) k))))))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 4.7e-58) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + (k / ((t_m * 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 (t_m <= 4.7d-58) then
        tmp = 2.0d0 / ((t_m / l) * ((k * k) * (((2.0d0 * (t_m * t_m)) / l) + ((k * (k * (1.0d0 + ((t_m * t_m) * 0.3333333333333333d0)))) / l))))
    else
        tmp = 2.0d0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0d0 + (k / ((t_m * 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 (t_m <= 4.7e-58) {
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	} else {
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * Math.sin(k)) / l)) * (Math.tan(k) * (2.0 + (k / ((t_m * 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 t_m <= 4.7e-58:
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))))
	else:
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * math.sin(k)) / l)) * (math.tan(k) * (2.0 + (k / ((t_m * t_m) / k))))))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 4.7e-58)
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(k * k) * Float64(Float64(Float64(2.0 * Float64(t_m * t_m)) / l) + Float64(Float64(k * Float64(k * Float64(1.0 + Float64(Float64(t_m * t_m) * 0.3333333333333333)))) / l)))));
	else
		tmp = Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(t_m * Float64(Float64(t_m * sin(k)) / l)) * Float64(tan(k) * Float64(2.0 + Float64(k / Float64(Float64(t_m * 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 (t_m <= 4.7e-58)
		tmp = 2.0 / ((t_m / l) * ((k * k) * (((2.0 * (t_m * t_m)) / l) + ((k * (k * (1.0 + ((t_m * t_m) * 0.3333333333333333)))) / l))));
	else
		tmp = 2.0 / ((t_m / l) * ((t_m * ((t_m * sin(k)) / l)) * (tan(k) * (2.0 + (k / ((t_m * 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[t$95$m, 4.7e-58], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * N[(N[(N[(2.0 * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] + N[(N[(k * N[(k * N[(1.0 + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m * N[(N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(2.0 + N[(k / N[(N[(t$95$m * t$95$m), $MachinePrecision] / 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}\;t\_m \leq 4.7 \cdot 10^{-58}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\

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


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

    1. Initial program 46.8%

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)}, \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left(\frac{2 \cdot {t}^{2}}{\ell}\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {t}^{2}\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({t}^{2}\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(t \cdot t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \mathsf{/.f64}\left(\left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \ell\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified68.0%

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

    if 4.69999999999999994e-58 < t

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\left(2 + \frac{\frac{k \cdot k}{t}}{t}\right) \cdot \left(\sin k \cdot \tan k\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\left(\sin k \cdot \tan k\right) \cdot \left(2 + \frac{\frac{k \cdot k}{t}}{t}\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k \cdot k}{t}}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{t} \cdot k}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      5. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(t \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{t \cdot \left(\left(t \cdot \sin k\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)}{\ell}\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. associate-*r/N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(t \cdot \left(\frac{t \cdot \sin k}{\ell} \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\left(t \cdot \frac{t \cdot \sin k}{\ell}\right) \cdot \left(\tan k \cdot \left(2 + \frac{\frac{k}{\frac{t}{k}}}{t}\right)\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
    5. Applied egg-rr94.6%

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

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

Alternative 5: 75.2% accurate, 11.7× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{\ell}{t\_m \cdot k}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.65 \cdot 10^{-12}:\\
\;\;\;\;\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(k \cdot k\right) \cdot \left(\frac{2 \cdot \left(t\_m \cdot t\_m\right)}{\ell} + \frac{k \cdot \left(k \cdot \left(1 + \left(t\_m \cdot t\_m\right) \cdot 0.3333333333333333\right)\right)}{\ell}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_2 \cdot t\_2}{t\_m}\\


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

    1. Initial program 48.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)}, \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(\color{blue}{t}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot \frac{{t}^{2}}{\ell} + \frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left(\frac{2 \cdot {t}^{2}}{\ell}\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {t}^{2}\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({t}^{2}\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(t \cdot t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \left(\frac{{k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)}{\ell}\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, t\right)\right), \ell\right), \mathsf{/.f64}\left(\left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \ell\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified67.3%

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

    if 1.65e-12 < t

    1. Initial program 65.6%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6462.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified62.7%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6468.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr68.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6471.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr71.3%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      6. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
      11. *-lowering-*.f6476.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
    11. Applied egg-rr76.7%

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

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

Alternative 6: 72.1% accurate, 12.4× speedup?

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

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


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

    1. Initial program 59.2%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified57.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6468.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr68.3%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr70.7%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      6. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
      11. *-lowering-*.f6476.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
    11. Applied egg-rr76.6%

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

    if 8.99999999999999998e-68 < k

    1. Initial program 38.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-rr47.2%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right)}, \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right) + 2 \cdot {t}^{2}\right)\right), \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left({k}^{2} \cdot \left({t}^{2} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \left(2 \cdot {t}^{2}\right)\right)\right), \ell\right), \mathsf{/.f64}\left(t, \ell\right)\right)\right) \]
    6. Simplified54.3%

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

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

Alternative 7: 70.7% accurate, 15.0× speedup?

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

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


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

    1. Initial program 58.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. Taylor expanded in k around 0

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified57.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6468.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr68.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr70.7%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      6. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
      11. *-lowering-*.f6476.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
    11. Applied egg-rr76.4%

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

    if 1.42000000000000005e-39 < k

    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. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left(\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)\right)}\right) \]
      2. associate-*l*N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left({t}^{3} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)\right)}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      5. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right)}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\ell}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right) + 2 \cdot {t}^{3}\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left({k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \left(2 \cdot {t}^{3}\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    7. Simplified45.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\color{blue}{\left({k}^{2} \cdot t\right)}, \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      3. *-lowering-*.f6445.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \mathsf{*.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    10. Simplified45.4%

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

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

Alternative 8: 70.1% accurate, 21.0× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \frac{\ell}{t\_m \cdot k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 9 \cdot 10^{-34}:\\ \;\;\;\;\frac{t\_2 \cdot t\_2}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}{\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 (/ l (* t_m k))))
   (*
    t_s
    (if (<= k 9e-34)
      (/ (* t_2 t_2) t_m)
      (/ 2.0 (/ (* (* k k) (* t_m (* k 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 = l / (t_m * k);
	double tmp;
	if (k <= 9e-34) {
		tmp = (t_2 * t_2) / t_m;
	} else {
		tmp = 2.0 / (((k * k) * (t_m * (k * 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) :: t_2
    real(8) :: tmp
    t_2 = l / (t_m * k)
    if (k <= 9d-34) then
        tmp = (t_2 * t_2) / t_m
    else
        tmp = 2.0d0 / (((k * k) * (t_m * (k * 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 t_2 = l / (t_m * k);
	double tmp;
	if (k <= 9e-34) {
		tmp = (t_2 * t_2) / t_m;
	} else {
		tmp = 2.0 / (((k * k) * (t_m * (k * 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):
	t_2 = l / (t_m * k)
	tmp = 0
	if k <= 9e-34:
		tmp = (t_2 * t_2) / t_m
	else:
		tmp = 2.0 / (((k * k) * (t_m * (k * 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(l / Float64(t_m * k))
	tmp = 0.0
	if (k <= 9e-34)
		tmp = Float64(Float64(t_2 * t_2) / t_m);
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(t_m * Float64(k * 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)
	t_2 = l / (t_m * k);
	tmp = 0.0;
	if (k <= 9e-34)
		tmp = (t_2 * t_2) / t_m;
	else
		tmp = 2.0 / (((k * k) * (t_m * (k * 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_] := Block[{t$95$2 = N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 9e-34], N[(N[(t$95$2 * t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $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 := \frac{\ell}{t\_m \cdot k}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 9 \cdot 10^{-34}:\\
\;\;\;\;\frac{t\_2 \cdot t\_2}{t\_m}\\

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


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

    1. Initial program 58.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}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6457.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified57.3%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6468.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr68.6%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6470.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr70.9%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      6. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
      11. *-lowering-*.f6476.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
    11. Applied egg-rr76.5%

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

    if 9.00000000000000085e-34 < k

    1. Initial program 35.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. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \color{blue}{\left(\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)\right)}\right) \]
      2. associate-*l*N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left({t}^{3} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)\right)}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left({t}^{3} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)\right)\right), \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
    3. Simplified37.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\color{blue}{\left({k}^{2} \cdot \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right)}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\color{blue}{\ell}, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(2 \cdot {t}^{3} + {k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right) + 2 \cdot {t}^{3}\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{+.f64}\left(\left({k}^{2} \cdot \left({t}^{3} \cdot \left(\frac{1}{3} + \frac{1}{{t}^{2}}\right)\right)\right), \left(2 \cdot {t}^{3}\right)\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    7. Simplified44.6%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(\left({k}^{2}\right), t\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(\left(k \cdot k\right), t\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
      3. *-lowering-*.f6444.6%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right)\right), \mathsf{*.f64}\left(\ell, \ell\right)\right)\right) \]
    10. Simplified44.6%

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

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

Alternative 9: 72.0% accurate, 23.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}\;t\_m \leq 5 \cdot 10^{-32}:\\ \;\;\;\;\frac{\frac{\frac{\frac{\ell}{k}}{\frac{t\_m \cdot k}{\ell}}}{t\_m}}{t\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{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 5e-32)
    (/ (/ (/ (/ l k) (/ (* t_m k) l)) t_m) t_m)
    (* (/ l t_m) (/ (/ l (* t_m (* 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) {
	double tmp;
	if (t_m <= 5e-32) {
		tmp = (((l / k) / ((t_m * k) / l)) / t_m) / t_m;
	} else {
		tmp = (l / t_m) * ((l / (t_m * (t_m * 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 <= 5d-32) then
        tmp = (((l / k) / ((t_m * k) / l)) / t_m) / t_m
    else
        tmp = (l / t_m) * ((l / (t_m * (t_m * 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 <= 5e-32) {
		tmp = (((l / k) / ((t_m * k) / l)) / t_m) / t_m;
	} else {
		tmp = (l / t_m) * ((l / (t_m * (t_m * 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 <= 5e-32:
		tmp = (((l / k) / ((t_m * k) / l)) / t_m) / t_m
	else:
		tmp = (l / t_m) * ((l / (t_m * (t_m * 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 <= 5e-32)
		tmp = Float64(Float64(Float64(Float64(l / k) / Float64(Float64(t_m * k) / l)) / t_m) / t_m);
	else
		tmp = Float64(Float64(l / t_m) * Float64(Float64(l / Float64(t_m * Float64(t_m * 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 <= 5e-32)
		tmp = (((l / k) / ((t_m * k) / l)) / t_m) / t_m;
	else
		tmp = (l / t_m) * ((l / (t_m * (t_m * 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, 5e-32], N[(N[(N[(N[(l / k), $MachinePrecision] / N[(N[(t$95$m * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(l / N[(t$95$m * N[(t$95$m * k), $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 5 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{\frac{\frac{\ell}{k}}{\frac{t\_m \cdot k}{\ell}}}{t\_m}}{t\_m}\\

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


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

    1. Initial program 47.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. Taylor expanded in k around 0

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6446.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified46.4%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6455.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr55.3%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6456.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr56.5%

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

        \[\leadsto \frac{\frac{\ell}{t \cdot k} \cdot \frac{\ell}{k}}{\color{blue}{t \cdot t}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{\frac{\frac{\ell}{t \cdot k} \cdot \frac{\ell}{k}}{t}}{\color{blue}{t}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t \cdot k} \cdot \frac{\ell}{k}}{t}\right), \color{blue}{t}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{t \cdot k} \cdot \frac{\ell}{k}\right), t\right), t\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\frac{t \cdot k}{\ell}} \cdot \frac{\ell}{k}\right), t\right), t\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{1 \cdot \frac{\ell}{k}}{\frac{t \cdot k}{\ell}}\right), t\right), t\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{1 \cdot \frac{1}{\frac{k}{\ell}}}{\frac{t \cdot k}{\ell}}\right), t\right), t\right) \]
      8. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{1}{\frac{k}{\ell}}}{\frac{t \cdot k}{\ell}}\right), t\right), t\right) \]
      9. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{\ell}{k}}{\frac{t \cdot k}{\ell}}\right), t\right), t\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \left(\frac{t \cdot k}{\ell}\right)\right), t\right), t\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{t \cdot k}{\ell}\right)\right), t\right), t\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\left(t \cdot k\right), \ell\right)\right), t\right), t\right) \]
      13. *-lowering-*.f6463.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, k\right), \ell\right)\right), t\right), t\right) \]
    11. Applied egg-rr63.6%

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

    if 5e-32 < t

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified60.9%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6465.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr65.5%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6468.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr68.5%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \frac{\ell \cdot \frac{\frac{\ell}{k}}{t \cdot t}}{\color{blue}{t \cdot k}} \]
      2. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{\frac{\ell}{k}}{t \cdot t}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\left(\frac{\ell}{\left(t \cdot t\right) \cdot k}\right), k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(\left(t \cdot t\right) \cdot k\right)\right), k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot k\right)\right)\right), k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot k\right)\right)\right), k\right)\right) \]
      10. *-lowering-*.f6472.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, k\right)\right)\right), k\right)\right) \]
    11. Applied egg-rr72.4%

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

Alternative 10: 67.9% accurate, 23.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}\;k \leq 5.4 \cdot 10^{+87}:\\ \;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{t\_m \cdot \left(t\_m \cdot \left(t\_m \cdot \left(k \cdot 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 5.4e+87)
    (* (/ l t_m) (/ (/ l (* t_m (* t_m k))) k))
    (/ (* l l) (* t_m (* t_m (* 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) {
	double tmp;
	if (k <= 5.4e+87) {
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	} else {
		tmp = (l * l) / (t_m * (t_m * (t_m * (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 <= 5.4d+87) then
        tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k)
    else
        tmp = (l * l) / (t_m * (t_m * (t_m * (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 <= 5.4e+87) {
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	} else {
		tmp = (l * l) / (t_m * (t_m * (t_m * (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 <= 5.4e+87:
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k)
	else:
		tmp = (l * l) / (t_m * (t_m * (t_m * (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 <= 5.4e+87)
		tmp = Float64(Float64(l / t_m) * Float64(Float64(l / Float64(t_m * Float64(t_m * k))) / k));
	else
		tmp = Float64(Float64(l * l) / Float64(t_m * Float64(t_m * Float64(t_m * Float64(k * k)))));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (k <= 5.4e+87)
		tmp = (l / t_m) * ((l / (t_m * (t_m * k))) / k);
	else
		tmp = (l * l) / (t_m * (t_m * (t_m * (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, 5.4e+87], N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(l / N[(t$95$m * N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(t$95$m * N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;k \leq 5.4 \cdot 10^{+87}:\\
\;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\\

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


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

    1. Initial program 56.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6454.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified54.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. /-lowering-/.f6463.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    7. Applied egg-rr63.9%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
      10. *-lowering-*.f6465.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
    9. Applied egg-rr65.8%

      \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
    10. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \frac{\ell \cdot \frac{\frac{\ell}{k}}{t \cdot t}}{\color{blue}{t \cdot k}} \]
      2. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{\frac{\ell}{k}}{t \cdot t}}{k}\right)}\right) \]
      4. /-lowering-/.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\left(\frac{\ell}{\left(t \cdot t\right) \cdot k}\right), k\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(\left(t \cdot t\right) \cdot k\right)\right), k\right)\right) \]
      8. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot k\right)\right)\right), k\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot k\right)\right)\right), k\right)\right) \]
      10. *-lowering-*.f6469.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, k\right)\right)\right), k\right)\right) \]
    11. Applied egg-rr69.3%

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

    if 5.40000000000000013e87 < k

    1. Initial program 34.1%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
      4. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
      12. *-lowering-*.f6428.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
    5. Simplified28.3%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{k \cdot \left(k \cdot \left(t \cdot \left(t \cdot t\right)\right)\right)}} \]
    6. Step-by-step derivation
      1. cube-unmultN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left({t}^{\color{blue}{3}}\right)\right)\right)\right) \]
      2. pow-lowering-pow.f6428.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{pow.f64}\left(t, \color{blue}{3}\right)\right)\right)\right) \]
    7. Applied egg-rr28.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \color{blue}{\left(t \cdot t\right)}\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot t\right) \cdot \color{blue}{t}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot t\right), \color{blue}{t}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), t\right), t\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(t \cdot \left(k \cdot k\right)\right), t\right), t\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(k \cdot k\right)\right), t\right), t\right)\right) \]
      9. *-lowering-*.f6444.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right), t\right), t\right)\right) \]
    9. Applied egg-rr44.3%

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

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

Alternative 11: 70.0% accurate, 32.4× speedup?

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

\\
\begin{array}{l}
t_2 := \frac{\ell}{t\_m \cdot k}\\
t\_s \cdot \frac{t\_2 \cdot t\_2}{t\_m}
\end{array}
\end{array}
Derivation
  1. Initial program 52.3%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    4. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
    8. cube-multN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
    9. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f6450.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
  5. Simplified50.0%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    8. /-lowering-/.f6457.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
  7. Applied egg-rr57.9%

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
    10. *-lowering-*.f6459.5%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
  9. Applied egg-rr59.5%

    \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
  10. Step-by-step derivation
    1. associate-/l/N/A

      \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\color{blue}{\frac{\ell}{k}}}{t \cdot t} \]
    2. associate-/r*N/A

      \[\leadsto \frac{\frac{\ell}{k}}{t} \cdot \frac{\frac{\frac{\ell}{k}}{t}}{\color{blue}{t}} \]
    3. associate-*r/N/A

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\ell}{k}}{t}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
    6. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\ell}{t \cdot k}\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{k}}{t}\right)\right), t\right) \]
    9. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\ell}{t \cdot k}\right)\right), t\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right)\right), t\right) \]
    11. *-lowering-*.f6465.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right) \]
  11. Applied egg-rr65.5%

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

Alternative 12: 67.0% accurate, 32.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\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 t_m) (/ (/ l (* t_m (* 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 / t_m) * ((l / (t_m * (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 / t_m) * ((l / (t_m * (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 / t_m) * ((l / (t_m * (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 / t_m) * ((l / (t_m * (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(Float64(l / t_m) * Float64(Float64(l / Float64(t_m * Float64(t_m * 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 / t_m) * ((l / (t_m * (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[(N[(l / t$95$m), $MachinePrecision] * N[(N[(l / N[(t$95$m * N[(t$95$m * k), $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 \left(\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{k}\right)
\end{array}
Derivation
  1. Initial program 52.3%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    4. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
    8. cube-multN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
    9. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f6450.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
  5. Simplified50.0%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    8. /-lowering-/.f6457.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
  7. Applied egg-rr57.9%

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
    10. *-lowering-*.f6459.5%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
  9. Applied egg-rr59.5%

    \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
  10. Step-by-step derivation
    1. associate-*l/N/A

      \[\leadsto \frac{\ell \cdot \frac{\frac{\ell}{k}}{t \cdot t}}{\color{blue}{t \cdot k}} \]
    2. times-fracN/A

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{t}\right), \color{blue}{\left(\frac{\frac{\frac{\ell}{k}}{t \cdot t}}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\left(\frac{\ell}{\left(t \cdot t\right) \cdot k}\right), k\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(\left(t \cdot t\right) \cdot k\right)\right), k\right)\right) \]
    8. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot k\right)\right)\right), k\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot k\right)\right)\right), k\right)\right) \]
    10. *-lowering-*.f6463.3%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, k\right)\right)\right), k\right)\right) \]
  11. Applied egg-rr63.3%

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

Alternative 13: 66.0% accurate, 32.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\ell}{t\_m \cdot \left(t\_m \cdot k\right)}}{t\_m}\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 k) (/ (/ l (* t_m (* t_m k))) t_m))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((l / k) * ((l / (t_m * (t_m * k))) / t_m));
}
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 / k) * ((l / (t_m * (t_m * k))) / t_m))
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 / k) * ((l / (t_m * (t_m * k))) / t_m));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * ((l / k) * ((l / (t_m * (t_m * k))) / t_m))
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 / k) * Float64(Float64(l / Float64(t_m * Float64(t_m * k))) / t_m)))
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 / k) * ((l / (t_m * (t_m * k))) / t_m));
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 / k), $MachinePrecision] * N[(N[(l / N[(t$95$m * N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\color{blue}{{k}^{2}} \cdot {t}^{3}\right)\right) \]
    4. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot {t}^{3}\right)}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left({t}^{3}\right)}\right)\right)\right) \]
    8. cube-multN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(t \cdot \color{blue}{\left(t \cdot t\right)}\right)\right)\right)\right) \]
    9. unpow2N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \color{blue}{\left({t}^{2}\right)}\right)\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. *-lowering-*.f6450.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right)\right)\right) \]
  5. Simplified50.0%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k \cdot \left(t \cdot \left(t \cdot t\right)\right)}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
    4. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \left(t \cdot \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(t \cdot t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
    8. /-lowering-/.f6457.9%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
  7. Applied egg-rr57.9%

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \left(\frac{\frac{\ell}{\color{blue}{k}}}{t \cdot t}\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(t \cdot t\right)}\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\color{blue}{t} \cdot t\right)\right)\right) \]
    10. *-lowering-*.f6459.5%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, k\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(t, \color{blue}{t}\right)\right)\right) \]
  9. Applied egg-rr59.5%

    \[\leadsto \color{blue}{\frac{\ell}{t \cdot k} \cdot \frac{\frac{\ell}{k}}{t \cdot t}} \]
  10. Step-by-step derivation
    1. associate-*l/N/A

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

      \[\leadsto \frac{\ell \cdot \frac{\frac{\ell}{k}}{t \cdot t}}{k \cdot \color{blue}{t}} \]
    3. times-fracN/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{\frac{\frac{\ell}{k}}{t \cdot t}}}{t}\right)\right) \]
    6. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{\left(t \cdot t\right) \cdot k}\right), t\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(\left(t \cdot t\right) \cdot k\right)\right), t\right)\right) \]
    9. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(t \cdot \left(t \cdot k\right)\right)\right), t\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \left(t \cdot k\right)\right)\right), t\right)\right) \]
    11. *-lowering-*.f6462.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, k\right)\right)\right), t\right)\right) \]
  11. Applied egg-rr62.2%

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

Reproduce

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