
(FPCore (t l k) :precision binary64 (/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))))
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 / N[(N[(N[(N[(N[Power[t, 3], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1 + N[Power[N[(k / t), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)}
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))))
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 / N[(N[(N[(N[(N[Power[t, 3], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1 + N[Power[N[(k / t), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)}
(FPCore (t l k) :precision binary64 (/ 2 (* (/ k l) (* (/ k l) (* (* (sin k) t) (tan k))))))
double code(double t, double l, double k) {
return 2.0 / ((k / l) * ((k / l) * ((sin(k) * t) * tan(k))));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((k / l) * ((k / l) * ((sin(k) * t) * tan(k))))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((k / l) * ((k / l) * ((Math.sin(k) * t) * Math.tan(k))));
}
def code(t, l, k): return 2.0 / ((k / l) * ((k / l) * ((math.sin(k) * t) * math.tan(k))))
function code(t, l, k) return Float64(2.0 / Float64(Float64(k / l) * Float64(Float64(k / l) * Float64(Float64(sin(k) * t) * tan(k))))) end
function tmp = code(t, l, k) tmp = 2.0 / ((k / l) * ((k / l) * ((sin(k) * t) * tan(k)))); end
code[t_, l_, k_] := N[(2 / N[(N[(k / l), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{k}{\ell} \cdot \left(\frac{k}{\ell} \cdot \left(\left(\sin k \cdot t\right) \cdot \tan k\right)\right)}
Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
Applied rewrites97.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ k (fabs l))) (t_2 (* (tan k) t)))
(if (<=
(fabs l)
4763410263543689/11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904)
(/ 2 (* (* t_2 (sin k)) (/ (* t_1 k) (fabs l))))
(if (<=
(fabs l)
5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200)
(/ 2 (* (* (sin k) k) (* t_2 (/ k (* (fabs l) (fabs l))))))
(/ 2 (* (* t (* (tan k) (sin k))) (* t_1 t_1)))))))double code(double t, double l, double k) {
double t_1 = k / fabs(l);
double t_2 = tan(k) * t;
double tmp;
if (fabs(l) <= 4e-124) {
tmp = 2.0 / ((t_2 * sin(k)) * ((t_1 * k) / fabs(l)));
} else if (fabs(l) <= 5e+138) {
tmp = 2.0 / ((sin(k) * k) * (t_2 * (k / (fabs(l) * fabs(l)))));
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = k / abs(l)
t_2 = tan(k) * t
if (abs(l) <= 4d-124) then
tmp = 2.0d0 / ((t_2 * sin(k)) * ((t_1 * k) / abs(l)))
else if (abs(l) <= 5d+138) then
tmp = 2.0d0 / ((sin(k) * k) * (t_2 * (k / (abs(l) * abs(l)))))
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k / Math.abs(l);
double t_2 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 4e-124) {
tmp = 2.0 / ((t_2 * Math.sin(k)) * ((t_1 * k) / Math.abs(l)));
} else if (Math.abs(l) <= 5e+138) {
tmp = 2.0 / ((Math.sin(k) * k) * (t_2 * (k / (Math.abs(l) * Math.abs(l)))));
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (t_1 * t_1));
}
return tmp;
}
def code(t, l, k): t_1 = k / math.fabs(l) t_2 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 4e-124: tmp = 2.0 / ((t_2 * math.sin(k)) * ((t_1 * k) / math.fabs(l))) elif math.fabs(l) <= 5e+138: tmp = 2.0 / ((math.sin(k) * k) * (t_2 * (k / (math.fabs(l) * math.fabs(l))))) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (t_1 * t_1)) return tmp
function code(t, l, k) t_1 = Float64(k / abs(l)) t_2 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 4e-124) tmp = Float64(2.0 / Float64(Float64(t_2 * sin(k)) * Float64(Float64(t_1 * k) / abs(l)))); elseif (abs(l) <= 5e+138) tmp = Float64(2.0 / Float64(Float64(sin(k) * k) * Float64(t_2 * Float64(k / Float64(abs(l) * abs(l)))))); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(t_1 * t_1))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k / abs(l); t_2 = tan(k) * t; tmp = 0.0; if (abs(l) <= 4e-124) tmp = 2.0 / ((t_2 * sin(k)) * ((t_1 * k) / abs(l))); elseif (abs(l) <= 5e+138) tmp = 2.0 / ((sin(k) * k) * (t_2 * (k / (abs(l) * abs(l))))); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 4763410263543689/11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904], N[(2 / N[(N[(t$95$2 * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 * k), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200], N[(2 / N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * N[(t$95$2 * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{k}{\left|\ell\right|}\\
t_2 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq \frac{4763410263543689}{11908525658859223294760121268437066290850060053501019099651935423375594096449911575776314174894302258147533153997065059263030913083222523904}:\\
\;\;\;\;\frac{2}{\left(t\_2 \cdot \sin k\right) \cdot \frac{t\_1 \cdot k}{\left|\ell\right|}}\\
\mathbf{elif}\;\left|\ell\right| \leq 5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot k\right) \cdot \left(t\_2 \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
\end{array}
if l < 3.9999999999999997e-124Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6489.1%
Applied rewrites89.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6490.5%
Applied rewrites90.5%
if 3.9999999999999997e-124 < l < 5.0000000000000002e138Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6478.9%
Applied rewrites78.9%
if 5.0000000000000002e138 < l Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6491.2%
Applied rewrites91.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (/ k (fabs l))) (t_2 (* (tan k) t)))
(if (<=
(fabs l)
467650163306275/570305077202774402330146450712536415611653563406069991322399064737409395901084673313239101414671424972330288696699300913836088090171929749781582664965276773531499334295033118760359274030825472)
(/ 2 (/ (* (* t_2 (pow k 2)) t_1) (fabs l)))
(if (<=
(fabs l)
5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200)
(/ 2 (* (* (* t_2 (sin k)) (/ k (* (fabs l) (fabs l)))) k))
(/ 2 (* (* t (* (tan k) (sin k))) (* t_1 t_1)))))))double code(double t, double l, double k) {
double t_1 = k / fabs(l);
double t_2 = tan(k) * t;
double tmp;
if (fabs(l) <= 8.2e-178) {
tmp = 2.0 / (((t_2 * pow(k, 2.0)) * t_1) / fabs(l));
} else if (fabs(l) <= 5e+138) {
tmp = 2.0 / (((t_2 * sin(k)) * (k / (fabs(l) * fabs(l)))) * k);
} else {
tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = k / abs(l)
t_2 = tan(k) * t
if (abs(l) <= 8.2d-178) then
tmp = 2.0d0 / (((t_2 * (k ** 2.0d0)) * t_1) / abs(l))
else if (abs(l) <= 5d+138) then
tmp = 2.0d0 / (((t_2 * sin(k)) * (k / (abs(l) * abs(l)))) * k)
else
tmp = 2.0d0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = k / Math.abs(l);
double t_2 = Math.tan(k) * t;
double tmp;
if (Math.abs(l) <= 8.2e-178) {
tmp = 2.0 / (((t_2 * Math.pow(k, 2.0)) * t_1) / Math.abs(l));
} else if (Math.abs(l) <= 5e+138) {
tmp = 2.0 / (((t_2 * Math.sin(k)) * (k / (Math.abs(l) * Math.abs(l)))) * k);
} else {
tmp = 2.0 / ((t * (Math.tan(k) * Math.sin(k))) * (t_1 * t_1));
}
return tmp;
}
def code(t, l, k): t_1 = k / math.fabs(l) t_2 = math.tan(k) * t tmp = 0 if math.fabs(l) <= 8.2e-178: tmp = 2.0 / (((t_2 * math.pow(k, 2.0)) * t_1) / math.fabs(l)) elif math.fabs(l) <= 5e+138: tmp = 2.0 / (((t_2 * math.sin(k)) * (k / (math.fabs(l) * math.fabs(l)))) * k) else: tmp = 2.0 / ((t * (math.tan(k) * math.sin(k))) * (t_1 * t_1)) return tmp
function code(t, l, k) t_1 = Float64(k / abs(l)) t_2 = Float64(tan(k) * t) tmp = 0.0 if (abs(l) <= 8.2e-178) tmp = Float64(2.0 / Float64(Float64(Float64(t_2 * (k ^ 2.0)) * t_1) / abs(l))); elseif (abs(l) <= 5e+138) tmp = Float64(2.0 / Float64(Float64(Float64(t_2 * sin(k)) * Float64(k / Float64(abs(l) * abs(l)))) * k)); else tmp = Float64(2.0 / Float64(Float64(t * Float64(tan(k) * sin(k))) * Float64(t_1 * t_1))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = k / abs(l); t_2 = tan(k) * t; tmp = 0.0; if (abs(l) <= 8.2e-178) tmp = 2.0 / (((t_2 * (k ^ 2.0)) * t_1) / abs(l)); elseif (abs(l) <= 5e+138) tmp = 2.0 / (((t_2 * sin(k)) * (k / (abs(l) * abs(l)))) * k); else tmp = 2.0 / ((t * (tan(k) * sin(k))) * (t_1 * t_1)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[l], $MachinePrecision], 467650163306275/570305077202774402330146450712536415611653563406069991322399064737409395901084673313239101414671424972330288696699300913836088090171929749781582664965276773531499334295033118760359274030825472], N[(2 / N[(N[(N[(t$95$2 * N[Power[k, 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[l], $MachinePrecision], 5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200], N[(2 / N[(N[(N[(t$95$2 * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(t * N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{k}{\left|\ell\right|}\\
t_2 := \tan k \cdot t\\
\mathbf{if}\;\left|\ell\right| \leq \frac{467650163306275}{570305077202774402330146450712536415611653563406069991322399064737409395901084673313239101414671424972330288696699300913836088090171929749781582664965276773531499334295033118760359274030825472}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_2 \cdot {k}^{2}\right) \cdot t\_1}{\left|\ell\right|}}\\
\mathbf{elif}\;\left|\ell\right| \leq 5000000000000000164207812446024630394935062831798058477561567131293735034493939977720006578138637063419747523921612177893242453171057459200:\\
\;\;\;\;\frac{2}{\left(\left(t\_2 \cdot \sin k\right) \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot \left(\tan k \cdot \sin k\right)\right) \cdot \left(t\_1 \cdot t\_1\right)}\\
\end{array}
if l < 8.1999999999999998e-178Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-pow.f6472.4%
Applied rewrites72.4%
if 8.1999999999999998e-178 < l < 5.0000000000000002e138Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6478.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6479.1%
Applied rewrites79.1%
if 5.0000000000000002e138 < l Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6491.2%
Applied rewrites91.2%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (* (tan (fabs k)) t)))
(if (<= (fabs k) 4911261142184431/37778931862957161709568)
(/ 2 (/ (* (* t_1 (pow (fabs k) 2)) (/ (fabs k) l)) l))
(/
2
(* (* (* t_1 (sin (fabs k))) (/ (fabs k) (* l l))) (fabs k))))))double code(double t, double l, double k) {
double t_1 = tan(fabs(k)) * t;
double tmp;
if (fabs(k) <= 1.3e-7) {
tmp = 2.0 / (((t_1 * pow(fabs(k), 2.0)) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / (((t_1 * sin(fabs(k))) * (fabs(k) / (l * l))) * fabs(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) :: t_1
real(8) :: tmp
t_1 = tan(abs(k)) * t
if (abs(k) <= 1.3d-7) then
tmp = 2.0d0 / (((t_1 * (abs(k) ** 2.0d0)) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / (((t_1 * sin(abs(k))) * (abs(k) / (l * l))) * abs(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double t_1 = Math.tan(Math.abs(k)) * t;
double tmp;
if (Math.abs(k) <= 1.3e-7) {
tmp = 2.0 / (((t_1 * Math.pow(Math.abs(k), 2.0)) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / (((t_1 * Math.sin(Math.abs(k))) * (Math.abs(k) / (l * l))) * Math.abs(k));
}
return tmp;
}
def code(t, l, k): t_1 = math.tan(math.fabs(k)) * t tmp = 0 if math.fabs(k) <= 1.3e-7: tmp = 2.0 / (((t_1 * math.pow(math.fabs(k), 2.0)) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / (((t_1 * math.sin(math.fabs(k))) * (math.fabs(k) / (l * l))) * math.fabs(k)) return tmp
function code(t, l, k) t_1 = Float64(tan(abs(k)) * t) tmp = 0.0 if (abs(k) <= 1.3e-7) tmp = Float64(2.0 / Float64(Float64(Float64(t_1 * (abs(k) ^ 2.0)) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(t_1 * sin(abs(k))) * Float64(abs(k) / Float64(l * l))) * abs(k))); end return tmp end
function tmp_2 = code(t, l, k) t_1 = tan(abs(k)) * t; tmp = 0.0; if (abs(k) <= 1.3e-7) tmp = 2.0 / (((t_1 * (abs(k) ^ 2.0)) * (abs(k) / l)) / l); else tmp = 2.0 / (((t_1 * sin(abs(k))) * (abs(k) / (l * l))) * abs(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := Block[{t$95$1 = N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 4911261142184431/37778931862957161709568], N[(2 / N[(N[(N[(t$95$1 * N[Power[N[Abs[k], $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(N[(t$95$1 * N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \tan \left(\left|k\right|\right) \cdot t\\
\mathbf{if}\;\left|k\right| \leq \frac{4911261142184431}{37778931862957161709568}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_1 \cdot {\left(\left|k\right|\right)}^{2}\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(t\_1 \cdot \sin \left(\left|k\right|\right)\right) \cdot \frac{\left|k\right|}{\ell \cdot \ell}\right) \cdot \left|k\right|}\\
\end{array}
if k < 1.3e-7Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-pow.f6472.4%
Applied rewrites72.4%
if 1.3e-7 < k Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6478.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6479.1%
Applied rewrites79.1%
(FPCore (t l k)
:precision binary64
(if (<= (fabs k) 4911261142184431/37778931862957161709568)
(/ 2 (/ (* (* (pow (fabs k) 3) t) (/ (fabs k) l)) l))
(/
2
(*
(* (* (* (tan (fabs k)) t) (sin (fabs k))) (/ (fabs k) (* l l)))
(fabs k)))))double code(double t, double l, double k) {
double tmp;
if (fabs(k) <= 1.3e-7) {
tmp = 2.0 / (((pow(fabs(k), 3.0) * t) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / ((((tan(fabs(k)) * t) * sin(fabs(k))) * (fabs(k) / (l * l))) * fabs(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 (abs(k) <= 1.3d-7) then
tmp = 2.0d0 / ((((abs(k) ** 3.0d0) * t) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / ((((tan(abs(k)) * t) * sin(abs(k))) * (abs(k) / (l * l))) * abs(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(k) <= 1.3e-7) {
tmp = 2.0 / (((Math.pow(Math.abs(k), 3.0) * t) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / ((((Math.tan(Math.abs(k)) * t) * Math.sin(Math.abs(k))) * (Math.abs(k) / (l * l))) * Math.abs(k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(k) <= 1.3e-7: tmp = 2.0 / (((math.pow(math.fabs(k), 3.0) * t) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / ((((math.tan(math.fabs(k)) * t) * math.sin(math.fabs(k))) * (math.fabs(k) / (l * l))) * math.fabs(k)) return tmp
function code(t, l, k) tmp = 0.0 if (abs(k) <= 1.3e-7) tmp = Float64(2.0 / Float64(Float64(Float64((abs(k) ^ 3.0) * t) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(abs(k)) * t) * sin(abs(k))) * Float64(abs(k) / Float64(l * l))) * abs(k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(k) <= 1.3e-7) tmp = 2.0 / ((((abs(k) ^ 3.0) * t) * (abs(k) / l)) / l); else tmp = 2.0 / ((((tan(abs(k)) * t) * sin(abs(k))) * (abs(k) / (l * l))) * abs(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 4911261142184431/37778931862957161709568], N[(2 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 3], $MachinePrecision] * t), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision] * N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{4911261142184431}{37778931862957161709568}:\\
\;\;\;\;\frac{2}{\frac{\left({\left(\left|k\right|\right)}^{3} \cdot t\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\tan \left(\left|k\right|\right) \cdot t\right) \cdot \sin \left(\left|k\right|\right)\right) \cdot \frac{\left|k\right|}{\ell \cdot \ell}\right) \cdot \left|k\right|}\\
\end{array}
if k < 1.3e-7Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.5%
Applied rewrites70.5%
if 1.3e-7 < k Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6478.9%
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6479.1%
Applied rewrites79.1%
(FPCore (t l k)
:precision binary64
(if (<= (fabs k) 4911261142184431/37778931862957161709568)
(/ 2 (/ (* (* (pow (fabs k) 3) t) (/ (fabs k) l)) l))
(/
2
(*
(* (sin (fabs k)) (fabs k))
(* (* (tan (fabs k)) t) (/ (fabs k) (* l l)))))))double code(double t, double l, double k) {
double tmp;
if (fabs(k) <= 1.3e-7) {
tmp = 2.0 / (((pow(fabs(k), 3.0) * t) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / ((sin(fabs(k)) * fabs(k)) * ((tan(fabs(k)) * t) * (fabs(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) :: tmp
if (abs(k) <= 1.3d-7) then
tmp = 2.0d0 / ((((abs(k) ** 3.0d0) * t) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / ((sin(abs(k)) * abs(k)) * ((tan(abs(k)) * t) * (abs(k) / (l * l))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(k) <= 1.3e-7) {
tmp = 2.0 / (((Math.pow(Math.abs(k), 3.0) * t) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / ((Math.sin(Math.abs(k)) * Math.abs(k)) * ((Math.tan(Math.abs(k)) * t) * (Math.abs(k) / (l * l))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(k) <= 1.3e-7: tmp = 2.0 / (((math.pow(math.fabs(k), 3.0) * t) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / ((math.sin(math.fabs(k)) * math.fabs(k)) * ((math.tan(math.fabs(k)) * t) * (math.fabs(k) / (l * l)))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(k) <= 1.3e-7) tmp = Float64(2.0 / Float64(Float64(Float64((abs(k) ^ 3.0) * t) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(Float64(sin(abs(k)) * abs(k)) * Float64(Float64(tan(abs(k)) * t) * Float64(abs(k) / Float64(l * l))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(k) <= 1.3e-7) tmp = 2.0 / ((((abs(k) ^ 3.0) * t) * (abs(k) / l)) / l); else tmp = 2.0 / ((sin(abs(k)) * abs(k)) * ((tan(abs(k)) * t) * (abs(k) / (l * l)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 4911261142184431/37778931862957161709568], N[(2 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 3], $MachinePrecision] * t), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * t), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{4911261142184431}{37778931862957161709568}:\\
\;\;\;\;\frac{2}{\frac{\left({\left(\left|k\right|\right)}^{3} \cdot t\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin \left(\left|k\right|\right) \cdot \left|k\right|\right) \cdot \left(\left(\tan \left(\left|k\right|\right) \cdot t\right) \cdot \frac{\left|k\right|}{\ell \cdot \ell}\right)}\\
\end{array}
if k < 1.3e-7Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.5%
Applied rewrites70.5%
if 1.3e-7 < k Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6478.9%
Applied rewrites78.9%
(FPCore (t l k)
:precision binary64
(if (<= (fabs k) 4911261142184431/37778931862957161709568)
(/ 2 (/ (* (* (pow (fabs k) 3) t) (/ (fabs k) l)) l))
(/
2
(*
(fabs k)
(*
(fabs k)
(* (* (tan (fabs k)) (sin (fabs k))) (/ t (* l l))))))))double code(double t, double l, double k) {
double tmp;
if (fabs(k) <= 1.3e-7) {
tmp = 2.0 / (((pow(fabs(k), 3.0) * t) * (fabs(k) / l)) / l);
} else {
tmp = 2.0 / (fabs(k) * (fabs(k) * ((tan(fabs(k)) * sin(fabs(k))) * (t / (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) :: tmp
if (abs(k) <= 1.3d-7) then
tmp = 2.0d0 / ((((abs(k) ** 3.0d0) * t) * (abs(k) / l)) / l)
else
tmp = 2.0d0 / (abs(k) * (abs(k) * ((tan(abs(k)) * sin(abs(k))) * (t / (l * l)))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(k) <= 1.3e-7) {
tmp = 2.0 / (((Math.pow(Math.abs(k), 3.0) * t) * (Math.abs(k) / l)) / l);
} else {
tmp = 2.0 / (Math.abs(k) * (Math.abs(k) * ((Math.tan(Math.abs(k)) * Math.sin(Math.abs(k))) * (t / (l * l)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(k) <= 1.3e-7: tmp = 2.0 / (((math.pow(math.fabs(k), 3.0) * t) * (math.fabs(k) / l)) / l) else: tmp = 2.0 / (math.fabs(k) * (math.fabs(k) * ((math.tan(math.fabs(k)) * math.sin(math.fabs(k))) * (t / (l * l))))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(k) <= 1.3e-7) tmp = Float64(2.0 / Float64(Float64(Float64((abs(k) ^ 3.0) * t) * Float64(abs(k) / l)) / l)); else tmp = Float64(2.0 / Float64(abs(k) * Float64(abs(k) * Float64(Float64(tan(abs(k)) * sin(abs(k))) * Float64(t / Float64(l * l)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(k) <= 1.3e-7) tmp = 2.0 / ((((abs(k) ^ 3.0) * t) * (abs(k) / l)) / l); else tmp = 2.0 / (abs(k) * (abs(k) * ((tan(abs(k)) * sin(abs(k))) * (t / (l * l))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 4911261142184431/37778931862957161709568], N[(2 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 3], $MachinePrecision] * t), $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[Abs[k], $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] * N[(N[(N[Tan[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(t / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{4911261142184431}{37778931862957161709568}:\\
\;\;\;\;\frac{2}{\frac{\left({\left(\left|k\right|\right)}^{3} \cdot t\right) \cdot \frac{\left|k\right|}{\ell}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\tan \left(\left|k\right|\right) \cdot \sin \left(\left|k\right|\right)\right) \cdot \frac{t}{\ell \cdot \ell}\right)\right)}\\
\end{array}
if k < 1.3e-7Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.5%
Applied rewrites70.5%
if 1.3e-7 < k Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
times-fracN/A
Applied rewrites75.1%
(FPCore (t l k)
:precision binary64
(if (<=
(fabs l)
5600000000000000129321311295108080674007094059169515942411161637667116262204963057648266062460524262220381358454248015500955464633560891638505766413260665039987376016101159633050213350899712)
(/ 2 (/ (* (* (pow k 3) t) (/ k (fabs l))) (fabs l)))
(/
2
(/
(* (* k (/ k (* (fabs l) (fabs l)))) (* (- 1/2 1/2) t))
(cos k)))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 5.6e+189) {
tmp = 2.0 / (((pow(k, 3.0) * t) * (k / fabs(l))) / fabs(l));
} else {
tmp = 2.0 / (((k * (k / (fabs(l) * fabs(l)))) * ((0.5 - 0.5) * t)) / cos(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 (abs(l) <= 5.6d+189) then
tmp = 2.0d0 / ((((k ** 3.0d0) * t) * (k / abs(l))) / abs(l))
else
tmp = 2.0d0 / (((k * (k / (abs(l) * abs(l)))) * ((0.5d0 - 0.5d0) * t)) / cos(k))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 5.6e+189) {
tmp = 2.0 / (((Math.pow(k, 3.0) * t) * (k / Math.abs(l))) / Math.abs(l));
} else {
tmp = 2.0 / (((k * (k / (Math.abs(l) * Math.abs(l)))) * ((0.5 - 0.5) * t)) / Math.cos(k));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 5.6e+189: tmp = 2.0 / (((math.pow(k, 3.0) * t) * (k / math.fabs(l))) / math.fabs(l)) else: tmp = 2.0 / (((k * (k / (math.fabs(l) * math.fabs(l)))) * ((0.5 - 0.5) * t)) / math.cos(k)) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 5.6e+189) tmp = Float64(2.0 / Float64(Float64(Float64((k ^ 3.0) * t) * Float64(k / abs(l))) / abs(l))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(k / Float64(abs(l) * abs(l)))) * Float64(Float64(0.5 - 0.5) * t)) / cos(k))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 5.6e+189) tmp = 2.0 / ((((k ^ 3.0) * t) * (k / abs(l))) / abs(l)); else tmp = 2.0 / (((k * (k / (abs(l) * abs(l)))) * ((0.5 - 0.5) * t)) / cos(k)); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 5600000000000000129321311295108080674007094059169515942411161637667116262204963057648266062460524262220381358454248015500955464633560891638505766413260665039987376016101159633050213350899712], N[(2 / N[(N[(N[(N[Power[k, 3], $MachinePrecision] * t), $MachinePrecision] * N[(k / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1/2 - 1/2), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 5600000000000000129321311295108080674007094059169515942411161637667116262204963057648266062460524262220381358454248015500955464633560891638505766413260665039987376016101159633050213350899712:\\
\;\;\;\;\frac{2}{\frac{\left({k}^{3} \cdot t\right) \cdot \frac{k}{\left|\ell\right|}}{\left|\ell\right|}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right) \cdot \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot t\right)}{\cos k}}\\
\end{array}
if l < 5.6000000000000001e189Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.5%
Applied rewrites70.5%
if 5.6000000000000001e189 < l Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites70.4%
Taylor expanded in k around 0
Applied rewrites36.4%
(FPCore (t l k)
:precision binary64
(if (<=
(fabs l)
1147258064484217/8498207885068273579033411304839498037273489883632510771191106211206456957773635883826600036243668570702229271779944016245545269402443315830552319660265397631101300333366291504507650048)
(* 2 (* (fabs l) (/ (* (pow k -4) (fabs l)) t)))
(/ 2 (* (* t (pow k 2)) (* k (/ k (* (fabs l) (fabs l))))))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 1.35e-169) {
tmp = 2.0 * (fabs(l) * ((pow(k, -4.0) * fabs(l)) / t));
} else {
tmp = 2.0 / ((t * pow(k, 2.0)) * (k * (k / (fabs(l) * fabs(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 (abs(l) <= 1.35d-169) then
tmp = 2.0d0 * (abs(l) * (((k ** (-4.0d0)) * abs(l)) / t))
else
tmp = 2.0d0 / ((t * (k ** 2.0d0)) * (k * (k / (abs(l) * abs(l)))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 1.35e-169) {
tmp = 2.0 * (Math.abs(l) * ((Math.pow(k, -4.0) * Math.abs(l)) / t));
} else {
tmp = 2.0 / ((t * Math.pow(k, 2.0)) * (k * (k / (Math.abs(l) * Math.abs(l)))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 1.35e-169: tmp = 2.0 * (math.fabs(l) * ((math.pow(k, -4.0) * math.fabs(l)) / t)) else: tmp = 2.0 / ((t * math.pow(k, 2.0)) * (k * (k / (math.fabs(l) * math.fabs(l))))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 1.35e-169) tmp = Float64(2.0 * Float64(abs(l) * Float64(Float64((k ^ -4.0) * abs(l)) / t))); else tmp = Float64(2.0 / Float64(Float64(t * (k ^ 2.0)) * Float64(k * Float64(k / Float64(abs(l) * abs(l)))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 1.35e-169) tmp = 2.0 * (abs(l) * (((k ^ -4.0) * abs(l)) / t)); else tmp = 2.0 / ((t * (k ^ 2.0)) * (k * (k / (abs(l) * abs(l))))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 1147258064484217/8498207885068273579033411304839498037273489883632510771191106211206456957773635883826600036243668570702229271779944016245545269402443315830552319660265397631101300333366291504507650048], N[(2 * N[(N[Abs[l], $MachinePrecision] * N[(N[(N[Power[k, -4], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(t * N[Power[k, 2], $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq \frac{1147258064484217}{8498207885068273579033411304839498037273489883632510771191106211206456957773635883826600036243668570702229271779944016245545269402443315830552319660265397631101300333366291504507650048}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \frac{{k}^{-4} \cdot \left|\ell\right|}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t \cdot {k}^{2}\right) \cdot \left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right)}\\
\end{array}
if l < 1.3500000000000001e-169Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-/.f64N/A
mult-flipN/A
lift-pow.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.0%
Applied rewrites69.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.7%
Applied rewrites69.7%
if 1.3500000000000001e-169 < l Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
Taylor expanded in k around 0
lower-pow.f6465.7%
Applied rewrites65.7%
(FPCore (t l k) :precision binary64 (/ 2 (/ (* (* (pow k 3) t) (/ k l)) l)))
double code(double t, double l, double k) {
return 2.0 / (((pow(k, 3.0) * t) * (k / l)) / l);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / ((((k ** 3.0d0) * t) * (k / l)) / l)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((Math.pow(k, 3.0) * t) * (k / l)) / l);
}
def code(t, l, k): return 2.0 / (((math.pow(k, 3.0) * t) * (k / l)) / l)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64((k ^ 3.0) * t) * Float64(k / l)) / l)) end
function tmp = code(t, l, k) tmp = 2.0 / ((((k ^ 3.0) * t) * (k / l)) / l); end
code[t_, l_, k_] := N[(2 / N[(N[(N[(N[Power[k, 3], $MachinePrecision] * t), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{\left({k}^{3} \cdot t\right) \cdot \frac{k}{\ell}}{\ell}}
Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-pow.f64N/A
unpow2N/A
associate-*r/N/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites91.2%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.5%
Applied rewrites70.5%
(FPCore (t l k) :precision binary64 (* (* l (/ l (* (pow k 4) t))) 2))
double code(double t, double l, double k) {
return (l * (l / (pow(k, 4.0) * 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 ** 4.0d0) * t))) * 2.0d0
end function
public static double code(double t, double l, double k) {
return (l * (l / (Math.pow(k, 4.0) * t))) * 2.0;
}
def code(t, l, k): return (l * (l / (math.pow(k, 4.0) * t))) * 2.0
function code(t, l, k) return Float64(Float64(l * Float64(l / Float64((k ^ 4.0) * t))) * 2.0) end
function tmp = code(t, l, k) tmp = (l * (l / ((k ^ 4.0) * t))) * 2.0; end
code[t_, l_, k_] := N[(N[(l * N[(l / N[(N[Power[k, 4], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2), $MachinePrecision]
\left(\ell \cdot \frac{\ell}{{k}^{4} \cdot t}\right) \cdot 2
Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.0%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6469.2%
Applied rewrites69.2%
(FPCore (t l k) :precision binary64 (* 2 (* l (/ (* (pow k -4) l) t))))
double code(double t, double l, double k) {
return 2.0 * (l * ((pow(k, -4.0) * l) / t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 * (l * (((k ** (-4.0d0)) * l) / t))
end function
public static double code(double t, double l, double k) {
return 2.0 * (l * ((Math.pow(k, -4.0) * l) / t));
}
def code(t, l, k): return 2.0 * (l * ((math.pow(k, -4.0) * l) / t))
function code(t, l, k) return Float64(2.0 * Float64(l * Float64(Float64((k ^ -4.0) * l) / t))) end
function tmp = code(t, l, k) tmp = 2.0 * (l * (((k ^ -4.0) * l) / t)); end
code[t_, l_, k_] := N[(2 * N[(l * N[(N[(N[Power[k, -4], $MachinePrecision] * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
2 \cdot \left(\ell \cdot \frac{{k}^{-4} \cdot \ell}{t}\right)
Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-/.f64N/A
mult-flipN/A
lift-pow.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.0%
Applied rewrites69.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.7%
Applied rewrites69.7%
(FPCore (t l k) :precision binary64 (/ (* (+ l l) (* (pow k -4) l)) t))
double code(double t, double l, double k) {
return ((l + l) * (pow(k, -4.0) * l)) / t;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = ((l + l) * ((k ** (-4.0d0)) * l)) / t
end function
public static double code(double t, double l, double k) {
return ((l + l) * (Math.pow(k, -4.0) * l)) / t;
}
def code(t, l, k): return ((l + l) * (math.pow(k, -4.0) * l)) / t
function code(t, l, k) return Float64(Float64(Float64(l + l) * Float64((k ^ -4.0) * l)) / t) end
function tmp = code(t, l, k) tmp = ((l + l) * ((k ^ -4.0) * l)) / t; end
code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[k, -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t}
Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-/.f64N/A
mult-flipN/A
lift-pow.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.0%
Applied rewrites69.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6469.1%
Applied rewrites69.1%
(FPCore (t l k) :precision binary64 (* (+ l l) (* (/ (pow k -4) t) l)))
double code(double t, double l, double k) {
return (l + l) * ((pow(k, -4.0) / t) * l);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = (l + l) * (((k ** (-4.0d0)) / t) * l)
end function
public static double code(double t, double l, double k) {
return (l + l) * ((Math.pow(k, -4.0) / t) * l);
}
def code(t, l, k): return (l + l) * ((math.pow(k, -4.0) / t) * l)
function code(t, l, k) return Float64(Float64(l + l) * Float64(Float64((k ^ -4.0) / t) * l)) end
function tmp = code(t, l, k) tmp = (l + l) * (((k ^ -4.0) / t) * l); end
code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] * N[(N[(N[Power[k, -4], $MachinePrecision] / t), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \ell\right)
Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-/.f64N/A
mult-flipN/A
lift-pow.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.0%
Applied rewrites69.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6462.9%
Applied rewrites62.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.0%
Applied rewrites69.0%
(FPCore (t l k)
:precision binary64
(if (<=
(fabs l)
29999999999999999061648523025317792442531696476907296615914263960963973225365257898969304001787672895785536451103497382835750166803163151679700391165952)
(* (* (+ (fabs l) (fabs l)) (fabs l)) (/ (pow k -4) t))
(/ 2 (/ (* (* k (/ k (* (fabs l) (fabs l)))) (* (- 1/2 1/2) t)) 1))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 3e+151) {
tmp = ((fabs(l) + fabs(l)) * fabs(l)) * (pow(k, -4.0) / t);
} else {
tmp = 2.0 / (((k * (k / (fabs(l) * fabs(l)))) * ((0.5 - 0.5) * t)) / 1.0);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (abs(l) <= 3d+151) then
tmp = ((abs(l) + abs(l)) * abs(l)) * ((k ** (-4.0d0)) / t)
else
tmp = 2.0d0 / (((k * (k / (abs(l) * abs(l)))) * ((0.5d0 - 0.5d0) * t)) / 1.0d0)
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 3e+151) {
tmp = ((Math.abs(l) + Math.abs(l)) * Math.abs(l)) * (Math.pow(k, -4.0) / t);
} else {
tmp = 2.0 / (((k * (k / (Math.abs(l) * Math.abs(l)))) * ((0.5 - 0.5) * t)) / 1.0);
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 3e+151: tmp = ((math.fabs(l) + math.fabs(l)) * math.fabs(l)) * (math.pow(k, -4.0) / t) else: tmp = 2.0 / (((k * (k / (math.fabs(l) * math.fabs(l)))) * ((0.5 - 0.5) * t)) / 1.0) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 3e+151) tmp = Float64(Float64(Float64(abs(l) + abs(l)) * abs(l)) * Float64((k ^ -4.0) / t)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * Float64(k / Float64(abs(l) * abs(l)))) * Float64(Float64(0.5 - 0.5) * t)) / 1.0)); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 3e+151) tmp = ((abs(l) + abs(l)) * abs(l)) * ((k ^ -4.0) / t); else tmp = 2.0 / (((k * (k / (abs(l) * abs(l)))) * ((0.5 - 0.5) * t)) / 1.0); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 29999999999999999061648523025317792442531696476907296615914263960963973225365257898969304001787672895785536451103497382835750166803163151679700391165952], N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, -4], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(2 / N[(N[(N[(k * N[(k / N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1/2 - 1/2), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / 1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 29999999999999999061648523025317792442531696476907296615914263960963973225365257898969304001787672895785536451103497382835750166803163151679700391165952:\\
\;\;\;\;\left(\left(\left|\ell\right| + \left|\ell\right|\right) \cdot \left|\ell\right|\right) \cdot \frac{{k}^{-4}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot \frac{k}{\left|\ell\right| \cdot \left|\ell\right|}\right) \cdot \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot t\right)}{1}}\\
\end{array}
if l < 2.9999999999999999e151Initial program 36.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6463.0%
Applied rewrites63.0%
lift-/.f64N/A
mult-flipN/A
lift-pow.f64N/A
pow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval69.0%
Applied rewrites69.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
count-2-revN/A
lower-+.f6462.9%
Applied rewrites62.9%
if 2.9999999999999999e151 < l Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites70.4%
Taylor expanded in k around 0
Applied rewrites36.4%
Taylor expanded in k around 0
Applied rewrites34.3%
(FPCore (t l k) :precision binary64 (/ 2 (/ (* (* k (/ k (* l l))) (* (- 1/2 1/2) t)) 1)))
double code(double t, double l, double k) {
return 2.0 / (((k * (k / (l * l))) * ((0.5 - 0.5) * t)) / 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 / (((k * (k / (l * l))) * ((0.5d0 - 0.5d0) * t)) / 1.0d0)
end function
public static double code(double t, double l, double k) {
return 2.0 / (((k * (k / (l * l))) * ((0.5 - 0.5) * t)) / 1.0);
}
def code(t, l, k): return 2.0 / (((k * (k / (l * l))) * ((0.5 - 0.5) * t)) / 1.0)
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(k * Float64(k / Float64(l * l))) * Float64(Float64(0.5 - 0.5) * t)) / 1.0)) end
function tmp = code(t, l, k) tmp = 2.0 / (((k * (k / (l * l))) * ((0.5 - 0.5) * t)) / 1.0); end
code[t_, l_, k_] := N[(2 / N[(N[(N[(k * N[(k / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1/2 - 1/2), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / 1), $MachinePrecision]), $MachinePrecision]
\frac{2}{\frac{\left(k \cdot \frac{k}{\ell \cdot \ell}\right) \cdot \left(\left(\frac{1}{2} - \frac{1}{2}\right) \cdot t\right)}{1}}
Initial program 36.4%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f6473.6%
Applied rewrites73.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
Applied rewrites70.4%
Taylor expanded in k around 0
Applied rewrites36.4%
Taylor expanded in k around 0
Applied rewrites34.3%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (t l k)
:name "Toniolo and Linder, Equation (10-)"
:precision binary64
(/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))))