
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (* (* (/ l k) (* (/ l k) (/ (/ (cos k) t) (pow (sin k) 2.0)))) 2.0))
double code(double t, double l, double k) {
return ((l / k) * ((l / k) * ((cos(k) / t) / pow(sin(k), 2.0)))) * 2.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 = ((l / k) * ((l / k) * ((cos(k) / t) / (sin(k) ** 2.0d0)))) * 2.0d0
end function
public static double code(double t, double l, double k) {
return ((l / k) * ((l / k) * ((Math.cos(k) / t) / Math.pow(Math.sin(k), 2.0)))) * 2.0;
}
def code(t, l, k): return ((l / k) * ((l / k) * ((math.cos(k) / t) / math.pow(math.sin(k), 2.0)))) * 2.0
function code(t, l, k) return Float64(Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(Float64(cos(k) / t) / (sin(k) ^ 2.0)))) * 2.0) end
function tmp = code(t, l, k) tmp = ((l / k) * ((l / k) * ((cos(k) / t) / (sin(k) ^ 2.0)))) * 2.0; end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t}}{{\sin k}^{2}}\right)\right) \cdot 2
\end{array}
Initial program 35.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.7
Applied rewrites73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites73.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6490.9
Applied rewrites90.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
lift-pow.f6496.3
Applied rewrites96.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= l 7.5e-148)
(/ 2.0 (/ (* (/ t_1 l) (* (* k k) t)) l))
(if (<= l 2.9e+133)
(* (/ (* (/ (cos k) t) (* (/ l k) l)) (* t_1 k)) 2.0)
(* (* (* (/ l k) (/ l k)) (/ (cos k) (* t_1 t))) 2.0)))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (l <= 7.5e-148) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 2.9e+133) {
tmp = (((cos(k) / t) * ((l / k) * l)) / (t_1 * k)) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 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) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (l <= 7.5d-148) then
tmp = 2.0d0 / (((t_1 / l) * ((k * k) * t)) / l)
else if (l <= 2.9d+133) then
tmp = (((cos(k) / t) * ((l / k) * l)) / (t_1 * k)) * 2.0d0
else
tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 2.0d0
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 (l <= 7.5e-148) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 2.9e+133) {
tmp = (((Math.cos(k) / t) * ((l / k) * l)) / (t_1 * k)) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if l <= 7.5e-148: tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l) elif l <= 2.9e+133: tmp = (((math.cos(k) / t) * ((l / k) * l)) / (t_1 * k)) * 2.0 else: tmp = (((l / k) * (l / k)) * (math.cos(k) / (t_1 * t))) * 2.0 return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (l <= 7.5e-148) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 / l) * Float64(Float64(k * k) * t)) / l)); elseif (l <= 2.9e+133) tmp = Float64(Float64(Float64(Float64(cos(k) / t) * Float64(Float64(l / k) * l)) / Float64(t_1 * k)) * 2.0); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(t_1 * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (l <= 7.5e-148) tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l); elseif (l <= 2.9e+133) tmp = (((cos(k) / t) * ((l / k) * l)) / (t_1 * k)) * 2.0; else tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, 7.5e-148], N[(2.0 / N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.9e+133], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;\ell \leq 7.5 \cdot 10^{-148}:\\
\;\;\;\;\frac{2}{\frac{\frac{t\_1}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell}}\\
\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+133}:\\
\;\;\;\;\frac{\frac{\cos k}{t} \cdot \left(\frac{\ell}{k} \cdot \ell\right)}{t\_1 \cdot k} \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t\_1 \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if l < 7.5000000000000005e-148Initial program 32.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6470.6
Applied rewrites70.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites85.3%
Taylor expanded in k around 0
Applied rewrites76.9%
if 7.5000000000000005e-148 < l < 2.9000000000000001e133Initial program 44.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6489.7
Applied rewrites89.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites89.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.4
Applied rewrites93.4%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites96.0%
if 2.9000000000000001e133 < l Initial program 34.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6461.7
Applied rewrites61.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites62.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)) (t_2 (* t_1 t)))
(if (<= l 8e-122)
(/ 2.0 (/ (* (/ t_1 l) (* (* k k) t)) l))
(if (<= l 1.6e+147)
(* (/ (* (* (/ l k) l) (cos k)) (* k t_2)) 2.0)
(* (* (* (/ l k) (/ l k)) (/ (cos k) t_2)) 2.0)))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double t_2 = t_1 * t;
double tmp;
if (l <= 8e-122) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 1.6e+147) {
tmp = ((((l / k) * l) * cos(k)) / (k * t_2)) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / t_2)) * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
t_2 = t_1 * t
if (l <= 8d-122) then
tmp = 2.0d0 / (((t_1 / l) * ((k * k) * t)) / l)
else if (l <= 1.6d+147) then
tmp = ((((l / k) * l) * cos(k)) / (k * t_2)) * 2.0d0
else
tmp = (((l / k) * (l / k)) * (cos(k) / t_2)) * 2.0d0
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 t_2 = t_1 * t;
double tmp;
if (l <= 8e-122) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 1.6e+147) {
tmp = ((((l / k) * l) * Math.cos(k)) / (k * t_2)) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / t_2)) * 2.0;
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) t_2 = t_1 * t tmp = 0 if l <= 8e-122: tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l) elif l <= 1.6e+147: tmp = ((((l / k) * l) * math.cos(k)) / (k * t_2)) * 2.0 else: tmp = (((l / k) * (l / k)) * (math.cos(k) / t_2)) * 2.0 return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 t_2 = Float64(t_1 * t) tmp = 0.0 if (l <= 8e-122) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 / l) * Float64(Float64(k * k) * t)) / l)); elseif (l <= 1.6e+147) tmp = Float64(Float64(Float64(Float64(Float64(l / k) * l) * cos(k)) / Float64(k * t_2)) * 2.0); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / t_2)) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; t_2 = t_1 * t; tmp = 0.0; if (l <= 8e-122) tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l); elseif (l <= 1.6e+147) tmp = ((((l / k) * l) * cos(k)) / (k * t_2)) * 2.0; else tmp = (((l / k) * (l / k)) * (cos(k) / t_2)) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t), $MachinePrecision]}, If[LessEqual[l, 8e-122], N[(2.0 / N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e+147], N[(N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(k * t$95$2), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
t_2 := t\_1 \cdot t\\
\mathbf{if}\;\ell \leq 8 \cdot 10^{-122}:\\
\;\;\;\;\frac{2}{\frac{\frac{t\_1}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell}}\\
\mathbf{elif}\;\ell \leq 1.6 \cdot 10^{+147}:\\
\;\;\;\;\frac{\left(\frac{\ell}{k} \cdot \ell\right) \cdot \cos k}{k \cdot t\_2} \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t\_2}\right) \cdot 2\\
\end{array}
\end{array}
if l < 8.00000000000000047e-122Initial program 32.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.3
Applied rewrites71.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites85.6%
Taylor expanded in k around 0
Applied rewrites77.2%
if 8.00000000000000047e-122 < l < 1.59999999999999989e147Initial program 44.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6488.3
Applied rewrites88.3%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites89.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6496.6
Applied rewrites96.6%
if 1.59999999999999989e147 < l Initial program 34.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6461.2
Applied rewrites61.2%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites61.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.7
Applied rewrites94.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= l 8e-122)
(/ 2.0 (/ (* (/ t_1 l) (* (* k k) t)) l))
(if (<= l 1.6e+147)
(* (/ (* (* (/ l k) l) (cos k)) (* k (* t_1 t))) 2.0)
(*
(*
(* (/ l k) (/ l k))
(/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (l <= 8e-122) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 1.6e+147) {
tmp = ((((l / k) * l) * cos(k)) / (k * (t_1 * t))) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 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) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (l <= 8d-122) then
tmp = 2.0d0 / (((t_1 / l) * ((k * k) * t)) / l)
else if (l <= 1.6d+147) then
tmp = ((((l / k) * l) * cos(k)) / (k * (t_1 * t))) * 2.0d0
else
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t))) * 2.0d0
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 (l <= 8e-122) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 1.6e+147) {
tmp = ((((l / k) * l) * Math.cos(k)) / (k * (t_1 * t))) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if l <= 8e-122: tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l) elif l <= 1.6e+147: tmp = ((((l / k) * l) * math.cos(k)) / (k * (t_1 * t))) * 2.0 else: tmp = (((l / k) * (l / k)) * (math.cos(k) / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t))) * 2.0 return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (l <= 8e-122) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 / l) * Float64(Float64(k * k) * t)) / l)); elseif (l <= 1.6e+147) tmp = Float64(Float64(Float64(Float64(Float64(l / k) * l) * cos(k)) / Float64(k * Float64(t_1 * t))) * 2.0); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (l <= 8e-122) tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l); elseif (l <= 1.6e+147) tmp = ((((l / k) * l) * cos(k)) / (k * (t_1 * t))) * 2.0; else tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, 8e-122], N[(2.0 / N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.6e+147], N[(N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(k * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;\ell \leq 8 \cdot 10^{-122}:\\
\;\;\;\;\frac{2}{\frac{\frac{t\_1}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell}}\\
\mathbf{elif}\;\ell \leq 1.6 \cdot 10^{+147}:\\
\;\;\;\;\frac{\left(\frac{\ell}{k} \cdot \ell\right) \cdot \cos k}{k \cdot \left(t\_1 \cdot t\right)} \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if l < 8.00000000000000047e-122Initial program 32.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.3
Applied rewrites71.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites85.6%
Taylor expanded in k around 0
Applied rewrites77.2%
if 8.00000000000000047e-122 < l < 1.59999999999999989e147Initial program 44.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6488.3
Applied rewrites88.3%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites89.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-cos.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f6496.6
Applied rewrites96.6%
if 1.59999999999999989e147 < l Initial program 34.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6461.2
Applied rewrites61.2%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites61.9%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.7
Applied rewrites94.7%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6494.4
Applied rewrites94.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= l 7.8e-157)
(/ 2.0 (/ (* (/ t_1 l) (* (* k k) t)) l))
(if (<= l 6e+76)
(* (/ 2.0 (* k (* k t))) (/ (* (cos k) (* l l)) t_1))
(*
(*
(* (/ l k) (/ l k))
(/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (l <= 7.8e-157) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 6e+76) {
tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l * l)) / t_1);
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 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) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (l <= 7.8d-157) then
tmp = 2.0d0 / (((t_1 / l) * ((k * k) * t)) / l)
else if (l <= 6d+76) then
tmp = (2.0d0 / (k * (k * t))) * ((cos(k) * (l * l)) / t_1)
else
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t))) * 2.0d0
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 (l <= 7.8e-157) {
tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l);
} else if (l <= 6e+76) {
tmp = (2.0 / (k * (k * t))) * ((Math.cos(k) * (l * l)) / t_1);
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if l <= 7.8e-157: tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l) elif l <= 6e+76: tmp = (2.0 / (k * (k * t))) * ((math.cos(k) * (l * l)) / t_1) else: tmp = (((l / k) * (l / k)) * (math.cos(k) / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t))) * 2.0 return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (l <= 7.8e-157) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 / l) * Float64(Float64(k * k) * t)) / l)); elseif (l <= 6e+76) tmp = Float64(Float64(2.0 / Float64(k * Float64(k * t))) * Float64(Float64(cos(k) * Float64(l * l)) / t_1)); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (l <= 7.8e-157) tmp = 2.0 / (((t_1 / l) * ((k * k) * t)) / l); elseif (l <= 6e+76) tmp = (2.0 / (k * (k * t))) * ((cos(k) * (l * l)) / t_1); else tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, 7.8e-157], N[(2.0 / N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 6e+76], N[(N[(2.0 / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;\ell \leq 7.8 \cdot 10^{-157}:\\
\;\;\;\;\frac{2}{\frac{\frac{t\_1}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell}}\\
\mathbf{elif}\;\ell \leq 6 \cdot 10^{+76}:\\
\;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if l < 7.79999999999999998e-157Initial program 32.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6470.3
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites85.2%
Taylor expanded in k around 0
Applied rewrites76.8%
if 7.79999999999999998e-157 < l < 5.9999999999999996e76Initial program 44.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6493.2
Applied rewrites93.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6496.2
Applied rewrites96.2%
if 5.9999999999999996e76 < l Initial program 36.8%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6465.6
Applied rewrites65.6%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites68.0%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.9
Applied rewrites94.9%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6493.8
Applied rewrites93.8%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (pow (sin k) 2.0)))
(if (<= l 2.5e+42)
(/ 2.0 (/ (* (/ t_1 l) (* k (* k t))) (* l (cos k))))
(* (* (* (/ l k) (/ l k)) (/ (cos k) (* t_1 t))) 2.0))))
double code(double t, double l, double k) {
double t_1 = pow(sin(k), 2.0);
double tmp;
if (l <= 2.5e+42) {
tmp = 2.0 / (((t_1 / l) * (k * (k * t))) / (l * cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 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) :: t_1
real(8) :: tmp
t_1 = sin(k) ** 2.0d0
if (l <= 2.5d+42) then
tmp = 2.0d0 / (((t_1 / l) * (k * (k * t))) / (l * cos(k)))
else
tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 2.0d0
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 (l <= 2.5e+42) {
tmp = 2.0 / (((t_1 / l) * (k * (k * t))) / (l * Math.cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / (t_1 * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): t_1 = math.pow(math.sin(k), 2.0) tmp = 0 if l <= 2.5e+42: tmp = 2.0 / (((t_1 / l) * (k * (k * t))) / (l * math.cos(k))) else: tmp = (((l / k) * (l / k)) * (math.cos(k) / (t_1 * t))) * 2.0 return tmp
function code(t, l, k) t_1 = sin(k) ^ 2.0 tmp = 0.0 if (l <= 2.5e+42) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 / l) * Float64(k * Float64(k * t))) / Float64(l * cos(k)))); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(t_1 * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) t_1 = sin(k) ^ 2.0; tmp = 0.0; if (l <= 2.5e+42) tmp = 2.0 / (((t_1 / l) * (k * (k * t))) / (l * cos(k))); else tmp = (((l / k) * (l / k)) * (cos(k) / (t_1 * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[l, 2.5e+42], N[(2.0 / N[(N[(N[(t$95$1 / l), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\sin k}^{2}\\
\mathbf{if}\;\ell \leq 2.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{2}{\frac{\frac{t\_1}{\ell} \cdot \left(k \cdot \left(k \cdot t\right)\right)}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{t\_1 \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if l < 2.50000000000000003e42Initial program 34.6%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6475.0
Applied rewrites75.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6489.5
Applied rewrites89.5%
if 2.50000000000000003e42 < l Initial program 37.6%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6468.3
Applied rewrites68.3%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites70.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
(FPCore (t l k)
:precision binary64
(if (<= k 0.00019)
(/ 2.0 (/ (* (/ (* k k) l) (* (* k k) t)) (* l (cos k))))
(if (<= k 1.6e+154)
(*
(* (/ (* l l) (* k k)) (/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)
(* (* (* (/ l k) (/ l k)) (/ 1.0 (* (pow (sin k) 2.0) t))) 2.0))))
double code(double t, double l, double k) {
double tmp;
if (k <= 0.00019) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)));
} else if (k <= 1.6e+154) {
tmp = (((l * l) / (k * k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (1.0 / (pow(sin(k), 2.0) * t))) * 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 (k <= 0.00019d0) then
tmp = 2.0d0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)))
else if (k <= 1.6d+154) then
tmp = (((l * l) / (k * k)) * (cos(k) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t))) * 2.0d0
else
tmp = (((l / k) * (l / k)) * (1.0d0 / ((sin(k) ** 2.0d0) * t))) * 2.0d0
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 0.00019) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * Math.cos(k)));
} else if (k <= 1.6e+154) {
tmp = (((l * l) / (k * k)) * (Math.cos(k) / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t))) * 2.0;
} else {
tmp = (((l / k) * (l / k)) * (1.0 / (Math.pow(Math.sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 0.00019: tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * math.cos(k))) elif k <= 1.6e+154: tmp = (((l * l) / (k * k)) * (math.cos(k) / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t))) * 2.0 else: tmp = (((l / k) * (l / k)) * (1.0 / (math.pow(math.sin(k), 2.0) * t))) * 2.0 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 0.00019) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * k) * t)) / Float64(l * cos(k)))); elseif (k <= 1.6e+154) tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k * k)) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))) * 2.0); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(1.0 / Float64((sin(k) ^ 2.0) * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 0.00019) tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k))); elseif (k <= 1.6e+154) tmp = (((l * l) / (k * k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0; else tmp = (((l / k) * (l / k)) * (1.0 / ((sin(k) ^ 2.0) * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 0.00019], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.6e+154], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00019:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot k}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell \cdot \cos k}}\\
\mathbf{elif}\;k \leq 1.6 \cdot 10^{+154}:\\
\;\;\;\;\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 1.9000000000000001e-4Initial program 37.0%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f6479.6
Applied rewrites79.6%
if 1.9000000000000001e-4 < k < 1.6e154Initial program 22.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6480.1
Applied rewrites80.1%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites81.0%
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-*.f6480.7
Applied rewrites80.7%
if 1.6e154 < k Initial program 38.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6461.4
Applied rewrites61.4%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites61.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in k around 0
Applied rewrites67.9%
(FPCore (t l k)
:precision binary64
(if (<= k 0.00019)
(/ 2.0 (/ (* (/ (* k k) l) (* (* k k) t)) (* l (cos k))))
(*
(* (* (/ l k) (/ l k)) (/ (cos k) (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) t)))
2.0)))
double code(double t, double l, double k) {
double tmp;
if (k <= 0.00019) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 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 (k <= 0.00019d0) then
tmp = 2.0d0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)))
else
tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * t))) * 2.0d0
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 0.00019) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * Math.cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (Math.cos(k) / ((0.5 - (0.5 * Math.cos((2.0 * k)))) * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 0.00019: tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * math.cos(k))) else: tmp = (((l / k) * (l / k)) * (math.cos(k) / ((0.5 - (0.5 * math.cos((2.0 * k)))) * t))) * 2.0 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 0.00019) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * k) * t)) / Float64(l * cos(k)))); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 0.00019) tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k))); else tmp = (((l / k) * (l / k)) * (cos(k) / ((0.5 - (0.5 * cos((2.0 * k)))) * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 0.00019], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.00019:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot k}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 1.9000000000000001e-4Initial program 37.0%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites86.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f6479.6
Applied rewrites79.6%
if 1.9000000000000001e-4 < k Initial program 30.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6470.7
Applied rewrites70.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites71.2%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6491.8
Applied rewrites91.8%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6491.5
Applied rewrites91.5%
(FPCore (t l k) :precision binary64 (if (<= k 4.3e+17) (/ 2.0 (/ (* (/ (* k k) l) (* (* k k) t)) (* l (cos k)))) (* (* (* (/ l k) (/ l k)) (/ 1.0 (* (pow (sin k) 2.0) t))) 2.0)))
double code(double t, double l, double k) {
double tmp;
if (k <= 4.3e+17) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (1.0 / (pow(sin(k), 2.0) * t))) * 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 (k <= 4.3d+17) then
tmp = 2.0d0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)))
else
tmp = (((l / k) * (l / k)) * (1.0d0 / ((sin(k) ** 2.0d0) * t))) * 2.0d0
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 4.3e+17) {
tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * Math.cos(k)));
} else {
tmp = (((l / k) * (l / k)) * (1.0 / (Math.pow(Math.sin(k), 2.0) * t))) * 2.0;
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 4.3e+17: tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * math.cos(k))) else: tmp = (((l / k) * (l / k)) * (1.0 / (math.pow(math.sin(k), 2.0) * t))) * 2.0 return tmp
function code(t, l, k) tmp = 0.0 if (k <= 4.3e+17) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * k) * t)) / Float64(l * cos(k)))); else tmp = Float64(Float64(Float64(Float64(l / k) * Float64(l / k)) * Float64(1.0 / Float64((sin(k) ^ 2.0) * t))) * 2.0); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 4.3e+17) tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k))); else tmp = (((l / k) * (l / k)) * (1.0 / ((sin(k) ^ 2.0) * t))) * 2.0; end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 4.3e+17], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.3 \cdot 10^{+17}:\\
\;\;\;\;\frac{2}{\frac{\frac{k \cdot k}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell \cdot \cos k}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{1}{{\sin k}^{2} \cdot t}\right) \cdot 2\\
\end{array}
\end{array}
if k < 4.3e17Initial program 36.6%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.8
Applied rewrites74.8%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites87.0%
Taylor expanded in k around 0
pow2N/A
lift-*.f6479.1
Applied rewrites79.1%
if 4.3e17 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6469.9
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites70.4%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.3
Applied rewrites92.3%
Taylor expanded in k around 0
Applied rewrites60.4%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (/ (pow (sin k) 2.0) l) (* (* k k) t)) l)))
double code(double t, double l, double k) {
return 2.0 / (((pow(sin(k), 2.0) / l) * ((k * k) * t)) / l);
}
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 / ((((sin(k) ** 2.0d0) / l) * ((k * k) * t)) / l)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.pow(Math.sin(k), 2.0) / l) * ((k * k) * t)) / l);
}
def code(t, l, k): return 2.0 / (((math.pow(math.sin(k), 2.0) / l) * ((k * k) * t)) / l)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) / l) * Float64(Float64(k * k) * t)) / l)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((sin(k) ^ 2.0) / l) * ((k * k) * t)) / l); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\frac{{\sin k}^{2}}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell}}
\end{array}
Initial program 35.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.6
Applied rewrites73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites84.3%
Taylor expanded in k around 0
Applied rewrites74.2%
(FPCore (t l k) :precision binary64 (/ 2.0 (/ (* (/ (* k k) l) (* (* k k) t)) (* l (cos k)))))
double code(double t, double l, double k) {
return 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)));
}
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 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k)))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * Math.cos(k)));
}
def code(t, l, k): return 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * math.cos(k)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) / l) * Float64(Float64(k * k) * t)) / Float64(l * cos(k)))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * k) / l) * ((k * k) * t)) / (l * cos(k))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\frac{k \cdot k}{\ell} \cdot \left(\left(k \cdot k\right) \cdot t\right)}{\ell \cdot \cos k}}
\end{array}
Initial program 35.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.6
Applied rewrites73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites84.3%
Taylor expanded in k around 0
pow2N/A
lift-*.f6473.8
Applied rewrites73.8%
(FPCore (t l k) :precision binary64 (if (<= k 3.9e-78) (* (/ 2.0 (* (* k k) t)) (pow (/ l k) 2.0)) (* (/ 2.0 (pow k 4.0)) (* l (/ l t)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.9e-78) {
tmp = (2.0 / ((k * k) * t)) * pow((l / k), 2.0);
} else {
tmp = (2.0 / pow(k, 4.0)) * (l * (l / 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 (k <= 3.9d-78) then
tmp = (2.0d0 / ((k * k) * t)) * ((l / k) ** 2.0d0)
else
tmp = (2.0d0 / (k ** 4.0d0)) * (l * (l / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.9e-78) {
tmp = (2.0 / ((k * k) * t)) * Math.pow((l / k), 2.0);
} else {
tmp = (2.0 / Math.pow(k, 4.0)) * (l * (l / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3.9e-78: tmp = (2.0 / ((k * k) * t)) * math.pow((l / k), 2.0) else: tmp = (2.0 / math.pow(k, 4.0)) * (l * (l / t)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3.9e-78) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * (Float64(l / k) ^ 2.0)); else tmp = Float64(Float64(2.0 / (k ^ 4.0)) * Float64(l * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.9e-78) tmp = (2.0 / ((k * k) * t)) * ((l / k) ^ 2.0); else tmp = (2.0 / (k ^ 4.0)) * (l * (l / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3.9e-78], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[Power[N[(l / k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.9 \cdot 10^{-78}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot {\left(\frac{\ell}{k}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{k}^{4}} \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if k < 3.9000000000000002e-78Initial program 38.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.0
Applied rewrites74.0%
lift-pow.f64N/A
lift-sin.f64N/A
metadata-evalN/A
pow-negN/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f6474.0
Applied rewrites74.0%
Taylor expanded in k around 0
pow2N/A
pow2N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
pow2N/A
lower-pow.f6476.8
Applied rewrites76.8%
if 3.9000000000000002e-78 < k Initial program 28.8%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6460.8
Applied rewrites60.8%
(FPCore (t l k) :precision binary64 (if (<= t 2.5e-71) (* (/ 2.0 (pow k 4.0)) (* l (/ l t))) (* (/ 2.0 (* (* k k) t)) (/ (* l l) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (t <= 2.5e-71) {
tmp = (2.0 / pow(k, 4.0)) * (l * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * 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) :: tmp
if (t <= 2.5d-71) then
tmp = (2.0d0 / (k ** 4.0d0)) * (l * (l / t))
else
tmp = (2.0d0 / ((k * k) * t)) * ((l * l) / (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 2.5e-71) {
tmp = (2.0 / Math.pow(k, 4.0)) * (l * (l / t));
} else {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 2.5e-71: tmp = (2.0 / math.pow(k, 4.0)) * (l * (l / t)) else: tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 2.5e-71) tmp = Float64(Float64(2.0 / (k ^ 4.0)) * Float64(l * Float64(l / t))); else tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l * l) / Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 2.5e-71) tmp = (2.0 / (k ^ 4.0)) * (l * (l / t)); else tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 2.5e-71], N[(N[(2.0 / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.5 \cdot 10^{-71}:\\
\;\;\;\;\frac{2}{{k}^{4}} \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k}\\
\end{array}
\end{array}
if t < 2.49999999999999999e-71Initial program 34.8%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6459.2
Applied rewrites59.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6463.8
Applied rewrites63.8%
if 2.49999999999999999e-71 < t Initial program 36.5%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6475.7
Applied rewrites75.7%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6469.7
Applied rewrites69.7%
(FPCore (t l k) :precision binary64 (if (<= k 3.9e-78) (* (/ 2.0 (* (* k k) t)) (/ (* l l) (* k k))) (* (/ 2.0 (* (* k k) (* k k))) (/ (* l l) t))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.9e-78) {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
} else {
tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / 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 (k <= 3.9d-78) then
tmp = (2.0d0 / ((k * k) * t)) * ((l * l) / (k * k))
else
tmp = (2.0d0 / ((k * k) * (k * k))) * ((l * l) / t)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3.9e-78) {
tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
} else {
tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3.9e-78: tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)) else: tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3.9e-78) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l * l) / Float64(k * k))); else tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) * Float64(Float64(l * l) / t)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3.9e-78) tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)); else tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3.9e-78], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.9 \cdot 10^{-78}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{t}\\
\end{array}
\end{array}
if k < 3.9000000000000002e-78Initial program 38.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6474.0
Applied rewrites74.0%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6467.3
Applied rewrites67.3%
if 3.9000000000000002e-78 < k Initial program 28.8%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
(FPCore (t l k) :precision binary64 (* (/ 2.0 (* (* k k) t)) (/ (* l l) (* k k))))
double code(double t, double l, double k) {
return (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
}
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 / ((k * k) * t)) * ((l * l) / (k * k))
end function
public static double code(double t, double l, double k) {
return (2.0 / ((k * k) * t)) * ((l * l) / (k * k));
}
def code(t, l, k): return (2.0 / ((k * k) * t)) * ((l * l) / (k * k))
function code(t, l, k) return Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(l * l) / Float64(k * k))) end
function tmp = code(t, l, k) tmp = (2.0 / ((k * k) * t)) * ((l * l) / (k * k)); end
code[t_, l_, k_] := N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k}
\end{array}
Initial program 35.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.7
Applied rewrites73.7%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6464.8
Applied rewrites64.8%
(FPCore (t l k) :precision binary64 (* (* (/ (* l l) (* k k)) (/ -0.16666666666666666 t)) 2.0))
double code(double t, double l, double k) {
return (((l * l) / (k * k)) * (-0.16666666666666666 / t)) * 2.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 = (((l * l) / (k * k)) * ((-0.16666666666666666d0) / t)) * 2.0d0
end function
public static double code(double t, double l, double k) {
return (((l * l) / (k * k)) * (-0.16666666666666666 / t)) * 2.0;
}
def code(t, l, k): return (((l * l) / (k * k)) * (-0.16666666666666666 / t)) * 2.0
function code(t, l, k) return Float64(Float64(Float64(Float64(l * l) / Float64(k * k)) * Float64(-0.16666666666666666 / t)) * 2.0) end
function tmp = code(t, l, k) tmp = (((l * l) / (k * k)) * (-0.16666666666666666 / t)) * 2.0; end
code[t_, l_, k_] := N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{-0.16666666666666666}{t}\right) \cdot 2
\end{array}
Initial program 35.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
lower-pow.f64N/A
lift-sin.f6473.7
Applied rewrites73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
associate-*r/N/A
Applied rewrites73.9%
Taylor expanded in k around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
inv-powN/A
lower-pow.f64N/A
pow2N/A
lift-*.f6448.4
Applied rewrites48.4%
Taylor expanded in k around inf
lower-/.f6428.8
Applied rewrites28.8%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / 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 = (-0.11666666666666667d0) * ((l * l) / t)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
def code(t, l, k): return -0.11666666666666667 * ((l * l) / t)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l * l) / t); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 35.3%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.8%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6419.9
Applied rewrites19.9%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* (/ l t) l)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l / t) * l);
}
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 = (-0.11666666666666667d0) * ((l / t) * l)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l / t) * l);
}
def code(t, l, k): return -0.11666666666666667 * ((l / t) * l)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l / t) * l)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l / t) * l); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \left(\frac{\ell}{t} \cdot \ell\right)
\end{array}
Initial program 35.3%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites27.8%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6419.9
Applied rewrites19.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6417.7
Applied rewrites17.7%
herbie shell --seed 2025091
(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))))