
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
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 1e-139)
(/ 2.0 (* (/ (* (* k k) t) t_2) (/ t_1 l_m)))
(if (<= l_m 9.5e+78)
(/ (* 2.0 (/ (* t_2 l_m) t_1)) (* (* k t) k))
(* (* (cos k) (pow (/ l_m k) 2.0)) (/ 4.0 (* (* t_1 t) 2.0)))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double t_2 = cos(k) * l_m;
double tmp;
if (l_m <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} else {
tmp = (cos(k) * pow((l_m / k), 2.0)) * (4.0 / ((t_1 * t) * 2.0));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (l_m <= 1d-139) then
tmp = 2.0d0 / ((((k * k) * t) / t_2) * (t_1 / l_m))
else if (l_m <= 9.5d+78) then
tmp = (2.0d0 * ((t_2 * l_m) / t_1)) / ((k * t) * k)
else
tmp = (cos(k) * ((l_m / k) ** 2.0d0)) * (4.0d0 / ((t_1 * t) * 2.0d0))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} else {
tmp = (Math.cos(k) * Math.pow((l_m / k), 2.0)) * (4.0 / ((t_1 * t) * 2.0));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) t_2 = math.cos(k) * l_m tmp = 0 if l_m <= 1e-139: tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)) elif l_m <= 9.5e+78: tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k) else: tmp = (math.cos(k) * math.pow((l_m / k), 2.0)) * (4.0 / ((t_1 * 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 <= 1e-139) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) / t_2) * Float64(t_1 / l_m))); elseif (l_m <= 9.5e+78) tmp = Float64(Float64(2.0 * Float64(Float64(t_2 * l_m) / t_1)) / Float64(Float64(k * t) * k)); else tmp = Float64(Float64(cos(k) * (Float64(l_m / k) ^ 2.0)) * Float64(4.0 / Float64(Float64(t_1 * t) * 2.0))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; t_2 = cos(k) * l_m; tmp = 0.0; if (l_m <= 1e-139) tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)); elseif (l_m <= 9.5e+78) tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k); else tmp = (cos(k) * ((l_m / k) ^ 2.0)) * (4.0 / ((t_1 * t) * 2.0)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 1e-139], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$1 / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 9.5e+78], N[(N[(2.0 * N[(N[(t$95$2 * l$95$m), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[k], $MachinePrecision] * N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(4.0 / N[(N[(t$95$1 * t), $MachinePrecision] * 2.0), $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 10^{-139}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t}{t\_2} \cdot \frac{t\_1}{l\_m}}\\
\mathbf{elif}\;l\_m \leq 9.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{2 \cdot \frac{t\_2 \cdot l\_m}{t\_1}}{\left(k \cdot t\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\left(\cos k \cdot {\left(\frac{l\_m}{k}\right)}^{2}\right) \cdot \frac{4}{\left(t\_1 \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 1.00000000000000003e-139Initial program 36.6%
Taylor expanded in t around inf
Applied rewrites22.9%
Taylor expanded in t around 0
unpow2N/A
times-fracN/A
associate-*r*N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
if 1.00000000000000003e-139 < l < 9.5000000000000006e78Initial program 32.6%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6490.2
Applied rewrites90.2%
Applied rewrites88.4%
Applied rewrites97.9%
if 9.5000000000000006e78 < l Initial program 45.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.f6470.4
Applied rewrites70.4%
Applied rewrites95.0%
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f6494.9
Applied rewrites94.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
associate-*r/N/A
lower-*.f64N/A
Applied rewrites95.1%
Final simplification92.1%
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 1e-139)
(/ 2.0 (* (/ (* (* k k) t) t_2) (/ t_1 l_m)))
(if (<= l_m 9.5e+78)
(/ (* 2.0 (/ (* t_2 l_m) t_1)) (* (* k t) k))
(/ (* (* (/ t_2 k) (/ l_m k)) 4.0) (* (* t_1 t) 2.0))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double t_2 = cos(k) * l_m;
double tmp;
if (l_m <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / ((t_1 * t) * 2.0);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (l_m <= 1d-139) then
tmp = 2.0d0 / ((((k * k) * t) / t_2) * (t_1 / l_m))
else if (l_m <= 9.5d+78) then
tmp = (2.0d0 * ((t_2 * l_m) / t_1)) / ((k * t) * k)
else
tmp = (((t_2 / k) * (l_m / k)) * 4.0d0) / ((t_1 * t) * 2.0d0)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / ((t_1 * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) t_2 = math.cos(k) * l_m tmp = 0 if l_m <= 1e-139: tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)) elif l_m <= 9.5e+78: tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k) else: tmp = (((t_2 / k) * (l_m / k)) * 4.0) / ((t_1 * 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 <= 1e-139) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) / t_2) * Float64(t_1 / l_m))); elseif (l_m <= 9.5e+78) tmp = Float64(Float64(2.0 * Float64(Float64(t_2 * l_m) / t_1)) / Float64(Float64(k * t) * k)); else tmp = Float64(Float64(Float64(Float64(t_2 / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(t_1 * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; t_2 = cos(k) * l_m; tmp = 0.0; if (l_m <= 1e-139) tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)); elseif (l_m <= 9.5e+78) tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k); else tmp = (((t_2 / k) * (l_m / k)) * 4.0) / ((t_1 * t) * 2.0); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 1e-139], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$1 / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 9.5e+78], N[(N[(2.0 * N[(N[(t$95$2 * l$95$m), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(t$95$1 * 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 10^{-139}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t}{t\_2} \cdot \frac{t\_1}{l\_m}}\\
\mathbf{elif}\;l\_m \leq 9.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{2 \cdot \frac{t\_2 \cdot l\_m}{t\_1}}{\left(k \cdot t\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(t\_1 \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 1.00000000000000003e-139Initial program 36.6%
Taylor expanded in t around inf
Applied rewrites22.9%
Taylor expanded in t around 0
unpow2N/A
times-fracN/A
associate-*r*N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
if 1.00000000000000003e-139 < l < 9.5000000000000006e78Initial program 32.6%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6490.2
Applied rewrites90.2%
Applied rewrites88.4%
Applied rewrites97.9%
if 9.5000000000000006e78 < l Initial program 45.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.f6470.4
Applied rewrites70.4%
Applied rewrites95.0%
Final simplification92.1%
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 l_m) 5e-159)
(* (* (/ t_2 (* (* k k) t)) (/ l_m t_1)) 2.0)
(if (<= (* l_m l_m) 5e+214)
(/ (* (/ 2.0 k) (* t_2 l_m)) (* (* k t) t_1))
(/
(* (* (/ t_2 k) (/ l_m k)) 4.0)
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) 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 * l_m) <= 5e-159) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if ((l_m * l_m) <= 5e+214) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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 * l_m) <= 5d-159) then
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0d0
else if ((l_m * l_m) <= 5d+214) 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 - (0.5d0 * cos((2.0d0 * k)))) * 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 * l_m) <= 5e-159) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else if ((l_m * l_m) <= 5e+214) {
tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1);
} else {
tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * Math.cos((2.0 * k)))) * 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 * l_m) <= 5e-159: tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0 elif (l_m * l_m) <= 5e+214: tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1) else: tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * math.cos((2.0 * k)))) * 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 (Float64(l_m * l_m) <= 5e-159) tmp = Float64(Float64(Float64(t_2 / Float64(Float64(k * k) * t)) * Float64(l_m / t_1)) * 2.0); elseif (Float64(l_m * l_m) <= 5e+214) 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(0.5 * cos(Float64(2.0 * k)))) * 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 * l_m) <= 5e-159) tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0; elseif ((l_m * l_m) <= 5e+214) tmp = ((2.0 / k) * (t_2 * l_m)) / ((k * t) * t_1); else tmp = (((t_2 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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[N[(l$95$m * l$95$m), $MachinePrecision], 5e-159], 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[N[(l$95$m * l$95$m), $MachinePrecision], 5e+214], 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[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $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 \cdot l\_m \leq 5 \cdot 10^{-159}:\\
\;\;\;\;\left(\frac{t\_2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{t\_1}\right) \cdot 2\\
\mathbf{elif}\;l\_m \cdot l\_m \leq 5 \cdot 10^{+214}:\\
\;\;\;\;\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 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if (*.f64 l l) < 5.00000000000000032e-159Initial program 36.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.3
Applied rewrites71.3%
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 rewrites94.4%
if 5.00000000000000032e-159 < (*.f64 l l) < 4.99999999999999953e214Initial program 35.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.f6489.7
Applied rewrites89.7%
Applied rewrites93.0%
Applied rewrites99.5%
if 4.99999999999999953e214 < (*.f64 l l) Initial program 39.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.f6469.5
Applied rewrites69.5%
Applied rewrites92.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-*.f6492.4
Applied rewrites92.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 1e-139)
(/ 2.0 (* (/ (* (* k k) t) t_2) (/ t_1 l_m)))
(if (<= l_m 9.5e+78)
(/ (* 2.0 (/ (* t_2 l_m) t_1)) (* (* k t) k))
(* (/ 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 <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} 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 <= 1d-139) then
tmp = 2.0d0 / ((((k * k) * t) / t_2) * (t_1 / l_m))
else if (l_m <= 9.5d+78) then
tmp = (2.0d0 * ((t_2 * l_m) / t_1)) / ((k * t) * k)
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 <= 1e-139) {
tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m));
} else if (l_m <= 9.5e+78) {
tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k);
} 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 <= 1e-139: tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)) elif l_m <= 9.5e+78: tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k) 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 <= 1e-139) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) / t_2) * Float64(t_1 / l_m))); elseif (l_m <= 9.5e+78) tmp = Float64(Float64(2.0 * Float64(Float64(t_2 * l_m) / t_1)) / Float64(Float64(k * t) * k)); 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 <= 1e-139) tmp = 2.0 / ((((k * k) * t) / t_2) * (t_1 / l_m)); elseif (l_m <= 9.5e+78) tmp = (2.0 * ((t_2 * l_m) / t_1)) / ((k * t) * k); 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, 1e-139], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(t$95$1 / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l$95$m, 9.5e+78], N[(N[(2.0 * N[(N[(t$95$2 * l$95$m), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $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 10^{-139}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t}{t\_2} \cdot \frac{t\_1}{l\_m}}\\
\mathbf{elif}\;l\_m \leq 9.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{2 \cdot \frac{t\_2 \cdot l\_m}{t\_1}}{\left(k \cdot t\right) \cdot k}\\
\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 < 1.00000000000000003e-139Initial program 36.6%
Taylor expanded in t around inf
Applied rewrites22.9%
Taylor expanded in t around 0
unpow2N/A
times-fracN/A
associate-*r*N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.7%
if 1.00000000000000003e-139 < l < 9.5000000000000006e78Initial program 32.6%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6490.2
Applied rewrites90.2%
Applied rewrites88.4%
Applied rewrites97.9%
if 9.5000000000000006e78 < l Initial program 45.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.f6470.4
Applied rewrites70.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites94.9%
Final simplification92.1%
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 (<= k 3e+105)
(* (* (/ t_2 (* (* k k) t)) (/ l_m t_1)) 2.0)
(/ (* (* (/ t_2 k) l_m) 4.0) (* k (* (* t_1 t) 2.0))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = pow(sin(k), 2.0);
double t_2 = cos(k) * l_m;
double tmp;
if (k <= 3e+105) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else {
tmp = (((t_2 / k) * l_m) * 4.0) / (k * ((t_1 * t) * 2.0));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = cos(k) * l_m
if (k <= 3d+105) then
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0d0
else
tmp = (((t_2 / k) * l_m) * 4.0d0) / (k * ((t_1 * t) * 2.0d0))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double t_2 = Math.cos(k) * l_m;
double tmp;
if (k <= 3e+105) {
tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0;
} else {
tmp = (((t_2 / k) * l_m) * 4.0) / (k * ((t_1 * t) * 2.0));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.pow(math.sin(k), 2.0) t_2 = math.cos(k) * l_m tmp = 0 if k <= 3e+105: tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0 else: tmp = (((t_2 / k) * l_m) * 4.0) / (k * ((t_1 * 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 (k <= 3e+105) tmp = Float64(Float64(Float64(t_2 / Float64(Float64(k * k) * t)) * Float64(l_m / t_1)) * 2.0); else tmp = Float64(Float64(Float64(Float64(t_2 / k) * l_m) * 4.0) / Float64(k * Float64(Float64(t_1 * t) * 2.0))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = sin(k) ^ 2.0; t_2 = cos(k) * l_m; tmp = 0.0; if (k <= 3e+105) tmp = ((t_2 / ((k * k) * t)) * (l_m / t_1)) * 2.0; else tmp = (((t_2 / k) * l_m) * 4.0) / (k * ((t_1 * t) * 2.0)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[k, 3e+105], 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], N[(N[(N[(N[(t$95$2 / k), $MachinePrecision] * l$95$m), $MachinePrecision] * 4.0), $MachinePrecision] / N[(k * N[(N[(t$95$1 * t), $MachinePrecision] * 2.0), $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}\;k \leq 3 \cdot 10^{+105}:\\
\;\;\;\;\left(\frac{t\_2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{t\_1}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{t\_2}{k} \cdot l\_m\right) \cdot 4}{k \cdot \left(\left(t\_1 \cdot t\right) \cdot 2\right)}\\
\end{array}
\end{array}
if k < 3.0000000000000001e105Initial program 38.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.9
Applied rewrites78.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
Applied rewrites90.5%
if 3.0000000000000001e105 < k Initial program 29.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.f6465.4
Applied rewrites65.4%
Applied rewrites94.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-/l*N/A
associate-*r/N/A
frac-timesN/A
Applied rewrites94.6%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)))
(if (<= k 1.5e+88)
(* (* (/ t_1 (* (* k k) t)) (/ l_m (pow (sin k) 2.0))) 2.0)
(/
(* (* (/ t_1 k) (/ l_m k)) 4.0)
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t) 2.0)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double tmp;
if (k <= 1.5e+88) {
tmp = ((t_1 / ((k * k) * t)) * (l_m / pow(sin(k), 2.0))) * 2.0;
} else {
tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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
if (k <= 1.5d+88) then
tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ** 2.0d0))) * 2.0d0
else
tmp = (((t_1 / k) * (l_m / k)) * 4.0d0) / (((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * 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 tmp;
if (k <= 1.5e+88) {
tmp = ((t_1 / ((k * k) * t)) * (l_m / Math.pow(Math.sin(k), 2.0))) * 2.0;
} else {
tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * Math.cos((2.0 * k)))) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m tmp = 0 if k <= 1.5e+88: tmp = ((t_1 / ((k * k) * t)) * (l_m / math.pow(math.sin(k), 2.0))) * 2.0 else: tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * math.cos((2.0 * k)))) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) tmp = 0.0 if (k <= 1.5e+88) tmp = Float64(Float64(Float64(t_1 / Float64(Float64(k * k) * t)) * Float64(l_m / (sin(k) ^ 2.0))) * 2.0); else tmp = Float64(Float64(Float64(Float64(t_1 / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * 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; tmp = 0.0; if (k <= 1.5e+88) tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ^ 2.0))) * 2.0; else tmp = (((t_1 / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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]}, If[LessEqual[k, 1.5e+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[(N[(N[(N[(t$95$1 / k), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $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\\
\mathbf{if}\;k \leq 1.5 \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{\left(\frac{t\_1}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 1.50000000000000003e88Initial 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.f6478.9
Applied rewrites78.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
Applied rewrites90.7%
if 1.50000000000000003e88 < k Initial program 26.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.f6467.1
Applied rewrites67.1%
Applied rewrites92.9%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2.7e-77)
(/ (* (pow (/ l_m k) 2.0) 2.0) (* (* k t) k))
(if (<= k 0.00095)
(/ 2.0 (* (/ (pow k 4.0) l_m) (/ t l_m)))
(/
(* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0)
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t) 2.0)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2.7e-77) {
tmp = (pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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 <= 2.7d-77) then
tmp = (((l_m / k) ** 2.0d0) * 2.0d0) / ((k * t) * k)
else if (k <= 0.00095d0) then
tmp = 2.0d0 / (((k ** 4.0d0) / l_m) * (t / l_m))
else
tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * 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 <= 2.7e-77) {
tmp = (Math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * Math.cos((2.0 * k)))) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2.7e-77: tmp = (math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k) elif k <= 0.00095: tmp = 2.0 / ((math.pow(k, 4.0) / l_m) * (t / l_m)) else: tmp = ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * math.cos((2.0 * k)))) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2.7e-77) tmp = Float64(Float64((Float64(l_m / k) ^ 2.0) * 2.0) / Float64(Float64(k * t) * k)); elseif (k <= 0.00095) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l_m) * Float64(t / l_m))); else tmp = Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2.7e-77) tmp = (((l_m / k) ^ 2.0) * 2.0) / ((k * t) * k); elseif (k <= 0.00095) tmp = 2.0 / (((k ^ 4.0) / l_m) * (t / l_m)); else tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * t) * 2.0); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2.7e-77], N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.00095], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k}\\
\mathbf{elif}\;k \leq 0.00095:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{l\_m} \cdot \frac{t}{l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\cos k \cdot l\_m}{k} \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Applied rewrites91.5%
Applied rewrites80.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6479.1
Applied rewrites79.1%
if 2.7e-77 < k < 9.49999999999999998e-4Initial program 25.4%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
if 9.49999999999999998e-4 < k Initial program 28.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.f6475.0
Applied rewrites75.0%
Applied rewrites89.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-*.f6489.3
Applied rewrites89.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2.7e-77)
(/ (* (pow (/ l_m k) 2.0) 2.0) (* (* k t) k))
(if (<= k 0.00095)
(/ 2.0 (* (/ (pow k 4.0) l_m) (/ t l_m)))
(/
(* (* (* (cos k) (/ l_m k)) (/ l_m k)) 4.0)
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t) 2.0)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2.7e-77) {
tmp = (pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = (((cos(k) * (l_m / k)) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * 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 <= 2.7d-77) then
tmp = (((l_m / k) ** 2.0d0) * 2.0d0) / ((k * t) * k)
else if (k <= 0.00095d0) then
tmp = 2.0d0 / (((k ** 4.0d0) / l_m) * (t / l_m))
else
tmp = (((cos(k) * (l_m / k)) * (l_m / k)) * 4.0d0) / (((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * 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 <= 2.7e-77) {
tmp = (Math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = (((Math.cos(k) * (l_m / k)) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * Math.cos((2.0 * k)))) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2.7e-77: tmp = (math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k) elif k <= 0.00095: tmp = 2.0 / ((math.pow(k, 4.0) / l_m) * (t / l_m)) else: tmp = (((math.cos(k) * (l_m / k)) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * math.cos((2.0 * k)))) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2.7e-77) tmp = Float64(Float64((Float64(l_m / k) ^ 2.0) * 2.0) / Float64(Float64(k * t) * k)); elseif (k <= 0.00095) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l_m) * Float64(t / l_m))); else tmp = Float64(Float64(Float64(Float64(cos(k) * Float64(l_m / k)) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2.7e-77) tmp = (((l_m / k) ^ 2.0) * 2.0) / ((k * t) * k); elseif (k <= 0.00095) tmp = 2.0 / (((k ^ 4.0) / l_m) * (t / l_m)); else tmp = (((cos(k) * (l_m / k)) * (l_m / k)) * 4.0) / (((0.5 - (0.5 * cos((2.0 * k)))) * t) * 2.0); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2.7e-77], N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.00095], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k}\\
\mathbf{elif}\;k \leq 0.00095:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{l\_m} \cdot \frac{t}{l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\cos k \cdot \frac{l\_m}{k}\right) \cdot \frac{l\_m}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Applied rewrites91.5%
Applied rewrites80.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6479.1
Applied rewrites79.1%
if 2.7e-77 < k < 9.49999999999999998e-4Initial program 25.4%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
if 9.49999999999999998e-4 < k Initial program 28.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.f6475.0
Applied rewrites75.0%
Applied rewrites89.8%
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f6489.8
Applied rewrites89.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-*.f6489.2
Applied rewrites89.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (* k t) k)))
(if (<= k 2.7e-77)
(/ (* (pow (/ l_m k) 2.0) 2.0) t_1)
(if (<= k 0.00095)
(/ 2.0 (* (/ (pow k 4.0) l_m) (/ t l_m)))
(/
(* 2.0 (/ (* (* (cos k) l_m) l_m) (- 0.5 (* 0.5 (cos (* 2.0 k))))))
t_1)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = (k * t) * k;
double tmp;
if (k <= 2.7e-77) {
tmp = (pow((l_m / k), 2.0) * 2.0) / t_1;
} else if (k <= 0.00095) {
tmp = 2.0 / ((pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = (2.0 * (((cos(k) * l_m) * l_m) / (0.5 - (0.5 * cos((2.0 * k)))))) / t_1;
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k * t) * k
if (k <= 2.7d-77) then
tmp = (((l_m / k) ** 2.0d0) * 2.0d0) / t_1
else if (k <= 0.00095d0) then
tmp = 2.0d0 / (((k ** 4.0d0) / l_m) * (t / l_m))
else
tmp = (2.0d0 * (((cos(k) * l_m) * l_m) / (0.5d0 - (0.5d0 * cos((2.0d0 * k)))))) / t_1
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = (k * t) * k;
double tmp;
if (k <= 2.7e-77) {
tmp = (Math.pow((l_m / k), 2.0) * 2.0) / t_1;
} else if (k <= 0.00095) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l_m) * (t / l_m));
} else {
tmp = (2.0 * (((Math.cos(k) * l_m) * l_m) / (0.5 - (0.5 * Math.cos((2.0 * k)))))) / t_1;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = (k * t) * k tmp = 0 if k <= 2.7e-77: tmp = (math.pow((l_m / k), 2.0) * 2.0) / t_1 elif k <= 0.00095: tmp = 2.0 / ((math.pow(k, 4.0) / l_m) * (t / l_m)) else: tmp = (2.0 * (((math.cos(k) * l_m) * l_m) / (0.5 - (0.5 * math.cos((2.0 * k)))))) / t_1 return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(Float64(k * t) * k) tmp = 0.0 if (k <= 2.7e-77) tmp = Float64(Float64((Float64(l_m / k) ^ 2.0) * 2.0) / t_1); elseif (k <= 0.00095) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l_m) * Float64(t / l_m))); else tmp = Float64(Float64(2.0 * Float64(Float64(Float64(cos(k) * l_m) * l_m) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))))) / t_1); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = (k * t) * k; tmp = 0.0; if (k <= 2.7e-77) tmp = (((l_m / k) ^ 2.0) * 2.0) / t_1; elseif (k <= 0.00095) tmp = 2.0 / (((k ^ 4.0) / l_m) * (t / l_m)); else tmp = (2.0 * (((cos(k) * l_m) * l_m) / (0.5 - (0.5 * cos((2.0 * k)))))) / t_1; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[k, 2.7e-77], N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[k, 0.00095], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t / l$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * l$95$m), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \left(k \cdot t\right) \cdot k\\
\mathbf{if}\;k \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot 2}{t\_1}\\
\mathbf{elif}\;k \leq 0.00095:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{l\_m} \cdot \frac{t}{l\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \frac{\left(\cos k \cdot l\_m\right) \cdot l\_m}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}}{t\_1}\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Applied rewrites91.5%
Applied rewrites80.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6479.1
Applied rewrites79.1%
if 2.7e-77 < k < 9.49999999999999998e-4Initial program 25.4%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
if 9.49999999999999998e-4 < k Initial program 28.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.f6475.0
Applied rewrites75.0%
Applied rewrites89.8%
Applied rewrites83.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-*.f6483.2
Applied rewrites83.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 2.7e-77)
(/ (* (pow (/ l_m k) 2.0) 2.0) (* (* k t) k))
(if (<= k 0.00095)
(/ 2.0 (* (/ (pow k 4.0) l_m) (/ t l_m)))
(*
(/ 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 <= 2.7e-77) {
tmp = (pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((pow(k, 4.0) / l_m) * (t / l_m));
} 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 <= 2.7d-77) then
tmp = (((l_m / k) ** 2.0d0) * 2.0d0) / ((k * t) * k)
else if (k <= 0.00095d0) then
tmp = 2.0d0 / (((k ** 4.0d0) / l_m) * (t / l_m))
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 <= 2.7e-77) {
tmp = (Math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else if (k <= 0.00095) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l_m) * (t / l_m));
} 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 <= 2.7e-77: tmp = (math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k) elif k <= 0.00095: tmp = 2.0 / ((math.pow(k, 4.0) / l_m) * (t / l_m)) 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 <= 2.7e-77) tmp = Float64(Float64((Float64(l_m / k) ^ 2.0) * 2.0) / Float64(Float64(k * t) * k)); elseif (k <= 0.00095) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l_m) * Float64(t / l_m))); 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(2.0 * k)))))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2.7e-77) tmp = (((l_m / k) ^ 2.0) * 2.0) / ((k * t) * k); elseif (k <= 0.00095) tmp = 2.0 / (((k ^ 4.0) / l_m) * (t / l_m)); 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, 2.7e-77], N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 0.00095], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l$95$m), $MachinePrecision] * N[(t / l$95$m), $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 - 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.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k}\\
\mathbf{elif}\;k \leq 0.00095:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{l\_m} \cdot \frac{t}{l\_m}}\\
\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(2 \cdot k\right)}\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Applied rewrites91.5%
Applied rewrites80.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6479.1
Applied rewrites79.1%
if 2.7e-77 < k < 9.49999999999999998e-4Initial program 25.4%
Taylor expanded in k around 0
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6499.6
Applied rewrites99.6%
if 9.49999999999999998e-4 < k Initial program 28.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.f6475.0
Applied rewrites75.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6483.8
Applied rewrites83.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-*.f6483.1
Applied rewrites83.1%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ (* (* (/ (* (cos k) l_m) k) (/ l_m k)) 4.0) (* (* (* k t) k) 2.0)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
}
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 = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0d0) / (((k * t) * k) * 2.0d0)
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return ((((Math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0);
}
l_m = math.fabs(l) def code(t, l_m, k): return ((((math.cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0)
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(Float64(Float64(Float64(cos(k) * l_m) / k) * Float64(l_m / k)) * 4.0) / Float64(Float64(Float64(k * t) * k) * 2.0)) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = ((((cos(k) * l_m) / k) * (l_m / k)) * 4.0) / (((k * t) * k) * 2.0); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := 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]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\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}
\end{array}
Initial program 37.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.9
Applied rewrites76.9%
Applied rewrites89.7%
Taylor expanded in k around 0
pow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6474.3
Applied rewrites74.3%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 4.4e-30) (/ (* (pow (/ l_m k) 2.0) 2.0) (* (* k t) k)) (* (/ 2.0 (pow k 4.0)) (* l_m (/ l_m t)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.4e-30) {
tmp = (pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else {
tmp = (2.0 / pow(k, 4.0)) * (l_m * (l_m / t));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.4d-30) then
tmp = (((l_m / k) ** 2.0d0) * 2.0d0) / ((k * t) * k)
else
tmp = (2.0d0 / (k ** 4.0d0)) * (l_m * (l_m / t))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.4e-30) {
tmp = (Math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k);
} else {
tmp = (2.0 / Math.pow(k, 4.0)) * (l_m * (l_m / t));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.4e-30: tmp = (math.pow((l_m / k), 2.0) * 2.0) / ((k * t) * k) else: tmp = (2.0 / math.pow(k, 4.0)) * (l_m * (l_m / t)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.4e-30) tmp = Float64(Float64((Float64(l_m / k) ^ 2.0) * 2.0) / Float64(Float64(k * t) * k)); else tmp = Float64(Float64(2.0 / (k ^ 4.0)) * Float64(l_m * Float64(l_m / t))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.4e-30) tmp = (((l_m / k) ^ 2.0) * 2.0) / ((k * t) * k); else tmp = (2.0 / (k ^ 4.0)) * (l_m * (l_m / t)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.4e-30], N[(N[(N[Power[N[(l$95$m / k), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l$95$m * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.4 \cdot 10^{-30}:\\
\;\;\;\;\frac{{\left(\frac{l\_m}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{k}^{4}} \cdot \left(l\_m \cdot \frac{l\_m}{t}\right)\\
\end{array}
\end{array}
if k < 4.39999999999999967e-30Initial 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.5
Applied rewrites78.5%
Applied rewrites90.9%
Applied rewrites80.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6479.2
Applied rewrites79.2%
if 4.39999999999999967e-30 < k Initial program 27.4%
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-*.f6453.8
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6457.8
Applied rewrites57.8%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 4.4e-30) (* (/ 2.0 (* (* k k) t)) (* (/ l_m k) (/ l_m k))) (* (/ 2.0 (pow k 4.0)) (* l_m (/ l_m t)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.4e-30) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = (2.0 / pow(k, 4.0)) * (l_m * (l_m / t));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.4d-30) then
tmp = (2.0d0 / ((k * k) * t)) * ((l_m / k) * (l_m / k))
else
tmp = (2.0d0 / (k ** 4.0d0)) * (l_m * (l_m / t))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.4e-30) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = (2.0 / Math.pow(k, 4.0)) * (l_m * (l_m / t));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.4e-30: tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)) else: tmp = (2.0 / math.pow(k, 4.0)) * (l_m * (l_m / t)) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.4e-30) 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 / (k ^ 4.0)) * Float64(l_m * Float64(l_m / t))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.4e-30) tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)); else tmp = (2.0 / (k ^ 4.0)) * (l_m * (l_m / t)); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.4e-30], 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[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l$95$m * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.4 \cdot 10^{-30}:\\
\;\;\;\;\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}^{4}} \cdot \left(l\_m \cdot \frac{l\_m}{t}\right)\\
\end{array}
\end{array}
if k < 4.39999999999999967e-30Initial 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.5
Applied rewrites78.5%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6477.3
Applied rewrites77.3%
if 4.39999999999999967e-30 < k Initial program 27.4%
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-*.f6453.8
Applied rewrites53.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6457.8
Applied rewrites57.8%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 2.7e-77) (* (/ 2.0 (* (* k k) t)) (* (/ l_m k) (/ l_m k))) (* (* (/ l_m (pow k 4.0)) (/ l_m t)) 2.0)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2.7e-77) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = ((l_m / pow(k, 4.0)) * (l_m / 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 <= 2.7d-77) then
tmp = (2.0d0 / ((k * k) * t)) * ((l_m / k) * (l_m / k))
else
tmp = ((l_m / (k ** 4.0d0)) * (l_m / 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 <= 2.7e-77) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = ((l_m / Math.pow(k, 4.0)) * (l_m / t)) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2.7e-77: tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)) else: tmp = ((l_m / math.pow(k, 4.0)) * (l_m / t)) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2.7e-77) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m / k) * Float64(l_m / k))); else tmp = Float64(Float64(Float64(l_m / (k ^ 4.0)) * Float64(l_m / t)) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2.7e-77) tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)); else tmp = ((l_m / (k ^ 4.0)) * (l_m / t)) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2.7e-77], 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[(N[(l$95$m / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{l\_m}{{k}^{4}} \cdot \frac{l\_m}{t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6477.1
Applied rewrites77.1%
if 2.7e-77 < k Initial program 27.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-*.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6460.9
Applied rewrites60.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= k 2.7e-77) (* (/ 2.0 (* (* k k) t)) (* (/ l_m k) (/ l_m k))) (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 2.7e-77) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / 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 <= 2.7d-77) then
tmp = (2.0d0 / ((k * k) * t)) * ((l_m / k) * (l_m / k))
else
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / 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 <= 2.7e-77) {
tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k));
} else {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 2.7e-77: tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)) else: tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0 return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 2.7e-77) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l_m / k) * Float64(l_m / k))); else tmp = Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 2.7e-77) tmp = (2.0 / ((k * k) * t)) * ((l_m / k) * (l_m / k)); else tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0; end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 2.7e-77], 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[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.7 \cdot 10^{-77}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{l\_m}{k} \cdot \frac{l\_m}{k}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 2.7e-77Initial program 41.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6478.3
Applied rewrites78.3%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6477.1
Applied rewrites77.1%
if 2.7e-77 < k Initial program 27.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-*.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6460.9
Applied rewrites60.9%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6460.9
Applied rewrites60.9%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 1.9e-169) (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0) (/ (* (/ (* l_m l_m) (* k k)) 4.0) (* (* (* k k) t) 2.0))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (l_m <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} else {
tmp = (((l_m * l_m) / (k * k)) * 4.0) / (((k * k) * 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 (l_m <= 1.9d-169) then
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0d0
else
tmp = (((l_m * l_m) / (k * k)) * 4.0d0) / (((k * k) * 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 (l_m <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} else {
tmp = (((l_m * l_m) / (k * k)) * 4.0) / (((k * k) * t) * 2.0);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if l_m <= 1.9e-169: tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0 else: tmp = (((l_m * l_m) / (k * k)) * 4.0) / (((k * k) * t) * 2.0) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (l_m <= 1.9e-169) tmp = Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0); else tmp = Float64(Float64(Float64(Float64(l_m * l_m) / Float64(k * k)) * 4.0) / Float64(Float64(Float64(k * k) * t) * 2.0)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (l_m <= 1.9e-169) tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0; else tmp = (((l_m * l_m) / (k * k)) * 4.0) / (((k * k) * t) * 2.0); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[l$95$m, 1.9e-169], N[(N[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.9 \cdot 10^{-169}:\\
\;\;\;\;\left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{l\_m \cdot l\_m}{k \cdot k} \cdot 4}{\left(\left(k \cdot k\right) \cdot t\right) \cdot 2}\\
\end{array}
\end{array}
if l < 1.9e-169Initial program 35.3%
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-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6471.0
Applied rewrites71.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.9
Applied rewrites70.9%
if 1.9e-169 < l Initial program 40.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.f6482.9
Applied rewrites82.9%
Applied rewrites92.0%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in k around 0
pow2N/A
lift-*.f6467.6
Applied rewrites67.6%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 1.9e-169) (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0) (* (/ 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 <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} 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 <= 1.9d-169) then
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0d0
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 <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} 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 <= 1.9e-169: tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0 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 (l_m <= 1.9e-169) tmp = Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0); else tmp = Float64(Float64(2.0 / Float64(Float64(k * 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 <= 1.9e-169) tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0; 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[l$95$m, 1.9e-169], N[(N[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l$95$m * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.9 \cdot 10^{-169}:\\
\;\;\;\;\left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m \cdot l\_m}{k \cdot k}\\
\end{array}
\end{array}
if l < 1.9e-169Initial program 35.3%
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-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6471.0
Applied rewrites71.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.9
Applied rewrites70.9%
if 1.9e-169 < l Initial program 40.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.f6482.9
Applied rewrites82.9%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites38.0%
Taylor expanded in k around 0
pow2N/A
lift-*.f6467.6
Applied rewrites67.6%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 1.9e-169) (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0) (* (/ 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 <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} 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 <= 1.9d-169) then
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0d0
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 <= 1.9e-169) {
tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
} 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 <= 1.9e-169: tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0 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 (l_m <= 1.9e-169) tmp = Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0); 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 <= 1.9e-169) tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0; 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[l$95$m, 1.9e-169], N[(N[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $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 \leq 1.9 \cdot 10^{-169}:\\
\;\;\;\;\left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2\\
\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 l < 1.9e-169Initial program 35.3%
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-*.f6460.2
Applied rewrites60.2%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6471.0
Applied rewrites71.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6470.9
Applied rewrites70.9%
if 1.9e-169 < l Initial program 40.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.f6482.9
Applied rewrites82.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6487.8
Applied rewrites87.8%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lower-*.f6467.6
Applied rewrites67.6%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0d0
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
}
l_m = math.fabs(l) def code(t, l_m, k): return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2
\end{array}
Initial program 37.2%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6461.6
Applied rewrites61.6%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
frac-timesN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-pow.f64N/A
lower-/.f6468.2
Applied rewrites68.2%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6468.2
Applied rewrites68.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(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 37.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.8
Applied rewrites20.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6420.8
Applied rewrites20.8%
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 37.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.8
Applied rewrites20.8%
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 37.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.8
Applied rewrites20.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f6419.4
Applied rewrites19.4%
herbie shell --seed 2025051
(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))))