
(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]
\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 12 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]
\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
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 5e+96)
(*
2.0
(*
l
(/ (* l t_1) (* (pow (fabs k) 2.0) (* t (pow (sin (fabs k)) 2.0))))))
(*
2.0
(*
t_1
(*
(/ l (* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) t) (fabs k)))
(/ l (fabs k))))))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 5e+96) {
tmp = 2.0 * (l * ((l * t_1) / (pow(fabs(k), 2.0) * (t * pow(sin(fabs(k)), 2.0)))));
} else {
tmp = 2.0 * (t_1 * ((l / ((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * t) * fabs(k))) * (l / fabs(k))));
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 5e+96) tmp = Float64(2.0 * Float64(l * Float64(Float64(l * t_1) / Float64((abs(k) ^ 2.0) * Float64(t * (sin(abs(k)) ^ 2.0)))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(l / Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * t) * abs(k))) * Float64(l / abs(k))))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 5e+96], N[(2.0 * N[(l * N[(N[(l * t$95$1), $MachinePrecision] / N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t * N[Power[N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(l / N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 5 \cdot 10^{+96}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \frac{\ell \cdot t\_1}{{\left(\left|k\right|\right)}^{2} \cdot \left(t \cdot {\sin \left(\left|k\right|\right)}^{2}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(\frac{\ell}{\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot t\right) \cdot \left|k\right|} \cdot \frac{\ell}{\left|k\right|}\right)\right)\\
\end{array}
if k < 5.0000000000000004e96Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-+.f64N/A
count-2N/A
sqr-sin-a-revN/A
pow2N/A
lower-pow.f64N/A
lower-sin.f6486.0%
Applied rewrites86.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6482.4%
Applied rewrites82.4%
if 5.0000000000000004e96 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6473.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites83.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 8.8e-7)
(*
2.0
(*
l
(* l (/ t_1 (* (* (* (pow (sin (fabs k)) 2.0) t) (fabs k)) (fabs k))))))
(*
2.0
(*
t_1
(*
(/ l (* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) t) (fabs k)))
(/ l (fabs k))))))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 8.8e-7) {
tmp = 2.0 * (l * (l * (t_1 / (((pow(sin(fabs(k)), 2.0) * t) * fabs(k)) * fabs(k)))));
} else {
tmp = 2.0 * (t_1 * ((l / ((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * t) * fabs(k))) * (l / fabs(k))));
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 8.8e-7) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(t_1 / Float64(Float64(Float64((sin(abs(k)) ^ 2.0) * t) * abs(k)) * abs(k)))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(l / Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * t) * abs(k))) * Float64(l / abs(k))))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 8.8e-7], N[(2.0 * N[(l * N[(l * N[(t$95$1 / N[(N[(N[(N[Power[N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(l / N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{t\_1}{\left(\left({\sin \left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(\frac{\ell}{\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot t\right) \cdot \left|k\right|} \cdot \frac{\ell}{\left|k\right|}\right)\right)\\
\end{array}
if k < 8.8000000000000004e-7Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-+.f64N/A
count-2N/A
sqr-sin-a-revN/A
pow2N/A
lower-pow.f64N/A
lower-sin.f6486.0%
Applied rewrites86.0%
if 8.8000000000000004e-7 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6473.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites83.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 8.8e-7)
(*
2.0
(* l (* l (/ t_1 (* (* (* (pow (fabs k) 2.0) t) (fabs k)) (fabs k))))))
(*
2.0
(*
t_1
(*
(/ l (* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) t) (fabs k)))
(/ l (fabs k))))))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 8.8e-7) {
tmp = 2.0 * (l * (l * (t_1 / (((pow(fabs(k), 2.0) * t) * fabs(k)) * fabs(k)))));
} else {
tmp = 2.0 * (t_1 * ((l / ((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * t) * fabs(k))) * (l / fabs(k))));
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 8.8e-7) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(t_1 / Float64(Float64(Float64((abs(k) ^ 2.0) * t) * abs(k)) * abs(k)))))); else tmp = Float64(2.0 * Float64(t_1 * Float64(Float64(l / Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * t) * abs(k))) * Float64(l / abs(k))))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 8.8e-7], N[(2.0 * N[(l * N[(l * N[(t$95$1 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 * N[(N[(l / N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{t\_1}{\left(\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(t\_1 \cdot \left(\frac{\ell}{\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot t\right) \cdot \left|k\right|} \cdot \frac{\ell}{\left|k\right|}\right)\right)\\
\end{array}
if k < 8.8000000000000004e-7Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-pow.f6471.5%
Applied rewrites71.5%
if 8.8000000000000004e-7 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6473.2%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites69.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites83.4%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 8.8e-7)
(*
2.0
(* l (* l (/ t_1 (* (* (* (pow (fabs k) 2.0) t) (fabs k)) (fabs k))))))
(*
2.0
(*
l
(/
(/ (* t_1 l) (fabs k))
(* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) (fabs k)) t)))))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 8.8e-7) {
tmp = 2.0 * (l * (l * (t_1 / (((pow(fabs(k), 2.0) * t) * fabs(k)) * fabs(k)))));
} else {
tmp = 2.0 * (l * (((t_1 * l) / fabs(k)) / ((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * fabs(k)) * t)));
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 8.8e-7) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(t_1 / Float64(Float64(Float64((abs(k) ^ 2.0) * t) * abs(k)) * abs(k)))))); else tmp = Float64(2.0 * Float64(l * Float64(Float64(Float64(t_1 * l) / abs(k)) / Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * abs(k)) * t)))); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 8.8e-7], N[(2.0 * N[(l * N[(l * N[(t$95$1 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(l * N[(N[(N[(t$95$1 * l), $MachinePrecision] / N[Abs[k], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{t\_1}{\left(\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \frac{\frac{t\_1 \cdot \ell}{\left|k\right|}}{\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot \left|k\right|\right) \cdot t}\right)\\
\end{array}
if k < 8.8000000000000004e-7Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-pow.f6471.5%
Applied rewrites71.5%
if 8.8000000000000004e-7 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-+.f64N/A
count-2N/A
sqr-sin-a-revN/A
pow2N/A
lower-pow.f64N/A
lower-sin.f6486.0%
Applied rewrites86.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-*.f64N/A
Applied rewrites82.5%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 8.4e-7)
(*
2.0
(* l (* l (/ t_1 (* (* (* (pow (fabs k) 2.0) t) (fabs k)) (fabs k))))))
(*
(/
(* t_1 l)
(*
(* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) t) (fabs k))
(fabs k)))
(+ l l)))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 8.4e-7) {
tmp = 2.0 * (l * (l * (t_1 / (((pow(fabs(k), 2.0) * t) * fabs(k)) * fabs(k)))));
} else {
tmp = ((t_1 * l) / (((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * t) * fabs(k)) * fabs(k))) * (l + l);
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 8.4e-7) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(t_1 / Float64(Float64(Float64((abs(k) ^ 2.0) * t) * abs(k)) * abs(k)))))); else tmp = Float64(Float64(Float64(t_1 * l) / Float64(Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * t) * abs(k)) * abs(k))) * Float64(l + l)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 8.4e-7], N[(2.0 * N[(l * N[(l * N[(t$95$1 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * l), $MachinePrecision] / N[(N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 8.4 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{t\_1}{\left(\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \ell}{\left(\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|} \cdot \left(\ell + \ell\right)\\
\end{array}
if k < 8.4e-7Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-pow.f6471.5%
Applied rewrites71.5%
if 8.4e-7 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites78.7%
(FPCore (t l k)
:precision binary64
(let* ((t_1 (cos (fabs k))))
(if (<= (fabs k) 8.4e-7)
(*
2.0
(* l (* l (/ t_1 (* (* (* (pow (fabs k) 2.0) t) (fabs k)) (fabs k))))))
(*
(/
(* t_1 l)
(*
(* (* (fma (cos (+ (fabs k) (fabs k))) -0.5 0.5) (fabs k)) t)
(fabs k)))
(+ l l)))))double code(double t, double l, double k) {
double t_1 = cos(fabs(k));
double tmp;
if (fabs(k) <= 8.4e-7) {
tmp = 2.0 * (l * (l * (t_1 / (((pow(fabs(k), 2.0) * t) * fabs(k)) * fabs(k)))));
} else {
tmp = ((t_1 * l) / (((fma(cos((fabs(k) + fabs(k))), -0.5, 0.5) * fabs(k)) * t) * fabs(k))) * (l + l);
}
return tmp;
}
function code(t, l, k) t_1 = cos(abs(k)) tmp = 0.0 if (abs(k) <= 8.4e-7) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(t_1 / Float64(Float64(Float64((abs(k) ^ 2.0) * t) * abs(k)) * abs(k)))))); else tmp = Float64(Float64(Float64(t_1 * l) / Float64(Float64(Float64(fma(cos(Float64(abs(k) + abs(k))), -0.5, 0.5) * abs(k)) * t) * abs(k))) * Float64(l + l)); end return tmp end
code[t_, l_, k_] := Block[{t$95$1 = N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 8.4e-7], N[(2.0 * N[(l * N[(l * N[(t$95$1 / N[(N[(N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * l), $MachinePrecision] / N[(N[(N[(N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \cos \left(\left|k\right|\right)\\
\mathbf{if}\;\left|k\right| \leq 8.4 \cdot 10^{-7}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{t\_1}{\left(\left({\left(\left|k\right|\right)}^{2} \cdot t\right) \cdot \left|k\right|\right) \cdot \left|k\right|}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot \ell}{\left(\left(\mathsf{fma}\left(\cos \left(\left|k\right| + \left|k\right|\right), -0.5, 0.5\right) \cdot \left|k\right|\right) \cdot t\right) \cdot \left|k\right|} \cdot \left(\ell + \ell\right)\\
\end{array}
if k < 8.4e-7Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-pow.f6471.5%
Applied rewrites71.5%
if 8.4e-7 < k Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-+.f64N/A
count-2N/A
sqr-sin-a-revN/A
pow2N/A
lower-pow.f64N/A
lower-sin.f6486.0%
Applied rewrites86.0%
Applied rewrites78.7%
(FPCore (t l k)
:precision binary64
(if (<= (fabs l) 3.4e+167)
(*
2.0
(* (fabs l) (* (fabs l) (/ 1.0 (* (* (* (pow (sin k) 2.0) t) k) k)))))
(*
2.0
(* (fabs l) (* (fabs l) (/ (cos k) (* (* (* (- 0.5 0.5) t) k) k)))))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 3.4e+167) {
tmp = 2.0 * (fabs(l) * (fabs(l) * (1.0 / (((pow(sin(k), 2.0) * t) * k) * k))));
} else {
tmp = 2.0 * (fabs(l) * (fabs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (abs(l) <= 3.4d+167) then
tmp = 2.0d0 * (abs(l) * (abs(l) * (1.0d0 / ((((sin(k) ** 2.0d0) * t) * k) * k))))
else
tmp = 2.0d0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5d0 - 0.5d0) * t) * k) * k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 3.4e+167) {
tmp = 2.0 * (Math.abs(l) * (Math.abs(l) * (1.0 / (((Math.pow(Math.sin(k), 2.0) * t) * k) * k))));
} else {
tmp = 2.0 * (Math.abs(l) * (Math.abs(l) * (Math.cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 3.4e+167: tmp = 2.0 * (math.fabs(l) * (math.fabs(l) * (1.0 / (((math.pow(math.sin(k), 2.0) * t) * k) * k)))) else: tmp = 2.0 * (math.fabs(l) * (math.fabs(l) * (math.cos(k) / ((((0.5 - 0.5) * t) * k) * k)))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 3.4e+167) tmp = Float64(2.0 * Float64(abs(l) * Float64(abs(l) * Float64(1.0 / Float64(Float64(Float64((sin(k) ^ 2.0) * t) * k) * k))))); else tmp = Float64(2.0 * Float64(abs(l) * Float64(abs(l) * Float64(cos(k) / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * k) * k))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 3.4e+167) tmp = 2.0 * (abs(l) * (abs(l) * (1.0 / ((((sin(k) ^ 2.0) * t) * k) * k)))); else tmp = 2.0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 3.4e+167], N[(2.0 * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(1.0 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 3.4 \cdot 10^{+167}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \left(\left|\ell\right| \cdot \frac{1}{\left(\left({\sin k}^{2} \cdot t\right) \cdot k\right) \cdot k}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \left(\left|\ell\right| \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k\right) \cdot k}\right)\right)\\
\end{array}
if l < 3.4e167Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
lift--.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-+.f64N/A
count-2N/A
sqr-sin-a-revN/A
pow2N/A
lower-pow.f64N/A
lower-sin.f6486.0%
Applied rewrites86.0%
Taylor expanded in k around 0
Applied rewrites72.3%
if 3.4e167 < l Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
Applied rewrites41.2%
(FPCore (t l k)
:precision binary64
(if (<= (fabs l) 1.35e+160)
(* 2.0 (* (fabs l) (* (fabs l) (/ (cos k) (* (* (pow k 3.0) t) k)))))
(*
2.0
(* (fabs l) (* (fabs l) (/ (cos k) (* (* (* (- 0.5 0.5) t) k) k)))))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 1.35e+160) {
tmp = 2.0 * (fabs(l) * (fabs(l) * (cos(k) / ((pow(k, 3.0) * t) * k))));
} else {
tmp = 2.0 * (fabs(l) * (fabs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (abs(l) <= 1.35d+160) then
tmp = 2.0d0 * (abs(l) * (abs(l) * (cos(k) / (((k ** 3.0d0) * t) * k))))
else
tmp = 2.0d0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5d0 - 0.5d0) * t) * k) * k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 1.35e+160) {
tmp = 2.0 * (Math.abs(l) * (Math.abs(l) * (Math.cos(k) / ((Math.pow(k, 3.0) * t) * k))));
} else {
tmp = 2.0 * (Math.abs(l) * (Math.abs(l) * (Math.cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 1.35e+160: tmp = 2.0 * (math.fabs(l) * (math.fabs(l) * (math.cos(k) / ((math.pow(k, 3.0) * t) * k)))) else: tmp = 2.0 * (math.fabs(l) * (math.fabs(l) * (math.cos(k) / ((((0.5 - 0.5) * t) * k) * k)))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 1.35e+160) tmp = Float64(2.0 * Float64(abs(l) * Float64(abs(l) * Float64(cos(k) / Float64(Float64((k ^ 3.0) * t) * k))))); else tmp = Float64(2.0 * Float64(abs(l) * Float64(abs(l) * Float64(cos(k) / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * k) * k))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 1.35e+160) tmp = 2.0 * (abs(l) * (abs(l) * (cos(k) / (((k ^ 3.0) * t) * k)))); else tmp = 2.0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 1.35e+160], N[(2.0 * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[Power[k, 3.0], $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 1.35 \cdot 10^{+160}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \left(\left|\ell\right| \cdot \frac{\cos k}{\left({k}^{3} \cdot t\right) \cdot k}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \left(\left|\ell\right| \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k\right) \cdot k}\right)\right)\\
\end{array}
if l < 1.35e160Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-*.f64N/A
lower-pow.f6470.6%
Applied rewrites70.6%
if 1.35e160 < l Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
Applied rewrites41.2%
(FPCore (t l k)
:precision binary64
(if (<= (fabs l) 6.6e+159)
(* (/ (/ (+ (fabs l) (fabs l)) (pow k 4.0)) t) (fabs l))
(*
2.0
(* (fabs l) (* (fabs l) (/ (cos k) (* (* (* (- 0.5 0.5) t) k) k)))))))double code(double t, double l, double k) {
double tmp;
if (fabs(l) <= 6.6e+159) {
tmp = (((fabs(l) + fabs(l)) / pow(k, 4.0)) / t) * fabs(l);
} else {
tmp = 2.0 * (fabs(l) * (fabs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (abs(l) <= 6.6d+159) then
tmp = (((abs(l) + abs(l)) / (k ** 4.0d0)) / t) * abs(l)
else
tmp = 2.0d0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5d0 - 0.5d0) * t) * k) * k))))
end if
code = tmp
end function
public static double code(double t, double l, double k) {
double tmp;
if (Math.abs(l) <= 6.6e+159) {
tmp = (((Math.abs(l) + Math.abs(l)) / Math.pow(k, 4.0)) / t) * Math.abs(l);
} else {
tmp = 2.0 * (Math.abs(l) * (Math.abs(l) * (Math.cos(k) / ((((0.5 - 0.5) * t) * k) * k))));
}
return tmp;
}
def code(t, l, k): tmp = 0 if math.fabs(l) <= 6.6e+159: tmp = (((math.fabs(l) + math.fabs(l)) / math.pow(k, 4.0)) / t) * math.fabs(l) else: tmp = 2.0 * (math.fabs(l) * (math.fabs(l) * (math.cos(k) / ((((0.5 - 0.5) * t) * k) * k)))) return tmp
function code(t, l, k) tmp = 0.0 if (abs(l) <= 6.6e+159) tmp = Float64(Float64(Float64(Float64(abs(l) + abs(l)) / (k ^ 4.0)) / t) * abs(l)); else tmp = Float64(2.0 * Float64(abs(l) * Float64(abs(l) * Float64(cos(k) / Float64(Float64(Float64(Float64(0.5 - 0.5) * t) * k) * k))))); end return tmp end
function tmp_2 = code(t, l, k) tmp = 0.0; if (abs(l) <= 6.6e+159) tmp = (((abs(l) + abs(l)) / (k ^ 4.0)) / t) * abs(l); else tmp = 2.0 * (abs(l) * (abs(l) * (cos(k) / ((((0.5 - 0.5) * t) * k) * k)))); end tmp_2 = tmp; end
code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 6.6e+159], N[(N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[Abs[l], $MachinePrecision] * N[(N[Abs[l], $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(N[(0.5 - 0.5), $MachinePrecision] * t), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|\ell\right| \leq 6.6 \cdot 10^{+159}:\\
\;\;\;\;\frac{\frac{\left|\ell\right| + \left|\ell\right|}{{k}^{4}}}{t} \cdot \left|\ell\right|\\
\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\left|\ell\right| \cdot \left(\left|\ell\right| \cdot \frac{\cos k}{\left(\left(\left(0.5 - 0.5\right) \cdot t\right) \cdot k\right) \cdot k}\right)\right)\\
\end{array}
if l < 6.5999999999999998e159Initial program 36.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6461.8%
Applied rewrites61.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.8%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.4%
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6468.4%
Applied rewrites68.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.1%
Applied rewrites69.1%
if 6.5999999999999998e159 < l Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
Applied rewrites41.2%
(FPCore (t l k)
:precision binary64
(if (<= (fabs k) 1.4e+34)
(*
2.0
(*
l
(*
l
(/
(fma -0.16666666666666666 (/ (pow (fabs k) 2.0) t) (/ 1.0 t))
(pow (fabs k) 4.0)))))
(/ (* (* (* l l) (pow (fabs k) -4.0)) 2.0) t)))double code(double t, double l, double k) {
double tmp;
if (fabs(k) <= 1.4e+34) {
tmp = 2.0 * (l * (l * (fma(-0.16666666666666666, (pow(fabs(k), 2.0) / t), (1.0 / t)) / pow(fabs(k), 4.0))));
} else {
tmp = (((l * l) * pow(fabs(k), -4.0)) * 2.0) / t;
}
return tmp;
}
function code(t, l, k) tmp = 0.0 if (abs(k) <= 1.4e+34) tmp = Float64(2.0 * Float64(l * Float64(l * Float64(fma(-0.16666666666666666, Float64((abs(k) ^ 2.0) / t), Float64(1.0 / t)) / (abs(k) ^ 4.0))))); else tmp = Float64(Float64(Float64(Float64(l * l) * (abs(k) ^ -4.0)) * 2.0) / t); end return tmp end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 1.4e+34], N[(2.0 * N[(l * N[(l * N[(N[(-0.16666666666666666 * N[(N[Power[N[Abs[k], $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision] + N[(1.0 / t), $MachinePrecision]), $MachinePrecision] / N[Power[N[Abs[k], $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] * N[Power[N[Abs[k], $MachinePrecision], -4.0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq 1.4 \cdot 10^{+34}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\mathsf{fma}\left(-0.16666666666666666, \frac{{\left(\left|k\right|\right)}^{2}}{t}, \frac{1}{t}\right)}{{\left(\left|k\right|\right)}^{4}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\ell \cdot \ell\right) \cdot {\left(\left|k\right|\right)}^{-4}\right) \cdot 2}{t}\\
\end{array}
if k < 1.4e34Initial program 36.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6473.3%
Applied rewrites73.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6482.3%
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
unpow2N/A
associate-*r*N/A
Applied rewrites78.7%
Taylor expanded in k around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-pow.f6451.4%
Applied rewrites51.4%
if 1.4e34 < k Initial program 36.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6461.8%
Applied rewrites61.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
mult-flipN/A
lower-*.f64N/A
lift-pow.f64N/A
pow-flipN/A
lower-pow.f64N/A
metadata-eval61.9%
Applied rewrites61.9%
(FPCore (t l k) :precision binary64 (* (/ (/ (+ l l) (pow k 4.0)) 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(Float64(Float64(l + l) / (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[(N[(N[(l + l), $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * l), $MachinePrecision]
\frac{\frac{\ell + \ell}{{k}^{4}}}{t} \cdot \ell
Initial program 36.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6461.8%
Applied rewrites61.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.8%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.4%
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6468.4%
Applied rewrites68.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.1%
Applied rewrites69.1%
(FPCore (t l k) :precision binary64 (* (/ (+ l l) (* (pow k 4.0) 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(Float64(l + l) / 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[(N[(l + l), $MachinePrecision] / N[(N[Power[k, 4.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]
\frac{\ell + \ell}{{k}^{4} \cdot t} \cdot \ell
Initial program 36.3%
Taylor expanded in k around 0
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6461.8%
Applied rewrites61.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.8%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6468.4%
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lower-/.f64N/A
count-2-revN/A
lower-+.f6468.4%
Applied rewrites68.4%
herbie shell --seed 2025191
(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))))