Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.7% → 96.2%
Time: 9.0s
Alternatives: 15
Speedup: 8.6×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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: 36.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
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: 96.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/ 2.0 (* (* (* (pow (sin k) 2.0) (/ t (cos k))) (/ k l)) (/ k l))))
double code(double t, double l, double k) {
	return 2.0 / (((pow(sin(k), 2.0) * (t / cos(k))) * (k / l)) * (k / l));
}
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 / ((((sin(k) ** 2.0d0) * (t / cos(k))) * (k / l)) * (k / l))
end function
public static double code(double t, double l, double k) {
	return 2.0 / (((Math.pow(Math.sin(k), 2.0) * (t / Math.cos(k))) * (k / l)) * (k / l));
}
def code(t, l, k):
	return 2.0 / (((math.pow(math.sin(k), 2.0) * (t / math.cos(k))) * (k / l)) * (k / l))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / ((((sin(k) ^ 2.0) * (t / cos(k))) * (k / l)) * (k / l));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}
\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. Add Preprocessing
  3. Taylor expanded in t around 0

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
    7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    16. lift-cos.f6495.9

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

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

Alternative 2: 94.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.95 \cdot 10^{+93}:\\ \;\;\;\;\frac{2}{\left(k \cdot \frac{{\sin k}^{2} \cdot t}{\cos k \cdot \ell}\right) \cdot \frac{k}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.95e+93)
   (/ 2.0 (* (* k (/ (* (pow (sin k) 2.0) t) (* (cos k) l))) (/ k l)))
   (/
    2.0
    (*
     (* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) (/ t (cos k))) (/ k l))
     (/ k l)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.95e+93) {
		tmp = 2.0 / ((k * ((pow(sin(k), 2.0) * t) / (cos(k) * l))) * (k / l));
	} else {
		tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (k <= 1.95d+93) then
        tmp = 2.0d0 / ((k * (((sin(k) ** 2.0d0) * t) / (cos(k) * l))) * (k / l))
    else
        tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * (t / cos(k))) * (k / l)) * (k / l))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.95e+93) {
		tmp = 2.0 / ((k * ((Math.pow(Math.sin(k), 2.0) * t) / (Math.cos(k) * l))) * (k / l));
	} else {
		tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) * (t / Math.cos(k))) * (k / l)) * (k / l));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.95e+93:
		tmp = 2.0 / ((k * ((math.pow(math.sin(k), 2.0) * t) / (math.cos(k) * l))) * (k / l))
	else:
		tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) * (t / math.cos(k))) * (k / l)) * (k / l))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.95e+93)
		tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64((sin(k) ^ 2.0) * t) / Float64(cos(k) * l))) * Float64(k / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.95e+93)
		tmp = 2.0 / ((k * (((sin(k) ^ 2.0) * t) / (cos(k) * l))) * (k / l));
	else
		tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.95e+93], N[(2.0 / N[(N[(k * N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{+93}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{{\sin k}^{2} \cdot t}{\cos k \cdot \ell}\right) \cdot \frac{k}{\ell}}\\

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


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

    1. Initial program 37.8%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]
    7. Applied rewrites90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      16. lift-cos.f6495.4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(k \cdot \frac{{\sin k}^{2} \cdot t}{\cos k \cdot \ell}\right) \cdot \frac{k}{\ell}} \]
      21. lift-cos.f6492.8

        \[\leadsto \frac{2}{\left(k \cdot \frac{{\sin k}^{2} \cdot t}{\cos k \cdot \ell}\right) \cdot \frac{k}{\ell}} \]
    11. Applied rewrites92.8%

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

    if 1.9500000000000001e93 < k

    1. Initial program 20.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      16. lift-cos.f6499.6

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\sin k \cdot \sin k\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      4. sqr-sin-aN/A

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      8. lower-*.f6499.5

        \[\leadsto \frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    11. Applied rewrites99.5%

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

Alternative 3: 84.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 9.8 \cdot 10^{-5}:\\ \;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 9.8e-5)
   (/ 2.0 (* (* (* (* k k) t) (/ k l)) (/ k l)))
   (/
    2.0
    (*
     (* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) (/ t (cos k))) (/ k l))
     (/ k l)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 9.8e-5) {
		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
	} else {
		tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (k <= 9.8d-5) then
        tmp = 2.0d0 / ((((k * k) * t) * (k / l)) * (k / l))
    else
        tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * (t / cos(k))) * (k / l)) * (k / l))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 9.8e-5) {
		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
	} else {
		tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) * (t / Math.cos(k))) * (k / l)) * (k / l));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 9.8e-5:
		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l))
	else:
		tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) * (t / math.cos(k))) * (k / l)) * (k / l))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 9.8e-5)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(k / l)) * Float64(k / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 9.8e-5)
		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
	else
		tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 9.8e-5], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 39.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      16. lift-cos.f6495.2

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      3. lift-*.f6478.8

        \[\leadsto \frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    12. Applied rewrites78.8%

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

    if 9.8e-5 < k

    1. Initial program 22.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]
    7. Applied rewrites92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      16. lift-cos.f6498.4

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\sin k \cdot \sin k\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      4. sqr-sin-aN/A

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      8. lower-*.f6498.3

        \[\leadsto \frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    11. Applied rewrites98.3%

      \[\leadsto \frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.2%

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

Alternative 4: 77.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(k \cdot k\right) \cdot t\\ \mathbf{if}\;k \leq 0.00029:\\ \;\;\;\;\frac{2}{\left(t\_1 \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_1}{\cos k} \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{\ell \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* (* k k) t)))
   (if (<= k 0.00029)
     (/ 2.0 (* (* t_1 (/ k l)) (/ k l)))
     (/ 2.0 (* (/ t_1 (cos k)) (/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) (* l l)))))))
