Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.7% → 83.6%
Time: 8.1s
Alternatives: 19
Speedup: 7.8×

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

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

Initial Program: 54.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: 83.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{2}{\frac{\frac{t}{\ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}{\ell}} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (/
   (*
    (/ t l)
    (/ (fma (pow (* (sin k) t) 2.0) 2.0 (pow (* (sin k) k) 2.0)) (cos k)))
   l)))
double code(double t, double l, double k) {
	return 2.0 / (((t / l) * (fma(pow((sin(k) * t), 2.0), 2.0, pow((sin(k) * k), 2.0)) / cos(k))) / l);
}
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(t / l) * Float64(fma((Float64(sin(k) * t) ^ 2.0), 2.0, (Float64(sin(k) * k) ^ 2.0)) / cos(k))) / l))
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] * N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\frac{\frac{t}{\ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}{\ell}}
\end{array}
Derivation
  1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    5. lower-/.f6481.7

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
  8. Applied rewrites81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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) \leq 5 \cdot 10^{+302}:\\ \;\;\;\;\frac{\frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\frac{k}{t}, \frac{k}{t}, 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<=
      (*
       (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
       (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))
      5e+302)
   (/
    (/ 2.0 (* (/ (/ (* (* t t) t) l) l) (* (sin k) (tan k))))
    (fma (/ k t) (/ k t) 2.0))
   (/ 2.0 (* (/ (/ t l) l) (/ (* (pow (* k t) 2.0) 2.0) (cos k))))))
double code(double t, double l, double k) {
	double tmp;
	if (((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0)) <= 5e+302) {
		tmp = (2.0 / (((((t * t) * t) / l) / l) * (sin(k) * tan(k)))) / fma((k / t), (k / t), 2.0);
	} else {
		tmp = 2.0 / (((t / l) / l) * ((pow((k * t), 2.0) * 2.0) / cos(k)));
	}
	return tmp;
}
function code(t, l, k)
	tmp = 0.0
	if (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)) <= 5e+302)
		tmp = Float64(Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t * t) * t) / l) / l) * Float64(sin(k) * tan(k)))) / fma(Float64(k / t), Float64(k / t), 2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / cos(k))));
	end
	return tmp
