
(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}
Sampling outcomes in binary64 precision:
Herbie found 15 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 (* (* (* (pow (sin k) 2.0) (/ t (cos k))) (/ k l)) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / (((pow(sin(k), 2.0) * (t / cos(k))) * (k / l)) * (k / l));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((sin(k) ** 2.0d0) * (t / cos(k))) * (k / l)) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.pow(Math.sin(k), 2.0) * (t / Math.cos(k))) * (k / l)) * (k / l));
}
def code(t, l, k): return 2.0 / (((math.pow(math.sin(k), 2.0) * (t / math.cos(k))) * (k / l)) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((sin(k) ^ 2.0) * (t / cos(k))) * (k / l)) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left({\sin k}^{2} \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 35.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.5
Applied rewrites73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.9
Applied rewrites95.9%
(FPCore (t l k)
:precision binary64
(if (<= k 1.95e+93)
(/ 2.0 (* (* k (/ (* (pow (sin k) 2.0) t) (* (cos k) l))) (/ k l)))
(/
2.0
(*
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) (/ t (cos k))) (/ k l))
(/ k l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e+93) {
tmp = 2.0 / ((k * ((pow(sin(k), 2.0) * t) / (cos(k) * l))) * (k / l));
} else {
tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 1.95d+93) then
tmp = 2.0d0 / ((k * (((sin(k) ** 2.0d0) * t) / (cos(k) * l))) * (k / l))
else
tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * (t / cos(k))) * (k / l)) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 1.95e+93) {
tmp = 2.0 / ((k * ((Math.pow(Math.sin(k), 2.0) * t) / (Math.cos(k) * l))) * (k / l));
} else {
tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) * (t / Math.cos(k))) * (k / l)) * (k / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 1.95e+93: tmp = 2.0 / ((k * ((math.pow(math.sin(k), 2.0) * t) / (math.cos(k) * l))) * (k / l)) else: tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) * (t / math.cos(k))) * (k / l)) * (k / l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 1.95e+93) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64((sin(k) ^ 2.0) * t) / Float64(cos(k) * l))) * Float64(k / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 1.95e+93) tmp = 2.0 / ((k * (((sin(k) ^ 2.0) * t) / (cos(k) * l))) * (k / l)); else tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 1.95e+93], N[(2.0 / N[(N[(k * N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.95 \cdot 10^{+93}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{{\sin k}^{2} \cdot t}{\cos k \cdot \ell}\right) \cdot \frac{k}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 1.9500000000000001e93Initial program 37.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.0
Applied rewrites76.0%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites90.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.4
Applied rewrites95.4%
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*r/N/A
*-commutativeN/A
times-fracN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-cos.f6492.8
Applied rewrites92.8%
if 1.9500000000000001e93 < k Initial program 20.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6457.7
Applied rewrites57.7%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6499.6
Applied rewrites99.6%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
(FPCore (t l k)
:precision binary64
(if (<= k 9.8e-5)
(/ 2.0 (* (* (* (* k k) t) (/ k l)) (/ k l)))
(/
2.0
(*
(* (* (- 0.5 (* 0.5 (cos (* 2.0 k)))) (/ t (cos k))) (/ k l))
(/ k l)))))
double code(double t, double l, double k) {
double tmp;
if (k <= 9.8e-5) {
tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
} else {
tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 9.8d-5) then
tmp = 2.0d0 / ((((k * k) * t) * (k / l)) * (k / l))
else
tmp = 2.0d0 / ((((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) * (t / cos(k))) * (k / l)) * (k / l))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 9.8e-5) {
tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
} else {
tmp = 2.0 / ((((0.5 - (0.5 * Math.cos((2.0 * k)))) * (t / Math.cos(k))) * (k / l)) * (k / l));
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 9.8e-5: tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l)) else: tmp = 2.0 / ((((0.5 - (0.5 * math.cos((2.0 * k)))) * (t / math.cos(k))) * (k / l)) * (k / l)) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 9.8e-5) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(k / l)) * Float64(k / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) * Float64(t / cos(k))) * Float64(k / l)) * Float64(k / l))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 9.8e-5) tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l)); else tmp = 2.0 / ((((0.5 - (0.5 * cos((2.0 * k)))) * (t / cos(k))) * (k / l)) * (k / l)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 9.8e-5], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 9.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot \frac{t}{\cos k}\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
\end{array}
\end{array}
if k < 9.8e-5Initial program 39.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites90.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.2
Applied rewrites95.2%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6478.8
Applied rewrites78.8%
if 9.8e-5 < k Initial program 22.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6498.4
Applied rewrites98.4%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6498.3
Applied rewrites98.3%
Final simplification83.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (* k k) t)))
(if (<= k 0.00029)
(/ 2.0 (* (* t_1 (/ k l)) (/ k l)))
(/ 2.0 (* (/ t_1 (cos k)) (/ (- 0.5 (* 0.5 (cos (* 2.0 k)))) (* l l)))))))
double code(double t, double l, double k) {
double t_1 = (k * k) * t;
double tmp;
if (k <= 0.00029) {
tmp = 2.0 / ((t_1 * (k / l)) * (k / l));
} else {
tmp = 2.0 / ((t_1 / cos(k)) * ((0.5 - (0.5 * cos((2.0 * k)))) / (l * l)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k * k) * t
if (k <= 0.00029d0) then
tmp = 2.0d0 / ((t_1 * (k / l)) * (k / l))
else
tmp = 2.0d0 / ((t_1 / cos(k)) * ((0.5d0 - (0.5d0 * cos((2.0d0 * k)))) / (l * l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = (k * k) * t;
double tmp;
if (k <= 0.00029) {
tmp = 2.0 / ((t_1 * (k / l)) * (k / l));
} else {
tmp = 2.0 / ((t_1 / Math.cos(k)) * ((0.5 - (0.5 * Math.cos((2.0 * k)))) / (l * l)));
}
return tmp;
}
def code(t, l, k): t_1 = (k * k) * t tmp = 0 if k <= 0.00029: tmp = 2.0 / ((t_1 * (k / l)) * (k / l)) else: tmp = 2.0 / ((t_1 / math.cos(k)) * ((0.5 - (0.5 * math.cos((2.0 * k)))) / (l * l))) return tmp
function code(t, l, k) t_1 = Float64(Float64(k * k) * t) tmp = 0.0 if (k <= 0.00029) tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(k / l)) * Float64(k / l))); else tmp = Float64(2.0 / Float64(Float64(t_1 / cos(k)) * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k)))) / Float64(l * l)))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = (k * k) * t; tmp = 0.0; if (k <= 0.00029) tmp = 2.0 / ((t_1 * (k / l)) * (k / l)); else tmp = 2.0 / ((t_1 / cos(k)) * ((0.5 - (0.5 * cos((2.0 * k)))) / (l * l))); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[k, 0.00029], N[(2.0 / N[(N[(t$95$1 * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(k \cdot k\right) \cdot t\\
\mathbf{if}\;k \leq 0.00029:\\
\;\;\;\;\frac{2}{\left(t\_1 \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_1}{\cos k} \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 2.9e-4Initial program 39.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.5
Applied rewrites76.5%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites90.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.2
Applied rewrites95.2%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6478.8
Applied rewrites78.8%
if 2.9e-4 < k Initial program 22.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6463.3
Applied rewrites63.3%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6463.4
Applied rewrites63.4%
Final simplification75.3%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (pow (sin k) 2.0) t) (/ k l)) (/ k l))))
double code(double t, double l, double k) {
return 2.0 / (((pow(sin(k), 2.0) * t) * (k / l)) * (k / l));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((sin(k) ** 2.0d0) * t) * (k / l)) * (k / l))
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.pow(Math.sin(k), 2.0) * t) * (k / l)) * (k / l));
}
def code(t, l, k): return 2.0 / (((math.pow(math.sin(k), 2.0) * t) * (k / l)) * (k / l))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * t) * Float64(k / l)) * Float64(k / l))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((sin(k) ^ 2.0) * t) * (k / l)) * (k / l)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left({\sin k}^{2} \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}
\end{array}
Initial program 35.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.5
Applied rewrites73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.9
Applied rewrites95.9%
Taylor expanded in k around 0
Applied rewrites74.1%
(FPCore (t l k) :precision binary64 (/ 2.0 (* (/ (* (* k k) t) (cos k)) (* (/ k l) (/ k l)))))
double code(double t, double l, double k) {
return 2.0 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l)))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((k * k) * t) / Math.cos(k)) * ((k / l) * (k / l)));
}
def code(t, l, k): return 2.0 / ((((k * k) * t) / math.cos(k)) * ((k / l) * (k / l)))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) / cos(k)) * Float64(Float64(k / l) * Float64(k / l)))) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k * k) * t) / cos(k)) * ((k / l) * (k / l))); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}
\end{array}
Initial program 35.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6473.5
Applied rewrites73.5%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
(FPCore (t l k) :precision binary64 (if (<= k 3200.0) (/ 2.0 (* (* (* (* k k) t) (/ k l)) (/ k l))) (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (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 <= 3200.0d0) then
tmp = 2.0d0 / ((((k * k) * t) * (k / l)) * (k / l))
else
tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l));
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3200.0: tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l)) else: tmp = (((l / t) * l) * -0.3333333333333333) / (k * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3200.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t) * Float64(k / l)) * Float64(k / l))); else tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3200.0) tmp = 2.0 / ((((k * k) * t) * (k / l)) * (k / l)); else tmp = (((l / t) * l) * -0.3333333333333333) / (k * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3200:\\
\;\;\;\;\frac{2}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k}{\ell}\right) \cdot \frac{k}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
\end{array}
\end{array}
if k < 3200Initial program 39.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.7
Applied rewrites76.7%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites90.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
lift-cos.f6495.3
Applied rewrites95.3%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6479.0
Applied rewrites79.0%
if 3200 < k Initial program 21.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6462.0
Applied rewrites62.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.5%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites49.2%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6451.6
Applied rewrites51.6%
Final simplification73.0%
(FPCore (t l k) :precision binary64 (if (<= t 1e-18) (/ (* (* (/ l t) 2.0) (/ l (* k k))) (* k k)) (/ 2.0 (* (* (* k k) t) (* (/ k l) (/ k l))))))
double code(double t, double l, double k) {
double tmp;
if (t <= 1e-18) {
tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
} else {
tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t <= 1d-18) then
tmp = (((l / t) * 2.0d0) * (l / (k * k))) / (k * k)
else
tmp = 2.0d0 / (((k * k) * t) * ((k / l) * (k / l)))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (t <= 1e-18) {
tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
} else {
tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l)));
}
return tmp;
}
def code(t, l, k): tmp = 0 if t <= 1e-18: tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k) else: tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l))) return tmp
function code(t, l, k) tmp = 0.0 if (t <= 1e-18) tmp = Float64(Float64(Float64(Float64(l / t) * 2.0) * Float64(l / Float64(k * k))) / Float64(k * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(k / l) * Float64(k / l)))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (t <= 1e-18) tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k); else tmp = 2.0 / (((k * k) * t) * ((k / l) * (k / l))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[t, 1e-18], N[(N[(N[(N[(l / t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-18}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if t < 1.0000000000000001e-18Initial program 37.6%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6472.0
Applied rewrites72.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites52.8%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites51.7%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f6470.3
Applied rewrites70.3%
if 1.0000000000000001e-18 < t Initial program 29.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.8
Applied rewrites77.8%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites95.4%
Taylor expanded in k around 0
lower-*.f64N/A
pow2N/A
lower-*.f6478.1
Applied rewrites78.1%
(FPCore (t l k) :precision binary64 (if (<= k 3200.0) (/ (* (* (/ l t) 2.0) (/ l (* k k))) (* k k)) (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (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 <= 3200.0d0) then
tmp = (((l / t) * 2.0d0) * (l / (k * k))) / (k * k)
else
tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k);
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3200.0: tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k) else: tmp = (((l / t) * l) * -0.3333333333333333) / (k * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3200.0) tmp = Float64(Float64(Float64(Float64(l / t) * 2.0) * Float64(l / Float64(k * k))) / Float64(k * k)); else tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3200.0) tmp = (((l / t) * 2.0) * (l / (k * k))) / (k * k); else tmp = (((l / t) * l) * -0.3333333333333333) / (k * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(N[(N[(N[(l / t), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3200:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot 2\right) \cdot \frac{\ell}{k \cdot k}}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
\end{array}
\end{array}
if k < 3200Initial program 39.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.7
Applied rewrites76.7%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites58.0%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites54.8%
Taylor expanded in k around 0
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
frac-timesN/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f6476.0
Applied rewrites76.0%
if 3200 < k Initial program 21.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6462.0
Applied rewrites62.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.5%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites49.2%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6451.6
Applied rewrites51.6%
(FPCore (t l k) :precision binary64 (if (<= k 3200.0) (/ 2.0 (* (* (* k k) t) (/ (* k k) (* l l)))) (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (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 <= 3200.0d0) then
tmp = 2.0d0 / (((k * k) * t) * ((k * k) / (l * l)))
else
tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l)));
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3200.0: tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l))) else: tmp = (((l / t) * l) * -0.3333333333333333) / (k * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3200.0) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * t) * Float64(Float64(k * k) / Float64(l * l)))); else tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3200.0) tmp = 2.0 / (((k * k) * t) * ((k * k) / (l * l))); else tmp = (((l / t) * l) * -0.3333333333333333) / (k * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3200:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\ell \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
\end{array}
\end{array}
if k < 3200Initial program 39.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.7
Applied rewrites76.7%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6470.8
Applied rewrites70.8%
Taylor expanded in k around 0
pow2N/A
lift-*.f6470.4
Applied rewrites70.4%
if 3200 < k Initial program 21.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6462.0
Applied rewrites62.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.5%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites49.2%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6451.6
Applied rewrites51.6%
(FPCore (t l k) :precision binary64 (if (<= k 3200.0) (* (/ 2.0 (* (* k k) (* k k))) (/ (* l l) t)) (/ (* (* (/ l t) l) -0.3333333333333333) (* k k))))
double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (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 <= 3200.0d0) then
tmp = (2.0d0 / ((k * k) * (k * k))) * ((l * l) / t)
else
tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (k <= 3200.0) {
tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t);
} else {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
}
return tmp;
}
def code(t, l, k): tmp = 0 if k <= 3200.0: tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t) else: tmp = (((l / t) * l) * -0.3333333333333333) / (k * k) return tmp
function code(t, l, k) tmp = 0.0 if (k <= 3200.0) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) * Float64(Float64(l * l) / t)); else tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (k <= 3200.0) tmp = (2.0 / ((k * k) * (k * k))) * ((l * l) / t); else tmp = (((l / t) * l) * -0.3333333333333333) / (k * k); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[k, 3200.0], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;k \leq 3200:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell \cdot \ell}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
\end{array}
\end{array}
if k < 3200Initial program 39.2%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6465.0
Applied rewrites65.0%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6465.0
Applied rewrites65.0%
if 3200 < k Initial program 21.7%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6462.0
Applied rewrites62.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites33.5%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites49.2%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6451.6
Applied rewrites51.6%
(FPCore (t l k) :precision binary64 (if (<= l 6.5e+222) (/ (* (* (/ l t) l) -0.3333333333333333) (* k k)) (* -0.11666666666666667 (* l (/ l t)))))
double code(double t, double l, double k) {
double tmp;
if (l <= 6.5e+222) {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
} else {
tmp = -0.11666666666666667 * (l * (l / t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 6.5d+222) then
tmp = (((l / t) * l) * (-0.3333333333333333d0)) / (k * k)
else
tmp = (-0.11666666666666667d0) * (l * (l / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (l <= 6.5e+222) {
tmp = (((l / t) * l) * -0.3333333333333333) / (k * k);
} else {
tmp = -0.11666666666666667 * (l * (l / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if l <= 6.5e+222: tmp = (((l / t) * l) * -0.3333333333333333) / (k * k) else: tmp = -0.11666666666666667 * (l * (l / t)) return tmp
function code(t, l, k) tmp = 0.0 if (l <= 6.5e+222) tmp = Float64(Float64(Float64(Float64(l / t) * l) * -0.3333333333333333) / Float64(k * k)); else tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (l <= 6.5e+222) tmp = (((l / t) * l) * -0.3333333333333333) / (k * k); else tmp = -0.11666666666666667 * (l * (l / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[l, 6.5e+222], N[(N[(N[(N[(l / t), $MachinePrecision] * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.5 \cdot 10^{+222}:\\
\;\;\;\;\frac{\left(\frac{\ell}{t} \cdot \ell\right) \cdot -0.3333333333333333}{k \cdot k}\\
\mathbf{else}:\\
\;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if l < 6.5000000000000006e222Initial program 35.8%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6476.3
Applied rewrites76.3%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites55.8%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites57.2%
Taylor expanded in k around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*r/N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6431.4
Applied rewrites31.4%
if 6.5000000000000006e222 < l Initial program 30.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites0.0%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6412.1
Applied rewrites12.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6412.3
Applied rewrites12.3%
(FPCore (t l k) :precision binary64 (if (<= (* l l) 2e+302) (/ (* (* l l) -0.3333333333333333) (* (* k k) t)) (* -0.11666666666666667 (* l (/ l t)))))
double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+302) {
tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t);
} else {
tmp = -0.11666666666666667 * (l * (l / t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((l * l) <= 2d+302) then
tmp = ((l * l) * (-0.3333333333333333d0)) / ((k * k) * t)
else
tmp = (-0.11666666666666667d0) * (l * (l / t))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if ((l * l) <= 2e+302) {
tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t);
} else {
tmp = -0.11666666666666667 * (l * (l / t));
}
return tmp;
}
def code(t, l, k): tmp = 0 if (l * l) <= 2e+302: tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t) else: tmp = -0.11666666666666667 * (l * (l / t)) return tmp
function code(t, l, k) tmp = 0.0 if (Float64(l * l) <= 2e+302) tmp = Float64(Float64(Float64(l * l) * -0.3333333333333333) / Float64(Float64(k * k) * t)); else tmp = Float64(-0.11666666666666667 * Float64(l * Float64(l / t))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if ((l * l) <= 2e+302) tmp = ((l * l) * -0.3333333333333333) / ((k * k) * t); else tmp = -0.11666666666666667 * (l * (l / t)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[(l * l), $MachinePrecision], 2e+302], N[(N[(N[(l * l), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 2 \cdot 10^{+302}:\\
\;\;\;\;\frac{\left(\ell \cdot \ell\right) \cdot -0.3333333333333333}{\left(k \cdot k\right) \cdot t}\\
\mathbf{else}:\\
\;\;\;\;-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)\\
\end{array}
\end{array}
if (*.f64 l l) < 2.0000000000000002e302Initial program 34.6%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6480.2
Applied rewrites80.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites59.4%
Taylor expanded in k around inf
lower-/.f64N/A
Applied rewrites73.0%
Taylor expanded in k around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6439.0
Applied rewrites39.0%
if 2.0000000000000002e302 < (*.f64 l l) Initial program 37.5%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites1.4%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6411.1
Applied rewrites11.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6411.3
Applied rewrites11.3%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * ((l * l) / t)
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * ((l * l) / t);
}
def code(t, l, k): return -0.11666666666666667 * ((l * l) / t)
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * ((l * l) / t); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 35.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites29.5%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6423.2
Applied rewrites23.2%
(FPCore (t l k) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (-0.11666666666666667d0) * (l * (l / t))
end function
public static double code(double t, double l, double k) {
return -0.11666666666666667 * (l * (l / t));
}
def code(t, l, k): return -0.11666666666666667 * (l * (l / t))
function code(t, l, k) return Float64(-0.11666666666666667 * Float64(l * Float64(l / t))) end
function tmp = code(t, l, k) tmp = -0.11666666666666667 * (l * (l / t)); end
code[t_, l_, k_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 35.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites29.5%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6422.4
Applied rewrites22.4%
herbie shell --seed 2025037
(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))))