
(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}
Herbie found 22 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}
(FPCore (t l k) :precision binary64 (* (* (* (/ (pow t -1.0) (sin k)) (/ 2.0 (sin k))) (/ (* (cos k) l) k)) (/ l k)))
double code(double t, double l, double k) {
return (((pow(t, -1.0) / sin(k)) * (2.0 / sin(k))) * ((cos(k) * l) / k)) * (l / 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 = ((((t ** (-1.0d0)) / sin(k)) * (2.0d0 / sin(k))) * ((cos(k) * l) / k)) * (l / k)
end function
public static double code(double t, double l, double k) {
return (((Math.pow(t, -1.0) / Math.sin(k)) * (2.0 / Math.sin(k))) * ((Math.cos(k) * l) / k)) * (l / k);
}
def code(t, l, k): return (((math.pow(t, -1.0) / math.sin(k)) * (2.0 / math.sin(k))) * ((math.cos(k) * l) / k)) * (l / k)
function code(t, l, k) return Float64(Float64(Float64(Float64((t ^ -1.0) / sin(k)) * Float64(2.0 / sin(k))) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)) end
function tmp = code(t, l, k) tmp = ((((t ^ -1.0) / sin(k)) * (2.0 / sin(k))) * ((cos(k) * l) / k)) * (l / k); end
code[t_, l_, k_] := N[(N[(N[(N[(N[Power[t, -1.0], $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{{t}^{-1}}{\sin k} \cdot \frac{2}{\sin k}\right) \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites96.1%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
metadata-evalN/A
associate-*r/N/A
*-commutativeN/A
unpow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
inv-powN/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f6497.4
Applied rewrites97.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 50000000000000.0)
(* (* (/ 2.0 (* k t)) (/ t_1 (pow (sin k) 2.0))) (/ l k))
(* (* (/ 2.0 (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)) (/ t_1 k)) (/ l k)))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 50000000000000.0) {
tmp = ((2.0 / (k * t)) * (t_1 / pow(sin(k), 2.0))) * (l / k);
} else {
tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l
if (k <= 50000000000000.0d0) then
tmp = ((2.0d0 / (k * t)) * (t_1 / (sin(k) ** 2.0d0))) * (l / k)
else
tmp = ((2.0d0 / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t)) * (t_1 / k)) * (l / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.cos(k) * l;
double tmp;
if (k <= 50000000000000.0) {
tmp = ((2.0 / (k * t)) * (t_1 / Math.pow(Math.sin(k), 2.0))) * (l / k);
} else {
tmp = ((2.0 / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
def code(t, l, k): t_1 = math.cos(k) * l tmp = 0 if k <= 50000000000000.0: tmp = ((2.0 / (k * t)) * (t_1 / math.pow(math.sin(k), 2.0))) * (l / k) else: tmp = ((2.0 / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k) return tmp
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 50000000000000.0) tmp = Float64(Float64(Float64(2.0 / Float64(k * t)) * Float64(t_1 / (sin(k) ^ 2.0))) * Float64(l / k)); else tmp = Float64(Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)) * Float64(t_1 / k)) * Float64(l / k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = cos(k) * l; tmp = 0.0; if (k <= 50000000000000.0) tmp = ((2.0 / (k * t)) * (t_1 / (sin(k) ^ 2.0))) * (l / k); else tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 50000000000000.0], N[(N[(N[(2.0 / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 50000000000000:\\
\;\;\;\;\left(\frac{2}{k \cdot t} \cdot \frac{t\_1}{{\sin k}^{2}}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 5e13Initial program 36.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites95.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites94.1%
if 5e13 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6469.4
Applied rewrites69.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites91.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.2
Applied rewrites99.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 3e+16)
(* (* (/ t_1 (* (* k k) t)) (/ l (pow (sin k) 2.0))) 2.0)
(* (* (/ 2.0 (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)) (/ t_1 k)) (/ l k)))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 3e+16) {
tmp = ((t_1 / ((k * k) * t)) * (l / pow(sin(k), 2.0))) * 2.0;
} else {
tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l
if (k <= 3d+16) then
tmp = ((t_1 / ((k * k) * t)) * (l / (sin(k) ** 2.0d0))) * 2.0d0
else
tmp = ((2.0d0 / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t)) * (t_1 / k)) * (l / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.cos(k) * l;
double tmp;
if (k <= 3e+16) {
tmp = ((t_1 / ((k * k) * t)) * (l / Math.pow(Math.sin(k), 2.0))) * 2.0;
} else {
tmp = ((2.0 / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k);
}
return tmp;
}
def code(t, l, k): t_1 = math.cos(k) * l tmp = 0 if k <= 3e+16: tmp = ((t_1 / ((k * k) * t)) * (l / math.pow(math.sin(k), 2.0))) * 2.0 else: tmp = ((2.0 / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k) return tmp
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 3e+16) tmp = Float64(Float64(Float64(t_1 / Float64(Float64(k * k) * t)) * Float64(l / (sin(k) ^ 2.0))) * 2.0); else tmp = Float64(Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)) * Float64(t_1 / k)) * Float64(l / k)); end return tmp end
function tmp_2 = code(t, l, k) t_1 = cos(k) * l; tmp = 0.0; if (k <= 3e+16) tmp = ((t_1 / ((k * k) * t)) * (l / (sin(k) ^ 2.0))) * 2.0; else tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * (t_1 / k)) * (l / k); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 3e+16], N[(N[(N[(t$95$1 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(2.0 / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\left(\frac{t\_1}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 3e16Initial program 36.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites87.0%
if 3e16 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6469.2
Applied rewrites69.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites91.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.2
Applied rewrites99.2%
(FPCore (t l k) :precision binary64 (* (/ (* (cos k) l) k) (/ (* (/ l k) 2.0) (* (pow (sin k) 2.0) t))))
double code(double t, double l, double k) {
return ((cos(k) * l) / k) * (((l / k) * 2.0) / (pow(sin(k), 2.0) * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((cos(k) * l) / k) * (((l / k) * 2.0d0) / ((sin(k) ** 2.0d0) * t))
end function
public static double code(double t, double l, double k) {
return ((Math.cos(k) * l) / k) * (((l / k) * 2.0) / (Math.pow(Math.sin(k), 2.0) * t));
}
def code(t, l, k): return ((math.cos(k) * l) / k) * (((l / k) * 2.0) / (math.pow(math.sin(k), 2.0) * t))
function code(t, l, k) return Float64(Float64(Float64(cos(k) * l) / k) * Float64(Float64(Float64(l / k) * 2.0) / Float64((sin(k) ^ 2.0) * t))) end
function tmp = code(t, l, k) tmp = ((cos(k) * l) / k) * (((l / k) * 2.0) / ((sin(k) ^ 2.0) * t)); end
code[t_, l_, k_] := N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\cos k \cdot \ell}{k} \cdot \frac{\frac{\ell}{k} \cdot 2}{{\sin k}^{2} \cdot t}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lower-/.f64N/A
Applied rewrites96.3%
(FPCore (t l k) :precision binary64 (* (* (/ 2.0 (* (pow (sin k) 2.0) t)) (/ (* (cos k) l) k)) (/ l k)))
double code(double t, double l, double k) {
return ((2.0 / (pow(sin(k), 2.0) * t)) * ((cos(k) * l) / k)) * (l / 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 = ((2.0d0 / ((sin(k) ** 2.0d0) * t)) * ((cos(k) * l) / k)) * (l / k)
end function
public static double code(double t, double l, double k) {
return ((2.0 / (Math.pow(Math.sin(k), 2.0) * t)) * ((Math.cos(k) * l) / k)) * (l / k);
}
def code(t, l, k): return ((2.0 / (math.pow(math.sin(k), 2.0) * t)) * ((math.cos(k) * l) / k)) * (l / k)
function code(t, l, k) return Float64(Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)) end
function tmp = code(t, l, k) tmp = ((2.0 / ((sin(k) ^ 2.0) * t)) * ((cos(k) * l) / k)) * (l / k); end
code[t_, l_, k_] := N[(N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{2}{{\sin k}^{2} \cdot t} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites96.1%
(FPCore (t l k)
:precision binary64
(if (<= k 0.00165)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(if (<= k 2.8e+176)
(*
(/ 2.0 (* (* k k) t))
(/ (* (cos k) (* l l)) (- 0.5 (* 0.5 (cos (* 2.0 k))))))
(* (/ 2.0 (* (pow (sin k) 2.0) t)) (* (/ l k) (/ l k))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 0.00165) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else if (k <= 2.8e+176) {
tmp = (2.0 / ((k * k) * t)) * ((cos(k) * (l * l)) / (0.5 - (0.5 * cos((2.0 * k)))));
} else {
tmp = (2.0 / (pow(sin(k), 2.0) * t)) * ((l / k) * (l / k));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 0.00165) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); elseif (k <= 2.8e+176) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(cos(k) * Float64(l * l)) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); else tmp = Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(Float64(l / k) * Float64(l / k))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 0.00165], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.8e+176], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00165:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{elif}\;k \leq 2.8 \cdot 10^{+176}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\sin k}^{2} \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\end{array}
\end{array}
if k < 0.00165Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.5
Applied rewrites70.5%
if 0.00165 < k < 2.8000000000000002e176Initial program 23.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6477.3
Applied rewrites77.3%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
if 2.8000000000000002e176 < k Initial program 38.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.0%
Taylor expanded in k around 0
Applied rewrites66.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 0.00165)
(*
(* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) (/ t_1 k))
(/ l k))
(if (<= k 4.6e+154)
(* (/ 2.0 (* k k)) (/ (* t_1 l) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
(* (/ 2.0 (* (pow (sin k) 2.0) t)) (* (/ l k) (/ l k)))))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 0.00165) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * (t_1 / k)) * (l / k);
} else if (k <= 4.6e+154) {
tmp = (2.0 / (k * k)) * ((t_1 * l) / ((0.5 - (0.5 * cos((2.0 * k)))) * t));
} else {
tmp = (2.0 / (pow(sin(k), 2.0) * t)) * ((l / k) * (l / k));
}
return tmp;
}
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 0.00165) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(t_1 / k)) * Float64(l / k)); elseif (k <= 4.6e+154) tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(t_1 * l) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))); else tmp = Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(Float64(l / k) * Float64(l / k))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 0.00165], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.6e+154], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * l), $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 0.00165:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{elif}\;k \leq 4.6 \cdot 10^{+154}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \frac{t\_1 \cdot \ell}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\sin k}^{2} \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\end{array}
\end{array}
if k < 0.00165Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.5
Applied rewrites70.5%
if 0.00165 < k < 4.6e154Initial program 24.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6481.4
Applied rewrites81.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites81.6%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6481.4
Applied rewrites81.4%
if 4.6e154 < k Initial program 36.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6458.9
Applied rewrites58.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.1%
Taylor expanded in k around 0
Applied rewrites64.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (* (cos k) l) k)))
(if (<= k 0.00162)
(* (* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) t_1) (/ l k))
(* (* (/ 2.0 (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)) t_1) (/ l k)))))
double code(double t, double l, double k) {
double t_1 = (cos(k) * l) / k;
double tmp;
if (k <= 0.00162) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * t_1) * (l / k);
} else {
tmp = ((2.0 / ((0.5 - (0.5 * cos((2.0 * k)))) * t)) * t_1) * (l / k);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(Float64(cos(k) * l) / k) tmp = 0.0 if (k <= 0.00162) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * t_1) * Float64(l / k)); else tmp = Float64(Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t)) * t_1) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]}, If[LessEqual[k, 0.00162], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\cos k \cdot \ell}{k}\\
\mathbf{if}\;k \leq 0.00162:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot t\_1\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t} \cdot t\_1\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 0.0016199999999999999Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.5
Applied rewrites70.5%
if 0.0016199999999999999 < k Initial program 30.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6470.1
Applied rewrites70.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites91.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.1
Applied rewrites99.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 0.00165)
(*
(* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) (/ t_1 k))
(/ l k))
(/ (* (* t_1 (/ l k)) 2.0) (* k (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t))))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 0.00165) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * (t_1 / k)) * (l / k);
} else {
tmp = ((t_1 * (l / k)) * 2.0) / (k * ((0.5 - (0.5 * cos((2.0 * k)))) * t));
}
return tmp;
}
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 0.00165) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(t_1 / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(t_1 * Float64(l / k)) * 2.0) / Float64(k * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 0.00165], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(l / k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 0.00165:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t\_1 \cdot \frac{\ell}{k}\right) \cdot 2}{k \cdot \left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right)}\\
\end{array}
\end{array}
if k < 0.00165Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.5
Applied rewrites70.5%
if 0.00165 < k Initial program 30.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6470.1
Applied rewrites70.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites91.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.6%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6487.3
Applied rewrites87.3%
(FPCore (t l k)
:precision binary64
(if (<= k 3.1e+102)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(* (* (/ 2.0 (* (pow (sin k) 2.0) t)) (/ l k)) (/ l k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.1e+102) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else {
tmp = ((2.0 / (pow(sin(k), 2.0) * t)) * (l / k)) * (l / k);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.1e+102) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(l / k)) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.1e+102], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.1 \cdot 10^{+102}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{2}{{\sin k}^{2} \cdot t} \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 3.09999999999999987e102Initial program 35.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6475.4
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites95.4%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6469.0
Applied rewrites69.0%
if 3.09999999999999987e102 < k Initial program 33.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6463.4
Applied rewrites63.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites99.5%
Taylor expanded in k around 0
Applied rewrites62.5%
(FPCore (t l k)
:precision binary64
(if (<= k 3.1e+102)
(*
(*
(/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k))
(/ (* (cos k) l) k))
(/ l k))
(/ (* (* l (/ l k)) 2.0) (* k (* (pow (sin k) 2.0) t)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.1e+102) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * ((cos(k) * l) / k)) * (l / k);
} else {
tmp = ((l * (l / k)) * 2.0) / (k * (pow(sin(k), 2.0) * t));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.1e+102) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(Float64(cos(k) * l) / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(l * Float64(l / k)) * 2.0) / Float64(k * Float64((sin(k) ^ 2.0) * t))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.1e+102], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[(l / k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.1 \cdot 10^{+102}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{\cos k \cdot \ell}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \frac{\ell}{k}\right) \cdot 2}{k \cdot \left({\sin k}^{2} \cdot t\right)}\\
\end{array}
\end{array}
if k < 3.09999999999999987e102Initial program 35.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6475.4
Applied rewrites75.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites95.4%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6469.0
Applied rewrites69.0%
if 3.09999999999999987e102 < k Initial program 33.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6463.4
Applied rewrites63.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites88.2%
Taylor expanded in k around 0
Applied rewrites61.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (cos k) l)))
(if (<= k 1.8e+130)
(*
(* (/ (/ (fma 0.6666666666666666 (* k k) 2.0) t) (* k k)) (/ t_1 k))
(/ l k))
(/ (* (* t_1 (/ l k)) 2.0) (* k (* (* k k) t))))))
double code(double t, double l, double k) {
double t_1 = cos(k) * l;
double tmp;
if (k <= 1.8e+130) {
tmp = (((fma(0.6666666666666666, (k * k), 2.0) / t) / (k * k)) * (t_1 / k)) * (l / k);
} else {
tmp = ((t_1 * (l / k)) * 2.0) / (k * ((k * k) * t));
}
return tmp;
}
function code(t, l, k) t_1 = Float64(cos(k) * l) tmp = 0.0 if (k <= 1.8e+130) tmp = Float64(Float64(Float64(Float64(fma(0.6666666666666666, Float64(k * k), 2.0) / t) / Float64(k * k)) * Float64(t_1 / k)) * Float64(l / k)); else tmp = Float64(Float64(Float64(t_1 * Float64(l / k)) * 2.0) / Float64(k * Float64(Float64(k * k) * t))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k, 1.8e+130], N[(N[(N[(N[(N[(0.6666666666666666 * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] / t), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / k), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(l / k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \cos k \cdot \ell\\
\mathbf{if}\;k \leq 1.8 \cdot 10^{+130}:\\
\;\;\;\;\left(\frac{\frac{\mathsf{fma}\left(0.6666666666666666, k \cdot k, 2\right)}{t}}{k \cdot k} \cdot \frac{t\_1}{k}\right) \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t\_1 \cdot \frac{\ell}{k}\right) \cdot 2}{k \cdot \left(\left(k \cdot k\right) \cdot t\right)}\\
\end{array}
\end{array}
if k < 1.8000000000000001e130Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6475.5
Applied rewrites75.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites95.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6468.6
Applied rewrites68.6%
if 1.8000000000000001e130 < k Initial program 35.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites93.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites88.2%
Taylor expanded in k around 0
pow2N/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (t l k) :precision binary64 (* (/ (/ 2.0 (* k k)) t) (* (/ (* (cos k) l) k) (/ l k))))
double code(double t, double l, double k) {
return ((2.0 / (k * k)) / t) * (((cos(k) * l) / k) * (l / 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 = ((2.0d0 / (k * k)) / t) * (((cos(k) * l) / k) * (l / k))
end function
public static double code(double t, double l, double k) {
return ((2.0 / (k * k)) / t) * (((Math.cos(k) * l) / k) * (l / k));
}
def code(t, l, k): return ((2.0 / (k * k)) / t) * (((math.cos(k) * l) / k) * (l / k))
function code(t, l, k) return Float64(Float64(Float64(2.0 / Float64(k * k)) / t) * Float64(Float64(Float64(cos(k) * l) / k) * Float64(l / k))) end
function tmp = code(t, l, k) tmp = ((2.0 / (k * k)) / t) * (((cos(k) * l) / k) * (l / k)); end
code[t_, l_, k_] := N[(N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{k \cdot k}}{t} \cdot \left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.9%
Taylor expanded in k around 0
associate-/r*N/A
pow2N/A
lower-/.f64N/A
lift-/.f64N/A
lift-*.f6472.5
Applied rewrites72.5%
(FPCore (t l k) :precision binary64 (/ (* (* (* (cos k) l) (/ l k)) 2.0) (* k (* (* k k) t))))
double code(double t, double l, double k) {
return (((cos(k) * l) * (l / k)) * 2.0) / (k * ((k * k) * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (((cos(k) * l) * (l / k)) * 2.0d0) / (k * ((k * k) * t))
end function
public static double code(double t, double l, double k) {
return (((Math.cos(k) * l) * (l / k)) * 2.0) / (k * ((k * k) * t));
}
def code(t, l, k): return (((math.cos(k) * l) * (l / k)) * 2.0) / (k * ((k * k) * t))
function code(t, l, k) return Float64(Float64(Float64(Float64(cos(k) * l) * Float64(l / k)) * 2.0) / Float64(k * Float64(Float64(k * k) * t))) end
function tmp = code(t, l, k) tmp = (((cos(k) * l) * (l / k)) * 2.0) / (k * ((k * k) * t)); end
code[t_, l_, k_] := N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(\cos k \cdot \ell\right) \cdot \frac{\ell}{k}\right) \cdot 2}{k \cdot \left(\left(k \cdot k\right) \cdot t\right)}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites90.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.6%
Taylor expanded in k around 0
pow2N/A
lower-*.f6470.8
Applied rewrites70.8%
(FPCore (t l k) :precision binary64 (if (<= k 3.4e-90) (* (/ 2.0 (* (* k k) t)) (* (/ l k) (/ l k))) (* (/ (* (/ l t) l) (* k k)) (/ 2.0 (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.4e-90) {
tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k));
} else {
tmp = (((l / t) * l) / (k * k)) * (2.0 / (k * k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 3.4d-90) then
tmp = (2.0d0 / ((k * k) * t)) * ((l / k) * (l / k))
else
tmp = (((l / t) * l) / (k * k)) * (2.0d0 / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.4e-90) {
tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k));
} else {
tmp = (((l / t) * l) / (k * k)) * (2.0 / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3.4e-90: tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k)) else: tmp = (((l / t) * l) / (k * k)) * (2.0 / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3.4e-90) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l / k) * Float64(l / k))); else tmp = Float64(Float64(Float64(Float64(l / t) * l) / Float64(k * k)) * Float64(2.0 / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.4e-90) tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k)); else tmp = (((l / t) * l) / (k * k)) * (2.0 / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3.4e-90], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.4 \cdot 10^{-90}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t} \cdot \ell}{k \cdot k} \cdot \frac{2}{k \cdot k}\\
\end{array}
\end{array}
if k < 3.39999999999999994e-90Initial program 38.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.9
Applied rewrites73.9%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
if 3.39999999999999994e-90 < k Initial program 29.2%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6457.0
Applied rewrites57.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.4
Applied rewrites59.4%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*l/N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
Applied rewrites61.4%
(FPCore (t l k) :precision binary64 (if (<= l 1.5e-172) (* (/ 2.0 (* (* k k) (* k k))) (* l (/ l t))) (* (/ 2.0 (* k k)) (/ (* l l) (* (* k k) t)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 1.5e-172) {
tmp = (2.0 / ((k * k) * (k * k))) * (l * (l / t));
} else {
tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 1.5d-172) then
tmp = (2.0d0 / ((k * k) * (k * k))) * (l * (l / t))
else
tmp = (2.0d0 / (k * k)) * ((l * l) / ((k * k) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 1.5e-172) {
tmp = (2.0 / ((k * k) * (k * k))) * (l * (l / t));
} else {
tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 1.5e-172: tmp = (2.0 / ((k * k) * (k * k))) * (l * (l / t)) else: tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 1.5e-172) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) * Float64(l * Float64(l / t))); else tmp = Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l * l) / Float64(Float64(k * k) * t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 1.5e-172) tmp = (2.0 / ((k * k) * (k * k))) * (l * (l / t)); else tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 1.5e-172], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.5 \cdot 10^{-172}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot k} \cdot \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot t}\\
\end{array}
\end{array}
if l < 1.49999999999999992e-172Initial program 32.7%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6458.9
Applied rewrites58.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6463.4
Applied rewrites63.4%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6463.3
Applied rewrites63.3%
if 1.49999999999999992e-172 < l Initial program 39.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6477.7
Applied rewrites77.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites77.9%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6467.0
Applied rewrites67.0%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* (* k k) t)) (* (/ l k) (/ l k))))
double code(double t, double l, double k) {
return (2.0 / ((k * k) * t)) * ((l / k) * (l / 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 = (2.0d0 / ((k * k) * t)) * ((l / k) * (l / k))
end function
public static double code(double t, double l, double k) {
return (2.0 / ((k * k) * t)) * ((l / k) * (l / k));
}
def code(t, l, k): return (2.0 / ((k * k) * t)) * ((l / k) * (l / k))
function code(t, l, k) return Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l / k) * Float64(l / k))) end
function tmp = code(t, l, k) tmp = (2.0 / ((k * k) * t)) * ((l / k) * (l / k)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6471.0
Applied rewrites71.0%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* k k)) (/ (* l l) (* (* k k) t))))
double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (2.0d0 / (k * k)) * ((l * l) / ((k * k) * t))
end function
public static double code(double t, double l, double k) {
return (2.0 / (k * k)) * ((l * l) / ((k * k) * t));
}
def code(t, l, k): return (2.0 / (k * k)) * ((l * l) / ((k * k) * t))
function code(t, l, k) return Float64(Float64(2.0 / Float64(k * k)) * Float64(Float64(l * l) / Float64(Float64(k * k) * t))) end
function tmp = code(t, l, k) tmp = (2.0 / (k * k)) * ((l * l) / ((k * k) * t)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{k \cdot k} \cdot \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot t}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.4
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites73.4%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.6
Applied rewrites64.6%
(FPCore (t l k) :precision binary64 (* (/ -0.3333333333333333 (* k k)) (* (/ l t) l)))
double code(double t, double l, double k) {
return (-0.3333333333333333 / (k * k)) * ((l / t) * 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 = ((-0.3333333333333333d0) / (k * k)) * ((l / t) * l)
end function
public static double code(double t, double l, double k) {
return (-0.3333333333333333 / (k * k)) * ((l / t) * l);
}
def code(t, l, k): return (-0.3333333333333333 / (k * k)) * ((l / t) * l)
function code(t, l, k) return Float64(Float64(-0.3333333333333333 / Float64(k * k)) * Float64(Float64(l / t) * l)) end
function tmp = code(t, l, k) tmp = (-0.3333333333333333 / (k * k)) * ((l / t) * l); end
code[t_, l_, k_] := N[(N[(-0.3333333333333333 / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.3333333333333333}{k \cdot k} \cdot \left(\frac{\ell}{t} \cdot \ell\right)
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.0%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.4
Applied rewrites20.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites46.9%
Taylor expanded in k around inf
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6429.4
Applied rewrites29.4%
(FPCore (t l k) :precision binary64 (/ (* -0.11666666666666667 (* l l)) t))
double code(double t, double l, double k) {
return (-0.11666666666666667 * (l * l)) / t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((-0.11666666666666667d0) * (l * l)) / t
end function
public static double code(double t, double l, double k) {
return (-0.11666666666666667 * (l * l)) / t;
}
def code(t, l, k): return (-0.11666666666666667 * (l * l)) / t
function code(t, l, k) return Float64(Float64(-0.11666666666666667 * Float64(l * l)) / t) end
function tmp = code(t, l, k) tmp = (-0.11666666666666667 * (l * l)) / t; end
code[t_, l_, k_] := N[(N[(-0.11666666666666667 * N[(l * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t}
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.0%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.4
Applied rewrites20.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6420.4
Applied rewrites20.4%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * ((l * l) / t)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
def code(t, l, k): return -0.11666666666666667 * ((l * l) / t)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l * l) / t); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.0%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.4
Applied rewrites20.4%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * (l * (l / t))
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
def code(t, l, k): return -0.11666666666666667 * (l * (l / t))
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(l * Float64(l / t))) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * (l * (l / t)); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.0%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.4
Applied rewrites20.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.2
Applied rewrites18.2%
herbie shell --seed 2025086
(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))))