Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.6% → 93.3%
Time: 23.4s
Alternatives: 16
Speedup: 18.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 16 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.6% 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: 93.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (+
    (/ (ratio-of-squares (* k (sin k)) l) (cos k))
    (* (/ (ratio-of-squares (* t (sin k)) l) (cos k)) 2.0))
   t)))
\begin{array}{l}

\\
\frac{2}{\left(\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}
\end{array}
Derivation
  1. Initial program 53.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 rewrites94.7%

    \[\leadsto \frac{2}{\color{blue}{\left(\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}} \]
  6. Add Preprocessing

Alternative 2: 77.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \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)\\ \mathbf{if}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq \infty\right):\\ \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1
         (*
          (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
          (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
   (if (or (<= t_1 0.0) (not (<= t_1 INFINITY)))
     (/ 2.0 (* (/ (ratio-of-squares (* (sin k) k) l) (cos k)) t))
     (/ (ratio-of-squares (/ l k) t) t))))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \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)\\
\mathbf{if}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{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))) < 0.0 or +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 43.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 rewrites94.7%

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      7. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      8. lift-cos.f64N/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      9. lift-/.f6472.0

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      10. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      11. lift-sin.f64N/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} \cdot t} \]
      12. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t} \]
      14. lift-sin.f6472.0

        \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t} \]
    8. Applied rewrites72.0%

      \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t} \]

    if 0.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))) < +inf.0

    1. Initial program 81.6%

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      5. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
      6. lift-pow.f6476.8

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
    5. Applied rewrites76.8%

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      3. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      6. lower-*.f6476.7

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
    7. Applied rewrites76.7%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      4. pow2N/A

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

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      7. lift-ratio-of-squares.f64N/A

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

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

        \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
      10. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
      11. lower-/.f6482.8

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
    9. Applied rewrites82.8%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.9%

    \[\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 0 \lor \neg \left(\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right) \leq \infty\right):\\ \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot k\right), \ell\right)}{\cos k} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<=
      (/
       2.0
       (*
        (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
        (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
      2e+275)
   (/ (ratio-of-squares (/ l k) t) t)
   (* (* (ratio-of-squares l k) (/ (cos k) (* (* k k) t))) 2.0)))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 #s(literal 2 binary64) (*.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.99999999999999992e275

    1. Initial program 80.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. associate-/r*N/A

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

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

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      5. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
      6. lift-pow.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
    5. Applied rewrites78.6%

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      3. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      6. lower-*.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
    7. Applied rewrites78.6%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      4. pow2N/A

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

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      7. lift-ratio-of-squares.f64N/A

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

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

        \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
      10. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
      11. lower-/.f6482.7

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
    9. Applied rewrites82.7%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]

    if 1.99999999999999992e275 < (/.f64 #s(literal 2 binary64) (*.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 18.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 \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} \]
      3. times-fracN/A

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

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

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      8. lower-/.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      9. lower-cos.f64N/A

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      12. lower-pow.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      13. lift-sin.f6477.1

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
    5. Applied rewrites77.1%

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
      2. lower-*.f6461.4

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
    8. Applied rewrites61.4%

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

Alternative 4: 67.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{\ell}{k \cdot k}\\ \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1 \cdot t\_1}{t} \cdot 2\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (/ l (* k k))))
   (if (<=
        (/
         2.0
         (*
          (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
          (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
        2e+275)
     (/ (ratio-of-squares (/ l k) t) t)
     (* (/ (* t_1 t_1) t) 2.0))))
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{\ell}{k \cdot k}\\
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 #s(literal 2 binary64) (*.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.99999999999999992e275

    1. Initial program 80.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. associate-/r*N/A

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

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

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      5. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
      6. lift-pow.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
    5. Applied rewrites78.6%

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      3. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      6. lower-*.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
    7. Applied rewrites78.6%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      4. pow2N/A

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

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      7. lift-ratio-of-squares.f64N/A

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

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

        \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
      10. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
      11. lower-/.f6482.7

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
    9. Applied rewrites82.7%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]

    if 1.99999999999999992e275 < (/.f64 #s(literal 2 binary64) (*.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 18.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 \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} \]
      3. times-fracN/A

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

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

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      8. lower-/.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      9. lower-cos.f64N/A

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      12. lower-pow.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      13. lift-sin.f6477.1

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
    5. Applied rewrites77.1%

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

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

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

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{4}}}{t} \cdot 2 \]
      4. sqr-powN/A

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2} \cdot {k}^{\left(\frac{4}{2}\right)}}}{t} \cdot 2 \]
      6. metadata-evalN/A

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left({k}^{2}\right)\right)}{t} \cdot 2 \]
      8. pow2N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
      9. lower-*.f6426.5

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
    8. Applied rewrites26.5%

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
      2. pow2N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left({k}^{2}\right)\right)}{t} \cdot 2 \]
      3. lower-ratio-of-squares.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot k}}{t} \cdot 2 \]
      11. lift-*.f6455.8

        \[\leadsto \frac{\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot k}}{t} \cdot 2 \]
    10. Applied rewrites55.8%

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