double code(double t, double l, double k) {
	double t_1 = (k * k) * t;
	double tmp;
	if (k <= 0.00029) {
		tmp = 2.0 / ((t_1 * (k / l)) * (k / l));
	} else {
		tmp = 2.0 / ((t_1 / cos(k)) * ((0.5 - (0.5 * cos((2.0 * k)))) / (l * l)));
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (k * k) * t
    if (k <= 0.00029d0) then
        tmp = 2.0d0 / ((t_1 * (k / l)) * (k / l))
    else
        tmp = 2.0d0 / ((t_1 / cos(k)) * ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) / (l * l)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = (k * k) * t;
	double tmp;
	if (k <= 0.00029) {
		tmp = 2.0 / ((t_1 * (k / l)) * (k / l));
	} else {
		tmp = 2.0 / ((t_1 / Math.cos(k)) * ((0.5 - (0.5 * Math.cos((2.0 * k)))) / (l * l)));
	}
	return tmp;
}
def code(t, l, k):
	t_1 = (k * k) * t
	tmp = 0
	if k <= 0.00029:
		tmp = 2.0 / ((t_1 * (k / l)) * (k / l))
	else:
		tmp = 2.0 / ((t_1 / math.cos(k)) * ((0.5 - (0.5 * math.cos((2.0 * k)))) / (l * l)))
	return tmp
function code(t, l, k)
	t_1 = Float64(Float64(k * k) * t)
	tmp = 0.0
	if (k <= 0.00029)
		tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(k / l)) * Float64(k / l)));
	else
		tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / Float64(l * l))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = (k * k) * t;
	tmp = 0.0;
	if (k <= 0.00029)
		tmp = 2.0 / ((t_1 * (k / l)) * (k / l));
	else
		tmp = 2.0 / ((t_1 / cos(k)) * ((0.5 - (0.5 * cos((2.0 * k)))) / (l * l)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[k, 0.00029], N[(2.0 / N[(N[(t$95$1 * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(k \cdot k\right) \cdot t\\
\mathbf{if}\;k \leq 0.00029:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_1}{\cos k} \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{\ell \cdot \ell}}\\


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

    1. Initial program 39.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      16. lift-cos.f6495.2

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
      3. lift-*.f6478.8

        \[\leadsto \frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    12. Applied rewrites78.8%

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

    if 2.9e-4 < k

    1. Initial program 22.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \frac{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)}{\ell \cdot \ell}} \]
      8. lower-*.f6463.4

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{\ell \cdot \ell}} \]
    7. Applied rewrites63.4%

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

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

Alternative 5: 75.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left({\sin k}^{2} \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/ 2.0 (* (* (* (pow (sin k) 2.0) t) (/ k l)) (/ k l))))
double code(double t, double l, double k) {
	return 2.0 / (((pow(sin(k), 2.0) * t) * (k / l)) * (k / l));
}
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 / ((((sin(k) ** 2.0d0) * t) * (k / l)) * (k / l))
end function
public static double code(double t, double l, double k) {
	return 2.0 / (((Math.pow(Math.sin(k), 2.0) * t) * (k / l)) * (k / l));
}
def code(t, l, k):
	return 2.0 / (((math.pow(math.sin(k), 2.0) * t) * (k / l)) * (k / l))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * t) * Float64(k / l)) * Float64(k / l)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / ((((sin(k) ^ 2.0) * t) * (k / l)) * (k / l));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left({\sin k}^{2} \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}
