Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.0% → 98.6%
Time: 7.3s
Alternatives: 6
Speedup: 6.0×

Specification

?
\[\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)} \]
(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]
\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)}

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

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

Initial Program: 36.0% accurate, 1.0× speedup?

\[\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)} \]
(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]
\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)}

Alternative 1: 98.6% accurate, 1.4× speedup?

\[\frac{2}{\frac{k}{\ell} \cdot \left(\left(\tan k \cdot t\right) \cdot \left(\sin k \cdot \frac{k}{\ell}\right)\right)} \]
(FPCore (t l k)
  :precision binary64
  (/ 2.0 (* (/ k l) (* (* (tan k) t) (* (sin k) (/ k l))))))
double code(double t, double l, double k) {
	return 2.0 / ((k / l) * ((tan(k) * t) * (sin(k) * (k / l))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / ((k / l) * ((tan(k) * t) * (sin(k) * (k / l))))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((k / l) * ((Math.tan(k) * t) * (Math.sin(k) * (k / l))));
}
def code(t, l, k):
	return 2.0 / ((k / l) * ((math.tan(k) * t) * (math.sin(k) * (k / l))))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(k / l) * Float64(Float64(tan(k) * t) * Float64(sin(k) * Float64(k / l)))))
end
function tmp = code(t, l, k)
	tmp = 2.0 / ((k / l) * ((tan(k) * t) * (sin(k) * (k / l))));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(k / l), $MachinePrecision] * N[(N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{k}{\ell} \cdot \left(\left(\tan k \cdot t\right) \cdot \left(\sin k \cdot \frac{k}{\ell}\right)\right)}
Derivation
  1. Initial program 36.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.8% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq 1.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{\ell + \ell}{\left|k\right| \cdot \left|k\right|} \cdot \frac{\ell}{\left(\left|k\right| \cdot t\right) \cdot \left|k\right|}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin \left(\left|k\right|\right) \cdot \left(t \cdot \left(\frac{\left|k\right|}{\ell \cdot \ell} \cdot \tan \left(\left|k\right|\right)\right)\right)\right) \cdot \left|k\right|}\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs k) 1.2e-52)
  (*
   (/ (+ l l) (* (fabs k) (fabs k)))
   (/ l (* (* (fabs k) t) (fabs k))))
  (/
   2.0
   (*
    (* (sin (fabs k)) (* t (* (/ (fabs k) (* l l)) (tan (fabs k)))))
    (fabs k)))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(k) <= 1.2e-52) {
		tmp = ((l + l) / (fabs(k) * fabs(k))) * (l / ((fabs(k) * t) * fabs(k)));
	} else {
		tmp = 2.0 / ((sin(fabs(k)) * (t * ((fabs(k) / (l * l)) * tan(fabs(k))))) * fabs(k));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (abs(k) <= 1.2d-52) then
        tmp = ((l + l) / (abs(k) * abs(k))) * (l / ((abs(k) * t) * abs(k)))
    else
        tmp = 2.0d0 / ((sin(abs(k)) * (t * ((abs(k) / (l * l)) * tan(abs(k))))) * abs(k))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(k) <= 1.2e-52) {
		tmp = ((l + l) / (Math.abs(k) * Math.abs(k))) * (l / ((Math.abs(k) * t) * Math.abs(k)));
	} else {
		tmp = 2.0 / ((Math.sin(Math.abs(k)) * (t * ((Math.abs(k) / (l * l)) * Math.tan(Math.abs(k))))) * Math.abs(k));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(k) <= 1.2e-52:
		tmp = ((l + l) / (math.fabs(k) * math.fabs(k))) * (l / ((math.fabs(k) * t) * math.fabs(k)))
	else:
		tmp = 2.0 / ((math.sin(math.fabs(k)) * (t * ((math.fabs(k) / (l * l)) * math.tan(math.fabs(k))))) * math.fabs(k))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(k) <= 1.2e-52)
		tmp = Float64(Float64(Float64(l + l) / Float64(abs(k) * abs(k))) * Float64(l / Float64(Float64(abs(k) * t) * abs(k))));
	else
		tmp = Float64(2.0 / Float64(Float64(sin(abs(k)) * Float64(t * Float64(Float64(abs(k) / Float64(l * l)) * tan(abs(k))))) * abs(k)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(k) <= 1.2e-52)
		tmp = ((l + l) / (abs(k) * abs(k))) * (l / ((abs(k) * t) * abs(k)));
	else
		tmp = 2.0 / ((sin(abs(k)) * (t * ((abs(k) / (l * l)) * tan(abs(k))))) * abs(k));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 1.2e-52], N[(N[(N[(l + l), $MachinePrecision] / N[(N[Abs[k], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(N[Abs[k], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[(t * N[(N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq 1.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{\ell + \ell}{\left|k\right| \cdot \left|k\right|} \cdot \frac{\ell}{\left(\left|k\right| \cdot t\right) \cdot \left|k\right|}\\

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


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.6%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
      10. pow-flipN/A

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
      11. sqr-powN/A

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
    8. Applied rewrites63.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot \color{blue}{k}} \]
      11. lower-*.f6473.2%

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

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

    if 1.2000000000000001e-52 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\left(t \cdot \sin k\right) \cdot \tan k\right) \cdot \frac{k}{\ell \cdot \ell}\right) \cdot k} \]
      12. lower-*.f6479.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\sin k \cdot \left(t \cdot \left(\frac{k}{\ell \cdot \ell} \cdot \tan k\right)\right)\right) \cdot k} \]
      10. lower-*.f6479.6%

        \[\leadsto \frac{2}{\left(\sin k \cdot \left(t \cdot \left(\frac{k}{\ell \cdot \ell} \cdot \tan k\right)\right)\right) \cdot k} \]
    10. Applied rewrites79.6%

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

Alternative 3: 74.6% accurate, 2.0× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 4.8 \cdot 10^{+179}:\\ \;\;\;\;\frac{\left|\ell\right| + \left|\ell\right|}{k \cdot k} \cdot \frac{\left|\ell\right|}{\left(k \cdot t\right) \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5\right)}{\cos k}}{\left|\ell\right| \cdot \left|\ell\right|}}\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs l) 4.8e+179)
  (* (/ (+ (fabs l) (fabs l)) (* k k)) (/ (fabs l) (* (* k t) k)))
  (/
   2.0
   (/
    (/ (* (* (* k k) t) (- 0.5 0.5)) (cos k))
    (* (fabs l) (fabs l))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(l) <= 4.8e+179) {
		tmp = ((fabs(l) + fabs(l)) / (k * k)) * (fabs(l) / ((k * t) * k));
	} else {
		tmp = 2.0 / (((((k * k) * t) * (0.5 - 0.5)) / cos(k)) / (fabs(l) * fabs(l)));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (abs(l) <= 4.8d+179) then
        tmp = ((abs(l) + abs(l)) / (k * k)) * (abs(l) / ((k * t) * k))
    else
        tmp = 2.0d0 / (((((k * k) * t) * (0.5d0 - 0.5d0)) / cos(k)) / (abs(l) * abs(l)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(l) <= 4.8e+179) {
		tmp = ((Math.abs(l) + Math.abs(l)) / (k * k)) * (Math.abs(l) / ((k * t) * k));
	} else {
		tmp = 2.0 / (((((k * k) * t) * (0.5 - 0.5)) / Math.cos(k)) / (Math.abs(l) * Math.abs(l)));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(l) <= 4.8e+179:
		tmp = ((math.fabs(l) + math.fabs(l)) / (k * k)) * (math.fabs(l) / ((k * t) * k))
	else:
		tmp = 2.0 / (((((k * k) * t) * (0.5 - 0.5)) / math.cos(k)) / (math.fabs(l) * math.fabs(l)))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(l) <= 4.8e+179)
		tmp = Float64(Float64(Float64(abs(l) + abs(l)) / Float64(k * k)) * Float64(abs(l) / Float64(Float64(k * t) * k)));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * Float64(0.5 - 0.5)) / cos(k)) / Float64(abs(l) * abs(l))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(l) <= 4.8e+179)
		tmp = ((abs(l) + abs(l)) / (k * k)) * (abs(l) / ((k * t) * k));
	else
		tmp = 2.0 / (((((k * k) * t) * (0.5 - 0.5)) / cos(k)) / (abs(l) * abs(l)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 4.8e+179], N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 4.8 \cdot 10^{+179}:\\
\;\;\;\;\frac{\left|\ell\right| + \left|\ell\right|}{k \cdot k} \cdot \frac{\left|\ell\right|}{\left(k \cdot t\right) \cdot k}\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.8000000000000003e179

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.6%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
      10. pow-flipN/A

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
      11. sqr-powN/A

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
    8. Applied rewrites63.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot \color{blue}{k}} \]
      11. lower-*.f6473.2%

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

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

    if 4.8000000000000003e179 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 73.7% accurate, 3.9× speedup?

    \[\begin{array}{l} t_1 := k \cdot \left|t\right|\\ \mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;\left|t\right| \leq 10^{-76}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \frac{\ell}{t\_1}}{\left(k \cdot k\right) \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{t\_1 \cdot k}\\ \end{array} \end{array} \]
    (FPCore (t l k)
      :precision binary64
      (let* ((t_1 (* k (fabs t))))
      (*
       (copysign 1.0 t)
       (if (<= (fabs t) 1e-76)
         (/ (* (+ l l) (/ l t_1)) (* (* k k) k))
         (* (/ (+ l l) (* k k)) (/ l (* t_1 k)))))))
    double code(double t, double l, double k) {
    	double t_1 = k * fabs(t);
    	double tmp;
    	if (fabs(t) <= 1e-76) {
    		tmp = ((l + l) * (l / t_1)) / ((k * k) * k);
    	} else {
    		tmp = ((l + l) / (k * k)) * (l / (t_1 * k));
    	}
    	return copysign(1.0, t) * tmp;
    }
    
    public static double code(double t, double l, double k) {
    	double t_1 = k * Math.abs(t);
    	double tmp;
    	if (Math.abs(t) <= 1e-76) {
    		tmp = ((l + l) * (l / t_1)) / ((k * k) * k);
    	} else {
    		tmp = ((l + l) / (k * k)) * (l / (t_1 * k));
    	}
    	return Math.copySign(1.0, t) * tmp;
    }
    
    def code(t, l, k):
    	t_1 = k * math.fabs(t)
    	tmp = 0
    	if math.fabs(t) <= 1e-76:
    		tmp = ((l + l) * (l / t_1)) / ((k * k) * k)
    	else:
    		tmp = ((l + l) / (k * k)) * (l / (t_1 * k))
    	return math.copysign(1.0, t) * tmp
    
    function code(t, l, k)
    	t_1 = Float64(k * abs(t))
    	tmp = 0.0
    	if (abs(t) <= 1e-76)
    		tmp = Float64(Float64(Float64(l + l) * Float64(l / t_1)) / Float64(Float64(k * k) * k));
    	else
    		tmp = Float64(Float64(Float64(l + l) / Float64(k * k)) * Float64(l / Float64(t_1 * k)));
    	end
    	return Float64(copysign(1.0, t) * tmp)
    end
    
    function tmp_2 = code(t, l, k)
    	t_1 = k * abs(t);
    	tmp = 0.0;
    	if (abs(t) <= 1e-76)
    		tmp = ((l + l) * (l / t_1)) / ((k * k) * k);
    	else
    		tmp = ((l + l) / (k * k)) * (l / (t_1 * k));
    	end
    	tmp_2 = (sign(t) * abs(1.0)) * tmp;
    end
    
    code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[Abs[t], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[t], $MachinePrecision], 1e-76], N[(N[(N[(l + l), $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l + l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$1 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
    
    \begin{array}{l}
    t_1 := k \cdot \left|t\right|\\
    \mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
    \mathbf{if}\;\left|t\right| \leq 10^{-76}:\\
    \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \frac{\ell}{t\_1}}{\left(k \cdot k\right) \cdot k}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{t\_1 \cdot k}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 9.9999999999999993e-77

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

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

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

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

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

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
        5. lower-pow.f6462.6%

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
      4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
        14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
        10. pow-flipN/A

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
        11. sqr-powN/A

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

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

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

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

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

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

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

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
      8. Applied rewrites63.7%

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\ell + \ell\right) \cdot \frac{\ell}{k \cdot t}}{\color{blue}{\left(k \cdot k\right)} \cdot k} \]
        8. lower-/.f6470.0%

          \[\leadsto \frac{\left(\ell + \ell\right) \cdot \frac{\ell}{k \cdot t}}{\left(k \cdot \color{blue}{k}\right) \cdot k} \]
      10. Applied rewrites70.0%

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

      if 9.9999999999999993e-77 < t

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

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

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

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

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

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
        5. lower-pow.f6462.6%

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
      4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
        14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
        10. pow-flipN/A

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
        11. sqr-powN/A

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

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

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

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

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

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

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

          \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
      8. Applied rewrites63.7%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot \color{blue}{k}} \]
        11. lower-*.f6473.2%

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

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

    Alternative 5: 73.2% accurate, 5.8× speedup?

    \[\frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot k} \]
    (FPCore (t l k)
      :precision binary64
      (* (/ (+ l l) (* k k)) (/ l (* (* k t) k))))
    double code(double t, double l, double k) {
    	return ((l + l) / (k * k)) * (l / ((k * t) * k));
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(t, l, k)
    use fmin_fmax_functions
        real(8), intent (in) :: t
        real(8), intent (in) :: l
        real(8), intent (in) :: k
        code = ((l + l) / (k * k)) * (l / ((k * t) * k))
    end function
    
    public static double code(double t, double l, double k) {
    	return ((l + l) / (k * k)) * (l / ((k * t) * k));
    }
    
    def code(t, l, k):
    	return ((l + l) / (k * k)) * (l / ((k * t) * k))
    
    function code(t, l, k)
    	return Float64(Float64(Float64(l + l) / Float64(k * k)) * Float64(l / Float64(Float64(k * t) * k)))
    end
    
    function tmp = code(t, l, k)
    	tmp = ((l + l) / (k * k)) * (l / ((k * t) * k));
    end
    
    code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot k}
    
    Derivation
    1. Initial program 36.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. Taylor expanded in k around 0

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.6%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
      10. pow-flipN/A

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
      11. sqr-powN/A

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
    8. Applied rewrites63.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell + \ell}{k \cdot k} \cdot \frac{\ell}{\left(k \cdot t\right) \cdot \color{blue}{k}} \]
      11. lower-*.f6473.2%

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

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

    Alternative 6: 70.0% accurate, 6.0× speedup?

    \[\frac{\ell}{\left(\left(\left(k \cdot k\right) \cdot k\right) \cdot t\right) \cdot k} \cdot \left(\ell + \ell\right) \]
    (FPCore (t l k)
      :precision binary64
      (* (/ l (* (* (* (* k k) k) t) k)) (+ l l)))
    double code(double t, double l, double k) {
    	return (l / ((((k * k) * k) * t) * k)) * (l + l);
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(t, l, k)
    use fmin_fmax_functions
        real(8), intent (in) :: t
        real(8), intent (in) :: l
        real(8), intent (in) :: k
        code = (l / ((((k * k) * k) * t) * k)) * (l + l)
    end function
    
    public static double code(double t, double l, double k) {
    	return (l / ((((k * k) * k) * t) * k)) * (l + l);
    }
    
    def code(t, l, k):
    	return (l / ((((k * k) * k) * t) * k)) * (l + l)
    
    function code(t, l, k)
    	return Float64(Float64(l / Float64(Float64(Float64(Float64(k * k) * k) * t) * k)) * Float64(l + l))
    end
    
    function tmp = code(t, l, k)
    	tmp = (l / ((((k * k) * k) * t) * k)) * (l + l);
    end
    
    code[t_, l_, k_] := N[(N[(l / N[(N[(N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
    
    \frac{\ell}{\left(\left(\left(k \cdot k\right) \cdot k\right) \cdot t\right) \cdot k} \cdot \left(\ell + \ell\right)
    
    Derivation
    1. Initial program 36.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. Taylor expanded in k around 0

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6462.6%

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
    4. Applied rewrites62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      14. metadata-eval68.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t} \]
      10. pow-flipN/A

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{1}{{k}^{4}}}{t} \]
      11. sqr-powN/A

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

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

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

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

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

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

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

        \[\leadsto \left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{1}{\left({k}^{\left(\frac{4}{2}\right)} \cdot {k}^{\left(\frac{4}{2}\right)}\right) \cdot \color{blue}{t}} \]
    8. Applied rewrites63.7%

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

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

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

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

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

        \[\leadsto \frac{\ell}{\left(\left(k \cdot k\right) \cdot k\right) \cdot \left(k \cdot t\right)} \cdot \color{blue}{\left(\ell + \ell\right)} \]
      6. lower-/.f6470.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{\left(\left(\left(k \cdot k\right) \cdot k\right) \cdot t\right) \cdot k} \cdot \left(\ell + \ell\right) \]
      14. lower-*.f6470.0%

        \[\leadsto \frac{\ell}{\left(\left(\left(k \cdot k\right) \cdot k\right) \cdot t\right) \cdot k} \cdot \left(\ell + \ell\right) \]
    10. Applied rewrites70.0%

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

    Reproduce

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