
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= l_m 1e+44)
(/ 2.0 (* (/ t_1 l_m) (/ (* (* k t) k) (* (cos k) l_m))))
(* (/ (* (pow (/ l_m k) 2.0) (cos k)) (* t_1 t)) 2.0))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (l_m <= 1e+44) {
tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m)));
} else {
tmp = ((pow((l_m / k), 2.0) * cos(k)) / (t_1 * t)) * 2.0;
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (l_m <= 1d+44) then
tmp = 2.0d0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m)))
else
tmp = ((((l_m / k) ** 2.0d0) * cos(k)) / (t_1 * t)) * 2.0d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (l_m <= 1e+44) {
tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (Math.cos(k) * l_m)));
} else {
tmp = ((Math.pow((l_m / k), 2.0) * Math.cos(k)) / (t_1 * t)) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if l_m <= 1e+44: tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (math.cos(k) * l_m))) else: tmp = ((math.pow((l_m / k), 2.0) * math.cos(k)) / (t_1 * t)) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (l_m <= 1e+44) tmp = Float64(2.0 / Float64(Float64(t_1 / l_m) * Float64(Float64(Float64(k * t) * k) / Float64(cos(k) * l_m)))); else tmp = Float64(Float64(Float64((Float64(l_m / k) ^ 2.0) * cos(k)) / Float64(t_1 * t)) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (l_m <= 1e+44) tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m))); else tmp = ((((l_m / k) ^ 2.0) * cos(k)) / (t_1 * t)) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l$95$m, 1e+44], N[(2.0 / N[(N[(t$95$1 / l$95$m), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;l\_m \leq 10^{+44}:\\
\;\;\;\;\frac{2}{\frac{t\_1}{l\_m} \cdot \frac{\left(k \cdot t\right) \cdot k}{\cos k \cdot l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot \cos k}{t\_1 \cdot t} \cdot 2\\
\end{array}
\end{array}
if l < 1.0000000000000001e44Initial program 34.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites91.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6492.6
Applied rewrites92.6%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites93.5%
if 1.0000000000000001e44 < l Initial program 36.6%
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.5
Applied rewrites69.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites71.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
Applied rewrites95.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= (* l_m l_m) 1e+88)
(/ 2.0 (* (/ t_1 l_m) (/ (* (* k t) k) (* (cos k) l_m))))
(* (* (* (/ l_m k) (/ l_m k)) (/ (cos k) (* t_1 t))) 2.0))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if ((l_m * l_m) <= 1e+88) {
tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if ((l_m * l_m) <= 1d+88) then
tmp = 2.0d0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m)))
else
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if ((l_m * l_m) <= 1e+88) {
tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (Math.cos(k) * l_m)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (Math.cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if (l_m * l_m) <= 1e+88: tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (math.cos(k) * l_m))) else: tmp = (((l_m / k) * (l_m / k)) * (math.cos(k) / (t_1 * t))) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (Float64(l_m * l_m) <= 1e+88) tmp = Float64(2.0 / Float64(Float64(t_1 / l_m) * Float64(Float64(Float64(k * t) * k) / Float64(cos(k) * l_m)))); else tmp = Float64(Float64(Float64(Float64(l_m / k) * Float64(l_m / k)) * Float64(cos(k) / Float64(t_1 * t))) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if ((l_m * l_m) <= 1e+88) tmp = 2.0 / ((t_1 / l_m) * (((k * t) * k) / (cos(k) * l_m))); else tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e+88], N[(2.0 / N[(N[(t$95$1 / l$95$m), $MachinePrecision] * N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{+88}:\\
\;\;\;\;\frac{2}{\frac{t\_1}{l\_m} \cdot \frac{\left(k \cdot t\right) \cdot k}{\cos k \cdot l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot \frac{\cos k}{t\_1 \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 l l) < 9.99999999999999959e87Initial program 34.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites91.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6492.6
Applied rewrites92.6%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
Applied rewrites93.5%
if 9.99999999999999959e87 < (*.f64 l l) Initial program 36.6%
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.5
Applied rewrites69.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites71.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6495.0
Applied rewrites95.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= (* l_m l_m) 1e+70)
(/ 2.0 (* (/ t_1 l_m) (/ (* (* k k) t) (* (cos k) l_m))))
(* (* (* (/ l_m k) (/ l_m k)) (/ (cos k) (* t_1 t))) 2.0))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if ((l_m * l_m) <= 1e+70) {
tmp = 2.0 / ((t_1 / l_m) * (((k * k) * t) / (cos(k) * l_m)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if ((l_m * l_m) <= 1d+70) then
tmp = 2.0d0 / ((t_1 / l_m) * (((k * k) * t) / (cos(k) * l_m)))
else
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if ((l_m * l_m) <= 1e+70) {
tmp = 2.0 / ((t_1 / l_m) * (((k * k) * t) / (Math.cos(k) * l_m)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (Math.cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if (l_m * l_m) <= 1e+70: tmp = 2.0 / ((t_1 / l_m) * (((k * k) * t) / (math.cos(k) * l_m))) else: tmp = (((l_m / k) * (l_m / k)) * (math.cos(k) / (t_1 * t))) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (Float64(l_m * l_m) <= 1e+70) tmp = Float64(2.0 / Float64(Float64(t_1 / l_m) * Float64(Float64(Float64(k * k) * t) / Float64(cos(k) * l_m)))); else tmp = Float64(Float64(Float64(Float64(l_m / k) * Float64(l_m / k)) * Float64(cos(k) / Float64(t_1 * t))) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if ((l_m * l_m) <= 1e+70) tmp = 2.0 / ((t_1 / l_m) * (((k * k) * t) / (cos(k) * l_m))); else tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (t_1 * t))) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 1e+70], N[(2.0 / N[(N[(t$95$1 / l$95$m), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;l\_m \cdot l\_m \leq 10^{+70}:\\
\;\;\;\;\frac{2}{\frac{t\_1}{l\_m} \cdot \frac{\left(k \cdot k\right) \cdot t}{\cos k \cdot l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot \frac{\cos k}{t\_1 \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if (*.f64 l l) < 1.00000000000000007e70Initial program 34.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6479.0
Applied rewrites79.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/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-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-/.f64N/A
Applied rewrites92.2%
if 1.00000000000000007e70 < (*.f64 l l) Initial 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.f6470.0
Applied rewrites70.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites72.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6495.0
Applied rewrites95.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= t 3.3e-173)
(/
2.0
(/
(* (/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) l_m) (* k (* k t)))
(* l_m (cos k))))
(* (* (* (/ l_m k) (/ l_m k)) (/ (cos k) (* (pow (sin k) 2.0) t))) 2.0)))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (t <= 3.3e-173) {
tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / (pow(sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 3.3d-173) then
tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k)))
else
tmp = (((l_m / k) * (l_m / k)) * (cos(k) / ((sin(k) ** 2.0d0) * t))) * 2.0d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (t <= 3.3e-173) {
tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * Math.cos(k)));
} else {
tmp = (((l_m / k) * (l_m / k)) * (Math.cos(k) / (Math.pow(Math.sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if t <= 3.3e-173: tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * math.cos(k))) else: tmp = (((l_m / k) * (l_m / k)) * (math.cos(k) / (math.pow(math.sin(k), 2.0) * t))) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (t <= 3.3e-173) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / l_m) * Float64(k * Float64(k * t))) / Float64(l_m * cos(k)))); else tmp = Float64(Float64(Float64(Float64(l_m / k) * Float64(l_m / k)) * Float64(cos(k) / Float64((sin(k) ^ 2.0) * t))) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (t <= 3.3e-173) tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k))); else tmp = (((l_m / k) * (l_m / k)) * (cos(k) / ((sin(k) ^ 2.0) * t))) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[t, 3.3e-173], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l$95$m * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.3 \cdot 10^{-173}:\\
\;\;\;\;\frac{2}{\frac{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{l\_m} \cdot \left(k \cdot \left(k \cdot t\right)\right)}{l\_m \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if t < 3.3000000000000003e-173Initial program 33.0%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.2
Applied rewrites74.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites83.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6488.9
Applied rewrites88.9%
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.0
Applied rewrites81.0%
if 3.3000000000000003e-173 < t Initial program 38.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.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites77.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= t 2.7e-145)
(/
2.0
(/
(* (/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) l_m) (* k (* k t)))
(* l_m (cos k))))
(* (* (* l_m (/ l_m (* k k))) (/ (cos k) (* (pow (sin k) 2.0) t))) 2.0)))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (t <= 2.7e-145) {
tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k)));
} else {
tmp = ((l_m * (l_m / (k * k))) * (cos(k) / (pow(sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 2.7d-145) then
tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k)))
else
tmp = ((l_m * (l_m / (k * k))) * (cos(k) / ((sin(k) ** 2.0d0) * t))) * 2.0d0
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (t <= 2.7e-145) {
tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * Math.cos(k)));
} else {
tmp = ((l_m * (l_m / (k * k))) * (Math.cos(k) / (Math.pow(Math.sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if t <= 2.7e-145: tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * math.cos(k))) else: tmp = ((l_m * (l_m / (k * k))) * (math.cos(k) / (math.pow(math.sin(k), 2.0) * t))) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (t <= 2.7e-145) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / l_m) * Float64(k * Float64(k * t))) / Float64(l_m * cos(k)))); else tmp = Float64(Float64(Float64(l_m * Float64(l_m / Float64(k * k))) * Float64(cos(k) / Float64((sin(k) ^ 2.0) * t))) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (t <= 2.7e-145) tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * (k * (k * t))) / (l_m * cos(k))); else tmp = ((l_m * (l_m / (k * k))) * (cos(k) / ((sin(k) ^ 2.0) * t))) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[t, 2.7e-145], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l$95$m * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l$95$m * N[(l$95$m / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.7 \cdot 10^{-145}:\\
\;\;\;\;\frac{2}{\frac{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{l\_m} \cdot \left(k \cdot \left(k \cdot t\right)\right)}{l\_m \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(l\_m \cdot \frac{l\_m}{k \cdot k}\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if t < 2.7e-145Initial program 33.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.3
Applied rewrites74.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites83.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.1
Applied rewrites89.1%
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.2
Applied rewrites81.2%
if 2.7e-145 < t Initial program 38.6%
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.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites77.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6487.0
Applied rewrites87.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 9e-9)
(/ 2.0 (/ (* (/ (pow (sin k) 2.0) l_m) (* k (* k t))) l_m))
(if (<= k 2e+134)
(*
(*
(/ (* l_m l_m) (* k k))
(/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)
(* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 9e-9) {
tmp = 2.0 / (((pow(sin(k), 2.0) / l_m) * (k * (k * t))) / l_m);
} else if (k <= 2e+134) {
tmp = (((l_m * l_m) / (k * k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0;
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 9d-9) then
tmp = 2.0d0 / ((((sin(k) ** 2.0d0) / l_m) * (k * (k * t))) / l_m)
else if (k <= 2d+134) then
tmp = (((l_m * l_m) / (k * k)) * (cos(k) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t))) * 2.0d0
else
tmp = ((l_m / k) ** 2.0d0) * ((-0.3333333333333333d0) / t)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 9e-9) {
tmp = 2.0 / (((Math.pow(Math.sin(k), 2.0) / l_m) * (k * (k * t))) / l_m);
} else if (k <= 2e+134) {
tmp = (((l_m * l_m) / (k * k)) * (Math.cos(k) / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t))) * 2.0;
} else {
tmp = Math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 9e-9: tmp = 2.0 / (((math.pow(math.sin(k), 2.0) / l_m) * (k * (k * t))) / l_m) elif k <= 2e+134: tmp = (((l_m * l_m) / (k * k)) * (math.cos(k) / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t))) * 2.0 else: tmp = math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 9e-9) tmp = Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) / l_m) * Float64(k * Float64(k * t))) / l_m)); elseif (k <= 2e+134) tmp = Float64(Float64(Float64(Float64(l_m * l_m) / Float64(k * k)) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))) * 2.0); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 9e-9) tmp = 2.0 / ((((sin(k) ^ 2.0) / l_m) * (k * (k * t))) / l_m); elseif (k <= 2e+134) tmp = (((l_m * l_m) / (k * k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0; else tmp = ((l_m / k) ^ 2.0) * (-0.3333333333333333 / t); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 9e-9], N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2e+134], N[(N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\sin k}^{2}}{l\_m} \cdot \left(k \cdot \left(k \cdot t\right)\right)}{l\_m}}\\
\mathbf{elif}\;k \leq 2 \cdot 10^{+134}:\\
\;\;\;\;\left(\frac{l\_m \cdot l\_m}{k \cdot k} \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 8.99999999999999953e-9Initial program 36.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.6
Applied rewrites89.6%
Taylor expanded in k around 0
Applied rewrites80.0%
if 8.99999999999999953e-9 < k < 1.99999999999999984e134Initial program 21.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.f6481.2
Applied rewrites81.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites81.4%
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-*.f6480.5
Applied rewrites80.5%
if 1.99999999999999984e134 < k Initial program 37.9%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6432.2
Applied rewrites32.2%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.3
Applied rewrites60.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.3
Applied rewrites60.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites65.6%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* k (* k t))))
(if (<= k 9e-9)
(/ 2.0 (/ (* (/ (pow (sin k) 2.0) l_m) t_1) l_m))
(/
2.0
(/ (* (/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) l_m) t_1) (* l_m (cos k)))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 9e-9) {
tmp = 2.0 / (((pow(sin(k), 2.0) / l_m) * t_1) / l_m);
} else {
tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * t_1) / (l_m * cos(k)));
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = k * (k * t)
if (k <= 9d-9) then
tmp = 2.0d0 / ((((sin(k) ** 2.0d0) / l_m) * t_1) / l_m)
else
tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) / l_m) * t_1) / (l_m * cos(k)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = k * (k * t);
double tmp;
if (k <= 9e-9) {
tmp = 2.0 / (((Math.pow(Math.sin(k), 2.0) / l_m) * t_1) / l_m);
} else {
tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) / l_m) * t_1) / (l_m * Math.cos(k)));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = k * (k * t) tmp = 0 if k <= 9e-9: tmp = 2.0 / (((math.pow(math.sin(k), 2.0) / l_m) * t_1) / l_m) else: tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) / l_m) * t_1) / (l_m * math.cos(k))) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(k * Float64(k * t)) tmp = 0.0 if (k <= 9e-9) tmp = Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) / l_m) * t_1) / l_m)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / l_m) * t_1) / Float64(l_m * cos(k)))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = k * (k * t); tmp = 0.0; if (k <= 9e-9) tmp = 2.0 / ((((sin(k) ^ 2.0) / l_m) * t_1) / l_m); else tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) / l_m) * t_1) / (l_m * cos(k))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 9e-9], N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * t$95$1), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(l$95$m * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := k \cdot \left(k \cdot t\right)\\
\mathbf{if}\;k \leq 9 \cdot 10^{-9}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\sin k}^{2}}{l\_m} \cdot t\_1}{l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{l\_m} \cdot t\_1}{l\_m \cdot \cos k}}\\
\end{array}
\end{array}
if k < 8.99999999999999953e-9Initial program 36.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.6
Applied rewrites89.6%
Taylor expanded in k around 0
Applied rewrites80.0%
if 8.99999999999999953e-9 < k Initial program 30.6%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.1
Applied rewrites71.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites77.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6484.2
Applied rewrites84.2%
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-*.f6483.6
Applied rewrites83.6%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 2120000000.0) (/ 2.0 (/ (* (/ (* k k) l_m) (* (* k k) t)) (* l_m (cos k)))) (* (/ 2.0 (* k (* k t))) (/ (* l_m l_m) (pow (sin k) 2.0)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2120000000.0) {
tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k)));
} else {
tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / pow(sin(k), 2.0));
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2120000000.0d0) then
tmp = 2.0d0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k)))
else
tmp = (2.0d0 / (k * (k * t))) * ((l_m * l_m) / (sin(k) ** 2.0d0))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 2120000000.0) {
tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * Math.cos(k)));
} else {
tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / Math.pow(Math.sin(k), 2.0));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2120000000.0: tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * math.cos(k))) else: tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / math.pow(math.sin(k), 2.0)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2120000000.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l_m) * Float64(Float64(k * k) * t)) / Float64(l_m * cos(k)))); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l_m * l_m) / (sin(k) ^ 2.0))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2120000000.0) tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k))); else tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / (sin(k) ^ 2.0)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2120000000.0], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l$95$m * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2120000000:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot k}{l\_m} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{l\_m \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{l\_m \cdot l\_m}{{\sin k}^{2}}\\
\end{array}
\end{array}
if k < 2.12e9Initial program 36.5%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.7
Applied rewrites76.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.3%
Taylor expanded in k around 0
pow2N/A
lift-*.f6479.4
Applied rewrites79.4%
if 2.12e9 < k Initial program 31.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.f6470.4
Applied rewrites70.4%
Taylor expanded in k around 0
pow2N/A
lift-*.f6454.1
Applied rewrites54.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6455.7
Applied rewrites55.7%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ 2.0 (/ (* (/ (pow (sin k) 2.0) l_m) (* k (* k t))) l_m)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return 2.0 / (((pow(sin(k), 2.0) / l_m) * (k * (k * t))) / l_m);
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = 2.0d0 / ((((sin(k) ** 2.0d0) / l_m) * (k * (k * t))) / l_m)
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return 2.0 / (((Math.pow(Math.sin(k), 2.0) / l_m) * (k * (k * t))) / l_m);
}
l_m = math.fabs(l) def code(t, l_m, k): return 2.0 / (((math.pow(math.sin(k), 2.0) / l_m) * (k * (k * t))) / l_m)
l_m = abs(l) function code(t, l_m, k) return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) / l_m) * Float64(k * Float64(k * t))) / l_m)) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = 2.0 / ((((sin(k) ^ 2.0) / l_m) * (k * (k * t))) / l_m); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2}{\frac{\frac{{\sin k}^{2}}{l\_m} \cdot \left(k \cdot \left(k \cdot t\right)\right)}{l\_m}}
\end{array}
Initial program 35.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6475.1
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites84.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6488.2
Applied rewrites88.2%
Taylor expanded in k around 0
Applied rewrites74.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2120000000.0)
(* l_m (* l_m (/ (fma (* k k) -0.3333333333333333 2.0) (* (pow k 4.0) t))))
(if (<= k 4.5e+132)
(* (/ 2.0 (* (* k k) t)) (/ (* l_m l_m) (- 0.5 (* 0.5 (cos (* 2.0 k))))))
(* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2120000000.0) {
tmp = l_m * (l_m * (fma((k * k), -0.3333333333333333, 2.0) / (pow(k, 4.0) * t)));
} else if (k <= 4.5e+132) {
tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (0.5 - (0.5 * cos((2.0 * k)))));
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2120000000.0) tmp = Float64(l_m * Float64(l_m * Float64(fma(Float64(k * k), -0.3333333333333333, 2.0) / Float64((k ^ 4.0) * t)))); elseif (k <= 4.5e+132) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m * l_m) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2120000000.0], N[(l$95$m * N[(l$95$m * N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 2.0), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.5e+132], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2120000000:\\
\;\;\;\;l\_m \cdot \left(l\_m \cdot \frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{{k}^{4} \cdot t}\right)\\
\mathbf{elif}\;k \leq 4.5 \cdot 10^{+132}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m \cdot l\_m}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 2.12e9Initial program 36.5%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6455.2
Applied rewrites55.2%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
Applied rewrites56.5%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6463.3
Applied rewrites63.3%
if 2.12e9 < k < 4.49999999999999972e132Initial program 22.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.f6480.4
Applied rewrites80.4%
Taylor expanded in k around 0
pow2N/A
lift-*.f6445.5
Applied rewrites45.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-*.f6445.5
Applied rewrites45.5%
if 4.49999999999999972e132 < k Initial program 37.6%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6432.3
Applied rewrites32.3%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites65.5%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2.1e-162)
(* l_m (* l_m (/ (fma (* k k) -0.3333333333333333 2.0) (* (pow k 4.0) t))))
(if (<= k 4.5e+132)
(* (* (/ (* l_m l_m) (* k k)) (/ (cos k) (* (* k t) k))) 2.0)
(* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2.1e-162) {
tmp = l_m * (l_m * (fma((k * k), -0.3333333333333333, 2.0) / (pow(k, 4.0) * t)));
} else if (k <= 4.5e+132) {
tmp = (((l_m * l_m) / (k * k)) * (cos(k) / ((k * t) * k))) * 2.0;
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2.1e-162) tmp = Float64(l_m * Float64(l_m * Float64(fma(Float64(k * k), -0.3333333333333333, 2.0) / Float64((k ^ 4.0) * t)))); elseif (k <= 4.5e+132) tmp = Float64(Float64(Float64(Float64(l_m * l_m) / Float64(k * k)) * Float64(cos(k) / Float64(Float64(k * t) * k))) * 2.0); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2.1e-162], N[(l$95$m * N[(l$95$m * N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 2.0), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.5e+132], N[(N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.1 \cdot 10^{-162}:\\
\;\;\;\;l\_m \cdot \left(l\_m \cdot \frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{{k}^{4} \cdot t}\right)\\
\mathbf{elif}\;k \leq 4.5 \cdot 10^{+132}:\\
\;\;\;\;\left(\frac{l\_m \cdot l\_m}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot t\right) \cdot k}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 2.1e-162Initial program 37.8%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6454.1
Applied rewrites54.1%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
Applied rewrites53.5%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6460.9
Applied rewrites60.9%
if 2.1e-162 < k < 4.49999999999999972e132Initial program 26.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.f6480.5
Applied rewrites80.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
*-commutativeN/A
Applied rewrites80.6%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6465.4
Applied rewrites65.4%
if 4.49999999999999972e132 < k Initial program 37.6%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6432.3
Applied rewrites32.3%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites65.5%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 6.8e+95) (/ 2.0 (/ (* (/ (* k k) l_m) (* (* k k) t)) (* l_m (cos k)))) (* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 6.8e+95) {
tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k)));
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 6.8d+95) then
tmp = 2.0d0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k)))
else
tmp = ((l_m / k) ** 2.0d0) * ((-0.3333333333333333d0) / t)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 6.8e+95) {
tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * Math.cos(k)));
} else {
tmp = Math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 6.8e+95: tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * math.cos(k))) else: tmp = math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 6.8e+95) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l_m) * Float64(Float64(k * k) * t)) / Float64(l_m * cos(k)))); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 6.8e+95) tmp = 2.0 / ((((k * k) / l_m) * ((k * k) * t)) / (l_m * cos(k))); else tmp = ((l_m / k) ^ 2.0) * (-0.3333333333333333 / t); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 6.8e+95], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l$95$m), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l$95$m * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.8 \cdot 10^{+95}:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot k}{l\_m} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{l\_m \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 6.80000000000000043e95Initial program 35.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.0
Applied rewrites77.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.6%
Taylor expanded in k around 0
pow2N/A
lift-*.f6476.3
Applied rewrites76.3%
if 6.80000000000000043e95 < k Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6433.9
Applied rewrites33.9%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6458.4
Applied rewrites58.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6458.4
Applied rewrites58.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites63.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 1.95e-146)
(* l_m (* l_m (/ (fma (* k k) -0.3333333333333333 2.0) (* (pow k 4.0) t))))
(if (<= k 6.8e+95)
(/
2.0
(*
(*
(/
(fma
(* (fma (* k k) 0.08611111111111111 0.16666666666666666) t)
(* k k)
t)
(* l_m l_m))
(* k k))
(* k k)))
(* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 1.95e-146) {
tmp = l_m * (l_m * (fma((k * k), -0.3333333333333333, 2.0) / (pow(k, 4.0) * t)));
} else if (k <= 6.8e+95) {
tmp = 2.0 / (((fma((fma((k * k), 0.08611111111111111, 0.16666666666666666) * t), (k * k), t) / (l_m * l_m)) * (k * k)) * (k * k));
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 1.95e-146) tmp = Float64(l_m * Float64(l_m * Float64(fma(Float64(k * k), -0.3333333333333333, 2.0) / Float64((k ^ 4.0) * t)))); elseif (k <= 6.8e+95) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(fma(Float64(k * k), 0.08611111111111111, 0.16666666666666666) * t), Float64(k * k), t) / Float64(l_m * l_m)) * Float64(k * k)) * Float64(k * k))); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 1.95e-146], N[(l$95$m * N[(l$95$m * N[(N[(N[(k * k), $MachinePrecision] * -0.3333333333333333 + 2.0), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 6.8e+95], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * 0.08611111111111111 + 0.16666666666666666), $MachinePrecision] * t), $MachinePrecision] * N[(k * k), $MachinePrecision] + t), $MachinePrecision] / N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{-146}:\\
\;\;\;\;l\_m \cdot \left(l\_m \cdot \frac{\mathsf{fma}\left(k \cdot k, -0.3333333333333333, 2\right)}{{k}^{4} \cdot t}\right)\\
\mathbf{elif}\;k \leq 6.8 \cdot 10^{+95}:\\
\;\;\;\;\frac{2}{\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, 0.08611111111111111, 0.16666666666666666\right) \cdot t, k \cdot k, t\right)}{l\_m \cdot l\_m} \cdot \left(k \cdot k\right)\right) \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 1.95000000000000001e-146Initial program 37.8%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6454.3
Applied rewrites54.3%
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-/l/N/A
+-commutativeN/A
pow2N/A
unpow-prod-downN/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
*-commutativeN/A
Applied rewrites53.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f6461.1
Applied rewrites61.1%
if 1.95000000000000001e-146 < k < 6.80000000000000043e95Initial program 26.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.6%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6459.6
Applied rewrites59.6%
Applied rewrites62.3%
if 6.80000000000000043e95 < k Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6433.9
Applied rewrites33.9%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6458.4
Applied rewrites58.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6458.4
Applied rewrites58.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites63.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 4.5e+132) (* (/ 2.0 (* (* k k) t)) (/ (* l_m l_m) (* k k))) (* (pow (/ l_m k) 2.0) (/ -0.3333333333333333 t))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.5e+132) {
tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k));
} else {
tmp = pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.5d+132) then
tmp = (2.0d0 / ((k * k) * t)) * ((l_m * l_m) / (k * k))
else
tmp = ((l_m / k) ** 2.0d0) * ((-0.3333333333333333d0) / t)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.5e+132) {
tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k));
} else {
tmp = Math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.5e+132: tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k)) else: tmp = math.pow((l_m / k), 2.0) * (-0.3333333333333333 / t) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.5e+132) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m * l_m) / Float64(k * k))); else tmp = Float64((Float64(l_m / k) ^ 2.0) * Float64(-0.3333333333333333 / t)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.5e+132) tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k)); else tmp = ((l_m / k) ^ 2.0) * (-0.3333333333333333 / t); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.5e+132], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * N[(-0.3333333333333333 / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{+132}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m \cdot l\_m}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{l\_m}{k}\right)}^{2} \cdot \frac{-0.3333333333333333}{t}\\
\end{array}
\end{array}
if k < 4.49999999999999972e132Initial program 34.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.f6477.1
Applied rewrites77.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6466.0
Applied rewrites66.0%
if 4.49999999999999972e132 < k Initial program 37.6%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6432.3
Applied rewrites32.3%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f64N/A
Applied rewrites65.5%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (/ 2.0 (* (* k k) t)) (/ (* l_m l_m) (* k k))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k));
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = (2.0d0 / ((k * k) * t)) * ((l_m * l_m) / (k * k))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k));
}
l_m = math.fabs(l) def code(t, l_m, k): return (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m * l_m) / Float64(k * k))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (2.0 / ((k * k) * t)) * ((l_m * l_m) / (k * k)); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m \cdot l\_m}{k \cdot 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.f6475.1
Applied rewrites75.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6465.1
Applied rewrites65.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (* l_m (/ l_m (* (* k t) k))) -0.3333333333333333))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (l_m * (l_m / ((k * t) * k))) * -0.3333333333333333;
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = (l_m * (l_m / ((k * t) * k))) * (-0.3333333333333333d0)
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (l_m * (l_m / ((k * t) * k))) * -0.3333333333333333;
}
l_m = math.fabs(l) def code(t, l_m, k): return (l_m * (l_m / ((k * t) * k))) * -0.3333333333333333
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(l_m * Float64(l_m / Float64(Float64(k * t) * k))) * -0.3333333333333333) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (l_m * (l_m / ((k * t) * k))) * -0.3333333333333333; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(l$95$m * N[(l$95$m / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\left(l\_m \cdot \frac{l\_m}{\left(k \cdot t\right) \cdot k}\right) \cdot -0.3333333333333333
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6450.2
Applied rewrites50.2%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6430.0
Applied rewrites30.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6430.0
Applied rewrites30.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6431.4
Applied rewrites31.4%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (* l_m l_m) (/ -0.3333333333333333 (* (* k t) k))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (l_m * l_m) * (-0.3333333333333333 / ((k * t) * k));
}
l_m = private
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_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = (l_m * l_m) * ((-0.3333333333333333d0) / ((k * t) * k))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (l_m * l_m) * (-0.3333333333333333 / ((k * t) * k));
}
l_m = math.fabs(l) def code(t, l_m, k): return (l_m * l_m) * (-0.3333333333333333 / ((k * t) * k))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(l_m * l_m) * Float64(-0.3333333333333333 / Float64(Float64(k * t) * k))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (l_m * l_m) * (-0.3333333333333333 / ((k * t) * k)); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\left(l\_m \cdot l\_m\right) \cdot \frac{-0.3333333333333333}{\left(k \cdot t\right) \cdot k}
\end{array}
Initial program 35.2%
Taylor expanded in k around 0
lower-/.f64N/A
associate-*r/N/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f6450.2
Applied rewrites50.2%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6430.0
Applied rewrites30.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6430.0
Applied rewrites30.0%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*l/N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow-to-expN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow-to-expN/A
lower-/.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6430.4
Applied rewrites30.4%
herbie shell --seed 2025097
(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))))