
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.5e+142)
(/
2.0
(/
(*
(/ t l)
(fma (pow (* (sin k_m) t) 2.0) 2.0 (pow (* (sin k_m) k_m) 2.0)))
(* l (cos k_m))))
(* (/ (* (pow (/ l k_m) 2.0) (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 <= 1.5e+142) {
tmp = 2.0 / (((t / l) * fma(pow((sin(k_m) * t), 2.0), 2.0, pow((sin(k_m) * k_m), 2.0))) / (l * cos(k_m)));
} else {
tmp = ((pow((l / k_m), 2.0) * cos(k_m)) / (pow(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 <= 1.5e+142) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) * fma((Float64(sin(k_m) * t) ^ 2.0), 2.0, (Float64(sin(k_m) * k_m) ^ 2.0))) / Float64(l * cos(k_m)))); else tmp = Float64(Float64(Float64((Float64(l / k_m) ^ 2.0) * cos(k_m)) / Float64((sin(k_m) ^ 2.0) * t)) * 2.0); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.5e+142], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] * 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]), $MachinePrecision] / N[(l * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $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 1.5 \cdot 10^{+142}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell} \cdot \mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\ell \cdot \cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2} \cdot \cos k\_m}{{\sin k\_m}^{2} \cdot t} \cdot 2\\
\end{array}
\end{array}
if k < 1.49999999999999987e142Initial program 54.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.9%
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
lift-*.f64N/A
lift-/.f64N/A
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-cos.f64N/A
frac-timesN/A
Applied rewrites85.2%
if 1.49999999999999987e142 < k Initial program 44.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6495.9
Applied rewrites95.9%
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+237)
(/ 2.0 (* (* (/ (* (* k_m t) (* k_m t)) (* l l)) 2.0) t))
(/ 2.0 (* (* (* (pow (/ k_m l) 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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (((pow((k_m / l), 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+237) then
tmp = 2.0d0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0d0) * t)
else
tmp = 2.0d0 / (((((k_m / l) ** 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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (((Math.pow((k_m / l), 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+237: tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t) else: tmp = 2.0 / (((math.pow((k_m / l), 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+237) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * t) * Float64(k_m * t)) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m / l) ^ 2.0) * 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+237) tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t); else tmp = 2.0 / (((((k_m / l) ^ 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+237], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * t), $MachinePrecision] * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $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^{+237}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k\_m \cdot t\right) \cdot \left(k\_m \cdot t\right)}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k\_m}{\ell}\right)}^{2} \cdot k\_m\right) \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)))) < 5.0000000000000002e237Initial program 78.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.4%
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-*.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
if 5.0000000000000002e237 < (/.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 23.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.2%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites48.1%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<=
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k_m)) (tan k_m))
(+ (+ 1.0 (pow (/ k_m t) 2.0)) 1.0))
INFINITY)
(/ 2.0 (* (* (/ (* (* k_m t) (* k_m t)) (* l l)) 2.0) t))
(/ 2.0 (* (* (* (* k_m k_m) (pow (/ t l) 2.0)) 2.0) t))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (((((pow(t, 3.0) / (l * l)) * sin(k_m)) * tan(k_m)) * ((1.0 + pow((k_m / t), 2.0)) + 1.0)) <= ((double) INFINITY)) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / ((((k_m * k_m) * pow((t / l), 2.0)) * 2.0) * t);
}
return tmp;
}
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (((((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)) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / ((((k_m * k_m) * Math.pow((t / l), 2.0)) * 2.0) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if ((((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)) <= math.inf: tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t) else: tmp = 2.0 / ((((k_m * k_m) * math.pow((t / l), 2.0)) * 2.0) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (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)) <= Inf) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * t) * Float64(k_m * t)) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * (Float64(t / l) ^ 2.0)) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if ((((((t ^ 3.0) / (l * l)) * sin(k_m)) * tan(k_m)) * ((1.0 + ((k_m / t) ^ 2.0)) + 1.0)) <= Inf) tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t); else tmp = 2.0 / ((((k_m * k_m) * ((t / l) ^ 2.0)) * 2.0) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[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], Infinity], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * t), $MachinePrecision] * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[Power[N[(t / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;\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 \infty:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k\_m \cdot t\right) \cdot \left(k\_m \cdot t\right)}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(k\_m \cdot k\_m\right) \cdot {\left(\frac{t}{\ell}\right)}^{2}\right) \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if (*.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))) < +inf.0Initial program 81.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.2%
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-*.f6482.6
Applied rewrites82.6%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6482.6
Applied rewrites82.6%
if +inf.0 < (*.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 0.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.1%
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-*.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lift-/.f6437.9
Applied rewrites37.9%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 3.6e-113)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 2.15e+86)
(/
2.0
(*
(/ t (* l l))
(/
(fma (pow (* (sin k_m) t) 2.0) 2.0 (pow (* (sin k_m) k_m) 2.0))
(cos k_m))))
(/ 2.0 (* (pow (/ k_m l) 2.0) (/ (* (pow (sin k_m) 2.0) t) (cos k_m)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 3.6e-113) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 2.15e+86) {
tmp = 2.0 / ((t / (l * l)) * (fma(pow((sin(k_m) * t), 2.0), 2.0, pow((sin(k_m) * k_m), 2.0)) / cos(k_m)));
} else {
tmp = 2.0 / (pow((k_m / l), 2.0) * ((pow(sin(k_m), 2.0) * t) / cos(k_m)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 3.6e-113) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 2.15e+86) tmp = Float64(2.0 / Float64(Float64(t / Float64(l * l)) * Float64(fma((Float64(sin(k_m) * t) ^ 2.0), 2.0, (Float64(sin(k_m) * k_m) ^ 2.0)) / cos(k_m)))); else tmp = Float64(2.0 / Float64((Float64(k_m / l) ^ 2.0) * Float64(Float64((sin(k_m) ^ 2.0) * t) / cos(k_m)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 3.6e-113], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 2.15e+86], N[(2.0 / N[(N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision] * 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[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 3.6 \cdot 10^{-113}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 2.15 \cdot 10^{+86}:\\
\;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \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}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell}\right)}^{2} \cdot \frac{{\sin k\_m}^{2} \cdot t}{\cos k\_m}}\\
\end{array}
\end{array}
if k < 3.59999999999999975e-113Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 3.59999999999999975e-113 < k < 2.1500000000000001e86Initial program 49.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.2%
Applied rewrites79.3%
if 2.1500000000000001e86 < k Initial program 46.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.2%
Applied rewrites59.7%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.8
Applied rewrites59.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-cos.f6494.4
Applied rewrites94.4%
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+237)
(/ 2.0 (* (* (/ (* (* k_m t) (* k_m t)) (* l l)) 2.0) t))
(/ 2.0 (* (* (/ (/ (* k_m k_m) l) l) (* 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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (((((k_m * k_m) / l) / l) * (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+237) then
tmp = 2.0d0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0d0) * t)
else
tmp = 2.0d0 / (((((k_m * k_m) / l) / l) * (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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (((((k_m * k_m) / l) / l) * (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+237: tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t) else: tmp = 2.0 / (((((k_m * k_m) / l) / l) * (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+237) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * t) * Float64(k_m * t)) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * k_m) / l) / l) * 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+237) tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t); else tmp = 2.0 / (((((k_m * k_m) / l) / l) * (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+237], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * t), $MachinePrecision] * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $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^{+237}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k\_m \cdot t\right) \cdot \left(k\_m \cdot t\right)}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{k\_m \cdot k\_m}{\ell}}{\ell} \cdot \left(k\_m \cdot k\_m\right)\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)))) < 5.0000000000000002e237Initial program 78.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.4%
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-*.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
if 5.0000000000000002e237 < (/.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 23.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.2%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6447.8
Applied rewrites47.8%
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+237)
(/ 2.0 (* (* (/ (* (* k_m t) (* k_m t)) (* l l)) 2.0) t))
(/ 2.0 (* (* (* (/ k_m l) (/ k_m l)) (* 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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / ((((k_m / l) * (k_m / l)) * (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+237) then
tmp = 2.0d0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0d0) * t)
else
tmp = 2.0d0 / ((((k_m / l) * (k_m / l)) * (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+237) {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / ((((k_m / l) * (k_m / l)) * (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+237: tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t) else: tmp = 2.0 / ((((k_m / l) * (k_m / l)) * (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+237) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * t) * Float64(k_m * t)) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m / l) * Float64(k_m / l)) * 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+237) tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t); else tmp = 2.0 / ((((k_m / l) * (k_m / l)) * (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+237], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * t), $MachinePrecision] * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $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^{+237}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k\_m \cdot t\right) \cdot \left(k\_m \cdot t\right)}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{k\_m}{\ell} \cdot \frac{k\_m}{\ell}\right) \cdot \left(k\_m \cdot k\_m\right)\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)))) < 5.0000000000000002e237Initial program 78.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites87.4%
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-*.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
if 5.0000000000000002e237 < (/.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 23.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.2%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6447.8
Applied rewrites47.8%
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+237)
(/ (* l l) (* (* k_m k_m) (* (* t t) t)))
(/ 2.0 (* (* (* k_m (/ k_m (* l l))) (* 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+237) {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
} else {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (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+237) then
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
else
tmp = 2.0d0 / (((k_m * (k_m / (l * l))) * (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+237) {
tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
} else {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (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+237: tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)) else: tmp = 2.0 / (((k_m * (k_m / (l * l))) * (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+237) tmp = Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(k_m / Float64(l * l))) * 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+237) tmp = (l * l) / ((k_m * k_m) * ((t * t) * t)); else tmp = 2.0 / (((k_m * (k_m / (l * l))) * (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+237], N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $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^{+237}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot \frac{k\_m}{\ell \cdot \ell}\right) \cdot \left(k\_m \cdot k\_m\right)\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)))) < 5.0000000000000002e237Initial program 78.5%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6468.5
Applied rewrites68.5%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6468.5
Applied rewrites68.5%
if 5.0000000000000002e237 < (/.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 23.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites51.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.2%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6443.4
Applied rewrites43.4%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 3e-45)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 1.95e+86)
(/ 2.0 (* (/ (/ t l) l) (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
(/ 2.0 (* (pow (/ k_m l) 2.0) (/ (* (pow (sin k_m) 2.0) t) (cos k_m)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 3e-45) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
} else {
tmp = 2.0 / (pow((k_m / l), 2.0) * ((pow(sin(k_m), 2.0) * t) / cos(k_m)));
}
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 <= 3d-45) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 1.95d+86) then
tmp = 2.0d0 / (((t / l) / l) * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
else
tmp = 2.0d0 / (((k_m / l) ** 2.0d0) * (((sin(k_m) ** 2.0d0) * t) / cos(k_m)))
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 <= 3e-45) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
} else {
tmp = 2.0 / (Math.pow((k_m / l), 2.0) * ((Math.pow(Math.sin(k_m), 2.0) * t) / Math.cos(k_m)));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 3e-45: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 1.95e+86: tmp = 2.0 / (((t / l) / l) * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m))) else: tmp = 2.0 / (math.pow((k_m / l), 2.0) * ((math.pow(math.sin(k_m), 2.0) * t) / math.cos(k_m))) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 3e-45) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 1.95e+86) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m)))); else tmp = Float64(2.0 / Float64((Float64(k_m / l) ^ 2.0) * Float64(Float64((sin(k_m) ^ 2.0) * t) / cos(k_m)))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 3e-45) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 1.95e+86) tmp = 2.0 / (((t / l) / l) * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m))); else tmp = 2.0 / (((k_m / l) ^ 2.0) * (((sin(k_m) ^ 2.0) * t) / cos(k_m))); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 3e-45], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.95e+86], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 3 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 1.95 \cdot 10^{+86}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k\_m}{\ell}\right)}^{2} \cdot \frac{{\sin k\_m}^{2} \cdot t}{\cos k\_m}}\\
\end{array}
\end{array}
if k < 3.00000000000000011e-45Initial program 56.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.0%
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-*.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.8
Applied rewrites73.8%
if 3.00000000000000011e-45 < k < 1.9500000000000001e86Initial program 40.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.0%
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in t around 0
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6483.2
Applied rewrites83.2%
if 1.9500000000000001e86 < k Initial program 46.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.2%
Applied rewrites59.7%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6459.8
Applied rewrites59.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-cos.f6494.4
Applied rewrites94.4%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 3e-45)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 1.95e+86)
(/ 2.0 (* (/ (/ t l) l) (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
(* (/ (* (pow (/ l k_m) 2.0) (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 <= 3e-45) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
} else {
tmp = ((pow((l / k_m), 2.0) * 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 <= 3d-45) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 1.95d+86) then
tmp = 2.0d0 / (((t / l) / l) * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
else
tmp = ((((l / k_m) ** 2.0d0) * 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 <= 3e-45) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
} else {
tmp = ((Math.pow((l / k_m), 2.0) * 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 <= 3e-45: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 1.95e+86: tmp = 2.0 / (((t / l) / l) * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m))) else: tmp = ((math.pow((l / k_m), 2.0) * 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 <= 3e-45) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 1.95e+86) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m)))); else tmp = Float64(Float64(Float64((Float64(l / k_m) ^ 2.0) * 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 <= 3e-45) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 1.95e+86) tmp = 2.0 / (((t / l) / l) * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m))); else tmp = ((((l / k_m) ^ 2.0) * 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, 3e-45], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.95e+86], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $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 3 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 1.95 \cdot 10^{+86}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2} \cdot \cos k\_m}{{\sin k\_m}^{2} \cdot t} \cdot 2\\
\end{array}
\end{array}
if k < 3.00000000000000011e-45Initial program 56.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.0%
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-*.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.8
Applied rewrites73.8%
if 3.00000000000000011e-45 < k < 1.9500000000000001e86Initial program 40.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.0%
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in t around 0
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6483.2
Applied rewrites83.2%
if 1.9500000000000001e86 < k Initial program 46.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6494.5
Applied rewrites94.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 3e-45)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 1.95e+86)
(/ 2.0 (* (/ (/ t l) l) (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
(*
(* (* (/ 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 <= 3e-45) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
} 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 <= 3d-45) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 1.95d+86) then
tmp = 2.0d0 / (((t / l) / l) * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
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 <= 3e-45) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.95e+86) {
tmp = 2.0 / (((t / l) / l) * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
} 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 <= 3e-45: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 1.95e+86: tmp = 2.0 / (((t / l) / l) * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m))) 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 <= 3e-45) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 1.95e+86) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m)))); 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 <= 3e-45) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 1.95e+86) tmp = 2.0 / (((t / l) / l) * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m))); 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, 3e-45], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.95e+86], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $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 3 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 1.95 \cdot 10^{+86}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\
\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 < 3.00000000000000011e-45Initial program 56.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.0%
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-*.f6466.1
Applied rewrites66.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.8
Applied rewrites73.8%
if 3.00000000000000011e-45 < k < 1.9500000000000001e86Initial program 40.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.0%
Applied rewrites73.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in t around 0
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6483.2
Applied rewrites83.2%
if 1.9500000000000001e86 < k Initial program 46.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.3
Applied rewrites94.3%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 5.1e-115)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 3e+46)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.0))
(*
(* (* (/ 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 <= 5.1e-115) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0);
} 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 <= 5.1d-115) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 3d+46) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0d0)
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 <= 5.1e-115) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.0);
} 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 <= 5.1e-115: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 3e+46: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.0) 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 <= 5.1e-115) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 3e+46) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); 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 <= 5.1e-115) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 3e+46) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0); 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, 5.1e-115], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3e+46], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $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 5.1 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 3 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\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 < 5.0999999999999997e-115Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 5.0999999999999997e-115 < k < 3.00000000000000023e46Initial program 58.9%
Taylor expanded in t around inf
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
if 3.00000000000000023e46 < k Initial program 40.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6487.3
Applied rewrites87.3%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 5.1e-115)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 3e+46)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.0))
(/ 2.0 (* (/ (pow (* (sin k_m) k_m) 2.0) (* (* (cos k_m) l) l)) t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 5.1e-115) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0);
} else {
tmp = 2.0 / ((pow((sin(k_m) * k_m), 2.0) / ((cos(k_m) * l) * l)) * 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 (k_m <= 5.1d-115) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 3d+46) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0d0)
else
tmp = 2.0d0 / ((((sin(k_m) * k_m) ** 2.0d0) / ((cos(k_m) * l) * l)) * 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 (k_m <= 5.1e-115) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.0);
} else {
tmp = 2.0 / ((Math.pow((Math.sin(k_m) * k_m), 2.0) / ((Math.cos(k_m) * l) * l)) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 5.1e-115: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 3e+46: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.0) else: tmp = 2.0 / ((math.pow((math.sin(k_m) * k_m), 2.0) / ((math.cos(k_m) * l) * l)) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 5.1e-115) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 3e+46) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); else tmp = Float64(2.0 / Float64(Float64((Float64(sin(k_m) * k_m) ^ 2.0) / Float64(Float64(cos(k_m) * l) * l)) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 5.1e-115) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 3e+46) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0); else tmp = 2.0 / ((((sin(k_m) * k_m) ^ 2.0) / ((cos(k_m) * l) * l)) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.1e-115], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3e+46], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 5.1 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 3 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\left(\cos k\_m \cdot \ell\right) \cdot \ell} \cdot t}\\
\end{array}
\end{array}
if k < 5.0999999999999997e-115Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 5.0999999999999997e-115 < k < 3.00000000000000023e46Initial program 58.9%
Taylor expanded in t around inf
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
if 3.00000000000000023e46 < k Initial program 40.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.4%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites18.6%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-cos.f6460.5
Applied rewrites60.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 5.1e-115)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 3e+46)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.0))
(*
(* (* l l) (/ (cos k_m) (* (* (* k_m k_m) t) (pow (sin k_m) 2.0))))
2.0))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 5.1e-115) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0);
} else {
tmp = ((l * l) * (cos(k_m) / (((k_m * k_m) * t) * pow(sin(k_m), 2.0)))) * 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 <= 5.1d-115) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 3d+46) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0d0)
else
tmp = ((l * l) * (cos(k_m) / (((k_m * k_m) * t) * (sin(k_m) ** 2.0d0)))) * 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 <= 5.1e-115) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.0);
} else {
tmp = ((l * l) * (Math.cos(k_m) / (((k_m * k_m) * t) * Math.pow(Math.sin(k_m), 2.0)))) * 2.0;
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 5.1e-115: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 3e+46: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.0) else: tmp = ((l * l) * (math.cos(k_m) / (((k_m * k_m) * t) * math.pow(math.sin(k_m), 2.0)))) * 2.0 return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 5.1e-115) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 3e+46) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); else tmp = Float64(Float64(Float64(l * l) * Float64(cos(k_m) / Float64(Float64(Float64(k_m * k_m) * t) * (sin(k_m) ^ 2.0)))) * 2.0); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 5.1e-115) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 3e+46) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0); else tmp = ((l * l) * (cos(k_m) / (((k_m * k_m) * t) * (sin(k_m) ^ 2.0)))) * 2.0; end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.1e-115], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3e+46], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 5.1 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 3 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\ell \cdot \ell\right) \cdot \frac{\cos k\_m}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot {\sin k\_m}^{2}}\right) \cdot 2\\
\end{array}
\end{array}
if k < 5.0999999999999997e-115Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 5.0999999999999997e-115 < k < 3.00000000000000023e46Initial program 58.9%
Taylor expanded in t around inf
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
if 3.00000000000000023e46 < k Initial program 40.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.6%
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
pow2N/A
pow2N/A
frac-timesN/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
Applied rewrites58.3%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 2.4e-50)
(* (* (* l (/ l (* k_m k_m))) (/ (cos k_m) (* (pow (sin k_m) 2.0) t))) 2.0)
(if (<= t 4.4e+67)
(/ (pow (/ l k_m) 2.0) (pow t 3.0))
(if (<= t 3.1e+127)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.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 tmp;
if (t <= 2.4e-50) {
tmp = ((l * (l / (k_m * k_m))) * (cos(k_m) / (pow(sin(k_m), 2.0) * t))) * 2.0;
} else if (t <= 4.4e+67) {
tmp = pow((l / k_m), 2.0) / pow(t, 3.0);
} else if (t <= 3.1e+127) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.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) :: tmp
if (t <= 2.4d-50) then
tmp = ((l * (l / (k_m * k_m))) * (cos(k_m) / ((sin(k_m) ** 2.0d0) * t))) * 2.0d0
else if (t <= 4.4d+67) then
tmp = ((l / k_m) ** 2.0d0) / (t ** 3.0d0)
else if (t <= 3.1d+127) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.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 tmp;
if (t <= 2.4e-50) {
tmp = ((l * (l / (k_m * k_m))) * (Math.cos(k_m) / (Math.pow(Math.sin(k_m), 2.0) * t))) * 2.0;
} else if (t <= 4.4e+67) {
tmp = Math.pow((l / k_m), 2.0) / Math.pow(t, 3.0);
} else if (t <= 3.1e+127) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.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): tmp = 0 if t <= 2.4e-50: tmp = ((l * (l / (k_m * k_m))) * (math.cos(k_m) / (math.pow(math.sin(k_m), 2.0) * t))) * 2.0 elif t <= 4.4e+67: tmp = math.pow((l / k_m), 2.0) / math.pow(t, 3.0) elif t <= 3.1e+127: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.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) tmp = 0.0 if (t <= 2.4e-50) tmp = Float64(Float64(Float64(l * Float64(l / Float64(k_m * k_m))) * Float64(cos(k_m) / Float64((sin(k_m) ^ 2.0) * t))) * 2.0); elseif (t <= 4.4e+67) tmp = Float64((Float64(l / k_m) ^ 2.0) / (t ^ 3.0)); elseif (t <= 3.1e+127) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 2.4e-50) tmp = ((l * (l / (k_m * k_m))) * (cos(k_m) / ((sin(k_m) ^ 2.0) * t))) * 2.0; elseif (t <= 4.4e+67) tmp = ((l / k_m) ^ 2.0) / (t ^ 3.0); elseif (t <= 3.1e+127) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.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_] := If[LessEqual[t, 2.4e-50], 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[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t, 4.4e+67], N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+127], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.4 \cdot 10^{-50}:\\
\;\;\;\;\left(\left(\ell \cdot \frac{\ell}{k\_m \cdot k\_m}\right) \cdot \frac{\cos k\_m}{{\sin k\_m}^{2} \cdot t}\right) \cdot 2\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+67}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{{t}^{3}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.40000000000000002e-50Initial program 49.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6465.9
Applied rewrites65.9%
if 2.40000000000000002e-50 < t < 4.4e67Initial program 70.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.0%
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
Taylor expanded in k around 0
associate-/r*N/A
pow2N/A
pow2N/A
lower-/.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-pow.f6482.5
Applied rewrites82.5%
if 4.4e67 < t < 3.1000000000000002e127Initial program 74.0%
Taylor expanded in t around inf
Applied rewrites67.5%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
if 3.1000000000000002e127 < t Initial program 49.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.8%
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-*.f6466.5
Applied rewrites66.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6483.7
Applied rewrites83.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 5.1e-115)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 3e+46)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.0))
(*
(*
(/ (* l l) (* k_m k_m))
(/ (cos k_m) (* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) t)))
2.0))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 5.1e-115) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0);
} else {
tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * 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 <= 5.1d-115) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 3d+46) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0d0)
else
tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k_m)))) * 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 <= 5.1e-115) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 3e+46) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.0);
} else {
tmp = (((l * l) / (k_m * k_m)) * (Math.cos(k_m) / ((0.5 - (0.5 * Math.cos((2.0 * k_m)))) * t))) * 2.0;
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 5.1e-115: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 3e+46: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.0) else: tmp = (((l * l) / (k_m * k_m)) * (math.cos(k_m) / ((0.5 - (0.5 * math.cos((2.0 * k_m)))) * t))) * 2.0 return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 5.1e-115) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 3e+46) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); else 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); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 5.1e-115) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 3e+46) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0); else tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * 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, 5.1e-115], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3e+46], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 5.1 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 3 \cdot 10^{+46}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\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\\
\end{array}
\end{array}
if k < 5.0999999999999997e-115Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 5.0999999999999997e-115 < k < 3.00000000000000023e46Initial program 58.9%
Taylor expanded in t around inf
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6481.3
Applied rewrites81.3%
if 3.00000000000000023e46 < k Initial program 40.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.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-*.f6460.5
Applied rewrites60.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 5.1e-115)
(/ 2.0 (* (* (/ (/ (pow (* k_m t) 2.0) l) l) 2.0) t))
(if (<= k_m 1.28e+123)
(/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k_m)) (tan k_m)) 2.0))
(/ 2.0 (* (* (* (pow (/ k_m l) 2.0) k_m) k_m) t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 5.1e-115) {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.28e+123) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0);
} else {
tmp = 2.0 / (((pow((k_m / l), 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 (k_m <= 5.1d-115) then
tmp = 2.0d0 / ((((((k_m * t) ** 2.0d0) / l) / l) * 2.0d0) * t)
else if (k_m <= 1.28d+123) then
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0d0)
else
tmp = 2.0d0 / (((((k_m / l) ** 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 (k_m <= 5.1e-115) {
tmp = 2.0 / ((((Math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
} else if (k_m <= 1.28e+123) {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k_m)) * Math.tan(k_m)) * 2.0);
} else {
tmp = 2.0 / (((Math.pow((k_m / l), 2.0) * k_m) * k_m) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 5.1e-115: tmp = 2.0 / ((((math.pow((k_m * t), 2.0) / l) / l) * 2.0) * t) elif k_m <= 1.28e+123: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k_m)) * math.tan(k_m)) * 2.0) else: tmp = 2.0 / (((math.pow((k_m / l), 2.0) * k_m) * k_m) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 5.1e-115) tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); elseif (k_m <= 1.28e+123) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k_m)) * tan(k_m)) * 2.0)); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m / l) ^ 2.0) * 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 (k_m <= 5.1e-115) tmp = 2.0 / ((((((k_m * t) ^ 2.0) / l) / l) * 2.0) * t); elseif (k_m <= 1.28e+123) tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k_m)) * tan(k_m)) * 2.0); else tmp = 2.0 / (((((k_m / l) ^ 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[k$95$m, 5.1e-115], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.28e+123], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[Tan[k$95$m], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 5.1 \cdot 10^{-115}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\mathbf{elif}\;k\_m \leq 1.28 \cdot 10^{+123}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\_m\right) \cdot \tan k\_m\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k\_m}{\ell}\right)}^{2} \cdot k\_m\right) \cdot k\_m\right) \cdot t}\\
\end{array}
\end{array}
if k < 5.0999999999999997e-115Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.9%
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-*.f6464.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
if 5.0999999999999997e-115 < k < 1.28000000000000005e123Initial program 50.5%
Taylor expanded in t around inf
Applied rewrites64.1%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
if 1.28000000000000005e123 < k Initial program 44.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites57.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites17.0%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6448.2
Applied rewrites48.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites48.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 1.38e-160)
(/
2.0
(*
(/ (/ t l) l)
(/
(*
(fma
(+
(fma
(-
(fma
(fma -0.006349206349206349 (* t t) 0.044444444444444446)
(* k_m k_m)
(* 0.08888888888888889 (* t t)))
0.3333333333333333)
(* k_m k_m)
(* (* t t) -0.6666666666666666))
1.0)
(* k_m k_m)
(* (* t t) 2.0))
(* k_m k_m))
(cos k_m))))
(if (<= t 1.9e+65)
(/ (pow (/ l k_m) 2.0) (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 tmp;
if (t <= 1.38e-160) {
tmp = 2.0 / (((t / l) / l) * ((fma((fma((fma(fma(-0.006349206349206349, (t * t), 0.044444444444444446), (k_m * k_m), (0.08888888888888889 * (t * t))) - 0.3333333333333333), (k_m * k_m), ((t * t) * -0.6666666666666666)) + 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / cos(k_m)));
} else if (t <= 1.9e+65) {
tmp = pow((l / k_m), 2.0) / pow(t, 3.0);
} else {
tmp = 2.0 / ((((pow((k_m * t), 2.0) / l) / l) * 2.0) * t);
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 1.38e-160) tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(Float64(fma(Float64(fma(Float64(fma(fma(-0.006349206349206349, Float64(t * t), 0.044444444444444446), Float64(k_m * k_m), Float64(0.08888888888888889 * Float64(t * t))) - 0.3333333333333333), Float64(k_m * k_m), Float64(Float64(t * t) * -0.6666666666666666)) + 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / cos(k_m)))); elseif (t <= 1.9e+65) tmp = Float64((Float64(l / k_m) ^ 2.0) / (t ^ 3.0)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 1.38e-160], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(-0.006349206349206349 * N[(t * t), $MachinePrecision] + 0.044444444444444446), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(0.08888888888888889 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $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[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+65], N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.38 \cdot 10^{-160}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.006349206349206349, t \cdot t, 0.044444444444444446\right), k\_m \cdot k\_m, 0.08888888888888889 \cdot \left(t \cdot t\right)\right) - 0.3333333333333333, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot -0.6666666666666666\right) + 1, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m}}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+65}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{{t}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.38e-160Initial program 51.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.6%
Applied rewrites73.3%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6480.3
Applied rewrites80.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites52.6%
if 1.38e-160 < t < 1.90000000000000006e65Initial program 53.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.1%
Applied rewrites61.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6461.8
Applied rewrites61.8%
Taylor expanded in k around 0
associate-/r*N/A
pow2N/A
pow2N/A
lower-/.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-pow.f6458.8
Applied rewrites58.8%
if 1.90000000000000006e65 < t Initial program 56.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.3%
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-*.f6471.3
Applied rewrites71.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6483.4
Applied rewrites83.4%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= t 1.45e-116)
(/ 2.0 (* (* (* (pow (/ k_m l) 2.0) k_m) k_m) t))
(if (<= t 1.9e+65)
(/ (pow (/ l k_m) 2.0) (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 tmp;
if (t <= 1.45e-116) {
tmp = 2.0 / (((pow((k_m / l), 2.0) * k_m) * k_m) * t);
} else if (t <= 1.9e+65) {
tmp = pow((l / k_m), 2.0) / 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) :: tmp
if (t <= 1.45d-116) then
tmp = 2.0d0 / (((((k_m / l) ** 2.0d0) * k_m) * k_m) * t)
else if (t <= 1.9d+65) then
tmp = ((l / k_m) ** 2.0d0) / (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 tmp;
if (t <= 1.45e-116) {
tmp = 2.0 / (((Math.pow((k_m / l), 2.0) * k_m) * k_m) * t);
} else if (t <= 1.9e+65) {
tmp = Math.pow((l / k_m), 2.0) / 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): tmp = 0 if t <= 1.45e-116: tmp = 2.0 / (((math.pow((k_m / l), 2.0) * k_m) * k_m) * t) elif t <= 1.9e+65: tmp = math.pow((l / k_m), 2.0) / 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) tmp = 0.0 if (t <= 1.45e-116) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m / l) ^ 2.0) * k_m) * k_m) * t)); elseif (t <= 1.9e+65) tmp = Float64((Float64(l / k_m) ^ 2.0) / (t ^ 3.0)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 1.45e-116) tmp = 2.0 / (((((k_m / l) ^ 2.0) * k_m) * k_m) * t); elseif (t <= 1.9e+65) tmp = ((l / k_m) ^ 2.0) / (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_] := If[LessEqual[t, 1.45e-116], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.9e+65], N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k\_m}{\ell}\right)}^{2} \cdot k\_m\right) \cdot k\_m\right) \cdot t}\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+65}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{{t}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.4499999999999999e-116Initial program 51.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites38.7%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6458.8
Applied rewrites58.8%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites61.0%
if 1.4499999999999999e-116 < t < 1.90000000000000006e65Initial program 56.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.8%
Applied rewrites63.5%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6463.7
Applied rewrites63.7%
Taylor expanded in k around 0
associate-/r*N/A
pow2N/A
pow2N/A
lower-/.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f64N/A
lift-pow.f6462.4
Applied rewrites62.4%
if 1.90000000000000006e65 < t Initial program 56.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.3%
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-*.f6471.3
Applied rewrites71.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6483.4
Applied rewrites83.4%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 1.08e-45) (/ 2.0 (* (* (* (pow (/ k_m l) 2.0) k_m) k_m) t)) (/ 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 tmp;
if (t <= 1.08e-45) {
tmp = 2.0 / (((pow((k_m / l), 2.0) * k_m) * k_m) * t);
} 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) :: tmp
if (t <= 1.08d-45) then
tmp = 2.0d0 / (((((k_m / l) ** 2.0d0) * k_m) * k_m) * t)
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 tmp;
if (t <= 1.08e-45) {
tmp = 2.0 / (((Math.pow((k_m / l), 2.0) * k_m) * k_m) * t);
} 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): tmp = 0 if t <= 1.08e-45: tmp = 2.0 / (((math.pow((k_m / l), 2.0) * k_m) * k_m) * t) 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) tmp = 0.0 if (t <= 1.08e-45) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m / l) ^ 2.0) * k_m) * k_m) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / l) / l) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 1.08e-45) tmp = 2.0 / (((((k_m / l) ^ 2.0) * k_m) * k_m) * t); 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_] := If[LessEqual[t, 1.08e-45], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.08 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k\_m}{\ell}\right)}^{2} \cdot k\_m\right) \cdot k\_m\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell}}{\ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.08e-45Initial program 49.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.7%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6456.1
Applied rewrites56.1%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites58.2%
if 1.08e-45 < t Initial program 62.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.6%
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-*.f6469.8
Applied rewrites69.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
unpow-prod-downN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
unpow-prod-downN/A
lift-pow.f64N/A
lift-*.f6480.9
Applied rewrites80.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 3.9e-52) (/ 2.0 (* (* (* k_m (/ k_m (* l l))) (* k_m k_m)) t)) (/ 2.0 (* (* (/ (* (* k_m t) (* k_m t)) (* l l)) 2.0) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 3.9e-52) {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t);
} else {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (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) :: tmp
if (t <= 3.9d-52) then
tmp = 2.0d0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t)
else
tmp = 2.0d0 / (((((k_m * t) * (k_m * t)) / (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 tmp;
if (t <= 3.9e-52) {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t);
} else {
tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 3.9e-52: tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t) else: tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 3.9e-52) tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(k_m / Float64(l * l))) * Float64(k_m * k_m)) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k_m * t) * Float64(k_m * t)) / Float64(l * l)) * 2.0) * t)); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (t <= 3.9e-52) tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t); else tmp = 2.0 / (((((k_m * t) * (k_m * t)) / (l * l)) * 2.0) * t); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[t, 3.9e-52], N[(2.0 / N[(N[(N[(k$95$m * N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(k$95$m * t), $MachinePrecision] * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.9 \cdot 10^{-52}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot \frac{k\_m}{\ell \cdot \ell}\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(k\_m \cdot t\right) \cdot \left(k\_m \cdot t\right)}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 3.90000000000000018e-52Initial program 49.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.9%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
if 3.90000000000000018e-52 < t Initial program 61.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.6%
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-*.f6468.9
Applied rewrites68.9%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f6468.9
Applied rewrites68.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= t 2e-50) (/ 2.0 (* (* (* k_m (/ k_m (* l l))) (* k_m k_m)) t)) (/ 2.0 (* (* (* (* t (/ t (* l l))) 2.0) (* k_m k_m)) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (t <= 2e-50) {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t);
} else {
tmp = 2.0 / ((((t * (t / (l * l))) * 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 (t <= 2d-50) then
tmp = 2.0d0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t)
else
tmp = 2.0d0 / ((((t * (t / (l * l))) * 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 (t <= 2e-50) {
tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t);
} else {
tmp = 2.0 / ((((t * (t / (l * l))) * 2.0) * (k_m * k_m)) * t);
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if t <= 2e-50: tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t) else: tmp = 2.0 / ((((t * (t / (l * l))) * 2.0) * (k_m * k_m)) * t) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (t <= 2e-50) tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(k_m / Float64(l * l))) * Float64(k_m * k_m)) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t * Float64(t / Float64(l * l))) * 2.0) * 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 (t <= 2e-50) tmp = 2.0 / (((k_m * (k_m / (l * l))) * (k_m * k_m)) * t); else tmp = 2.0 / ((((t * (t / (l * l))) * 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[t, 2e-50], N[(2.0 / N[(N[(N[(k$95$m * N[(k$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{-50}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot \frac{k\_m}{\ell \cdot \ell}\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(t \cdot \frac{t}{\ell \cdot \ell}\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right) \cdot t}\\
\end{array}
\end{array}
if t < 2.00000000000000002e-50Initial program 49.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites37.9%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
if 2.00000000000000002e-50 < t Initial program 61.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites31.8%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-/l*N/A
pow2N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f6463.5
Applied rewrites63.5%
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 53.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.f6450.9
Applied rewrites50.9%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6450.9
Applied rewrites50.9%
herbie shell --seed 2025043
(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))))