
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ 2.0 (/ t_m l))) (t_3 (/ (* (tan k) t_m) l)))
(*
t_s
(if (<= t_m 1.3e-78)
(/ t_2 (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(/
t_2
(* (fma (/ k t_m) (* (/ k t_m) t_3) (* t_3 2.0)) (* (sin k) t_m)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = 2.0 / (t_m / l);
double t_3 = (tan(k) * t_m) / l;
double tmp;
if (t_m <= 1.3e-78) {
tmp = t_2 / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} else {
tmp = t_2 / (fma((k / t_m), ((k / t_m) * t_3), (t_3 * 2.0)) * (sin(k) * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(2.0 / Float64(t_m / l)) t_3 = Float64(Float64(tan(k) * t_m) / l) tmp = 0.0 if (t_m <= 1.3e-78) tmp = Float64(t_2 / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); else tmp = Float64(t_2 / Float64(fma(Float64(k / t_m), Float64(Float64(k / t_m) * t_3), Float64(t_3 * 2.0)) * Float64(sin(k) * t_m))); 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[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Tan[k], $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.3e-78], N[(t$95$2 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(t$95$3 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * t$95$m), $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{2}{\frac{t\_m}{\ell}}\\
t_3 := \frac{\tan k \cdot t\_m}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.3 \cdot 10^{-78}:\\
\;\;\;\;\frac{t\_2}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_2}{\mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m} \cdot t\_3, t\_3 \cdot 2\right) \cdot \left(\sin k \cdot t\_m\right)}\\
\end{array}
\end{array}
\end{array}
if t < 1.3000000000000001e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.3000000000000001e-78 < t Initial program 67.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-/.f6486.8
Applied rewrites86.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 rewrites92.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6489.6
Applied rewrites89.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-/.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-+.f64N/A
distribute-lft-inN/A
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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
1e+306)
(* (/ (/ l (* t_m t_m)) k) (/ l (* 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 ((2.0 / ((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + 1.0))) <= 1e+306) {
tmp = ((l / (t_m * t_m)) / k) * (l / (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 ((2.0d0 / (((((t_m ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t_m) ** 2.0d0)) + 1.0d0))) <= 1d+306) then
tmp = ((l / (t_m * t_m)) / k) * (l / (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 ((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))) <= 1e+306) {
tmp = ((l / (t_m * t_m)) / k) * (l / (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 (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))) <= 1e+306: tmp = ((l / (t_m * t_m)) / k) * (l / (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 (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))) <= 1e+306) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(k * t_m))); else tmp = Float64(Float64(Float64(Float64(l / t_m) * 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))) <= 1e+306) tmp = ((l / (t_m * t_m)) / k) * (l / (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[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], 1e+306], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / t$95$m), $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 10^{+306}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{k \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{t\_m} \cdot \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)))) < 1.00000000000000002e306Initial program 78.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-*.f6467.0
Applied rewrites67.0%
Applied rewrites67.0%
Applied rewrites67.1%
Applied rewrites78.5%
if 1.00000000000000002e306 < (/.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 22.7%
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-*.f6437.7
Applied rewrites37.7%
Applied rewrites37.7%
Applied rewrites41.4%
Applied rewrites52.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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
1e+306)
(* (/ (/ l (* t_m t_m)) k) (/ l (* 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 ((2.0 / ((((pow(t_m, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t_m), 2.0)) + 1.0))) <= 1e+306) {
tmp = ((l / (t_m * t_m)) / k) * (l / (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 ((2.0d0 / (((((t_m ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t_m) ** 2.0d0)) + 1.0d0))) <= 1d+306) then
tmp = ((l / (t_m * t_m)) / k) * (l / (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 ((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))) <= 1e+306) {
tmp = ((l / (t_m * t_m)) / k) * (l / (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 (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))) <= 1e+306: tmp = ((l / (t_m * t_m)) / k) * (l / (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 (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))) <= 1e+306) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(k * t_m))); 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))) <= 1e+306) tmp = ((l / (t_m * t_m)) / k) * (l / (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[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], 1e+306], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $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 10^{+306}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{k \cdot t\_m}\\
\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)))) < 1.00000000000000002e306Initial program 78.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-*.f6467.0
Applied rewrites67.0%
Applied rewrites67.0%
Applied rewrites67.1%
Applied rewrites78.5%
if 1.00000000000000002e306 < (/.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 22.7%
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-*.f6437.7
Applied rewrites37.7%
Applied rewrites37.7%
Applied rewrites41.4%
Applied rewrites52.0%
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) t_m)))
(*
t_s
(if (<= t_m 1.3e-78)
(/ (/ 2.0 (/ t_m l)) (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(if (<= t_m 1.1e+189)
(*
(/
(* (/ 2.0 (* t_2 t_m)) l)
(* (* t_m (+ (pow (/ k t_m) 2.0) 2.0)) (tan k)))
l)
(/
2.0
(* (* (/ t_m l) (* t_m (sin k))) (* (/ 2.0 (cos k)) (/ t_2 l)))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = sin(k) * t_m;
double tmp;
if (t_m <= 1.3e-78) {
tmp = (2.0 / (t_m / l)) / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} else if (t_m <= 1.1e+189) {
tmp = (((2.0 / (t_2 * t_m)) * l) / ((t_m * (pow((k / t_m), 2.0) + 2.0)) * tan(k))) * l;
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((2.0 / cos(k)) * (t_2 / l)));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = sin(k) * t_m
if (t_m <= 1.3d-78) then
tmp = (2.0d0 / (t_m / l)) / ((((sin(k) ** 2.0d0) * k) * k) / (cos(k) * l))
else if (t_m <= 1.1d+189) then
tmp = (((2.0d0 / (t_2 * t_m)) * l) / ((t_m * (((k / t_m) ** 2.0d0) + 2.0d0)) * tan(k))) * l
else
tmp = 2.0d0 / (((t_m / l) * (t_m * sin(k))) * ((2.0d0 / cos(k)) * (t_2 / l)))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = Math.sin(k) * t_m;
double tmp;
if (t_m <= 1.3e-78) {
tmp = (2.0 / (t_m / l)) / (((Math.pow(Math.sin(k), 2.0) * k) * k) / (Math.cos(k) * l));
} else if (t_m <= 1.1e+189) {
tmp = (((2.0 / (t_2 * t_m)) * l) / ((t_m * (Math.pow((k / t_m), 2.0) + 2.0)) * Math.tan(k))) * l;
} else {
tmp = 2.0 / (((t_m / l) * (t_m * Math.sin(k))) * ((2.0 / Math.cos(k)) * (t_2 / l)));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = math.sin(k) * t_m tmp = 0 if t_m <= 1.3e-78: tmp = (2.0 / (t_m / l)) / (((math.pow(math.sin(k), 2.0) * k) * k) / (math.cos(k) * l)) elif t_m <= 1.1e+189: tmp = (((2.0 / (t_2 * t_m)) * l) / ((t_m * (math.pow((k / t_m), 2.0) + 2.0)) * math.tan(k))) * l else: tmp = 2.0 / (((t_m / l) * (t_m * math.sin(k))) * ((2.0 / math.cos(k)) * (t_2 / l))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(sin(k) * t_m) tmp = 0.0 if (t_m <= 1.3e-78) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); elseif (t_m <= 1.1e+189) tmp = Float64(Float64(Float64(Float64(2.0 / Float64(t_2 * t_m)) * l) / Float64(Float64(t_m * Float64((Float64(k / t_m) ^ 2.0) + 2.0)) * tan(k))) * l); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(2.0 / cos(k)) * Float64(t_2 / l)))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = sin(k) * t_m; tmp = 0.0; if (t_m <= 1.3e-78) tmp = (2.0 / (t_m / l)) / ((((sin(k) ^ 2.0) * k) * k) / (cos(k) * l)); elseif (t_m <= 1.1e+189) tmp = (((2.0 / (t_2 * t_m)) * l) / ((t_m * (((k / t_m) ^ 2.0) + 2.0)) * tan(k))) * l; else tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((2.0 / cos(k)) * (t_2 / l))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.3e-78], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.1e+189], N[(N[(N[(N[(2.0 / N[(t$95$2 * t$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[(t$95$m * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sin k \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.3 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{elif}\;t\_m \leq 1.1 \cdot 10^{+189}:\\
\;\;\;\;\frac{\frac{2}{t\_2 \cdot t\_m} \cdot \ell}{\left(t\_m \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right) \cdot \tan k} \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m}{\ell} \cdot \left(t\_m \cdot \sin k\right)\right) \cdot \left(\frac{2}{\cos k} \cdot \frac{t\_2}{\ell}\right)}\\
\end{array}
\end{array}
\end{array}
if t < 1.3000000000000001e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.3000000000000001e-78 < t < 1.10000000000000003e189Initial program 72.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-/.f6484.7
Applied rewrites84.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 rewrites90.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites83.4%
if 1.10000000000000003e189 < t Initial program 53.1%
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-/.f6493.9
Applied rewrites93.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 rewrites99.6%
Taylor expanded in t around inf
associate-*r/N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.6
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 (<= t_m 1.26e-78)
(/ (/ 2.0 (/ t_m l)) (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(/
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 <= 1.26e-78) {
tmp = (2.0 / (t_m / l)) / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} 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 <= 1.26d-78) then
tmp = (2.0d0 / (t_m / l)) / ((((sin(k) ** 2.0d0) * k) * k) / (cos(k) * l))
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 <= 1.26e-78) {
tmp = (2.0 / (t_m / l)) / (((Math.pow(Math.sin(k), 2.0) * k) * k) / (Math.cos(k) * l));
} 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 <= 1.26e-78: tmp = (2.0 / (t_m / l)) / (((math.pow(math.sin(k), 2.0) * k) * k) / (math.cos(k) * l)) 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 <= 1.26e-78) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); 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 <= 1.26e-78) tmp = (2.0 / (t_m / l)) / ((((sin(k) ^ 2.0) * k) * k) / (cos(k) * l)); 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, 1.26e-78], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * 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[(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 1.26 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \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(\tan k \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right)\right)}\\
\end{array}
\end{array}
if t < 1.26000000000000008e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.26000000000000008e-78 < t Initial program 67.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-/.f6486.8
Applied rewrites86.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 rewrites92.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 1.26e-78)
(/ (/ 2.0 (/ t_m l)) (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(/
2.0
(*
(* (+ (pow (/ k t_m) 2.0) 2.0) (* (* (* (tan k) t_m) (sin k)) (/ t_m l)))
(/ t_m l))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.26e-78) {
tmp = (2.0 / (t_m / l)) / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} else {
tmp = 2.0 / (((pow((k / t_m), 2.0) + 2.0) * (((tan(k) * t_m) * sin(k)) * (t_m / l))) * (t_m / l));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 1.26d-78) then
tmp = (2.0d0 / (t_m / l)) / ((((sin(k) ** 2.0d0) * k) * k) / (cos(k) * l))
else
tmp = 2.0d0 / (((((k / t_m) ** 2.0d0) + 2.0d0) * (((tan(k) * t_m) * sin(k)) * (t_m / l))) * (t_m / l))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.26e-78) {
tmp = (2.0 / (t_m / l)) / (((Math.pow(Math.sin(k), 2.0) * k) * k) / (Math.cos(k) * l));
} else {
tmp = 2.0 / (((Math.pow((k / t_m), 2.0) + 2.0) * (((Math.tan(k) * t_m) * Math.sin(k)) * (t_m / l))) * (t_m / l));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 1.26e-78: tmp = (2.0 / (t_m / l)) / (((math.pow(math.sin(k), 2.0) * k) * k) / (math.cos(k) * l)) else: tmp = 2.0 / (((math.pow((k / t_m), 2.0) + 2.0) * (((math.tan(k) * t_m) * math.sin(k)) * (t_m / l))) * (t_m / l)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1.26e-78) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); else tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k / t_m) ^ 2.0) + 2.0) * Float64(Float64(Float64(tan(k) * t_m) * sin(k)) * Float64(t_m / l))) * Float64(t_m / l))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 1.26e-78) tmp = (2.0 / (t_m / l)) / ((((sin(k) ^ 2.0) * k) * k) / (cos(k) * l)); else tmp = 2.0 / (((((k / t_m) ^ 2.0) + 2.0) * (((tan(k) * t_m) * sin(k)) * (t_m / l))) * (t_m / l)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.26e-78], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision] * N[(N[(N[(N[Tan[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l), $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.26 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right) \cdot \left(\left(\left(\tan k \cdot t\_m\right) \cdot \sin k\right) \cdot \frac{t\_m}{\ell}\right)\right) \cdot \frac{t\_m}{\ell}}\\
\end{array}
\end{array}
if t < 1.26000000000000008e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.26000000000000008e-78 < t Initial program 67.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-/.f6486.8
Applied rewrites86.8%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
Applied rewrites87.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 1.3e-78)
(/ (/ 2.0 (/ t_m l)) (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(*
(/
(* (/ 2.0 (* (* (sin k) t_m) t_m)) l)
(* (* t_m (+ (pow (/ k t_m) 2.0) 2.0)) (tan 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 (t_m <= 1.3e-78) {
tmp = (2.0 / (t_m / l)) / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} else {
tmp = (((2.0 / ((sin(k) * t_m) * t_m)) * l) / ((t_m * (pow((k / t_m), 2.0) + 2.0)) * tan(k))) * l;
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 1.3d-78) then
tmp = (2.0d0 / (t_m / l)) / ((((sin(k) ** 2.0d0) * k) * k) / (cos(k) * l))
else
tmp = (((2.0d0 / ((sin(k) * t_m) * t_m)) * l) / ((t_m * (((k / t_m) ** 2.0d0) + 2.0d0)) * tan(k))) * l
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.3e-78) {
tmp = (2.0 / (t_m / l)) / (((Math.pow(Math.sin(k), 2.0) * k) * k) / (Math.cos(k) * l));
} else {
tmp = (((2.0 / ((Math.sin(k) * t_m) * t_m)) * l) / ((t_m * (Math.pow((k / t_m), 2.0) + 2.0)) * Math.tan(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 t_m <= 1.3e-78: tmp = (2.0 / (t_m / l)) / (((math.pow(math.sin(k), 2.0) * k) * k) / (math.cos(k) * l)) else: tmp = (((2.0 / ((math.sin(k) * t_m) * t_m)) * l) / ((t_m * (math.pow((k / t_m), 2.0) + 2.0)) * math.tan(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 (t_m <= 1.3e-78) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); else tmp = Float64(Float64(Float64(Float64(2.0 / Float64(Float64(sin(k) * t_m) * t_m)) * l) / Float64(Float64(t_m * Float64((Float64(k / t_m) ^ 2.0) + 2.0)) * tan(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 (t_m <= 1.3e-78) tmp = (2.0 / (t_m / l)) / ((((sin(k) ^ 2.0) * k) * k) / (cos(k) * l)); else tmp = (((2.0 / ((sin(k) * t_m) * t_m)) * l) / ((t_m * (((k / t_m) ^ 2.0) + 2.0)) * tan(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[t$95$m, 1.3e-78], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[(t$95$m * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $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.3 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\left(\sin k \cdot t\_m\right) \cdot t\_m} \cdot \ell}{\left(t\_m \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right) \cdot \tan k} \cdot \ell\\
\end{array}
\end{array}
if t < 1.3000000000000001e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.3000000000000001e-78 < t Initial program 67.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-/.f6486.8
Applied rewrites86.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 rewrites92.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites83.3%
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 (+ (pow (/ k t_m) 2.0) 2.0)) (t_3 (/ 2.0 (/ t_m l))))
(*
t_s
(if (<= t_m 1.52e-78)
(/ t_3 (/ (* (* (pow (sin k) 2.0) k) k) (* (cos k) l)))
(if (<= t_m 1.25e+16)
(/ 2.0 (* (* k (/ (* t_m t_m) l)) (* (/ t_m l) (* (tan k) t_2))))
(if (<= t_m 3.5e+163)
(/
2.0
(*
(* (* (* (tan k) (sin k)) t_m) (* (/ t_m l) (/ t_m l)))
(fma (/ k t_m) (/ k t_m) 2.0)))
(/ t_3 (* (* (* (/ t_m l) k) t_2) (* (sin k) t_m)))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = pow((k / t_m), 2.0) + 2.0;
double t_3 = 2.0 / (t_m / l);
double tmp;
if (t_m <= 1.52e-78) {
tmp = t_3 / (((pow(sin(k), 2.0) * k) * k) / (cos(k) * l));
} else if (t_m <= 1.25e+16) {
tmp = 2.0 / ((k * ((t_m * t_m) / l)) * ((t_m / l) * (tan(k) * t_2)));
} else if (t_m <= 3.5e+163) {
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 = t_3 / ((((t_m / l) * k) * t_2) * (sin(k) * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64((Float64(k / t_m) ^ 2.0) + 2.0) t_3 = Float64(2.0 / Float64(t_m / l)) tmp = 0.0 if (t_m <= 1.52e-78) tmp = Float64(t_3 / Float64(Float64(Float64((sin(k) ^ 2.0) * k) * k) / Float64(cos(k) * l))); elseif (t_m <= 1.25e+16) tmp = Float64(2.0 / Float64(Float64(k * Float64(Float64(t_m * t_m) / l)) * Float64(Float64(t_m / l) * Float64(tan(k) * t_2)))); elseif (t_m <= 3.5e+163) 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(t_3 / Float64(Float64(Float64(Float64(t_m / l) * k) * t_2) * Float64(sin(k) * t_m))); 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[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.52e-78], N[(t$95$3 / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.25e+16], 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] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 3.5e+163], 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[(t$95$3 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * k), $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * t$95$m), $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 := {\left(\frac{k}{t\_m}\right)}^{2} + 2\\
t_3 := \frac{2}{\frac{t\_m}{\ell}}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.52 \cdot 10^{-78}:\\
\;\;\;\;\frac{t\_3}{\frac{\left({\sin k}^{2} \cdot k\right) \cdot k}{\cos k \cdot \ell}}\\
\mathbf{elif}\;t\_m \leq 1.25 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{\left(k \cdot \frac{t\_m \cdot t\_m}{\ell}\right) \cdot \left(\frac{t\_m}{\ell} \cdot \left(\tan k \cdot t\_2\right)\right)}\\
\mathbf{elif}\;t\_m \leq 3.5 \cdot 10^{+163}:\\
\;\;\;\;\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{t\_3}{\left(\left(\frac{t\_m}{\ell} \cdot k\right) \cdot t\_2\right) \cdot \left(\sin k \cdot t\_m\right)}\\
\end{array}
\end{array}
\end{array}
if t < 1.52e-78Initial program 48.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-/.f6472.3
Applied rewrites72.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 rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.0
Applied rewrites79.0%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f6471.5
Applied rewrites71.5%
if 1.52e-78 < t < 1.25e16Initial program 76.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-/.f6476.7
Applied rewrites76.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 rewrites88.6%
Taylor expanded in k around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6486.0
Applied rewrites86.0%
if 1.25e16 < t < 3.5000000000000003e163Initial program 68.9%
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-/.f6485.2
Applied rewrites85.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6485.2
Applied rewrites85.2%
if 3.5000000000000003e163 < t Initial program 57.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-/.f6495.1
Applied rewrites95.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 rewrites99.7%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.6
Applied rewrites99.5%
Taylor expanded in k around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6491.1
Applied rewrites91.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 2e-64)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 11000.0)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(* (* 2.0 (* l l)) (/ (cos k) (* (* (* (pow (sin k) 2.0) 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 (k <= 2e-64) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 11000.0) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else {
tmp = (2.0 * (l * l)) * (cos(k) / (((pow(sin(k), 2.0) * 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 (k <= 2e-64) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); elseif (k <= 11000.0) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); else tmp = Float64(Float64(2.0 * Float64(l * l)) * Float64(cos(k) / Float64(Float64(Float64((sin(k) ^ 2.0) * t_m) * k) * 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[k, 2e-64], 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], If[LessEqual[k, 11000.0], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision] * 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}\;k \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\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{elif}\;k \leq 11000:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\cos k}{\left(\left({\sin k}^{2} \cdot t\_m\right) \cdot k\right) \cdot k}\\
\end{array}
\end{array}
if k < 1.99999999999999993e-64Initial program 56.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-/.f6480.7
Applied rewrites80.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 rewrites86.9%
Taylor expanded in k around 0
lower-*.f6476.6
Applied rewrites76.6%
if 1.99999999999999993e-64 < k < 11000Initial program 69.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-/.f6481.5
Applied rewrites81.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 rewrites81.5%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6487.6
Applied rewrites87.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
if 11000 < k Initial program 44.1%
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-/.f6465.1
Applied rewrites65.1%
Taylor expanded in t around 0
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6470.2
Applied rewrites70.2%
Final simplification76.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 2e-64)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 3.2e-19)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(/
2.0
(*
(* (* (* (tan k) (sin k)) t_m) (* (/ 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 (k <= 2e-64) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 3.2e-19) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else {
tmp = 2.0 / ((((tan(k) * sin(k)) * t_m) * ((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 (k <= 2e-64) tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(t_m / l) * Float64(2.0 * k)))); elseif (k <= 3.2e-19) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); else 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))); 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[k, 2e-64], 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], If[LessEqual[k, 3.2e-19], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]), $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 2 \cdot 10^{-64}:\\
\;\;\;\;\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{elif}\;k \leq 3.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if k < 1.99999999999999993e-64Initial program 56.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-/.f6480.7
Applied rewrites80.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 rewrites86.9%
Taylor expanded in k around 0
lower-*.f6476.6
Applied rewrites76.6%
if 1.99999999999999993e-64 < k < 3.19999999999999982e-19Initial program 44.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-/.f6467.1
Applied rewrites67.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 rewrites67.1%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6478.0
Applied rewrites78.0%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
if 3.19999999999999982e-19 < k Initial program 49.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-/.f6468.2
Applied rewrites68.2%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
metadata-evalN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6468.2
Applied rewrites68.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 8e-116)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(/
2.0
(*
(* (/ t_m l) (* t_m (sin k)))
(*
(/
(fma
(* (* k k) t_m)
(+ 0.6666666666666666 (pow (* t_m t_m) -1.0))
(* 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 <= 8e-116) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((fma(((k * k) * t_m), (0.6666666666666666 + pow((t_m * t_m), -1.0)), (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 <= 8e-116) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m / l) * Float64(t_m * sin(k))) * Float64(Float64(fma(Float64(Float64(k * k) * t_m), Float64(0.6666666666666666 + (Float64(t_m * t_m) ^ -1.0)), 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, 8e-116], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $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[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(0.6666666666666666 + N[Power[N[(t$95$m * t$95$m), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] + 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 8 \cdot 10^{-116}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\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(k \cdot k\right) \cdot t\_m, 0.6666666666666666 + {\left(t\_m \cdot t\_m\right)}^{-1}, 2 \cdot t\_m\right)}{\ell} \cdot k\right)}\\
\end{array}
\end{array}
if t < 8e-116Initial program 48.1%
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-/.f6472.3
Applied rewrites72.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 rewrites77.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.2
Applied rewrites79.3%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.7%
if 8e-116 < t Initial program 67.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-/.f6485.5
Applied rewrites85.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 rewrites91.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.7%
Final simplification70.1%
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) t_m)))
(*
t_s
(if (<= l 4.8e+86)
(/
(/ 2.0 (/ t_m l))
(* (* (* (/ t_m l) k) (+ (pow (/ k t_m) 2.0) 2.0)) t_2))
(/ 2.0 (* (* (* t_2 (* (/ 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) * t_m;
double tmp;
if (l <= 4.8e+86) {
tmp = (2.0 / (t_m / l)) / ((((t_m / l) * k) * (pow((k / t_m), 2.0) + 2.0)) * t_2);
} else {
tmp = 2.0 / (((t_2 * ((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) * t_m
if (l <= 4.8d+86) then
tmp = (2.0d0 / (t_m / l)) / ((((t_m / l) * k) * (((k / t_m) ** 2.0d0) + 2.0d0)) * t_2)
else
tmp = 2.0d0 / (((t_2 * ((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) * t_m;
double tmp;
if (l <= 4.8e+86) {
tmp = (2.0 / (t_m / l)) / ((((t_m / l) * k) * (Math.pow((k / t_m), 2.0) + 2.0)) * t_2);
} else {
tmp = 2.0 / (((t_2 * ((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) * t_m tmp = 0 if l <= 4.8e+86: tmp = (2.0 / (t_m / l)) / ((((t_m / l) * k) * (math.pow((k / t_m), 2.0) + 2.0)) * t_2) else: tmp = 2.0 / (((t_2 * ((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) * t_m) tmp = 0.0 if (l <= 4.8e+86) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(Float64(Float64(t_m / l) * k) * Float64((Float64(k / t_m) ^ 2.0) + 2.0)) * t_2)); else tmp = Float64(2.0 / Float64(Float64(Float64(t_2 * 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) * t_m; tmp = 0.0; if (l <= 4.8e+86) tmp = (2.0 / (t_m / l)) / ((((t_m / l) * k) * (((k / t_m) ^ 2.0) + 2.0)) * t_2); else tmp = 2.0 / (((t_2 * ((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] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 4.8e+86], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * k), $MachinePrecision] * N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$2 * 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 := \sin k \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 4.8 \cdot 10^{+86}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\left(\left(\frac{t\_m}{\ell} \cdot k\right) \cdot \left({\left(\frac{k}{t\_m}\right)}^{2} + 2\right)\right) \cdot t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(t\_2 \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 l < 4.8000000000000001e86Initial program 59.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-/.f6479.2
Applied rewrites79.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 rewrites83.8%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6484.6
Applied rewrites84.6%
Taylor expanded in k around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f6478.9
Applied rewrites78.9%
if 4.8000000000000001e86 < l Initial program 28.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-/.f6463.0
Applied rewrites63.0%
Taylor expanded in t around inf
Applied rewrites64.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.7e-105)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(/
2.0
(*
(* (/ t_m l) (* t_m (sin k)))
(*
(/ t_m l)
(*
(fma (+ 0.6666666666666666 (pow (* t_m t_m) -1.0)) (* 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 <= 5.7e-105) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (fma((0.6666666666666666 + pow((t_m * t_m), -1.0)), (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 <= 5.7e-105) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); 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(t_m * t_m) ^ -1.0)), 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, 5.7e-105], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $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[Power[N[(t$95$m * t$95$m), $MachinePrecision], -1.0], $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 5.7 \cdot 10^{-105}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot 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(\mathsf{fma}\left(0.6666666666666666 + {\left(t\_m \cdot t\_m\right)}^{-1}, k \cdot k, 2\right) \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 5.69999999999999963e-105Initial program 48.1%
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-/.f6472.6
Applied rewrites72.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 rewrites77.3%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.5
Applied rewrites79.5%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.1%
if 5.69999999999999963e-105 < t Initial program 67.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-/.f6485.2
Applied rewrites85.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 rewrites90.8%
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-*.f6481.3
Applied rewrites81.3%
Final simplification70.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 1.8e-78)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(/
2.0
(*
(* (/ (* t_m t_m) l) k)
(*
(/
(fma
(* (* k k) t_m)
(+ 0.6666666666666666 (pow (* t_m t_m) -1.0))
(* 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 <= 1.8e-78) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else {
tmp = 2.0 / ((((t_m * t_m) / l) * k) * ((fma(((k * k) * t_m), (0.6666666666666666 + pow((t_m * t_m), -1.0)), (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 <= 1.8e-78) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * t_m) / l) * k) * Float64(Float64(fma(Float64(Float64(k * k) * t_m), Float64(0.6666666666666666 + (Float64(t_m * t_m) ^ -1.0)), 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, 1.8e-78], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision] * k), $MachinePrecision] * N[(N[(N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(0.6666666666666666 + N[Power[N[(t$95$m * t$95$m), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] + 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 1.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{t\_m \cdot t\_m}{\ell} \cdot k\right) \cdot \left(\frac{\mathsf{fma}\left(\left(k \cdot k\right) \cdot t\_m, 0.6666666666666666 + {\left(t\_m \cdot t\_m\right)}^{-1}, 2 \cdot t\_m\right)}{\ell} \cdot k\right)}\\
\end{array}
\end{array}
if t < 1.8000000000000001e-78Initial program 48.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-/.f6472.0
Applied rewrites72.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 rewrites77.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.2%
if 1.8000000000000001e-78 < t Initial program 68.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-/.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 rewrites92.7%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites82.4%
Taylor expanded in k around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6476.2
Applied rewrites76.2%
Final simplification68.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 2e-64)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 2e-64) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 2e-64) 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(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * 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[k, 2e-64], 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[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\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{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.99999999999999993e-64Initial program 56.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-/.f6480.7
Applied rewrites80.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 rewrites86.9%
Taylor expanded in k around 0
lower-*.f6476.6
Applied rewrites76.6%
if 1.99999999999999993e-64 < k Initial program 48.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.1
Applied rewrites68.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 rewrites70.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.1
Applied rewrites75.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.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 6.5e-75)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(if (<= t_m 1.1e+115)
(/ (* l (/ (/ (/ l k) k) t_m)) (* t_m t_m))
(/ (pow (/ l t_m) 2.0) (* (* 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 <= 6.5e-75) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else if (t_m <= 1.1e+115) {
tmp = (l * (((l / k) / k) / t_m)) / (t_m * t_m);
} else {
tmp = pow((l / t_m), 2.0) / ((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 <= 6.5e-75) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); elseif (t_m <= 1.1e+115) tmp = Float64(Float64(l * Float64(Float64(Float64(l / k) / k) / t_m)) / Float64(t_m * t_m)); else tmp = Float64((Float64(l / t_m) ^ 2.0) / Float64(Float64(t_m * k) * 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.5e-75], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.1e+115], N[(N[(l * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(l / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[(N[(t$95$m * k), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{elif}\;t\_m \leq 1.1 \cdot 10^{+115}:\\
\;\;\;\;\frac{\ell \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\frac{\ell}{t\_m}\right)}^{2}}{\left(t\_m \cdot k\right) \cdot k}\\
\end{array}
\end{array}
if t < 6.5000000000000002e-75Initial program 48.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-/.f6472.0
Applied rewrites72.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 rewrites77.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.2%
if 6.5000000000000002e-75 < t < 1.1e115Initial program 80.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-*.f6468.7
Applied rewrites68.7%
Applied rewrites68.8%
Applied rewrites70.9%
Applied rewrites78.5%
if 1.1e115 < t Initial program 54.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-*.f6446.4
Applied rewrites46.4%
Applied rewrites46.4%
Applied rewrites56.1%
Applied rewrites85.5%
Final simplification69.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 6.5e-75)
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))
(if (<= t_m 7.5e+118)
(/ (* l (/ (/ (/ l k) k) t_m)) (* t_m t_m))
(/ (* (/ l t_m) l) (pow (* 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 <= 6.5e-75) {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
} else if (t_m <= 7.5e+118) {
tmp = (l * (((l / k) / k) / t_m)) / (t_m * t_m);
} else {
tmp = ((l / t_m) * l) / pow((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 <= 6.5e-75) tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * k))); elseif (t_m <= 7.5e+118) tmp = Float64(Float64(l * Float64(Float64(Float64(l / k) / k) / t_m)) / Float64(t_m * t_m)); else tmp = Float64(Float64(Float64(l / t_m) * l) / (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, 6.5e-75], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 7.5e+118], N[(N[(l * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[Power[N[(k * t$95$m), $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 6.5 \cdot 10^{-75}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\mathbf{elif}\;t\_m \leq 7.5 \cdot 10^{+118}:\\
\;\;\;\;\frac{\ell \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{{\left(k \cdot t\_m\right)}^{2}}\\
\end{array}
\end{array}
if t < 6.5000000000000002e-75Initial program 48.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-/.f6472.0
Applied rewrites72.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 rewrites77.0%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.1
Applied rewrites79.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.2%
if 6.5000000000000002e-75 < t < 7.50000000000000003e118Initial program 80.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-*.f6468.7
Applied rewrites68.7%
Applied rewrites68.8%
Applied rewrites70.9%
Applied rewrites78.5%
if 7.50000000000000003e118 < t Initial program 54.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-*.f6446.4
Applied rewrites46.4%
Applied rewrites46.4%
Applied rewrites56.1%
Applied rewrites82.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 2.15e-177)
(* (/ (/ l (* t_m t_m)) k) (/ l (* k t_m)))
(if (<= k 1.95e-64)
(/ (* (/ l t_m) (/ l t_m)) (* t_m (* k k)))
(/
(/ 2.0 (/ t_m l))
(*
(/
(fma
(* (fma 0.3333333333333333 (* t_m t_m) 1.0) k)
k
(* (* 2.0 t_m) t_m))
l)
(* k k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 2.15e-177) {
tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m));
} else if (k <= 1.95e-64) {
tmp = ((l / t_m) * (l / t_m)) / (t_m * (k * k));
} else {
tmp = (2.0 / (t_m / l)) / ((fma((fma(0.3333333333333333, (t_m * t_m), 1.0) * k), k, ((2.0 * t_m) * t_m)) / l) * (k * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 2.15e-177) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(k * t_m))); elseif (k <= 1.95e-64) tmp = Float64(Float64(Float64(l / t_m) * Float64(l / t_m)) / Float64(t_m * Float64(k * k))); else tmp = Float64(Float64(2.0 / Float64(t_m / l)) / Float64(Float64(fma(Float64(fma(0.3333333333333333, Float64(t_m * t_m), 1.0) * k), k, Float64(Float64(2.0 * t_m) * t_m)) / l) * Float64(k * 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[k, 2.15e-177], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.95e-64], 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], N[(N[(2.0 / N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(0.3333333333333333 * N[(t$95$m * t$95$m), $MachinePrecision] + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(2.0 * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 2.15 \cdot 10^{-177}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{k \cdot t\_m}\\
\mathbf{elif}\;k \leq 1.95 \cdot 10^{-64}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\ell}{t\_m}}{t\_m \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\frac{t\_m}{\ell}}}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, t\_m \cdot t\_m, 1\right) \cdot k, k, \left(2 \cdot t\_m\right) \cdot t\_m\right)}{\ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 2.1500000000000001e-177Initial program 55.7%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6453.9
Applied rewrites53.9%
Applied rewrites53.9%
Applied rewrites55.3%
Applied rewrites66.0%
if 2.1500000000000001e-177 < k < 1.9499999999999998e-64Initial 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-*.f6473.2
Applied rewrites73.2%
Applied rewrites73.3%
Applied rewrites87.2%
Applied rewrites96.9%
if 1.9499999999999998e-64 < k Initial program 48.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.1
Applied rewrites68.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 rewrites70.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6475.1
Applied rewrites75.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites66.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 (<= (* l l) 2e-179)
(/ (* (/ l t_m) (/ (/ (/ l k) k) t_m)) t_m)
(if (<= (* l l) 5e+74)
(/ (* (/ l (* t_m t_m)) (/ l k)) (* 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 * l) <= 2e-179) {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
} else if ((l * l) <= 5e+74) {
tmp = ((l / (t_m * t_m)) * (l / k)) / (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 * l) <= 2d-179) then
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m
else if ((l * l) <= 5d+74) then
tmp = ((l / (t_m * t_m)) * (l / k)) / (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 * l) <= 2e-179) {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
} else if ((l * l) <= 5e+74) {
tmp = ((l / (t_m * t_m)) * (l / k)) / (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 * l) <= 2e-179: tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m elif (l * l) <= 5e+74: tmp = ((l / (t_m * t_m)) * (l / k)) / (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(l * l) <= 2e-179) tmp = Float64(Float64(Float64(l / t_m) * Float64(Float64(Float64(l / k) / k) / t_m)) / t_m); elseif (Float64(l * l) <= 5e+74) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) * Float64(l / k)) / 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 ((l * l) <= 2e-179) tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m; elseif ((l * l) <= 5e+74) tmp = ((l / (t_m * t_m)) * (l / k)) / (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[(l * l), $MachinePrecision], 2e-179], 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], If[LessEqual[N[(l * l), $MachinePrecision], 5e+74], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * k), $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}\;\ell \cdot \ell \leq 2 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m}\\
\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m} \cdot \frac{\ell}{k}}{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 l l) < 2e-179Initial program 54.7%
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.5
Applied rewrites58.5%
Applied rewrites58.5%
Applied rewrites56.5%
Applied rewrites82.4%
if 2e-179 < (*.f64 l l) < 4.99999999999999963e74Initial program 71.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-*.f6460.2
Applied rewrites60.2%
Applied rewrites60.2%
Applied rewrites73.5%
if 4.99999999999999963e74 < (*.f64 l l) Initial program 44.7%
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-*.f6447.9
Applied rewrites47.9%
Applied rewrites47.9%
Applied rewrites52.5%
Applied rewrites60.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 6.5e+90)
(* (/ (/ l (* t_m t_m)) k) (/ l (* k t_m)))
(/ (* (/ (- l) k) l) (* t_m (* (* 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 <= 6.5e+90) {
tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m));
} else {
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5d+90) then
tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m))
else
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90) {
tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m));
} else {
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90: tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m)) else: tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) / k) * Float64(l / Float64(k * t_m))); else tmp = Float64(Float64(Float64(Float64(-l) / k) * l) / Float64(t_m * Float64(Float64(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 <= 6.5e+90) tmp = ((l / (t_m * t_m)) / k) * (l / (k * t_m)); else tmp = ((-l / k) * l) / (t_m * ((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, 6.5e+90], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] * N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-l) / k), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 6.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m}}{k} \cdot \frac{\ell}{k \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-\ell}{k} \cdot \ell}{t\_m \cdot \left(\left(k \cdot t\_m\right) \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 6.5000000000000001e90Initial program 56.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-*.f6456.9
Applied rewrites56.9%
Applied rewrites56.9%
Applied rewrites59.3%
Applied rewrites66.7%
if 6.5000000000000001e90 < k Initial program 39.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-*.f6441.0
Applied rewrites41.0%
Applied rewrites45.5%
Applied rewrites47.9%
Final simplification63.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 6.5e+90)
(/ (* (/ l (* t_m t_m)) l) (* (* k t_m) k))
(/ (* (/ (- l) k) l) (* t_m (* (* 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 <= 6.5e+90) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5d+90) then
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k)
else
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90: tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k) else: tmp = ((-l / k) * l) / (t_m * ((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 <= 6.5e+90) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) * l) / Float64(Float64(k * t_m) * k)); else tmp = Float64(Float64(Float64(Float64(-l) / k) * l) / Float64(t_m * Float64(Float64(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 <= 6.5e+90) tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k); else tmp = ((-l / k) * l) / (t_m * ((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, 6.5e+90], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[((-l) / k), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 6.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m} \cdot \ell}{\left(k \cdot t\_m\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-\ell}{k} \cdot \ell}{t\_m \cdot \left(\left(k \cdot t\_m\right) \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 6.5000000000000001e90Initial program 56.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-*.f6456.9
Applied rewrites56.9%
Applied rewrites56.9%
Applied rewrites59.3%
Applied rewrites63.9%
if 6.5000000000000001e90 < k Initial program 39.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-*.f6441.0
Applied rewrites41.0%
Applied rewrites45.5%
Applied rewrites47.9%
Final simplification61.3%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 6.6e+90)
(/ (* (/ l (* t_m t_m)) l) (* (* k t_m) k))
(* (/ (- l) (* (* t_m t_m) t_m)) (/ l (* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 6.6e+90) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = (-l / ((t_m * t_m) * t_m)) * (l / (k * k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 6.6d+90) then
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k)
else
tmp = (-l / ((t_m * t_m) * t_m)) * (l / (k * k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 6.6e+90) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = (-l / ((t_m * t_m) * t_m)) * (l / (k * k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 6.6e+90: tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k) else: tmp = (-l / ((t_m * t_m) * t_m)) * (l / (k * k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 6.6e+90) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) * l) / Float64(Float64(k * t_m) * k)); else tmp = Float64(Float64(Float64(-l) / Float64(Float64(t_m * t_m) * t_m)) * Float64(l / Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 6.6e+90) tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k); else tmp = (-l / ((t_m * t_m) * t_m)) * (l / (k * k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 6.6e+90], N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[((-l) / N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 6.6 \cdot 10^{+90}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m} \cdot \ell}{\left(k \cdot t\_m\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{-\ell}{\left(t\_m \cdot t\_m\right) \cdot t\_m} \cdot \frac{\ell}{k \cdot k}\\
\end{array}
\end{array}
if k < 6.60000000000000016e90Initial program 56.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-*.f6456.9
Applied rewrites56.9%
Applied rewrites56.9%
Applied rewrites59.3%
Applied rewrites63.9%
if 6.60000000000000016e90 < k Initial program 39.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-*.f6441.0
Applied rewrites41.0%
Applied rewrites43.0%
Final simplification60.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 (* t_m t_m)) l) (* (* k t_m) k))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (((l / (t_m * t_m)) * l) / ((k * t_m) * k));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (((l / (t_m * t_m)) * l) / ((k * t_m) * k))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (((l / (t_m * t_m)) * l) / ((k * t_m) * k));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (((l / (t_m * t_m)) * l) / ((k * t_m) * k))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(Float64(l / Float64(t_m * t_m)) * l) / Float64(Float64(k * t_m) * k))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (((l / (t_m * t_m)) * l) / ((k * t_m) * k)); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\frac{\ell}{t\_m \cdot t\_m} \cdot \ell}{\left(k \cdot t\_m\right) \cdot k}
\end{array}
Initial program 54.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-*.f6454.3
Applied rewrites54.3%
Applied rewrites54.3%
Applied rewrites56.0%
Applied rewrites59.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)) (* (* k k) t_m)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (l * ((l / (t_m * t_m)) / ((k * k) * t_m)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (l * ((l / (t_m * t_m)) / ((k * k) * t_m)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (l * ((l / (t_m * t_m)) / ((k * k) * t_m)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (l * ((l / (t_m * t_m)) / ((k * k) * t_m)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(l * Float64(Float64(l / Float64(t_m * t_m)) / Float64(Float64(k * k) * t_m)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (l * ((l / (t_m * t_m)) / ((k * k) * t_m))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(l * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\ell \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{\left(k \cdot k\right) \cdot t\_m}\right)
\end{array}
Initial program 54.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-*.f6454.3
Applied rewrites54.3%
Applied rewrites54.3%
Applied rewrites56.0%
Applied rewrites56.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) (* (* k k) t_m)))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((k * k) * t_m)));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l * l) / ((t_m * t_m) * ((k * k) * t_m)))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l * l) / ((t_m * t_m) * ((k * k) * t_m)));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l * l) / ((t_m * t_m) * ((k * k) * t_m)))
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l * l) / Float64(Float64(t_m * t_m) * Float64(Float64(k * k) * t_m)))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l * l) / ((t_m * t_m) * ((k * k) * t_m))); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l * l), $MachinePrecision] / N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{\ell \cdot \ell}{\left(t\_m \cdot t\_m\right) \cdot \left(\left(k \cdot k\right) \cdot t\_m\right)}
\end{array}
Initial program 54.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-*.f6454.3
Applied rewrites54.3%
Applied rewrites54.3%
Applied rewrites56.0%
Applied rewrites49.9%
herbie shell --seed 2024358
(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))))