
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 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}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 9.6e-10)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ (/ l (pow (sin k) 2.0)) k) t_m))
(/
(/ 2.0 (/ t_m l))
(*
(* (/ (* (sin k) t_m) l) t_m)
(* (+ (pow (/ k t_m) 2.0) 2.0) (tan k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 9.6e-10) {
tmp = (((cos(k) * l) * 2.0) / k) * (((l / pow(sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / (t_m / l)) / ((((sin(k) * t_m) / l) * t_m) * ((pow((k / t_m), 2.0) + 2.0) * tan(k)));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 9.6d-10) then
tmp = (((cos(k) * l) * 2.0d0) / k) * (((l / (sin(k) ** 2.0d0)) / k) / t_m)
else
tmp = (2.0d0 / (t_m / l)) / ((((sin(k) * t_m) / l) * t_m) * ((((k / t_m) ** 2.0d0) + 2.0d0) * tan(k)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 9.6e-10) {
tmp = (((Math.cos(k) * l) * 2.0) / k) * (((l / Math.pow(Math.sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / (t_m / l)) / ((((Math.sin(k) * t_m) / l) * t_m) * ((Math.pow((k / t_m), 2.0) + 2.0) * Math.tan(k)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 9.6e-10: tmp = (((math.cos(k) * l) * 2.0) / k) * (((l / math.pow(math.sin(k), 2.0)) / k) / t_m) else: tmp = (2.0 / (t_m / l)) / ((((math.sin(k) * t_m) / l) * t_m) * ((math.pow((k / t_m), 2.0) + 2.0) * math.tan(k))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 9.6e-10) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) / k) / t_m)); else tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64(Float64(sin(k) * t_m) / l) * t_m) * Float64(Float64((Float64(k / t_m) ^ 2.0) + 2.0) * tan(k)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 9.6e-10) tmp = (((cos(k) * l) * 2.0) / k) * (((l / (sin(k) ^ 2.0)) / k) / t_m); else tmp = (2.0 / (t_m / l)) / ((((sin(k) * t_m) / l) * t_m) * ((((k / t_m) ^ 2.0) + 2.0) * tan(k))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 9.6e-10], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.6 \cdot 10^{-10}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\frac{\ell}{{\sin k}^{2}}}{k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\left(\frac{\sin k \cdot t\_m}{\ell} \cdot t\_m\right) \cdot \left(\left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right) \cdot \tan k\right)}\\
\end{array}
\end{array}
if t < 9.5999999999999999e-10Initial program 46.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6458.6
Applied rewrites58.6%
Applied rewrites69.4%
Applied rewrites79.3%
if 9.5999999999999999e-10 < t Initial program 67.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites75.3%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6492.7
Applied rewrites92.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6493.8
Applied rewrites93.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-/l/N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6496.3
Applied rewrites96.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 2.85e-39)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ (/ l (pow (sin k) 2.0)) k) t_m))
(/
(/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l))))
(* (tan k) (+ (pow (/ k t_m) 2.0) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.85e-39) {
tmp = (((cos(k) * l) * 2.0) / k) * (((l / pow(sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (tan(k) * (pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.85d-39) then
tmp = (((cos(k) * l) * 2.0d0) / k) * (((l / (sin(k) ** 2.0d0)) / k) / t_m)
else
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.85e-39) {
tmp = (((Math.cos(k) * l) * 2.0) / k) * (((l / Math.pow(Math.sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 2.85e-39: tmp = (((math.cos(k) * l) * 2.0) / k) * (((l / math.pow(math.sin(k), 2.0)) / k) / t_m) else: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 2.85e-39) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) / k) / t_m)); else tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 2.85e-39) tmp = (((cos(k) * l) * 2.0) / k) * (((l / (sin(k) ^ 2.0)) / k) / t_m); else tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (tan(k) * (((k / t_m) ^ 2.0) + 2.0)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.85e-39], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.85 \cdot 10^{-39}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\frac{\ell}{{\sin k}^{2}}}{k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)}\\
\end{array}
\end{array}
if t < 2.8499999999999998e-39Initial program 45.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6458.2
Applied rewrites58.2%
Applied rewrites69.4%
Applied rewrites79.7%
if 2.8499999999999998e-39 < t Initial program 69.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites77.0%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6493.1
Applied rewrites93.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6494.2
Applied rewrites94.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 6e-37)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ (/ l (pow (sin k) 2.0)) k) t_m))
(/
(/ 2.0 (* t_m (* (/ t_m l) (* (/ t_m l) (sin k)))))
(* (tan k) (+ (pow (/ k t_m) 2.0) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6e-37) {
tmp = (((cos(k) * l) * 2.0) / k) * (((l / pow(sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / (t_m * ((t_m / l) * ((t_m / l) * sin(k))))) / (tan(k) * (pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 6d-37) then
tmp = (((cos(k) * l) * 2.0d0) / k) * (((l / (sin(k) ** 2.0d0)) / k) / t_m)
else
tmp = (2.0d0 / (t_m * ((t_m / l) * ((t_m / l) * sin(k))))) / (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6e-37) {
tmp = (((Math.cos(k) * l) * 2.0) / k) * (((l / Math.pow(Math.sin(k), 2.0)) / k) / t_m);
} else {
tmp = (2.0 / (t_m * ((t_m / l) * ((t_m / l) * Math.sin(k))))) / (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 6e-37: tmp = (((math.cos(k) * l) * 2.0) / k) * (((l / math.pow(math.sin(k), 2.0)) / k) / t_m) else: tmp = (2.0 / (t_m * ((t_m / l) * ((t_m / l) * math.sin(k))))) / (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6e-37) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) / k) / t_m)); else tmp = Float64(Float64(2.0 / Float64(t_m * Float64(Float64(t_m / l) * Float64(Float64(t_m / l) * sin(k))))) / Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 6e-37) tmp = (((cos(k) * l) * 2.0) / k) * (((l / (sin(k) ^ 2.0)) / k) / t_m); else tmp = (2.0 / (t_m * ((t_m / l) * ((t_m / l) * sin(k))))) / (tan(k) * (((k / t_m) ^ 2.0) + 2.0)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6e-37], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6 \cdot 10^{-37}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\frac{\ell}{{\sin k}^{2}}}{k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot \left(\frac{t\_m}{\ell} \cdot \left(\frac{t\_m}{\ell} \cdot \sin k\right)\right)}}{\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)}\\
\end{array}
\end{array}
if t < 6e-37Initial program 45.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6458.4
Applied rewrites58.4%
Applied rewrites69.5%
Applied rewrites79.8%
if 6e-37 < t Initial program 69.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites76.7%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6493.1
Applied rewrites93.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1e-9)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ (/ l (pow (sin k) 2.0)) k) t_m))
(/
2.0
(*
(* (* (pow (/ t_m l) 2.0) (sin k)) (* t_m (tan k)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1e-9) {
tmp = (((cos(k) * l) * 2.0) / k) * (((l / pow(sin(k), 2.0)) / k) / t_m);
} else {
tmp = 2.0 / (((pow((t_m / l), 2.0) * sin(k)) * (t_m * tan(k))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1e-9) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) / k) / t_m)); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(t_m / l) ^ 2.0) * sin(k)) * Float64(t_m * tan(k))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1e-9], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(t$95$m / l), $MachinePrecision], 2.0], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$m * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 10^{-9}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\frac{\ell}{{\sin k}^{2}}}{k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{t\_m}{\ell}\right)}^{2} \cdot \sin k\right) \cdot \left(t\_m \cdot \tan k\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 1.00000000000000006e-9Initial program 46.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6458.6
Applied rewrites58.6%
Applied rewrites69.4%
Applied rewrites79.3%
if 1.00000000000000006e-9 < t Initial program 67.5%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6481.6
Applied rewrites81.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites92.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 0.0021)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ (/ l (pow (sin k) 2.0)) k) t_m)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = (((cos(k) * l) * 2.0) / k) * (((l / pow(sin(k), 2.0)) / k) / t_m);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.0021d0) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = (((cos(k) * l) * 2.0d0) / k) * (((l / (sin(k) ** 2.0d0)) / k) / t_m)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = (((Math.cos(k) * l) * 2.0) / k) * (((l / Math.pow(Math.sin(k), 2.0)) / k) / t_m);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 0.0021: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = (((math.cos(k) * l) * 2.0) / k) * (((l / math.pow(math.sin(k), 2.0)) / k) / t_m) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 0.0021) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) / k) / t_m)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 0.0021) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = (((cos(k) * l) * 2.0) / k) * (((l / (sin(k) ^ 2.0)) / k) / t_m); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.0021], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.0021:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\frac{\ell}{{\sin k}^{2}}}{k}}{t\_m}\\
\end{array}
\end{array}
if k < 0.00209999999999999987Initial program 52.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.2
Applied rewrites78.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
lower-*.f6469.3
Applied rewrites69.3%
if 0.00209999999999999987 < k Initial program 55.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6463.0
Applied rewrites63.0%
Applied rewrites72.4%
Applied rewrites90.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1e-9)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ l (pow (sin k) 2.0)) (* k t_m)))
(/
2.0
(*
(* (* (/ t_m l) t_m) (* (* (sin k) (/ t_m l)) (tan k)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1e-9) {
tmp = (((cos(k) * l) * 2.0) / k) * ((l / pow(sin(k), 2.0)) / (k * t_m));
} else {
tmp = 2.0 / ((((t_m / l) * t_m) * ((sin(k) * (t_m / l)) * tan(k))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1e-9) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(l / (sin(k) ^ 2.0)) / Float64(k * t_m))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * t_m) * Float64(Float64(sin(k) * Float64(t_m / l)) * tan(k))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1e-9], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 10^{-9}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{k \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \left(\left(\sin k \cdot \frac{t\_m}{\ell}\right) \cdot \tan k\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 1.00000000000000006e-9Initial program 46.9%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6458.6
Applied rewrites58.6%
Applied rewrites69.4%
Applied rewrites78.2%
if 1.00000000000000006e-9 < t Initial program 67.5%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6481.6
Applied rewrites81.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6490.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.3
Applied rewrites90.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 5e-126)
(* (* (* (cos k) l) 2.0) (/ (/ l (pow (sin k) 2.0)) (* (* k t_m) k)))
(/
2.0
(*
(* (* (/ t_m l) t_m) (* (* (sin k) (/ t_m l)) (tan k)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5e-126) {
tmp = ((cos(k) * l) * 2.0) * ((l / pow(sin(k), 2.0)) / ((k * t_m) * k));
} else {
tmp = 2.0 / ((((t_m / l) * t_m) * ((sin(k) * (t_m / l)) * tan(k))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5e-126) tmp = Float64(Float64(Float64(cos(k) * l) * 2.0) * Float64(Float64(l / (sin(k) ^ 2.0)) / Float64(Float64(k * t_m) * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * t_m) * Float64(Float64(sin(k) * Float64(t_m / l)) * tan(k))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5e-126], N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-126}:\\
\;\;\;\;\left(\left(\cos k \cdot \ell\right) \cdot 2\right) \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{\left(k \cdot t\_m\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \left(\left(\sin k \cdot \frac{t\_m}{\ell}\right) \cdot \tan k\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 5.00000000000000006e-126Initial program 42.1%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6457.1
Applied rewrites57.1%
Applied rewrites68.2%
Applied rewrites73.6%
if 5.00000000000000006e-126 < t Initial program 69.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 5e-126)
(/ 2.0 (/ (* (* (/ (sin k) l) (tan k)) (* (* k t_m) k)) l))
(/
2.0
(*
(* (* (/ t_m l) t_m) (* (* (sin k) (/ t_m l)) (tan k)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5e-126) {
tmp = 2.0 / ((((sin(k) / l) * tan(k)) * ((k * t_m) * k)) / l);
} else {
tmp = 2.0 / ((((t_m / l) * t_m) * ((sin(k) * (t_m / l)) * tan(k))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5e-126) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) / l) * tan(k)) * Float64(Float64(k * t_m) * k)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * t_m) * Float64(Float64(sin(k) * Float64(t_m / l)) * tan(k))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5e-126], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-126}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{\sin k}{\ell} \cdot \tan k\right) \cdot \left(\left(k \cdot t\_m\right) \cdot k\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \left(\left(\sin k \cdot \frac{t\_m}{\ell}\right) \cdot \tan k\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 5.00000000000000006e-126Initial program 42.1%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6454.9
Applied rewrites54.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6454.9
Applied rewrites54.9%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6462.9
Applied rewrites62.9%
Applied rewrites73.3%
if 5.00000000000000006e-126 < t Initial program 69.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.2
Applied rewrites88.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 5e-126)
(/ 2.0 (/ (* (* (/ (sin k) l) (tan k)) (* (* k t_m) k)) l))
(/
2.0
(*
(* (* (* (/ t_m l) (* (/ t_m l) t_m)) (sin k)) (tan k))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5e-126) {
tmp = 2.0 / ((((sin(k) / l) * tan(k)) * ((k * t_m) * k)) / l);
} else {
tmp = 2.0 / (((((t_m / l) * ((t_m / l) * t_m)) * sin(k)) * tan(k)) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5e-126) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) / l) * tan(k)) * Float64(Float64(k * t_m) * k)) / l)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l) * Float64(Float64(t_m / l) * t_m)) * sin(k)) * tan(k)) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5e-126], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5 \cdot 10^{-126}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{\sin k}{\ell} \cdot \tan k\right) \cdot \left(\left(k \cdot t\_m\right) \cdot k\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t\_m}{\ell} \cdot \left(\frac{t\_m}{\ell} \cdot t\_m\right)\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 5.00000000000000006e-126Initial program 42.1%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6454.9
Applied rewrites54.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6454.9
Applied rewrites54.9%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6462.9
Applied rewrites62.9%
Applied rewrites73.3%
if 5.00000000000000006e-126 < t Initial program 69.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6480.9
Applied rewrites80.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6480.9
Applied rewrites80.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.9
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6487.3
Applied rewrites87.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 0.0021)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(/ 2.0 (/ (* (* (/ (sin k) l) (tan k)) (* (* k t_m) k)) l)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / ((((sin(k) / l) * tan(k)) * ((k * t_m) * k)) / l);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.0021d0) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = 2.0d0 / ((((sin(k) / l) * tan(k)) * ((k * t_m) * k)) / l)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / ((((Math.sin(k) / l) * Math.tan(k)) * ((k * t_m) * k)) / l);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 0.0021: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = 2.0 / ((((math.sin(k) / l) * math.tan(k)) * ((k * t_m) * k)) / l) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 0.0021) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) / l) * tan(k)) * Float64(Float64(k * t_m) * k)) / l)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 0.0021) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = 2.0 / ((((sin(k) / l) * tan(k)) * ((k * t_m) * k)) / l); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.0021], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.0021:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{\sin k}{\ell} \cdot \tan k\right) \cdot \left(\left(k \cdot t\_m\right) \cdot k\right)}{\ell}}\\
\end{array}
\end{array}
if k < 0.00209999999999999987Initial program 52.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.2
Applied rewrites78.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
lower-*.f6469.3
Applied rewrites69.3%
if 0.00209999999999999987 < k Initial program 55.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6471.7
Applied rewrites71.7%
Applied rewrites80.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 0.0021)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(/ 2.0 (* (* (* (tan k) (/ (sin k) (* l l))) (* k t_m)) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((tan(k) * (sin(k) / (l * l))) * (k * t_m)) * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.0021d0) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = 2.0d0 / (((tan(k) * (sin(k) / (l * l))) * (k * t_m)) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((Math.tan(k) * (Math.sin(k) / (l * l))) * (k * t_m)) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 0.0021: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = 2.0 / (((math.tan(k) * (math.sin(k) / (l * l))) * (k * t_m)) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 0.0021) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(tan(k) * Float64(sin(k) / Float64(l * l))) * Float64(k * t_m)) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 0.0021) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = 2.0 / (((tan(k) * (sin(k) / (l * l))) * (k * t_m)) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.0021], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.0021:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\tan k \cdot \frac{\sin k}{\ell \cdot \ell}\right) \cdot \left(k \cdot t\_m\right)\right) \cdot k}\\
\end{array}
\end{array}
if k < 0.00209999999999999987Initial program 52.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.2
Applied rewrites78.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
lower-*.f6469.3
Applied rewrites69.3%
if 0.00209999999999999987 < k Initial program 55.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6471.7
Applied rewrites71.7%
Applied rewrites71.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 0.0021)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(/ 2.0 (* (* (* (tan k) (/ (sin k) (* l l))) k) (* k t_m))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((tan(k) * (sin(k) / (l * l))) * k) * (k * t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.0021d0) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = 2.0d0 / (((tan(k) * (sin(k) / (l * l))) * k) * (k * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((Math.tan(k) * (Math.sin(k) / (l * l))) * k) * (k * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 0.0021: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = 2.0 / (((math.tan(k) * (math.sin(k) / (l * l))) * k) * (k * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 0.0021) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(tan(k) * Float64(sin(k) / Float64(l * l))) * k) * Float64(k * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 0.0021) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = 2.0 / (((tan(k) * (sin(k) / (l * l))) * k) * (k * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.0021], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.0021:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\tan k \cdot \frac{\sin k}{\ell \cdot \ell}\right) \cdot k\right) \cdot \left(k \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 0.00209999999999999987Initial program 52.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.2
Applied rewrites78.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
lower-*.f6469.3
Applied rewrites69.3%
if 0.00209999999999999987 < k Initial program 55.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6471.7
Applied rewrites71.7%
Applied rewrites73.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 0.0021)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(/ 2.0 (* k (* t_m (* (* (tan k) (/ (sin k) (* l l))) k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k)));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 0.0021d0) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = 2.0d0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 0.0021) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (k * (t_m * ((Math.tan(k) * (Math.sin(k) / (l * l))) * k)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 0.0021: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = 2.0 / (k * (t_m * ((math.tan(k) * (math.sin(k) / (l * l))) * k))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 0.0021) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(2.0 / Float64(k * Float64(t_m * Float64(Float64(tan(k) * Float64(sin(k) / Float64(l * l))) * k)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 0.0021) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = 2.0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 0.0021], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(t$95$m * N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 0.0021:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(t\_m \cdot \left(\left(\tan k \cdot \frac{\sin k}{\ell \cdot \ell}\right) \cdot k\right)\right)}\\
\end{array}
\end{array}
if k < 0.00209999999999999987Initial program 52.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.5%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.2
Applied rewrites78.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.2%
Taylor expanded in k around 0
lower-*.f6469.3
Applied rewrites69.3%
if 0.00209999999999999987 < k Initial program 55.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6471.7
Applied rewrites71.7%
Applied rewrites73.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.1e-132)
(/ 2.0 (* (/ (pow k 4.0) l) (/ t_m l)))
(/
(/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l))))
(*
(fma
(fma
(* (+ 0.26666666666666666 (/ 0.3333333333333333 (* t_m t_m))) k)
k
(+ 0.6666666666666666 (/ 1.0 (* t_m t_m))))
(* k k)
2.0)
k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.1e-132) {
tmp = 2.0 / ((pow(k, 4.0) / l) * (t_m / l));
} else {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (fma(fma(((0.26666666666666666 + (0.3333333333333333 / (t_m * t_m))) * k), k, (0.6666666666666666 + (1.0 / (t_m * t_m)))), (k * k), 2.0) * k);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1.1e-132) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l) * Float64(t_m / l))); else tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(fma(fma(Float64(Float64(0.26666666666666666 + Float64(0.3333333333333333 / Float64(t_m * t_m))) * k), k, Float64(0.6666666666666666 + Float64(1.0 / Float64(t_m * t_m)))), Float64(k * k), 2.0) * k)); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.1e-132], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.26666666666666666 + N[(0.3333333333333333 / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * k + N[(0.6666666666666666 + N[(1.0 / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t\_m}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{\mathsf{fma}\left(\mathsf{fma}\left(\left(0.26666666666666666 + \frac{0.3333333333333333}{t\_m \cdot t\_m}\right) \cdot k, k, 0.6666666666666666 + \frac{1}{t\_m \cdot t\_m}\right), k \cdot k, 2\right) \cdot k}\\
\end{array}
\end{array}
if t < 1.09999999999999995e-132Initial program 42.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6454.7
Applied rewrites54.7%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6462.8
Applied rewrites62.8%
Taylor expanded in k around 0
Applied rewrites54.0%
if 1.09999999999999995e-132 < t Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites76.4%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6489.2
Applied rewrites89.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.9
Applied rewrites90.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.1e-132)
(/ 2.0 (* (/ (pow k 4.0) l) (/ t_m l)))
(/
(/ 2.0 (* t_m (* (/ t_m l) (* (/ t_m l) (sin k)))))
(* (fma (+ 0.6666666666666666 (/ 1.0 (* t_m t_m))) (* k k) 2.0) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.1e-132) {
tmp = 2.0 / ((pow(k, 4.0) / l) * (t_m / l));
} else {
tmp = (2.0 / (t_m * ((t_m / l) * ((t_m / l) * sin(k))))) / (fma((0.6666666666666666 + (1.0 / (t_m * t_m))), (k * k), 2.0) * k);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1.1e-132) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l) * Float64(t_m / l))); else tmp = Float64(Float64(2.0 / Float64(t_m * Float64(Float64(t_m / l) * Float64(Float64(t_m / l) * sin(k))))) / Float64(fma(Float64(0.6666666666666666 + Float64(1.0 / Float64(t_m * t_m))), Float64(k * k), 2.0) * k)); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.1e-132], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(0.6666666666666666 + N[(1.0 / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.1 \cdot 10^{-132}:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t\_m}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{t\_m \cdot \left(\frac{t\_m}{\ell} \cdot \left(\frac{t\_m}{\ell} \cdot \sin k\right)\right)}}{\mathsf{fma}\left(0.6666666666666666 + \frac{1}{t\_m \cdot t\_m}, k \cdot k, 2\right) \cdot k}\\
\end{array}
\end{array}
if t < 1.09999999999999995e-132Initial program 42.3%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6454.7
Applied rewrites54.7%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6454.7
Applied rewrites54.7%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6462.8
Applied rewrites62.8%
Taylor expanded in k around 0
Applied rewrites54.0%
if 1.09999999999999995e-132 < t Initial program 68.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites76.4%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6489.2
Applied rewrites89.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6482.3
Applied rewrites82.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 4.1e+17)
(/ (/ 2.0 (* (/ t_m l) (* (* (sin k) t_m) (/ t_m l)))) (* 2.0 k))
(/ 2.0 (* (* (* k t_m) k) (* (/ k l) (/ k l)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 4.1e+17) {
tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 4.1d+17) then
tmp = (2.0d0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0d0 * k)
else
tmp = 2.0d0 / (((k * t_m) * k) * ((k / l) * (k / l)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 4.1e+17) {
tmp = (2.0 / ((t_m / l) * ((Math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k);
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 4.1e+17: tmp = (2.0 / ((t_m / l) * ((math.sin(k) * t_m) * (t_m / l)))) / (2.0 * k) else: tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 4.1e+17) tmp = Float64(Float64(2.0 / Float64(Float64(t_m / l) * Float64(Float64(sin(k) * t_m) * Float64(t_m / l)))) / Float64(2.0 * k)); else tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(k / l) * Float64(k / l)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 4.1e+17) tmp = (2.0 / ((t_m / l) * ((sin(k) * t_m) * (t_m / l)))) / (2.0 * k); else tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 4.1e+17], N[(N[(2.0 / N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(2.0 * k), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 4.1 \cdot 10^{+17}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell} \cdot \left(\left(\sin k \cdot t\_m\right) \cdot \frac{t\_m}{\ell}\right)}}{2 \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if k < 4.1e17Initial program 52.9%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites61.4%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-*l/N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l*N/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-*.f6478.1
Applied rewrites78.1%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in k around 0
lower-*.f6469.1
Applied rewrites69.1%
if 4.1e17 < k Initial program 54.8%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6467.9
Applied rewrites67.9%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6467.9
Applied rewrites67.9%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6471.7
Applied rewrites71.7%
Taylor expanded in k around 0
Applied rewrites56.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 6.4e-81)
(/ 2.0 (* (/ (pow k 4.0) l) (/ t_m l)))
(if (<= t_m 4.8e+130)
(* (/ (/ l (* t_m t_m)) (* k t_m)) (/ l k))
(/ (* (/ l t_m) (/ l t_m)) (* (* k t_m) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.4e-81) {
tmp = 2.0 / ((pow(k, 4.0) / l) * (t_m / l));
} else if (t_m <= 4.8e+130) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 6.4d-81) then
tmp = 2.0d0 / (((k ** 4.0d0) / l) * (t_m / l))
else if (t_m <= 4.8d+130) then
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k)
else
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.4e-81) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l) * (t_m / l));
} else if (t_m <= 4.8e+130) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 6.4e-81: tmp = 2.0 / ((math.pow(k, 4.0) / l) * (t_m / l)) elif t_m <= 4.8e+130: tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k) else: tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6.4e-81) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l) * Float64(t_m / l))); elseif (t_m <= 4.8e+130) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / Float64(k * t_m)) * Float64(l / k)); else tmp = Float64(Float64(Float64(l / t_m) * Float64(l / t_m)) / Float64(Float64(k * t_m) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 6.4e-81) tmp = 2.0 / (((k ^ 4.0) / l) * (t_m / l)); elseif (t_m <= 4.8e+130) tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k); else tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6.4e-81], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4.8e+130], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t\_m}{\ell}}\\
\mathbf{elif}\;t\_m \leq 4.8 \cdot 10^{+130}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k \cdot t\_m} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}{\left(k \cdot t\_m\right) \cdot k}\\
\end{array}
\end{array}
if t < 6.4e-81Initial program 45.4%
lift-/.f64N/A
lift-pow.f64N/A
unpow3N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6457.4
Applied rewrites57.4%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6457.4
Applied rewrites57.4%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f6465.0
Applied rewrites65.0%
Taylor expanded in k around 0
Applied rewrites56.8%
if 6.4e-81 < t < 4.80000000000000048e130Initial program 72.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Applied rewrites65.7%
Applied rewrites73.0%
if 4.80000000000000048e130 < t Initial program 61.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6461.4
Applied rewrites61.4%
Applied rewrites61.4%
Applied rewrites77.4%
Applied rewrites92.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 6.4e-81)
(* (/ 2.0 (* (* k k) t_m)) (* (/ l k) (/ l k)))
(if (<= t_m 4.8e+130)
(* (/ (/ l (* t_m t_m)) (* k t_m)) (/ l k))
(/ (* (/ l t_m) (/ l t_m)) (* (* k t_m) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.4e-81) {
tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k));
} else if (t_m <= 4.8e+130) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 6.4d-81) then
tmp = (2.0d0 / ((k * k) * t_m)) * ((l / k) * (l / k))
else if (t_m <= 4.8d+130) then
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k)
else
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.4e-81) {
tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k));
} else if (t_m <= 4.8e+130) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 6.4e-81: tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)) elif t_m <= 4.8e+130: tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k) else: tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6.4e-81) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t_m)) * Float64(Float64(l / k) * Float64(l / k))); elseif (t_m <= 4.8e+130) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / Float64(k * t_m)) * Float64(l / k)); else tmp = Float64(Float64(Float64(l / t_m) * Float64(l / t_m)) / Float64(Float64(k * t_m) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 6.4e-81) tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)); elseif (t_m <= 4.8e+130) tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k); else tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6.4e-81], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4.8e+130], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.4 \cdot 10^{-81}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t\_m} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\mathbf{elif}\;t\_m \leq 4.8 \cdot 10^{+130}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k \cdot t\_m} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}{\left(k \cdot t\_m\right) \cdot k}\\
\end{array}
\end{array}
if t < 6.4e-81Initial program 45.4%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6459.5
Applied rewrites59.5%
Taylor expanded in k around 0
Applied rewrites55.7%
if 6.4e-81 < t < 4.80000000000000048e130Initial program 72.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Applied rewrites65.7%
Applied rewrites73.0%
if 4.80000000000000048e130 < t Initial program 61.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6461.4
Applied rewrites61.4%
Applied rewrites61.4%
Applied rewrites77.4%
Applied rewrites92.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= l 2.1e-44)
(* (/ (/ l (* t_m t_m)) (* k t_m)) (/ l k))
(/ (* (/ l t_m) (/ l t_m)) (* (* k t_m) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 2.1e-44) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 2.1d-44) then
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k)
else
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 2.1e-44) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if l <= 2.1e-44: tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k) else: tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (l <= 2.1e-44) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / Float64(k * t_m)) * Float64(l / k)); else tmp = Float64(Float64(Float64(l / t_m) * Float64(l / t_m)) / Float64(Float64(k * t_m) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (l <= 2.1e-44) tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k); else tmp = ((l / t_m) * (l / t_m)) / ((k * t_m) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 2.1e-44], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k \cdot t\_m} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}{\left(k \cdot t\_m\right) \cdot k}\\
\end{array}
\end{array}
if l < 2.10000000000000001e-44Initial program 54.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6456.5
Applied rewrites56.5%
Applied rewrites62.2%
Applied rewrites66.5%
if 2.10000000000000001e-44 < l Initial program 50.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites46.1%
Applied rewrites57.2%
Applied rewrites63.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= l 2.5e-44)
(* (/ (/ l (* t_m t_m)) (* k t_m)) (/ l k))
(/ (* l (/ (/ l t_m) t_m)) (* (* k t_m) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 2.5e-44) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = (l * ((l / t_m) / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (l <= 2.5d-44) then
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k)
else
tmp = (l * ((l / t_m) / t_m)) / ((k * t_m) * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 2.5e-44) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = (l * ((l / t_m) / t_m)) / ((k * t_m) * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if l <= 2.5e-44: tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k) else: tmp = (l * ((l / t_m) / t_m)) / ((k * t_m) * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (l <= 2.5e-44) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / Float64(k * t_m)) * Float64(l / k)); else tmp = Float64(Float64(l * Float64(Float64(l / t_m) / t_m)) / Float64(Float64(k * t_m) * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (l <= 2.5e-44) tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k); else tmp = (l * ((l / t_m) / t_m)) / ((k * t_m) * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 2.5e-44], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(l * N[(N[(l / t$95$m), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 2.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k \cdot t\_m} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \frac{\frac{\ell}{t\_m}}{t\_m}}{\left(k \cdot t\_m\right) \cdot k}\\
\end{array}
\end{array}
if l < 2.50000000000000019e-44Initial program 54.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6456.5
Applied rewrites56.5%
Applied rewrites62.2%
Applied rewrites66.5%
if 2.50000000000000019e-44 < l Initial program 50.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6446.1
Applied rewrites46.1%
Applied rewrites46.1%
Applied rewrites57.2%
Applied rewrites63.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 8e-145)
(* (/ (/ l (* t_m t_m)) (* k t_m)) (/ l k))
(* (/ l t_m) (/ (/ l (* k k)) (* t_m t_m))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-145) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = (l / t_m) * ((l / (k * k)) / (t_m * t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 8d-145) then
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k)
else
tmp = (l / t_m) * ((l / (k * k)) / (t_m * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-145) {
tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k);
} else {
tmp = (l / t_m) * ((l / (k * k)) / (t_m * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 8e-145: tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k) else: tmp = (l / t_m) * ((l / (k * k)) / (t_m * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8e-145) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / Float64(k * t_m)) * Float64(l / k)); else tmp = Float64(Float64(l / t_m) * Float64(Float64(l / Float64(k * k)) / Float64(t_m * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 8e-145) tmp = ((l / (t_m * t_m)) / (k * t_m)) * (l / k); else tmp = (l / t_m) * ((l / (k * k)) / (t_m * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 8e-145], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision], N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8 \cdot 10^{-145}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k \cdot t\_m} \cdot \frac{\ell}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{t\_m} \cdot \frac{\frac{\ell}{k \cdot k}}{t\_m \cdot t\_m}\\
\end{array}
\end{array}
if k < 7.99999999999999932e-145Initial program 52.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6449.6
Applied rewrites49.6%
Applied rewrites57.4%
Applied rewrites64.0%
if 7.99999999999999932e-145 < k Initial program 54.9%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6460.7
Applied rewrites60.7%
Applied rewrites63.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ l (* t_m t_m)) (/ l (* (* k t_m) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (t_m * t_m)) * (l / ((k * t_m) * k)));
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l / (t_m * t_m)) * (l / ((k * t_m) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (t_m * t_m)) * (l / ((k * t_m) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l / (t_m * t_m)) * (l / ((k * t_m) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l / Float64(t_m * t_m)) * Float64(l / Float64(Float64(k * t_m) * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l / (t_m * t_m)) * (l / ((k * t_m) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell}{t\_m \cdot t\_m} \cdot \frac{\ell}{\left(k \cdot t\_m\right) \cdot k}\right)
\end{array}
Initial program 53.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.6
Applied rewrites53.6%
Applied rewrites53.6%
Applied rewrites60.1%
Applied rewrites62.2%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ (* l l) (* (* t_m t_m) (* (* k t_m) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((k * t_m) * k)));
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l * l) / ((t_m * t_m) * ((k * t_m) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((k * t_m) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l * l) / ((t_m * t_m) * ((k * t_m) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l * l) / Float64(Float64(t_m * t_m) * Float64(Float64(k * t_m) * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l * l) / ((t_m * t_m) * ((k * t_m) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] / N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\ell \cdot \ell}{\left(t\_m \cdot t\_m\right) \cdot \left(\left(k \cdot t\_m\right) \cdot k\right)}
\end{array}
Initial program 53.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.6
Applied rewrites53.6%
Applied rewrites50.6%
Applied rewrites55.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ (* l l) (* t_m (* (* t_m t_m) (* k k))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / (t_m * ((t_m * t_m) * (k * k))));
}
t\_m = private
t\_s = 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_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l * l) / (t_m * ((t_m * t_m) * (k * k))))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / (t_m * ((t_m * t_m) * (k * k))));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l * l) / (t_m * ((t_m * t_m) * (k * k))))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l * l) / Float64(t_m * Float64(Float64(t_m * t_m) * Float64(k * k))))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l * l) / (t_m * ((t_m * t_m) * (k * k)))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] / N[(t$95$m * N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\ell \cdot \ell}{t\_m \cdot \left(\left(t\_m \cdot t\_m\right) \cdot \left(k \cdot k\right)\right)}
\end{array}
Initial program 53.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.6
Applied rewrites53.6%
Applied rewrites50.6%
Applied rewrites51.6%
herbie shell --seed 2025015
(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))))