
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)))
(if (<= l_m 2.25e+167)
(* (* (/ (/ 1.0 t) (sin k)) (/ 2.0 (sin k))) (/ (* t_1 (/ l_m k)) k))
(/ (* 2.0 (* t_1 (/ (/ l_m k) k))) (* (- 0.5 (* (cos (+ k k)) 0.5)) t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double tmp;
if (l_m <= 2.25e+167) {
tmp = (((1.0 / t) / sin(k)) * (2.0 / sin(k))) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (cos((k + k)) * 0.5)) * t);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l_m
if (l_m <= 2.25d+167) then
tmp = (((1.0d0 / t) / sin(k)) * (2.0d0 / sin(k))) * ((t_1 * (l_m / k)) / k)
else
tmp = (2.0d0 * (t_1 * ((l_m / k) / k))) / ((0.5d0 - (cos((k + k)) * 0.5d0)) * t)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 2.25e+167) {
tmp = (((1.0 / t) / Math.sin(k)) * (2.0 / Math.sin(k))) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (Math.cos((k + k)) * 0.5)) * t);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m tmp = 0 if l_m <= 2.25e+167: tmp = (((1.0 / t) / math.sin(k)) * (2.0 / math.sin(k))) * ((t_1 * (l_m / k)) / k) else: tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (math.cos((k + k)) * 0.5)) * t) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 2.25e+167) tmp = Float64(Float64(Float64(Float64(1.0 / t) / sin(k)) * Float64(2.0 / sin(k))) * Float64(Float64(t_1 * Float64(l_m / k)) / k)); else tmp = Float64(Float64(2.0 * Float64(t_1 * Float64(Float64(l_m / k) / k))) / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; tmp = 0.0; if (l_m <= 2.25e+167) tmp = (((1.0 / t) / sin(k)) * (2.0 / sin(k))) * ((t_1 * (l_m / k)) / k); else tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (cos((k + k)) * 0.5)) * t); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 2.25e+167], N[(N[(N[(N[(1.0 / t), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(t$95$1 * N[(N[(l$95$m / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 2.25 \cdot 10^{+167}:\\
\;\;\;\;\left(\frac{\frac{1}{t}}{\sin k} \cdot \frac{2}{\sin k}\right) \cdot \frac{t\_1 \cdot \frac{l\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \frac{\frac{l\_m}{k}}{k}\right)}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t}\\
\end{array}
\end{array}
if l < 2.25e167Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
count-2-revN/A
metadata-evalN/A
distribute-lft-neg-inN/A
*-commutativeN/A
*-commutativeN/A
associate-/r*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
metadata-evalN/A
count-2-revN/A
Applied rewrites88.4%
if 2.25e167 < l Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*l/N/A
Applied rewrites80.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)) (t_2 (* (- 0.5 (* (cos (+ k k)) 0.5)) t)))
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(if (<= k 2.05e+220)
(/ (* 2.0 (* t_1 (/ (/ l_m k) k))) t_2)
(/ (* 2.0 (* t_1 (/ l_m k))) (* t_2 k))))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double t_2 = (0.5 - (cos((k + k)) * 0.5)) * t;
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else if (k <= 2.05e+220) {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / t_2;
} else {
tmp = (2.0 * (t_1 * (l_m / k))) / (t_2 * k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = cos(k) * l_m
t_2 = (0.5d0 - (cos((k + k)) * 0.5d0)) * t
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else if (k <= 2.05d+220) then
tmp = (2.0d0 * (t_1 * ((l_m / k) / k))) / t_2
else
tmp = (2.0d0 * (t_1 * (l_m / k))) / (t_2 * k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.cos(k) * l_m;
double t_2 = (0.5 - (Math.cos((k + k)) * 0.5)) * t;
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else if (k <= 2.05e+220) {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / t_2;
} else {
tmp = (2.0 * (t_1 * (l_m / k))) / (t_2 * k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m t_2 = (0.5 - (math.cos((k + k)) * 0.5)) * t tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) elif k <= 2.05e+220: tmp = (2.0 * (t_1 * ((l_m / k) / k))) / t_2 else: tmp = (2.0 * (t_1 * (l_m / k))) / (t_2 * k) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) t_2 = Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); elseif (k <= 2.05e+220) tmp = Float64(Float64(2.0 * Float64(t_1 * Float64(Float64(l_m / k) / k))) / t_2); else tmp = Float64(Float64(2.0 * Float64(t_1 * Float64(l_m / k))) / Float64(t_2 * k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; t_2 = (0.5 - (cos((k + k)) * 0.5)) * t; tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); elseif (k <= 2.05e+220) tmp = (2.0 * (t_1 * ((l_m / k) / k))) / t_2; else tmp = (2.0 * (t_1 * (l_m / k))) / (t_2 * k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.05e+220], N[(N[(2.0 * N[(t$95$1 * N[(N[(l$95$m / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(2.0 * N[(t$95$1 * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * k), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
t_2 := \left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\\
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{elif}\;k \leq 2.05 \cdot 10^{+220}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \frac{\frac{l\_m}{k}}{k}\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \frac{l\_m}{k}\right)}{t\_2 \cdot k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k < 2.0499999999999999e220Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*l/N/A
Applied rewrites80.3%
if 2.0499999999999999e220 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)))
(if (<= l_m 1.5e+187)
(* (/ 2.0 (* (pow (sin k) 2.0) t)) (/ (* t_1 (/ l_m k)) k))
(/ (* 2.0 (* t_1 (/ (/ l_m k) k))) (* (- 0.5 (* (cos (+ k k)) 0.5)) t)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double tmp;
if (l_m <= 1.5e+187) {
tmp = (2.0 / (pow(sin(k), 2.0) * t)) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (cos((k + k)) * 0.5)) * t);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l_m
if (l_m <= 1.5d+187) then
tmp = (2.0d0 / ((sin(k) ** 2.0d0) * t)) * ((t_1 * (l_m / k)) / k)
else
tmp = (2.0d0 * (t_1 * ((l_m / k) / k))) / ((0.5d0 - (cos((k + k)) * 0.5d0)) * t)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 1.5e+187) {
tmp = (2.0 / (Math.pow(Math.sin(k), 2.0) * t)) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (Math.cos((k + k)) * 0.5)) * t);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m tmp = 0 if l_m <= 1.5e+187: tmp = (2.0 / (math.pow(math.sin(k), 2.0) * t)) * ((t_1 * (l_m / k)) / k) else: tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (math.cos((k + k)) * 0.5)) * t) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 1.5e+187) tmp = Float64(Float64(2.0 / Float64((sin(k) ^ 2.0) * t)) * Float64(Float64(t_1 * Float64(l_m / k)) / k)); else tmp = Float64(Float64(2.0 * Float64(t_1 * Float64(Float64(l_m / k) / k))) / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; tmp = 0.0; if (l_m <= 1.5e+187) tmp = (2.0 / ((sin(k) ^ 2.0) * t)) * ((t_1 * (l_m / k)) / k); else tmp = (2.0 * (t_1 * ((l_m / k) / k))) / ((0.5 - (cos((k + k)) * 0.5)) * t); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 1.5e+187], N[(N[(2.0 / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(t$95$1 * N[(N[(l$95$m / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 1.5 \cdot 10^{+187}:\\
\;\;\;\;\frac{2}{{\sin k}^{2} \cdot t} \cdot \frac{t\_1 \cdot \frac{l\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \frac{\frac{l\_m}{k}}{k}\right)}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t}\\
\end{array}
\end{array}
if l < 1.5e187Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lower-sin.f6487.5
Applied rewrites87.5%
if 1.5e187 < l Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*l/N/A
Applied rewrites80.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(*
(/ 2.0 (* (- 0.5 (* (cos (+ k k)) 0.5)) t))
(/ (* (* (cos k) l_m) (/ l_m k)) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / ((0.5 - (cos((k + k)) * 0.5)) * t)) * (((cos(k) * l_m) * (l_m / k)) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (2.0d0 / ((0.5d0 - (cos((k + k)) * 0.5d0)) * t)) * (((cos(k) * l_m) * (l_m / k)) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / ((0.5 - (Math.cos((k + k)) * 0.5)) * t)) * (((Math.cos(k) * l_m) * (l_m / k)) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (2.0 / ((0.5 - (math.cos((k + k)) * 0.5)) * t)) * (((math.cos(k) * l_m) * (l_m / k)) / k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t)) * Float64(Float64(Float64(cos(k) * l_m) * Float64(l_m / k)) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (2.0 / ((0.5 - (cos((k + k)) * 0.5)) * t)) * (((cos(k) * l_m) * (l_m / k)) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t} \cdot \frac{\left(\cos k \cdot l\_m\right) \cdot \frac{l\_m}{k}}{k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(*
(/ 2.0 (* (- 0.5 (* (cos (+ k k)) 0.5)) t))
(/ (* (cos k) (* l_m (/ l_m k))) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / ((0.5 - (cos((k + k)) * 0.5)) * t)) * ((cos(k) * (l_m * (l_m / k))) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (2.0d0 / ((0.5d0 - (cos((k + k)) * 0.5d0)) * t)) * ((cos(k) * (l_m * (l_m / k))) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / ((0.5 - (Math.cos((k + k)) * 0.5)) * t)) * ((Math.cos(k) * (l_m * (l_m / k))) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (2.0 / ((0.5 - (math.cos((k + k)) * 0.5)) * t)) * ((math.cos(k) * (l_m * (l_m / k))) / k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(2.0 / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t)) * Float64(Float64(cos(k) * Float64(l_m * Float64(l_m / k))) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (2.0 / ((0.5 - (cos((k + k)) * 0.5)) * t)) * ((cos(k) * (l_m * (l_m / k))) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * N[(l$95$m * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t} \cdot \frac{\cos k \cdot \left(l\_m \cdot \frac{l\_m}{k}\right)}{k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lower-*.f64N/A
lift-/.f6479.7
Applied rewrites79.7%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(/
(* 2.0 (* (* (cos k) l_m) (/ l_m k)))
(* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 * ((cos(k) * l_m) * (l_m / k))) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (2.0d0 * ((cos(k) * l_m) * (l_m / k))) / (((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 * ((Math.cos(k) * l_m) * (l_m / k))) / (((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (2.0 * ((math.cos(k) * l_m) * (l_m / k))) / (((0.5 - (math.cos((k + k)) * 0.5)) * t) * k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(2.0 * Float64(Float64(cos(k) * l_m) * Float64(l_m / k))) / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (2.0 * ((cos(k) * l_m) * (l_m / k))) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(\left(\cos k \cdot l\_m\right) \cdot \frac{l\_m}{k}\right)}{\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\right) \cdot k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.2%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(*
(/ (* (* l_m l_m) 2.0) (* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k))
(/ (cos k) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (((l_m * l_m) * 2.0) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (cos(k) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (((l_m * l_m) * 2.0d0) / (((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k)) * (cos(k) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (((l_m * l_m) * 2.0) / (((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k)) * (Math.cos(k) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (((l_m * l_m) * 2.0) / (((0.5 - (math.cos((k + k)) * 0.5)) * t) * k)) * (math.cos(k) / k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(Float64(Float64(l_m * l_m) * 2.0) / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k)) * Float64(cos(k) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (((l_m * l_m) * 2.0) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (cos(k) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(l\_m \cdot l\_m\right) \cdot 2}{\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\right) \cdot k} \cdot \frac{\cos k}{k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
Applied rewrites71.3%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(*
(/ 2.0 (* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k))
(/ (* (* (cos k) l_m) l_m) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (((cos(k) * l_m) * l_m) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (2.0d0 / (((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k)) * (((cos(k) * l_m) * l_m) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / (((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k)) * (((Math.cos(k) * l_m) * l_m) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (2.0 / (((0.5 - (math.cos((k + k)) * 0.5)) * t) * k)) * (((math.cos(k) * l_m) * l_m) / k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(2.0 / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k)) * Float64(Float64(Float64(cos(k) * l_m) * l_m) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (2.0 / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (((cos(k) * l_m) * l_m) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\right) \cdot k} \cdot \frac{\left(\cos k \cdot l\_m\right) \cdot l\_m}{k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Applied rewrites71.4%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(if (<= k 4.6e-5)
(* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t)))
(/
(* (* (* (cos k) l_m) l_m) 2.0)
(* (* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k) k))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (((cos(k) * l_m) * l_m) * 2.0) / ((((0.5 - (cos((k + k)) * 0.5)) * t) * k) * k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.6d-5) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (((cos(k) * l_m) * l_m) * 2.0d0) / ((((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k) * k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (k <= 4.6e-5) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (((Math.cos(k) * l_m) * l_m) * 2.0) / ((((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k) * k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if k <= 4.6e-5: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (((math.cos(k) * l_m) * l_m) * 2.0) / ((((0.5 - (math.cos((k + k)) * 0.5)) * t) * k) * k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (k <= 4.6e-5) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(Float64(Float64(cos(k) * l_m) * l_m) * 2.0) / Float64(Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k) * k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (k <= 4.6e-5) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (((cos(k) * l_m) * l_m) * 2.0) / ((((0.5 - (cos((k + k)) * 0.5)) * t) * k) * k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[k, 4.6e-5], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * l$95$m), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;k \leq 4.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\cos k \cdot l\_m\right) \cdot l\_m\right) \cdot 2}{\left(\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot t\right) \cdot k\right) \cdot k}\\
\end{array}
\end{array}
if k < 4.6e-5Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 4.6e-5 < k Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Applied rewrites69.7%
l_m = (fabs.f64 l)
(FPCore (t l_m k)
:precision binary64
(let* ((t_1 (* (cos k) l_m)))
(if (<= l_m 1.7e+169)
(* (/ 2.0 (* (* k k) t)) (/ (* t_1 (/ l_m k)) k))
(* (/ 2.0 (* (* (- 0.5 0.5) t) k)) (/ (* t_1 l_m) k)))))l_m = fabs(l);
double code(double t, double l_m, double k) {
double t_1 = cos(k) * l_m;
double tmp;
if (l_m <= 1.7e+169) {
tmp = (2.0 / ((k * k) * t)) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * ((t_1 * l_m) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = cos(k) * l_m
if (l_m <= 1.7d+169) then
tmp = (2.0d0 / ((k * k) * t)) * ((t_1 * (l_m / k)) / k)
else
tmp = (2.0d0 / (((0.5d0 - 0.5d0) * t) * k)) * ((t_1 * l_m) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double t_1 = Math.cos(k) * l_m;
double tmp;
if (l_m <= 1.7e+169) {
tmp = (2.0 / ((k * k) * t)) * ((t_1 * (l_m / k)) / k);
} else {
tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * ((t_1 * l_m) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): t_1 = math.cos(k) * l_m tmp = 0 if l_m <= 1.7e+169: tmp = (2.0 / ((k * k) * t)) * ((t_1 * (l_m / k)) / k) else: tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * ((t_1 * l_m) / k) return tmp
l_m = abs(l) function code(t, l_m, k) t_1 = Float64(cos(k) * l_m) tmp = 0.0 if (l_m <= 1.7e+169) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t)) * Float64(Float64(t_1 * Float64(l_m / k)) / k)); else tmp = Float64(Float64(2.0 / Float64(Float64(Float64(0.5 - 0.5) * t) * k)) * Float64(Float64(t_1 * l_m) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) t_1 = cos(k) * l_m; tmp = 0.0; if (l_m <= 1.7e+169) tmp = (2.0 / ((k * k) * t)) * ((t_1 * (l_m / k)) / k); else tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * ((t_1 * l_m) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision]
code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[l$95$m, 1.7e+169], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * l$95$m), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
t_1 := \cos k \cdot l\_m\\
\mathbf{if}\;l\_m \leq 1.7 \cdot 10^{+169}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{t\_1 \cdot \frac{l\_m}{k}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k} \cdot \frac{t\_1 \cdot l\_m}{k}\\
\end{array}
\end{array}
if l < 1.70000000000000014e169Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
sqr-sin-a-revN/A
unpow2N/A
lower-pow.f64N/A
lift-sin.f6473.3
Applied rewrites73.3%
Applied rewrites79.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f6471.8
Applied rewrites71.8%
if 1.70000000000000014e169 < l Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Applied rewrites71.4%
Taylor expanded in k around 0
Applied rewrites35.7%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= l_m 1.65e+156) (* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t))) (* (/ 2.0 (* (* (- 0.5 0.5) t) k)) (/ (* (* (cos k) l_m) l_m) k))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (l_m <= 1.65e+156) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * (((cos(k) * l_m) * l_m) / k);
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (l_m <= 1.65d+156) then
tmp = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
else
tmp = (2.0d0 / (((0.5d0 - 0.5d0) * t) * k)) * (((cos(k) * l_m) * l_m) / k)
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (l_m <= 1.65e+156) {
tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
} else {
tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * (((Math.cos(k) * l_m) * l_m) / k);
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if l_m <= 1.65e+156: tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)) else: tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * (((math.cos(k) * l_m) * l_m) / k) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (l_m <= 1.65e+156) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))); else tmp = Float64(Float64(2.0 / Float64(Float64(Float64(0.5 - 0.5) * t) * k)) * Float64(Float64(Float64(cos(k) * l_m) * l_m) / k)); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (l_m <= 1.65e+156) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); else tmp = (2.0 / (((0.5 - 0.5) * t) * k)) * (((cos(k) * l_m) * l_m) / k); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[l$95$m, 1.65e+156], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] * l$95$m), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;l\_m \leq 1.65 \cdot 10^{+156}:\\
\;\;\;\;\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k} \cdot \frac{\left(\cos k \cdot l\_m\right) \cdot l\_m}{k}\\
\end{array}
\end{array}
if l < 1.6499999999999999e156Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
if 1.6499999999999999e156 < l Initial program 36.2%
Taylor expanded in t around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Applied rewrites71.4%
Taylor expanded in k around 0
Applied rewrites35.7%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (/ (* 2.0 l_m) (* k k)) (/ l_m (* (* k k) t))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = ((2.0d0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t));
}
l_m = math.fabs(l) def code(t, l_m, k): return ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(Float64(2.0 * l_m) / Float64(k * k)) * Float64(l_m / Float64(Float64(k * k) * t))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = ((2.0 * l_m) / (k * k)) * (l_m / ((k * k) * t)); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2 \cdot l\_m}{k \cdot k} \cdot \frac{l\_m}{\left(k \cdot k\right) \cdot t}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6472.8
Applied rewrites72.8%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (* (/ (* 2.0 l_m) (* (* (* k k) t) k)) (/ l_m k)))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return ((2.0 * l_m) / (((k * k) * t) * k)) * (l_m / k);
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = ((2.0d0 * l_m) / (((k * k) * t) * k)) * (l_m / k)
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return ((2.0 * l_m) / (((k * k) * t) * k)) * (l_m / k);
}
l_m = math.fabs(l) def code(t, l_m, k): return ((2.0 * l_m) / (((k * k) * t) * k)) * (l_m / k)
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(Float64(2.0 * l_m) / Float64(Float64(Float64(k * k) * t) * k)) * Float64(l_m / k)) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = ((2.0 * l_m) / (((k * k) * t) * k)) * (l_m / k); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2 \cdot l\_m}{\left(\left(k \cdot k\right) \cdot t\right) \cdot k} \cdot \frac{l\_m}{k}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f6471.8
Applied rewrites71.8%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (if (<= t 2e+95) (* (/ (* 2.0 l_m) (* (* (* k k) k) k)) (/ l_m t)) (/ (* 2.0 (* l_m l_m)) (* (* k k) (* k (* k t))))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
double tmp;
if (t <= 2e+95) {
tmp = ((2.0 * l_m) / (((k * k) * k) * k)) * (l_m / t);
} else {
tmp = (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t)));
}
return tmp;
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 2d+95) then
tmp = ((2.0d0 * l_m) / (((k * k) * k) * k)) * (l_m / t)
else
tmp = (2.0d0 * (l_m * l_m)) / ((k * k) * (k * (k * t)))
end if
code = tmp
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
double tmp;
if (t <= 2e+95) {
tmp = ((2.0 * l_m) / (((k * k) * k) * k)) * (l_m / t);
} else {
tmp = (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t)));
}
return tmp;
}
l_m = math.fabs(l) def code(t, l_m, k): tmp = 0 if t <= 2e+95: tmp = ((2.0 * l_m) / (((k * k) * k) * k)) * (l_m / t) else: tmp = (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t))) return tmp
l_m = abs(l) function code(t, l_m, k) tmp = 0.0 if (t <= 2e+95) tmp = Float64(Float64(Float64(2.0 * l_m) / Float64(Float64(Float64(k * k) * k) * k)) * Float64(l_m / t)); else tmp = Float64(Float64(2.0 * Float64(l_m * l_m)) / Float64(Float64(k * k) * Float64(k * Float64(k * t)))); end return tmp end
l_m = abs(l); function tmp_2 = code(t, l_m, k) tmp = 0.0; if (t <= 2e+95) tmp = ((2.0 * l_m) / (((k * k) * k) * k)) * (l_m / t); else tmp = (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t))); end tmp_2 = tmp; end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := If[LessEqual[t, 2e+95], N[(N[(N[(2.0 * l$95$m), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{+95}:\\
\;\;\;\;\frac{2 \cdot l\_m}{\left(\left(k \cdot k\right) \cdot k\right) \cdot k} \cdot \frac{l\_m}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(l\_m \cdot l\_m\right)}{\left(k \cdot k\right) \cdot \left(k \cdot \left(k \cdot t\right)\right)}\\
\end{array}
\end{array}
if t < 2.00000000000000004e95Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites67.9%
if 2.00000000000000004e95 < t Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6464.0
Applied rewrites64.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ (* (* 2.0 l_m) l_m) (* (* k k) (* (* k k) t))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return ((2.0 * l_m) * l_m) / ((k * k) * ((k * k) * t));
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = ((2.0d0 * l_m) * l_m) / ((k * k) * ((k * k) * t))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return ((2.0 * l_m) * l_m) / ((k * k) * ((k * k) * t));
}
l_m = math.fabs(l) def code(t, l_m, k): return ((2.0 * l_m) * l_m) / ((k * k) * ((k * k) * t))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(Float64(2.0 * l_m) * l_m) / Float64(Float64(k * k) * Float64(Float64(k * k) * t))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = ((2.0 * l_m) * l_m) / ((k * k) * ((k * k) * t)); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(N[(2.0 * l$95$m), $MachinePrecision] * l$95$m), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{\left(2 \cdot l\_m\right) \cdot l\_m}{\left(k \cdot k\right) \cdot \left(\left(k \cdot k\right) \cdot t\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.0
Applied rewrites64.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ (* 2.0 (* l_m l_m)) (* (* k k) (* k (* k t)))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t)));
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = (2.0d0 * (l_m * l_m)) / ((k * k) * (k * (k * t)))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t)));
}
l_m = math.fabs(l) def code(t, l_m, k): return (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t)))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(2.0 * Float64(l_m * l_m)) / Float64(Float64(k * k) * Float64(k * Float64(k * t)))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (2.0 * (l_m * l_m)) / ((k * k) * (k * (k * t))); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(2.0 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2 \cdot \left(l\_m \cdot l\_m\right)}{\left(k \cdot k\right) \cdot \left(k \cdot \left(k \cdot t\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6464.0
Applied rewrites64.0%
l_m = (fabs.f64 l) (FPCore (t l_m k) :precision binary64 (/ (* 2.0 (* l_m l_m)) (* k (* k (* k (* k t))))))
l_m = fabs(l);
double code(double t, double l_m, double k) {
return (2.0 * (l_m * l_m)) / (k * (k * (k * (k * t))));
}
l_m = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l_m, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l_m
real(8), intent (in) :: k
code = (2.0d0 * (l_m * l_m)) / (k * (k * (k * (k * t))))
end function
l_m = Math.abs(l);
public static double code(double t, double l_m, double k) {
return (2.0 * (l_m * l_m)) / (k * (k * (k * (k * t))));
}
l_m = math.fabs(l) def code(t, l_m, k): return (2.0 * (l_m * l_m)) / (k * (k * (k * (k * t))))
l_m = abs(l) function code(t, l_m, k) return Float64(Float64(2.0 * Float64(l_m * l_m)) / Float64(k * Float64(k * Float64(k * Float64(k * t))))) end
l_m = abs(l); function tmp = code(t, l_m, k) tmp = (2.0 * (l_m * l_m)) / (k * (k * (k * (k * t)))); end
l_m = N[Abs[l], $MachinePrecision] code[t_, l$95$m_, k_] := N[(N[(2.0 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * N[(k * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l_m = \left|\ell\right|
\\
\frac{2 \cdot \left(l\_m \cdot l\_m\right)}{k \cdot \left(k \cdot \left(k \cdot \left(k \cdot t\right)\right)\right)}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.5
Applied rewrites62.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6464.0
Applied rewrites64.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6464.0
Applied rewrites64.0%
herbie shell --seed 2025138
(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))))