end
code[t_, l_, k_] := If[LessEqual[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], 5e+302], N[(N[(2.0 / N[(N[(N[(N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(k / t), $MachinePrecision] * N[(k / t), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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) \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{\frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\frac{k}{t}, \frac{k}{t}, 2\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < 5e302

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\color{blue}{\frac{k}{t}}, \frac{k}{t}, 2\right)} \]
      10. lift-/.f6482.1

        \[\leadsto \frac{\frac{2}{\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\frac{k}{t}, \color{blue}{\frac{k}{t}}, 2\right)} \]
    5. Applied rewrites82.1%

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

        \[\leadsto \frac{\frac{2}{\frac{\frac{\color{blue}{{t}^{3}}}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\frac{k}{t}, \frac{k}{t}, 2\right)} \]
      2. unpow3N/A

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

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

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

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

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

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

    if 5e302 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))

    1. Initial program 34.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6471.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites71.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6460.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 5 \cdot 10^{+302}:\\ \;\;\;\;\frac{\frac{2}{\frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell} \cdot \left(\sin k \cdot \tan k\right)}}{\mathsf{fma}\left(\frac{k}{t}, \frac{k}{t}, 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\sin k \cdot t\right)}^{2}\\ \mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{+232}:\\ \;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left(t\_1, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{t\_1 \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (pow (* (sin k) t) 2.0)))
   (if (<= (* l l) 5e+232)
     (/
      2.0
      (* (/ t (* l l)) (/ (fma t_1 2.0 (pow (* (sin k) k) 2.0)) (cos k))))
     (/ 2.0 (* (/ (/ t l) l) (/ (* t_1 2.0) (cos k)))))))
double code(double t, double l, double k) {
	double t_1 = pow((sin(k) * t), 2.0);
	double tmp;
	if ((l * l) <= 5e+232) {
		tmp = 2.0 / ((t / (l * l)) * (fma(t_1, 2.0, pow((sin(k) * k), 2.0)) / cos(k)));
	} else {
		tmp = 2.0 / (((t / l) / l) * ((t_1 * 2.0) / cos(k)));
	}
	return tmp;
}
function code(t, l, k)
	t_1 = Float64(sin(k) * t) ^ 2.0
	tmp = 0.0
	if (Float64(l * l) <= 5e+232)
		tmp = Float64(2.0 / Float64(Float64(t / Float64(l * l)) * Float64(fma(t_1, 2.0, (Float64(sin(k) * k) ^ 2.0)) / cos(k))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(Float64(t_1 * 2.0) / cos(k))));
	end
	return tmp
end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 5e+232], N[(2.0 / N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * 2.0 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t$95$1 * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := {\left(\sin k \cdot t\right)}^{2}\\
\mathbf{if}\;\ell \cdot \ell \leq 5 \cdot 10^{+232}:\\
\;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left(t\_1, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{t\_1 \cdot 2}{\cos k}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 4.99999999999999987e232

    1. Initial program 68.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

    if 4.99999999999999987e232 < (*.f64 l l)

    1. Initial program 41.9%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
    6. Applied rewrites55.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 77.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := {\left(\sin k \cdot t\right)}^{2}\\ \mathbf{if}\;\ell \cdot \ell \leq 10^{+220}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(2, t\_1, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{t\_1 \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (pow (* (sin k) t) 2.0)))
   (if (<= (* l l) 1e+220)
     (/
      2.0
      (* (/ (fma 2.0 t_1 (pow (* (sin k) k) 2.0)) (* (cos k) (* l l))) t))
     (/ 2.0 (* (/ (/ t l) l) (/ (* t_1 2.0) (cos k)))))))
double code(double t, double l, double k) {
	double t_1 = pow((sin(k) * t), 2.0);
	double tmp;
	if ((l * l) <= 1e+220) {
		tmp = 2.0 / ((fma(2.0, t_1, pow((sin(k) * k), 2.0)) / (cos(k) * (l * l))) * t);
	} else {
		tmp = 2.0 / (((t / l) / l) * ((t_1 * 2.0) / cos(k)));
	}
	return tmp;
}
function code(t, l, k)
	t_1 = Float64(sin(k) * t) ^ 2.0
	tmp = 0.0
	if (Float64(l * l) <= 1e+220)
		tmp = Float64(2.0 / Float64(Float64(fma(2.0, t_1, (Float64(sin(k) * k) ^ 2.0)) / Float64(cos(k) * Float64(l * l))) * t));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(Float64(t_1 * 2.0) / cos(k))));
	end
	return tmp
end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(l * l), $MachinePrecision], 1e+220], N[(2.0 / N[(N[(N[(2.0 * t$95$1 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(t$95$1 * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := {\left(\sin k \cdot t\right)}^{2}\\
\mathbf{if}\;\ell \cdot \ell \leq 10^{+220}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(2, t\_1, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{t\_1 \cdot 2}{\cos k}}\\


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

    1. Initial program 69.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

    if 1e220 < (*.f64 l l)

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6466.4

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites66.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      7. lift-pow.f6466.0

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

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

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

Alternative 5: 74.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 9.5 \cdot 10^{+100}:\\ \;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= t 9.5e+100)
   (/
    2.0
    (/
     (* (fma (pow (* (sin k) t) 2.0) 2.0 (pow (* (sin k) k) 2.0)) t)
     (* (* (cos k) l) l)))
   (/ 2.0 (* (/ (/ t l) l) (/ (* (pow (* k t) 2.0) 2.0) (cos k))))))
double code(double t, double l, double k) {
	double tmp;
	if (t <= 9.5e+100) {
		tmp = 2.0 / ((fma(pow((sin(k) * t), 2.0), 2.0, pow((sin(k) * k), 2.0)) * t) / ((cos(k) * l) * l));
	} else {
		tmp = 2.0 / (((t / l) / l) * ((pow((k * t), 2.0) * 2.0) / cos(k)));
	}
	return tmp;
}
function code(t, l, k)
	tmp = 0.0
	if (t <= 9.5e+100)
		tmp = Float64(2.0 / Float64(Float64(fma((Float64(sin(k) * t) ^ 2.0), 2.0, (Float64(sin(k) * k) ^ 2.0)) * t) / Float64(Float64(cos(k) * l) * l)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / cos(k))));
	end
	return tmp
end
code[t_, l_, k_] := If[LessEqual[t, 9.5e+100], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.5 \cdot 10^{+100}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right) \cdot t}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\

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


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

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
    6. Applied rewrites79.4%

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

    if 9.4999999999999995e100 < t

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6485.0

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6481.6

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

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

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

Alternative 6: 83.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \frac{2}{\frac{\frac{t}{\ell} \cdot \mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\ell \cdot \cos k}} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (/
   (* (/ t l) (fma (pow (* (sin k) t) 2.0) 2.0 (pow (* (sin k) k) 2.0)))
   (* l (cos k)))))
double code(double t, double l, double k) {
	return 2.0 / (((t / l) * fma(pow((sin(k) * t), 2.0), 2.0, pow((sin(k) * k), 2.0))) / (l * cos(k)));
}
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(t / l) * fma((Float64(sin(k) * t) ^ 2.0), 2.0, (Float64(sin(k) * k) ^ 2.0))) / Float64(l * cos(k))))
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] * N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\frac{\frac{t}{\ell} \cdot \mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\ell \cdot \cos k}}
\end{array}
Derivation
  1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    5. lower-/.f6481.7

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
  8. Applied rewrites81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 57.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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) \leq \infty:\\ \;\;\;\;\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<=
      (*
       (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
       (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))
      INFINITY)
   (/ (* l l) (* (* k k) (* (* t t) t)))
   (/ 2.0 (* (/ (* (* k k) (* k k)) (* l l)) t))))
