
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Herbie found 25 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}
(FPCore (t l k)
:precision binary64
(/
2.0
(*
(fma
(pow (/ k l) 2.0)
(/ (pow (sin k) 2.0) (cos k))
(/ (/ (* (pow (* (sin k) t) 2.0) 2.0) (* (cos k) l)) l))
t)))
double code(double t, double l, double k) {
return 2.0 / (fma(pow((k / l), 2.0), (pow(sin(k), 2.0) / cos(k)), (((pow((sin(k) * t), 2.0) * 2.0) / (cos(k) * l)) / l)) * t);
}
function code(t, l, k) return Float64(2.0 / Float64(fma((Float64(k / l) ^ 2.0), Float64((sin(k) ^ 2.0) / cos(k)), Float64(Float64(Float64((Float64(sin(k) * t) ^ 2.0) * 2.0) / Float64(cos(k) * l)) / l)) * t)) end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\mathsf{fma}\left({\left(\frac{k}{\ell}\right)}^{2}, \frac{{\sin k}^{2}}{\cos k}, \frac{\frac{{\left(\sin k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \ell}}{\ell}\right) \cdot t}
\end{array}
Initial program 55.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.0%
lift-*.f64N/A
pow2N/A
metadata-evalN/A
pow-negN/A
metadata-evalN/A
pow-flipN/A
lower-/.f64N/A
pow-flipN/A
metadata-evalN/A
lower-pow.f6473.8
Applied rewrites73.8%
Applied rewrites79.5%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites88.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))))
(if (<= t_1 -5e-250)
(/ 2.0 (* (/ (* (* (* t t) 2.0) (* k k)) (* (cos k) (* l l))) t))
(if (<= t_1 2e+303)
(/ 2.0 (* (* (/ (pow (* k t) 2.0) (* l l)) 2.0) t))
(/ 2.0 (* (pow (/ k l) 2.0) (* (* k k) t)))))))
double code(double t, double l, double k) {
double t_1 = 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
double tmp;
if (t_1 <= -5e-250) {
tmp = 2.0 / (((((t * t) * 2.0) * (k * k)) / (cos(k) * (l * l))) * t);
} else if (t_1 <= 2e+303) {
tmp = 2.0 / (((pow((k * t), 2.0) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (pow((k / l), 2.0) * ((k * k) * t));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
if (t_1 <= (-5d-250)) then
tmp = 2.0d0 / (((((t * t) * 2.0d0) * (k * k)) / (cos(k) * (l * l))) * t)
else if (t_1 <= 2d+303) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) / (l * l)) * 2.0d0) * t)
else
tmp = 2.0d0 / (((k / l) ** 2.0d0) * ((k * k) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = 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));
double tmp;
if (t_1 <= -5e-250) {
tmp = 2.0 / (((((t * t) * 2.0) * (k * k)) / (Math.cos(k) * (l * l))) * t);
} else if (t_1 <= 2e+303) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (Math.pow((k / l), 2.0) * ((k * k) * t));
}
return tmp;
}
def code(t, l, k): t_1 = 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)) tmp = 0 if t_1 <= -5e-250: tmp = 2.0 / (((((t * t) * 2.0) * (k * k)) / (math.cos(k) * (l * l))) * t) elif t_1 <= 2e+303: tmp = 2.0 / (((math.pow((k * t), 2.0) / (l * l)) * 2.0) * t) else: tmp = 2.0 / (math.pow((k / l), 2.0) * ((k * k) * t)) return tmp
function code(t, l, k) t_1 = 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))) tmp = 0.0 if (t_1 <= -5e-250) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t * t) * 2.0) * Float64(k * k)) / Float64(cos(k) * Float64(l * l))) * t)); elseif (t_1 <= 2e+303) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(Float64(k * k) * t))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); tmp = 0.0; if (t_1 <= -5e-250) tmp = 2.0 / (((((t * t) * 2.0) * (k * k)) / (cos(k) * (l * l))) * t); elseif (t_1 <= 2e+303) tmp = 2.0 / (((((k * t) ^ 2.0) / (l * l)) * 2.0) * t); else tmp = 2.0 / (((k / l) ^ 2.0) * ((k * k) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -5e-250], N[(2.0 / N[(N[(N[(N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-250}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\left(k \cdot k\right) \cdot t\right)}\\
\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.00000000000000027e-250Initial program 89.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.5%
Taylor expanded in k around 0
*-commutativeN/A
pow2N/A
lift-*.f64N/A
lift-*.f6476.1
Applied rewrites76.1%
if -5.00000000000000027e-250 < (/.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)))) < 2e303Initial program 79.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.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-*.f6483.1
Applied rewrites83.1%
if 2e303 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6455.7
Applied rewrites55.7%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6445.5
Applied rewrites45.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
unpow2N/A
lift-pow.f64N/A
lift-/.f6452.3
Applied rewrites52.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))))
(if (<= t_1 -5e-250)
(/
2.0
(*
(/
(*
(fma
(+
(fma
(- (* (* t t) 0.08888888888888889) 0.3333333333333333)
(* k k)
(* -0.6666666666666666 (* t t)))
1.0)
(* k k)
(* (* t t) 2.0))
(* k k))
(* (fma (- (* 0.041666666666666664 (* k k)) 0.5) (* k k) 1.0) (* l l)))
t))
(if (<= t_1 2e+303)
(/ 2.0 (* (* (/ (pow (* k t) 2.0) (* l l)) 2.0) t))
(/ 2.0 (* (pow (/ k l) 2.0) (* (* k k) t)))))))
double code(double t, double l, double k) {
double t_1 = 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
double tmp;
if (t_1 <= -5e-250) {
tmp = 2.0 / (((fma((fma((((t * t) * 0.08888888888888889) - 0.3333333333333333), (k * k), (-0.6666666666666666 * (t * t))) + 1.0), (k * k), ((t * t) * 2.0)) * (k * k)) / (fma(((0.041666666666666664 * (k * k)) - 0.5), (k * k), 1.0) * (l * l))) * t);
} else if (t_1 <= 2e+303) {
tmp = 2.0 / (((pow((k * t), 2.0) / (l * l)) * 2.0) * t);
} else {
tmp = 2.0 / (pow((k / l), 2.0) * ((k * k) * t));
}
return tmp;
}
function code(t, l, k) t_1 = 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))) tmp = 0.0 if (t_1 <= -5e-250) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(fma(Float64(Float64(Float64(t * t) * 0.08888888888888889) - 0.3333333333333333), Float64(k * k), Float64(-0.6666666666666666 * Float64(t * t))) + 1.0), Float64(k * k), Float64(Float64(t * t) * 2.0)) * Float64(k * k)) / Float64(fma(Float64(Float64(0.041666666666666664 * Float64(k * k)) - 0.5), Float64(k * k), 1.0) * Float64(l * l))) * t)); elseif (t_1 <= 2e+303) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) / Float64(l * l)) * 2.0) * t)); else tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(Float64(k * k) * t))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -5e-250], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] * 0.08888888888888889), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(-0.6666666666666666 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(0.041666666666666664 * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+303], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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)}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-250}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(t \cdot t\right) \cdot 0.08888888888888889 - 0.3333333333333333, k \cdot k, -0.6666666666666666 \cdot \left(t \cdot t\right)\right) + 1, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\mathsf{fma}\left(0.041666666666666664 \cdot \left(k \cdot k\right) - 0.5, k \cdot k, 1\right) \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\left(k \cdot k\right) \cdot t\right)}\\
\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.00000000000000027e-250Initial program 89.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.5%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6477.0
Applied rewrites77.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6476.6
Applied rewrites76.6%
if -5.00000000000000027e-250 < (/.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)))) < 2e303Initial program 79.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.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-*.f6483.1
Applied rewrites83.1%
if 2e303 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6455.7
Applied rewrites55.7%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6445.5
Applied rewrites45.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
unpow2N/A
lift-pow.f64N/A
lift-/.f6452.3
Applied rewrites52.3%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
2e+303)
(/
2.0
(*
(/
(fma 2.0 (pow (* (sin k) t) 2.0) (pow (* (sin k) k) 2.0))
(* (cos k) (* l l)))
t))
(/ 2.0 (/ (* (pow (/ k l) 2.0) (* (pow (sin k) 2.0) t)) (cos k)))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0))) <= 2e+303) {
tmp = 2.0 / ((fma(2.0, pow((sin(k) * t), 2.0), pow((sin(k) * k), 2.0)) / (cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / ((pow((k / l), 2.0) * (pow(sin(k), 2.0) * t)) / cos(k));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (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))) <= 2e+303) tmp = Float64(2.0 / Float64(Float64(fma(2.0, (Float64(sin(k) * t) ^ 2.0), (Float64(sin(k) * k) ^ 2.0)) / Float64(cos(k) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64((Float64(k / l) ^ 2.0) * Float64((sin(k) ^ 2.0) * t)) / cos(k))); end return tmp end
code[t_, l_, k_] := If[LessEqual[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], 2e+303], N[(2.0 / N[(N[(N[(2.0 * N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left({\sin k}^{2} \cdot t\right)}{\cos k}}\\
\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)))) < 2e303Initial program 81.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.3%
if 2e303 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6455.7
Applied rewrites55.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites77.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (/ k l) 2.0)) (t_2 (pow (sin k) 2.0)))
(if (<= t 7.6e-70)
(/ 2.0 (* t_1 (* t_2 (/ t (cos k)))))
(if (<= t 3.6e+208)
(/
2.0
(*
(fma
t_1
(/ t_2 (cos k))
(/ (* (pow (* (sin k) t) 2.0) 2.0) (* (* (cos k) l) l)))
t))
(/
2.0
(*
(* (* (exp (- (* (log t) 3.0) (* (log l) 2.0))) (sin k)) (tan k))
2.0))))))
double code(double t, double l, double k) {
double t_1 = pow((k / l), 2.0);
double t_2 = pow(sin(k), 2.0);
double tmp;
if (t <= 7.6e-70) {
tmp = 2.0 / (t_1 * (t_2 * (t / cos(k))));
} else if (t <= 3.6e+208) {
tmp = 2.0 / (fma(t_1, (t_2 / cos(k)), ((pow((sin(k) * t), 2.0) * 2.0) / ((cos(k) * l) * l))) * t);
} else {
tmp = 2.0 / (((exp(((log(t) * 3.0) - (log(l) * 2.0))) * sin(k)) * tan(k)) * 2.0);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(k / l) ^ 2.0 t_2 = sin(k) ^ 2.0 tmp = 0.0 if (t <= 7.6e-70) tmp = Float64(2.0 / Float64(t_1 * Float64(t_2 * Float64(t / cos(k))))); elseif (t <= 3.6e+208) tmp = Float64(2.0 / Float64(fma(t_1, Float64(t_2 / cos(k)), Float64(Float64((Float64(sin(k) * t) ^ 2.0) * 2.0) / Float64(Float64(cos(k) * l) * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(exp(Float64(Float64(log(t) * 3.0) - Float64(log(l) * 2.0))) * sin(k)) * tan(k)) * 2.0)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[t, 7.6e-70], N[(2.0 / N[(t$95$1 * N[(t$95$2 * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+208], N[(2.0 / N[(N[(t$95$1 * N[(t$95$2 / N[Cos[k], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Exp[N[(N[(N[Log[t], $MachinePrecision] * 3.0), $MachinePrecision] - N[(N[Log[l], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(\frac{k}{\ell}\right)}^{2}\\
t_2 := {\sin k}^{2}\\
\mathbf{if}\;t \leq 7.6 \cdot 10^{-70}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(t\_2 \cdot \frac{t}{\cos k}\right)}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+208}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(t\_1, \frac{t\_2}{\cos k}, \frac{{\left(\sin k \cdot t\right)}^{2} \cdot 2}{\left(\cos k \cdot \ell\right) \cdot \ell}\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(e^{\log t \cdot 3 - \log \ell \cdot 2} \cdot \sin k\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
if t < 7.5999999999999995e-70Initial program 49.3%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6475.1
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6475.1
Applied rewrites75.1%
if 7.5999999999999995e-70 < t < 3.60000000000000003e208Initial program 67.2%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.1%
lift-*.f64N/A
pow2N/A
metadata-evalN/A
pow-negN/A
metadata-evalN/A
pow-flipN/A
lower-/.f64N/A
pow-flipN/A
metadata-evalN/A
lower-pow.f6475.0
Applied rewrites75.0%
Applied rewrites84.3%
if 3.60000000000000003e208 < t Initial program 69.9%
Taylor expanded in t around inf
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-to-expN/A
pow2N/A
pow-to-expN/A
div-expN/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6443.6
Applied rewrites43.6%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
2e+303)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(/ 2.0 (* (pow (/ k l) 2.0) (* (* k k) t)))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0))) <= 2e+303) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / (pow((k / l), 2.0) * ((k * k) * t));
}
return tmp;
}
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
real(8) :: tmp
if ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))) <= 2d+303) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else
tmp = 2.0d0 / (((k / l) ** 2.0d0) * ((k * k) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((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))) <= 2e+303) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / (Math.pow((k / l), 2.0) * ((k * k) * t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (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))) <= 2e+303: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) else: tmp = 2.0 / (math.pow((k / l), 2.0) * ((k * k) * t)) return tmp
function code(t, l, k) tmp = 0.0 if (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))) <= 2e+303) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(Float64(k * k) * t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0))) <= 2e+303) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); else tmp = 2.0 / (((k / l) ^ 2.0) * ((k * k) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[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], 2e+303], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\left(k \cdot k\right) \cdot t\right)}\\
\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)))) < 2e303Initial program 81.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6481.7
Applied rewrites81.7%
if 2e303 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6455.7
Applied rewrites55.7%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6445.5
Applied rewrites45.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
unpow2N/A
lift-pow.f64N/A
lift-/.f6452.3
Applied rewrites52.3%
(FPCore (t l k)
:precision binary64
(if (<= t 5.5e+15)
(/ 2.0 (/ (* (pow (/ k l) 2.0) (* (pow (sin k) 2.0) t)) (cos k)))
(/
2.0
(*
(* (* (exp (- (* (log t) 3.0) (* (log l) 2.0))) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 5.5e+15) {
tmp = 2.0 / ((pow((k / l), 2.0) * (pow(sin(k), 2.0) * t)) / cos(k));
} else {
tmp = 2.0 / (((exp(((log(t) * 3.0) - (log(l) * 2.0))) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
return tmp;
}
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
real(8) :: tmp
if (t <= 5.5d+15) then
tmp = 2.0d0 / ((((k / l) ** 2.0d0) * ((sin(k) ** 2.0d0) * t)) / cos(k))
else
tmp = 2.0d0 / (((exp(((log(t) * 3.0d0) - (log(l) * 2.0d0))) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 5.5e+15) {
tmp = 2.0 / ((Math.pow((k / l), 2.0) * (Math.pow(Math.sin(k), 2.0) * t)) / Math.cos(k));
} else {
tmp = 2.0 / (((Math.exp(((Math.log(t) * 3.0) - (Math.log(l) * 2.0))) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 5.5e+15: tmp = 2.0 / ((math.pow((k / l), 2.0) * (math.pow(math.sin(k), 2.0) * t)) / math.cos(k)) else: tmp = 2.0 / (((math.exp(((math.log(t) * 3.0) - (math.log(l) * 2.0))) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 5.5e+15) tmp = Float64(2.0 / Float64(Float64((Float64(k / l) ^ 2.0) * Float64((sin(k) ^ 2.0) * t)) / cos(k))); else tmp = Float64(2.0 / Float64(Float64(Float64(exp(Float64(Float64(log(t) * 3.0) - Float64(log(l) * 2.0))) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 5.5e+15) tmp = 2.0 / ((((k / l) ^ 2.0) * ((sin(k) ^ 2.0) * t)) / cos(k)); else tmp = 2.0 / (((exp(((log(t) * 3.0) - (log(l) * 2.0))) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 5.5e+15], N[(2.0 / N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Exp[N[(N[(N[Log[t], $MachinePrecision] * 3.0), $MachinePrecision] - N[(N[Log[l], $MachinePrecision] * 2.0), $MachinePrecision]), $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}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{2}{\frac{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left({\sin k}^{2} \cdot t\right)}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(e^{\log t \cdot 3 - \log \ell \cdot 2} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}\\
\end{array}
\end{array}
if t < 5.5e15Initial program 51.9%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6463.9
Applied rewrites63.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites75.9%
if 5.5e15 < t Initial program 65.3%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow-to-expN/A
pow2N/A
pow-to-expN/A
div-expN/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6444.3
Applied rewrites44.3%
(FPCore (t l k)
:precision binary64
(if (<=
(/
2.0
(*
(* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t) 2.0)) 1.0)))
2e+303)
(/ (* l l) (* (* k k) (* (* t t) t)))
(/ 2.0 (* (/ (* k k) (* l l)) (* k (* k t))))))
double code(double t, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0))) <= 2e+303) {
tmp = (l * l) / ((k * k) * ((t * t) * t));
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
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
real(8) :: tmp
if ((2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))) <= 2d+303) then
tmp = (l * l) / ((k * k) * ((t * t) * t))
else
tmp = 2.0d0 / (((k * k) / (l * l)) * (k * (k * t)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((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))) <= 2e+303) {
tmp = (l * l) / ((k * k) * ((t * t) * t));
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (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))) <= 2e+303: tmp = (l * l) / ((k * k) * ((t * t) * t)) else: tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t))) return tmp
function code(t, l, k) tmp = 0.0 if (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))) <= 2e+303) tmp = Float64(Float64(l * l) / Float64(Float64(k * k) * Float64(Float64(t * t) * t))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * Float64(k * t)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0))) <= 2e+303) tmp = (l * l) / ((k * k) * ((t * t) * t)); else tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[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], 2e+303], N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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)} \leq 2 \cdot 10^{+303}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\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)))) < 2e303Initial program 81.6%
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 2e303 < (/.f64 #s(literal 2 binary64) (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (+.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64)))) Initial program 21.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6455.7
Applied rewrites55.7%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6445.5
Applied rewrites45.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6445.5
Applied rewrites45.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 26500.0)
(/
2.0
(*
(/ (fma 2.0 (pow (* (sin k) t) 2.0) (pow k 4.0)) (* (cos k) (* l l)))
t))
(if (<= k 9.2e+157)
(/ 2.0 (/ (/ (* (* (* k k) t) t_1) (* (cos k) l)) l))
(/ 2.0 (/ (* (pow (/ k l) 2.0) (* t_1 t)) (cos k)))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 26500.0) {
tmp = 2.0 / ((fma(2.0, pow((sin(k) * t), 2.0), pow(k, 4.0)) / (cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l);
} else {
tmp = 2.0 / ((pow((k / l), 2.0) * (t_1 * t)) / cos(k));
}
return tmp;
}
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 26500.0) tmp = Float64(2.0 / Float64(Float64(fma(2.0, (Float64(sin(k) * t) ^ 2.0), (k ^ 4.0)) / Float64(cos(k) * Float64(l * l))) * t)); elseif (k <= 9.2e+157) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * t_1) / Float64(cos(k) * l)) / l)); else tmp = Float64(2.0 / Float64(Float64((Float64(k / l) ^ 2.0) * Float64(t_1 * t)) / cos(k))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 26500.0], N[(2.0 / N[(N[(N[(2.0 * N[Power[N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.2e+157], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 26500:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {k}^{4}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;k \leq 9.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot t\_1}{\cos k \cdot \ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(t\_1 \cdot t\right)}{\cos k}}\\
\end{array}
\end{array}
if k < 26500Initial program 57.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
lower-pow.f6470.4
Applied rewrites70.4%
if 26500 < k < 9.20000000000000015e157Initial program 48.3%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites77.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites84.2%
if 9.20000000000000015e157 < k Initial program 49.1%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6462.4
Applied rewrites62.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites92.0%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 12500.0)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(if (<= k 9.2e+157)
(/ 2.0 (/ (/ (* (* (* k k) t) t_1) (* (cos k) l)) l))
(/ 2.0 (/ (* (pow (/ k l) 2.0) (* t_1 t)) (cos k)))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l);
} else {
tmp = 2.0 / ((pow((k / l), 2.0) * (t_1 * t)) / cos(k));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (k <= 12500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else if (k <= 9.2d+157) then
tmp = 2.0d0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l)
else
tmp = 2.0d0 / ((((k / l) ** 2.0d0) * (t_1 * t)) / cos(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (Math.cos(k) * l)) / l);
} else {
tmp = 2.0 / ((Math.pow((k / l), 2.0) * (t_1 * t)) / Math.cos(k));
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 12500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) elif k <= 9.2e+157: tmp = 2.0 / (((((k * k) * t) * t_1) / (math.cos(k) * l)) / l) else: tmp = 2.0 / ((math.pow((k / l), 2.0) * (t_1 * t)) / math.cos(k)) return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 12500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); elseif (k <= 9.2e+157) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * t_1) / Float64(cos(k) * l)) / l)); else tmp = Float64(2.0 / Float64(Float64((Float64(k / l) ^ 2.0) * Float64(t_1 * t)) / cos(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 12500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); elseif (k <= 9.2e+157) tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l); else tmp = 2.0 / ((((k / l) ^ 2.0) * (t_1 * t)) / cos(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 12500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.2e+157], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 12500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;k \leq 9.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot t\_1}{\cos k \cdot \ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(t\_1 \cdot t\right)}{\cos k}}\\
\end{array}
\end{array}
if k < 12500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 12500 < k < 9.20000000000000015e157Initial program 48.2%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites77.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites84.3%
if 9.20000000000000015e157 < k Initial program 49.1%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6462.4
Applied rewrites62.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites92.0%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 12500.0)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(if (<= k 9.2e+157)
(/ 2.0 (/ (/ (* (* (* k k) t) t_1) (* (cos k) l)) l))
(/ 2.0 (* (pow (/ k l) 2.0) (* t_1 (/ t (cos k)))))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l);
} else {
tmp = 2.0 / (pow((k / l), 2.0) * (t_1 * (t / cos(k))));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (k <= 12500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else if (k <= 9.2d+157) then
tmp = 2.0d0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l)
else
tmp = 2.0d0 / (((k / l) ** 2.0d0) * (t_1 * (t / cos(k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (Math.cos(k) * l)) / l);
} else {
tmp = 2.0 / (Math.pow((k / l), 2.0) * (t_1 * (t / Math.cos(k))));
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 12500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) elif k <= 9.2e+157: tmp = 2.0 / (((((k * k) * t) * t_1) / (math.cos(k) * l)) / l) else: tmp = 2.0 / (math.pow((k / l), 2.0) * (t_1 * (t / math.cos(k)))) return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 12500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); elseif (k <= 9.2e+157) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * t_1) / Float64(cos(k) * l)) / l)); else tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(t_1 * Float64(t / cos(k))))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 12500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); elseif (k <= 9.2e+157) tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l); else tmp = 2.0 / (((k / l) ^ 2.0) * (t_1 * (t / cos(k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 12500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.2e+157], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$1 * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 12500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;k \leq 9.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot t\_1}{\cos k \cdot \ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(t\_1 \cdot \frac{t}{\cos k}\right)}\\
\end{array}
\end{array}
if k < 12500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 12500 < k < 9.20000000000000015e157Initial program 48.2%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites77.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites84.3%
if 9.20000000000000015e157 < k Initial program 49.1%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6462.4
Applied rewrites62.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6492.1
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6492.1
Applied rewrites92.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 12500.0)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(if (<= k 9.2e+157)
(/ 2.0 (/ (/ (* (* (* k k) t) t_1) (* (cos k) l)) l))
(/ 2.0 (* (* (/ k l) (/ k l)) (/ (* t_1 t) (cos k))))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l);
} else {
tmp = 2.0 / (((k / l) * (k / l)) * ((t_1 * t) / cos(k)));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (k <= 12500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else if (k <= 9.2d+157) then
tmp = 2.0d0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l)
else
tmp = 2.0d0 / (((k / l) * (k / l)) * ((t_1 * t) / cos(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else if (k <= 9.2e+157) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (Math.cos(k) * l)) / l);
} else {
tmp = 2.0 / (((k / l) * (k / l)) * ((t_1 * t) / Math.cos(k)));
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 12500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) elif k <= 9.2e+157: tmp = 2.0 / (((((k * k) * t) * t_1) / (math.cos(k) * l)) / l) else: tmp = 2.0 / (((k / l) * (k / l)) * ((t_1 * t) / math.cos(k))) return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 12500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); elseif (k <= 9.2e+157) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * t_1) / Float64(cos(k) * l)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * Float64(k / l)) * Float64(Float64(t_1 * t) / cos(k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 12500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); elseif (k <= 9.2e+157) tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l); else tmp = 2.0 / (((k / l) * (k / l)) * ((t_1 * t) / cos(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 12500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.2e+157], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * t), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 12500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;k \leq 9.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot t\_1}{\cos k \cdot \ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right) \cdot \frac{t\_1 \cdot t}{\cos k}}\\
\end{array}
\end{array}
if k < 12500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 12500 < k < 9.20000000000000015e157Initial program 48.2%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6472.8
Applied rewrites72.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites77.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites84.3%
if 9.20000000000000015e157 < k Initial program 49.1%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6462.4
Applied rewrites62.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.1
Applied rewrites92.1%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= k 12500.0)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(if (<= k 2.15e+160)
(/ 2.0 (/ (/ (* (* (* k k) t) t_1) (* (cos k) l)) l))
(/ 2.0 (* (* k (/ k (* l l))) (/ (* t_1 t) (cos k))))))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else if (k <= 2.15e+160) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l);
} else {
tmp = 2.0 / ((k * (k / (l * l))) * ((t_1 * t) / cos(k)));
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (k <= 12500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else if (k <= 2.15d+160) then
tmp = 2.0d0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l)
else
tmp = 2.0d0 / ((k * (k / (l * l))) * ((t_1 * t) / cos(k)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.pow(Math.sin(k), 2.0);
double tmp;
if (k <= 12500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else if (k <= 2.15e+160) {
tmp = 2.0 / (((((k * k) * t) * t_1) / (Math.cos(k) * l)) / l);
} else {
tmp = 2.0 / ((k * (k / (l * l))) * ((t_1 * t) / Math.cos(k)));
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if k <= 12500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) elif k <= 2.15e+160: tmp = 2.0 / (((((k * k) * t) * t_1) / (math.cos(k) * l)) / l) else: tmp = 2.0 / ((k * (k / (l * l))) * ((t_1 * t) / math.cos(k))) return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 12500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); elseif (k <= 2.15e+160) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(k * k) * t) * t_1) / Float64(cos(k) * l)) / l)); else tmp = Float64(2.0 / Float64(Float64(k * Float64(k / Float64(l * l))) * Float64(Float64(t_1 * t) / cos(k)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (k <= 12500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); elseif (k <= 2.15e+160) tmp = 2.0 / (((((k * k) * t) * t_1) / (cos(k) * l)) / l); else tmp = 2.0 / ((k * (k / (l * l))) * ((t_1 * t) / cos(k))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k, 12500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.15e+160], N[(2.0 / N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * N[(k / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * t), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;k \leq 12500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{elif}\;k \leq 2.15 \cdot 10^{+160}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot t\_1}{\cos k \cdot \ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{k}{\ell \cdot \ell}\right) \cdot \frac{t\_1 \cdot t}{\cos k}}\\
\end{array}
\end{array}
if k < 12500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 12500 < k < 2.14999999999999994e160Initial program 48.1%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6472.4
Applied rewrites72.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites77.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites83.8%
if 2.14999999999999994e160 < k Initial program 49.3%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6473.1
Applied rewrites73.1%
(FPCore (t l k) :precision binary64 (if (<= k 13500.0) (/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t)) (/ 2.0 (/ (* (* k (* k t)) (pow (sin k) 2.0)) (* (* (cos k) l) l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 13500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * (k * t)) * pow(sin(k), 2.0)) / ((cos(k) * l) * l));
}
return tmp;
}
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
real(8) :: tmp
if (k <= 13500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else
tmp = 2.0d0 / (((k * (k * t)) * (sin(k) ** 2.0d0)) / ((cos(k) * l) * l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 13500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * (k * t)) * Math.pow(Math.sin(k), 2.0)) / ((Math.cos(k) * l) * l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 13500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) else: tmp = 2.0 / (((k * (k * t)) * math.pow(math.sin(k), 2.0)) / ((math.cos(k) * l) * l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 13500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(k * t)) * (sin(k) ^ 2.0)) / Float64(Float64(cos(k) * l) * l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 13500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); else tmp = 2.0 / (((k * (k * t)) * (sin(k) ^ 2.0)) / ((cos(k) * l) * l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 13500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 13500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot \left(k \cdot t\right)\right) \cdot {\sin k}^{2}}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\
\end{array}
\end{array}
if k < 13500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 13500 < k Initial program 48.6%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.6
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites70.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6476.1
Applied rewrites76.1%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 1e+297) (/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t)) (/ 2.0 (* (* (* (* (/ (* t t) l) (/ t l)) (sin k)) (tan k)) 2.0))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e+297) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k)) * tan(k)) * 2.0);
}
return tmp;
}
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
real(8) :: tmp
if ((l * l) <= 1d+297) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else
tmp = 2.0d0 / ((((((t * t) / l) * (t / l)) * sin(k)) * tan(k)) * 2.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 1e+297) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / ((((((t * t) / l) * (t / l)) * Math.sin(k)) * Math.tan(k)) * 2.0);
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 1e+297: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) else: tmp = 2.0 / ((((((t * t) / l) * (t / l)) * math.sin(k)) * math.tan(k)) * 2.0) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 1e+297) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t * t) / l) * Float64(t / l)) * sin(k)) * tan(k)) * 2.0)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 1e+297) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); else tmp = 2.0 / ((((((t * t) / l) * (t / l)) * sin(k)) * tan(k)) * 2.0); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 1e+297], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(N[(t * t), $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 10^{+297}:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t \cdot t}{\ell} \cdot \frac{t}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
if (*.f64 l l) < 1e297Initial program 62.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6470.6
Applied rewrites70.6%
if 1e297 < (*.f64 l l) Initial program 33.6%
Taylor expanded in t around inf
Applied rewrites47.9%
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-/.f6461.0
Applied rewrites61.0%
(FPCore (t l k)
:precision binary64
(if (<= k 13500.0)
(/ 2.0 (* (/ (* (pow (* k t) 2.0) 2.0) (* (cos k) (* l l))) t))
(/
2.0
(/
(* (* (* k k) t) (- 0.5 (* 0.5 (cos (* 2.0 k)))))
(* (* (cos k) l) l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 13500.0) {
tmp = 2.0 / (((pow((k * t), 2.0) * 2.0) / (cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / ((((k * k) * t) * (0.5 - (0.5 * cos((2.0 * k))))) / ((cos(k) * l) * l));
}
return tmp;
}
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
real(8) :: tmp
if (k <= 13500.0d0) then
tmp = 2.0d0 / (((((k * t) ** 2.0d0) * 2.0d0) / (cos(k) * (l * l))) * t)
else
tmp = 2.0d0 / ((((k * k) * t) * (0.5d0 - (0.5d0 * cos((2.0d0 * k))))) / ((cos(k) * l) * l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 13500.0) {
tmp = 2.0 / (((Math.pow((k * t), 2.0) * 2.0) / (Math.cos(k) * (l * l))) * t);
} else {
tmp = 2.0 / ((((k * k) * t) * (0.5 - (0.5 * Math.cos((2.0 * k))))) / ((Math.cos(k) * l) * l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 13500.0: tmp = 2.0 / (((math.pow((k * t), 2.0) * 2.0) / (math.cos(k) * (l * l))) * t) else: tmp = 2.0 / ((((k * k) * t) * (0.5 - (0.5 * math.cos((2.0 * k))))) / ((math.cos(k) * l) * l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 13500.0) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) * 2.0) / Float64(cos(k) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k))))) / Float64(Float64(cos(k) * l) * l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 13500.0) tmp = 2.0 / (((((k * t) ^ 2.0) * 2.0) / (cos(k) * (l * l))) * t); else tmp = 2.0 / ((((k * k) * t) * (0.5 - (0.5 * cos((2.0 * k))))) / ((cos(k) * l) * l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 13500.0], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 13500:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot t\right)}^{2} \cdot 2}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right)}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\
\end{array}
\end{array}
if k < 13500Initial program 57.4%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6468.6
Applied rewrites68.6%
if 13500 < k Initial program 48.6%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.6
Applied rewrites67.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites70.1%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6470.0
Applied rewrites70.0%
(FPCore (t l k) :precision binary64 (if (<= t 3.4e-21) (/ 2.0 (* (/ (* k k) (* l l)) (/ (* (* k k) t) (cos k)))) (/ 2.0 (* (* (/ (pow (* k t) 2.0) (* l l)) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (t <= 3.4e-21) {
tmp = 2.0 / (((k * k) / (l * l)) * (((k * k) * t) / cos(k)));
} else {
tmp = 2.0 / (((pow((k * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
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
real(8) :: tmp
if (t <= 3.4d-21) then
tmp = 2.0d0 / (((k * k) / (l * l)) * (((k * k) * t) / cos(k)))
else
tmp = 2.0d0 / (((((k * t) ** 2.0d0) / (l * l)) * 2.0d0) * t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 3.4e-21) {
tmp = 2.0 / (((k * k) / (l * l)) * (((k * k) * t) / Math.cos(k)));
} else {
tmp = 2.0 / (((Math.pow((k * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 3.4e-21: tmp = 2.0 / (((k * k) / (l * l)) * (((k * k) * t) / math.cos(k))) else: tmp = 2.0 / (((math.pow((k * t), 2.0) / (l * l)) * 2.0) * t) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 3.4e-21) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(Float64(Float64(k * k) * t) / cos(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) / Float64(l * l)) * 2.0) * t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 3.4e-21) tmp = 2.0 / (((k * k) / (l * l)) * (((k * k) * t) / cos(k))); else tmp = 2.0 / (((((k * t) ^ 2.0) / (l * l)) * 2.0) * t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 3.4e-21], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.4 \cdot 10^{-21}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \frac{\left(k \cdot k\right) \cdot t}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 3.4e-21Initial program 50.7%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f6458.1
Applied rewrites58.1%
if 3.4e-21 < t Initial program 66.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.4
Applied rewrites71.4%
(FPCore (t l k) :precision binary64 (if (<= t 1.55e-29) (/ 2.0 (/ (* (* (* k k) t) (* k k)) (* (* (cos k) l) l))) (/ 2.0 (* (* (/ (pow (* k t) 2.0) (* l l)) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.55e-29) {
tmp = 2.0 / ((((k * k) * t) * (k * k)) / ((cos(k) * l) * l));
} else {
tmp = 2.0 / (((pow((k * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
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
real(8) :: tmp
if (t <= 1.55d-29) then
tmp = 2.0d0 / ((((k * k) * t) * (k * k)) / ((cos(k) * l) * l))
else
tmp = 2.0d0 / (((((k * t) ** 2.0d0) / (l * l)) * 2.0d0) * t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.55e-29) {
tmp = 2.0 / ((((k * k) * t) * (k * k)) / ((Math.cos(k) * l) * l));
} else {
tmp = 2.0 / (((Math.pow((k * t), 2.0) / (l * l)) * 2.0) * t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1.55e-29: tmp = 2.0 / ((((k * k) * t) * (k * k)) / ((math.cos(k) * l) * l)) else: tmp = 2.0 / (((math.pow((k * t), 2.0) / (l * l)) * 2.0) * t) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1.55e-29) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(k * k)) / Float64(Float64(cos(k) * l) * l))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k * t) ^ 2.0) / Float64(l * l)) * 2.0) * t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.55e-29) tmp = 2.0 / ((((k * k) * t) * (k * k)) / ((cos(k) * l) * l)); else tmp = 2.0 / (((((k * t) ^ 2.0) / (l * l)) * 2.0) * t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1.55e-29], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.55 \cdot 10^{-29}:\\
\;\;\;\;\frac{2}{\frac{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(k \cdot k\right)}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\
\end{array}
\end{array}
if t < 1.55000000000000013e-29Initial program 50.5%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6463.6
Applied rewrites63.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
frac-timesN/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites64.6%
Taylor expanded in k around 0
pow2N/A
lift-*.f6456.7
Applied rewrites56.7%
if 1.55000000000000013e-29 < t Initial program 67.1%
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.2
Applied rewrites71.2%
(FPCore (t l k) :precision binary64 (if (<= t 1.45e-22) (/ 2.0 (* (pow (/ k l) 2.0) (* (* k k) t))) (/ (* l l) (* (pow (* k t) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.45e-22) {
tmp = 2.0 / (pow((k / l), 2.0) * ((k * k) * t));
} else {
tmp = (l * l) / (pow((k * t), 2.0) * t);
}
return tmp;
}
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
real(8) :: tmp
if (t <= 1.45d-22) then
tmp = 2.0d0 / (((k / l) ** 2.0d0) * ((k * k) * t))
else
tmp = (l * l) / (((k * t) ** 2.0d0) * t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1.45e-22) {
tmp = 2.0 / (Math.pow((k / l), 2.0) * ((k * k) * t));
} else {
tmp = (l * l) / (Math.pow((k * t), 2.0) * t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1.45e-22: tmp = 2.0 / (math.pow((k / l), 2.0) * ((k * k) * t)) else: tmp = (l * l) / (math.pow((k * t), 2.0) * t) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1.45e-22) tmp = Float64(2.0 / Float64((Float64(k / l) ^ 2.0) * Float64(Float64(k * k) * t))); else tmp = Float64(Float64(l * l) / Float64((Float64(k * t) ^ 2.0) * t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1.45e-22) tmp = 2.0 / (((k / l) ^ 2.0) * ((k * k) * t)); else tmp = (l * l) / (((k * t) ^ 2.0) * t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1.45e-22], N[(2.0 / N[(N[Power[N[(k / l), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.45 \cdot 10^{-22}:\\
\;\;\;\;\frac{2}{{\left(\frac{k}{\ell}\right)}^{2} \cdot \left(\left(k \cdot k\right) \cdot t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\
\end{array}
\end{array}
if t < 1.4500000000000001e-22Initial program 50.7%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6463.7
Applied rewrites63.7%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6455.6
Applied rewrites55.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
unpow2N/A
lift-pow.f64N/A
lift-/.f6458.8
Applied rewrites58.8%
if 1.4500000000000001e-22 < t Initial program 67.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.f6456.3
Applied rewrites56.3%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6456.3
Applied rewrites56.3%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6471.9
Applied rewrites71.9%
(FPCore (t l k)
:precision binary64
(if (<= t 1.55e-29)
(/
2.0
(*
(/
(*
(fma
(+
(fma
(-
(fma
(fma -0.006349206349206349 (* t t) 0.044444444444444446)
(* k k)
(* 0.08888888888888889 (* t t)))
0.3333333333333333)
(* k k)
(* -0.6666666666666666 (* t t)))
1.0)
(* k k)
(* (* t t) 2.0))
(* k k))
(* 1.0 (* l l)))
t))
(/ (* l l) (* (pow (* k t) 2.0) t))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1.55e-29) {
tmp = 2.0 / (((fma((fma((fma(fma(-0.006349206349206349, (t * t), 0.044444444444444446), (k * k), (0.08888888888888889 * (t * t))) - 0.3333333333333333), (k * k), (-0.6666666666666666 * (t * t))) + 1.0), (k * k), ((t * t) * 2.0)) * (k * k)) / (1.0 * (l * l))) * t);
} else {
tmp = (l * l) / (pow((k * t), 2.0) * t);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (t <= 1.55e-29) tmp = Float64(2.0 / Float64(Float64(Float64(fma(Float64(fma(Float64(fma(fma(-0.006349206349206349, Float64(t * t), 0.044444444444444446), Float64(k * k), Float64(0.08888888888888889 * Float64(t * t))) - 0.3333333333333333), Float64(k * k), Float64(-0.6666666666666666 * Float64(t * t))) + 1.0), Float64(k * k), Float64(Float64(t * t) * 2.0)) * Float64(k * k)) / Float64(1.0 * Float64(l * l))) * t)); else tmp = Float64(Float64(l * l) / Float64((Float64(k * t) ^ 2.0) * t)); end return tmp end
code[t_, l_, k_] := If[LessEqual[t, 1.55e-29], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(N[(-0.006349206349206349 * N[(t * t), $MachinePrecision] + 0.044444444444444446), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(0.08888888888888889 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(-0.6666666666666666 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(1.0 * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.55 \cdot 10^{-29}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.006349206349206349, t \cdot t, 0.044444444444444446\right), k \cdot k, 0.08888888888888889 \cdot \left(t \cdot t\right)\right) - 0.3333333333333333, k \cdot k, -0.6666666666666666 \cdot \left(t \cdot t\right)\right) + 1, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{1 \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\
\end{array}
\end{array}
if t < 1.55000000000000013e-29Initial program 50.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.5%
Taylor expanded in k around 0
Applied rewrites48.8%
if 1.55000000000000013e-29 < t Initial program 67.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6456.4
Applied rewrites56.4%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6471.6
Applied rewrites71.6%
(FPCore (t l k)
:precision binary64
(if (<= k 6.6e-153)
(/ (* l l) (* (pow (* k t) 2.0) t))
(if (<= k 2.55e+33)
(/
2.0
(*
(/
(*
(*
(fma
(-
(* (fma (* k k) -0.006349206349206349 0.08888888888888889) (* k k))
0.6666666666666666)
(* k k)
2.0)
(* t t))
(* k k))
(* (fma (- (* 0.041666666666666664 (* k k)) 0.5) (* k k) 1.0) (* l l)))
t))
(/ 2.0 (* (/ (* k k) (* l l)) (* k (* k t)))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 6.6e-153) {
tmp = (l * l) / (pow((k * t), 2.0) * t);
} else if (k <= 2.55e+33) {
tmp = 2.0 / ((((fma(((fma((k * k), -0.006349206349206349, 0.08888888888888889) * (k * k)) - 0.6666666666666666), (k * k), 2.0) * (t * t)) * (k * k)) / (fma(((0.041666666666666664 * (k * k)) - 0.5), (k * k), 1.0) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 6.6e-153) tmp = Float64(Float64(l * l) / Float64((Float64(k * t) ^ 2.0) * t)); elseif (k <= 2.55e+33) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(Float64(fma(Float64(k * k), -0.006349206349206349, 0.08888888888888889) * Float64(k * k)) - 0.6666666666666666), Float64(k * k), 2.0) * Float64(t * t)) * Float64(k * k)) / Float64(fma(Float64(Float64(0.041666666666666664 * Float64(k * k)) - 0.5), Float64(k * k), 1.0) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * Float64(k * t)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 6.6e-153], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.55e+33], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.6666666666666666), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(0.041666666666666664 * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.6 \cdot 10^{-153}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\
\mathbf{elif}\;k \leq 2.55 \cdot 10^{+33}:\\
\;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, -0.006349206349206349, 0.08888888888888889\right) \cdot \left(k \cdot k\right) - 0.6666666666666666, k \cdot k, 2\right) \cdot \left(t \cdot t\right)\right) \cdot \left(k \cdot k\right)}{\mathsf{fma}\left(0.041666666666666664 \cdot \left(k \cdot k\right) - 0.5, k \cdot k, 1\right) \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if k < 6.59999999999999975e-153Initial program 56.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6450.2
Applied rewrites50.2%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6450.2
Applied rewrites50.2%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
if 6.59999999999999975e-153 < k < 2.5499999999999999e33Initial program 62.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.1%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6455.0
Applied rewrites55.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.2%
if 2.5499999999999999e33 < k Initial program 47.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.3
Applied rewrites67.3%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6456.4
Applied rewrites56.4%
(FPCore (t l k)
:precision binary64
(if (<= k 4.5e-165)
(/ (* l l) (* k (* k (pow t 3.0))))
(if (<= k 2.55e+33)
(/
2.0
(*
(/
(*
(*
(fma
(-
(* (fma (* k k) -0.006349206349206349 0.08888888888888889) (* k k))
0.6666666666666666)
(* k k)
2.0)
(* t t))
(* k k))
(* (fma (- (* 0.041666666666666664 (* k k)) 0.5) (* k k) 1.0) (* l l)))
t))
(/ 2.0 (* (/ (* k k) (* l l)) (* k (* k t)))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.5e-165) {
tmp = (l * l) / (k * (k * pow(t, 3.0)));
} else if (k <= 2.55e+33) {
tmp = 2.0 / ((((fma(((fma((k * k), -0.006349206349206349, 0.08888888888888889) * (k * k)) - 0.6666666666666666), (k * k), 2.0) * (t * t)) * (k * k)) / (fma(((0.041666666666666664 * (k * k)) - 0.5), (k * k), 1.0) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 4.5e-165) tmp = Float64(Float64(l * l) / Float64(k * Float64(k * (t ^ 3.0)))); elseif (k <= 2.55e+33) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(Float64(fma(Float64(k * k), -0.006349206349206349, 0.08888888888888889) * Float64(k * k)) - 0.6666666666666666), Float64(k * k), 2.0) * Float64(t * t)) * Float64(k * k)) / Float64(fma(Float64(Float64(0.041666666666666664 * Float64(k * k)) - 0.5), Float64(k * k), 1.0) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * Float64(k * t)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 4.5e-165], N[(N[(l * l), $MachinePrecision] / N[(k * N[(k * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.55e+33], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.6666666666666666), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(0.041666666666666664 * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.5 \cdot 10^{-165}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k \cdot \left(k \cdot {t}^{3}\right)}\\
\mathbf{elif}\;k \leq 2.55 \cdot 10^{+33}:\\
\;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, -0.006349206349206349, 0.08888888888888889\right) \cdot \left(k \cdot k\right) - 0.6666666666666666, k \cdot k, 2\right) \cdot \left(t \cdot t\right)\right) \cdot \left(k \cdot k\right)}{\mathsf{fma}\left(0.041666666666666664 \cdot \left(k \cdot k\right) - 0.5, k \cdot k, 1\right) \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if k < 4.49999999999999992e-165Initial program 55.9%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6450.0
Applied rewrites50.0%
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f6456.8
Applied rewrites56.8%
if 4.49999999999999992e-165 < k < 2.5499999999999999e33Initial program 62.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.4%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites56.3%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6455.3
Applied rewrites55.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.6%
if 2.5499999999999999e33 < k Initial program 47.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.3
Applied rewrites67.3%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6456.4
Applied rewrites56.4%
(FPCore (t l k)
:precision binary64
(if (<= k 2.55e+33)
(/
2.0
(*
(/
(*
(*
(fma
(-
(* (fma (* k k) -0.006349206349206349 0.08888888888888889) (* k k))
0.6666666666666666)
(* k k)
2.0)
(* t t))
(* k k))
(* (fma (- (* 0.041666666666666664 (* k k)) 0.5) (* k k) 1.0) (* l l)))
t))
(/ 2.0 (* (/ (* k k) (* l l)) (* k (* k t))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 2.55e+33) {
tmp = 2.0 / ((((fma(((fma((k * k), -0.006349206349206349, 0.08888888888888889) * (k * k)) - 0.6666666666666666), (k * k), 2.0) * (t * t)) * (k * k)) / (fma(((0.041666666666666664 * (k * k)) - 0.5), (k * k), 1.0) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 2.55e+33) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(Float64(fma(Float64(k * k), -0.006349206349206349, 0.08888888888888889) * Float64(k * k)) - 0.6666666666666666), Float64(k * k), 2.0) * Float64(t * t)) * Float64(k * k)) / Float64(fma(Float64(Float64(0.041666666666666664 * Float64(k * k)) - 0.5), Float64(k * k), 1.0) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * Float64(k * t)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 2.55e+33], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * -0.006349206349206349 + 0.08888888888888889), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.6666666666666666), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(0.041666666666666664 * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 2.55 \cdot 10^{+33}:\\
\;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, -0.006349206349206349, 0.08888888888888889\right) \cdot \left(k \cdot k\right) - 0.6666666666666666, k \cdot k, 2\right) \cdot \left(t \cdot t\right)\right) \cdot \left(k \cdot k\right)}{\mathsf{fma}\left(0.041666666666666664 \cdot \left(k \cdot k\right) - 0.5, k \cdot k, 1\right) \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if k < 2.5499999999999999e33Initial program 57.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.0%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6438.2
Applied rewrites38.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites43.7%
if 2.5499999999999999e33 < k Initial program 47.8%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.3
Applied rewrites67.3%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6456.4
Applied rewrites56.4%
(FPCore (t l k)
:precision binary64
(if (<= k 26500.0)
(/
2.0
(*
(/
(* (* (* t t) 2.0) (* k k))
(* (fma (- (* 0.041666666666666664 (* k k)) 0.5) (* k k) 1.0) (* l l)))
t))
(/ 2.0 (* (/ (* k k) (* l l)) (* k (* k t))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 26500.0) {
tmp = 2.0 / (((((t * t) * 2.0) * (k * k)) / (fma(((0.041666666666666664 * (k * k)) - 0.5), (k * k), 1.0) * (l * l))) * t);
} else {
tmp = 2.0 / (((k * k) / (l * l)) * (k * (k * t)));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 26500.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t * t) * 2.0) * Float64(k * k)) / Float64(fma(Float64(Float64(0.041666666666666664 * Float64(k * k)) - 0.5), Float64(k * k), 1.0) * Float64(l * l))) * t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / Float64(l * l)) * Float64(k * Float64(k * t)))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 26500.0], N[(2.0 / N[(N[(N[(N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(0.041666666666666664 * N[(k * k), $MachinePrecision]), $MachinePrecision] - 0.5), $MachinePrecision] * N[(k * k), $MachinePrecision] + 1.0), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 26500:\\
\;\;\;\;\frac{2}{\frac{\left(\left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\mathsf{fma}\left(0.041666666666666664 \cdot \left(k \cdot k\right) - 0.5, k \cdot k, 1\right) \cdot \left(\ell \cdot \ell\right)} \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if k < 26500Initial program 57.3%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.6%
Taylor expanded in k around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6438.6
Applied rewrites38.6%
Taylor expanded in k around 0
*-commutativeN/A
pow2N/A
lift-*.f64N/A
lift-*.f6444.6
Applied rewrites44.6%
if 26500 < k Initial program 48.7%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
lower-cos.f6467.6
Applied rewrites67.6%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lift-*.f6454.9
Applied rewrites54.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.9
Applied rewrites54.9%
(FPCore (t l k) :precision binary64 (/ (* l l) (* (* k k) (* (* t t) t))))
double code(double t, double l, double k) {
return (l * l) / ((k * k) * ((t * t) * t));
}
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 = (l * l) / ((k * k) * ((t * t) * t))
end function
public static double code(double t, double l, double k) {
return (l * l) / ((k * k) * ((t * t) * t));
}
def code(t, l, k): return (l * l) / ((k * k) * ((t * t) * t))
function code(t, l, k) return Float64(Float64(l * l) / Float64(Float64(k * k) * Float64(Float64(t * t) * t))) end
function tmp = code(t, l, k) tmp = (l * l) / ((k * k) * ((t * t) * t)); end
code[t_, l_, k_] := N[(N[(l * l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}
\end{array}
Initial program 55.2%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6451.2
Applied rewrites51.2%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6451.2
Applied rewrites51.2%
herbie shell --seed 2025093
(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))))