Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.4% → 95.2%
Time: 8.0s
Alternatives: 14
Speedup: 5.7×

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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k)
use fmin_fmax_functions
    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}

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 14 alternatives:

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

Initial Program: 35.4% 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.2 \cdot 10^{-161}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\frac{\cos k}{k} \cdot \frac{\ell}{\left(\mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right) \cdot t\_m\right) \cdot k}\right)\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
    4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \color{blue}{\frac{\cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}}\right)\right) \]
      11. lower-/.f6482.3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\frac{\cos k}{k} \cdot \frac{\color{blue}{\ell}}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k}\right)\right) \]
      10. lower-/.f6483.0

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\frac{\cos k}{k} \cdot \frac{\ell}{\color{blue}{\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k}}\right)\right) \]
    8. Applied rewrites83.0%

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

    if 7.20000000000000036e-161 < t

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.2 \cdot 10^{-161}:\\
\;\;\;\;\frac{\cos k \cdot \ell}{\left(\mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right) \cdot t\_m\right) \cdot k} \cdot \frac{\ell + \ell}{k}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
    4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \color{blue}{\frac{\cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}}\right)\right) \]
      11. lower-/.f6482.3

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(\ell \cdot \frac{\cos k}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k}\right) \cdot \ell\right) \]
      5. lift-/.f64N/A

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

        \[\leadsto 2 \cdot \left(\frac{\ell \cdot \cos k}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k} \cdot \ell\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\frac{\cos k \cdot \ell}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k} \cdot \ell\right) \]
      8. lift-*.f64N/A

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

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

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

      \[\leadsto \frac{\cos k \cdot \ell}{\left(\mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right) \cdot t\right) \cdot k} \cdot \color{blue}{\frac{\ell + \ell}{k}} \]

    if 7.20000000000000036e-161 < t

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.2 \cdot 10^{-161}:\\
\;\;\;\;\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell + \ell}{\left(\mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right) \cdot t\_m\right) \cdot k}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
    4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \color{blue}{\frac{\cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}}\right)\right) \]
      11. lower-/.f6482.3

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(\ell \cdot \frac{\cos k}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k}\right) \cdot \ell\right) \]
      5. lift-/.f64N/A

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

        \[\leadsto 2 \cdot \left(\frac{\ell \cdot \cos k}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k} \cdot \ell\right) \]
      7. *-commutativeN/A

        \[\leadsto 2 \cdot \left(\frac{\cos k \cdot \ell}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k\right) \cdot k} \cdot \ell\right) \]
      8. lift-*.f64N/A

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

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

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

      \[\leadsto \frac{\cos k \cdot \ell}{k} \cdot \color{blue}{\frac{\ell + \ell}{\left(\mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right) \cdot t\right) \cdot k}} \]

    if 7.20000000000000036e-161 < t

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 93.9% accurate, 1.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{2}{\tan k} \cdot \left(\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\sin k \cdot t\_m} \cdot 1\right)\right) \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* (/ 2.0 (tan k)) (* (/ (* (/ l k) (/ l k)) (* (sin k) t_m)) 1.0))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 / tan(k)) * ((((l / k) * (l / k)) / (sin(k) * t_m)) * 1.0));
}
t\_m =     private
t\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.6% accurate, 1.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := \sin k \cdot t\_m\\ t_3 := \frac{2}{\tan k}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 1.8 \cdot 10^{+134}:\\ \;\;\;\;\frac{\ell}{k \cdot k} \cdot \left(\frac{\ell}{t\_2} \cdot t\_3\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3 \cdot \frac{\frac{\ell}{k} \cdot \ell}{k \cdot t\_2}\\ \end{array} \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (* (sin k) t_m)) (t_3 (/ 2.0 (tan k))))
   (*
    t_s
    (if (<= k 1.8e+134)
      (* (/ l (* k k)) (* (/ l t_2) t_3))
      (* t_3 (/ (* (/ l k) l) (* k t_2)))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double t_2 = sin(k) * t_m;
	double t_3 = 2.0 / tan(k);
	double tmp;
	if (k <= 1.8e+134) {
		tmp = (l / (k * k)) * ((l / t_2) * t_3);
	} else {
		tmp = t_3 * (((l / k) * l) / (k * t_2));
	}
	return t_s * tmp;
}
t\_m =     private
t\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = sin(k) * t_m
    t_3 = 2.0d0 / tan(k)
    if (k <= 1.8d+134) then
        tmp = (l / (k * k)) * ((l / t_2) * t_3)
    else
        tmp = t_3 * (((l / k) * l) / (k * t_2))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double t_2 = Math.sin(k) * t_m;
	double t_3 = 2.0 / Math.tan(k);
	double tmp;
	if (k <= 1.8e+134) {
		tmp = (l / (k * k)) * ((l / t_2) * t_3);
	} else {
		tmp = t_3 * (((l / k) * l) / (k * t_2));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	t_2 = math.sin(k) * t_m
	t_3 = 2.0 / math.tan(k)
	tmp = 0
	if k <= 1.8e+134:
		tmp = (l / (k * k)) * ((l / t_2) * t_3)
	else:
		tmp = t_3 * (((l / k) * l) / (k * t_2))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(sin(k) * t_m)
	t_3 = Float64(2.0 / tan(k))
	tmp = 0.0
	if (k <= 1.8e+134)
		tmp = Float64(Float64(l / Float64(k * k)) * Float64(Float64(l / t_2) * t_3));
	else
		tmp = Float64(t_3 * Float64(Float64(Float64(l / k) * l) / Float64(k * t_2)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	t_2 = sin(k) * t_m;
	t_3 = 2.0 / tan(k);
	tmp = 0.0;
	if (k <= 1.8e+134)
		tmp = (l / (k * k)) * ((l / t_2) * t_3);
	else
		tmp = t_3 * (((l / k) * l) / (k * t_2));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.8e+134], N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(k * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

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

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


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

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.79999999999999994e134 < k

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.3% accurate, 1.4× speedup?

\[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \left(\frac{2}{\tan k} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{\sin k \cdot t\_m}}{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 (* (/ 2.0 (tan k)) (/ (* (/ l k) (/ l (* (sin k) t_m))) k))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 / tan(k)) * (((l / k) * (l / (sin(k) * t_m))) / k));
}
t\_m =     private
t\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = t_s * ((2.0d0 / tan(k)) * (((l / k) * (l / (sin(k) * t_m))) / k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	return t_s * ((2.0 / Math.tan(k)) * (((l / k) * (l / (Math.sin(k) * t_m))) / k));
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * ((2.0 / math.tan(k)) * (((l / k) * (l / (math.sin(k) * t_m))) / k))
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(Float64(2.0 / tan(k)) * Float64(Float64(Float64(l / k) * Float64(l / Float64(sin(k) * t_m))) / k)))
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * ((2.0 / tan(k)) * (((l / k) * (l / (sin(k) * t_m))) / k));
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] * N[(l / N[(N[Sin[k], $MachinePrecision] * t$95$m), $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{2}{\tan k} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{\sin k \cdot t\_m}}{k}\right)
\end{array}
Derivation
  1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\tan k} \cdot \frac{\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{\sin k \cdot t}}}{k} \]
  8. Applied rewrites93.6%

    \[\leadsto \frac{2}{\tan k} \cdot \color{blue}{\frac{\frac{\ell}{k} \cdot \frac{\ell}{\sin k \cdot t}}{k}} \]
  9. Add Preprocessing

Alternative 7: 87.1% accurate, 1.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.8 \cdot 10^{-73}:\\ \;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{k \cdot k} \cdot \ell}{\sin k \cdot t\_m} \cdot 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{\tan k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \sin k}\right) \cdot \frac{\ell}{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
 (*
  t_s
  (if (<= k 5.8e-73)
    (* (/ 2.0 k) (* (/ (* (/ l (* k k)) l) (* (sin k) t_m)) 1.0))
    (* (* (/ 2.0 (tan k)) (/ l (* (* k k) (sin k)))) (/ l 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 tmp;
	if (k <= 5.8e-73) {
		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0);
	} else {
		tmp = ((2.0 / tan(k)) * (l / ((k * k) * sin(k)))) * (l / t_m);
	}
	return t_s * tmp;
}
t\_m =     private
t\_s =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
    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.8d-73) then
        tmp = (2.0d0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0d0)
    else
        tmp = ((2.0d0 / tan(k)) * (l / ((k * k) * sin(k)))) * (l / 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 tmp;
	if (k <= 5.8e-73) {
		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (Math.sin(k) * t_m)) * 1.0);
	} else {
		tmp = ((2.0 / Math.tan(k)) * (l / ((k * k) * Math.sin(k)))) * (l / 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):
	tmp = 0
	if k <= 5.8e-73:
		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (math.sin(k) * t_m)) * 1.0)
	else:
		tmp = ((2.0 / math.tan(k)) * (l / ((k * k) * math.sin(k)))) * (l / t_m)
	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.8e-73)
		tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(Float64(l / Float64(k * k)) * l) / Float64(sin(k) * t_m)) * 1.0));
	else
		tmp = Float64(Float64(Float64(2.0 / tan(k)) * Float64(l / Float64(Float64(k * k) * sin(k)))) * Float64(l / 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)
	tmp = 0.0;
	if (k <= 5.8e-73)
		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0);
	else
		tmp = ((2.0 / tan(k)) * (l / ((k * k) * sin(k)))) * (l / 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_] := N[(t$95$s * If[LessEqual[k, 5.8e-73], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / 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 \begin{array}{l}
\mathbf{if}\;k \leq 5.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{k \cdot k} \cdot \ell}{\sin k \cdot t\_m} \cdot 1\right)\\

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


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

    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 5.8e-73 < k

      1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 84.0% accurate, 1.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 k} \cdot \left(\frac{\ell}{\sin k \cdot t\_m} \cdot \frac{2}{\tan k}\right)\right) \end{array} \]
    t\_m = (fabs.f64 t)
    t\_s = (copysign.f64 #s(literal 1 binary64) t)
    (FPCore (t_s t_m l k)
     :precision binary64
     (* t_s (* (/ l (* k k)) (* (/ l (* (sin k) t_m)) (/ 2.0 (tan 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 / (k * k)) * ((l / (sin(k) * t_m)) * (2.0 / tan(k))));
    }
    
    t\_m =     private
    t\_s =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(t_s, t_m, l, k)
    use fmin_fmax_functions
        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 * k)) * ((l / (sin(k) * t_m)) * (2.0d0 / tan(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 / (k * k)) * ((l / (Math.sin(k) * t_m)) * (2.0 / Math.tan(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 / (k * k)) * ((l / (math.sin(k) * t_m)) * (2.0 / math.tan(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 / Float64(k * k)) * Float64(Float64(l / Float64(sin(k) * t_m)) * Float64(2.0 / tan(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 / (k * k)) * ((l / (sin(k) * t_m)) * (2.0 / tan(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 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    t\_m = \left|t\right|
    \\
    t\_s = \mathsf{copysign}\left(1, t\right)
    
    \\
    t\_s \cdot \left(\frac{\ell}{k \cdot k} \cdot \left(\frac{\ell}{\sin k \cdot t\_m} \cdot \frac{2}{\tan k}\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 9: 80.3% accurate, 1.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 7.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{k \cdot k} \cdot \ell}{\sin k \cdot t\_m} \cdot 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \sin k}\right) \cdot 2}{t\_m \cdot \tan 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 (<= k 7.2e-76)
        (* (/ 2.0 k) (* (/ (* (/ l (* k k)) l) (* (sin k) t_m)) 1.0))
        (/ (* (* l (/ l (* (* k k) (sin k)))) 2.0) (* t_m (tan 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 <= 7.2e-76) {
    		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0);
    	} else {
    		tmp = ((l * (l / ((k * k) * sin(k)))) * 2.0) / (t_m * tan(k));
    	}
    	return t_s * tmp;
    }
    
    t\_m =     private
    t\_s =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(t_s, t_m, l, k)
    use fmin_fmax_functions
        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 <= 7.2d-76) then
            tmp = (2.0d0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0d0)
        else
            tmp = ((l * (l / ((k * k) * sin(k)))) * 2.0d0) / (t_m * tan(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 <= 7.2e-76) {
    		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (Math.sin(k) * t_m)) * 1.0);
    	} else {
    		tmp = ((l * (l / ((k * k) * Math.sin(k)))) * 2.0) / (t_m * Math.tan(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 <= 7.2e-76:
    		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (math.sin(k) * t_m)) * 1.0)
    	else:
    		tmp = ((l * (l / ((k * k) * math.sin(k)))) * 2.0) / (t_m * math.tan(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 <= 7.2e-76)
    		tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(Float64(l / Float64(k * k)) * l) / Float64(sin(k) * t_m)) * 1.0));
    	else
    		tmp = Float64(Float64(Float64(l * Float64(l / Float64(Float64(k * k) * sin(k)))) * 2.0) / Float64(t_m * tan(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 <= 7.2e-76)
    		tmp = (2.0 / k) * ((((l / (k * k)) * l) / (sin(k) * t_m)) * 1.0);
    	else
    		tmp = ((l * (l / ((k * k) * sin(k)))) * 2.0) / (t_m * tan(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, 7.2e-76], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[(l / N[(N[(k * k), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(t$95$m * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
    
    \begin{array}{l}
    t\_m = \left|t\right|
    \\
    t\_s = \mathsf{copysign}\left(1, t\right)
    
    \\
    t\_s \cdot \begin{array}{l}
    \mathbf{if}\;k \leq 7.2 \cdot 10^{-76}:\\
    \;\;\;\;\frac{2}{k} \cdot \left(\frac{\frac{\ell}{k \cdot k} \cdot \ell}{\sin k \cdot t\_m} \cdot 1\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \sin k}\right) \cdot 2}{t\_m \cdot \tan k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 7.2000000000000001e-76

      1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 7.2000000000000001e-76 < k

        1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{\frac{\ell}{k \cdot k} \cdot \ell}{\sin k} \cdot 2}{t \cdot \tan k}} \]
        8. Applied rewrites82.6%

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

      Alternative 10: 79.2% accurate, 1.4× speedup?

      \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{\left(\frac{\ell}{k \cdot k} \cdot \ell\right) \cdot 2}{\left(\sin k \cdot t\_m\right) \cdot \tan k} \end{array} \]
      t\_m = (fabs.f64 t)
      t\_s = (copysign.f64 #s(literal 1 binary64) t)
      (FPCore (t_s t_m l k)
       :precision binary64
       (* t_s (/ (* (* (/ l (* k k)) l) 2.0) (* (* (sin k) t_m) (tan 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 / (k * k)) * l) * 2.0) / ((sin(k) * t_m) * tan(k)));
      }
      
      t\_m =     private
      t\_s =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t_s, t_m, l, k)
      use fmin_fmax_functions
          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 * k)) * l) * 2.0d0) / ((sin(k) * t_m) * tan(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 / (k * k)) * l) * 2.0) / ((Math.sin(k) * t_m) * Math.tan(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 / (k * k)) * l) * 2.0) / ((math.sin(k) * t_m) * math.tan(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(Float64(Float64(l / Float64(k * k)) * l) * 2.0) / Float64(Float64(sin(k) * t_m) * tan(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 / (k * k)) * l) * 2.0) / ((sin(k) * t_m) * tan(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[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      t\_m = \left|t\right|
      \\
      t\_s = \mathsf{copysign}\left(1, t\right)
      
      \\
      t\_s \cdot \frac{\left(\frac{\ell}{k \cdot k} \cdot \ell\right) \cdot 2}{\left(\sin k \cdot t\_m\right) \cdot \tan k}
      \end{array}
      
      Derivation
      1. Initial program 35.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. Applied rewrites29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 74.0% accurate, 2.1× speedup?

      \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\ell \leq 1.06 \cdot 10^{+158}:\\ \;\;\;\;\frac{\frac{2}{t\_m} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\_m\right) \cdot k\right) \cdot k}\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 (<= l 1.06e+158)
          (/ (* (/ 2.0 t_m) (* (/ l (* k k)) l)) (* k k))
          (* 2.0 (* l (* l (/ (cos k) (* (* (* (- 0.5 0.5) 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 (l <= 1.06e+158) {
      		tmp = ((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k);
      	} else {
      		tmp = 2.0 * (l * (l * (cos(k) / ((((0.5 - 0.5) * t_m) * k) * k))));
      	}
      	return t_s * tmp;
      }
      
      t\_m =     private
      t\_s =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t_s, t_m, l, k)
      use fmin_fmax_functions
          real(8), intent (in) :: t_s
          real(8), intent (in) :: t_m
          real(8), intent (in) :: l
          real(8), intent (in) :: k
          real(8) :: tmp
          if (l <= 1.06d+158) then
              tmp = ((2.0d0 / t_m) * ((l / (k * k)) * l)) / (k * k)
          else
              tmp = 2.0d0 * (l * (l * (cos(k) / ((((0.5d0 - 0.5d0) * 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 (l <= 1.06e+158) {
      		tmp = ((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k);
      	} else {
      		tmp = 2.0 * (l * (l * (Math.cos(k) / ((((0.5 - 0.5) * 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 l <= 1.06e+158:
      		tmp = ((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k)
      	else:
      		tmp = 2.0 * (l * (l * (math.cos(k) / ((((0.5 - 0.5) * 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 (l <= 1.06e+158)
      		tmp = Float64(Float64(Float64(2.0 / t_m) * Float64(Float64(l / Float64(k * k)) * l)) / Float64(k * k));
      	else
      		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(k) / Float64(Float64(Float64(Float64(0.5 - 0.5) * 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 (l <= 1.06e+158)
      		tmp = ((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k);
      	else
      		tmp = 2.0 * (l * (l * (cos(k) / ((((0.5 - 0.5) * 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[l, 1.06e+158], N[(N[(N[(2.0 / t$95$m), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(l * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t$95$m), $MachinePrecision] * k), $MachinePrecision] * 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}\;\ell \leq 1.06 \cdot 10^{+158}:\\
      \;\;\;\;\frac{\frac{2}{t\_m} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k}\\
      
      \mathbf{else}:\\
      \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\_m\right) \cdot k\right) \cdot k}\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if l < 1.06e158

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
        4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lower-pow.f6465.7

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
        9. Applied rewrites65.7%

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          2. lift-/.f64N/A

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

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

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lift-pow.f64N/A

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          6. pow2N/A

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

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

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

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{{\ell}^{2}}{k \cdot k}}{k \cdot k} \]
          10. lift-pow.f64N/A

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{{\ell}^{2}}{k \cdot k}}{k \cdot k} \]
          11. pow2N/A

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
          12. associate-*l/N/A

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

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

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

            \[\leadsto \frac{\frac{2}{t} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k} \]
          16. lower-/.f6473.0

            \[\leadsto \frac{\frac{2}{t} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k} \]
        11. Applied rewrites73.0%

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

        if 1.06e158 < l

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
        4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \color{blue}{\frac{\cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}}\right)\right) \]
          11. lower-/.f6482.3

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot t\right) \cdot k\right) \cdot k}\right)\right) \]
        8. Step-by-step derivation
          1. Applied rewrites41.6%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k\right) \cdot k}\right)\right) \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 12: 73.0% accurate, 5.5× speedup?

        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{\frac{2}{t\_m} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k} \end{array} \]
        t\_m = (fabs.f64 t)
        t\_s = (copysign.f64 #s(literal 1 binary64) t)
        (FPCore (t_s t_m l k)
         :precision binary64
         (* t_s (/ (* (/ 2.0 t_m) (* (/ l (* k k)) l)) (* k k))))
        t\_m = fabs(t);
        t\_s = copysign(1.0, t);
        double code(double t_s, double t_m, double l, double k) {
        	return t_s * (((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k));
        }
        
        t\_m =     private
        t\_s =     private
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(t_s, t_m, l, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t_s
            real(8), intent (in) :: t_m
            real(8), intent (in) :: l
            real(8), intent (in) :: k
            code = t_s * (((2.0d0 / t_m) * ((l / (k * k)) * l)) / (k * k))
        end function
        
        t\_m = Math.abs(t);
        t\_s = Math.copySign(1.0, t);
        public static double code(double t_s, double t_m, double l, double k) {
        	return t_s * (((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k));
        }
        
        t\_m = math.fabs(t)
        t\_s = math.copysign(1.0, t)
        def code(t_s, t_m, l, k):
        	return t_s * (((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k))
        
        t\_m = abs(t)
        t\_s = copysign(1.0, t)
        function code(t_s, t_m, l, k)
        	return Float64(t_s * Float64(Float64(Float64(2.0 / t_m) * Float64(Float64(l / Float64(k * k)) * l)) / Float64(k * k)))
        end
        
        t\_m = abs(t);
        t\_s = sign(t) * abs(1.0);
        function tmp = code(t_s, t_m, l, k)
        	tmp = t_s * (((2.0 / t_m) * ((l / (k * k)) * l)) / (k * k));
        end
        
        t\_m = N[Abs[t], $MachinePrecision]
        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(2.0 / t$95$m), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        t\_m = \left|t\right|
        \\
        t\_s = \mathsf{copysign}\left(1, t\right)
        
        \\
        t\_s \cdot \frac{\frac{2}{t\_m} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k}
        \end{array}
        
        Derivation
        1. Initial program 35.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
        4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lower-pow.f6465.7

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
        9. Applied rewrites65.7%

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          2. lift-/.f64N/A

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

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

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lift-pow.f64N/A

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          6. pow2N/A

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

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

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

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{{\ell}^{2}}{k \cdot k}}{k \cdot k} \]
          10. lift-pow.f64N/A

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{{\ell}^{2}}{k \cdot k}}{k \cdot k} \]
          11. pow2N/A

            \[\leadsto \frac{\frac{2}{t} \cdot \frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
          12. associate-*l/N/A

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

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

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

            \[\leadsto \frac{\frac{2}{t} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k} \]
          16. lower-/.f6473.0

            \[\leadsto \frac{\frac{2}{t} \cdot \left(\frac{\ell}{k \cdot k} \cdot \ell\right)}{k \cdot k} \]
        11. Applied rewrites73.0%

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

        Alternative 13: 72.9% accurate, 5.6× speedup?

        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{\left(\ell \cdot \frac{\ell}{t\_m \cdot \left(k \cdot k\right)}\right) \cdot 2}{k \cdot k} \end{array} \]
        t\_m = (fabs.f64 t)
        t\_s = (copysign.f64 #s(literal 1 binary64) t)
        (FPCore (t_s t_m l k)
         :precision binary64
         (* t_s (/ (* (* l (/ l (* t_m (* k k)))) 2.0) (* k k))))
        t\_m = fabs(t);
        t\_s = copysign(1.0, t);
        double code(double t_s, double t_m, double l, double k) {
        	return t_s * (((l * (l / (t_m * (k * k)))) * 2.0) / (k * k));
        }
        
        t\_m =     private
        t\_s =     private
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(t_s, t_m, l, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t_s
            real(8), intent (in) :: t_m
            real(8), intent (in) :: l
            real(8), intent (in) :: k
            code = t_s * (((l * (l / (t_m * (k * k)))) * 2.0d0) / (k * k))
        end function
        
        t\_m = Math.abs(t);
        t\_s = Math.copySign(1.0, t);
        public static double code(double t_s, double t_m, double l, double k) {
        	return t_s * (((l * (l / (t_m * (k * k)))) * 2.0) / (k * k));
        }
        
        t\_m = math.fabs(t)
        t\_s = math.copysign(1.0, t)
        def code(t_s, t_m, l, k):
        	return t_s * (((l * (l / (t_m * (k * k)))) * 2.0) / (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(Float64(l * Float64(l / Float64(t_m * Float64(k * k)))) * 2.0) / Float64(k * k)))
        end
        
        t\_m = abs(t);
        t\_s = sign(t) * abs(1.0);
        function tmp = code(t_s, t_m, l, k)
        	tmp = t_s * (((l * (l / (t_m * (k * k)))) * 2.0) / (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[(N[(l * N[(l / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        t\_m = \left|t\right|
        \\
        t\_s = \mathsf{copysign}\left(1, t\right)
        
        \\
        t\_s \cdot \frac{\left(\ell \cdot \frac{\ell}{t\_m \cdot \left(k \cdot k\right)}\right) \cdot 2}{k \cdot k}
        \end{array}
        
        Derivation
        1. Initial program 35.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
        4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lower-pow.f6465.7

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
        9. Applied rewrites65.7%

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

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

            \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2} \cdot t} \cdot 2}{k \cdot k} \]
          3. lower-*.f6465.7

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

            \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2} \cdot t} \cdot 2}{k \cdot k} \]
          5. lift-pow.f64N/A

            \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2} \cdot t} \cdot 2}{k \cdot k} \]
          6. pow2N/A

            \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2} \cdot t} \cdot 2}{k \cdot k} \]
          7. associate-/l*N/A

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

            \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{{k}^{2} \cdot t}\right) \cdot 2}{k \cdot k} \]
          9. lower-/.f6472.9

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

            \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{{k}^{2} \cdot t}\right) \cdot 2}{k \cdot k} \]
          11. lift-pow.f64N/A

            \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{{k}^{2} \cdot t}\right) \cdot 2}{k \cdot k} \]
          12. pow2N/A

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

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

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

            \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t \cdot \left(k \cdot k\right)}\right) \cdot 2}{k \cdot k} \]
        11. Applied rewrites72.9%

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

        Alternative 14: 65.7% accurate, 5.7× speedup?

        \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{t\_m \cdot \left(k \cdot k\right)}}{k \cdot k} \end{array} \]
        t\_m = (fabs.f64 t)
        t\_s = (copysign.f64 #s(literal 1 binary64) t)
        (FPCore (t_s t_m l k)
         :precision binary64
         (* t_s (/ (/ (* (+ l l) l) (* t_m (* k k))) (* k k))))
        t\_m = fabs(t);
        t\_s = copysign(1.0, t);
        double code(double t_s, double t_m, double l, double k) {
        	return t_s * ((((l + l) * l) / (t_m * (k * k))) / (k * k));
        }
        
        t\_m =     private
        t\_s =     private
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(t_s, t_m, l, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t_s
            real(8), intent (in) :: t_m
            real(8), intent (in) :: l
            real(8), intent (in) :: k
            code = t_s * ((((l + l) * l) / (t_m * (k * k))) / (k * k))
        end function
        
        t\_m = Math.abs(t);
        t\_s = Math.copySign(1.0, t);
        public static double code(double t_s, double t_m, double l, double k) {
        	return t_s * ((((l + l) * l) / (t_m * (k * k))) / (k * k));
        }
        
        t\_m = math.fabs(t)
        t\_s = math.copysign(1.0, t)
        def code(t_s, t_m, l, k):
        	return t_s * ((((l + l) * l) / (t_m * (k * k))) / (k * k))
        
        t\_m = abs(t)
        t\_s = copysign(1.0, t)
        function code(t_s, t_m, l, k)
        	return Float64(t_s * Float64(Float64(Float64(Float64(l + l) * l) / Float64(t_m * Float64(k * k))) / Float64(k * k)))
        end
        
        t\_m = abs(t);
        t\_s = sign(t) * abs(1.0);
        function tmp = code(t_s, t_m, l, k)
        	tmp = t_s * ((((l + l) * l) / (t_m * (k * k))) / (k * k));
        end
        
        t\_m = N[Abs[t], $MachinePrecision]
        t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        t\_m = \left|t\right|
        \\
        t\_s = \mathsf{copysign}\left(1, t\right)
        
        \\
        t\_s \cdot \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{t\_m \cdot \left(k \cdot k\right)}}{k \cdot k}
        \end{array}
        
        Derivation
        1. Initial program 35.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
        4. Applied rewrites73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lower-pow.f6465.7

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
        9. Applied rewrites65.7%

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          2. lift-/.f64N/A

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

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

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          5. lift-pow.f64N/A

            \[\leadsto \frac{\frac{2 \cdot {\ell}^{2}}{{k}^{2} \cdot t}}{k \cdot k} \]
          6. pow2N/A

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

            \[\leadsto \frac{\frac{\left(2 \cdot \ell\right) \cdot \ell}{{k}^{2} \cdot t}}{k \cdot k} \]
          8. count-2N/A

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{{k}^{2} \cdot t}}{k \cdot k} \]
          9. lift-+.f64N/A

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{{k}^{2} \cdot t}}{k \cdot k} \]
          10. lower-*.f6465.7

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

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{{k}^{2} \cdot t}}{k \cdot k} \]
          12. lift-pow.f64N/A

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{{k}^{2} \cdot t}}{k \cdot k} \]
          13. pow2N/A

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

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

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{t \cdot \left(k \cdot k\right)}}{k \cdot k} \]
          16. lower-*.f6465.7

            \[\leadsto \frac{\frac{\left(\ell + \ell\right) \cdot \ell}{t \cdot \left(k \cdot k\right)}}{k \cdot k} \]
        11. Applied rewrites65.7%

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

        Reproduce

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