double code(double t, double l, double k) {
	double tmp;
	if (((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0)) <= ((double) INFINITY)) {
		tmp = (l * l) / ((k * k) * ((t * t) * t));
	} else {
		tmp = 2.0 / ((((k * k) * (k * k)) / (l * l)) * t);
	}
	return tmp;
}
public static double code(double t, double l, double k) {
	double tmp;
	if (((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0)) <= Double.POSITIVE_INFINITY) {
		tmp = (l * l) / ((k * k) * ((t * t) * t));
	} else {
		tmp = 2.0 / ((((k * k) * (k * k)) / (l * l)) * t);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0)) <= math.inf:
		tmp = (l * l) / ((k * k) * ((t * t) * t))
	else:
		tmp = 2.0 / ((((k * k) * (k * k)) / (l * l)) * t)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (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)) <= Inf)
		tmp = Float64(Float64(l * l) / Float64(Float64(k * k) * Float64(Float64(t * t) * t)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * Float64(k * k)) / Float64(l * l)) * t));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if ((((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)) <= Inf)
		tmp = (l * l) / ((k * k) * ((t * t) * t));
	else
		tmp = 2.0 / ((((k * k) * (k * k)) / (l * l)) * t);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[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], Infinity], N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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) \leq \infty:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < +inf.0

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), {k}^{2}, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, {t}^{2} \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      14. unpow2N/A

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      16. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      17. lift-*.f6428.1

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    8. Applied rewrites28.1%

      \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    9. Taylor expanded in k around 0

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
      2. lift-*.f6428.0

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
    11. Applied rewrites28.0%

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

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

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

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

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

Alternative 8: 71.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 1.15 \cdot 10^{-60}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}}\\ \mathbf{elif}\;t \leq 2.15 \cdot 10^{+80}:\\ \;\;\;\;\frac{2}{\left(\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left({\left(\frac{k}{t}\right)}^{2} + 1\right) + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k \cdot t\right)}^{2} \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 1.15e-60)
     (/ 2.0 (* t_1 (/ (pow (* (sin k) k) 2.0) (cos k))))
     (if (<= t 2.15e+80)
       (/
        2.0
        (*
         (* (/ (/ (pow t 3.0) l) l) (sin k))
         (* (tan k) (+ (+ (pow (/ k t) 2.0) 1.0) 1.0))))
       (/ 2.0 (* t_1 (/ (* (pow (* (sin k) t) 2.0) 2.0) (cos k))))))))
