
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l k) (* (/ l k) (/ (cos k) (* (* t (sin k)) (sin k)))))))
double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (cos(k) / ((t * sin(k)) * sin(k)))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 * ((l / k) * ((l / k) * (cos(k) / ((t * sin(k)) * sin(k)))))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (Math.cos(k) / ((t * Math.sin(k)) * Math.sin(k)))));
}
def code(t, l, k): return 2.0 * ((l / k) * ((l / k) * (math.cos(k) / ((t * math.sin(k)) * math.sin(k)))))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(cos(k) / Float64(Float64(t * sin(k)) * sin(k)))))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / k) * ((l / k) * (cos(k) / ((t * sin(k)) * sin(k))))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(t * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\cos k}{\left(t \cdot \sin k\right) \cdot \sin k}\right)\right)
\end{array}
Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Applied rewrites97.7%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
2.0
(* (/ l k) (* (/ l k) (/ (/ (cos k) t) (- 0.5 (* 0.5 (cos (+ k k))))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = 2.0 * ((l / k) * ((l / k) * ((cos(k) / t) / (0.5 - (0.5 * cos((k + k)))))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(Float64(cos(k) / t) / Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t}}{0.5 - 0.5 \cdot \cos \left(k + k\right)}\right)\right)\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Applied rewrites85.8%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
(* (/ (+ l l) k) (/ (cos k) (* (- 0.5 (* 0.5 (cos (+ k k)))) t)))
(/ l k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = (((l + l) / k) * (cos(k) / ((0.5 - (0.5 * cos((k + k)))) * t))) * (l / k);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(Float64(Float64(l + l) / k) * Float64(cos(k) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * t))) * Float64(l / k)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell + \ell}{k} \cdot \frac{\cos k}{\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t}\right) \cdot \frac{\ell}{k}\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Applied rewrites85.8%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
(/ (+ l l) k)
(/ (* (cos k) l) (* (* k t) (- 0.5 (* 0.5 (cos (+ k k)))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = ((l + l) / k) * ((cos(k) * l) / ((k * t) * (0.5 - (0.5 * cos((k + k))))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(Float64(l + l) / k) * Float64(Float64(cos(k) * l) / Float64(Float64(k * t) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k))))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell + \ell}{k} \cdot \frac{\cos k \cdot \ell}{\left(k \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)}\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Applied rewrites82.8%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
2.0
(* l (* l (/ (cos k) (* (* (- 0.5 (* 0.5 (cos (+ k k)))) k) (* k t))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = 2.0 * (l * (l * (cos(k) / (((0.5 - (0.5 * cos((k + k)))) * k) * (k * t)))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(k) / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * k) * Float64(k * t)))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(l * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot k\right) \cdot \left(k \cdot t\right)}\right)\right)\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites77.8%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
2.0
(* l (* l (/ (cos k) (* k (* k (* (- 0.5 (* 0.5 (cos (+ k k)))) t)))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = 2.0 * (l * (l * (cos(k) / (k * (k * ((0.5 - (0.5 * cos((k + k)))) * t))))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(k) / Float64(k * Float64(k * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * t))))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(l * N[(N[Cos[k], $MachinePrecision] / N[(k * N[(k * N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{k \cdot \left(k \cdot \left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\right)\right)}\right)\right)\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites77.8%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(/
(* (* (+ l l) l) (cos k))
(* (* (* k t) k) (- 0.5 (* 0.5 (cos (+ k k))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = (((l + l) * l) * cos(k)) / (((k * t) * k) * (0.5 - (0.5 * cos((k + k)))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(Float64(Float64(l + l) * l) * cos(k)) / Float64(Float64(Float64(k * t) * k) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\ell + \ell\right) \cdot \ell\right) \cdot \cos k}{\left(\left(k \cdot t\right) \cdot k\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)}\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites67.2%
Applied rewrites69.6%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
(* (+ l l) (/ (cos k) (* (* (* k k) t) (- 0.5 (* 0.5 (cos (+ k k)))))))
l)))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = ((l + l) * (cos(k) / (((k * k) * t) * (0.5 - (0.5 * cos((k + k))))))) * l;
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(Float64(l + l) * Float64(cos(k) / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k))))))) * l); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\ell + \ell\right) \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)}\right) \cdot \ell\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites74.5%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
(/ (* (cos k) l) (* (* (* k k) t) (- 0.5 (* 0.5 (cos (+ k k))))))
(+ l l))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = ((cos(k) * l) / (((k * k) * t) * (0.5 - (0.5 * cos((k + k)))))) * (l + l);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(Float64(cos(k) * l) / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))) * Float64(l + l)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos k \cdot \ell}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)} \cdot \left(\ell + \ell\right)\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites74.5%
(FPCore (t l k)
:precision binary64
(if (<= k 1.28e-8)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
(/ (cos k) (* (* (* k k) t) (- 0.5 (* 0.5 (cos (+ k k))))))
(* (+ l l) l))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.28e-8) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = (cos(k) / (((k * k) * t) * (0.5 - (0.5 * cos((k + k)))))) * ((l + l) * l);
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 1.28e-8) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(Float64(cos(k) / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))) * Float64(Float64(l + l) * l)); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 1.28e-8], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.28 \cdot 10^{-8}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)} \cdot \left(\left(\ell + \ell\right) \cdot \ell\right)\\
\end{array}
\end{array}
if k < 1.28000000000000005e-8Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 1.28000000000000005e-8 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites67.2%
(FPCore (t l k)
:precision binary64
(if (<= k 3.9e+69)
(*
2.0
(*
(/ l k)
(*
(/ l k)
(/ (fma -0.16666666666666666 (/ (pow k 2.0) t) (/ 1.0 t)) (pow k 2.0)))))
(*
2.0
(* l (* l (/ 1.0 (* k (* (* k t) (- 0.5 (* 0.5 (cos (+ k k))))))))))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3.9e+69) {
tmp = 2.0 * ((l / k) * ((l / k) * (fma(-0.16666666666666666, (pow(k, 2.0) / t), (1.0 / t)) / pow(k, 2.0))));
} else {
tmp = 2.0 * (l * (l * (1.0 / (k * ((k * t) * (0.5 - (0.5 * cos((k + k)))))))));
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (k <= 3.9e+69) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(fma(-0.16666666666666666, Float64((k ^ 2.0) / t), Float64(1.0 / t)) / (k ^ 2.0))))); else tmp = Float64(2.0 * Float64(l * Float64(l * Float64(1.0 / Float64(k * Float64(Float64(k * t) * Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))))))))); end return tmp end
code[t_, l_, k_] := If[LessEqual[k, 3.9e+69], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(l * N[(1.0 / N[(k * N[(N[(k * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3.9 \cdot 10^{+69}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{k}^{2}}{t}, \frac{1}{t}\right)}{{k}^{2}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(\left(k \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right)\right)}\right)\right)\\
\end{array}
\end{array}
if k < 3.8999999999999999e69Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites57.6%
if 3.8999999999999999e69 < k Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Taylor expanded in k around 0
Applied rewrites64.5%
Applied rewrites64.9%
(FPCore (t l k) :precision binary64 (if (<= l 7.5e+124) (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* (pow k 2.0) t))))) (* 2.0 (* (/ l k) (* (/ l k) (/ (cos k) (* (- 0.5 0.5) t)))))))
double code(double t, double l, double k) {
double tmp;
if (l <= 7.5e+124) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (pow(k, 2.0) * t))));
} else {
tmp = 2.0 * ((l / k) * ((l / k) * (cos(k) / ((0.5 - 0.5) * t))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 7.5d+124) then
tmp = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / ((k ** 2.0d0) * t))))
else
tmp = 2.0d0 * ((l / k) * ((l / k) * (cos(k) / ((0.5d0 - 0.5d0) * t))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 7.5e+124) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (Math.pow(k, 2.0) * t))));
} else {
tmp = 2.0 * ((l / k) * ((l / k) * (Math.cos(k) / ((0.5 - 0.5) * t))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 7.5e+124: tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (math.pow(k, 2.0) * t)))) else: tmp = 2.0 * ((l / k) * ((l / k) * (math.cos(k) / ((0.5 - 0.5) * t)))) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 7.5e+124) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64((k ^ 2.0) * t))))); else tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(cos(k) / Float64(Float64(0.5 - 0.5) * t))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 7.5e+124) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / ((k ^ 2.0) * t)))); else tmp = 2.0 * ((l / k) * ((l / k) * (cos(k) / ((0.5 - 0.5) * t)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 7.5e+124], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.5 \cdot 10^{+124}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{{k}^{2} \cdot t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\cos k}{\left(0.5 - 0.5\right) \cdot t}\right)\right)\\
\end{array}
\end{array}
if l < 7.50000000000000038e124Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites73.0%
if 7.50000000000000038e124 < l Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites41.3%
(FPCore (t l k) :precision binary64 (if (<= l 6.7e+128) (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* (pow k 2.0) t))))) (* (* 2.0 (/ (* l l) (* k k))) (/ (cos k) (* t (- 0.5 0.5))))))
double code(double t, double l, double k) {
double tmp;
if (l <= 6.7e+128) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (pow(k, 2.0) * t))));
} else {
tmp = (2.0 * ((l * l) / (k * k))) * (cos(k) / (t * (0.5 - 0.5)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 6.7d+128) then
tmp = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / ((k ** 2.0d0) * t))))
else
tmp = (2.0d0 * ((l * l) / (k * k))) * (cos(k) / (t * (0.5d0 - 0.5d0)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 6.7e+128) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (Math.pow(k, 2.0) * t))));
} else {
tmp = (2.0 * ((l * l) / (k * k))) * (Math.cos(k) / (t * (0.5 - 0.5)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 6.7e+128: tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (math.pow(k, 2.0) * t)))) else: tmp = (2.0 * ((l * l) / (k * k))) * (math.cos(k) / (t * (0.5 - 0.5))) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 6.7e+128) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64((k ^ 2.0) * t))))); else tmp = Float64(Float64(2.0 * Float64(Float64(l * l) / Float64(k * k))) * Float64(cos(k) / Float64(t * Float64(0.5 - 0.5)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 6.7e+128) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / ((k ^ 2.0) * t)))); else tmp = (2.0 * ((l * l) / (k * k))) * (cos(k) / (t * (0.5 - 0.5))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 6.7e+128], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(t * N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.7 \cdot 10^{+128}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{{k}^{2} \cdot t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \frac{\ell \cdot \ell}{k \cdot k}\right) \cdot \frac{\cos k}{t \cdot \left(0.5 - 0.5\right)}\\
\end{array}
\end{array}
if l < 6.69999999999999993e128Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites73.0%
if 6.69999999999999993e128 < l Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites67.6%
Taylor expanded in k around 0
Applied rewrites35.9%
(FPCore (t l k) :precision binary64 (if (<= l 6.7e+128) (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* (pow k 2.0) t))))) (/ (* (* (+ l l) l) (cos k)) (* (* (* k k) t) (- 0.5 0.5)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 6.7e+128) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (pow(k, 2.0) * t))));
} else {
tmp = (((l + l) * l) * cos(k)) / (((k * k) * t) * (0.5 - 0.5));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 6.7d+128) then
tmp = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / ((k ** 2.0d0) * t))))
else
tmp = (((l + l) * l) * cos(k)) / (((k * k) * t) * (0.5d0 - 0.5d0))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 6.7e+128) {
tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (Math.pow(k, 2.0) * t))));
} else {
tmp = (((l + l) * l) * Math.cos(k)) / (((k * k) * t) * (0.5 - 0.5));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 6.7e+128: tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / (math.pow(k, 2.0) * t)))) else: tmp = (((l + l) * l) * math.cos(k)) / (((k * k) * t) * (0.5 - 0.5)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 6.7e+128) tmp = Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64((k ^ 2.0) * t))))); else tmp = Float64(Float64(Float64(Float64(l + l) * l) * cos(k)) / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - 0.5))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 6.7e+128) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / ((k ^ 2.0) * t)))); else tmp = (((l + l) * l) * cos(k)) / (((k * k) * t) * (0.5 - 0.5)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 6.7e+128], N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.7 \cdot 10^{+128}:\\
\;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{{k}^{2} \cdot t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\ell + \ell\right) \cdot \ell\right) \cdot \cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5\right)}\\
\end{array}
\end{array}
if l < 6.69999999999999993e128Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites73.0%
if 6.69999999999999993e128 < l Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites67.2%
Taylor expanded in k around 0
Applied rewrites35.8%
(FPCore (t l k) :precision binary64 (* 2.0 (* (/ l k) (* (/ l k) (/ 1.0 (* (pow k 2.0) t))))))
double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (1.0 / (pow(k, 2.0) * t))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 * ((l / k) * ((l / k) * (1.0d0 / ((k ** 2.0d0) * t))))
end function
public static double code(double t, double l, double k) {
return 2.0 * ((l / k) * ((l / k) * (1.0 / (Math.pow(k, 2.0) * t))));
}
def code(t, l, k): return 2.0 * ((l / k) * ((l / k) * (1.0 / (math.pow(k, 2.0) * t))))
function code(t, l, k) return Float64(2.0 * Float64(Float64(l / k) * Float64(Float64(l / k) * Float64(1.0 / Float64((k ^ 2.0) * t))))) end
function tmp = code(t, l, k) tmp = 2.0 * ((l / k) * ((l / k) * (1.0 / ((k ^ 2.0) * t)))); end
code[t_, l_, k_] := N[(2.0 * N[(N[(l / k), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(1.0 / N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
2 \cdot \left(\frac{\ell}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{1}{{k}^{2} \cdot t}\right)\right)
\end{array}
Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites74.5%
Applied rewrites85.8%
Taylor expanded in k around 0
Applied rewrites73.0%
(FPCore (t l k) :precision binary64 (if (<= l 3.9e-165) (* (/ (/ l (pow k 4.0)) t) (+ l l)) (* (* 2.0 (/ (* l l) (* k k))) (/ 1.0 (* (pow k 2.0) t)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 3.9e-165) {
tmp = ((l / pow(k, 4.0)) / t) * (l + l);
} else {
tmp = (2.0 * ((l * l) / (k * k))) * (1.0 / (pow(k, 2.0) * t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 3.9d-165) then
tmp = ((l / (k ** 4.0d0)) / t) * (l + l)
else
tmp = (2.0d0 * ((l * l) / (k * k))) * (1.0d0 / ((k ** 2.0d0) * t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 3.9e-165) {
tmp = ((l / Math.pow(k, 4.0)) / t) * (l + l);
} else {
tmp = (2.0 * ((l * l) / (k * k))) * (1.0 / (Math.pow(k, 2.0) * t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 3.9e-165: tmp = ((l / math.pow(k, 4.0)) / t) * (l + l) else: tmp = (2.0 * ((l * l) / (k * k))) * (1.0 / (math.pow(k, 2.0) * t)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 3.9e-165) tmp = Float64(Float64(Float64(l / (k ^ 4.0)) / t) * Float64(l + l)); else tmp = Float64(Float64(2.0 * Float64(Float64(l * l) / Float64(k * k))) * Float64(1.0 / Float64((k ^ 2.0) * t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 3.9e-165) tmp = ((l / (k ^ 4.0)) / t) * (l + l); else tmp = (2.0 * ((l * l) / (k * k))) * (1.0 / ((k ^ 2.0) * t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 3.9e-165], N[(N[(N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(N[(l * l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[Power[k, 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.9 \cdot 10^{-165}:\\
\;\;\;\;\frac{\frac{\ell}{{k}^{4}}}{t} \cdot \left(\ell + \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \frac{\ell \cdot \ell}{k \cdot k}\right) \cdot \frac{1}{{k}^{2} \cdot t}\\
\end{array}
\end{array}
if l < 3.8999999999999999e-165Initial program 35.4%
Taylor expanded in k around 0
Applied rewrites63.2%
Applied rewrites68.9%
Applied rewrites68.9%
Applied rewrites69.6%
if 3.8999999999999999e-165 < l Initial program 35.4%
Taylor expanded in t around 0
Applied rewrites74.0%
Applied rewrites67.6%
Taylor expanded in k around 0
Applied rewrites66.2%
(FPCore (t l k) :precision binary64 (* (/ (/ l (pow k 4.0)) t) (+ l l)))
double code(double t, double l, double k) {
return ((l / pow(k, 4.0)) / t) * (l + l);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / (k ** 4.0d0)) / t) * (l + l)
end function
public static double code(double t, double l, double k) {
return ((l / Math.pow(k, 4.0)) / t) * (l + l);
}
def code(t, l, k): return ((l / math.pow(k, 4.0)) / t) * (l + l)
function code(t, l, k) return Float64(Float64(Float64(l / (k ^ 4.0)) / t) * Float64(l + l)) end
function tmp = code(t, l, k) tmp = ((l / (k ^ 4.0)) / t) * (l + l); end
code[t_, l_, k_] := N[(N[(N[(l / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\ell}{{k}^{4}}}{t} \cdot \left(\ell + \ell\right)
\end{array}
Initial program 35.4%
Taylor expanded in k around 0
Applied rewrites63.2%
Applied rewrites68.9%
Applied rewrites68.9%
Applied rewrites69.6%
(FPCore (t l k) :precision binary64 (* (/ (+ l l) (pow k 4.0)) (/ l t)))
double code(double t, double l, double k) {
return ((l + l) / pow(k, 4.0)) * (l / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) / (k ** 4.0d0)) * (l / t)
end function
public static double code(double t, double l, double k) {
return ((l + l) / Math.pow(k, 4.0)) * (l / t);
}
def code(t, l, k): return ((l + l) / math.pow(k, 4.0)) * (l / t)
function code(t, l, k) return Float64(Float64(Float64(l + l) / (k ^ 4.0)) * Float64(l / t)) end
function tmp = code(t, l, k) tmp = ((l + l) / (k ^ 4.0)) * (l / t); end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] * N[(l / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell + \ell}{{k}^{4}} \cdot \frac{\ell}{t}
\end{array}
Initial program 35.4%
Taylor expanded in k around 0
Applied rewrites63.2%
Applied rewrites68.9%
Applied rewrites68.9%
Applied rewrites68.1%
(FPCore (t l k) :precision binary64 (* (/ l (* (pow k 4.0) t)) (+ l l)))
double code(double t, double l, double k) {
return (l / (pow(k, 4.0) * t)) * (l + l);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l / ((k ** 4.0d0) * t)) * (l + l)
end function
public static double code(double t, double l, double k) {
return (l / (Math.pow(k, 4.0) * t)) * (l + l);
}
def code(t, l, k): return (l / (math.pow(k, 4.0) * t)) * (l + l)
function code(t, l, k) return Float64(Float64(l / Float64((k ^ 4.0) * t)) * Float64(l + l)) end
function tmp = code(t, l, k) tmp = (l / ((k ^ 4.0) * t)) * (l + l); end
code[t_, l_, k_] := N[(N[(l / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)
\end{array}
Initial program 35.4%
Taylor expanded in k around 0
Applied rewrites63.2%
Applied rewrites68.9%
Applied rewrites68.9%
herbie shell --seed 2025153
(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))))