\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. Add Preprocessing
  3. Taylor expanded in t around 0

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
    7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
    16. lift-cos.f6495.9

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

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

    \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
  11. Step-by-step derivation
    1. Applied rewrites74.1%

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

    Alternative 6: 73.8% accurate, 2.8× speedup?

    \[\begin{array}{l} \\ \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (/ 2.0 (* (/ (* (* k k) t) (cos k)) (* (/ k l) (/ k l)))))
    double code(double t, double l, double k) {
    	return 2.0 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l)));
    }
    
    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 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l)))
    end function
    
    public static double code(double t, double l, double k) {
    	return 2.0 / ((((k * k) * t) / Math.cos(k)) * ((k / l) * (k / l)));
    }
    
    def code(t, l, k):
    	return 2.0 / ((((k * k) * t) / math.cos(k)) * ((k / l) * (k / l)))
    
    function code(t, l, k)
    	return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) / cos(k)) * Float64(Float64(k / l) * Float64(k / l))))
    end
    
    function tmp = code(t, l, k)
    	tmp = 2.0 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l)));
    end
    
    code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\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. Add Preprocessing
    3. Taylor expanded in t around 0

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
      7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 74.1% accurate, 7.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3200:\\ \;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= k 3200.0)
       (/ 2.0 (* (* (* (* k k) t) (/ k l)) (/ k l)))
       (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (k <= 3200.0d0) then
            tmp = 2.0d0 / ((((k * k) * t) * (k / l)) * (k / l))
        else
            tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if k <= 3200.0:
    		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l))
    	else:
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k)
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (k <= 3200.0)
    		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(k / l)) * Float64(k / l)));
    	else
    		tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (k <= 3200.0)
    		tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
    	else
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;k \leq 3200:\\
    \;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 3200

      1. Initial program 39.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]
      7. Applied rewrites90.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
        16. lift-cos.f6495.3

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

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

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

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

          \[\leadsto \frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}} \]
        3. lift-*.f6479.0

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

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

      if 3200 < k

      1. Initial program 21.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites33.5%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites49.2%

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot k} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        7. lift-/.f6451.6

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k} \]
      14. Applied rewrites51.6%

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

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

    Alternative 8: 73.5% accurate, 7.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 10^{-18}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= t 1e-18)
       (/ (* (* (/ l t) 2.0) (/ l (* k k))) (* k k))
       (/ 2.0 (* (* (* k k) t) (* (/ k l) (/ k l))))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (t <= 1e-18) {
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	} else {
    		tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)));
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (t <= 1d-18) then
            tmp = (((l / t) * 2.0d0) * (l / (k * k))) / (k * k)
        else
            tmp = 2.0d0 / (((k * k) * t) * ((k / l) * (k / l)))
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (t <= 1e-18) {
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	} else {
    		tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)));
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if t <= 1e-18:
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k)
    	else:
    		tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)))
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (t <= 1e-18)
    		tmp = Float64(Float64(Float64(Float64(l / t) * 2.0) * Float64(l / Float64(k * k))) / Float64(k * k));
    	else
    		tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(k / l) * Float64(k / l))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (t <= 1e-18)
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	else
    		tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)));
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[t, 1e-18], N[(N[(N[(N[(l / t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq 10^{-18}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 1.0000000000000001e-18

      1. Initial program 37.6%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites52.8%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites51.7%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell}{k \cdot k}, \frac{\ell \cdot 2}{t}, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right)}{\color{blue}{k \cdot k}} \]
      12. Taylor expanded in k around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k} \]
        15. lift-*.f6470.3

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k} \]
      14. Applied rewrites70.3%

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

      if 1.0000000000000001e-18 < t

      1. Initial program 29.1%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{t \cdot {\sin k}^{2}}{\cos k} \cdot \color{blue}{\frac{{k}^{2}}{{\ell}^{2}}}} \]
      7. Applied rewrites95.4%

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

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

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

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

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

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

    Alternative 9: 72.7% accurate, 7.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3200:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= k 3200.0)
       (/ (* (* (/ l t) 2.0) (/ l (* k k))) (* k k))
       (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (k <= 3200.0d0) then
            tmp = (((l / t) * 2.0d0) * (l / (k * k))) / (k * k)
        else
            tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if k <= 3200.0:
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k)
    	else:
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k)
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (k <= 3200.0)
    		tmp = Float64(Float64(Float64(Float64(l / t) * 2.0) * Float64(l / Float64(k * k))) / Float64(k * k));
    	else
    		tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (k <= 3200.0)
    		tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
    	else
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(N[(N[(N[(l / t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;k \leq 3200:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 3200

      1. Initial program 39.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites58.0%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites54.8%

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell}{k \cdot k}, \frac{\ell \cdot 2}{t}, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right)}{\color{blue}{k \cdot k}} \]
      12. Taylor expanded in k around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k} \]
        15. lift-*.f6476.0

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

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

      if 3200 < k

      1. Initial program 21.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites33.5%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites49.2%

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot k} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        7. lift-/.f6451.6

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k} \]
      14. Applied rewrites51.6%

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

    Alternative 10: 66.9% accurate, 8.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3200:\\ \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= k 3200.0)
       (/ 2.0 (* (* (* k k) t) (/ (* k k) (* l l))))
       (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (k <= 3200.0d0) then
            tmp = 2.0d0 / (((k * k) * t) * ((k * k) / (l * l)))
        else
            tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if k <= 3200.0:
    		tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)))
    	else:
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k)
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (k <= 3200.0)
    		tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(k * k) / Float64(l * l))));
    	else
    		tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (k <= 3200.0)
    		tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
    	else
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;k \leq 3200:\\
    \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 3200

      1. Initial program 39.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{{\sin k}^{2}}{\ell \cdot \ell}} \]
        3. lift-*.f6470.8

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

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

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

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\ell \cdot \ell}} \]
        2. lift-*.f6470.4

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

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

      if 3200 < k

      1. Initial program 21.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites33.5%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites49.2%

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot k} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        7. lift-/.f6451.6

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k} \]
      14. Applied rewrites51.6%

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

    Alternative 11: 62.8% accurate, 8.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3200:\\ \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= k 3200.0)
       (* (/ 2.0 (* (* k k) (* k k))) (/ (* l l) t))
       (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (k <= 3200.0d0) then
            tmp = (2.0d0 / ((k * k) * (k * k))) * ((l * l) / t)
        else
            tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (k <= 3200.0) {
    		tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
    	} else {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if k <= 3200.0:
    		tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t)
    	else:
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k)
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (k <= 3200.0)
    		tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) * Float64(Float64(l * l) / t));
    	else
    		tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (k <= 3200.0)
    		tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
    	else
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;k \leq 3200:\\
    \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 3200

      1. Initial program 39.2%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
        7. pow2N/A

          \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
        8. lift-*.f6465.0

          \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
      5. Applied rewrites65.0%

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

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

          \[\leadsto \frac{2}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell \cdot \ell}{t} \]
        3. pow-prod-upN/A

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

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

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

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

          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{t} \]
        8. lift-*.f6465.0

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

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

      if 3200 < k

      1. Initial program 21.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites33.5%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites49.2%

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot k} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        7. lift-/.f6451.6

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k} \]
      14. Applied rewrites51.6%

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

    Alternative 12: 29.8% accurate, 10.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.5 \cdot 10^{+222}:\\ \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= l 6.5e+222)
       (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))
       (* -0.11666666666666667 (* l (/ l t)))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (l <= 6.5e+222) {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	} else {
    		tmp = -0.11666666666666667 * (l * (l / t));
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (l <= 6.5d+222) then
            tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
        else
            tmp = (-0.11666666666666667d0) * (l * (l / t))
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (l <= 6.5e+222) {
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	} else {
    		tmp = -0.11666666666666667 * (l * (l / t));
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if l <= 6.5e+222:
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k)
    	else:
    		tmp = -0.11666666666666667 * (l * (l / t))
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (l <= 6.5e+222)
    		tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k));
    	else
    		tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (l <= 6.5e+222)
    		tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
    	else
    		tmp = -0.11666666666666667 * (l * (l / t));
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[l, 6.5e+222], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\ell \leq 6.5 \cdot 10^{+222}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if l < 6.5000000000000006e222

      1. Initial program 35.8%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites55.8%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites57.2%

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

        \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot k} \]
      13. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

          \[\leadsto \frac{\left(\ell \cdot \frac{\ell}{t}\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        5. *-commutativeN/A

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

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot \frac{-1}{3}}{k \cdot k} \]
        7. lift-/.f6431.4

          \[\leadsto \frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k} \]
      14. Applied rewrites31.4%

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

      if 6.5000000000000006e222 < l

      1. Initial program 30.4%

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

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

          \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
      5. Applied rewrites0.0%

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

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

          \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
        2. pow2N/A

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        3. lift-/.f64N/A

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        4. lift-*.f6412.1

          \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
      8. Applied rewrites12.1%

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

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

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        3. associate-/l*N/A

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

          \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
        5. lower-/.f6412.3

          \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \]
      10. Applied rewrites12.3%

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

    Alternative 13: 29.4% accurate, 10.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+302}:\\ \;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot -0.3333333333333333}{\left(k \cdot k\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<= (* l l) 2e+302)
       (/ (* (* l l) -0.3333333333333333) (* (* k k) t))
       (* -0.11666666666666667 (* l (/ l t)))))
    double code(double t, double l, double k) {
    	double tmp;
    	if ((l * l) <= 2e+302) {
    		tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t);
    	} else {
    		tmp = -0.11666666666666667 * (l * (l / t));
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if ((l * l) <= 2d+302) then
            tmp = ((l * l) * (-0.3333333333333333d0)) / ((k * k) * t)
        else
            tmp = (-0.11666666666666667d0) * (l * (l / t))
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if ((l * l) <= 2e+302) {
    		tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t);
    	} else {
    		tmp = -0.11666666666666667 * (l * (l / t));
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if (l * l) <= 2e+302:
    		tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t)
    	else:
    		tmp = -0.11666666666666667 * (l * (l / t))
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (Float64(l * l) <= 2e+302)
    		tmp = Float64(Float64(Float64(l * l) * -0.3333333333333333) / Float64(Float64(k * k) * t));
    	else
    		tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if ((l * l) <= 2e+302)
    		tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t);
    	else
    		tmp = -0.11666666666666667 * (l * (l / t));
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+302], N[(N[(N[(l * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+302}:\\
    \;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot -0.3333333333333333}{\left(k \cdot k\right) \cdot t}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 l l) < 2.0000000000000002e302

      1. Initial program 34.6%

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k} \cdot \frac{{\color{blue}{\sin k}}^{2}}{{\ell}^{2}}} \]
        7. unpow2N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{\color{blue}{{k}^{4}}} \]
      8. Applied rewrites59.4%

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

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

          \[\leadsto \frac{\frac{-1}{3} \cdot \frac{{\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{{k}^{2} \cdot t}}{{k}^{\color{blue}{2}}} \]
      11. Applied rewrites73.0%

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

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

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

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

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

          \[\leadsto \frac{{\ell}^{2} \cdot \frac{-1}{3}}{{k}^{2} \cdot t} \]
        5. pow2N/A

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

          \[\leadsto \frac{\left(\ell \cdot \ell\right) \cdot \frac{-1}{3}}{{k}^{2} \cdot t} \]
        7. pow2N/A

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

          \[\leadsto \frac{\left(\ell \cdot \ell\right) \cdot \frac{-1}{3}}{\left(k \cdot k\right) \cdot t} \]
        9. lift-*.f6439.0

          \[\leadsto \frac{\left(\ell \cdot \ell\right) \cdot -0.3333333333333333}{\left(k \cdot k\right) \cdot t} \]
      14. Applied rewrites39.0%

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

      if 2.0000000000000002e302 < (*.f64 l l)

      1. Initial program 37.5%

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

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

          \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
      5. Applied rewrites1.4%

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

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

          \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
        2. pow2N/A

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        3. lift-/.f64N/A

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        4. lift-*.f6411.1

          \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
      8. Applied rewrites11.1%

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

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

          \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
        3. associate-/l*N/A

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

          \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
        5. lower-/.f6411.3

          \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \]
      10. Applied rewrites11.3%

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

    Alternative 14: 20.2% accurate, 21.0× speedup?

    \[\begin{array}{l} \\ -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \end{array} \]
    (FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
    double code(double t, double l, double k) {
    	return -0.11666666666666667 * ((l * l) / t);
    }
    
    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 = (-0.11666666666666667d0) * ((l * l) / t)
    end function
    
    public static double code(double t, double l, double k) {
    	return -0.11666666666666667 * ((l * l) / t);
    }
    
    def code(t, l, k):
    	return -0.11666666666666667 * ((l * l) / t)
    
    function code(t, l, k)
    	return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t))
    end
    
    function tmp = code(t, l, k)
    	tmp = -0.11666666666666667 * ((l * l) / t);
    end
    
    code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
    \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. Add Preprocessing
    3. Taylor expanded in k around 0

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

        \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
    5. Applied rewrites29.5%

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

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

        \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
      2. pow2N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      4. lift-*.f6423.2

        \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
    8. Applied rewrites23.2%

      \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
    9. Add Preprocessing

    Alternative 15: 17.9% accurate, 21.0× speedup?

    \[\begin{array}{l} \\ -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \end{array} \]
    (FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
    double code(double t, double l, double k) {
    	return -0.11666666666666667 * (l * (l / t));
    }
    
    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 = (-0.11666666666666667d0) * (l * (l / t))
    end function
    
    public static double code(double t, double l, double k) {
    	return -0.11666666666666667 * (l * (l / t));
    }
    
    def code(t, l, k):
    	return -0.11666666666666667 * (l * (l / t))
    
    function code(t, l, k)
    	return Float64(-0.11666666666666667 * Float64(l * Float64(l / t)))
    end
    
    function tmp = code(t, l, k)
    	tmp = -0.11666666666666667 * (l * (l / t));
    end
    
    code[t_, l_, k_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\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. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
    5. Applied rewrites29.5%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2 \cdot \left(k \cdot k\right), \frac{\ell \cdot \ell}{t} \cdot 0.058333333333333334, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right), k \cdot k, \frac{\ell \cdot \ell}{t} \cdot 2\right)}{{k}^{4}}} \]
    6. Taylor expanded in k around inf

      \[\leadsto \frac{-7}{60} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
      2. pow2N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      3. lift-/.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      4. lift-*.f6423.2

        \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
    8. Applied rewrites23.2%

      \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
      3. associate-/l*N/A

        \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
      4. lower-*.f64N/A

        \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
      5. lower-/.f6422.4

        \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \]
    10. Applied rewrites22.4%

      \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
    11. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2025037 
    (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))))