
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Herbie found 23 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}
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.45e+94)
(/
2.0
(*
(/
(/ (fma (pow (* (sin k_m) t) 2.0) 2.0 (pow (* (sin k_m) k_m) 2.0)) l)
(cos k_m))
(/ t l)))
(*
(/ l k_m)
(* (/ l k_m) (/ (* (/ (cos k_m) t) 2.0) (pow (sin k_m) 2.0))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 1.45e+94) {
tmp = 2.0 / (((fma(pow((sin(k_m) * t), 2.0), 2.0, pow((sin(k_m) * k_m), 2.0)) / l) / cos(k_m)) * (t / l));
} else {
tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0) / pow(sin(k_m), 2.0)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 1.45e+94) tmp = Float64(2.0 / Float64(Float64(Float64(fma((Float64(sin(k_m) * t) ^ 2.0), 2.0, (Float64(sin(k_m) * k_m) ^ 2.0)) / l) / cos(k_m)) * Float64(t / l))); else tmp = Float64(Float64(l / k_m) * Float64(Float64(l / k_m) * Float64(Float64(Float64(cos(k_m) / t) * 2.0) / (sin(k_m) ^ 2.0)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.45e+94], N[(2.0 / N[(N[(N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] * 2.0), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.45 \cdot 10^{+94}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\ell}}{\cos k\_m} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\frac{\cos k\_m}{t} \cdot 2}{{\sin k\_m}^{2}}\right)\\
\end{array}
\end{array}
if k < 1.4499999999999999e94Initial program 59.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.6%
Applied rewrites77.5%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites91.1%
lift-/.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lift-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
Applied rewrites91.1%
if 1.4499999999999999e94 < k Initial program 46.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.7%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites88.3%
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
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
Applied rewrites94.3%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k_m)) (tan k_m))
(+ (+ 1.0 (pow (/ k_m t) 2.0)) 1.0)))
5e+252)
(/ (* l l) (* k_m (* k_m (pow t 3.0))))
(* (* (/ l k_m) (/ l k_m)) (/ 2.0 (* (* k_m k_m) t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t), 2.0)) + 1.0))) <= 5e+252) {
tmp = (l * l) / (k_m * (k_m * pow(t, 3.0)));
} else {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k_m)) * tan(k_m)) * ((1.0d0 + ((k_m / t) ** 2.0d0)) + 1.0d0))) <= 5d+252) then
tmp = (l * l) / (k_m * (k_m * (t ** 3.0d0)))
else
tmp = ((l / k_m) * (l / k_m)) * (2.0d0 / ((k_m * k_m) * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if ((2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k_m)) * Math.tan(k_m)) * ((1.0 + Math.pow((k_m / t), 2.0)) + 1.0))) <= 5e+252) {
tmp = (l * l) / (k_m * (k_m * Math.pow(t, 3.0)));
} else {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if (2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k_m)) * math.tan(k_m)) * ((1.0 + math.pow((k_m / t), 2.0)) + 1.0))) <= 5e+252: tmp = (l * l) / (k_m * (k_m * math.pow(t, 3.0))) else: tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k_m)) * tan(k_m)) * Float64(Float64(1.0 + (Float64(k_m / t) ^ 2.0)) + 1.0))) <= 5e+252) tmp = Float64(Float64(l * l) / Float64(k_m * Float64(k_m * (t ^ 3.0)))); else tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t) ^ 2.0)) + 1.0))) <= 5e+252) tmp = (l * l) / (k_m * (k_m * (t ^ 3.0))); else tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k$95$m / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+252], N[(N[(l * l), $MachinePrecision] / N[(k$95$m * N[(k$95$m * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot \left(\left(1 + {\left(\frac{k\_m}{t}\right)}^{2}\right) + 1\right)} \leq 5 \cdot 10^{+252}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m \cdot \left(k\_m \cdot {t}^{3}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) < 4.9999999999999997e252Initial program 81.7%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6469.6
Applied rewrites69.6%
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f6476.0
Applied rewrites76.0%
if 4.9999999999999997e252 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites55.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites76.5%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6451.8
Applied rewrites51.8%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.35e+93)
(/
2.0
(*
(/
(fma (pow (* (sin k_m) t) 2.0) 2.0 (pow (* (sin k_m) k_m) 2.0))
(* (cos k_m) l))
(/ t l)))
(*
(/ l k_m)
(* (/ l k_m) (/ (* (/ (cos k_m) t) 2.0) (pow (sin k_m) 2.0))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 1.35e+93) {
tmp = 2.0 / ((fma(pow((sin(k_m) * t), 2.0), 2.0, pow((sin(k_m) * k_m), 2.0)) / (cos(k_m) * l)) * (t / l));
} else {
tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0) / pow(sin(k_m), 2.0)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 1.35e+93) tmp = Float64(2.0 / Float64(Float64(fma((Float64(sin(k_m) * t) ^ 2.0), 2.0, (Float64(sin(k_m) * k_m) ^ 2.0)) / Float64(cos(k_m) * l)) * Float64(t / l))); else tmp = Float64(Float64(l / k_m) * Float64(Float64(l / k_m) * Float64(Float64(Float64(cos(k_m) / t) * 2.0) / (sin(k_m) ^ 2.0)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.35e+93], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] * 2.0), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.35 \cdot 10^{+93}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\cos k\_m \cdot \ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\frac{\cos k\_m}{t} \cdot 2}{{\sin k\_m}^{2}}\right)\\
\end{array}
\end{array}
if k < 1.35e93Initial program 59.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.6%
Applied rewrites77.5%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites91.0%
if 1.35e93 < k Initial program 46.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites88.3%
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
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
Applied rewrites94.2%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 0.046)
(/
2.0
(*
(/ (fma (pow (* (sin k_m) t) 2.0) 2.0 (pow k_m 4.0)) (* (cos k_m) l))
(/ t l)))
(*
(/ l k_m)
(* (/ l k_m) (/ (* (/ (cos k_m) t) 2.0) (pow (sin k_m) 2.0))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 0.046) {
tmp = 2.0 / ((fma(pow((sin(k_m) * t), 2.0), 2.0, pow(k_m, 4.0)) / (cos(k_m) * l)) * (t / l));
} else {
tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0) / pow(sin(k_m), 2.0)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 0.046) tmp = Float64(2.0 / Float64(Float64(fma((Float64(sin(k_m) * t) ^ 2.0), 2.0, (k_m ^ 4.0)) / Float64(cos(k_m) * l)) * Float64(t / l))); else tmp = Float64(Float64(l / k_m) * Float64(Float64(l / k_m) * Float64(Float64(Float64(cos(k_m) / t) * 2.0) / (sin(k_m) ^ 2.0)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 0.046], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] * 2.0), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 0.046:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {k\_m}^{4}\right)}{\cos k\_m \cdot \ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\frac{\cos k\_m}{t} \cdot 2}{{\sin k\_m}^{2}}\right)\\
\end{array}
\end{array}
if k < 0.045999999999999999Initial program 62.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Applied rewrites75.4%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites90.4%
Taylor expanded in k around 0
lower-pow.f6490.3
Applied rewrites90.3%
if 0.045999999999999999 < k Initial program 48.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites83.8%
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
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
Applied rewrites89.6%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 6.2e-34)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))
(*
(/ l k_m)
(* (/ l k_m) (/ (* (/ (cos k_m) t) 2.0) (pow (sin k_m) 2.0))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0) / pow(sin(k_m), 2.0)));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 6.2d-34) then
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
else
tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0d0) / (sin(k_m) ** 2.0d0)))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = (l / k_m) * ((l / k_m) * (((Math.cos(k_m) / t) * 2.0) / Math.pow(Math.sin(k_m), 2.0)));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 6.2e-34: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) else: tmp = (l / k_m) * ((l / k_m) * (((math.cos(k_m) / t) * 2.0) / math.pow(math.sin(k_m), 2.0))) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 6.2e-34) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); else tmp = Float64(Float64(l / k_m) * Float64(Float64(l / k_m) * Float64(Float64(Float64(cos(k_m) / t) * 2.0) / (sin(k_m) ^ 2.0)))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 6.2e-34) tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); else tmp = (l / k_m) * ((l / k_m) * (((cos(k_m) / t) * 2.0) / (sin(k_m) ^ 2.0))); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.2e-34], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] * 2.0), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\frac{\cos k\_m}{t} \cdot 2}{{\sin k\_m}^{2}}\right)\\
\end{array}
\end{array}
if k < 6.1999999999999996e-34Initial program 62.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.7%
Applied rewrites74.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites89.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if 6.1999999999999996e-34 < k Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites81.5%
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
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
Applied rewrites87.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 3.1e-87)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))
(if (<= k_m 1.1e+93)
(/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (cos k_m) l)) (/ t l)))
(*
(* (/ l k_m) (/ l k_m))
(* (/ (/ (cos k_m) t) (- 0.5 (* (cos (* k_m 2.0)) 0.5))) 2.0)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 3.1e-87) {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else if (k_m <= 1.1e+93) {
tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / (cos(k_m) * l)) * (t / l));
} else {
tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5 - (cos((k_m * 2.0)) * 0.5))) * 2.0);
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 3.1d-87) then
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
else if (k_m <= 1.1d+93) then
tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / (cos(k_m) * l)) * (t / l))
else
tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5d0 - (cos((k_m * 2.0d0)) * 0.5d0))) * 2.0d0)
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 3.1e-87) {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else if (k_m <= 1.1e+93) {
tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / (Math.cos(k_m) * l)) * (t / l));
} else {
tmp = ((l / k_m) * (l / k_m)) * (((Math.cos(k_m) / t) / (0.5 - (Math.cos((k_m * 2.0)) * 0.5))) * 2.0);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 3.1e-87: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) elif k_m <= 1.1e+93: tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / (math.cos(k_m) * l)) * (t / l)) else: tmp = ((l / k_m) * (l / k_m)) * (((math.cos(k_m) / t) / (0.5 - (math.cos((k_m * 2.0)) * 0.5))) * 2.0) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 3.1e-87) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); elseif (k_m <= 1.1e+93) tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(cos(k_m) * l)) * Float64(t / l))); else tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(Float64(Float64(cos(k_m) / t) / Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) * 0.5))) * 2.0)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 3.1e-87) tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); elseif (k_m <= 1.1e+93) tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / (cos(k_m) * l)) * (t / l)); else tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5 - (cos((k_m * 2.0)) * 0.5))) * 2.0); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 3.1e-87], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.1e+93], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] / N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 3.1 \cdot 10^{-87}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\mathbf{elif}\;k\_m \leq 1.1 \cdot 10^{+93}:\\
\;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m \cdot \ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \left(\frac{\frac{\cos k\_m}{t}}{0.5 - \cos \left(k\_m \cdot 2\right) \cdot 0.5} \cdot 2\right)\\
\end{array}
\end{array}
if k < 3.09999999999999998e-87Initial program 63.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.0%
Applied rewrites75.1%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites88.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6488.2
Applied rewrites88.2%
if 3.09999999999999998e-87 < k < 1.10000000000000011e93Initial program 55.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.7%
Applied rewrites80.4%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites94.4%
Taylor expanded in t around 0
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6470.3
Applied rewrites70.3%
if 1.10000000000000011e93 < k Initial program 46.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites88.3%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6488.1
Applied rewrites88.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 6.2e-34)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))
(*
(/ (* (* (/ l k_m) (/ l k_m)) (cos k_m)) (* (pow (sin k_m) 2.0) t))
2.0)))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / (pow(sin(k_m), 2.0) * t)) * 2.0;
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 6.2d-34) then
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
else
tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / ((sin(k_m) ** 2.0d0) * t)) * 2.0d0
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = ((((l / k_m) * (l / k_m)) * Math.cos(k_m)) / (Math.pow(Math.sin(k_m), 2.0) * t)) * 2.0;
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 6.2e-34: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) else: tmp = ((((l / k_m) * (l / k_m)) * math.cos(k_m)) / (math.pow(math.sin(k_m), 2.0) * t)) * 2.0 return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 6.2e-34) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); else tmp = Float64(Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * cos(k_m)) / Float64((sin(k_m) ^ 2.0) * t)) * 2.0); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 6.2e-34) tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); else tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / ((sin(k_m) ^ 2.0) * t)) * 2.0; end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.2e-34], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \cos k\_m}{{\sin k\_m}^{2} \cdot t} \cdot 2\\
\end{array}
\end{array}
if k < 6.1999999999999996e-34Initial program 62.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.7%
Applied rewrites74.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites89.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if 6.1999999999999996e-34 < k Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
Applied rewrites81.6%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 6.2e-34)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))
(*
(* (* (/ l k_m) (/ l k_m)) (/ (cos k_m) (* (pow (sin k_m) 2.0) t)))
2.0)))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / (pow(sin(k_m), 2.0) * t))) * 2.0;
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 6.2d-34) then
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
else
tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ** 2.0d0) * t))) * 2.0d0
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 6.2e-34) {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = (((l / k_m) * (l / k_m)) * (Math.cos(k_m) / (Math.pow(Math.sin(k_m), 2.0) * t))) * 2.0;
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 6.2e-34: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) else: tmp = (((l / k_m) * (l / k_m)) * (math.cos(k_m) / (math.pow(math.sin(k_m), 2.0) * t))) * 2.0 return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 6.2e-34) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); else tmp = Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(cos(k_m) / Float64((sin(k_m) ^ 2.0) * t))) * 2.0); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 6.2e-34) tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); else tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ^ 2.0) * t))) * 2.0; end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.2e-34], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{\cos k\_m}{{\sin k\_m}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 6.1999999999999996e-34Initial program 62.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites76.7%
Applied rewrites74.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites89.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if 6.1999999999999996e-34 < k Initial program 49.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6481.5
Applied rewrites81.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 0.0135)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))
(*
(* (/ l k_m) (/ l k_m))
(* (/ (/ (cos k_m) t) (- 0.5 (* (cos (* k_m 2.0)) 0.5))) 2.0))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 0.0135) {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5 - (cos((k_m * 2.0)) * 0.5))) * 2.0);
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 0.0135d0) then
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
else
tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5d0 - (cos((k_m * 2.0d0)) * 0.5d0))) * 2.0d0)
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 0.0135) {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
} else {
tmp = ((l / k_m) * (l / k_m)) * (((Math.cos(k_m) / t) / (0.5 - (Math.cos((k_m * 2.0)) * 0.5))) * 2.0);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 0.0135: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) else: tmp = ((l / k_m) * (l / k_m)) * (((math.cos(k_m) / t) / (0.5 - (math.cos((k_m * 2.0)) * 0.5))) * 2.0) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 0.0135) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); else tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(Float64(Float64(cos(k_m) / t) / Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) * 0.5))) * 2.0)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 0.0135) tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); else tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (0.5 - (cos((k_m * 2.0)) * 0.5))) * 2.0); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 0.0135], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] / N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 0.0135:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \left(\frac{\frac{\cos k\_m}{t}}{0.5 - \cos \left(k\_m \cdot 2\right) \cdot 0.5} \cdot 2\right)\\
\end{array}
\end{array}
if k < 0.0134999999999999998Initial program 62.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Applied rewrites75.4%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites90.4%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6485.2
Applied rewrites85.2%
if 0.0134999999999999998 < k Initial program 48.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites83.7%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f6483.5
Applied rewrites83.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (cos k_m) l)))
(if (<= t 1.02e-50)
(/
2.0
(*
(/
(*
(fma
(fma -0.6666666666666666 (* t t) 1.0)
(* k_m k_m)
(* (* t t) 2.0))
(* k_m k_m))
t_1)
(/ t l)))
(if (<= t 3.1e+37)
(*
(*
(/ (* l l) (* k_m k_m))
(/ (cos k_m) (* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) t)))
2.0)
(/ 2.0 (* (/ (* (pow (* k_m t) 2.0) 2.0) t_1) (/ t l)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = cos(k_m) * l;
double tmp;
if (t <= 1.02e-50) {
tmp = 2.0 / (((fma(fma(-0.6666666666666666, (t * t), 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / t_1) * (t / l));
} else if (t <= 3.1e+37) {
tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * t))) * 2.0;
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) * 2.0) / t_1) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(cos(k_m) * l) tmp = 0.0 if (t <= 1.02e-50) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(-0.6666666666666666, Float64(t * t), 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / t_1) * Float64(t / l))); elseif (t <= 3.1e+37) tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(cos(k_m) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) * t))) * 2.0); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) * 2.0) / t_1) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t, 1.02e-50], N[(2.0 / N[(N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+37], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \cos k\_m \cdot \ell\\
\mathbf{if}\;t \leq 1.02 \cdot 10^{-50}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{t\_1} \cdot \frac{t}{\ell}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+37}:\\
\;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right) \cdot t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\right)}^{2} \cdot 2}{t\_1} \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 1.0199999999999999e-50Initial program 49.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.2%
Applied rewrites72.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites82.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6455.4
Applied rewrites55.4%
if 1.0199999999999999e-50 < t < 3.1000000000000002e37Initial program 76.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.6%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6462.4
Applied rewrites62.4%
if 3.1000000000000002e37 < t Initial program 65.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites88.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6483.7
Applied rewrites83.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (cos k_m) l)))
(if (<= t 1.02e-50)
(/
2.0
(*
(/
(*
(fma
(fma -0.6666666666666666 (* t t) 1.0)
(* k_m k_m)
(* (* t t) 2.0))
(* k_m k_m))
t_1)
(/ t l)))
(if (<= t 3e+37)
(/
(* 2.0 (* t_1 l))
(* (* (* k_m k_m) t) (- 0.5 (* (cos (* k_m 2.0)) 0.5))))
(/ 2.0 (* (/ (* (pow (* k_m t) 2.0) 2.0) t_1) (/ t l)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = cos(k_m) * l;
double tmp;
if (t <= 1.02e-50) {
tmp = 2.0 / (((fma(fma(-0.6666666666666666, (t * t), 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / t_1) * (t / l));
} else if (t <= 3e+37) {
tmp = (2.0 * (t_1 * l)) / (((k_m * k_m) * t) * (0.5 - (cos((k_m * 2.0)) * 0.5)));
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) * 2.0) / t_1) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(cos(k_m) * l) tmp = 0.0 if (t <= 1.02e-50) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(-0.6666666666666666, Float64(t * t), 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / t_1) * Float64(t / l))); elseif (t <= 3e+37) tmp = Float64(Float64(2.0 * Float64(t_1 * l)) / Float64(Float64(Float64(k_m * k_m) * t) * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) * 0.5)))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) * 2.0) / t_1) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t, 1.02e-50], N[(2.0 / N[(N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+37], N[(N[(2.0 * N[(t$95$1 * l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \cos k\_m \cdot \ell\\
\mathbf{if}\;t \leq 1.02 \cdot 10^{-50}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{t\_1} \cdot \frac{t}{\ell}}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+37}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - \cos \left(k\_m \cdot 2\right) \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(k\_m \cdot t\right)}^{2} \cdot 2}{t\_1} \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 1.0199999999999999e-50Initial program 49.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.2%
Applied rewrites72.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites82.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6455.4
Applied rewrites55.4%
if 1.0199999999999999e-50 < t < 3.00000000000000022e37Initial program 76.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites65.6%
lift-sin.f64N/A
lower-pow.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f6462.6
Applied rewrites62.6%
if 3.00000000000000022e37 < t Initial program 65.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites88.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6483.7
Applied rewrites83.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (cos k_m) l)))
(if (<= t 1.02e-50)
(/
2.0
(*
(/
(*
(fma
(fma -0.6666666666666666 (* t t) 1.0)
(* k_m k_m)
(* (* t t) 2.0))
(* k_m k_m))
t_1)
(/ t l)))
(if (<= t 3e+37)
(/
(* 2.0 (* t_1 l))
(* (* (* k_m k_m) t) (- 0.5 (* (cos (* k_m 2.0)) 0.5))))
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = cos(k_m) * l;
double tmp;
if (t <= 1.02e-50) {
tmp = 2.0 / (((fma(fma(-0.6666666666666666, (t * t), 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / t_1) * (t / l));
} else if (t <= 3e+37) {
tmp = (2.0 * (t_1 * l)) / (((k_m * k_m) * t) * (0.5 - (cos((k_m * 2.0)) * 0.5)));
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(cos(k_m) * l) tmp = 0.0 if (t <= 1.02e-50) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(-0.6666666666666666, Float64(t * t), 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / t_1) * Float64(t / l))); elseif (t <= 3e+37) tmp = Float64(Float64(2.0 * Float64(t_1 * l)) / Float64(Float64(Float64(k_m * k_m) * t) * Float64(0.5 - Float64(cos(Float64(k_m * 2.0)) * 0.5)))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[t, 1.02e-50], N[(2.0 / N[(N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+37], N[(N[(2.0 * N[(t$95$1 * l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \cos k\_m \cdot \ell\\
\mathbf{if}\;t \leq 1.02 \cdot 10^{-50}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{t\_1} \cdot \frac{t}{\ell}}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+37}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - \cos \left(k\_m \cdot 2\right) \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 1.0199999999999999e-50Initial program 49.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.2%
Applied rewrites72.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites82.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6455.4
Applied rewrites55.4%
if 1.0199999999999999e-50 < t < 3.00000000000000022e37Initial program 76.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites65.6%
lift-sin.f64N/A
lower-pow.f64N/A
unpow2N/A
sqr-sin-a-revN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lower-*.f6462.6
Applied rewrites62.6%
if 3.00000000000000022e37 < t Initial program 65.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites88.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6483.6
Applied rewrites83.6%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 5e-33)
(/
2.0
(*
(/
(*
(fma (fma -0.6666666666666666 (* t t) 1.0) (* k_m k_m) (* (* t t) 2.0))
(* k_m k_m))
(* (cos k_m) l))
(/ t l)))
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 5e-33) {
tmp = 2.0 / (((fma(fma(-0.6666666666666666, (t * t), 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / (cos(k_m) * l)) * (t / l));
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 5e-33) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(-0.6666666666666666, Float64(t * t), 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / Float64(cos(k_m) * l)) * Float64(t / l))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 5e-33], N[(2.0 / N[(N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5 \cdot 10^{-33}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right), k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m \cdot \ell} \cdot \frac{t}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 5.00000000000000028e-33Initial program 50.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.2%
Applied rewrites72.9%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites82.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6455.6
Applied rewrites55.6%
if 5.00000000000000028e-33 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
Applied rewrites75.5%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites87.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6480.5
Applied rewrites80.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 3.5e-42)
(*
(*
(* l (/ l (* k_m k_m)))
(/
(cos k_m)
(*
(*
(fma
(- (* 0.044444444444444446 (* k_m k_m)) 0.3333333333333333)
(* k_m k_m)
1.0)
(* k_m k_m))
t)))
2.0)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 3.5e-42) {
tmp = ((l * (l / (k_m * k_m))) * (cos(k_m) / ((fma(((0.044444444444444446 * (k_m * k_m)) - 0.3333333333333333), (k_m * k_m), 1.0) * (k_m * k_m)) * t))) * 2.0;
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 3.5e-42) tmp = Float64(Float64(Float64(l * Float64(l / Float64(k_m * k_m))) * Float64(cos(k_m) / Float64(Float64(fma(Float64(Float64(0.044444444444444446 * Float64(k_m * k_m)) - 0.3333333333333333), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)) * t))) * 2.0); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 3.5e-42], N[(N[(N[(l * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(N[(N[(N[(0.044444444444444446 * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-42}:\\
\;\;\;\;\left(\left(\ell \cdot \frac{\ell}{k\_m \cdot k\_m}\right) \cdot \frac{\cos k\_m}{\left(\mathsf{fma}\left(0.044444444444444446 \cdot \left(k\_m \cdot k\_m\right) - 0.3333333333333333, k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 3.5000000000000002e-42Initial program 50.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6455.3
Applied rewrites55.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6458.4
Applied rewrites58.4%
if 3.5000000000000002e-42 < t Initial program 67.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.0%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites87.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6480.1
Applied rewrites80.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 3.5e-42)
(*
(/
(pow (/ l k_m) 2.0)
(*
(*
(*
(fma
(- (* (* k_m k_m) 0.044444444444444446) 0.3333333333333333)
(* k_m k_m)
1.0)
k_m)
k_m)
t))
2.0)
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 3.5e-42) {
tmp = (pow((l / k_m), 2.0) / (((fma((((k_m * k_m) * 0.044444444444444446) - 0.3333333333333333), (k_m * k_m), 1.0) * k_m) * k_m) * t)) * 2.0;
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 3.5e-42) tmp = Float64(Float64((Float64(l / k_m) ^ 2.0) / Float64(Float64(Float64(fma(Float64(Float64(Float64(k_m * k_m) * 0.044444444444444446) - 0.3333333333333333), Float64(k_m * k_m), 1.0) * k_m) * k_m) * t)) * 2.0); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 3.5e-42], N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * 0.044444444444444446), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{\left(\left(\mathsf{fma}\left(\left(k\_m \cdot k\_m\right) \cdot 0.044444444444444446 - 0.3333333333333333, k\_m \cdot k\_m, 1\right) \cdot k\_m\right) \cdot k\_m\right) \cdot t} \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 3.5000000000000002e-42Initial program 50.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6455.3
Applied rewrites55.3%
Applied rewrites58.4%
Taylor expanded in k around 0
pow2N/A
pow2N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
pow2N/A
lift-pow.f6457.7
Applied rewrites57.7%
if 3.5000000000000002e-42 < t Initial program 67.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.0%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites87.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6480.1
Applied rewrites80.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (/ l k_m) (/ l k_m))))
(if (<= t 1.35e-42)
(* t_1 (/ 2.0 (* (* k_m k_m) t)))
(if (<= t 1.55e+100)
(/ t_1 (pow t 3.0))
(/ 2.0 (* (* (/ (pow (* k_m t) 2.0) (* l l)) 2.0) t))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (l / k_m) * (l / k_m);
double tmp;
if (t <= 1.35e-42) {
tmp = t_1 * (2.0 / ((k_m * k_m) * t));
} else if (t <= 1.55e+100) {
tmp = t_1 / pow(t, 3.0);
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: t_1
real(8) :: tmp
t_1 = (l / k_m) * (l / k_m)
if (t <= 1.35d-42) then
tmp = t_1 * (2.0d0 / ((k_m * k_m) * t))
else if (t <= 1.55d+100) then
tmp = t_1 / (t ** 3.0d0)
else
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / (l * l)) * 2.0d0) * t)
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double t_1 = (l / k_m) * (l / k_m);
double tmp;
if (t <= 1.35e-42) {
tmp = t_1 * (2.0 / ((k_m * k_m) * t));
} else if (t <= 1.55e+100) {
tmp = t_1 / Math.pow(t, 3.0);
} else {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): t_1 = (l / k_m) * (l / k_m) tmp = 0 if t <= 1.35e-42: tmp = t_1 * (2.0 / ((k_m * k_m) * t)) elif t <= 1.55e+100: tmp = t_1 / math.pow(t, 3.0) else: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / (l * l)) * 2.0) * t) return tmp
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(l / k_m) * Float64(l / k_m)) tmp = 0.0 if (t <= 1.35e-42) tmp = Float64(t_1 * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); elseif (t <= 1.55e+100) tmp = Float64(t_1 / (t ^ 3.0)); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / Float64(l * l)) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) t_1 = (l / k_m) * (l / k_m); tmp = 0.0; if (t <= 1.35e-42) tmp = t_1 * (2.0 / ((k_m * k_m) * t)); elseif (t <= 1.55e+100) tmp = t_1 / (t ^ 3.0); else tmp = 2.0 / (((((k_m * t) ^ 2.0) / (l * l)) * 2.0) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.35e-42], N[(t$95$1 * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+100], N[(t$95$1 / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\\
\mathbf{if}\;t \leq 1.35 \cdot 10^{-42}:\\
\;\;\;\;t\_1 \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+100}:\\
\;\;\;\;\frac{t\_1}{{t}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.35e-42Initial program 50.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites74.3%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6458.5
Applied rewrites58.5%
if 1.35e-42 < t < 1.55000000000000003e100Initial program 76.0%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6463.5
Applied rewrites63.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
lower-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-pow.f6473.1
Applied rewrites73.1%
if 1.55000000000000003e100 < t Initial program 61.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6476.2
Applied rewrites76.2%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 3.5e-42) (* (* (/ l k_m) (/ l k_m)) (/ 2.0 (* (* k_m k_m) t))) (/ 2.0 (* (* (/ (pow (* k_m t) 2.0) l) 2.0) (/ t l)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 3.5e-42) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = 2.0 / (((pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t <= 3.5d-42) then
tmp = ((l / k_m) * (l / k_m)) * (2.0d0 / ((k_m * k_m) * t))
else
tmp = 2.0d0 / (((((k_m * t) ** 2.0d0) / l) * 2.0d0) * (t / l))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (t <= 3.5e-42) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = 2.0 / (((Math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 3.5e-42: tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)) else: tmp = 2.0 / (((math.pow((k_m * t), 2.0) / l) * 2.0) * (t / l)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 3.5e-42) tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) * 2.0) * Float64(t / l))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 3.5e-42) tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)); else tmp = 2.0 / (((((k_m * t) ^ 2.0) / l) * 2.0) * (t / l)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 3.5e-42], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-42}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell} \cdot 2\right) \cdot \frac{t}{\ell}}\\
\end{array}
\end{array}
if t < 3.5000000000000002e-42Initial program 50.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites74.3%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6458.5
Applied rewrites58.5%
if 3.5000000000000002e-42 < t Initial program 67.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.0%
Applied rewrites75.2%
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
times-fracN/A
Applied rewrites87.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6480.1
Applied rewrites80.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (/ l k_m) (/ l k_m))))
(if (<= t 1.35e-42)
(* t_1 (/ 2.0 (* (* k_m k_m) t)))
(if (<= t 1.55e+100)
(/ t_1 (pow t 3.0))
(/ (* l l) (* (pow (* k_m t) 2.0) t))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (l / k_m) * (l / k_m);
double tmp;
if (t <= 1.35e-42) {
tmp = t_1 * (2.0 / ((k_m * k_m) * t));
} else if (t <= 1.55e+100) {
tmp = t_1 / pow(t, 3.0);
} else {
tmp = (l * l) / (pow((k_m * t), 2.0) * t);
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: t_1
real(8) :: tmp
t_1 = (l / k_m) * (l / k_m)
if (t <= 1.35d-42) then
tmp = t_1 * (2.0d0 / ((k_m * k_m) * t))
else if (t <= 1.55d+100) then
tmp = t_1 / (t ** 3.0d0)
else
tmp = (l * l) / (((k_m * t) ** 2.0d0) * t)
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double t_1 = (l / k_m) * (l / k_m);
double tmp;
if (t <= 1.35e-42) {
tmp = t_1 * (2.0 / ((k_m * k_m) * t));
} else if (t <= 1.55e+100) {
tmp = t_1 / Math.pow(t, 3.0);
} else {
tmp = (l * l) / (Math.pow((k_m * t), 2.0) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): t_1 = (l / k_m) * (l / k_m) tmp = 0 if t <= 1.35e-42: tmp = t_1 * (2.0 / ((k_m * k_m) * t)) elif t <= 1.55e+100: tmp = t_1 / math.pow(t, 3.0) else: tmp = (l * l) / (math.pow((k_m * t), 2.0) * t) return tmp
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(l / k_m) * Float64(l / k_m)) tmp = 0.0 if (t <= 1.35e-42) tmp = Float64(t_1 * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); elseif (t <= 1.55e+100) tmp = Float64(t_1 / (t ^ 3.0)); else tmp = Float64(Float64(l * l) / Float64((Float64(k_m * t) ^ 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) t_1 = (l / k_m) * (l / k_m); tmp = 0.0; if (t <= 1.35e-42) tmp = t_1 * (2.0 / ((k_m * k_m) * t)); elseif (t <= 1.55e+100) tmp = t_1 / (t ^ 3.0); else tmp = (l * l) / (((k_m * t) ^ 2.0) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.35e-42], N[(t$95$1 * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.55e+100], N[(t$95$1 / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\\
\mathbf{if}\;t \leq 1.35 \cdot 10^{-42}:\\
\;\;\;\;t\_1 \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+100}:\\
\;\;\;\;\frac{t\_1}{{t}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\
\end{array}
\end{array}
if t < 1.35e-42Initial program 50.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites74.3%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6458.5
Applied rewrites58.5%
if 1.35e-42 < t < 1.55000000000000003e100Initial program 76.0%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6463.5
Applied rewrites63.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
pow2N/A
associate-/r*N/A
pow2N/A
pow2N/A
lower-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-pow.f6473.1
Applied rewrites73.1%
if 1.55000000000000003e100 < t Initial program 61.9%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6454.1
Applied rewrites54.1%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6454.1
Applied rewrites54.1%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6474.9
Applied rewrites74.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 3e+16) (* (* (/ l k_m) (/ l k_m)) (/ 2.0 (* (* k_m k_m) t))) (/ (* l l) (* (pow (* k_m t) 2.0) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 3e+16) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = (l * l) / (pow((k_m * t), 2.0) * t);
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t <= 3d+16) then
tmp = ((l / k_m) * (l / k_m)) * (2.0d0 / ((k_m * k_m) * t))
else
tmp = (l * l) / (((k_m * t) ** 2.0d0) * t)
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (t <= 3e+16) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = (l * l) / (Math.pow((k_m * t), 2.0) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 3e+16: tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)) else: tmp = (l * l) / (math.pow((k_m * t), 2.0) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 3e+16) tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); else tmp = Float64(Float64(l * l) / Float64((Float64(k_m * t) ^ 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 3e+16) tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)); else tmp = (l * l) / (((k_m * t) ^ 2.0) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 3e+16], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{+16}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\
\end{array}
\end{array}
if t < 3e16Initial program 51.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites74.5%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
if 3e16 < t Initial program 65.8%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6457.2
Applied rewrites57.2%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.2
Applied rewrites57.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6473.1
Applied rewrites73.1%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 4.1e+165) (* (* (/ l k_m) (/ l k_m)) (/ 2.0 (* (* k_m k_m) t))) (* l (/ l (* (* k_m k_m) (pow t 3.0))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 4.1e+165) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = l * (l / ((k_m * k_m) * pow(t, 3.0)));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t <= 4.1d+165) then
tmp = ((l / k_m) * (l / k_m)) * (2.0d0 / ((k_m * k_m) * t))
else
tmp = l * (l / ((k_m * k_m) * (t ** 3.0d0)))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (t <= 4.1e+165) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = l * (l / ((k_m * k_m) * Math.pow(t, 3.0)));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 4.1e+165: tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)) else: tmp = l * (l / ((k_m * k_m) * math.pow(t, 3.0))) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 4.1e+165) tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); else tmp = Float64(l * Float64(l / Float64(Float64(k_m * k_m) * (t ^ 3.0)))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 4.1e+165) tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)); else tmp = l * (l / ((k_m * k_m) * (t ^ 3.0))); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 4.1e+165], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(l / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.1 \cdot 10^{+165}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{\ell}{\left(k\_m \cdot k\_m\right) \cdot {t}^{3}}\\
\end{array}
\end{array}
if t < 4.1000000000000003e165Initial program 53.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites72.8%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6457.1
Applied rewrites57.1%
if 4.1000000000000003e165 < t Initial program 66.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6456.9
Applied rewrites56.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f6463.2
Applied rewrites63.2%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 4.1e+165) (* (* (/ l k_m) (/ l k_m)) (/ 2.0 (* (* k_m k_m) t))) (/ (* l l) (* (* k_m k_m) (* (* t t) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 4.1e+165) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t <= 4.1d+165) then
tmp = ((l / k_m) * (l / k_m)) * (2.0d0 / ((k_m * k_m) * t))
else
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (t <= 4.1e+165) {
tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t));
} else {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 4.1e+165: tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)) else: tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 4.1e+165) tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(2.0 / Float64(Float64(k_m * k_m) * t))); else tmp = Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 4.1e+165) tmp = ((l / k_m) * (l / k_m)) * (2.0 / ((k_m * k_m) * t)); else tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 4.1e+165], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.1 \cdot 10^{+165}:\\
\;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
\end{array}
\end{array}
if t < 4.1000000000000003e165Initial program 53.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
Applied rewrites72.8%
Taylor expanded in k around 0
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6457.1
Applied rewrites57.1%
if 4.1000000000000003e165 < t Initial program 66.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6456.9
Applied rewrites56.9%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6456.9
Applied rewrites56.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 2.55e+166) (* (* (/ (* l l) (* k_m k_m)) (/ 1.0 (* (* k_m k_m) t))) 2.0) (/ (* l l) (* (* k_m k_m) (* (* t t) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 2.55e+166) {
tmp = (((l * l) / (k_m * k_m)) * (1.0 / ((k_m * k_m) * t))) * 2.0;
} else {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
}
return tmp;
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (t <= 2.55d+166) then
tmp = (((l * l) / (k_m * k_m)) * (1.0d0 / ((k_m * k_m) * t))) * 2.0d0
else
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (t <= 2.55e+166) {
tmp = (((l * l) / (k_m * k_m)) * (1.0 / ((k_m * k_m) * t))) * 2.0;
} else {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 2.55e+166: tmp = (((l * l) / (k_m * k_m)) * (1.0 / ((k_m * k_m) * t))) * 2.0 else: tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 2.55e+166) tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(1.0 / Float64(Float64(k_m * k_m) * t))) * 2.0); else tmp = Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 2.55e+166) tmp = (((l * l) / (k_m * k_m)) * (1.0 / ((k_m * k_m) * t))) * 2.0; else tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 2.55e+166], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.55 \cdot 10^{+166}:\\
\;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{1}{\left(k\_m \cdot k\_m\right) \cdot t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
\end{array}
\end{array}
if t < 2.55e166Initial program 53.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites61.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6454.8
Applied rewrites54.8%
Taylor expanded in k around 0
Applied rewrites54.0%
Taylor expanded in k around 0
pow2N/A
lift-*.f6455.2
Applied rewrites55.2%
if 2.55e166 < t Initial program 66.3%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6457.1
Applied rewrites57.1%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ (* l l) (* (* k_m k_m) (* (* t t) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return (l * l) / ((k_m * k_m) * ((t * t) * t));
}
k_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, k_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = (l * l) / ((k_m * k_m) * ((t * t) * t))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return (l * l) / ((k_m * k_m) * ((t * t) * t));
}
k_m = math.fabs(k) def code(t, l, k_m): return (l * l) / ((k_m * k_m) * ((t * t) * t))
k_m = abs(k) function code(t, l, k_m) return Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t))) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}
\end{array}
Initial program 55.2%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6451.6
Applied rewrites51.6%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6451.6
Applied rewrites51.6%
herbie shell --seed 2025086
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10+)"
:precision binary64
(/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))