double code(double t, double l, double k) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 1.15e-60) {
		tmp = 2.0 / (t_1 * (pow((sin(k) * k), 2.0) / cos(k)));
	} else if (t <= 2.15e+80) {
		tmp = 2.0 / ((((pow(t, 3.0) / l) / l) * sin(k)) * (tan(k) * ((pow((k / t), 2.0) + 1.0) + 1.0)));
	} else {
		tmp = 2.0 / (t_1 * ((pow((sin(k) * t), 2.0) * 2.0) / cos(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) :: t_1
    real(8) :: tmp
    t_1 = (t / l) / l
    if (t <= 1.15d-60) then
        tmp = 2.0d0 / (t_1 * (((sin(k) * k) ** 2.0d0) / cos(k)))
    else if (t <= 2.15d+80) then
        tmp = 2.0d0 / (((((t ** 3.0d0) / l) / l) * sin(k)) * (tan(k) * ((((k / t) ** 2.0d0) + 1.0d0) + 1.0d0)))
    else
        tmp = 2.0d0 / (t_1 * ((((sin(k) * t) ** 2.0d0) * 2.0d0) / cos(k)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 1.15e-60) {
		tmp = 2.0 / (t_1 * (Math.pow((Math.sin(k) * k), 2.0) / Math.cos(k)));
	} else if (t <= 2.15e+80) {
		tmp = 2.0 / ((((Math.pow(t, 3.0) / l) / l) * Math.sin(k)) * (Math.tan(k) * ((Math.pow((k / t), 2.0) + 1.0) + 1.0)));
	} else {
		tmp = 2.0 / (t_1 * ((Math.pow((Math.sin(k) * t), 2.0) * 2.0) / Math.cos(k)));
	}
	return tmp;
}
def code(t, l, k):
	t_1 = (t / l) / l
	tmp = 0
	if t <= 1.15e-60:
		tmp = 2.0 / (t_1 * (math.pow((math.sin(k) * k), 2.0) / math.cos(k)))
	elif t <= 2.15e+80:
		tmp = 2.0 / ((((math.pow(t, 3.0) / l) / l) * math.sin(k)) * (math.tan(k) * ((math.pow((k / t), 2.0) + 1.0) + 1.0)))
	else:
		tmp = 2.0 / (t_1 * ((math.pow((math.sin(k) * t), 2.0) * 2.0) / math.cos(k)))
	return tmp
function code(t, l, k)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 1.15e-60)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(sin(k) * k) ^ 2.0) / cos(k))));
	elseif (t <= 2.15e+80)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / l) / l) * sin(k)) * Float64(tan(k) * Float64(Float64((Float64(k / t) ^ 2.0) + 1.0) + 1.0))));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64(Float64((Float64(sin(k) * t) ^ 2.0) * 2.0) / cos(k))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = (t / l) / l;
	tmp = 0.0;
	if (t <= 1.15e-60)
		tmp = 2.0 / (t_1 * (((sin(k) * k) ^ 2.0) / cos(k)));
	elseif (t <= 2.15e+80)
		tmp = 2.0 / (((((t ^ 3.0) / l) / l) * sin(k)) * (tan(k) * ((((k / t) ^ 2.0) + 1.0) + 1.0)));
	else
		tmp = 2.0 / (t_1 * ((((sin(k) * t) ^ 2.0) * 2.0) / cos(k)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 1.15e-60], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.15e+80], N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 1.15 \cdot 10^{-60}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}}\\

\mathbf{elif}\;t \leq 2.15 \cdot 10^{+80}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{t}^{3}}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left({\left(\frac{k}{t}\right)}^{2} + 1\right) + 1\right)\right)}\\

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


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

    1. Initial program 57.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\sin k}^{2} \cdot {k}^{2}}{\cos k}} \]
      2. unpow-prod-downN/A

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

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

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

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

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

    if 1.1500000000000001e-60 < t < 2.15000000000000002e80

    1. Initial program 78.0%

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

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

    if 2.15000000000000002e80 < t

    1. Initial program 62.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 70.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 1.8 \cdot 10^{-35}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}}\\

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

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


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

    1. Initial program 57.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6481.0

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\sin k}^{2} \cdot {k}^{2}}{\cos k}} \]
      2. unpow-prod-downN/A

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

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

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

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

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

    if 1.80000000000000009e-35 < t < 7.99999999999999941e75

    1. Initial program 79.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{{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. unpow3N/A

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{\left(t \cdot t\right)} \cdot t}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
      6. lower-*.f6479.4

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

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

    if 7.99999999999999941e75 < t

    1. Initial program 62.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 69.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 4 \cdot 10^{-22}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}}\\

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


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

    1. Initial program 58.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\sin k}^{2} \cdot {k}^{2}}{\cos k}} \]
      2. unpow-prod-downN/A

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

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

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

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

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

    if 4.0000000000000002e-22 < t

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites82.9%

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6475.3

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

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

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

Alternative 11: 66.3% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 58.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{{\sin k}^{2} \cdot {k}^{2}}{\cos k}} \]
      3. unpow-prod-downN/A

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

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

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

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

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

    if 4.0000000000000002e-22 < t

    1. Initial program 65.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites82.9%

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6475.3

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

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

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

