
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
(FPCore (t l k) :precision binary64 (* (* (/ l (sin k)) (/ (/ (+ l l) (* k t)) (sin k))) (/ (cos k) k)))
double code(double t, double l, double k) {
return ((l / sin(k)) * (((l + l) / (k * t)) / sin(k))) * (cos(k) / k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / sin(k)) * (((l + l) / (k * t)) / sin(k))) * (cos(k) / k)
end function
public static double code(double t, double l, double k) {
return ((l / Math.sin(k)) * (((l + l) / (k * t)) / Math.sin(k))) * (Math.cos(k) / k);
}
def code(t, l, k): return ((l / math.sin(k)) * (((l + l) / (k * t)) / math.sin(k))) * (math.cos(k) / k)
function code(t, l, k) return Float64(Float64(Float64(l / sin(k)) * Float64(Float64(Float64(l + l) / Float64(k * t)) / sin(k))) * Float64(cos(k) / k)) end
function tmp = code(t, l, k) tmp = ((l / sin(k)) * (((l + l) / (k * t)) / sin(k))) * (cos(k) / k); end
code[t_, l_, k_] := N[(N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l + l), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{\sin k} \cdot \frac{\frac{\ell + \ell}{k \cdot t}}{\sin k}\right) \cdot \frac{\cos k}{k}
\end{array}
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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
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
associate-*l/N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.0%
(FPCore (t l k)
:precision binary64
(if (<= k 0.000108)
(* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0)
(/
(* (* l (/ (+ l l) (* k t))) (cos k))
(* (- 0.5 (* (cos (+ k k)) 0.5)) k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 0.000108) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = ((l * ((l + l) / (k * t))) * cos(k)) / ((0.5 - (cos((k + k)) * 0.5)) * k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.000108d0) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = ((l * ((l + l) / (k * t))) * cos(k)) / ((0.5d0 - (cos((k + k)) * 0.5d0)) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 0.000108) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = ((l * ((l + l) / (k * t))) * Math.cos(k)) / ((0.5 - (Math.cos((k + k)) * 0.5)) * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 0.000108: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = ((l * ((l + l) / (k * t))) * math.cos(k)) / ((0.5 - (math.cos((k + k)) * 0.5)) * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 0.000108) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(Float64(l * Float64(Float64(l + l) / Float64(k * t))) * cos(k)) / Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 0.000108) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = ((l * ((l + l) / (k * t))) * cos(k)) / ((0.5 - (cos((k + k)) * 0.5)) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 0.000108], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(l * N[(N[(l + l), $MachinePrecision] / N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.000108:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \frac{\ell + \ell}{k \cdot t}\right) \cdot \cos k}{\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot k}\\
\end{array}
\end{array}
if k < 1.08e-4Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 1.08e-4 < 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
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
associate-*l/N/A
lift-/.f64N/A
lift-cos.f64N/A
frac-timesN/A
Applied rewrites79.8%
(FPCore (t l k) :precision binary64 (* (* (/ l (pow (sin k) 2.0)) (/ (* l 2.0) (* t k))) (/ (cos k) k)))
double code(double t, double l, double k) {
return ((l / pow(sin(k), 2.0)) * ((l * 2.0) / (t * k))) * (cos(k) / k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / (sin(k) ** 2.0d0)) * ((l * 2.0d0) / (t * k))) * (cos(k) / k)
end function
public static double code(double t, double l, double k) {
return ((l / Math.pow(Math.sin(k), 2.0)) * ((l * 2.0) / (t * k))) * (Math.cos(k) / k);
}
def code(t, l, k): return ((l / math.pow(math.sin(k), 2.0)) * ((l * 2.0) / (t * k))) * (math.cos(k) / k)
function code(t, l, k) return Float64(Float64(Float64(l / (sin(k) ^ 2.0)) * Float64(Float64(l * 2.0) / Float64(t * k))) * Float64(cos(k) / k)) end
function tmp = code(t, l, k) tmp = ((l / (sin(k) ^ 2.0)) * ((l * 2.0) / (t * k))) * (cos(k) / k); end
code[t_, l_, k_] := N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(t * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{{\sin k}^{2}} \cdot \frac{\ell \cdot 2}{t \cdot k}\right) \cdot \frac{\cos k}{k}
\end{array}
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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
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.f6490.6
Applied rewrites90.6%
(FPCore (t l k)
:precision binary64
(if (<= k 0.000108)
(* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0)
(*
(/ l (- 0.5 (* (cos (+ k k)) 0.5)))
(/ (* (+ l l) (cos k)) (* (* k t) k)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 0.000108) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (l / (0.5 - (cos((k + k)) * 0.5))) * (((l + l) * cos(k)) / ((k * t) * k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.000108d0) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = (l / (0.5d0 - (cos((k + k)) * 0.5d0))) * (((l + l) * cos(k)) / ((k * t) * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 0.000108) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (l / (0.5 - (Math.cos((k + k)) * 0.5))) * (((l + l) * Math.cos(k)) / ((k * t) * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 0.000108: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = (l / (0.5 - (math.cos((k + k)) * 0.5))) * (((l + l) * math.cos(k)) / ((k * t) * k)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 0.000108) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(l / Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5))) * Float64(Float64(Float64(l + l) * cos(k)) / Float64(Float64(k * t) * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 0.000108) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = (l / (0.5 - (cos((k + k)) * 0.5))) * (((l + l) * cos(k)) / ((k * t) * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 0.000108], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(l / N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l + l), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 0.000108:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{0.5 - \cos \left(k + k\right) \cdot 0.5} \cdot \frac{\left(\ell + \ell\right) \cdot \cos k}{\left(k \cdot t\right) \cdot k}\\
\end{array}
\end{array}
if k < 1.08e-4Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 1.08e-4 < 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
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-/.f64N/A
lift-cos.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites78.4%
(FPCore (t l k)
:precision binary64
(if (<= k 20.0)
(* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0)
(*
(/ (* (+ l l) l) (* (* (- 0.5 (* (cos (+ k k)) 0.5)) t) k))
(/ (cos k) k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 20.0) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (((l + l) * l) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (cos(k) / k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 20.0d0) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = (((l + l) * l) / (((0.5d0 - (cos((k + k)) * 0.5d0)) * t) * k)) * (cos(k) / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 20.0) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (((l + l) * l) / (((0.5 - (Math.cos((k + k)) * 0.5)) * t) * k)) * (Math.cos(k) / k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 20.0: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = (((l + l) * l) / (((0.5 - (math.cos((k + k)) * 0.5)) * t) * k)) * (math.cos(k) / k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 20.0) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(Float64(Float64(l + l) * l) / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * t) * k)) * Float64(cos(k) / k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 20.0) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = (((l + l) * l) / (((0.5 - (cos((k + k)) * 0.5)) * t) * k)) * (cos(k) / k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 20.0], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] * l), $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}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 20:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \ell}{\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 < 20Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 20 < 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
Applied rewrites72.2%
(FPCore (t l k)
:precision binary64
(if (<= k 20.0)
(* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0)
(/
(* (* l (+ l l)) (cos k))
(* (* (- 0.5 (* (cos (+ k k)) 0.5)) (* k t)) k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 20.0) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = ((l * (l + l)) * cos(k)) / (((0.5 - (cos((k + k)) * 0.5)) * (k * t)) * k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 20.0d0) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = ((l * (l + l)) * cos(k)) / (((0.5d0 - (cos((k + k)) * 0.5d0)) * (k * t)) * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 20.0) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = ((l * (l + l)) * Math.cos(k)) / (((0.5 - (Math.cos((k + k)) * 0.5)) * (k * t)) * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 20.0: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = ((l * (l + l)) * math.cos(k)) / (((0.5 - (math.cos((k + k)) * 0.5)) * (k * t)) * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 20.0) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(Float64(l * Float64(l + l)) * cos(k)) / Float64(Float64(Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5)) * Float64(k * t)) * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 20.0) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = ((l * (l + l)) * cos(k)) / (((0.5 - (cos((k + k)) * 0.5)) * (k * t)) * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 20.0], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] * N[(k * t), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 20:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \left(\ell + \ell\right)\right) \cdot \cos k}{\left(\left(0.5 - \cos \left(k + k\right) \cdot 0.5\right) \cdot \left(k \cdot t\right)\right) \cdot k}\\
\end{array}
\end{array}
if k < 20Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 20 < 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
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
frac-timesN/A
lift-/.f64N/A
lift-cos.f64N/A
frac-timesN/A
Applied rewrites70.3%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ (* l 2.0) (* t k))))
(if (<= k 1.05e+118)
(*
(* (/ (fma (* (* k k) l) 0.3333333333333333 l) (* k k)) t_1)
(/ (cos k) k))
(* (* (/ l (- 0.5 (* (cos (+ k k)) 0.5))) t_1) (/ 1.0 k)))))
double code(double t, double l, double k) {
double t_1 = (l * 2.0) / (t * k);
double tmp;
if (k <= 1.05e+118) {
tmp = ((fma(((k * k) * l), 0.3333333333333333, l) / (k * k)) * t_1) * (cos(k) / k);
} else {
tmp = ((l / (0.5 - (cos((k + k)) * 0.5))) * t_1) * (1.0 / k);
}
return tmp;
}
function code(t, l, k) t_1 = Float64(Float64(l * 2.0) / Float64(t * k)) tmp = 0.0 if (k <= 1.05e+118) tmp = Float64(Float64(Float64(fma(Float64(Float64(k * k) * l), 0.3333333333333333, l) / Float64(k * k)) * t_1) * Float64(cos(k) / k)); else tmp = Float64(Float64(Float64(l / Float64(0.5 - Float64(cos(Float64(k + k)) * 0.5))) * t_1) * Float64(1.0 / k)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(l * 2.0), $MachinePrecision] / N[(t * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, 1.05e+118], N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * l), $MachinePrecision] * 0.3333333333333333 + l), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[(0.5 - N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(1.0 / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\ell \cdot 2}{t \cdot k}\\
\mathbf{if}\;k \leq 1.05 \cdot 10^{+118}:\\
\;\;\;\;\left(\frac{\mathsf{fma}\left(\left(k \cdot k\right) \cdot \ell, 0.3333333333333333, \ell\right)}{k \cdot k} \cdot t\_1\right) \cdot \frac{\cos k}{k}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{0.5 - \cos \left(k + k\right) \cdot 0.5} \cdot t\_1\right) \cdot \frac{1}{k}\\
\end{array}
\end{array}
if k < 1.05e118Initial 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
Taylor expanded in k around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6460.8
Applied rewrites60.8%
if 1.05e118 < 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 rewrites68.1%
Applied rewrites72.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-cos.f64N/A
associate-*l*N/A
associate-*l*N/A
*-commutativeN/A
count-2-revN/A
sqr-sin-a-revN/A
unpow2N/A
Applied rewrites80.5%
Taylor expanded in k around 0
lower-/.f6465.7
Applied rewrites65.7%
(FPCore (t l k) :precision binary64 (if (<= l 3.6e+200) (* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0) (* (/ (* (* l l) 2.0) (* (* (- 0.5 0.5) t) k)) (/ (cos k) k))))
double code(double t, double l, double k) {
double tmp;
if (l <= 3.6e+200) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (((l * l) * 2.0) / (((0.5 - 0.5) * t) * k)) * (cos(k) / k);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 3.6d+200) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = (((l * l) * 2.0d0) / (((0.5d0 - 0.5d0) * t) * k)) * (cos(k) / k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 3.6e+200) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (((l * l) * 2.0) / (((0.5 - 0.5) * t) * k)) * (Math.cos(k) / k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 3.6e+200: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = (((l * l) * 2.0) / (((0.5 - 0.5) * t) * k)) * (math.cos(k) / k) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 3.6e+200) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(Float64(Float64(l * l) * 2.0) / Float64(Float64(Float64(0.5 - 0.5) * t) * k)) * Float64(cos(k) / k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 3.6e+200) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = (((l * l) * 2.0) / (((0.5 - 0.5) * t) * k)) * (cos(k) / k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 3.6e+200], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * 2.0), $MachinePrecision] / N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 3.6 \cdot 10^{+200}:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot 2}{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k} \cdot \frac{\cos k}{k}\\
\end{array}
\end{array}
if l < 3.5999999999999998e200Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 3.5999999999999998e200 < 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 rewrites68.1%
Applied rewrites72.2%
Taylor expanded in k around 0
Applied rewrites36.5%
(FPCore (t l k) :precision binary64 (if (<= l 4.9e+200) (* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0) (/ (* 2.0 (* (cos k) (* l l))) (* (* (- 0.5 0.5) t) (* k k)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 4.9e+200) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (2.0 * (cos(k) * (l * l))) / (((0.5 - 0.5) * t) * (k * k));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 4.9d+200) then
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
else
tmp = (2.0d0 * (cos(k) * (l * l))) / (((0.5d0 - 0.5d0) * t) * (k * k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 4.9e+200) {
tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
} else {
tmp = (2.0 * (Math.cos(k) * (l * l))) / (((0.5 - 0.5) * t) * (k * k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 4.9e+200: tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0 else: tmp = (2.0 * (math.cos(k) * (l * l))) / (((0.5 - 0.5) * t) * (k * k)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 4.9e+200) tmp = Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0); else tmp = Float64(Float64(2.0 * Float64(cos(k) * Float64(l * l))) / Float64(Float64(Float64(0.5 - 0.5) * t) * Float64(k * k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 4.9e+200) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; else tmp = (2.0 * (cos(k) * (l * l))) / (((0.5 - 0.5) * t) * (k * k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 4.9e+200], N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(2.0 * N[(N[Cos[k], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.9 \cdot 10^{+200}:\\
\;\;\;\;\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2\\
\mathbf{else}:\\
\;\;\;\;\frac{2 \cdot \left(\cos k \cdot \left(\ell \cdot \ell\right)\right)}{\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if l < 4.89999999999999982e200Initial 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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
if 4.89999999999999982e200 < 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 rewrites68.1%
Taylor expanded in k around 0
Applied rewrites35.6%
(FPCore (t l k) :precision binary64 (* (* (/ l (* k k)) (/ l (* k (* k t)))) 2.0))
double code(double t, double l, double k) {
return ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0d0
end function
public static double code(double t, double l, double k) {
return ((l / (k * k)) * (l / (k * (k * t)))) * 2.0;
}
def code(t, l, k): return ((l / (k * k)) * (l / (k * (k * t)))) * 2.0
function code(t, l, k) return Float64(Float64(Float64(l / Float64(k * k)) * Float64(l / Float64(k * Float64(k * t)))) * 2.0) end
function tmp = code(t, l, k) tmp = ((l / (k * k)) * (l / (k * (k * t)))) * 2.0; end
code[t_, l_, k_] := N[(N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{k \cdot k} \cdot \frac{\ell}{k \cdot \left(k \cdot t\right)}\right) \cdot 2
\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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-*.f6473.6
Applied rewrites73.6%
(FPCore (t l k) :precision binary64 (* (* l (/ l (* (* k k) (* k (* k t))))) 2.0))
double code(double t, double l, double k) {
return (l * (l / ((k * k) * (k * (k * t))))) * 2.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l * (l / ((k * k) * (k * (k * t))))) * 2.0d0
end function
public static double code(double t, double l, double k) {
return (l * (l / ((k * k) * (k * (k * t))))) * 2.0;
}
def code(t, l, k): return (l * (l / ((k * k) * (k * (k * t))))) * 2.0
function code(t, l, k) return Float64(Float64(l * Float64(l / Float64(Float64(k * k) * Float64(k * Float64(k * t))))) * 2.0) end
function tmp = code(t, l, k) tmp = (l * (l / ((k * k) * (k * (k * t))))) * 2.0; end
code[t_, l_, k_] := N[(N[(l * N[(l / N[(N[(k * k), $MachinePrecision] * N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot \left(k \cdot t\right)\right)}\right) \cdot 2
\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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f6471.1
Applied rewrites71.1%
(FPCore (t l k) :precision binary64 (* (* (/ l (* (* (* k k) (* k k)) t)) l) 2.0))
double code(double t, double l, double k) {
return ((l / (((k * k) * (k * k)) * t)) * l) * 2.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l / (((k * k) * (k * k)) * t)) * l) * 2.0d0
end function
public static double code(double t, double l, double k) {
return ((l / (((k * k) * (k * k)) * t)) * l) * 2.0;
}
def code(t, l, k): return ((l / (((k * k) * (k * k)) * t)) * l) * 2.0
function code(t, l, k) return Float64(Float64(Float64(l / Float64(Float64(Float64(k * k) * Float64(k * k)) * t)) * l) * 2.0) end
function tmp = code(t, l, k) tmp = ((l / (((k * k) * (k * k)) * t)) * l) * 2.0; end
code[t_, l_, k_] := N[(N[(N[(l / N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{\ell}{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t} \cdot \ell\right) \cdot 2
\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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
Applied rewrites69.1%
(FPCore (t l k) :precision binary64 (/ (* (+ l l) l) (* (* (* k k) (* k k)) t)))
double code(double t, double l, double k) {
return ((l + l) * l) / (((k * k) * (k * k)) * 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) * l) / (((k * k) * (k * k)) * t)
end function
public static double code(double t, double l, double k) {
return ((l + l) * l) / (((k * k) * (k * k)) * t);
}
def code(t, l, k): return ((l + l) * l) / (((k * k) * (k * k)) * t)
function code(t, l, k) return Float64(Float64(Float64(l + l) * l) / Float64(Float64(Float64(k * k) * Float64(k * k)) * t)) end
function tmp = code(t, l, k) tmp = ((l + l) * l) / (((k * k) * (k * k)) * t); end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\ell + \ell\right) \cdot \ell}{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\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-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6463.1
Applied rewrites63.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
unpow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Applied rewrites70.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
pow-plusN/A
metadata-evalN/A
associate-/l*N/A
lower-/.f64N/A
Applied rewrites63.1%
herbie shell --seed 2025135
(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))))