
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (pow (sin k_m) 2.0)))
(if (<= k_m 1.7e-99)
(/ 2.0 (* (* k_m k_m) (* (/ t (cos k_m)) (/ (/ t_1 l) l))))
(/ 2.0 (/ (* t_1 (* k_m (/ (* k_m t) l))) (* (cos k_m) l))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = pow(sin(k_m), 2.0);
double tmp;
if (k_m <= 1.7e-99) {
tmp = 2.0 / ((k_m * k_m) * ((t / cos(k_m)) * ((t_1 / l) / l)));
} else {
tmp = 2.0 / ((t_1 * (k_m * ((k_m * t) / l))) / (cos(k_m) * l));
}
return tmp;
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: t_1
real(8) :: tmp
t_1 = sin(k_m) ** 2.0d0
if (k_m <= 1.7d-99) then
tmp = 2.0d0 / ((k_m * k_m) * ((t / cos(k_m)) * ((t_1 / l) / l)))
else
tmp = 2.0d0 / ((t_1 * (k_m * ((k_m * t) / l))) / (cos(k_m) * l))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double t_1 = Math.pow(Math.sin(k_m), 2.0);
double tmp;
if (k_m <= 1.7e-99) {
tmp = 2.0 / ((k_m * k_m) * ((t / Math.cos(k_m)) * ((t_1 / l) / l)));
} else {
tmp = 2.0 / ((t_1 * (k_m * ((k_m * t) / l))) / (Math.cos(k_m) * l));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): t_1 = math.pow(math.sin(k_m), 2.0) tmp = 0 if k_m <= 1.7e-99: tmp = 2.0 / ((k_m * k_m) * ((t / math.cos(k_m)) * ((t_1 / l) / l))) else: tmp = 2.0 / ((t_1 * (k_m * ((k_m * t) / l))) / (math.cos(k_m) * l)) return tmp
k_m = abs(k) function code(t, l, k_m) t_1 = sin(k_m) ^ 2.0 tmp = 0.0 if (k_m <= 1.7e-99) tmp = Float64(2.0 / Float64(Float64(k_m * k_m) * Float64(Float64(t / cos(k_m)) * Float64(Float64(t_1 / l) / l)))); else tmp = Float64(2.0 / Float64(Float64(t_1 * Float64(k_m * Float64(Float64(k_m * t) / l))) / Float64(cos(k_m) * l))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) t_1 = sin(k_m) ^ 2.0; tmp = 0.0; if (k_m <= 1.7e-99) tmp = 2.0 / ((k_m * k_m) * ((t / cos(k_m)) * ((t_1 / l) / l))); else tmp = 2.0 / ((t_1 * (k_m * ((k_m * t) / l))) / (cos(k_m) * l)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 1.7e-99], N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$1 / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$1 * N[(k$95$m * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := {\sin k\_m}^{2}\\
\mathbf{if}\;k\_m \leq 1.7 \cdot 10^{-99}:\\
\;\;\;\;\frac{2}{\left(k\_m \cdot k\_m\right) \cdot \left(\frac{t}{\cos k\_m} \cdot \frac{\frac{t\_1}{\ell}}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_1 \cdot \left(k\_m \cdot \frac{k\_m \cdot t}{\ell}\right)}{\cos k\_m \cdot \ell}}\\
\end{array}
\end{array}
if k < 1.70000000000000003e-99Initial program 47.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.4
Applied rewrites74.4%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
Applied rewrites92.1%
if 1.70000000000000003e-99 < k Initial program 30.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites92.0%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.15e-101)
(/
2.0
(*
(/ (* k_m (* k_m t)) (fma -0.5 (* k_m k_m) 1.0))
(* (/ k_m l) (/ k_m l))))
(/
2.0
(/ (* (pow (sin k_m) 2.0) (* k_m (/ (* k_m t) l))) (* (cos k_m) l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 1.15e-101) {
tmp = 2.0 / (((k_m * (k_m * t)) / fma(-0.5, (k_m * k_m), 1.0)) * ((k_m / l) * (k_m / l)));
} else {
tmp = 2.0 / ((pow(sin(k_m), 2.0) * (k_m * ((k_m * t) / l))) / (cos(k_m) * l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 1.15e-101) tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(k_m * t)) / fma(-0.5, Float64(k_m * k_m), 1.0)) * Float64(Float64(k_m / l) * Float64(k_m / l)))); else tmp = Float64(2.0 / Float64(Float64((sin(k_m) ^ 2.0) * Float64(k_m * Float64(Float64(k_m * t) / l))) / Float64(cos(k_m) * l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.15e-101], N[(2.0 / N[(N[(N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(-0.5 * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * N[(k$95$m * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.15 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{\frac{k\_m \cdot \left(k\_m \cdot t\right)}{\mathsf{fma}\left(-0.5, k\_m \cdot k\_m, 1\right)} \cdot \left(\frac{k\_m}{\ell} \cdot \frac{k\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{{\sin k\_m}^{2} \cdot \left(k\_m \cdot \frac{k\_m \cdot t}{\ell}\right)}{\cos k\_m \cdot \ell}}\\
\end{array}
\end{array}
if k < 1.15e-101Initial program 47.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.4
Applied rewrites74.4%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.0
Applied rewrites92.0%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6492.0
Applied rewrites92.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6496.1
Applied rewrites96.1%
if 1.15e-101 < k Initial program 30.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.1
Applied rewrites74.1%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites92.0%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (/ 2.0 (* (* (/ k_m l) (/ (* k_m t) l)) (/ (pow (sin k_m) 2.0) (cos k_m)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return 2.0 / (((k_m / l) * ((k_m * t) / l)) * (pow(sin(k_m), 2.0) / cos(k_m)));
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = 2.0d0 / (((k_m / l) * ((k_m * t) / l)) * ((sin(k_m) ** 2.0d0) / cos(k_m)))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return 2.0 / (((k_m / l) * ((k_m * t) / l)) * (Math.pow(Math.sin(k_m), 2.0) / Math.cos(k_m)));
}
k_m = math.fabs(k) def code(t, l, k_m): return 2.0 / (((k_m / l) * ((k_m * t) / l)) * (math.pow(math.sin(k_m), 2.0) / math.cos(k_m)))
k_m = abs(k) function code(t, l, k_m) return Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64((sin(k_m) ^ 2.0) / cos(k_m)))) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * ((sin(k_m) ^ 2.0) / cos(k_m))); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \frac{{\sin k\_m}^{2}}{\cos k\_m}}
\end{array}
Initial program 36.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.2
Applied rewrites74.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.5%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (* (/ k_m l) (/ (* k_m t) l))))
(if (<= k_m 0.032)
(/
2.0
(*
t_1
(*
(fma
(fma
(fma 0.03432539682539683 (* k_m k_m) 0.08611111111111111)
(* k_m k_m)
0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(/ 2.0 (* t_1 (/ (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) (cos k_m)))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m / l) * ((k_m * t) / l);
double tmp;
if (k_m <= 0.032) {
tmp = 2.0 / (t_1 * (fma(fma(fma(0.03432539682539683, (k_m * k_m), 0.08611111111111111), (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = 2.0 / (t_1 * ((0.5 - (0.5 * cos((2.0 * k_m)))) / cos(k_m)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) tmp = 0.0 if (k_m <= 0.032) tmp = Float64(2.0 / Float64(t_1 * Float64(fma(fma(fma(0.03432539682539683, Float64(k_m * k_m), 0.08611111111111111), Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) / cos(k_m)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 0.032], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(0.03432539682539683 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.08611111111111111), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\\
\mathbf{if}\;k\_m \leq 0.032:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.03432539682539683, k\_m \cdot k\_m, 0.08611111111111111\right), k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)}{\cos k\_m}}\\
\end{array}
\end{array}
if k < 0.032000000000000001Initial program 41.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.9%
if 0.032000000000000001 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.1
Applied rewrites71.1%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites93.1%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6492.7
Applied rewrites92.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(let* ((t_1 (/ (* k_m t) l)))
(if (<= k_m 0.032)
(/
2.0
(*
(* (/ k_m l) t_1)
(*
(fma
(fma
(fma 0.03432539682539683 (* k_m k_m) 0.08611111111111111)
(* k_m k_m)
0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(/
2.0
(/ (* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) (* k_m t_1)) (* (cos k_m) l))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double t_1 = (k_m * t) / l;
double tmp;
if (k_m <= 0.032) {
tmp = 2.0 / (((k_m / l) * t_1) * (fma(fma(fma(0.03432539682539683, (k_m * k_m), 0.08611111111111111), (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = 2.0 / (((0.5 - (0.5 * cos((2.0 * k_m)))) * (k_m * t_1)) / (cos(k_m) * l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) t_1 = Float64(Float64(k_m * t) / l) tmp = 0.0 if (k_m <= 0.032) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * t_1) * Float64(fma(fma(fma(0.03432539682539683, Float64(k_m * k_m), 0.08611111111111111), Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(2.0 / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) * Float64(k_m * t_1)) / Float64(cos(k_m) * l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 0.032], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[(N[(N[(0.03432539682539683 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.08611111111111111), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
t_1 := \frac{k\_m \cdot t}{\ell}\\
\mathbf{if}\;k\_m \leq 0.032:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot t\_1\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.03432539682539683, k\_m \cdot k\_m, 0.08611111111111111\right), k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right) \cdot \left(k\_m \cdot t\_1\right)}{\cos k\_m \cdot \ell}}\\
\end{array}
\end{array}
if k < 0.032000000000000001Initial program 41.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.9%
if 0.032000000000000001 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.1
Applied rewrites71.1%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites93.1%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites91.0%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6490.7
Applied rewrites90.7%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 0.034)
(/
2.0
(*
(* (/ k_m l) (/ (* k_m t) l))
(*
(fma
(fma
(fma 0.03432539682539683 (* k_m k_m) 0.08611111111111111)
(* k_m k_m)
0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(/
2.0
(*
(/ (* (* k_m k_m) t) (cos k_m))
(/ (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) (* l l))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 0.034) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (fma(fma(fma(0.03432539682539683, (k_m * k_m), 0.08611111111111111), (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = 2.0 / ((((k_m * k_m) * t) / cos(k_m)) * ((0.5 - (0.5 * cos((2.0 * k_m)))) / (l * l)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 0.034) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(fma(fma(fma(0.03432539682539683, Float64(k_m * k_m), 0.08611111111111111), Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * t) / cos(k_m)) * Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) / Float64(l * l)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 0.034], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.03432539682539683 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.08611111111111111), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 0.034:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.03432539682539683, k\_m \cdot k\_m, 0.08611111111111111\right), k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot t}{\cos k\_m} \cdot \frac{0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 0.034000000000000002Initial program 41.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.9%
if 0.034000000000000002 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.1
Applied rewrites71.1%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6471.0
Applied rewrites71.0%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 0.034)
(/
2.0
(*
(* (/ k_m l) (/ (* k_m t) l))
(*
(fma
(fma
(fma 0.03432539682539683 (* k_m k_m) 0.08611111111111111)
(* k_m k_m)
0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(/
2.0
(/
(* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) (* (* k_m k_m) t))
(* (cos k_m) (* l l))))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 0.034) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (fma(fma(fma(0.03432539682539683, (k_m * k_m), 0.08611111111111111), (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = 2.0 / (((0.5 - (0.5 * cos((2.0 * k_m)))) * ((k_m * k_m) * t)) / (cos(k_m) * (l * l)));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 0.034) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(fma(fma(fma(0.03432539682539683, Float64(k_m * k_m), 0.08611111111111111), Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(2.0 / Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) * Float64(Float64(k_m * k_m) * t)) / Float64(cos(k_m) * Float64(l * l)))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 0.034], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.03432539682539683 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.08611111111111111), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 0.034:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.03432539682539683, k\_m \cdot k\_m, 0.08611111111111111\right), k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right) \cdot \left(\left(k\_m \cdot k\_m\right) \cdot t\right)}{\cos k\_m \cdot \left(\ell \cdot \ell\right)}}\\
\end{array}
\end{array}
if k < 0.034000000000000002Initial program 41.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.2
Applied rewrites77.2%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.9%
if 0.034000000000000002 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.1
Applied rewrites71.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
*-commutativeN/A
pow2N/A
pow2N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites71.2%
lift-pow.f64N/A
lift-sin.f64N/A
unpow2N/A
sqr-sin-aN/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f6471.0
Applied rewrites71.0%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 1.15e-101)
(/
2.0
(*
(/ (* k_m (* k_m t)) (fma -0.5 (* k_m k_m) 1.0))
(* (/ k_m l) (/ k_m l))))
(/ 2.0 (/ (* (* k_m k_m) (* k_m (/ (* k_m t) l))) (* (cos k_m) l)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 1.15e-101) {
tmp = 2.0 / (((k_m * (k_m * t)) / fma(-0.5, (k_m * k_m), 1.0)) * ((k_m / l) * (k_m / l)));
} else {
tmp = 2.0 / (((k_m * k_m) * (k_m * ((k_m * t) / l))) / (cos(k_m) * l));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 1.15e-101) tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(k_m * t)) / fma(-0.5, Float64(k_m * k_m), 1.0)) * Float64(Float64(k_m / l) * Float64(k_m / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(k_m * Float64(Float64(k_m * t) / l))) / Float64(cos(k_m) * l))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.15e-101], N[(2.0 / N[(N[(N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / N[(-0.5 * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(k$95$m * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1.15 \cdot 10^{-101}:\\
\;\;\;\;\frac{2}{\frac{k\_m \cdot \left(k\_m \cdot t\right)}{\mathsf{fma}\left(-0.5, k\_m \cdot k\_m, 1\right)} \cdot \left(\frac{k\_m}{\ell} \cdot \frac{k\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(k\_m \cdot \frac{k\_m \cdot t}{\ell}\right)}{\cos k\_m \cdot \ell}}\\
\end{array}
\end{array}
if k < 1.15e-101Initial program 47.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.4
Applied rewrites74.4%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.0
Applied rewrites92.0%
Taylor expanded in k around 0
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6492.0
Applied rewrites92.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6496.1
Applied rewrites96.1%
if 1.15e-101 < k Initial program 30.4%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.1
Applied rewrites74.1%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.8%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
lift-cos.f64N/A
*-commutativeN/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites92.0%
Taylor expanded in k around 0
pow2N/A
lift-*.f6466.0
Applied rewrites66.0%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 26.5)
(/
2.0
(*
(* (/ k_m l) (/ (* k_m t) l))
(*
(fma
(fma
(fma 0.03432539682539683 (* k_m k_m) 0.08611111111111111)
(* k_m k_m)
0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 26.5) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (fma(fma(fma(0.03432539682539683, (k_m * k_m), 0.08611111111111111), (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 26.5) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(fma(fma(fma(0.03432539682539683, Float64(k_m * k_m), 0.08611111111111111), Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 26.5], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(0.03432539682539683 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.08611111111111111), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 26.5:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.03432539682539683, k\_m \cdot k\_m, 0.08611111111111111\right), k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 26.5Initial program 41.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.6%
if 26.5 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6454.9
Applied rewrites54.9%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 26.5)
(/
2.0
(*
(* (/ k_m l) (/ (* k_m t) l))
(*
(fma
(fma 0.08611111111111111 (* k_m k_m) 0.16666666666666666)
(* k_m k_m)
1.0)
(* k_m k_m))))
(* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 26.5) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (fma(fma(0.08611111111111111, (k_m * k_m), 0.16666666666666666), (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 26.5) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(fma(fma(0.08611111111111111, Float64(k_m * k_m), 0.16666666666666666), Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 26.5], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.08611111111111111 * N[(k$95$m * k$95$m), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 26.5:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(0.08611111111111111, k\_m \cdot k\_m, 0.16666666666666666\right), k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 26.5Initial program 41.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6491.6
Applied rewrites91.6%
if 26.5 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6454.9
Applied rewrites54.9%
k_m = (fabs.f64 k)
(FPCore (t l k_m)
:precision binary64
(if (<= k_m 26.5)
(/
2.0
(*
(* (/ k_m l) (/ (* k_m t) l))
(* (fma 0.16666666666666666 (* k_m k_m) 1.0) (* k_m k_m))))
(* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 26.5) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (fma(0.16666666666666666, (k_m * k_m), 1.0) * (k_m * k_m)));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 26.5) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(fma(0.16666666666666666, Float64(k_m * k_m), 1.0) * Float64(k_m * k_m)))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 26.5], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(0.16666666666666666 * N[(k$95$m * k$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 26.5:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(\mathsf{fma}\left(0.16666666666666666, k\_m \cdot k\_m, 1\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 26.5Initial program 41.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6491.5
Applied rewrites91.5%
if 26.5 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6454.9
Applied rewrites54.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= k_m 26.5) (/ 2.0 (* (* (/ k_m l) (/ (* k_m t) l)) (* k_m k_m))) (* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 26.5) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (k_m * k_m));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 26.5d0) then
tmp = 2.0d0 / (((k_m / l) * ((k_m * t) / l)) * (k_m * k_m))
else
tmp = ((l * l) / k_m) * ((-0.3333333333333333d0) / (k_m * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 26.5) {
tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (k_m * k_m));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 26.5: tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (k_m * k_m)) else: tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 26.5) tmp = Float64(2.0 / Float64(Float64(Float64(k_m / l) * Float64(Float64(k_m * t) / l)) * Float64(k_m * k_m))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 26.5) tmp = 2.0 / (((k_m / l) * ((k_m * t) / l)) * (k_m * k_m)); else tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 26.5], N[(2.0 / N[(N[(N[(k$95$m / l), $MachinePrecision] * N[(N[(k$95$m * t), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 26.5:\\
\;\;\;\;\frac{2}{\left(\frac{k\_m}{\ell} \cdot \frac{k\_m \cdot t}{\ell}\right) \cdot \left(k\_m \cdot k\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 26.5Initial program 41.3%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
lift-/.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
lift-sin.f64N/A
pow2N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites91.9%
Taylor expanded in k around 0
pow2N/A
lift-*.f6491.3
Applied rewrites91.3%
if 26.5 < k Initial program 30.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites35.9%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6454.9
Applied rewrites54.9%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= k_m 550000000000.0) (/ 2.0 (* (* (* k_m k_m) t) (* (/ k_m l) (/ k_m l)))) (* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = 2.0 / (((k_m * k_m) * t) * ((k_m / l) * (k_m / l)));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 550000000000.0d0) then
tmp = 2.0d0 / (((k_m * k_m) * t) * ((k_m / l) * (k_m / l)))
else
tmp = ((l * l) / k_m) * ((-0.3333333333333333d0) / (k_m * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = 2.0 / (((k_m * k_m) * t) * ((k_m / l) * (k_m / l)));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 550000000000.0: tmp = 2.0 / (((k_m * k_m) * t) * ((k_m / l) * (k_m / l))) else: tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 550000000000.0) tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * t) * Float64(Float64(k_m / l) * Float64(k_m / l)))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 550000000000.0) tmp = 2.0 / (((k_m * k_m) * t) * ((k_m / l) * (k_m / l))); else tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 550000000000.0], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k$95$m / l), $MachinePrecision] * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 550000000000:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(\frac{k\_m}{\ell} \cdot \frac{k\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 5.5e11Initial program 40.9%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6477.6
Applied rewrites77.6%
Taylor expanded in k around 0
pow2N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.9
Applied rewrites88.9%
Taylor expanded in k around 0
pow2N/A
lift-*.f64N/A
lift-*.f6488.4
Applied rewrites88.4%
if 5.5e11 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6470.4
Applied rewrites70.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6455.4
Applied rewrites55.4%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= k_m 550000000000.0) (* (/ (/ (* l l) t) (* k_m k_m)) (/ 2.0 (* k_m k_m))) (* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = (((l * l) / t) / (k_m * k_m)) * (2.0 / (k_m * k_m));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 550000000000.0d0) then
tmp = (((l * l) / t) / (k_m * k_m)) * (2.0d0 / (k_m * k_m))
else
tmp = ((l * l) / k_m) * ((-0.3333333333333333d0) / (k_m * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = (((l * l) / t) / (k_m * k_m)) * (2.0 / (k_m * k_m));
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 550000000000.0: tmp = (((l * l) / t) / (k_m * k_m)) * (2.0 / (k_m * k_m)) else: tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 550000000000.0) tmp = Float64(Float64(Float64(Float64(l * l) / t) / Float64(k_m * k_m)) * Float64(2.0 / Float64(k_m * k_m))); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 550000000000.0) tmp = (((l * l) / t) / (k_m * k_m)) * (2.0 / (k_m * k_m)); else tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 550000000000.0], N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 550000000000:\\
\;\;\;\;\frac{\frac{\ell \cdot \ell}{t}}{k\_m \cdot k\_m} \cdot \frac{2}{k\_m \cdot k\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 5.5e11Initial program 40.9%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6468.8
Applied rewrites68.8%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
associate-*l/N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
metadata-evalN/A
pow-prod-upN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6471.3
Applied rewrites71.3%
if 5.5e11 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6470.4
Applied rewrites70.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6455.4
Applied rewrites55.4%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (if (<= k_m 550000000000.0) (* (/ 2.0 (* (* k_m k_m) (* k_m k_m))) (/ (* l l) t)) (* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = (2.0 / ((k_m * k_m) * (k_m * k_m))) * ((l * l) / t);
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
real(8) :: tmp
if (k_m <= 550000000000.0d0) then
tmp = (2.0d0 / ((k_m * k_m) * (k_m * k_m))) * ((l * l) / t)
else
tmp = ((l * l) / k_m) * ((-0.3333333333333333d0) / (k_m * t))
end if
code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
double tmp;
if (k_m <= 550000000000.0) {
tmp = (2.0 / ((k_m * k_m) * (k_m * k_m))) * ((l * l) / t);
} else {
tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
return tmp;
}
k_m = math.fabs(k) def code(t, l, k_m): tmp = 0 if k_m <= 550000000000.0: tmp = (2.0 / ((k_m * k_m) * (k_m * k_m))) * ((l * l) / t) else: tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)) return tmp
k_m = abs(k) function code(t, l, k_m) tmp = 0.0 if (k_m <= 550000000000.0) tmp = Float64(Float64(2.0 / Float64(Float64(k_m * k_m) * Float64(k_m * k_m))) * Float64(Float64(l * l) / t)); else tmp = Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))); end return tmp end
k_m = abs(k); function tmp_2 = code(t, l, k_m) tmp = 0.0; if (k_m <= 550000000000.0) tmp = (2.0 / ((k_m * k_m) * (k_m * k_m))) * ((l * l) / t); else tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)); end tmp_2 = tmp; end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 550000000000.0], N[(N[(2.0 / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|
\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 550000000000:\\
\;\;\;\;\frac{2}{\left(k\_m \cdot k\_m\right) \cdot \left(k\_m \cdot k\_m\right)} \cdot \frac{\ell \cdot \ell}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}\\
\end{array}
\end{array}
if k < 5.5e11Initial program 40.9%
Taylor expanded in k around 0
associate-*r/N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6468.8
Applied rewrites68.8%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6468.8
Applied rewrites68.8%
if 5.5e11 < k Initial program 31.1%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6470.4
Applied rewrites70.4%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6455.4
Applied rewrites55.4%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (* (/ (* l l) k_m) (/ -0.3333333333333333 (* k_m t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = ((l * l) / k_m) * ((-0.3333333333333333d0) / (k_m * t))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t));
}
k_m = math.fabs(k) def code(t, l, k_m): return ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t))
k_m = abs(k) function code(t, l, k_m) return Float64(Float64(Float64(l * l) / k_m) * Float64(-0.3333333333333333 / Float64(k_m * t))) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = ((l * l) / k_m) * (-0.3333333333333333 / (k_m * t)); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(N[(N[(l * l), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(-0.3333333333333333 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
\frac{\ell \cdot \ell}{k\_m} \cdot \frac{-0.3333333333333333}{k\_m \cdot t}
\end{array}
Initial program 36.2%
Taylor expanded in t around 0
associate-*r*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6474.2
Applied rewrites74.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites50.2%
Taylor expanded in k around inf
associate-*r/N/A
*-commutativeN/A
pow2N/A
associate-*l*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
lift-*.f6429.4
Applied rewrites29.4%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (* -0.11666666666666667 (/ (* l l) t)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return -0.11666666666666667 * ((l * l) / t);
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = (-0.11666666666666667d0) * ((l * l) / t)
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return -0.11666666666666667 * ((l * l) / t);
}
k_m = math.fabs(k) def code(t, l, k_m): return -0.11666666666666667 * ((l * l) / t)
k_m = abs(k) function code(t, l, k_m) return Float64(-0.11666666666666667 * Float64(Float64(l * l) / t)) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = -0.11666666666666667 * ((l * l) / t); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(-0.11666666666666667 * N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
-0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t}
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.1%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.5
Applied rewrites20.5%
k_m = (fabs.f64 k) (FPCore (t l k_m) :precision binary64 (* -0.11666666666666667 (* l (/ l t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
return -0.11666666666666667 * (l * (l / t));
}
k_m = private
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_m)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k_m
code = (-0.11666666666666667d0) * (l * (l / t))
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
return -0.11666666666666667 * (l * (l / t));
}
k_m = math.fabs(k) def code(t, l, k_m): return -0.11666666666666667 * (l * (l / t))
k_m = abs(k) function code(t, l, k_m) return Float64(-0.11666666666666667 * Float64(l * Float64(l / t))) end
k_m = abs(k); function tmp = code(t, l, k_m) tmp = -0.11666666666666667 * (l * (l / t)); end
k_m = N[Abs[k], $MachinePrecision] code[t_, l_, k$95$m_] := N[(-0.11666666666666667 * N[(l * N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
k_m = \left|k\right|
\\
-0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right)
\end{array}
Initial program 36.2%
Taylor expanded in k around 0
lower-/.f64N/A
Applied rewrites28.1%
Taylor expanded in k around inf
lower-*.f64N/A
pow2N/A
lift-/.f64N/A
lift-*.f6420.5
Applied rewrites20.5%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6418.0
Applied rewrites18.0%
herbie shell --seed 2025098
(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))))