Alternative 12: 66.6% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 57.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 \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

    if 2.8e-35 < t

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6483.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites83.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6474.8

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

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

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

Alternative 13: 66.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 57.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

    if 2.8e-35 < t

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6483.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites83.3%

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6474.8

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

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

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

Alternative 14: 58.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 1.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 1.2e+14)
     (/
      2.0
      (*
       t_1
       (*
        (fma
         (+ (fma (* t t) -0.6666666666666666 1.0) (* t t))
         (* k k)
         (* (* t t) 2.0))
        (* k k))))
     (/ 2.0 (* t_1 (/ (* (pow (* k t) 2.0) 2.0) (cos k)))))))
double code(double t, double l, double k) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 1.2e+14) {
		tmp = 2.0 / (t_1 * (fma((fma((t * t), -0.6666666666666666, 1.0) + (t * t)), (k * k), ((t * t) * 2.0)) * (k * k)));
	} else {
		tmp = 2.0 / (t_1 * ((pow((k * t), 2.0) * 2.0) / cos(k)));
	}
	return tmp;
}
function code(t, l, k)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 1.2e+14)
		tmp = Float64(2.0 / Float64(t_1 * Float64(fma(Float64(fma(Float64(t * t), -0.6666666666666666, 1.0) + Float64(t * t)), Float64(k * k), Float64(Float64(t * t) * 2.0)) * Float64(k * k))));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / cos(k))));
	end
	return tmp
end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 1.2e+14], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\

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


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

    1. Initial program 59.9%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
    6. Applied rewrites79.4%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.0

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

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

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

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

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

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

    if 1.2e14 < t

    1. Initial program 61.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6481.0

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k}} \]
      5. lift-*.f6472.9

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

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

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

Alternative 15: 58.9% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 9.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 9.5e+14)
     (/
      2.0
      (*
       t_1
       (*
        (fma
         (+ (fma (* t t) -0.6666666666666666 1.0) (* t t))
         (* k k)
         (* (* t t) 2.0))
        (* k k))))
     (/ 2.0 (* t_1 (* (pow (* k t) 2.0) 2.0))))))
double code(double t, double l, double k) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 9.5e+14) {
		tmp = 2.0 / (t_1 * (fma((fma((t * t), -0.6666666666666666, 1.0) + (t * t)), (k * k), ((t * t) * 2.0)) * (k * k)));
	} else {
		tmp = 2.0 / (t_1 * (pow((k * t), 2.0) * 2.0));
	}
	return tmp;
}
function code(t, l, k)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 9.5e+14)
		tmp = Float64(2.0 / Float64(t_1 * Float64(fma(Float64(fma(Float64(t * t), -0.6666666666666666, 1.0) + Float64(t * t)), Float64(k * k), Float64(Float64(t * t) * 2.0)) * Float64(k * k))));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 9.5e+14], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 9.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\

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


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

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.1

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites82.1%

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites57.5%

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

    if 9.5e14 < t

    1. Initial program 61.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6467.6

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

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

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

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

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

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

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

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

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

Alternative 16: 57.3% accurate, 4.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 9.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \left(\left(\left(k \cdot t\right) \cdot \left(k \cdot t\right)\right) \cdot 2\right)}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= t 9.2e+14)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma (* t t) -0.6666666666666666 1.0) (* t t))
       (* k k)
       (* (* t t) 2.0))
      (* k k))))
   (/ 2.0 (* (/ t (* l l)) (* (* (* k t) (* k t)) 2.0)))))
double code(double t, double l, double k) {
	double tmp;
	if (t <= 9.2e+14) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma((t * t), -0.6666666666666666, 1.0) + (t * t)), (k * k), ((t * t) * 2.0)) * (k * k)));
	} else {
		tmp = 2.0 / ((t / (l * l)) * (((k * t) * (k * t)) * 2.0));
	}
	return tmp;
}
function code(t, l, k)
	tmp = 0.0
	if (t <= 9.2e+14)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(Float64(t * t), -0.6666666666666666, 1.0) + Float64(t * t)), Float64(k * k), Float64(Float64(t * t) * 2.0)) * Float64(k * k))));
	else
		tmp = Float64(2.0 / Float64(Float64(t / Float64(l * l)) * Float64(Float64(Float64(k * t) * Float64(k * t)) * 2.0)));
	end
	return tmp
