
(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 25 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
(let* ((t_2 (/ k (cos k))) (t_3 (/ (sin k) l)))
(*
t_s
(if (<= t_m 4.6e-209)
(/ 2.0 (/ (* (* t_3 t_2) (* (* (sin k) k) t_m)) l))
(/ 2.0 (* (* t_2 t_3) (* k (/ (* (sin k) t_m) l))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = k / cos(k);
double t_3 = sin(k) / l;
double tmp;
if (t_m <= 4.6e-209) {
tmp = 2.0 / (((t_3 * t_2) * ((sin(k) * k) * t_m)) / l);
} else {
tmp = 2.0 / ((t_2 * t_3) * (k * ((sin(k) * t_m) / 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_2 = k / cos(k)
t_3 = sin(k) / l
if (t_m <= 4.6d-209) then
tmp = 2.0d0 / (((t_3 * t_2) * ((sin(k) * k) * t_m)) / l)
else
tmp = 2.0d0 / ((t_2 * t_3) * (k * ((sin(k) * t_m) / 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 t_2 = k / Math.cos(k);
double t_3 = Math.sin(k) / l;
double tmp;
if (t_m <= 4.6e-209) {
tmp = 2.0 / (((t_3 * t_2) * ((Math.sin(k) * k) * t_m)) / l);
} else {
tmp = 2.0 / ((t_2 * t_3) * (k * ((Math.sin(k) * t_m) / 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): t_2 = k / math.cos(k) t_3 = math.sin(k) / l tmp = 0 if t_m <= 4.6e-209: tmp = 2.0 / (((t_3 * t_2) * ((math.sin(k) * k) * t_m)) / l) else: tmp = 2.0 / ((t_2 * t_3) * (k * ((math.sin(k) * t_m) / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(k / cos(k)) t_3 = Float64(sin(k) / l) tmp = 0.0 if (t_m <= 4.6e-209) tmp = Float64(2.0 / Float64(Float64(Float64(t_3 * t_2) * Float64(Float64(sin(k) * k) * t_m)) / l)); else tmp = Float64(2.0 / Float64(Float64(t_2 * t_3) * Float64(k * Float64(Float64(sin(k) * t_m) / 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) t_2 = k / cos(k); t_3 = sin(k) / l; tmp = 0.0; if (t_m <= 4.6e-209) tmp = 2.0 / (((t_3 * t_2) * ((sin(k) * k) * t_m)) / l); else tmp = 2.0 / ((t_2 * t_3) * (k * ((sin(k) * t_m) / 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_] := Block[{t$95$2 = N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 4.6e-209], N[(2.0 / N[(N[(N[(t$95$3 * t$95$2), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$2 * t$95$3), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{k}{\cos k}\\
t_3 := \frac{\sin k}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.6 \cdot 10^{-209}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_3 \cdot t\_2\right) \cdot \left(\left(\sin k \cdot k\right) \cdot t\_m\right)}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t\_2 \cdot t\_3\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if t < 4.5999999999999999e-209Initial program 36.7%
Taylor expanded in t around 0
Applied rewrites76.1%
Applied rewrites85.1%
Applied rewrites94.6%
Applied rewrites93.7%
if 4.5999999999999999e-209 < t Initial program 41.7%
Taylor expanded in t around 0
Applied rewrites71.2%
Applied rewrites88.4%
Applied rewrites99.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 (<=
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(- (+ 1.0 (pow (/ k t_m) 2.0)) 1.0))
1e+120)
(/
2.0
(*
(* (* (* (/ (* t_m t_m) l) (/ t_m l)) (sin k)) (tan k))
(* (/ k t_m) (/ k t_m))))
(/ 2.0 (* (* k (/ (sin k) l)) (* k (/ (* (sin k) t_m) 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 (((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) - 1.0)) <= 1e+120) {
tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * tan(k)) * ((k / t_m) * (k / t_m)));
} else {
tmp = 2.0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / 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 ((((((t_m ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t_m) ** 2.0d0)) - 1.0d0)) <= 1d+120) then
tmp = 2.0d0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * tan(k)) * ((k / t_m) * (k / t_m)))
else
tmp = 2.0d0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / 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 (((((Math.pow(t_m, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t_m), 2.0)) - 1.0)) <= 1e+120) {
tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * Math.sin(k)) * Math.tan(k)) * ((k / t_m) * (k / t_m)));
} else {
tmp = 2.0 / ((k * (Math.sin(k) / l)) * (k * ((Math.sin(k) * t_m) / 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 ((((math.pow(t_m, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t_m), 2.0)) - 1.0)) <= 1e+120: tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * math.sin(k)) * math.tan(k)) * ((k / t_m) * (k / t_m))) else: tmp = 2.0 / ((k * (math.sin(k) / l)) * (k * ((math.sin(k) * t_m) / 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 (Float64(Float64(Float64(Float64((t_m ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t_m) ^ 2.0)) - 1.0)) <= 1e+120) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) / l) * Float64(t_m / l)) * sin(k)) * tan(k)) * Float64(Float64(k / t_m) * Float64(k / t_m)))); else tmp = Float64(2.0 / Float64(Float64(k * Float64(sin(k) / l)) * Float64(k * Float64(Float64(sin(k) * t_m) / 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 ((((((t_m ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) - 1.0)) <= 1e+120) tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * tan(k)) * ((k / t_m) * (k / t_m))); else tmp = 2.0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / 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[N[(N[(N[(N[(N[Power[t$95$m, 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$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision], 1e+120], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $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]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / 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}\;\left(\left(\frac{{t\_m}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t\_m}\right)}^{2}\right) - 1\right) \leq 10^{+120}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t\_m \cdot t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right) \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\frac{k}{t\_m} \cdot \frac{k}{t\_m}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) < 9.9999999999999998e119Initial program 93.0%
lift-varN/A
lift-literalN/A
lift-pow.f64N/A
lift-varN/A
lift-varN/A
lift-*.f64N/A
lift-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-varN/A
lift-varN/A
lift-varN/A
lower-/.f64N/A
lift-varN/A
lift-var94.7
Applied rewrites94.7%
Taylor expanded in t around 0
Applied rewrites95.8%
if 9.9999999999999998e119 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t #s(literal 3 binary64)) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 #s(literal 1 binary64) (pow.f64 (/.f64 k t) #s(literal 2 binary64))) #s(literal 1 binary64))) Initial program 10.2%
Taylor expanded in t around 0
Applied rewrites63.2%
Applied rewrites79.8%
Applied rewrites94.8%
Taylor expanded in k around 0
Applied rewrites69.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (sin k) l)))
(*
t_s
(if (<= t_m 8.5e-216)
(/ 2.0 (/ (* (* t_2 k) (* (* (sin k) k) t_m)) (* (cos k) l)))
(/ 2.0 (* (* (/ k (cos k)) t_2) (* k (/ (* (sin k) t_m) l))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sin(k) / l;
double tmp;
if (t_m <= 8.5e-216) {
tmp = 2.0 / (((t_2 * k) * ((sin(k) * k) * t_m)) / (cos(k) * l));
} else {
tmp = 2.0 / (((k / cos(k)) * t_2) * (k * ((sin(k) * t_m) / 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) :: t_2
real(8) :: tmp
t_2 = sin(k) / l
if (t_m <= 8.5d-216) then
tmp = 2.0d0 / (((t_2 * k) * ((sin(k) * k) * t_m)) / (cos(k) * l))
else
tmp = 2.0d0 / (((k / cos(k)) * t_2) * (k * ((sin(k) * t_m) / 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 t_2 = Math.sin(k) / l;
double tmp;
if (t_m <= 8.5e-216) {
tmp = 2.0 / (((t_2 * k) * ((Math.sin(k) * k) * t_m)) / (Math.cos(k) * l));
} else {
tmp = 2.0 / (((k / Math.cos(k)) * t_2) * (k * ((Math.sin(k) * t_m) / 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): t_2 = math.sin(k) / l tmp = 0 if t_m <= 8.5e-216: tmp = 2.0 / (((t_2 * k) * ((math.sin(k) * k) * t_m)) / (math.cos(k) * l)) else: tmp = 2.0 / (((k / math.cos(k)) * t_2) * (k * ((math.sin(k) * t_m) / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(sin(k) / l) tmp = 0.0 if (t_m <= 8.5e-216) tmp = Float64(2.0 / Float64(Float64(Float64(t_2 * k) * Float64(Float64(sin(k) * k) * t_m)) / Float64(cos(k) * l))); else tmp = Float64(2.0 / Float64(Float64(Float64(k / cos(k)) * t_2) * Float64(k * Float64(Float64(sin(k) * t_m) / 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) t_2 = sin(k) / l; tmp = 0.0; if (t_m <= 8.5e-216) tmp = 2.0 / (((t_2 * k) * ((sin(k) * k) * t_m)) / (cos(k) * l)); else tmp = 2.0 / (((k / cos(k)) * t_2) * (k * ((sin(k) * t_m) / 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_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 8.5e-216], N[(2.0 / N[(N[(N[(t$95$2 * k), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k / N[Cos[k], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{\sin k}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 8.5 \cdot 10^{-216}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_2 \cdot k\right) \cdot \left(\left(\sin k \cdot k\right) \cdot t\_m\right)}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\cos k} \cdot t\_2\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if t < 8.50000000000000003e-216Initial program 36.7%
Taylor expanded in t around 0
Applied rewrites76.1%
Applied rewrites85.1%
Applied rewrites94.6%
Applied rewrites93.7%
if 8.50000000000000003e-216 < t Initial program 41.7%
Taylor expanded in t around 0
Applied rewrites71.2%
Applied rewrites88.4%
Applied rewrites99.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (sin k) k)) (t_3 (* (cos k) l)))
(*
t_s
(if (<= t_m 2e-202)
(/ 2.0 (/ (* (* (/ (sin k) l) k) (* t_2 t_m)) t_3))
(/ 2.0 (* (/ t_2 t_3) (* k (/ (* (sin k) t_m) l))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sin(k) * k;
double t_3 = cos(k) * l;
double tmp;
if (t_m <= 2e-202) {
tmp = 2.0 / ((((sin(k) / l) * k) * (t_2 * t_m)) / t_3);
} else {
tmp = 2.0 / ((t_2 / t_3) * (k * ((sin(k) * t_m) / 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_2 = sin(k) * k
t_3 = cos(k) * l
if (t_m <= 2d-202) then
tmp = 2.0d0 / ((((sin(k) / l) * k) * (t_2 * t_m)) / t_3)
else
tmp = 2.0d0 / ((t_2 / t_3) * (k * ((sin(k) * t_m) / 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 t_2 = Math.sin(k) * k;
double t_3 = Math.cos(k) * l;
double tmp;
if (t_m <= 2e-202) {
tmp = 2.0 / ((((Math.sin(k) / l) * k) * (t_2 * t_m)) / t_3);
} else {
tmp = 2.0 / ((t_2 / t_3) * (k * ((Math.sin(k) * t_m) / 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): t_2 = math.sin(k) * k t_3 = math.cos(k) * l tmp = 0 if t_m <= 2e-202: tmp = 2.0 / ((((math.sin(k) / l) * k) * (t_2 * t_m)) / t_3) else: tmp = 2.0 / ((t_2 / t_3) * (k * ((math.sin(k) * t_m) / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(sin(k) * k) t_3 = Float64(cos(k) * l) tmp = 0.0 if (t_m <= 2e-202) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) / l) * k) * Float64(t_2 * t_m)) / t_3)); else tmp = Float64(2.0 / Float64(Float64(t_2 / t_3) * Float64(k * Float64(Float64(sin(k) * t_m) / 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) t_2 = sin(k) * k; t_3 = cos(k) * l; tmp = 0.0; if (t_m <= 2e-202) tmp = 2.0 / ((((sin(k) / l) * k) * (t_2 * t_m)) / t_3); else tmp = 2.0 / ((t_2 / t_3) * (k * ((sin(k) * t_m) / 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_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2e-202], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(t$95$2 * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$2 / t$95$3), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sin k \cdot k\\
t_3 := \cos k \cdot \ell\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2 \cdot 10^{-202}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{\sin k}{\ell} \cdot k\right) \cdot \left(t\_2 \cdot t\_m\right)}{t\_3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t\_2}{t\_3} \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if t < 2.0000000000000001e-202Initial program 36.9%
Taylor expanded in t around 0
Applied rewrites75.8%
Applied rewrites85.3%
Applied rewrites94.7%
Applied rewrites93.8%
if 2.0000000000000001e-202 < t Initial program 41.6%
Taylor expanded in t around 0
Applied rewrites71.6%
Applied rewrites88.2%
Applied rewrites99.6%
Applied rewrites98.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (cos k) l)))
(*
t_s
(if (<= k 1.45e-37)
(/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))
(if (<= k 1.25e+151)
(/ 2.0 (/ (* (pow (* k (sin k)) 2.0) (/ t_m l)) t_2))
(/ 2.0 (* k (/ (* (* k t_m) (pow (sin k) 2.0)) (* l t_2)))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = cos(k) * l;
double tmp;
if (k <= 1.45e-37) {
tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)));
} else if (k <= 1.25e+151) {
tmp = 2.0 / ((pow((k * sin(k)), 2.0) * (t_m / l)) / t_2);
} else {
tmp = 2.0 / (k * (((k * t_m) * pow(sin(k), 2.0)) / (l * t_2)));
}
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) :: t_2
real(8) :: tmp
t_2 = cos(k) * l
if (k <= 1.45d-37) then
tmp = 2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))
else if (k <= 1.25d+151) then
tmp = 2.0d0 / ((((k * sin(k)) ** 2.0d0) * (t_m / l)) / t_2)
else
tmp = 2.0d0 / (k * (((k * t_m) * (sin(k) ** 2.0d0)) / (l * t_2)))
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 t_2 = Math.cos(k) * l;
double tmp;
if (k <= 1.45e-37) {
tmp = 2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l)));
} else if (k <= 1.25e+151) {
tmp = 2.0 / ((Math.pow((k * Math.sin(k)), 2.0) * (t_m / l)) / t_2);
} else {
tmp = 2.0 / (k * (((k * t_m) * Math.pow(Math.sin(k), 2.0)) / (l * t_2)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = math.cos(k) * l tmp = 0 if k <= 1.45e-37: tmp = 2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))) elif k <= 1.25e+151: tmp = 2.0 / ((math.pow((k * math.sin(k)), 2.0) * (t_m / l)) / t_2) else: tmp = 2.0 / (k * (((k * t_m) * math.pow(math.sin(k), 2.0)) / (l * t_2))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(cos(k) * l) tmp = 0.0 if (k <= 1.45e-37) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l)))); elseif (k <= 1.25e+151) tmp = Float64(2.0 / Float64(Float64((Float64(k * sin(k)) ^ 2.0) * Float64(t_m / l)) / t_2)); else tmp = Float64(2.0 / Float64(k * Float64(Float64(Float64(k * t_m) * (sin(k) ^ 2.0)) / Float64(l * t_2)))); 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) t_2 = cos(k) * l; tmp = 0.0; if (k <= 1.45e-37) tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))); elseif (k <= 1.25e+151) tmp = 2.0 / ((((k * sin(k)) ^ 2.0) * (t_m / l)) / t_2); else tmp = 2.0 / (k * (((k * t_m) * (sin(k) ^ 2.0)) / (l * t_2))); 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_] := Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.45e-37], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.25e+151], N[(2.0 / N[(N[(N[Power[N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(N[(N[(k * t$95$m), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \cos k \cdot \ell\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.45 \cdot 10^{-37}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\mathbf{elif}\;k \leq 1.25 \cdot 10^{+151}:\\
\;\;\;\;\frac{2}{\frac{{\left(k \cdot \sin k\right)}^{2} \cdot \frac{t\_m}{\ell}}{t\_2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \frac{\left(k \cdot t\_m\right) \cdot {\sin k}^{2}}{\ell \cdot t\_2}}\\
\end{array}
\end{array}
\end{array}
if k < 1.45000000000000002e-37Initial program 42.2%
Taylor expanded in t around 0
Applied rewrites73.5%
Applied rewrites88.0%
Applied rewrites96.7%
Taylor expanded in k around 0
Applied rewrites81.5%
if 1.45000000000000002e-37 < k < 1.2500000000000001e151Initial program 30.4%
Taylor expanded in t around 0
Applied rewrites88.8%
Applied rewrites95.2%
Applied rewrites95.2%
if 1.2500000000000001e151 < k Initial program 26.9%
Taylor expanded in t around 0
Applied rewrites54.6%
Applied rewrites59.7%
Applied rewrites73.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 1e-39)
(/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))
(/ 2.0 (* (* (pow (sin k) 2.0) (* (/ t_m l) k)) (/ k (* (cos 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 <= 1e-39) {
tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)));
} else {
tmp = 2.0 / ((pow(sin(k), 2.0) * ((t_m / l) * k)) * (k / (cos(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 <= 1d-39) then
tmp = 2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))
else
tmp = 2.0d0 / (((sin(k) ** 2.0d0) * ((t_m / l) * k)) * (k / (cos(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 <= 1e-39) {
tmp = 2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l)));
} else {
tmp = 2.0 / ((Math.pow(Math.sin(k), 2.0) * ((t_m / l) * k)) * (k / (Math.cos(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 <= 1e-39: tmp = 2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))) else: tmp = 2.0 / ((math.pow(math.sin(k), 2.0) * ((t_m / l) * k)) * (k / (math.cos(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 <= 1e-39) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l)))); else tmp = Float64(2.0 / Float64(Float64((sin(k) ^ 2.0) * Float64(Float64(t_m / l) * k)) * Float64(k / Float64(cos(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 <= 1e-39) tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))); else tmp = 2.0 / (((sin(k) ^ 2.0) * ((t_m / l) * k)) * (k / (cos(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, 1e-39], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * N[(k / N[(N[Cos[k], $MachinePrecision] * 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 10^{-39}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left({\sin k}^{2} \cdot \left(\frac{t\_m}{\ell} \cdot k\right)\right) \cdot \frac{k}{\cos k \cdot \ell}}\\
\end{array}
\end{array}
if k < 9.99999999999999929e-40Initial program 42.4%
Taylor expanded in t around 0
Applied rewrites73.9%
Applied rewrites88.0%
Applied rewrites96.7%
Taylor expanded in k around 0
Applied rewrites81.4%
if 9.99999999999999929e-40 < k Initial program 28.7%
Taylor expanded in t around 0
Applied rewrites74.9%
Applied rewrites82.1%
Applied rewrites96.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 (/ 2.0 (* (/ (* (sin k) k) (* (cos k) l)) (* k (/ (* (sin k) t_m) l))))))
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 * (2.0 / (((sin(k) * k) / (cos(k) * l)) * (k * ((sin(k) * t_m) / l))));
}
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 * (2.0d0 / (((sin(k) * k) / (cos(k) * l)) * (k * ((sin(k) * t_m) / l))))
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 * (2.0 / (((Math.sin(k) * k) / (Math.cos(k) * l)) * (k * ((Math.sin(k) * t_m) / l))));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / (((math.sin(k) * k) / (math.cos(k) * l)) * (k * ((math.sin(k) * t_m) / l))))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(sin(k) * k) / Float64(cos(k) * l)) * Float64(k * Float64(Float64(sin(k) * t_m) / l))))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / (((sin(k) * k) / (cos(k) * l)) * (k * ((sin(k) * t_m) / l)))); 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[(2.0 / N[(N[(N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / 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 \frac{2}{\frac{\sin k \cdot k}{\cos k \cdot \ell} \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}
\end{array}
Initial program 38.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Applied rewrites86.4%
Applied rewrites96.6%
Applied rewrites95.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* k (/ (* (sin k) t_m) l))))
(*
t_s
(if (<= k 4.8e-26)
(/ 2.0 (* (* (/ k l) k) t_2))
(if (<= k 1.6e+149)
(/ 2.0 (* (pow (* k (sin k)) 2.0) (/ t_m (* l (* (cos k) l)))))
(/ 2.0 (* (* k (/ (sin k) l)) t_2)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = k * ((sin(k) * t_m) / l);
double tmp;
if (k <= 4.8e-26) {
tmp = 2.0 / (((k / l) * k) * t_2);
} else if (k <= 1.6e+149) {
tmp = 2.0 / (pow((k * sin(k)), 2.0) * (t_m / (l * (cos(k) * l))));
} else {
tmp = 2.0 / ((k * (sin(k) / l)) * t_2);
}
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) :: t_2
real(8) :: tmp
t_2 = k * ((sin(k) * t_m) / l)
if (k <= 4.8d-26) then
tmp = 2.0d0 / (((k / l) * k) * t_2)
else if (k <= 1.6d+149) then
tmp = 2.0d0 / (((k * sin(k)) ** 2.0d0) * (t_m / (l * (cos(k) * l))))
else
tmp = 2.0d0 / ((k * (sin(k) / l)) * t_2)
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 t_2 = k * ((Math.sin(k) * t_m) / l);
double tmp;
if (k <= 4.8e-26) {
tmp = 2.0 / (((k / l) * k) * t_2);
} else if (k <= 1.6e+149) {
tmp = 2.0 / (Math.pow((k * Math.sin(k)), 2.0) * (t_m / (l * (Math.cos(k) * l))));
} else {
tmp = 2.0 / ((k * (Math.sin(k) / l)) * t_2);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = k * ((math.sin(k) * t_m) / l) tmp = 0 if k <= 4.8e-26: tmp = 2.0 / (((k / l) * k) * t_2) elif k <= 1.6e+149: tmp = 2.0 / (math.pow((k * math.sin(k)), 2.0) * (t_m / (l * (math.cos(k) * l)))) else: tmp = 2.0 / ((k * (math.sin(k) / l)) * t_2) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(k * Float64(Float64(sin(k) * t_m) / l)) tmp = 0.0 if (k <= 4.8e-26) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * t_2)); elseif (k <= 1.6e+149) tmp = Float64(2.0 / Float64((Float64(k * sin(k)) ^ 2.0) * Float64(t_m / Float64(l * Float64(cos(k) * l))))); else tmp = Float64(2.0 / Float64(Float64(k * Float64(sin(k) / l)) * t_2)); 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) t_2 = k * ((sin(k) * t_m) / l); tmp = 0.0; if (k <= 4.8e-26) tmp = 2.0 / (((k / l) * k) * t_2); elseif (k <= 1.6e+149) tmp = 2.0 / (((k * sin(k)) ^ 2.0) * (t_m / (l * (cos(k) * l)))); else tmp = 2.0 / ((k * (sin(k) / l)) * t_2); 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_] := Block[{t$95$2 = N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 4.8e-26], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.6e+149], N[(2.0 / N[(N[Power[N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m / N[(l * N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := k \cdot \frac{\sin k \cdot t\_m}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 4.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot t\_2}\\
\mathbf{elif}\;k \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{2}{{\left(k \cdot \sin k\right)}^{2} \cdot \frac{t\_m}{\ell \cdot \left(\cos k \cdot \ell\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{\sin k}{\ell}\right) \cdot t\_2}\\
\end{array}
\end{array}
\end{array}
if k < 4.8000000000000002e-26Initial program 42.8%
Taylor expanded in t around 0
Applied rewrites73.8%
Applied rewrites88.2%
Applied rewrites96.8%
Taylor expanded in k around 0
Applied rewrites81.7%
if 4.8000000000000002e-26 < k < 1.6000000000000001e149Initial program 27.0%
Taylor expanded in t around 0
Applied rewrites88.2%
Applied rewrites95.0%
Applied rewrites88.3%
if 1.6000000000000001e149 < k Initial program 26.9%
Taylor expanded in t around 0
Applied rewrites54.6%
Applied rewrites59.7%
Applied rewrites97.5%
Taylor expanded in k around 0
Applied rewrites60.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 3.8e-13)
(/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))
(/ 2.0 (* k (/ (* (* k t_m) (pow (sin k) 2.0)) (* l (* (cos 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 <= 3.8e-13) {
tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)));
} else {
tmp = 2.0 / (k * (((k * t_m) * pow(sin(k), 2.0)) / (l * (cos(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 <= 3.8d-13) then
tmp = 2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))
else
tmp = 2.0d0 / (k * (((k * t_m) * (sin(k) ** 2.0d0)) / (l * (cos(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 <= 3.8e-13) {
tmp = 2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l)));
} else {
tmp = 2.0 / (k * (((k * t_m) * Math.pow(Math.sin(k), 2.0)) / (l * (Math.cos(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 <= 3.8e-13: tmp = 2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))) else: tmp = 2.0 / (k * (((k * t_m) * math.pow(math.sin(k), 2.0)) / (l * (math.cos(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 <= 3.8e-13) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l)))); else tmp = Float64(2.0 / Float64(k * Float64(Float64(Float64(k * t_m) * (sin(k) ^ 2.0)) / Float64(l * Float64(cos(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 <= 3.8e-13) tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))); else tmp = 2.0 / (k * (((k * t_m) * (sin(k) ^ 2.0)) / (l * (cos(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, 3.8e-13], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(N[(N[(k * t$95$m), $MachinePrecision] * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(l * N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $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 3.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \frac{\left(k \cdot t\_m\right) \cdot {\sin k}^{2}}{\ell \cdot \left(\cos k \cdot \ell\right)}}\\
\end{array}
\end{array}
if k < 3.8e-13Initial program 42.7%
Taylor expanded in t around 0
Applied rewrites74.5%
Applied rewrites88.5%
Applied rewrites96.8%
Taylor expanded in k around 0
Applied rewrites82.1%
if 3.8e-13 < k Initial program 26.0%
Taylor expanded in t around 0
Applied rewrites73.3%
Applied rewrites79.9%
Applied rewrites82.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* k (/ (* (sin k) t_m) l))))
(*
t_s
(if (<= k 1.9e-15)
(/ 2.0 (* (* (/ k l) k) t_2))
(if (<= k 1.6e+149)
(* (/ (cos k) (* (* k k) (* (pow (sin k) 2.0) t_m))) (* l (+ l l)))
(/ 2.0 (* (* k (/ (sin k) l)) t_2)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = k * ((sin(k) * t_m) / l);
double tmp;
if (k <= 1.9e-15) {
tmp = 2.0 / (((k / l) * k) * t_2);
} else if (k <= 1.6e+149) {
tmp = (cos(k) / ((k * k) * (pow(sin(k), 2.0) * t_m))) * (l * (l + l));
} else {
tmp = 2.0 / ((k * (sin(k) / l)) * t_2);
}
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) :: t_2
real(8) :: tmp
t_2 = k * ((sin(k) * t_m) / l)
if (k <= 1.9d-15) then
tmp = 2.0d0 / (((k / l) * k) * t_2)
else if (k <= 1.6d+149) then
tmp = (cos(k) / ((k * k) * ((sin(k) ** 2.0d0) * t_m))) * (l * (l + l))
else
tmp = 2.0d0 / ((k * (sin(k) / l)) * t_2)
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 t_2 = k * ((Math.sin(k) * t_m) / l);
double tmp;
if (k <= 1.9e-15) {
tmp = 2.0 / (((k / l) * k) * t_2);
} else if (k <= 1.6e+149) {
tmp = (Math.cos(k) / ((k * k) * (Math.pow(Math.sin(k), 2.0) * t_m))) * (l * (l + l));
} else {
tmp = 2.0 / ((k * (Math.sin(k) / l)) * t_2);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = k * ((math.sin(k) * t_m) / l) tmp = 0 if k <= 1.9e-15: tmp = 2.0 / (((k / l) * k) * t_2) elif k <= 1.6e+149: tmp = (math.cos(k) / ((k * k) * (math.pow(math.sin(k), 2.0) * t_m))) * (l * (l + l)) else: tmp = 2.0 / ((k * (math.sin(k) / l)) * t_2) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(k * Float64(Float64(sin(k) * t_m) / l)) tmp = 0.0 if (k <= 1.9e-15) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * t_2)); elseif (k <= 1.6e+149) tmp = Float64(Float64(cos(k) / Float64(Float64(k * k) * Float64((sin(k) ^ 2.0) * t_m))) * Float64(l * Float64(l + l))); else tmp = Float64(2.0 / Float64(Float64(k * Float64(sin(k) / l)) * t_2)); 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) t_2 = k * ((sin(k) * t_m) / l); tmp = 0.0; if (k <= 1.9e-15) tmp = 2.0 / (((k / l) * k) * t_2); elseif (k <= 1.6e+149) tmp = (cos(k) / ((k * k) * ((sin(k) ^ 2.0) * t_m))) * (l * (l + l)); else tmp = 2.0 / ((k * (sin(k) / l)) * t_2); 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_] := Block[{t$95$2 = N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.9e-15], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.6e+149], N[(N[(N[Cos[k], $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := k \cdot \frac{\sin k \cdot t\_m}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.9 \cdot 10^{-15}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot t\_2}\\
\mathbf{elif}\;k \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;\frac{\cos k}{\left(k \cdot k\right) \cdot \left({\sin k}^{2} \cdot t\_m\right)} \cdot \left(\ell \cdot \left(\ell + \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{\sin k}{\ell}\right) \cdot t\_2}\\
\end{array}
\end{array}
\end{array}
if k < 1.9000000000000001e-15Initial program 42.9%
Taylor expanded in t around 0
Applied rewrites74.3%
Applied rewrites88.4%
Applied rewrites96.8%
Taylor expanded in k around 0
Applied rewrites82.0%
if 1.9000000000000001e-15 < k < 1.6000000000000001e149Initial program 24.6%
Taylor expanded in t around 0
Applied rewrites94.6%
Applied rewrites94.5%
if 1.6000000000000001e149 < k Initial program 26.9%
Taylor expanded in t around 0
Applied rewrites54.6%
Applied rewrites59.7%
Applied rewrites97.5%
Taylor expanded in k around 0
Applied rewrites60.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 (/ 2.0 (* (* k (/ (sin k) l)) (* k (/ (* (sin k) t_m) l))))))
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 * (2.0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / l))));
}
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 * (2.0d0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / l))))
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 * (2.0 / ((k * (Math.sin(k) / l)) * (k * ((Math.sin(k) * t_m) / l))));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / ((k * (math.sin(k) / l)) * (k * ((math.sin(k) * t_m) / l))))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(k * Float64(sin(k) / l)) * Float64(k * Float64(Float64(sin(k) * t_m) / l))))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / ((k * (sin(k) / l)) * (k * ((sin(k) * t_m) / l)))); 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[(2.0 / N[(N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / 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 \frac{2}{\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}
\end{array}
Initial program 38.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Applied rewrites86.4%
Applied rewrites96.6%
Taylor expanded in k around 0
Applied rewrites77.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 6.8e-28)
(/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))
(/ 2.0 (* (* (* (/ (/ t_m l) l) k) k) (/ (* k k) (cos 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 <= 6.8e-28) {
tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)));
} else {
tmp = 2.0 / (((((t_m / l) / l) * k) * k) * ((k * k) / cos(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 <= 6.8d-28) then
tmp = 2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))
else
tmp = 2.0d0 / (((((t_m / l) / l) * k) * k) * ((k * k) / cos(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 <= 6.8e-28) {
tmp = 2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l)));
} else {
tmp = 2.0 / (((((t_m / l) / l) * k) * k) * ((k * k) / Math.cos(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 <= 6.8e-28: tmp = 2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))) else: tmp = 2.0 / (((((t_m / l) / l) * k) * k) * ((k * k) / math.cos(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 <= 6.8e-28) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l) / l) * k) * k) * Float64(Float64(k * k) / cos(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 <= 6.8e-28) tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))); else tmp = 2.0 / (((((t_m / l) / l) * k) * k) * ((k * k) / cos(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, 6.8e-28], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / N[Cos[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 6.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{\ell}}{\ell} \cdot k\right) \cdot k\right) \cdot \frac{k \cdot k}{\cos k}}\\
\end{array}
\end{array}
if k < 6.8000000000000001e-28Initial program 42.8%
Taylor expanded in t around 0
Applied rewrites73.8%
Applied rewrites88.2%
Applied rewrites96.8%
Taylor expanded in k around 0
Applied rewrites81.7%
if 6.8000000000000001e-28 < k Initial program 27.0%
Taylor expanded in t around 0
Applied rewrites75.2%
Taylor expanded in k around 0
Applied rewrites64.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 (<= k 1.45e-37)
(/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))
(/ 2.0 (/ (* (* (/ t_m l) (* k k)) (* k k)) (* l (cos 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 <= 1.45e-37) {
tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)));
} else {
tmp = 2.0 / ((((t_m / l) * (k * k)) * (k * k)) / (l * cos(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 <= 1.45d-37) then
tmp = 2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))
else
tmp = 2.0d0 / ((((t_m / l) * (k * k)) * (k * k)) / (l * cos(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 <= 1.45e-37) {
tmp = 2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l)));
} else {
tmp = 2.0 / ((((t_m / l) * (k * k)) * (k * k)) / (l * Math.cos(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 <= 1.45e-37: tmp = 2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))) else: tmp = 2.0 / ((((t_m / l) * (k * k)) * (k * k)) / (l * math.cos(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 <= 1.45e-37) tmp = Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * Float64(k * k)) * Float64(k * k)) / Float64(l * cos(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 <= 1.45e-37) tmp = 2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))); else tmp = 2.0 / ((((t_m / l) * (k * k)) * (k * k)) / (l * cos(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, 1.45e-37], N[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[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 1.45 \cdot 10^{-37}:\\
\;\;\;\;\frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(\frac{t\_m}{\ell} \cdot \left(k \cdot k\right)\right) \cdot \left(k \cdot k\right)}{\ell \cdot \cos k}}\\
\end{array}
\end{array}
if k < 1.45000000000000002e-37Initial program 42.2%
Taylor expanded in t around 0
Applied rewrites73.5%
Applied rewrites88.0%
Applied rewrites96.7%
Taylor expanded in k around 0
Applied rewrites81.5%
if 1.45000000000000002e-37 < k Initial program 29.1%
Taylor expanded in t around 0
Applied rewrites75.9%
Applied rewrites81.8%
Taylor expanded in k around 0
Applied rewrites64.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 (/ 2.0 (* (* (/ k l) k) (* k (/ (* (sin k) t_m) l))))))
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 * (2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))));
}
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 * (2.0d0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l))))
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 * (2.0 / (((k / l) * k) * (k * ((Math.sin(k) * t_m) / l))));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (2.0 / (((k / l) * k) * (k * ((math.sin(k) * t_m) / l))))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(k / l) * k) * Float64(k * Float64(Float64(sin(k) * t_m) / l))))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (2.0 / (((k / l) * k) * (k * ((sin(k) * t_m) / l)))); 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[(2.0 / N[(N[(N[(k / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / 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 \frac{2}{\left(\frac{k}{\ell} \cdot k\right) \cdot \left(k \cdot \frac{\sin k \cdot t\_m}{\ell}\right)}
\end{array}
Initial program 38.7%
Taylor expanded in t around 0
Applied rewrites74.2%
Applied rewrites86.4%
Applied rewrites96.6%
Taylor expanded in k around 0
Applied rewrites75.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 (<= t_m 2e+41)
(/ 2.0 (* (* (* (* (/ t_m l) k) (/ k l)) k) k))
(/ (* (/ (+ l l) k) (/ l (* (* k 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 (t_m <= 2e+41) {
tmp = 2.0 / (((((t_m / l) * k) * (k / l)) * k) * k);
} else {
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2d+41) then
tmp = 2.0d0 / (((((t_m / l) * k) * (k / l)) * k) * k)
else
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2e+41) {
tmp = 2.0 / (((((t_m / l) * k) * (k / l)) * k) * k);
} else {
tmp = (((l + l) / k) * (l / ((k * 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 t_m <= 2e+41: tmp = 2.0 / (((((t_m / l) * k) * (k / l)) * k) * k) else: tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2e+41) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l) * k) * Float64(k / l)) * k) * k)); else tmp = Float64(Float64(Float64(Float64(l + l) / k) * Float64(l / Float64(Float64(k * k) * 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 (t_m <= 2e+41) tmp = 2.0 / (((((t_m / l) * k) * (k / l)) * k) * k); else tmp = (((l + l) / k) * (l / ((k * 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[t$95$m, 2e+41], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * k), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 \cdot 10^{+41}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t\_m}{\ell} \cdot k\right) \cdot \frac{k}{\ell}\right) \cdot k\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell + \ell}{k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot k}}{t\_m}\\
\end{array}
\end{array}
if t < 2.00000000000000001e41Initial program 41.0%
Taylor expanded in t around 0
Applied rewrites74.4%
Applied rewrites85.4%
Taylor expanded in k around 0
Applied rewrites71.2%
Applied rewrites71.7%
if 2.00000000000000001e41 < t Initial program 27.5%
Taylor expanded in k around 0
Applied rewrites64.4%
Taylor expanded in l around 0
Applied rewrites73.9%
Final simplification72.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 3.6e+90)
(/ 2.0 (* (/ (* k k) l) (* (* (/ t_m l) k) k)))
(/ (* (/ (+ l l) k) (/ l (* (* k 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 (t_m <= 3.6e+90) {
tmp = 2.0 / (((k * k) / l) * (((t_m / l) * k) * k));
} else {
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 3.6d+90) then
tmp = 2.0d0 / (((k * k) / l) * (((t_m / l) * k) * k))
else
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 3.6e+90) {
tmp = 2.0 / (((k * k) / l) * (((t_m / l) * k) * k));
} else {
tmp = (((l + l) / k) * (l / ((k * 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 t_m <= 3.6e+90: tmp = 2.0 / (((k * k) / l) * (((t_m / l) * k) * k)) else: tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 3.6e+90) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) / l) * Float64(Float64(Float64(t_m / l) * k) * k))); else tmp = Float64(Float64(Float64(Float64(l + l) / k) * Float64(l / Float64(Float64(k * k) * 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 (t_m <= 3.6e+90) tmp = 2.0 / (((k * k) / l) * (((t_m / l) * k) * k)); else tmp = (((l + l) / k) * (l / ((k * 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[t$95$m, 3.6e+90], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(t$95$m / l), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 3.6 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell} \cdot \left(\left(\frac{t\_m}{\ell} \cdot k\right) \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell + \ell}{k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot k}}{t\_m}\\
\end{array}
\end{array}
if t < 3.6e90Initial program 42.0%
Taylor expanded in t around 0
Applied rewrites74.8%
Applied rewrites85.9%
Taylor expanded in k around 0
Applied rewrites71.7%
Applied rewrites72.1%
if 3.6e90 < t Initial program 18.9%
Taylor expanded in k around 0
Applied rewrites62.6%
Taylor expanded in l around 0
Applied rewrites71.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 2e+41)
(/ 2.0 (* (* (/ t_m l) (/ (* k k) l)) (* k k)))
(/ (* (/ (+ l l) k) (/ l (* (* k 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 (t_m <= 2e+41) {
tmp = 2.0 / (((t_m / l) * ((k * k) / l)) * (k * k));
} else {
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2d+41) then
tmp = 2.0d0 / (((t_m / l) * ((k * k) / l)) * (k * k))
else
tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2e+41) {
tmp = 2.0 / (((t_m / l) * ((k * k) / l)) * (k * k));
} else {
tmp = (((l + l) / k) * (l / ((k * 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 t_m <= 2e+41: tmp = 2.0 / (((t_m / l) * ((k * k) / l)) * (k * k)) else: tmp = (((l + l) / k) * (l / ((k * 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 (t_m <= 2e+41) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(Float64(k * k) / l)) * Float64(k * k))); else tmp = Float64(Float64(Float64(Float64(l + l) / k) * Float64(l / Float64(Float64(k * k) * 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 (t_m <= 2e+41) tmp = 2.0 / (((t_m / l) * ((k * k) / l)) * (k * k)); else tmp = (((l + l) / k) * (l / ((k * 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[t$95$m, 2e+41], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 \cdot 10^{+41}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \frac{k \cdot k}{\ell}\right) \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell + \ell}{k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot k}}{t\_m}\\
\end{array}
\end{array}
if t < 2.00000000000000001e41Initial program 41.0%
Taylor expanded in t around 0
Applied rewrites74.4%
Applied rewrites85.4%
Taylor expanded in k around 0
Applied rewrites71.2%
if 2.00000000000000001e41 < t Initial program 27.5%
Taylor expanded in k around 0
Applied rewrites64.4%
Taylor expanded in l around 0
Applied rewrites73.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 3e-40)
(/ (* (/ (+ l l) k) (/ l (* (* k k) k))) t_m)
(/ 2.0 (* (* (* (/ (/ t_m l) l) k) (* k k)) 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 <= 3e-40) {
tmp = (((l + l) / k) * (l / ((k * k) * k))) / t_m;
} else {
tmp = 2.0 / (((((t_m / l) / l) * k) * (k * k)) * 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 <= 3d-40) then
tmp = (((l + l) / k) * (l / ((k * k) * k))) / t_m
else
tmp = 2.0d0 / (((((t_m / l) / l) * k) * (k * k)) * 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 <= 3e-40) {
tmp = (((l + l) / k) * (l / ((k * k) * k))) / t_m;
} else {
tmp = 2.0 / (((((t_m / l) / l) * k) * (k * k)) * 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 <= 3e-40: tmp = (((l + l) / k) * (l / ((k * k) * k))) / t_m else: tmp = 2.0 / (((((t_m / l) / l) * k) * (k * k)) * 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 <= 3e-40) tmp = Float64(Float64(Float64(Float64(l + l) / k) * Float64(l / Float64(Float64(k * k) * k))) / t_m); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l) / l) * k) * Float64(k * k)) * 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 <= 3e-40) tmp = (((l + l) / k) * (l / ((k * k) * k))) / t_m; else tmp = 2.0 / (((((t_m / l) / l) * k) * (k * k)) * 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, 3e-40], N[(N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(k * k), $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}\;\ell \leq 3 \cdot 10^{-40}:\\
\;\;\;\;\frac{\frac{\ell + \ell}{k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\frac{t\_m}{\ell}}{\ell} \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot k}\\
\end{array}
\end{array}
if l < 3.0000000000000002e-40Initial program 39.3%
Taylor expanded in k around 0
Applied rewrites66.8%
Taylor expanded in l around 0
Applied rewrites79.6%
if 3.0000000000000002e-40 < l Initial program 37.4%
Taylor expanded in t around 0
Applied rewrites74.5%
Taylor expanded in k around 0
Applied rewrites56.7%
Applied rewrites60.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 5.5e-167)
(/ (/ 2.0 (* (* k k) (* k k))) t_m)
(/ 2.0 (* (* t_m (/ (* k k) (* l l))) (* k 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 <= 5.5e-167) {
tmp = (2.0 / ((k * k) * (k * k))) / t_m;
} else {
tmp = 2.0 / ((t_m * ((k * k) / (l * l))) * (k * 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 <= 5.5d-167) then
tmp = (2.0d0 / ((k * k) * (k * k))) / t_m
else
tmp = 2.0d0 / ((t_m * ((k * k) / (l * l))) * (k * 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 <= 5.5e-167) {
tmp = (2.0 / ((k * k) * (k * k))) / t_m;
} else {
tmp = 2.0 / ((t_m * ((k * k) / (l * l))) * (k * 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 <= 5.5e-167: tmp = (2.0 / ((k * k) * (k * k))) / t_m else: tmp = 2.0 / ((t_m * ((k * k) / (l * l))) * (k * 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 <= 5.5e-167) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) / t_m); else tmp = Float64(2.0 / Float64(Float64(t_m * Float64(Float64(k * k) / Float64(l * l))) * Float64(k * 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 <= 5.5e-167) tmp = (2.0 / ((k * k) * (k * k))) / t_m; else tmp = 2.0 / ((t_m * ((k * k) / (l * l))) * (k * 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, 5.5e-167], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(2.0 / N[(N[(t$95$m * N[(N[(k * k), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $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 5.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t\_m \cdot \frac{k \cdot k}{\ell \cdot \ell}\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 5.5000000000000003e-167Initial program 40.4%
Taylor expanded in k around 0
Applied rewrites64.9%
Applied rewrites64.9%
if 5.5000000000000003e-167 < k Initial program 35.8%
Taylor expanded in t around 0
Applied rewrites79.1%
Applied rewrites86.2%
Taylor expanded in k around 0
Applied rewrites67.5%
Applied rewrites64.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 1.8e-86)
(/ (/ 2.0 (* (* k k) (* k k))) t_m)
(/ (/ (* l (+ l l)) (* (* (* k k) 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 <= 1.8e-86) {
tmp = (2.0 / ((k * k) * (k * k))) / t_m;
} else {
tmp = ((l * (l + l)) / (((k * k) * 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 <= 1.8d-86) then
tmp = (2.0d0 / ((k * k) * (k * k))) / t_m
else
tmp = ((l * (l + l)) / (((k * k) * 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 <= 1.8e-86) {
tmp = (2.0 / ((k * k) * (k * k))) / t_m;
} else {
tmp = ((l * (l + l)) / (((k * k) * 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 <= 1.8e-86: tmp = (2.0 / ((k * k) * (k * k))) / t_m else: tmp = ((l * (l + l)) / (((k * k) * 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 <= 1.8e-86) tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) / t_m); else tmp = Float64(Float64(Float64(l * Float64(l + l)) / Float64(Float64(Float64(k * k) * k) * 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 <= 1.8e-86) tmp = (2.0 / ((k * k) * (k * k))) / t_m; else tmp = ((l * (l + l)) / (((k * k) * 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, 1.8e-86], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] / t$95$m), $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 1.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell \cdot \left(\ell + \ell\right)}{\left(\left(k \cdot k\right) \cdot k\right) \cdot k}}{t\_m}\\
\end{array}
\end{array}
if k < 1.79999999999999983e-86Initial program 42.2%
Taylor expanded in k around 0
Applied rewrites65.9%
Applied rewrites65.9%
if 1.79999999999999983e-86 < k Initial program 30.4%
Taylor expanded in k around 0
Applied rewrites55.2%
Applied rewrites55.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (* k k) (* k k))))
(*
t_s
(if (<= k 1.8e-86) (/ (/ 2.0 t_2) t_m) (/ (/ (* l (+ l l)) t_2) 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 t_2 = (k * k) * (k * k);
double tmp;
if (k <= 1.8e-86) {
tmp = (2.0 / t_2) / t_m;
} else {
tmp = ((l * (l + l)) / t_2) / 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) :: t_2
real(8) :: tmp
t_2 = (k * k) * (k * k)
if (k <= 1.8d-86) then
tmp = (2.0d0 / t_2) / t_m
else
tmp = ((l * (l + l)) / t_2) / 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 t_2 = (k * k) * (k * k);
double tmp;
if (k <= 1.8e-86) {
tmp = (2.0 / t_2) / t_m;
} else {
tmp = ((l * (l + l)) / t_2) / 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): t_2 = (k * k) * (k * k) tmp = 0 if k <= 1.8e-86: tmp = (2.0 / t_2) / t_m else: tmp = ((l * (l + l)) / t_2) / t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(Float64(k * k) * Float64(k * k)) tmp = 0.0 if (k <= 1.8e-86) tmp = Float64(Float64(2.0 / t_2) / t_m); else tmp = Float64(Float64(Float64(l * Float64(l + l)) / t_2) / 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) t_2 = (k * k) * (k * k); tmp = 0.0; if (k <= 1.8e-86) tmp = (2.0 / t_2) / t_m; else tmp = ((l * (l + l)) / t_2) / 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_] := Block[{t$95$2 = N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 1.8e-86], N[(N[(2.0 / t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(N[(l * N[(l + l), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \left(k \cdot k\right) \cdot \left(k \cdot k\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{\frac{2}{t\_2}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell \cdot \left(\ell + \ell\right)}{t\_2}}{t\_m}\\
\end{array}
\end{array}
\end{array}
if k < 1.79999999999999983e-86Initial program 42.2%
Taylor expanded in k around 0
Applied rewrites65.9%
Applied rewrites65.9%
if 1.79999999999999983e-86 < k Initial program 30.4%
Taylor expanded in k around 0
Applied rewrites55.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) k) (/ l (* (* k 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) {
return t_s * ((((l + l) / k) * (l / ((k * k) * k))) / t_m);
}
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) / k) * (l / ((k * k) * k))) / t_m)
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) / k) * (l / ((k * k) * k))) / t_m);
}
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) / k) * (l / ((k * k) * k))) / t_m)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(Float64(l + l) / k) * Float64(l / Float64(Float64(k * k) * k))) / t_m)) 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) / k) * (l / ((k * k) * k))) / t_m); 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[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(N[(k * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\frac{\ell + \ell}{k} \cdot \frac{\ell}{\left(k \cdot k\right) \cdot k}}{t\_m}
\end{array}
Initial program 38.7%
Taylor expanded in k around 0
Applied rewrites62.7%
Taylor expanded in l around 0
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 (* (/ l t_m) (/ (/ (+ l l) k) (* (* k 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 / t_m) * (((l + l) / k) / ((k * 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 / t_m) * (((l + l) / k) / ((k * 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 / t_m) * (((l + l) / k) / ((k * 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 / t_m) * (((l + l) / k) / ((k * 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 / t_m) * Float64(Float64(Float64(l + l) / k) / Float64(Float64(k * 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 / t_m) * (((l + l) / k) / ((k * 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 / t$95$m), $MachinePrecision] * N[(N[(N[(l + l), $MachinePrecision] / k), $MachinePrecision] / N[(N[(k * k), $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 \frac{\frac{\ell + \ell}{k}}{\left(k \cdot k\right) \cdot k}\right)
\end{array}
Initial program 38.7%
Taylor expanded in k around 0
Applied rewrites62.7%
Taylor expanded in t around 0
Applied rewrites71.0%
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) (* (* k k) (* 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) {
return t_s * (((l + l) / ((k * k) * (k * k))) / t_m);
}
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) / ((k * k) * (k * k))) / t_m)
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) / ((k * k) * (k * k))) / t_m);
}
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) / ((k * k) * (k * k))) / t_m)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(l + l) / Float64(Float64(k * k) * Float64(k * k))) / t_m)) 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) / ((k * k) * (k * k))) / t_m); 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[(N[(l + l), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\frac{\ell + \ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{t\_m}
\end{array}
Initial program 38.7%
Taylor expanded in k around 0
Applied rewrites62.7%
Applied rewrites44.7%
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 (/ (/ 2.0 (* (* k k) (* 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) {
return t_s * ((2.0 / ((k * k) * (k * k))) / t_m);
}
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 * ((2.0d0 / ((k * k) * (k * k))) / t_m)
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 * ((2.0 / ((k * k) * (k * k))) / t_m);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((2.0 / ((k * k) * (k * k))) / t_m)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(2.0 / Float64(Float64(k * k) * Float64(k * k))) / t_m)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((2.0 / ((k * k) * (k * k))) / t_m); 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[(2.0 / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{t\_m}
\end{array}
Initial program 38.7%
Taylor expanded in k around 0
Applied rewrites62.7%
Applied rewrites57.6%
herbie shell --seed 2025021
(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))))