
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 2.4e+60) (* (* (/ (cos k) (* k (* k t))) (ratio-of-squares l_m (sin k))) 2.0) (* (/ (* (ratio-of-squares l_m k) (cos k)) (* (pow (sin k) 2.0) t)) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.4 \cdot 10^{+60}:\\
\;\;\;\;\left(\frac{\cos k}{k \cdot \left(k \cdot t\right)} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \sin k\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2\\
\end{array}
\end{array}
if l < 2.4e60Initial program 35.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.8
Applied rewrites89.8%
if 2.4e60 < l Initial program 42.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.0%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-ratio-of-squares.f64N/A
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f64N/A
Applied rewrites97.4%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6497.3
Applied rewrites97.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= l_m 5.2e+75)
(* (* (/ (cos k) (* k (* k t))) (ratio-of-squares l_m (sin k))) 2.0)
(*
(*
(ratio-of-squares l_m k)
(/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)))\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 5.2 \cdot 10^{+75}:\\
\;\;\;\;\left(\frac{\cos k}{k \cdot \left(k \cdot t\right)} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \sin k\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if l < 5.1999999999999997e75Initial program 35.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.9
Applied rewrites89.9%
if 5.1999999999999997e75 < l Initial program 42.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-ratio-of-squares.f64N/A
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f64N/A
Applied rewrites97.3%
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6497.2
Applied rewrites97.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= l_m 5.2e+75)
(* (* (/ (cos k) (* k (* k t))) (ratio-of-squares l_m (sin k))) 2.0)
(*
(/
(* (ratio-of-squares l_m k) (cos k))
(* (- 0.5 (* 0.5 (cos (+ k k)))) t))
2.0)))\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 5.2 \cdot 10^{+75}:\\
\;\;\;\;\left(\frac{\cos k}{k \cdot \left(k \cdot t\right)} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \sin k\right)\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot \cos k}{\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t} \cdot 2\\
\end{array}
\end{array}
if l < 5.1999999999999997e75Initial program 35.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites86.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.9
Applied rewrites89.9%
if 5.1999999999999997e75 < l Initial program 42.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-ratio-of-squares.f64N/A
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f64N/A
Applied rewrites97.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6497.3
Applied rewrites97.3%
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
cos-2N/A
cos-sumN/A
lower-cos.f64N/A
lower-+.f6496.9
Applied rewrites96.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 2.75e-46) (/ 2.0 (* (/ (* k (* k t)) 1.0) (ratio-of-squares (sin k) l_m))) (* (* (ratio-of-squares (/ l_m k) (sin k)) (/ (cos k) t)) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.75 \cdot 10^{-46}:\\
\;\;\;\;\frac{2}{\frac{k \cdot \left(k \cdot t\right)}{1} \cdot \mathsf{ratio\_of\_squares}\left(\sin k, l\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(\left(\frac{l\_m}{k}\right), \sin k\right) \cdot \frac{\cos k}{t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 2.74999999999999992e-46Initial program 41.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
unpow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lift-sin.f6485.9
Applied rewrites85.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6490.2
Applied rewrites90.2%
Taylor expanded in k around 0
Applied rewrites83.8%
if 2.74999999999999992e-46 < k Initial program 25.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-ratio-of-squares.f64N/A
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f64N/A
Applied rewrites93.8%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6494.0
Applied rewrites94.0%
Applied rewrites95.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= (* l_m l_m) 1e-273) (/ (* 2.0 (ratio-of-squares (/ l_m k) k)) t) (* (* (ratio-of-squares l_m k) (/ 1.0 (* (pow (sin k) 2.0) t))) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{-273}:\\
\;\;\;\;\frac{2 \cdot \mathsf{ratio\_of\_squares}\left(\left(\frac{l\_m}{k}\right), k\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 l l) < 1e-273Initial program 28.5%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6444.3
Applied rewrites44.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-ratio-of-squares.f64N/A
lift-*.f6444.3
Applied rewrites44.3%
lift-*.f64N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f6496.4
Applied rewrites96.4%
if 1e-273 < (*.f64 l l) Initial program 40.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.8%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-ratio-of-squares.f64N/A
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f64N/A
Applied rewrites96.5%
Taylor expanded in k around 0
Applied rewrites72.3%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (* (/ (cos k) (* k (* k t))) (ratio-of-squares l_m (sin k))) 2.0))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\left(\frac{\cos k}{k \cdot \left(k \cdot t\right)} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \sin k\right)\right) \cdot 2
\end{array}
Initial program 36.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6487.0
Applied rewrites87.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= (* l_m l_m) 1e-273) (/ (* 2.0 (ratio-of-squares (/ l_m k) k)) t) (* (* (/ (cos k) (* (* k k) t)) (ratio-of-squares l_m k)) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{-273}:\\
\;\;\;\;\frac{2 \cdot \mathsf{ratio\_of\_squares}\left(\left(\frac{l\_m}{k}\right), k\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\cos k}{\left(k \cdot k\right) \cdot t} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, k\right)\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 l l) < 1e-273Initial program 28.5%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6444.3
Applied rewrites44.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-ratio-of-squares.f64N/A
lift-*.f6444.3
Applied rewrites44.3%
lift-*.f64N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f6496.4
Applied rewrites96.4%
if 1e-273 < (*.f64 l l) Initial program 40.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.8%
Taylor expanded in k around 0
Applied rewrites72.3%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= (* l_m l_m) 2e-313) (/ (* 2.0 (ratio-of-squares (/ l_m k) k)) t) (/ 2.0 (* (* (* k k) t) (ratio-of-squares (sin k) l_m)))))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-313}:\\
\;\;\;\;\frac{2 \cdot \mathsf{ratio\_of\_squares}\left(\left(\frac{l\_m}{k}\right), k\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \mathsf{ratio\_of\_squares}\left(\sin k, l\_m\right)}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.99999999998e-313Initial program 25.1%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6445.7
Applied rewrites45.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-ratio-of-squares.f64N/A
lift-*.f6445.7
Applied rewrites45.7%
lift-*.f64N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f6495.9
Applied rewrites95.9%
if 1.99999999998e-313 < (*.f64 l l) Initial program 41.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
unpow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
lift-sin.f6480.8
Applied rewrites80.8%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6471.0
Applied rewrites71.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (/ l_m (* k k))))
(if (<= k 1800.0)
(* (/ 2.0 t) (* t_1 t_1))
(* (/ (* (ratio-of-squares l_m k) -0.16666666666666666) t) 2.0))))\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \frac{l\_m}{k \cdot k}\\
\mathbf{if}\;k \leq 1800:\\
\;\;\;\;\frac{2}{t} \cdot \left(t\_1 \cdot t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot -0.16666666666666666}{t} \cdot 2\\
\end{array}
\end{array}
if k < 1800Initial program 39.8%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6432.7
Applied rewrites32.7%
lift-*.f64N/A
pow2N/A
lower-ratio-of-squares.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6481.8
Applied rewrites81.8%
if 1800 < k Initial program 28.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.6%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6464.1
Applied rewrites64.1%
Applied rewrites64.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 4e-137) (/ (* 2.0 (ratio-of-squares (/ l_m k) k)) t) (/ (* (ratio-of-squares l_m k) 2.0) (* (* k k) t))))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 4 \cdot 10^{-137}:\\
\;\;\;\;\frac{2 \cdot \mathsf{ratio\_of\_squares}\left(\left(\frac{l\_m}{k}\right), k\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot 2}{\left(k \cdot k\right) \cdot t}\\
\end{array}
\end{array}
if l < 3.99999999999999991e-137Initial program 35.0%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6435.2
Applied rewrites35.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-ratio-of-squares.f64N/A
lift-*.f6435.2
Applied rewrites35.2%
lift-*.f64N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-ratio-of-squares.f64N/A
lower-/.f6475.4
Applied rewrites75.4%
if 3.99999999999999991e-137 < l Initial program 40.1%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6426.1
Applied rewrites26.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
pow2N/A
associate-/r*N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6467.2
Applied rewrites67.2%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 1800.0) (/ (* (ratio-of-squares l_m k) 2.0) (* (* k k) t)) (* (/ (* (ratio-of-squares l_m k) -0.16666666666666666) t) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1800:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot 2}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot -0.16666666666666666}{t} \cdot 2\\
\end{array}
\end{array}
if k < 1800Initial program 39.8%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6432.7
Applied rewrites32.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
pow2N/A
associate-/r*N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-ratio-of-squares.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6481.0
Applied rewrites81.0%
if 1800 < k Initial program 28.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.6%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6464.1
Applied rewrites64.1%
Applied rewrites64.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 1800.0) (/ (* 2.0 (ratio-of-squares l_m (* k k))) t) (* (/ (* (ratio-of-squares l_m k) -0.16666666666666666) t) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1800:\\
\;\;\;\;\frac{2 \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \left(k \cdot k\right)\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot -0.16666666666666666}{t} \cdot 2\\
\end{array}
\end{array}
if k < 1800Initial program 39.8%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6432.7
Applied rewrites32.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-ratio-of-squares.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-ratio-of-squares.f64N/A
lift-*.f6432.7
Applied rewrites32.7%
if 1800 < k Initial program 28.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.6%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6464.1
Applied rewrites64.1%
Applied rewrites64.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 1800.0) (* (/ 2.0 t) (ratio-of-squares l_m (* k k))) (* (/ (* (ratio-of-squares l_m k) -0.16666666666666666) t) 2.0)))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1800:\\
\;\;\;\;\frac{2}{t} \cdot \mathsf{ratio\_of\_squares}\left(l\_m, \left(k \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot -0.16666666666666666}{t} \cdot 2\\
\end{array}
\end{array}
if k < 1800Initial program 39.8%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
lower-ratio-of-squares.f64N/A
unpow2N/A
lower-*.f6432.7
Applied rewrites32.7%
if 1800 < k Initial program 28.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.6%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6464.1
Applied rewrites64.1%
Applied rewrites64.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (/ (* (ratio-of-squares l_m k) -0.16666666666666666) t) 2.0))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right) \cdot -0.16666666666666666}{t} \cdot 2
\end{array}
Initial program 36.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.8%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6431.2
Applied rewrites31.2%
Applied rewrites31.2%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (* (/ (ratio-of-squares l_m k) t) -0.16666666666666666) 2.0))
\begin{array}{l}
l_m = \left|\ell\right|
\\
\left(\frac{\mathsf{ratio\_of\_squares}\left(l\_m, k\right)}{t} \cdot -0.16666666666666666\right) \cdot 2
\end{array}
Initial program 36.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.8%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.8%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
associate-/r*N/A
pow2N/A
pow2N/A
lift-ratio-of-squares.f64N/A
lower-/.f6431.2
Applied rewrites31.2%
herbie shell --seed 2025058
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))