end
code[t_, l_, k_] := If[LessEqual[t, 9.2e+14], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.2 \cdot 10^{+14}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\

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


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

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.1

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites82.1%

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites57.5%

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

    if 9.2e14 < t

    1. Initial program 61.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6467.6

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

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

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

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

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

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

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

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

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

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

Alternative 17: 55.7% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq 4.5 \cdot 10^{+98}:\\ \;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) \cdot k, k, \left(t \cdot t\right) \cdot 2\right) \cdot k\right) \cdot k}{\ell \cdot \ell} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \left(\left(\left(k \cdot t\right) \cdot \left(k \cdot t\right)\right) \cdot 2\right)}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= t 4.5e+98)
   (/
    2.0
    (*
     (/
      (*
       (*
        (fma (* (fma (* t t) -0.6666666666666666 1.0) k) k (* (* t t) 2.0))
        k)
       k)
      (* l l))
     t))
   (/ 2.0 (* (/ t (* l l)) (* (* (* k t) (* k t)) 2.0)))))
double code(double t, double l, double k) {
	double tmp;
	if (t <= 4.5e+98) {
		tmp = 2.0 / ((((fma((fma((t * t), -0.6666666666666666, 1.0) * k), k, ((t * t) * 2.0)) * k) * k) / (l * l)) * t);
	} else {
		tmp = 2.0 / ((t / (l * l)) * (((k * t) * (k * t)) * 2.0));
	}
	return tmp;
}
function code(t, l, k)
	tmp = 0.0
	if (t <= 4.5e+98)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t * t), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t * t) * 2.0)) * k) * k) / Float64(l * l)) * t));
	else
		tmp = Float64(2.0 / Float64(Float64(t / Float64(l * l)) * Float64(Float64(Float64(k * t) * Float64(k * t)) * 2.0)));
	end
	return tmp
end
code[t_, l_, k_] := If[LessEqual[t, 4.5e+98], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.5 \cdot 10^{+98}:\\
\;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) \cdot k, k, \left(t \cdot t\right) \cdot 2\right) \cdot k\right) \cdot k}{\ell \cdot \ell} \cdot t}\\

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


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

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), {k}^{2}, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, {t}^{2} \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      14. unpow2N/A

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      16. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      17. lift-*.f6455.1

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    8. Applied rewrites55.1%

      \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    9. Taylor expanded in k around 0

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
      2. lift-*.f6454.9

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
    11. Applied rewrites54.9%

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
      2. lift-fma.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\left(\left(\left(\frac{-2}{3} \cdot \left(t \cdot t\right) + 1\right) \cdot \left(k \cdot k\right) + \left(t \cdot t\right) \cdot 2\right) \cdot k\right) \cdot k}{\ell \cdot \ell} \cdot t} \]
    13. Applied rewrites56.9%

      \[\leadsto \frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(t \cdot t, -0.6666666666666666, 1\right) \cdot k, k, \left(t \cdot t\right) \cdot 2\right) \cdot k\right) \cdot k}{\ell \cdot \ell} \cdot t} \]

    if 4.5000000000000002e98 < t

    1. Initial program 60.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6474.0

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

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

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

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

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

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

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

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

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

Alternative 18: 57.8% accurate, 7.8× speedup?

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

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

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


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

    1. Initial program 57.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 t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), {k}^{2}, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      10. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, 2 \cdot {t}^{2}\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      11. lift-*.f64N/A

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, {t}^{2} \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      14. unpow2N/A

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot {k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      16. pow2N/A

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
      17. lift-*.f6454.3

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    8. Applied rewrites54.3%

      \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t} \]
    9. Taylor expanded in k around 0

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

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-2}{3}, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
      2. lift-*.f6454.2

        \[\leadsto \frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell \cdot \ell} \cdot t} \]
    11. Applied rewrites54.2%

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

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

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

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

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

    if 1.2999999999999999e-60 < t

    1. Initial program 66.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}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 19: 51.0% accurate, 12.5× speedup?

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

\\
\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}
\end{array}
Derivation
  1. Initial program 60.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{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
  4. Step-by-step derivation
    1. lower-/.f64N/A

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

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

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

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

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

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
    7. lift-pow.f6458.6

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
  5. Applied rewrites58.6%

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

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

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

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

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

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    6. lower-*.f6458.6

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
  7. Applied rewrites58.6%

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

Reproduce

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