
(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 28 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 (* (/ t_m t_m) (/ k l))) (t_3 (* (sin k) t_m)))
(*
t_s
(if (<= t_m 3.1e+61)
(/
2.0
(fma
(* (* (* (tan k) t_m) (sin k)) (/ t_m l))
(* (/ t_m l) 2.0)
(* t_2 (* t_2 (* t_3 (tan k))))))
(/
(/ 2.0 (/ t_m l))
(* (* t_3 (* (tan k) (/ t_m l))) (+ (pow (/ k t_m) 2.0) 2.0)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = (t_m / t_m) * (k / l);
double t_3 = sin(k) * t_m;
double tmp;
if (t_m <= 3.1e+61) {
tmp = 2.0 / fma((((tan(k) * t_m) * sin(k)) * (t_m / l)), ((t_m / l) * 2.0), (t_2 * (t_2 * (t_3 * tan(k)))));
} else {
tmp = (2.0 / (t_m / l)) / ((t_3 * (tan(k) * (t_m / l))) * (pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(Float64(t_m / t_m) * Float64(k / l)) t_3 = Float64(sin(k) * t_m) tmp = 0.0 if (t_m <= 3.1e+61) tmp = Float64(2.0 / fma(Float64(Float64(Float64(tan(k) * t_m) * sin(k)) * Float64(t_m / l)), Float64(Float64(t_m / l) * 2.0), Float64(t_2 * Float64(t_2 * Float64(t_3 * tan(k)))))); else tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(t_3 * Float64(tan(k) * Float64(t_m / l))) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(t$95$m / t$95$m), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 3.1e+61], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * 2.0), $MachinePrecision] + N[(t$95$2 * N[(t$95$2 * N[(t$95$3 * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$3 * N[(N[Tan[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{t\_m}{t\_m} \cdot \frac{k}{\ell}\\
t_3 := \sin k \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 3.1 \cdot 10^{+61}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\left(\left(\tan k \cdot t\_m\right) \cdot \sin k\right) \cdot \frac{t\_m}{\ell}, \frac{t\_m}{\ell} \cdot 2, t\_2 \cdot \left(t\_2 \cdot \left(t\_3 \cdot \tan k\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\left(t\_3 \cdot \left(\tan k \cdot \frac{t\_m}{\ell}\right)\right) \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)}\\
\end{array}
\end{array}
\end{array}
if t < 3.0999999999999999e61Initial program 55.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6469.4
Applied rewrites69.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites73.3%
Applied rewrites80.5%
lift-*.f64N/A
lift-pow.f64N/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6481.6
Applied rewrites94.2%
if 3.0999999999999999e61 < t Initial program 61.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.5
Applied rewrites88.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites98.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
INFINITY)
(/ 2.0 (* (* k (/ (* t_m t_m) l)) (* (* k (/ t_m l)) 2.0)))
(/ 2.0 (* (* (* k t_m) k) (* (/ k l) (/ k l)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + 1.0))) <= ((double) INFINITY)) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
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 ((2.0 / ((((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))) <= Double.POSITIVE_INFINITY) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (2.0 / ((((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))) <= math.inf: tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0)) else: tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(2.0 / 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))) <= Inf) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(k * Float64(t_m / l)) * 2.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(k / l) * Float64(k / l)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((2.0 / (((((t_m ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) + 1.0))) <= Inf) tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0)); else tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[N[(2.0 / 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]), $MachinePrecision], Infinity], N[(2.0 / N[(N[(k * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{2}{\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 \infty:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\left(k \cdot \frac{t\_m}{\ell}\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.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)))) < +inf.0Initial program 85.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.4
Applied rewrites92.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites98.2%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6487.1
Applied rewrites87.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
if +inf.0 < (/.f64 #s(literal 2 binary64) (*.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 0.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6433.1
Applied rewrites33.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites35.6%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6455.6
Applied rewrites55.6%
Taylor expanded in k around 0
Applied rewrites38.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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
INFINITY)
(* (/ (/ l (* t_m t_m)) k) (/ l (* t_m k)))
(/ 2.0 (* (* (* k t_m) k) (* (/ k l) (/ k l)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + 1.0))) <= ((double) INFINITY)) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
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 ((2.0 / ((((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))) <= Double.POSITIVE_INFINITY) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (2.0 / ((((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))) <= math.inf: tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)) else: tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (Float64(2.0 / 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))) <= Inf) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(t_m * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(k / l) * Float64(k / l)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((2.0 / (((((t_m ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) + 1.0))) <= Inf) tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)); else tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[N[(2.0 / 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]), $MachinePrecision], Infinity], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\frac{2}{\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 \infty:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{t\_m \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.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)))) < +inf.0Initial program 85.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6477.8
Applied rewrites77.8%
Applied rewrites77.8%
Applied rewrites77.2%
Applied rewrites84.9%
if +inf.0 < (/.f64 #s(literal 2 binary64) (*.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 0.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6433.1
Applied rewrites33.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites35.6%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6455.6
Applied rewrites55.6%
Taylor expanded in k around 0
Applied rewrites38.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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
INFINITY)
(* (/ (/ l (* t_m t_m)) k) (/ l (* t_m k)))
(/ (* (/ l t_m) (/ l t_m)) (* t_m (* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((2.0 / ((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + 1.0))) <= ((double) INFINITY)) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = ((l / t_m) * (l / t_m)) / (t_m * (k * k));
}
return t_s * tmp;
}
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 ((2.0 / ((((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))) <= Double.POSITIVE_INFINITY) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = ((l / t_m) * (l / t_m)) / (t_m * (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 (2.0 / ((((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))) <= math.inf: tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)) else: tmp = ((l / t_m) * (l / t_m)) / (t_m * (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 (Float64(2.0 / 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))) <= Inf) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(t_m * k))); else tmp = Float64(Float64(Float64(l / t_m) * Float64(l / t_m)) / Float64(t_m * 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 ((2.0 / (((((t_m ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) + 1.0))) <= Inf) tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)); else tmp = ((l / t_m) * (l / t_m)) / (t_m * (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[N[(2.0 / 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]), $MachinePrecision], Infinity], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * 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}\;\frac{2}{\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 \infty:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{t\_m \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}{t\_m \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if (/.f64 #s(literal 2 binary64) (*.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)))) < +inf.0Initial program 85.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6477.8
Applied rewrites77.8%
Applied rewrites77.8%
Applied rewrites77.2%
Applied rewrites84.9%
if +inf.0 < (/.f64 #s(literal 2 binary64) (*.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 0.0%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6421.8
Applied rewrites21.8%
Applied rewrites21.8%
Applied rewrites25.3%
Applied rewrites34.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 2.3e-63)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(/
(/ 2.0 (/ t_m l))
(*
(* (* (sin k) t_m) (* (tan k) (/ t_m l)))
(+ (pow (/ k t_m) 2.0) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.3e-63) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else {
tmp = (2.0 / (t_m / l)) / (((sin(k) * t_m) * (tan(k) * (t_m / l))) * (pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.3d-63) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else
tmp = (2.0d0 / (t_m / l)) / (((sin(k) * t_m) * (tan(k) * (t_m / l))) * (((k / t_m) ** 2.0d0) + 2.0d0))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.3e-63) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else {
tmp = (2.0 / (t_m / l)) / (((Math.sin(k) * t_m) * (Math.tan(k) * (t_m / l))) * (Math.pow((k / t_m), 2.0) + 2.0));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 2.3e-63: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) else: tmp = (2.0 / (t_m / l)) / (((math.sin(k) * t_m) * (math.tan(k) * (t_m / l))) * (math.pow((k / t_m), 2.0) + 2.0)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 2.3e-63) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); else tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64(sin(k) * t_m) * Float64(tan(k) * Float64(t_m / l))) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 2.3e-63) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); else tmp = (2.0 / (t_m / l)) / (((sin(k) * t_m) * (tan(k) * (t_m / l))) * (((k / t_m) ^ 2.0) + 2.0)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.3e-63], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\left(\left(\sin k \cdot t\_m\right) \cdot \left(\tan k \cdot \frac{t\_m}{\ell}\right)\right) \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)}\\
\end{array}
\end{array}
if t < 2.3e-63Initial program 52.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6467.7
Applied rewrites67.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites71.4%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.0
Applied rewrites73.0%
Applied rewrites78.8%
if 2.3e-63 < t Initial program 70.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.7
Applied rewrites88.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites97.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
metadata-evalN/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
Applied rewrites97.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 0.0026)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(/
2.0
(*
(* (/ t_m l) (* t_m (sin k)))
(* (/ t_m l) (* (tan k) (+ (pow (/ k t_m) 2.0) 2.0))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 0.0026) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (tan(k) * (pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 0.0026d0) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 0.0026) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 0.0026: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) else: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 0.0026) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 0.0026) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); else tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (tan(k) * (((k / t_m) ^ 2.0) + 2.0)))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 0.0026], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $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}\;t\_m \leq 0.0026:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right)\right)}\\
\end{array}
\end{array}
if t < 0.0025999999999999999Initial program 54.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.7
Applied rewrites68.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Applied rewrites79.3%
if 0.0025999999999999999 < t Initial program 66.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.4
Applied rewrites88.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites98.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 5.4e-48)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(/
2.0
(*
(* t_m (/ (* (sin k) t_m) l))
(* (/ t_m l) (* (tan k) (+ (pow (/ k t_m) 2.0) 2.0))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.4e-48) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else {
tmp = 2.0 / ((t_m * ((sin(k) * t_m) / l)) * ((t_m / l) * (tan(k) * (pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 5.4d-48) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else
tmp = 2.0d0 / ((t_m * ((sin(k) * t_m) / l)) * ((t_m / l) * (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.4e-48) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else {
tmp = 2.0 / ((t_m * ((Math.sin(k) * t_m) / l)) * ((t_m / l) * (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 5.4e-48: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) else: tmp = 2.0 / ((t_m * ((math.sin(k) * t_m) / l)) * ((t_m / l) * (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5.4e-48) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); else tmp = Float64(2.0 / Float64(Float64(t_m * Float64(Float64(sin(k) * t_m) / l)) * Float64(Float64(t_m / l) * Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 5.4e-48) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); else tmp = 2.0 / ((t_m * ((sin(k) * t_m) / l)) * ((t_m / l) * (tan(k) * (((k / t_m) ^ 2.0) + 2.0)))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.4e-48], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$m * N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $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}\;t\_m \leq 5.4 \cdot 10^{-48}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(t\_m \cdot \frac{\sin k \cdot t\_m}{\ell}\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right)\right)}\\
\end{array}
\end{array}
if t < 5.40000000000000023e-48Initial program 53.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.3
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites71.9%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.5
Applied rewrites73.5%
Applied rewrites79.2%
if 5.40000000000000023e-48 < t Initial program 68.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6487.8
Applied rewrites87.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites96.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6496.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6496.8
Applied rewrites96.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 4.3e-40)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(if (<= t_m 1.3e+105)
(/
2.0
(*
(* k (/ (* t_m t_m) l))
(* (/ t_m l) (* (tan k) (+ (pow (/ k t_m) 2.0) 2.0)))))
(if (<= t_m 2.55e+197)
(/
2.0
(*
(* (* (* (tan k) (sin k)) t_m) (* (/ t_m l) (/ t_m l)))
(fma (/ k t_m) (/ k t_m) 2.0)))
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k)))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4.3e-40) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else if (t_m <= 1.3e+105) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (tan(k) * (pow((k / t_m), 2.0) + 2.0))));
} else if (t_m <= 2.55e+197) {
tmp = 2.0 / ((((tan(k) * sin(k)) * t_m) * ((t_m / l) * (t_m / l))) * fma((k / t_m), (k / t_m), 2.0));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4.3e-40) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); elseif (t_m <= 1.3e+105) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(t_m / l) * Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))))); elseif (t_m <= 2.55e+197) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(tan(k) * sin(k)) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.3e-40], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.3e+105], N[(2.0 / N[(N[(k * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.55e+197], N[(2.0 / N[(N[(N[(N[(N[Tan[k], $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.3 \cdot 10^{-40}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{+105}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right)\right)}\\
\mathbf{elif}\;t\_m \leq 2.55 \cdot 10^{+197}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\tan k \cdot \sin k\right) \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 4.3000000000000003e-40Initial program 53.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.4
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.0%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.6
Applied rewrites73.6%
Applied rewrites79.3%
if 4.3000000000000003e-40 < t < 1.3000000000000001e105Initial program 75.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6480.4
Applied rewrites80.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites94.6%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
if 1.3000000000000001e105 < t < 2.54999999999999996e197Initial program 48.3%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.54999999999999996e197 < t Initial program 73.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6492.1
Applied rewrites92.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites97.0%
Taylor expanded in k around 0
lower-*.f6497.0
Applied rewrites97.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
(if (<= t_m 4e-94)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(/
2.0
(*
(* (* (* (/ t_m l) t_m) (sin k)) (* (tan k) (/ t_m l)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4e-94) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else {
tmp = 2.0 / (((((t_m / l) * t_m) * sin(k)) * (tan(k) * (t_m / l))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4e-94) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m / l) * t_m) * sin(k)) * Float64(tan(k) * Float64(t_m / l))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4e-94], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4 \cdot 10^{-94}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \sin k\right) \cdot \left(\tan k \cdot \frac{t\_m}{\ell}\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 3.9999999999999998e-94Initial program 51.0%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6467.0
Applied rewrites67.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites70.4%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6472.0
Applied rewrites72.0%
Applied rewrites77.7%
if 3.9999999999999998e-94 < t Initial program 72.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6479.8
Applied rewrites79.8%
Applied rewrites91.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 (<= t_m 4.3e-40)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(if (<= t_m 2.16e+133)
(/
2.0
(*
(* k (/ (* t_m t_m) l))
(* (/ t_m l) (* (tan k) (+ (pow (/ k t_m) 2.0) 2.0)))))
(/
2.0
(* (* (* (* (sin k) t_m) (* (/ t_m l) (/ t_m l))) (tan k)) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4.3e-40) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else if (t_m <= 2.16e+133) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (tan(k) * (pow((k / t_m), 2.0) + 2.0))));
} else {
tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 4.3d-40) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else if (t_m <= 2.16d+133) then
tmp = 2.0d0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))))
else
tmp = 2.0d0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0d0)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4.3e-40) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else if (t_m <= 2.16e+133) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0))));
} else {
tmp = 2.0 / ((((Math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * Math.tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 4.3e-40: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) elif t_m <= 2.16e+133: tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)))) else: tmp = 2.0 / ((((math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * math.tan(k)) * 2.0) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4.3e-40) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); elseif (t_m <= 2.16e+133) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(t_m / l) * Float64(tan(k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0))))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * 2.0)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 4.3e-40) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); elseif (t_m <= 2.16e+133) tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (tan(k) * (((k / t_m) ^ 2.0) + 2.0)))); else tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.3e-40], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.16e+133], N[(2.0 / N[(N[(k * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.3 \cdot 10^{-40}:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{elif}\;t\_m \leq 2.16 \cdot 10^{+133}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\sin k \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
if t < 4.3000000000000003e-40Initial program 53.7%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.4
Applied rewrites68.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.0%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.6
Applied rewrites73.6%
Applied rewrites79.3%
if 4.3000000000000003e-40 < t < 2.16e133Initial program 63.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites95.4%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6480.1
Applied rewrites80.1%
if 2.16e133 < t Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Taylor expanded in t around inf
Applied rewrites94.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) l)))
(*
t_s
(if (<= t_m 3900.0)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* t_2 (tan k))))
(if (<= t_m 4.7e+131)
(/ 2.0 (* (* k (/ (* t_m t_m) l)) (* (* t_m 2.0) (/ t_2 (cos k)))))
(/
2.0
(* (* (* (* (sin k) t_m) (* (/ t_m l) (/ t_m l))) (tan k)) 2.0)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sin(k) / l;
double tmp;
if (t_m <= 3900.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * (t_2 * tan(k)));
} else if (t_m <= 4.7e+131) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m * 2.0) * (t_2 / cos(k))));
} else {
tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = sin(k) / l
if (t_m <= 3900.0d0) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * (t_2 * tan(k)))
else if (t_m <= 4.7d+131) then
tmp = 2.0d0 / ((k * ((t_m * t_m) / l)) * ((t_m * 2.0d0) * (t_2 / cos(k))))
else
tmp = 2.0d0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0d0)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = Math.sin(k) / l;
double tmp;
if (t_m <= 3900.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * (t_2 * Math.tan(k)));
} else if (t_m <= 4.7e+131) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m * 2.0) * (t_2 / Math.cos(k))));
} else {
tmp = 2.0 / ((((Math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * Math.tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = math.sin(k) / l tmp = 0 if t_m <= 3900.0: tmp = 2.0 / ((((t_m * k) * k) / l) * (t_2 * math.tan(k))) elif t_m <= 4.7e+131: tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m * 2.0) * (t_2 / math.cos(k)))) else: tmp = 2.0 / ((((math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * math.tan(k)) * 2.0) 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 <= 3900.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(t_2 * tan(k)))); elseif (t_m <= 4.7e+131) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(t_m * 2.0) * Float64(t_2 / cos(k))))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * 2.0)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = sin(k) / l; tmp = 0.0; if (t_m <= 3900.0) tmp = 2.0 / ((((t_m * k) * k) / l) * (t_2 * tan(k))); elseif (t_m <= 4.7e+131) tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m * 2.0) * (t_2 / cos(k)))); else tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 3900.0], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$2 * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 4.7e+131], N[(2.0 / N[(N[(k * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * 2.0), $MachinePrecision] * N[(t$95$2 / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $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 3900:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(t\_2 \cdot \tan k\right)}\\
\mathbf{elif}\;t\_m \leq 4.7 \cdot 10^{+131}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\left(t\_m \cdot 2\right) \cdot \frac{t\_2}{\cos k}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\sin k \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
\end{array}
if t < 3900Initial program 54.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.7
Applied rewrites68.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Applied rewrites79.3%
if 3900 < t < 4.7e131Initial program 59.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6480.0
Applied rewrites80.0%
Taylor expanded in t around inf
*-commutativeN/A
associate-/l*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-cos.f6479.9
Applied rewrites79.9%
if 4.7e131 < t Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Taylor expanded in t around inf
Applied rewrites94.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 (<= t_m 4800.0)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(if (<= t_m 1.3e+133)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(/
2.0
(* (* (* (* (sin k) t_m) (* (/ t_m l) (/ t_m l))) (tan k)) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4800.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else if (t_m <= 1.3e+133) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 4800.0d0) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else if (t_m <= 1.3d+133) then
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0d0 * k)))
else
tmp = 2.0d0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0d0)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4800.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else if (t_m <= 1.3e+133) {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / ((((Math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * Math.tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 4800.0: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) elif t_m <= 1.3e+133: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (2.0 * k))) else: tmp = 2.0 / ((((math.sin(k) * t_m) * ((t_m / l) * (t_m / l))) * math.tan(k)) * 2.0) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4800.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); elseif (t_m <= 1.3e+133) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * 2.0)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 4800.0) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); elseif (t_m <= 1.3e+133) tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k))); else tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * 2.0); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4800.0], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.3e+133], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4800:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{elif}\;t\_m \leq 1.3 \cdot 10^{+133}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\sin k \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
if t < 4800Initial program 54.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.7
Applied rewrites68.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Applied rewrites79.3%
if 4800 < t < 1.2999999999999999e133Initial program 59.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6479.6
Applied rewrites79.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites99.3%
Taylor expanded in k around 0
lower-*.f6479.8
Applied rewrites79.8%
if 1.2999999999999999e133 < t Initial program 71.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.6
Applied rewrites94.6%
Taylor expanded in t around inf
Applied rewrites94.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 (<= t_m 4800.0)
(/ 2.0 (* (/ (* (* t_m k) k) l) (* (/ (sin k) l) (tan k))))
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4800.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 4800.0d0) then
tmp = 2.0d0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k)))
else
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0d0 * k)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4800.0) {
tmp = 2.0 / ((((t_m * k) * k) / l) * ((Math.sin(k) / l) * Math.tan(k)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (2.0 * k)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 4800.0: tmp = 2.0 / ((((t_m * k) * k) / l) * ((math.sin(k) / l) * math.tan(k))) else: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (2.0 * k))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4800.0) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * k) * k) / l) * Float64(Float64(sin(k) / l) * tan(k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 4800.0) tmp = 2.0 / ((((t_m * k) * k) / l) * ((sin(k) / l) * tan(k))); else tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4800.0], N[(2.0 / N[(N[(N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4800:\\
\;\;\;\;\frac{2}{\frac{\left(t\_m \cdot k\right) \cdot k}{\ell} \cdot \left(\frac{\sin k}{\ell} \cdot \tan k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 4800Initial program 54.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.7
Applied rewrites68.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6473.8
Applied rewrites73.8%
Applied rewrites79.3%
if 4800 < t Initial program 66.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.4
Applied rewrites88.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites98.5%
Taylor expanded in k around 0
lower-*.f6486.4
Applied rewrites86.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 8.8e-14)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(/ 2.0 (* (* (* k t_m) k) (/ (* (sin k) (tan k)) (* l 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 <= 8.8e-14) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((sin(k) * tan(k)) / (l * 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 <= 8.8d-14) then
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0d0 * k)))
else
tmp = 2.0d0 / (((k * t_m) * k) * ((sin(k) * tan(k)) / (l * 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 <= 8.8e-14) {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / (((k * t_m) * k) * ((Math.sin(k) * Math.tan(k)) / (l * 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 <= 8.8e-14: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (2.0 * k))) else: tmp = 2.0 / (((k * t_m) * k) * ((math.sin(k) * math.tan(k)) / (l * 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 <= 8.8e-14) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(sin(k) * tan(k)) / Float64(l * 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 <= 8.8e-14) tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k))); else tmp = 2.0 / (((k * t_m) * k) * ((sin(k) * tan(k)) / (l * 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, 8.8e-14], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] / N[(l * 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 8.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \frac{\sin k \cdot \tan k}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 8.8000000000000004e-14Initial program 61.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites81.6%
Taylor expanded in k around 0
lower-*.f6474.7
Applied rewrites74.7%
if 8.8000000000000004e-14 < k Initial program 41.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites62.7%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6478.0
Applied rewrites78.0%
Applied rewrites78.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 (<= k 8.8e-14)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(/ 2.0 (* k (* t_m (* (* (tan k) (/ (sin k) (* l l))) k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8.8e-14) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k)));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 8.8d-14) then
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0d0 * k)))
else
tmp = 2.0d0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8.8e-14) {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = 2.0 / (k * (t_m * ((Math.tan(k) * (Math.sin(k) / (l * l))) * k)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 8.8e-14: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (2.0 * k))) else: tmp = 2.0 / (k * (t_m * ((math.tan(k) * (math.sin(k) / (l * l))) * k))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8.8e-14) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); else tmp = Float64(2.0 / Float64(k * Float64(t_m * Float64(Float64(tan(k) * Float64(sin(k) / Float64(l * l))) * k)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 8.8e-14) tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k))); else tmp = 2.0 / (k * (t_m * ((tan(k) * (sin(k) / (l * l))) * k))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 8.8e-14], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k * N[(t$95$m * N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{k \cdot \left(t\_m \cdot \left(\left(\tan k \cdot \frac{\sin k}{\ell \cdot \ell}\right) \cdot k\right)\right)}\\
\end{array}
\end{array}
if k < 8.8000000000000004e-14Initial program 61.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites81.6%
Taylor expanded in k around 0
lower-*.f6474.7
Applied rewrites74.7%
if 8.8000000000000004e-14 < k Initial program 41.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites62.7%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6478.0
Applied rewrites78.0%
Applied rewrites79.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 6.2e-152)
(/ 2.0 (* (* (* k t_m) k) (* (/ k l) (/ k l))))
(/
2.0
(*
(* (/ t_m l) (* t_m (sin k)))
(*
(/
(fma
(* (* (+ 0.6666666666666666 (/ 1.0 (* t_m t_m))) t_m) k)
k
(* 2.0 t_m))
l)
k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.2e-152) {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((fma((((0.6666666666666666 + (1.0 / (t_m * t_m))) * t_m) * k), k, (2.0 * t_m)) / l) * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6.2e-152) tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(k / l) * Float64(k / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(fma(Float64(Float64(Float64(0.6666666666666666 + Float64(1.0 / Float64(t_m * t_m))) * t_m) * k), k, Float64(2.0 * t_m)) / l) * k))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6.2e-152], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[(N[(N[(0.6666666666666666 + N[(1.0 / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] * k), $MachinePrecision] * k + N[(2.0 * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.2 \cdot 10^{-152}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{\mathsf{fma}\left(\left(\left(0.6666666666666666 + \frac{1}{t\_m \cdot t\_m}\right) \cdot t\_m\right) \cdot k, k, 2 \cdot t\_m\right)}{\ell} \cdot k\right)}\\
\end{array}
\end{array}
if t < 6.1999999999999997e-152Initial program 50.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites69.3%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
Applied rewrites58.8%
if 6.1999999999999997e-152 < t Initial program 70.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites95.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 6.8e-152)
(/ 2.0 (* (* (* k t_m) k) (* (/ k l) (/ k l))))
(/
2.0
(*
(* (/ t_m l) (* t_m (sin k)))
(*
(/ t_m l)
(* (fma (+ 0.6666666666666666 (/ 1.0 (* t_m t_m))) (* k k) 2.0) k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.8e-152) {
tmp = 2.0 / (((k * t_m) * k) * ((k / l) * (k / l)));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (fma((0.6666666666666666 + (1.0 / (t_m * t_m))), (k * k), 2.0) * k)));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6.8e-152) tmp = Float64(2.0 / Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(k / l) * Float64(k / l)))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(fma(Float64(0.6666666666666666 + Float64(1.0 / Float64(t_m * t_m))), Float64(k * k), 2.0) * k)))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 6.8e-152], N[(2.0 / N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(k / l), $MachinePrecision] * N[(k / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(N[(N[(0.6666666666666666 + N[(1.0 / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + 2.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.8 \cdot 10^{-152}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{k}{\ell} \cdot \frac{k}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\mathsf{fma}\left(0.6666666666666666 + \frac{1}{t\_m \cdot t\_m}, k \cdot k, 2\right) \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 6.79999999999999968e-152Initial program 50.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites69.3%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.0
Applied rewrites71.0%
Taylor expanded in k around 0
Applied rewrites58.8%
if 6.79999999999999968e-152 < t Initial program 70.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6486.5
Applied rewrites86.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites95.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.3
Applied rewrites85.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 9.8e-70)
(/ 2.0 (* (/ (pow k 4.0) l) (/ t_m l)))
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 9.8e-70) {
tmp = 2.0 / ((pow(k, 4.0) / l) * (t_m / l));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 9.8d-70) then
tmp = 2.0d0 / (((k ** 4.0d0) / l) * (t_m / l))
else
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0d0 * k)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 9.8e-70) {
tmp = 2.0 / ((Math.pow(k, 4.0) / l) * (t_m / l));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((t_m / l) * (2.0 * k)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 9.8e-70: tmp = 2.0 / ((math.pow(k, 4.0) / l) * (t_m / l)) else: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((t_m / l) * (2.0 * k))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 9.8e-70) tmp = Float64(2.0 / Float64(Float64((k ^ 4.0) / l) * Float64(t_m / l))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 9.8e-70) tmp = 2.0 / (((k ^ 4.0) / l) * (t_m / l)); else tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 9.8e-70], N[(2.0 / N[(N[(N[Power[k, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.8 \cdot 10^{-70}:\\
\;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t\_m}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(2 \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 9.8000000000000001e-70Initial program 51.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6467.3
Applied rewrites67.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites71.1%
Taylor expanded in t around 0
associate-/l*N/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6472.3
Applied rewrites72.3%
Taylor expanded in k around 0
Applied rewrites60.1%
if 9.8000000000000001e-70 < t Initial program 71.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6488.0
Applied rewrites88.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites95.6%
Taylor expanded in k around 0
lower-*.f6483.4
Applied rewrites83.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 5.2e+154)
(/ (* (/ l t_m) (/ (/ (/ l k) k) t_m)) t_m)
(/ (/ (pow (/ l t_m) 2.0) k) (* t_m k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.2e+154) {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
} else {
tmp = (pow((l / t_m), 2.0) / k) / (t_m * k);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 5.2d+154) then
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m
else
tmp = (((l / t_m) ** 2.0d0) / k) / (t_m * k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.2e+154) {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
} else {
tmp = (Math.pow((l / t_m), 2.0) / k) / (t_m * k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 5.2e+154: tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m else: tmp = (math.pow((l / t_m), 2.0) / k) / (t_m * k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5.2e+154) tmp = Float64(Float64(Float64(l / t_m) * Float64(Float64(Float64(l / k) / k) / t_m)) / t_m); else tmp = Float64(Float64((Float64(l / t_m) ^ 2.0) / k) / Float64(t_m * k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 5.2e+154) tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m; else tmp = (((l / t_m) ^ 2.0) / k) / (t_m * k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.2e+154], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(N[Power[N[(l / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / k), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{\left(\frac{\ell}{t\_m}\right)}^{2}}{k}}{t\_m \cdot k}\\
\end{array}
\end{array}
if t < 5.19999999999999978e154Initial program 55.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.1%
Applied rewrites59.0%
Applied rewrites67.4%
if 5.19999999999999978e154 < t Initial program 67.6%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6465.3
Applied rewrites65.3%
Applied rewrites65.3%
Applied rewrites65.3%
Applied rewrites89.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
(if (<= t_m 5.2e+154)
(/ (* (/ l t_m) (/ (/ (/ l k) k) t_m)) t_m)
(/
2.0
(*
(* (* (* k t_m) k) (* (/ t_m l) (/ t_m l)))
(fma (/ k t_m) (/ k t_m) 2.0))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.2e+154) {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
} else {
tmp = 2.0 / ((((k * t_m) * k) * ((t_m / l) * (t_m / l))) * fma((k / t_m), (k / t_m), 2.0));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5.2e+154) tmp = Float64(Float64(Float64(l / t_m) * Float64(Float64(Float64(l / k) / k) / t_m)) / t_m); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * t_m) * k) * Float64(Float64(t_m / l) * Float64(t_m / l))) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.2e+154], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(k \cdot t\_m\right) \cdot k\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 5.19999999999999978e154Initial program 55.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.1%
Applied rewrites59.0%
Applied rewrites67.4%
if 5.19999999999999978e154 < t Initial program 67.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6477.4
Applied rewrites77.4%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6477.4
Applied rewrites77.4%
Taylor expanded in k around 0
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6489.7
Applied rewrites89.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
(if (<= k 3.1e-204)
(/ 2.0 (* (* k (/ (* t_m t_m) l)) (* (* k (/ t_m l)) 2.0)))
(/ (* (/ l t_m) (/ (/ (/ l k) k) t_m)) t_m))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 3.1e-204) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0));
} else {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 3.1d-204) then
tmp = 2.0d0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0d0))
else
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 3.1e-204) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0));
} else {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 3.1e-204: tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0)) else: tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 3.1e-204) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(k * Float64(t_m / l)) * 2.0))); else tmp = Float64(Float64(Float64(l / t_m) * Float64(Float64(Float64(l / k) / k) / t_m)) / t_m); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 3.1e-204) tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((k * (t_m / l)) * 2.0)); else tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 3.1e-204], N[(2.0 / N[(N[(k * N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[(k * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $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 3.1 \cdot 10^{-204}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\left(k \cdot \frac{t\_m}{\ell}\right) \cdot 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m}\\
\end{array}
\end{array}
if k < 3.0999999999999999e-204Initial program 57.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-pow.f64N/A
cube-multN/A
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6474.5
Applied rewrites74.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites79.4%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6466.2
Applied rewrites66.2%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6466.7
Applied rewrites66.7%
if 3.0999999999999999e-204 < k Initial program 53.8%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
Applied rewrites60.2%
Applied rewrites61.4%
Applied rewrites72.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 (<= l 8.8e+18)
(* (/ (/ l (* t_m t_m)) k) (/ l (* t_m k)))
(/ (* (/ l t_m) l) (* t_m (* (* t_m k) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 8.8e+18) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 <= 8.8d+18) then
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k))
else
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 <= 8.8e+18) {
tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k));
} else {
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 <= 8.8e+18: tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)) else: tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 <= 8.8e+18) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(t_m * k))); else tmp = Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(t_m * 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 <= 8.8e+18) tmp = ((l / (t_m * t_m)) / k) * (l / (t_m * k)); else tmp = ((l / t_m) * l) / (t_m * ((t_m * 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, 8.8e+18], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;\ell \leq 8.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{t\_m \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(t\_m \cdot k\right) \cdot k\right)}\\
\end{array}
\end{array}
if l < 8.8e18Initial program 57.1%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6459.3
Applied rewrites59.3%
Applied rewrites59.3%
Applied rewrites60.5%
Applied rewrites66.8%
if 8.8e18 < l Initial program 54.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6457.0
Applied rewrites57.0%
Applied rewrites57.0%
Applied rewrites56.9%
Applied rewrites63.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 1.15e+112)
(* (/ l (* t_m t_m)) (/ (/ l (* k k)) t_m))
(/ (* (/ l t_m) l) (* t_m (* (* t_m k) k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.15e+112) {
tmp = (l / (t_m * t_m)) * ((l / (k * k)) / t_m);
} else {
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 (t_m <= 1.15d+112) then
tmp = (l / (t_m * t_m)) * ((l / (k * k)) / t_m)
else
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 (t_m <= 1.15e+112) {
tmp = (l / (t_m * t_m)) * ((l / (k * k)) / t_m);
} else {
tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 t_m <= 1.15e+112: tmp = (l / (t_m * t_m)) * ((l / (k * k)) / t_m) else: tmp = ((l / t_m) * l) / (t_m * ((t_m * 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 (t_m <= 1.15e+112) tmp = Float64(Float64(l / Float64(t_m * t_m)) * Float64(Float64(l / Float64(k * k)) / t_m)); else tmp = Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(t_m * 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 (t_m <= 1.15e+112) tmp = (l / (t_m * t_m)) * ((l / (k * k)) / t_m); else tmp = ((l / t_m) * l) / (t_m * ((t_m * 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[t$95$m, 1.15e+112], N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.15 \cdot 10^{+112}:\\
\;\;\;\;\frac{\ell}{t\_m \cdot t\_m} \cdot \frac{\frac{\ell}{k \cdot k}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(t\_m \cdot k\right) \cdot k\right)}\\
\end{array}
\end{array}
if t < 1.15e112Initial program 55.1%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.0
Applied rewrites58.0%
Applied rewrites61.1%
if 1.15e112 < t Initial program 66.9%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6464.7
Applied rewrites64.7%
Applied rewrites64.7%
Applied rewrites64.7%
Applied rewrites82.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 t_m) l) (* t_m (* (* t_m k) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (((l / t_m) * l) / (t_m * ((t_m * k) * k)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (((l / t_m) * l) / (t_m * ((t_m * k) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (((l / t_m) * l) / (t_m * ((t_m * k) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (((l / t_m) * l) / (t_m * ((t_m * k) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(t_m * 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) / (t_m * ((t_m * k) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(N[(t$95$m * 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 \frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(t\_m \cdot k\right) \cdot k\right)}
\end{array}
Initial program 56.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
Applied rewrites58.7%
Applied rewrites59.6%
Applied rewrites63.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* l (/ (/ l (* t_m t_m)) (* (* t_m k) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (l * ((l / (t_m * t_m)) / ((t_m * k) * k)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (l * ((l / (t_m * t_m)) / ((t_m * k) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (l * ((l / (t_m * t_m)) / ((t_m * k) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (l * ((l / (t_m * t_m)) / ((t_m * k) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(l * Float64(Float64(l / Float64(t_m * t_m)) / Float64(Float64(t_m * k) * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (l * ((l / (t_m * t_m)) / ((t_m * k) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(l * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$m * 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(\ell \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{\left(t\_m \cdot k\right) \cdot k}\right)
\end{array}
Initial program 56.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
Applied rewrites58.7%
Applied rewrites59.6%
Applied rewrites62.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ (* l l) (* (* (* t_m t_m) (* t_m k)) (- k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / (((t_m * t_m) * (t_m * k)) * -k));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l * l) / (((t_m * t_m) * (t_m * k)) * -k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / (((t_m * t_m) * (t_m * k)) * -k));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l * l) / (((t_m * t_m) * (t_m * k)) * -k))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l * l) / Float64(Float64(Float64(t_m * t_m) * Float64(t_m * k)) * Float64(-k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l * l) / (((t_m * t_m) * (t_m * k)) * -k)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] / N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(t$95$m * 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 \frac{\ell \cdot \ell}{\left(\left(t\_m \cdot t\_m\right) \cdot \left(t\_m \cdot k\right)\right) \cdot \left(-k\right)}
\end{array}
Initial program 56.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
Applied rewrites31.3%
Applied rewrites32.5%
Final simplification32.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 (/ (* (- l) l) (* (* t_m t_m) (* (* t_m k) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((-l * l) / ((t_m * t_m) * ((t_m * k) * k)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((-l * l) / ((t_m * t_m) * ((t_m * k) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((-l * l) / ((t_m * t_m) * ((t_m * k) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((-l * l) / ((t_m * t_m) * ((t_m * k) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(-l) * l) / Float64(Float64(t_m * t_m) * Float64(Float64(t_m * k) * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((-l * l) / ((t_m * t_m) * ((t_m * k) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[((-l) * l), $MachinePrecision] / N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(N[(t$95$m * 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 \frac{\left(-\ell\right) \cdot \ell}{\left(t\_m \cdot t\_m\right) \cdot \left(\left(t\_m \cdot k\right) \cdot k\right)}
\end{array}
Initial program 56.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
Applied rewrites31.3%
Applied rewrites32.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 (/ (* l l) (* (* t_m t_m) (* (* t_m k) k)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((t_m * k) * k)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l * l) / ((t_m * t_m) * ((t_m * k) * k)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((t_m * k) * k)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l * l) / ((t_m * t_m) * ((t_m * k) * k)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l * l) / Float64(Float64(t_m * t_m) * Float64(Float64(t_m * k) * k)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l * l) / ((t_m * t_m) * ((t_m * k) * k))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] / N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(N[(t$95$m * 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 \frac{\ell \cdot \ell}{\left(t\_m \cdot t\_m\right) \cdot \left(\left(t\_m \cdot k\right) \cdot k\right)}
\end{array}
Initial program 56.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.7
Applied rewrites58.7%
Applied rewrites58.7%
Applied rewrites59.6%
Applied rewrites59.1%
Final simplification59.1%
herbie shell --seed 2025003
(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))))