Alternative 5: 66.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot -0.3333333333333333 + t\right) \cdot \left(k \cdot k\right)} \cdot 2\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<=
      (/
       2.0
       (*
        (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
        (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
      2e+275)
   (/ (ratio-of-squares (/ l k) t) t)
   (*
    (/
     (* (ratio-of-squares l k) 1.0)
     (* (+ (* (* (* k k) t) -0.3333333333333333) t) (* k k)))
    2.0)))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot -0.3333333333333333 + t\right) \cdot \left(k \cdot k\right)} \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 #s(literal 2 binary64) (*.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.99999999999999992e275

    1. Initial program 80.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. associate-/r*N/A

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

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

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

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      5. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
      6. lift-pow.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
    5. Applied rewrites78.6%

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      3. pow2N/A

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

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      6. lower-*.f6478.6

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
    7. Applied rewrites78.6%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      4. pow2N/A

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

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
      7. lift-ratio-of-squares.f64N/A

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

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

        \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
      10. lower-ratio-of-squares.f64N/A

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
      11. lower-/.f6482.7

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
    9. Applied rewrites82.7%

      \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]

    if 1.99999999999999992e275 < (/.f64 #s(literal 2 binary64) (*.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 18.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 \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} \]
      3. times-fracN/A

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

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

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      8. lower-/.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
      9. lower-cos.f64N/A

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

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      12. lower-pow.f64N/A

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      13. lift-sin.f6477.1

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
    5. Applied rewrites77.1%

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

      \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
    7. Step-by-step derivation
      1. Applied rewrites55.6%

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

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        2. lift-/.f64N/A

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

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        4. lift-pow.f64N/A

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        5. lift-sin.f64N/A

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        6. associate-*r/N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        7. lower-/.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        9. lift-sin.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        10. lift-pow.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        11. lift-*.f6455.5

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
      3. Applied rewrites55.5%

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
      4. Taylor expanded in k around 0

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{{k}^{2} \cdot \left(t + \frac{-1}{3} \cdot \left({k}^{2} \cdot t\right)\right)} \cdot 2 \]
      5. Step-by-step derivation
        1. *-commutativeN/A

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left({k}^{2} \cdot t\right) \cdot \frac{-1}{3} + t\right) \cdot {k}^{2}} \cdot 2 \]
        8. pow2N/A

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

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

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{-1}{3} + t\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
        11. lift-*.f6456.7

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot -0.3333333333333333 + t\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
      6. Applied rewrites56.7%

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot 1}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot -0.3333333333333333 + t\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
    8. Recombined 2 regimes into one program.
    9. Add Preprocessing

    Alternative 6: 66.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot -0.3333333333333333 + 1\right) \cdot \left(k \cdot k\right)\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
    (FPCore (t l k)
     :precision binary64
     (if (<=
          (/
           2.0
           (*
            (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
            (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
          2e+275)
       (/ (ratio-of-squares (/ l k) t) t)
       (*
        (*
         (ratio-of-squares l k)
         (/ 1.0 (* (* (+ (* (* k k) -0.3333333333333333) 1.0) (* k k)) t)))
        2.0)))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\
    \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot -0.3333333333333333 + 1\right) \cdot \left(k \cdot k\right)\right) \cdot t}\right) \cdot 2\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 #s(literal 2 binary64) (*.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.99999999999999992e275

      1. Initial program 80.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. associate-/r*N/A

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

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

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

          \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
        5. lower-ratio-of-squares.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
        6. lift-pow.f6478.6

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
      5. Applied rewrites78.6%

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

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
        2. unpow3N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
        3. pow2N/A

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

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

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
        6. lower-*.f6478.6

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
      7. Applied rewrites78.6%

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
      8. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
        4. pow2N/A

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

          \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
        7. lift-ratio-of-squares.f64N/A

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

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

          \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
        10. lower-ratio-of-squares.f64N/A

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
        11. lower-/.f6482.7

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
      9. Applied rewrites82.7%

        \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]

      if 1.99999999999999992e275 < (/.f64 #s(literal 2 binary64) (*.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 18.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 \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} \]
        3. times-fracN/A

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

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

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

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

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
        8. lower-/.f64N/A

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
        9. lower-cos.f64N/A

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

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

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        12. lower-pow.f64N/A

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        13. lift-sin.f6477.1

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      5. Applied rewrites77.1%

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

        \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      7. Step-by-step derivation
        1. Applied rewrites55.6%

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        2. Taylor expanded in k around 0

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

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

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

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

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

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left({k}^{2} \cdot \frac{-1}{3} + 1\right) \cdot {k}^{2}\right) \cdot t}\right) \cdot 2 \]
          7. pow2N/A

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot \frac{-1}{3} + 1\right) \cdot {k}^{2}\right) \cdot t}\right) \cdot 2 \]
          9. pow2N/A

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot \frac{-1}{3} + 1\right) \cdot \left(k \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
          10. lift-*.f6455.8

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot -0.3333333333333333 + 1\right) \cdot \left(k \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
        4. Applied rewrites55.8%

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(\left(\left(k \cdot k\right) \cdot -0.3333333333333333 + 1\right) \cdot \left(k \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
      8. Recombined 2 regimes into one program.
      9. Add Preprocessing

      Alternative 7: 66.3% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
      (FPCore (t l k)
       :precision binary64
       (if (<=
            (/
             2.0
             (*
              (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
              (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
            2e+275)
         (/ (ratio-of-squares (/ l k) t) t)
         (* (* (ratio-of-squares l k) (/ 1.0 (* (* k k) t))) 2.0)))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\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)} \leq 2 \cdot 10^{+275}:\\
      \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 #s(literal 2 binary64) (*.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.99999999999999992e275

        1. Initial program 80.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. associate-/r*N/A

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

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

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

            \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
          5. lower-ratio-of-squares.f64N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
          6. lift-pow.f6478.6

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
        5. Applied rewrites78.6%

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
          2. unpow3N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
          3. pow2N/A

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

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          6. lower-*.f6478.6

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
        7. Applied rewrites78.6%

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
        8. Step-by-step derivation
          1. lift-/.f64N/A

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
          4. pow2N/A

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

            \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
          6. lower-/.f64N/A

            \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
          7. lift-ratio-of-squares.f64N/A

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

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

            \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
          10. lower-ratio-of-squares.f64N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
          11. lower-/.f6482.7

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
        9. Applied rewrites82.7%

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{\color{blue}{t}} \]

        if 1.99999999999999992e275 < (/.f64 #s(literal 2 binary64) (*.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 18.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 \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} \]
          3. times-fracN/A

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

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

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

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
          8. lower-/.f64N/A

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
          9. lower-cos.f64N/A

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

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          12. lower-pow.f64N/A

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          13. lift-sin.f6477.1

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        5. Applied rewrites77.1%

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

          \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        7. Step-by-step derivation
          1. Applied rewrites55.6%

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          2. Taylor expanded in k around 0

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
          4. Applied rewrites54.7%

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{1}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
        8. Recombined 2 regimes into one program.
        9. Add Preprocessing

        Alternative 8: 67.0% accurate, 1.0× 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 0:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{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))
              0.0)
           (/ (ratio-of-squares l k) (* (* t t) t))
           (/ (ratio-of-squares (/ l k) t) t)))
        \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 0:\\
        \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{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))) < 0.0

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

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

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

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

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

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
            6. lift-pow.f6481.1

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
          5. Applied rewrites81.1%

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
            2. unpow3N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
            3. pow2N/A

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

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
            6. lower-*.f6481.1

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          7. Applied rewrites81.1%

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]

          if 0.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 36.6%

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

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

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

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

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

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
            6. lift-pow.f6447.4

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
          5. Applied rewrites47.4%

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
            2. unpow3N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
            3. pow2N/A

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

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
            6. lower-*.f6447.3

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          7. Applied rewrites47.3%

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
          8. Step-by-step derivation
            1. lift-/.f64N/A

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
            3. lift-*.f64N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
            4. pow2N/A

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

              \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
            6. lower-/.f64N/A

              \[\leadsto \frac{\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{2}}}{\color{blue}{t}} \]
            7. lift-ratio-of-squares.f64N/A

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

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

              \[\leadsto \frac{\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{t \cdot t}}{t} \]
            10. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
            11. lower-/.f6460.8

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), t\right)}{t} \]
          9. Applied rewrites60.8%

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

        Alternative 9: 73.4% accurate, 1.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 5600:\\ \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 5600.0)
           (/
            2.0
            (*
             (+
              (ratio-of-squares (* k k) l)
              (* (/ (ratio-of-squares (* t (sin k)) l) (cos k)) 2.0))
             t))
           (* (* (ratio-of-squares l k) (/ (/ (cos k) (pow (sin k) 2.0)) t)) 2.0)))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 5600:\\
        \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if k < 5600

          1. Initial program 56.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 rewrites93.9%

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

            \[\leadsto \frac{2}{\left(\frac{{k}^{4}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          7. Step-by-step derivation
            1. sqr-powN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            2. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            3. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            4. pow2N/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{\ell \cdot \ell} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left({k}^{2}\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            6. pow2N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            7. lower-*.f6462.4

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          8. Applied rewrites62.4%

            \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]

          if 5600 < k

          1. Initial program 44.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 \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} \]
            3. times-fracN/A

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            8. lower-/.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            9. lower-cos.f64N/A

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            12. lower-pow.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            13. lift-sin.f6481.5

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          5. Applied rewrites81.5%

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

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

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
            7. lower-/.f64N/A

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
            10. lift-pow.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
            11. lift-/.f6481.6

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
          7. Applied rewrites81.6%

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 10: 73.4% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 5600:\\ \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 5600.0)
           (/
            2.0
            (*
             (+
              (ratio-of-squares (* k k) l)
              (* (/ (ratio-of-squares (* t (sin k)) l) (cos k)) 2.0))
             t))
           (* (* (ratio-of-squares l k) (/ (cos k) (* (pow (sin k) 2.0) t))) 2.0)))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 5600:\\
        \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if k < 5600

          1. Initial program 56.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 rewrites93.9%

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

            \[\leadsto \frac{2}{\left(\frac{{k}^{4}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          7. Step-by-step derivation
            1. sqr-powN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            2. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            3. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            4. pow2N/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{\ell \cdot \ell} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left({k}^{2}\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            6. pow2N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            7. lower-*.f6462.4

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          8. Applied rewrites62.4%

            \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]

          if 5600 < k

          1. Initial program 44.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 \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} \]
            3. times-fracN/A

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            8. lower-/.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            9. lower-cos.f64N/A

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            12. lower-pow.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            13. lift-sin.f6481.5

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          5. Applied rewrites81.5%

            \[\leadsto \color{blue}{\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 11: 73.3% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 5600:\\ \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 5600.0)
           (/
            2.0
            (*
             (+
              (ratio-of-squares (* k k) l)
              (* (/ (ratio-of-squares (* t (sin k)) l) (cos k)) 2.0))
             t))
           (*
            (*
             (ratio-of-squares l k)
             (/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
            2.0)))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 5600:\\
        \;\;\;\;\frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if k < 5600

          1. Initial program 56.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 rewrites93.9%

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

            \[\leadsto \frac{2}{\left(\frac{{k}^{4}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          7. Step-by-step derivation
            1. sqr-powN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            2. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{\left(\frac{4}{2}\right)}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            3. metadata-evalN/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{{\ell}^{2}} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            4. pow2N/A

              \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {k}^{2}}{\ell \cdot \ell} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left({k}^{2}\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            6. pow2N/A

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
            7. lower-*.f6462.4

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]
          8. Applied rewrites62.4%

            \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\left(k \cdot k\right), \ell\right) + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t} \]

          if 5600 < k

          1. Initial program 44.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 \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} \]
            3. times-fracN/A

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            8. lower-/.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            9. lower-cos.f64N/A

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            12. lower-pow.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            13. lift-sin.f6481.5

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          5. Applied rewrites81.5%

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

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

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

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
            8. lower-*.f6481.4

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
          7. Applied rewrites81.4%

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

        Alternative 12: 77.5% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 10000:\\ \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 10000.0)
           (/ 2.0 (* (/ (* (ratio-of-squares (* (sin k) t) l) 2.0) (cos k)) t))
           (*
            (*
             (ratio-of-squares l k)
             (/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
            2.0)))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 10000:\\
        \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if k < 1e4

          1. Initial program 56.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 rewrites93.9%

            \[\leadsto \frac{2}{\color{blue}{\left(\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}} \]
          6. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t} \]

          if 1e4 < k

          1. Initial program 44.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 \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} \]
            3. times-fracN/A

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            8. lower-/.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
            9. lower-cos.f64N/A

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            12. lower-pow.f64N/A

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
            13. lift-sin.f6481.5

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          5. Applied rewrites81.5%

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

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

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

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

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

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

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

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
            8. lower-*.f6481.4

              \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2 \]
          7. Applied rewrites81.4%

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

        Alternative 13: 70.7% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 3.7 \cdot 10^{-150}:\\ \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t}\\ \mathbf{elif}\;k \leq 2.8 \cdot 10^{-6}:\\ \;\;\;\;\frac{2}{\left(\left(\left({\ell}^{-2} + \left(\mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 0.16666666666666666\right) \cdot 2\right) \cdot \left(k \cdot k\right) + \mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), \sin k\right) \cdot \frac{\cos k}{t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 3.7e-150)
           (/ (ratio-of-squares l k) (* (* t t) t))
           (if (<= k 2.8e-6)
             (/
              2.0
              (*
               (*
                (+
                 (*
                  (+
                   (pow l -2.0)
                   (* (* (ratio-of-squares t l) 0.16666666666666666) 2.0))
                  (* k k))
                 (* (ratio-of-squares t l) 2.0))
                (* k k))
               t))
             (* (* (ratio-of-squares (/ l k) (sin k)) (/ (cos k) t)) 2.0))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 3.7 \cdot 10^{-150}:\\
        \;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t}\\
        
        \mathbf{elif}\;k \leq 2.8 \cdot 10^{-6}:\\
        \;\;\;\;\frac{2}{\left(\left(\left({\ell}^{-2} + \left(\mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 0.16666666666666666\right) \cdot 2\right) \cdot \left(k \cdot k\right) + \mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right) \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), \sin k\right) \cdot \frac{\cos k}{t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if k < 3.70000000000000001e-150

          1. Initial program 55.6%

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

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

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

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

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

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
            5. lower-ratio-of-squares.f64N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
            6. lift-pow.f6462.9

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
          5. Applied rewrites62.9%

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
            2. unpow3N/A

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
            3. pow2N/A

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

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

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
            6. lower-*.f6462.9

              \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          7. Applied rewrites62.9%

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]

          if 3.70000000000000001e-150 < k < 2.79999999999999987e-6

          1. Initial program 66.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 rewrites96.1%

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

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

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

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

            \[\leadsto \frac{2}{\left(\left(\left({\ell}^{-2} + \left(\mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 0.16666666666666666\right) \cdot 2\right) \cdot \left(k \cdot k\right) + \mathsf{ratio\_of\_squares}\left(t, \ell\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right) \cdot t} \]

          if 2.79999999999999987e-6 < k

          1. Initial program 42.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 rewrites27.8%

            \[\leadsto \color{blue}{\frac{2}{\left(\left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 1\right) + 1\right) \cdot \left(\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
          4. Applied rewrites27.7%

            \[\leadsto \frac{2}{\color{blue}{\left(\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)}} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

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

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

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\color{blue}{\left({t}^{\frac{3}{2}}\right)}, \ell\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)} \]
            4. lift-ratio-of-squares.f64N/A

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

              \[\leadsto \frac{2}{\left(\frac{{t}^{\frac{3}{2}} \cdot {t}^{\frac{3}{2}}}{\ell \cdot \ell} \cdot \color{blue}{\sin k}\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)} \]
            6. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \left(\sin k \cdot \left(\left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right) \cdot \tan k\right)\right)}} \]
          7. 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)}} \]
          8. 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. associate-/r*N/A

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

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

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

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

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

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

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

        Alternative 14: 77.5% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 10000:\\ \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), \sin k\right) \cdot \frac{\cos k}{t}\right) \cdot 2\\ \end{array} \end{array} \]
        (FPCore (t l k)
         :precision binary64
         (if (<= k 10000.0)
           (/ 2.0 (* (/ (* (ratio-of-squares (* (sin k) t) l) 2.0) (cos k)) t))
           (* (* (ratio-of-squares (/ l k) (sin k)) (/ (cos k) t)) 2.0)))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;k \leq 10000:\\
        \;\;\;\;\frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\left(\frac{\ell}{k}\right), \sin k\right) \cdot \frac{\cos k}{t}\right) \cdot 2\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if k < 1e4

          1. Initial program 56.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 rewrites93.9%

            \[\leadsto \frac{2}{\color{blue}{\left(\frac{\mathsf{ratio\_of\_squares}\left(\left(k \cdot \sin k\right), \ell\right)}{\cos k} + \frac{\mathsf{ratio\_of\_squares}\left(\left(t \cdot \sin k\right), \ell\right)}{\cos k} \cdot 2\right) \cdot t}} \]
          6. Taylor expanded in t around inf

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{\mathsf{ratio\_of\_squares}\left(\left(\sin k \cdot t\right), \ell\right) \cdot 2}{\cos k} \cdot t} \]

          if 1e4 < k

          1. Initial program 44.4%

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

            \[\leadsto \color{blue}{\frac{2}{\left(\left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 1\right) + 1\right) \cdot \left(\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \left(\sin k \cdot \tan k\right)\right)}} \]
          4. Applied rewrites28.8%

            \[\leadsto \frac{2}{\color{blue}{\left(\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)}} \]
          5. Step-by-step derivation
            1. lift-*.f64N/A

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

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

              \[\leadsto \frac{2}{\left(\mathsf{ratio\_of\_squares}\left(\color{blue}{\left({t}^{\frac{3}{2}}\right)}, \ell\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)} \]
            4. lift-ratio-of-squares.f64N/A

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

              \[\leadsto \frac{2}{\left(\frac{{t}^{\frac{3}{2}} \cdot {t}^{\frac{3}{2}}}{\ell \cdot \ell} \cdot \color{blue}{\sin k}\right) \cdot \left(\tan k \cdot \left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right)\right)} \]
            6. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\mathsf{ratio\_of\_squares}\left(\left({t}^{1.5}\right), \ell\right) \cdot \left(\sin k \cdot \left(\left(\mathsf{ratio\_of\_squares}\left(k, t\right) + 2\right) \cdot \tan k\right)\right)}} \]
          7. 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)}} \]
          8. 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. associate-/r*N/A

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

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

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

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

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

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

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

        Alternative 15: 59.6% accurate, 18.8× speedup?

        \[\begin{array}{l} \\ \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \end{array} \]
        (FPCore (t l k) :precision binary64 (/ (ratio-of-squares l k) (* (* t t) t)))
        \begin{array}{l}
        
        \\
        \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t}
        \end{array}
        
        Derivation
        1. Initial program 53.9%

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

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

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

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

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

            \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
          5. lower-ratio-of-squares.f64N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{\color{blue}{t}}^{3}} \]
          6. lift-pow.f6460.8

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
        5. Applied rewrites60.8%

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{{t}^{\color{blue}{3}}} \]
          2. unpow3N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot \color{blue}{t}} \]
          3. pow2N/A

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

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
          6. lower-*.f6460.8

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, k\right)}{\left(t \cdot t\right) \cdot t} \]
        7. Applied rewrites60.8%

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

        Alternative 16: 26.1% accurate, 18.8× speedup?

        \[\begin{array}{l} \\ \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \end{array} \]
        (FPCore (t l k) :precision binary64 (* (/ (ratio-of-squares l (* k k)) t) 2.0))
        \begin{array}{l}
        
        \\
        \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2
        \end{array}
        
        Derivation
        1. Initial program 53.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 \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} \]
          3. times-fracN/A

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

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

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

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
          8. lower-/.f64N/A

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right) \cdot 2 \]
          9. lower-cos.f64N/A

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

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

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          12. lower-pow.f64N/A

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
          13. lift-sin.f6467.6

            \[\leadsto \left(\mathsf{ratio\_of\_squares}\left(\ell, k\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        5. Applied rewrites67.6%

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

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

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

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

            \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{4}}}{t} \cdot 2 \]
          4. sqr-powN/A

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

            \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2} \cdot {k}^{\left(\frac{4}{2}\right)}}}{t} \cdot 2 \]
          6. metadata-evalN/A

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

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left({k}^{2}\right)\right)}{t} \cdot 2 \]
          8. pow2N/A

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
          9. lower-*.f6424.3

            \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
        8. Applied rewrites24.3%

          \[\leadsto \frac{\mathsf{ratio\_of\_squares}\left(\ell, \left(k \cdot k\right)\right)}{t} \cdot 2 \]
        9. Add Preprocessing

        Reproduce

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