
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 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)) (t_2 (* (cos k) l_m)))
(if (<= l_m 2.4e-82)
(* (* (/ t_2 (* (* k k) t)) (/ l_m t_1)) 2.0)
(if (<= l_m 1.1e+117)
(/ (* (/ 2.0 k) (* t_2 l_m)) (* (* k t) t_1))
(/
(* (* (/ t_2 k) (/ l_m k)) 4.0)
(* (* (/ 1.0 (pow (sin k) -2.0)) 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 t_2 = cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 1.1e+117) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((1.0 / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (l_m <= 2.4d-82) then
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0d0
else if (l_m <= 1.1d+117) then
tmp = ((2.0d0 / k) * (t_2 * l_m)) / ((k * t) * t_1)
else
tmp = (((t_2 / k) * (l_m / k)) * 4.0d0) / (((1.0d0 / (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 t_1 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 1.1e+117) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((1.0 / Math.pow(Math.sin(k), -2.0)) * 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) t_2 = math.cos(k) * l_m tmp = 0 if l_m <= 2.4e-82: tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0 elif l_m <= 1.1e+117: tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1) else: tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((1.0 / math.pow(math.sin(k), -2.0)) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 t_2 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 2.4e-82) tmp = Float64(Float64(Float64(t_2 / Float64(Float64(k * k) * t)) * Float64(l_m / t_1)) * 2.0); elseif (l_m <= 1.1e+117) tmp = Float64(Float64(Float64(2.0 / k) * Float64(t_2 * l_m)) / Float64(Float64(k * t) * t_1)); else tmp = Float64(Float64(Float64(Float64(t_2 / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(1.0 / (sin(k) ^ -2.0)) * 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; t_2 = cos(k) * l_m; tmp = 0.0; if (l_m <= 2.4e-82) tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0; elseif (l_m <= 1.1e+117) tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1); else tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((1.0 / (sin(k) ^ -2.0)) * 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]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 2.4e-82], N[(N[(N[(t$95$2 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t$95$1), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[l$95$m, 1.1e+117], N[(N[(N[(2.0 / k), $MachinePrecision] * N[(t$95$2 * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(1.0 / N[Power[N[Sin[k], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
t_2 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 2.4 \cdot 10^{-82}:\\
\;\;\;\;\left(\frac{t\_2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{t\_1}\right) \cdot 2\\
\mathbf{elif}\;l\_m \leq 1.1 \cdot 10^{+117}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot \left(t\_2 \cdot l\_m\right)}{\left(k \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\frac{1}{{\sin k}^{-2}} \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 2.40000000000000008e-82Initial program 34.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.f6472.7
Applied rewrites72.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites89.8%
if 2.40000000000000008e-82 < l < 1.10000000000000007e117Initial program 55.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.f6492.7
Applied rewrites92.7%
Applied rewrites94.6%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6494.6
Applied rewrites94.6%
Applied rewrites99.5%
if 1.10000000000000007e117 < l Initial program 39.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6471.3
Applied rewrites71.3%
Applied rewrites97.3%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6497.4
Applied rewrites97.4%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)) (t_2 (* (cos k) l_m)))
(if (<= l_m 2.4e-82)
(* (* (/ t_2 (* (* k k) t)) (/ l_m t_1)) 2.0)
(if (<= l_m 2.55e+115)
(/ (* (/ 2.0 k) (* t_2 l_m)) (* (* k t) t_1))
(* (/ 2.0 (* t_1 t)) (* (/ t_2 k) (/ l_m k)))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double t_2 = cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 2.55e+115) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (2.0 / (t_1 * t)) * ((t_2 / k) * (l_m / 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) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (l_m <= 2.4d-82) then
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0d0
else if (l_m <= 2.55d+115) then
tmp = ((2.0d0 / k) * (t_2 * l_m)) / ((k * t) * t_1)
else
tmp = (2.0d0 / (t_1 * t)) * ((t_2 / k) * (l_m / 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 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 2.55e+115) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (2.0 / (t_1 * t)) * ((t_2 / k) * (l_m / k));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) t_2 = math.cos(k) * l_m tmp = 0 if l_m <= 2.4e-82: tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0 elif l_m <= 2.55e+115: tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1) else: tmp = (2.0 / (t_1 * t)) * ((t_2 / k) * (l_m / k)) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 t_2 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 2.4e-82) tmp = Float64(Float64(Float64(t_2 / Float64(Float64(k * k) * t)) * Float64(l_m / t_1)) * 2.0); elseif (l_m <= 2.55e+115) tmp = Float64(Float64(Float64(2.0 / k) * Float64(t_2 * l_m)) / Float64(Float64(k * t) * t_1)); else tmp = Float64(Float64(2.0 / Float64(t_1 * t)) * Float64(Float64(t_2 / k) * Float64(l_m / k))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; t_2 = cos(k) * l_m; tmp = 0.0; if (l_m <= 2.4e-82) tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0; elseif (l_m <= 2.55e+115) tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1); else tmp = (2.0 / (t_1 * t)) * ((t_2 / k) * (l_m / k)); 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]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 2.4e-82], N[(N[(N[(t$95$2 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t$95$1), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[l$95$m, 2.55e+115], N[(N[(N[(2.0 / k), $MachinePrecision] * N[(t$95$2 * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$2 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
t_2 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 2.4 \cdot 10^{-82}:\\
\;\;\;\;\left(\frac{t\_2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{t\_1}\right) \cdot 2\\
\mathbf{elif}\;l\_m \leq 2.55 \cdot 10^{+115}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot \left(t\_2 \cdot l\_m\right)}{\left(k \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_1 \cdot t} \cdot \left(\frac{t\_2}{k} \cdot \frac{l\_m}{k}\right)\\
\end{array}
\end{array}
if l < 2.40000000000000008e-82Initial program 34.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.f6472.7
Applied rewrites72.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites89.8%
if 2.40000000000000008e-82 < l < 2.5499999999999998e115Initial program 56.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.f6492.6
Applied rewrites92.6%
Applied rewrites94.5%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6494.6
Applied rewrites94.6%
Applied rewrites99.5%
if 2.5499999999999998e115 < l Initial program 38.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.f6471.9
Applied rewrites71.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites97.4%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)) (t_2 (* (cos k) l_m)))
(if (<= l_m 2.4e-82)
(* (* (/ t_2 (* (* k k) t)) (/ l_m t_1)) 2.0)
(if (<= l_m 2.6e+115)
(/ (* (/ 2.0 k) (* t_2 l_m)) (* (* k t) t_1))
(/
(* (* (/ t_2 k) (/ l_m k)) 4.0)
(* (* (- 0.5 (* (cos (* k 2.0)) 0.5)) 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 t_2 = cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 2.6e+115) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (l_m <= 2.4d-82) then
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0d0
else if (l_m <= 2.6d+115) then
tmp = ((2.0d0 / k) * (t_2 * l_m)) / ((k * t) * t_1)
else
tmp = (((t_2 / k) * (l_m / k)) * 4.0d0) / (((0.5d0 - (cos((k * 2.0d0)) * 0.5d0)) * 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 t_2 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 2.4e-82) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if (l_m <= 2.6e+115) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (Math.cos((k * 2.0)) * 0.5)) * 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) t_2 = math.cos(k) * l_m tmp = 0 if l_m <= 2.4e-82: tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0 elif l_m <= 2.6e+115: tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1) else: tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (math.cos((k * 2.0)) * 0.5)) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = sin(k) ^ 2.0 t_2 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 2.4e-82) tmp = Float64(Float64(Float64(t_2 / Float64(Float64(k * k) * t)) * Float64(l_m / t_1)) * 2.0); elseif (l_m <= 2.6e+115) tmp = Float64(Float64(Float64(2.0 / k) * Float64(t_2 * l_m)) / Float64(Float64(k * t) * t_1)); else tmp = Float64(Float64(Float64(Float64(t_2 / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k * 2.0)) * 0.5)) * 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; t_2 = cos(k) * l_m; tmp = 0.0; if (l_m <= 2.4e-82) tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0; elseif (l_m <= 2.6e+115) tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1); else tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 2.4e-82], N[(N[(N[(t$95$2 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t$95$1), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[l$95$m, 2.6e+115], N[(N[(N[(2.0 / k), $MachinePrecision] * N[(t$95$2 * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
t_2 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 2.4 \cdot 10^{-82}:\\
\;\;\;\;\left(\frac{t\_2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{t\_1}\right) \cdot 2\\
\mathbf{elif}\;l\_m \leq 2.6 \cdot 10^{+115}:\\
\;\;\;\;\frac{\frac{2}{k} \cdot \left(t\_2 \cdot l\_m\right)}{\left(k \cdot t\right) \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(0.5 - \cos \left(k \cdot 2\right) \cdot 0.5\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 2.40000000000000008e-82Initial program 34.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.f6472.7
Applied rewrites72.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites89.8%
if 2.40000000000000008e-82 < l < 2.6e115Initial program 56.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.f6492.6
Applied rewrites92.6%
Applied rewrites94.5%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6494.6
Applied rewrites94.6%
Applied rewrites99.5%
if 2.6e115 < l Initial program 38.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.f6471.9
Applied rewrites71.9%
Applied rewrites97.3%
lift-sin.f64N/A
lower-pow.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f6497.3
Applied rewrites97.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)) (t_2 (* (* (/ t_1 k) (/ l_m k)) 4.0)))
(if (<= k 2e-106)
(/ t_2 (* (* (* k t) k) 2.0))
(if (<= k 1.7e+88)
(* (* (/ t_1 (* (* k k) t)) (/ l_m (pow (sin k) 2.0))) 2.0)
(/ t_2 (* (* (- 0.5 (* (cos (* k 2.0)) 0.5)) t) 2.0))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double t_2 = ((t_1 / k) * (l_m / k)) * 4.0;
double tmp;
if (k <= 2e-106) {
tmp = t_2 / (((k * t) * k) * 2.0);
} else if (k <= 1.7e+88) {
tmp = ((t_1 / ((k * k) * t)) * (l_m / pow(sin(k), 2.0))) * 2.0;
} else {
tmp = t_2 / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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) :: t_2
real(8) :: tmp
t_1 = cos(k) * l_m
t_2 = ((t_1 / k) * (l_m / k)) * 4.0d0
if (k <= 2d-106) then
tmp = t_2 / (((k * t) * k) * 2.0d0)
else if (k <= 1.7d+88) then
tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ** 2.0d0))) * 2.0d0
else
tmp = t_2 / (((0.5d0 - (cos((k * 2.0d0)) * 0.5d0)) * 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.cos(k) * l_m;
double t_2 = ((t_1 / k) * (l_m / k)) * 4.0;
double tmp;
if (k <= 2e-106) {
tmp = t_2 / (((k * t) * k) * 2.0);
} else if (k <= 1.7e+88) {
tmp = ((t_1 / ((k * k) * t)) * (l_m / Math.pow(Math.sin(k), 2.0))) * 2.0;
} else {
tmp = t_2 / (((0.5 - (Math.cos((k * 2.0)) * 0.5)) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m t_2 = ((t_1 / k) * (l_m / k)) * 4.0 tmp = 0 if k <= 2e-106: tmp = t_2 / (((k * t) * k) * 2.0) elif k <= 1.7e+88: tmp = ((t_1 / ((k * k) * t)) * (l_m / math.pow(math.sin(k), 2.0))) * 2.0 else: tmp = t_2 / (((0.5 - (math.cos((k * 2.0)) * 0.5)) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) t_2 = Float64(Float64(Float64(t_1 / k) * Float64(l_m / k)) * 4.0) tmp = 0.0 if (k <= 2e-106) tmp = Float64(t_2 / Float64(Float64(Float64(k * t) * k) * 2.0)); elseif (k <= 1.7e+88) tmp = Float64(Float64(Float64(t_1 / Float64(Float64(k * k) * t)) * Float64(l_m / (sin(k) ^ 2.0))) * 2.0); else tmp = Float64(t_2 / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k * 2.0)) * 0.5)) * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; t_2 = ((t_1 / k) * (l_m / k)) * 4.0; tmp = 0.0; if (k <= 2e-106) tmp = t_2 / (((k * t) * k) * 2.0); elseif (k <= 1.7e+88) tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ^ 2.0))) * 2.0; else tmp = t_2 / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[k, 2e-106], N[(t$95$2 / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.7e+88], N[(N[(N[(t$95$1 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(t$95$2 / N[(N[(N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
t_2 := \left(\frac{t\_1}{k} \cdot \frac{l\_m}{k}\right) \cdot 4\\
\mathbf{if}\;k \leq 2 \cdot 10^{-106}:\\
\;\;\;\;\frac{t\_2}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{elif}\;k \leq 1.7 \cdot 10^{+88}:\\
\;\;\;\;\left(\frac{t\_1}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{{\sin k}^{2}}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\left(\left(0.5 - \cos \left(k \cdot 2\right) \cdot 0.5\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 1.99999999999999988e-106Initial program 38.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.f6476.1
Applied rewrites76.1%
Applied rewrites92.6%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6492.3
Applied rewrites92.3%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6478.5
Applied rewrites78.5%
if 1.99999999999999988e-106 < k < 1.70000000000000002e88Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.1
Applied rewrites78.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
Applied rewrites97.2%
if 1.70000000000000002e88 < k Initial program 46.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6477.9
Applied rewrites77.9%
Applied rewrites94.1%
lift-sin.f64N/A
lower-pow.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f6493.7
Applied rewrites93.7%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0)))
(if (<= k 2e-8)
(/ t_1 (* (* (* k t) k) 2.0))
(/ t_1 (* (* (- 0.5 (* (cos (* k 2.0)) 0.5)) t) 2.0)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = (((cos(k) * l_m) / k) * (l_m / k)) * 4.0;
double tmp;
if (k <= 2e-8) {
tmp = t_1 / (((k * t) * k) * 2.0);
} else {
tmp = t_1 / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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 = (((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0
if (k <= 2d-8) then
tmp = t_1 / (((k * t) * k) * 2.0d0)
else
tmp = t_1 / (((0.5d0 - (cos((k * 2.0d0)) * 0.5d0)) * 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.cos(k) * l_m) / k) * (l_m / k)) * 4.0;
double tmp;
if (k <= 2e-8) {
tmp = t_1 / (((k * t) * k) * 2.0);
} else {
tmp = t_1 / (((0.5 - (Math.cos((k * 2.0)) * 0.5)) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = (((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0 tmp = 0 if k <= 2e-8: tmp = t_1 / (((k * t) * k) * 2.0) else: tmp = t_1 / (((0.5 - (math.cos((k * 2.0)) * 0.5)) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) tmp = 0.0 if (k <= 2e-8) tmp = Float64(t_1 / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(t_1 / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k * 2.0)) * 0.5)) * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = (((cos(k) * l_m) / k) * (l_m / k)) * 4.0; tmp = 0.0; if (k <= 2e-8) tmp = t_1 / (((k * t) * k) * 2.0); else tmp = t_1 / (((0.5 - (cos((k * 2.0)) * 0.5)) * 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[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[k, 2e-8], N[(t$95$1 / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(N[(N[(0.5 - N[(N[Cos[N[(k * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4\\
\mathbf{if}\;k \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{t\_1}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\left(\left(0.5 - \cos \left(k \cdot 2\right) \cdot 0.5\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 2e-8Initial program 39.3%
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.9
Applied rewrites76.9%
Applied rewrites92.8%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6492.5
Applied rewrites92.5%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6480.0
Applied rewrites80.0%
if 2e-8 < k Initial program 40.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.f6476.7
Applied rewrites76.7%
Applied rewrites88.7%
lift-sin.f64N/A
lower-pow.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f6488.3
Applied rewrites88.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2e-8)
(/ (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0))
(*
(/ (/ 2.0 k) (* k t))
(/ (* (cos k) (* l_m l_m)) (- 0.5 (* 0.5 (cos (* 2.0 k))))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2e-8) {
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = ((2.0 / k) / (k * t)) * ((cos(k) * (l_m * l_m)) / (0.5 - (0.5 * cos((2.0 * 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) :: tmp
if (k <= 2d-8) then
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
else
tmp = ((2.0d0 / k) / (k * t)) * ((cos(k) * (l_m * l_m)) / (0.5d0 - (0.5d0 * cos((2.0d0 * k)))))
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 <= 2e-8) {
tmp = ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = ((2.0 / k) / (k * t)) * ((Math.cos(k) * (l_m * l_m)) / (0.5 - (0.5 * Math.cos((2.0 * k)))));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2e-8: tmp = ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0) else: tmp = ((2.0 / k) / (k * t)) * ((math.cos(k) * (l_m * l_m)) / (0.5 - (0.5 * math.cos((2.0 * k))))) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2e-8) tmp = Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(Float64(Float64(2.0 / k) / Float64(k * t)) * Float64(Float64(cos(k) * Float64(l_m * l_m)) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2e-8) tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); else tmp = ((2.0 / k) / (k * t)) * ((cos(k) * (l_m * l_m)) / (0.5 - (0.5 * cos((2.0 * k))))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2e-8], N[(N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / k), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{k}}{k \cdot t} \cdot \frac{\cos k \cdot \left(l\_m \cdot l\_m\right)}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\end{array}
\end{array}
if k < 2e-8Initial program 39.3%
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.9
Applied rewrites76.9%
Applied rewrites92.8%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6492.5
Applied rewrites92.5%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6480.0
Applied rewrites80.0%
if 2e-8 < k Initial program 40.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.f6476.7
Applied rewrites76.7%
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-*.f6476.6
Applied rewrites76.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6477.9
Applied rewrites77.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-*.f6478.0
Applied rewrites78.0%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)))
(if (<= k 2e-8)
(/ (* (* (/ t_1 k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0))
(*
(/ 2.0 (* k (* k t)))
(/ (* t_1 l_m) (- 0.5 (* 0.5 (cos (* 2.0 k)))))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double tmp;
if (k <= 2e-8) {
tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((t_1 * l_m) / (0.5 - (0.5 * cos((2.0 * 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 = cos(k) * l_m
if (k <= 2d-8) then
tmp = (((t_1 / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
else
tmp = (2.0d0 / (k * (k * t))) * ((t_1 * l_m) / (0.5d0 - (0.5d0 * cos((2.0d0 * 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 = Math.cos(k) * l_m;
double tmp;
if (k <= 2e-8) {
tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((t_1 * l_m) / (0.5 - (0.5 * Math.cos((2.0 * k)))));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m tmp = 0 if k <= 2e-8: tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0) else: tmp = (2.0 / (k * (k * t))) * ((t_1 * l_m) / (0.5 - (0.5 * math.cos((2.0 * k))))) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) tmp = 0.0 if (k <= 2e-8) tmp = Float64(Float64(Float64(Float64(t_1 / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(t_1 * l_m) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; tmp = 0.0; if (k <= 2e-8) tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); else tmp = (2.0 / (k * (k * t))) * ((t_1 * l_m) / (0.5 - (0.5 * cos((2.0 * k))))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[k, 2e-8], N[(N[(N[(N[(t$95$1 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * l$95$m), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
\mathbf{if}\;k \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\left(\frac{t\_1}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{t\_1 \cdot l\_m}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
\end{array}
\end{array}
if k < 2e-8Initial program 39.3%
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.9
Applied rewrites76.9%
Applied rewrites92.8%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6492.5
Applied rewrites92.5%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6480.0
Applied rewrites80.0%
if 2e-8 < k Initial program 40.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.f6476.7
Applied rewrites76.7%
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-*.f6476.6
Applied rewrites76.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6477.9
Applied rewrites77.9%
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-*.f6477.9
Applied rewrites77.9%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2e-8)
(/ (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0))
(*
(/ 2.0 (* k (* k t)))
(/ (* (cos k) (* l_m l_m)) (- 0.5 (* 0.5 (cos (+ k k))))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2e-8) {
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - (0.5 * cos((k + 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) :: tmp
if (k <= 2d-8) then
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
else
tmp = (2.0d0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5d0 - (0.5d0 * cos((k + k)))))
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 <= 2e-8) {
tmp = ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((Math.cos(k) * (l_m * l_m)) / (0.5 - (0.5 * Math.cos((k + k)))));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2e-8: tmp = ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0) else: tmp = (2.0 / (k * (k * t))) * ((math.cos(k) * (l_m * l_m)) / (0.5 - (0.5 * math.cos((k + k))))) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2e-8) tmp = Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l_m * l_m)) / Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2e-8) tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); else tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - (0.5 * cos((k + k))))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2e-8], N[(N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{-8}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(l\_m \cdot l\_m\right)}{0.5 - 0.5 \cdot \cos \left(k + k\right)}\\
\end{array}
\end{array}
if k < 2e-8Initial program 39.3%
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.9
Applied rewrites76.9%
Applied rewrites92.8%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6492.5
Applied rewrites92.5%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6480.0
Applied rewrites80.0%
if 2e-8 < k Initial program 40.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.f6476.7
Applied rewrites76.7%
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-*.f6476.6
Applied rewrites76.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6477.9
Applied rewrites77.9%
lift-*.f64N/A
count-2-revN/A
lower-+.f6477.9
Applied rewrites77.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 1.7e+16) (/ (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0)) (/ (* (* (/ l_m k) (/ l_m k)) 4.0) (* (* (pow (sin k) 2.0) t) 2.0))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 1.7e+16) {
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (((l_m / k) * (l_m / k)) * 4.0) / ((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 (k <= 1.7d+16) then
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
else
tmp = (((l_m / k) * (l_m / k)) * 4.0d0) / (((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 (k <= 1.7e+16) {
tmp = ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (((l_m / k) * (l_m / k)) * 4.0) / ((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 k <= 1.7e+16: tmp = ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0) else: tmp = (((l_m / k) * (l_m / k)) * 4.0) / ((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 (k <= 1.7e+16) tmp = Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(Float64(Float64(Float64(l_m / k) * Float64(l_m / k)) * 4.0) / Float64(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 (k <= 1.7e+16) tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); else tmp = (((l_m / k) * (l_m / k)) * 4.0) / (((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[k, 1.7e+16], N[(N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.7 \cdot 10^{+16}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 1.7e16Initial program 38.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6476.2
Applied rewrites76.2%
Applied rewrites91.6%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6491.2
Applied rewrites91.2%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6478.8
Applied rewrites78.8%
if 1.7e16 < k Initial program 41.3%
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.f6478.5
Applied rewrites78.5%
Applied rewrites91.7%
Taylor expanded in k around 0
Applied rewrites66.8%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0)))
(if (<= l_m 5.4e+168)
(/ t_1 (* (* (* k t) k) 2.0))
(/
t_1
(*
(* (/ 1.0 (/ (fma 0.3333333333333333 (* k k) 1.0) (* k k))) t)
2.0)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = (((cos(k) * l_m) / k) * (l_m / k)) * 4.0;
double tmp;
if (l_m <= 5.4e+168) {
tmp = t_1 / (((k * t) * k) * 2.0);
} else {
tmp = t_1 / (((1.0 / (fma(0.3333333333333333, (k * k), 1.0) / (k * k))) * t) * 2.0);
}
return tmp;
}
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) tmp = 0.0 if (l_m <= 5.4e+168) tmp = Float64(t_1 / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(t_1 / Float64(Float64(Float64(1.0 / Float64(fma(0.3333333333333333, Float64(k * k), 1.0) / Float64(k * k))) * t) * 2.0)); end return tmp end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, If[LessEqual[l$95$m, 5.4e+168], N[(t$95$1 / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / N[(N[(N[(1.0 / N[(N[(0.3333333333333333 * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4\\
\mathbf{if}\;l\_m \leq 5.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{t\_1}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\left(\frac{1}{\frac{\mathsf{fma}\left(0.3333333333333333, k \cdot k, 1\right)}{k \cdot k}} \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 5.40000000000000031e168Initial program 41.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.f6478.3
Applied rewrites78.3%
Applied rewrites90.9%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6490.6
Applied rewrites90.6%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6476.0
Applied rewrites76.0%
if 5.40000000000000031e168 < l Initial program 28.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.f6466.3
Applied rewrites66.3%
Applied rewrites96.6%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6496.7
Applied rewrites96.7%
Taylor expanded in k around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6467.9
Applied rewrites67.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 2.5e+170) (/ (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0)) (* (/ 2.0 (* k (* k t))) (/ (* (cos k) (* l_m l_m)) (- 0.5 0.5)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (l_m <= 2.5e+170) {
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - 0.5));
}
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 (l_m <= 2.5d+170) then
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
else
tmp = (2.0d0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5d0 - 0.5d0))
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 (l_m <= 2.5e+170) {
tmp = ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
} else {
tmp = (2.0 / (k * (k * t))) * ((Math.cos(k) * (l_m * l_m)) / (0.5 - 0.5));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if l_m <= 2.5e+170: tmp = ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0) else: tmp = (2.0 / (k * (k * t))) * ((math.cos(k) * (l_m * l_m)) / (0.5 - 0.5)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (l_m <= 2.5e+170) tmp = Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l_m * l_m)) / Float64(0.5 - 0.5))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (l_m <= 2.5e+170) tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); else tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - 0.5)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[l$95$m, 2.5e+170], N[(N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.5 \cdot 10^{+170}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(l\_m \cdot l\_m\right)}{0.5 - 0.5}\\
\end{array}
\end{array}
if l < 2.49999999999999988e170Initial program 41.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.0
Applied rewrites78.0%
Applied rewrites90.9%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6490.6
Applied rewrites90.6%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6475.6
Applied rewrites75.6%
if 2.49999999999999988e170 < l Initial program 29.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6468.4
Applied rewrites68.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-*.f6468.4
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6468.5
Applied rewrites68.5%
Taylor expanded in k around 0
Applied rewrites68.5%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 2.15e+170) (* (/ 2.0 (* (* k k) t)) (* (/ l_m k) (/ l_m k))) (* (/ 2.0 (* k (* k t))) (/ (* (cos k) (* l_m l_m)) (- 0.5 0.5)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (l_m <= 2.15e+170) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - 0.5));
}
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 (l_m <= 2.15d+170) then
tmp = (2.0d0 / ((k * k) * t)) * ((l_m / k) * (l_m / k))
else
tmp = (2.0d0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5d0 - 0.5d0))
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 (l_m <= 2.15e+170) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = (2.0 / (k * (k * t))) * ((Math.cos(k) * (l_m * l_m)) / (0.5 - 0.5));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if l_m <= 2.15e+170: tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)) else: tmp = (2.0 / (k * (k * t))) * ((math.cos(k) * (l_m * l_m)) / (0.5 - 0.5)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (l_m <= 2.15e+170) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m / k) * Float64(l_m / k))); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l_m * l_m)) / Float64(0.5 - 0.5))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (l_m <= 2.15e+170) tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)); else tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l_m * l_m)) / (0.5 - 0.5)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[l$95$m, 2.15e+170], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 2.15 \cdot 10^{+170}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(l\_m \cdot l\_m\right)}{0.5 - 0.5}\\
\end{array}
\end{array}
if l < 2.1499999999999999e170Initial program 41.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.0
Applied rewrites78.0%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
if 2.1499999999999999e170 < l Initial program 29.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6468.4
Applied rewrites68.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-*.f6468.4
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6468.5
Applied rewrites68.5%
Taylor expanded in k around 0
Applied rewrites68.5%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= (* l_m l_m) 2e-314) (* (/ 2.0 (* (* k k) (* k k))) (* l_m (/ l_m t))) (* (/ 2.0 (* k (* k t))) (/ (* l_m l_m) (* k k)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if ((l_m * l_m) <= 2e-314) {
tmp = (2.0 / ((k * k) * (k * k))) * (l_m * (l_m / t));
} else {
tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / (k * 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) :: tmp
if ((l_m * l_m) <= 2d-314) then
tmp = (2.0d0 / ((k * k) * (k * k))) * (l_m * (l_m / t))
else
tmp = (2.0d0 / (k * (k * t))) * ((l_m * l_m) / (k * k))
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 ((l_m * l_m) <= 2e-314) {
tmp = (2.0 / ((k * k) * (k * k))) * (l_m * (l_m / t));
} else {
tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / (k * k));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if (l_m * l_m) <= 2e-314: tmp = (2.0 / ((k * k) * (k * k))) * (l_m * (l_m / t)) else: tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / (k * k)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (Float64(l_m * l_m) <= 2e-314) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m * Float64(l_m / t))); else tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(l_m * l_m) / Float64(k * k))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if ((l_m * l_m) <= 2e-314) tmp = (2.0 / ((k * k) * (k * k))) * (l_m * (l_m / t)); else tmp = (2.0 / (k * (k * t))) * ((l_m * l_m) / (k * k)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[N[(l$95$m * l$95$m), $MachinePrecision], 2e-314], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m * N[(l$95$m / t), $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[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \cdot l\_m \leq 2 \cdot 10^{-314}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \left(l\_m \cdot \frac{l\_m}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{l\_m \cdot l\_m}{k \cdot k}\\
\end{array}
\end{array}
if (*.f64 l l) < 1.9999999999e-314Initial program 16.7%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6446.8
Applied rewrites46.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6455.7
Applied rewrites55.7%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6455.7
Applied rewrites55.7%
if 1.9999999999e-314 < (*.f64 l l) Initial program 46.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.f6485.1
Applied rewrites85.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-*.f6479.9
Applied rewrites79.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6481.8
Applied rewrites81.8%
Taylor expanded in k around 0
pow2N/A
sqr-sin-a-revN/A
unpow2N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.6
Applied rewrites68.6%
Final simplification65.6%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (/ 2.0 (* (* k k) t)) (* (/ l_m k) (/ l_m k))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / 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 / k) * (l_m / 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 / k) * (l_m / k));
}
l_m = math.fabs(l) def code(t, l_m, k): return (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / 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 / k) * Float64(l_m / k))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / 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 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right)
\end{array}
Initial program 39.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.f6476.8
Applied rewrites76.8%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6470.7
Applied rewrites70.7%
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(k * Float64(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[(k * N[(k * t), $MachinePrecision]), $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}{k \cdot \left(k \cdot t\right)} \cdot \frac{l\_m \cdot l\_m}{k \cdot k}
\end{array}
Initial program 39.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.f6476.8
Applied rewrites76.8%
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-*.f6472.1
Applied rewrites72.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6473.6
Applied rewrites73.6%
Taylor expanded in k around 0
pow2N/A
sqr-sin-a-revN/A
unpow2N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6463.9
Applied rewrites63.9%
Final simplification63.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ (* -0.11666666666666667 (* l_m l_m)) t))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (-0.11666666666666667 * (l_m * l_m)) / t;
}
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 = ((-0.11666666666666667d0) * (l_m * l_m)) / t
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (-0.11666666666666667 * (l_m * l_m)) / t;
}
l_m = math.fabs(l) def code(t, l_m, k): return (-0.11666666666666667 * (l_m * l_m)) / t
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(-0.11666666666666667 * Float64(l_m * l_m)) / t) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (-0.11666666666666667 * (l_m * l_m)) / t; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(-0.11666666666666667 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{-0.11666666666666667 \cdot \left(l\_m \cdot l\_m\right)}{t}
\end{array}
Initial program 39.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites25.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6416.2
Applied rewrites16.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6416.2
Applied rewrites16.2%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* -0.11666666666666667 (/ (* l_m l_m) t)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return -0.11666666666666667 * ((l_m * l_m) / t);
}
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 = (-0.11666666666666667d0) * ((l_m * l_m) / t)
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return -0.11666666666666667 * ((l_m * l_m) / t);
}
l_m = math.fabs(l) def code(t, l_m, k): return -0.11666666666666667 * ((l_m * l_m) / t)
l_m = abs(l) function code(t, l_m, k) return Float64(-0.11666666666666667 * Float64(Float64(l_m * l_m) / t)) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = -0.11666666666666667 * ((l_m * l_m) / t); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(-0.11666666666666667 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
-0.11666666666666667 \cdot \frac{l\_m \cdot l\_m}{t}
\end{array}
Initial program 39.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites25.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6416.2
Applied rewrites16.2%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* -0.11666666666666667 (* l_m (/ l_m t))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return -0.11666666666666667 * (l_m * (l_m / t));
}
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 = (-0.11666666666666667d0) * (l_m * (l_m / t))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return -0.11666666666666667 * (l_m * (l_m / t));
}
l_m = math.fabs(l) def code(t, l_m, k): return -0.11666666666666667 * (l_m * (l_m / t))
l_m = abs(l) function code(t, l_m, k) return Float64(-0.11666666666666667 * Float64(l_m * Float64(l_m / t))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = -0.11666666666666667 * (l_m * (l_m / t)); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(-0.11666666666666667 * N[(l$95$m * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
-0.11666666666666667 \cdot \left(l\_m \cdot \frac{l\_m}{t}\right)
\end{array}
Initial program 39.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites25.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6416.2
Applied rewrites16.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6414.0
Applied rewrites14.0%
herbie shell --seed 2025085
(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))))