
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 2.2e-41)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ l (pow (sin k) 2.0)) (* k t_m)))
(/
2.0
(*
(* (* (/ t_m l) (sin k)) t_m)
(* (/ t_m l) (* (tan k) (+ (pow (/ k t_m) 2.0) 2.0))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.2e-41) {
tmp = (((cos(k) * l) * 2.0) / k) * ((l / pow(sin(k), 2.0)) / (k * t_m));
} else {
tmp = 2.0 / ((((t_m / l) * sin(k)) * t_m) * ((t_m / l) * (tan(k) * (pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 2.2d-41) then
tmp = (((cos(k) * l) * 2.0d0) / k) * ((l / (sin(k) ** 2.0d0)) / (k * t_m))
else
tmp = 2.0d0 / ((((t_m / l) * sin(k)) * t_m) * ((t_m / l) * (tan(k) * (((k / t_m) ** 2.0d0) + 2.0d0))))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 2.2e-41) {
tmp = (((Math.cos(k) * l) * 2.0) / k) * ((l / Math.pow(Math.sin(k), 2.0)) / (k * t_m));
} else {
tmp = 2.0 / ((((t_m / l) * Math.sin(k)) * t_m) * ((t_m / l) * (Math.tan(k) * (Math.pow((k / t_m), 2.0) + 2.0))));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 2.2e-41: tmp = (((math.cos(k) * l) * 2.0) / k) * ((l / math.pow(math.sin(k), 2.0)) / (k * t_m)) else: tmp = 2.0 / ((((t_m / l) * math.sin(k)) * t_m) * ((t_m / l) * (math.tan(k) * (math.pow((k / t_m), 2.0) + 2.0)))) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 2.2e-41) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(l / (sin(k) ^ 2.0)) / Float64(k * t_m))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * sin(k)) * t_m) * 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 <= 2.2e-41) tmp = (((cos(k) * l) * 2.0) / k) * ((l / (sin(k) ^ 2.0)) / (k * t_m)); else tmp = 2.0 / ((((t_m / l) * sin(k)) * t_m) * ((t_m / l) * (tan(k) * (((k / t_m) ^ 2.0) + 2.0)))); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 2.2e-41], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $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 2.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{k \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\ell} \cdot \sin k\right) \cdot t\_m\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 < 2.2e-41Initial program 50.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6463.1
Applied rewrites63.1%
Applied rewrites71.9%
Applied rewrites78.8%
if 2.2e-41 < t Initial program 63.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-/.f6484.8
Applied rewrites84.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 rewrites93.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6493.9
Applied rewrites93.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 (<=
(/
2.0
(*
(* (* (/ (pow t_m 3.0) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (pow (/ k t_m) 2.0)) 1.0)))
5e+140)
(/ (* (/ l k) l) (* (* k (* t_m t_m)) t_m))
(/ (* (/ l t_m) l) (* 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) {
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))) <= 5e+140) {
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if ((2.0d0 / (((((t_m ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t_m) ** 2.0d0)) + 1.0d0))) <= 5d+140) then
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m)
else
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if ((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))) <= 5e+140) {
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if (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))) <= 5e+140: tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m) else: tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (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))) <= 5e+140) tmp = Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * Float64(t_m * t_m)) * t_m)); else tmp = Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(k * k) * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if ((2.0 / (((((t_m ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t_m) ^ 2.0)) + 1.0))) <= 5e+140) tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m); else tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[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], 5e+140], N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * 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 \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 5 \cdot 10^{+140}:\\
\;\;\;\;\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot \left(t\_m \cdot t\_m\right)\right) \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot t\_m\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)))) < 5.00000000000000008e140Initial program 84.0%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6469.8
Applied rewrites69.8%
Applied rewrites55.1%
Applied rewrites83.6%
if 5.00000000000000008e140 < (/.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 17.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-*.f6436.6
Applied rewrites36.6%
Applied rewrites36.6%
Applied rewrites42.8%
Applied rewrites54.5%
Final simplification70.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (sin k) t_m)))
(*
t_s
(if (<= t_m 2.2e-41)
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ l (pow (sin k) 2.0)) (* k t_m)))
(if (<= t_m 5.3e+150)
(*
(/
(* (/ 2.0 (* t_2 t_m)) l)
(* (* t_m (+ (pow (/ k t_m) 2.0) 2.0)) (tan k)))
l)
(/
2.0
(*
(* (* t_2 (* (/ t_m l) (/ t_m l))) (tan k))
(fma k (/ k (* t_m 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 t_2 = sin(k) * t_m;
double tmp;
if (t_m <= 2.2e-41) {
tmp = (((cos(k) * l) * 2.0) / k) * ((l / pow(sin(k), 2.0)) / (k * t_m));
} else if (t_m <= 5.3e+150) {
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_2 * ((t_m / l) * (t_m / l))) * tan(k)) * fma(k, (k / (t_m * 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) t_2 = Float64(sin(k) * t_m) tmp = 0.0 if (t_m <= 2.2e-41) tmp = Float64(Float64(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(l / (sin(k) ^ 2.0)) / Float64(k * t_m))); elseif (t_m <= 5.3e+150) 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_2 * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * fma(k, Float64(k / Float64(t_m * 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_] := Block[{t$95$2 = N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.2e-41], N[(N[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.3e+150], 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$2 * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \sin k \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{k \cdot t\_m}\\
\mathbf{elif}\;t\_m \leq 5.3 \cdot 10^{+150}:\\
\;\;\;\;\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(\left(t\_2 \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)}\\
\end{array}
\end{array}
\end{array}
if t < 2.2e-41Initial program 50.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6463.1
Applied rewrites63.1%
Applied rewrites71.9%
Applied rewrites78.8%
if 2.2e-41 < t < 5.30000000000000013e150Initial program 67.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-/.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 rewrites91.0%
Applied rewrites90.9%
if 5.30000000000000013e150 < t Initial program 58.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-/.f6490.7
Applied rewrites90.7%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6484.7
Applied rewrites84.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (cos k) l)) (t_3 (pow (sin k) 2.0)))
(*
t_s
(if (<= k 8e-55)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 140000.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)))
(if (<= k 1.35e+217)
(* t_2 (* (/ l t_3) (/ 2.0 (* (* k k) t_m))))
(/ (/ (* (* t_2 2.0) l) (* t_3 k)) (* t_m k))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = cos(k) * l;
double t_3 = pow(sin(k), 2.0);
double tmp;
if (k <= 8e-55) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 140000.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 if (k <= 1.35e+217) {
tmp = t_2 * ((l / t_3) * (2.0 / ((k * k) * t_m)));
} else {
tmp = (((t_2 * 2.0) * l) / (t_3 * k)) / (t_m * k);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(cos(k) * l) t_3 = sin(k) ^ 2.0 tmp = 0.0 if (k <= 8e-55) 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 <= 140000.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))); elseif (k <= 1.35e+217) tmp = Float64(t_2 * Float64(Float64(l / t_3) * Float64(2.0 / Float64(Float64(k * k) * t_m)))); else tmp = Float64(Float64(Float64(Float64(t_2 * 2.0) * l) / Float64(t_3 * k)) / Float64(t_m * 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_] := Block[{t$95$2 = N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 8e-55], 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, 140000.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], If[LessEqual[k, 1.35e+217], N[(t$95$2 * N[(N[(l / t$95$3), $MachinePrecision] * N[(2.0 / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t$95$2 * 2.0), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$3 * k), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \cos k \cdot \ell\\
t_3 := {\sin k}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\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 140000:\\
\;\;\;\;\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}\;k \leq 1.35 \cdot 10^{+217}:\\
\;\;\;\;t\_2 \cdot \left(\frac{\ell}{t\_3} \cdot \frac{2}{\left(k \cdot k\right) \cdot t\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(t\_2 \cdot 2\right) \cdot \ell}{t\_3 \cdot k}}{t\_m \cdot k}\\
\end{array}
\end{array}
\end{array}
if k < 7.99999999999999996e-55Initial program 55.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-/.f6477.9
Applied rewrites77.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 rewrites85.3%
Taylor expanded in k around 0
lower-*.f6473.1
Applied rewrites73.1%
if 7.99999999999999996e-55 < k < 1.4e5Initial program 65.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-/.f6492.8
Applied rewrites92.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 rewrites99.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-*.f6499.6
Applied rewrites99.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.1%
if 1.4e5 < k < 1.35000000000000001e217Initial program 46.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6472.7
Applied rewrites72.7%
Applied rewrites78.5%
if 1.35000000000000001e217 < k Initial program 35.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6452.7
Applied rewrites52.7%
Applied rewrites82.5%
Applied rewrites82.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 8e-55)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 460000.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)))
(* (/ (* (* (cos k) l) 2.0) k) (/ (/ l (pow (sin k) 2.0)) (* k t_m)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-55) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 460000.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 = (((cos(k) * l) * 2.0) / k) * ((l / pow(sin(k), 2.0)) / (k * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8e-55) 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 <= 460000.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(Float64(Float64(cos(k) * l) * 2.0) / k) * Float64(Float64(l / (sin(k) ^ 2.0)) / Float64(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_] := N[(t$95$s * If[LessEqual[k, 8e-55], 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, 460000.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[(N[(N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\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 460000:\\
\;\;\;\;\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{\left(\cos k \cdot \ell\right) \cdot 2}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{k \cdot t\_m}\\
\end{array}
\end{array}
if k < 7.99999999999999996e-55Initial program 55.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-/.f6477.9
Applied rewrites77.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 rewrites85.3%
Taylor expanded in k around 0
lower-*.f6473.1
Applied rewrites73.1%
if 7.99999999999999996e-55 < k < 4.6e5Initial program 65.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-/.f6492.8
Applied rewrites92.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 rewrites99.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-*.f6499.6
Applied rewrites99.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.1%
if 4.6e5 < k Initial program 42.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6466.3
Applied rewrites66.3%
Applied rewrites79.3%
Applied rewrites88.2%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 8e-55)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 140000.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)))
(* (* (cos k) l) (* (/ l (pow (sin k) 2.0)) (/ 2.0 (* (* k k) t_m))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-55) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 140000.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 = (cos(k) * l) * ((l / pow(sin(k), 2.0)) * (2.0 / ((k * k) * t_m)));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8e-55) 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 <= 140000.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(cos(k) * l) * Float64(Float64(l / (sin(k) ^ 2.0)) * Float64(2.0 / Float64(Float64(k * 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_] := N[(t$95$s * If[LessEqual[k, 8e-55], 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, 140000.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[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision] * N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\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 140000:\\
\;\;\;\;\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(\cos k \cdot \ell\right) \cdot \left(\frac{\ell}{{\sin k}^{2}} \cdot \frac{2}{\left(k \cdot k\right) \cdot t\_m}\right)\\
\end{array}
\end{array}
if k < 7.99999999999999996e-55Initial program 55.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-/.f6477.9
Applied rewrites77.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 rewrites85.3%
Taylor expanded in k around 0
lower-*.f6473.1
Applied rewrites73.1%
if 7.99999999999999996e-55 < k < 1.4e5Initial program 65.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-/.f6492.8
Applied rewrites92.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 rewrites99.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-*.f6499.6
Applied rewrites99.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.1%
if 1.4e5 < k Initial program 42.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6466.3
Applied rewrites66.3%
Applied rewrites72.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.25e-35)
(* (/ 2.0 k) (/ (* (/ l (pow (sin k) 2.0)) (* (cos k) l)) (* t_m k)))
(/
2.0
(*
(* (* (* (sin k) t_m) (* (/ t_m l) (/ t_m l))) (tan k))
(fma k (/ k (* t_m 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 <= 1.25e-35) {
tmp = (2.0 / k) * (((l / pow(sin(k), 2.0)) * (cos(k) * l)) / (t_m * k));
} else {
tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * fma(k, (k / (t_m * 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 <= 1.25e-35) tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(l / (sin(k) ^ 2.0)) * Float64(cos(k) * l)) / Float64(t_m * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * fma(k, Float64(k / Float64(t_m * 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, 1.25e-35], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.25 \cdot 10^{-35}:\\
\;\;\;\;\frac{2}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}} \cdot \left(\cos k \cdot \ell\right)}{t\_m \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\sin k \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)}\\
\end{array}
\end{array}
if t < 1.24999999999999991e-35Initial program 49.7%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6462.8
Applied rewrites62.8%
Applied rewrites71.7%
if 1.24999999999999991e-35 < t Initial program 64.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-/.f6486.0
Applied rewrites86.0%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6483.1
Applied rewrites83.1%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 8e-55)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 460000.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 (/ (* t_m (pow (* (sin k) k) 2.0)) (cos k))) l) l)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-55) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 460000.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 / ((t_m * pow((sin(k) * k), 2.0)) / cos(k))) * l) * l;
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8e-55) 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 <= 460000.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(Float64(2.0 / Float64(Float64(t_m * (Float64(sin(k) * k) ^ 2.0)) / cos(k))) * l) * l); 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, 8e-55], 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, 460000.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[(N[(2.0 / N[(N[(t$95$m * N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $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}\;k \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\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 460000:\\
\;\;\;\;\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(\frac{2}{\frac{t\_m \cdot {\left(\sin k \cdot k\right)}^{2}}{\cos k}} \cdot \ell\right) \cdot \ell\\
\end{array}
\end{array}
if k < 7.99999999999999996e-55Initial program 55.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-/.f6477.9
Applied rewrites77.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 rewrites85.3%
Taylor expanded in k around 0
lower-*.f6473.1
Applied rewrites73.1%
if 7.99999999999999996e-55 < k < 4.6e5Initial program 65.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-/.f6492.8
Applied rewrites92.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 rewrites99.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-*.f6499.6
Applied rewrites99.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.1%
if 4.6e5 < k Initial program 42.7%
Applied rewrites36.0%
Taylor expanded in t around 0
lower-/.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.f64N/A
lower-cos.f6477.5
Applied rewrites77.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites72.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 (<= k 1.2e-29)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 2.95e+54)
(/
2.0
(*
(* (* (* (sin k) t_m) (* (/ t_m l) (/ t_m l))) (tan k))
(fma k (/ k (* t_m t_m)) 2.0)))
(/
2.0
(/
(/ (* (* (* (- 0.5 (* 0.5 (cos (+ k k)))) t_m) k) k) (cos k))
(* l l)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.2e-29) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 2.95e+54) {
tmp = 2.0 / ((((sin(k) * t_m) * ((t_m / l) * (t_m / l))) * tan(k)) * fma(k, (k / (t_m * t_m)), 2.0));
} else {
tmp = 2.0 / ((((((0.5 - (0.5 * cos((k + k)))) * t_m) * k) * k) / cos(k)) / (l * l));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 1.2e-29) 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 <= 2.95e+54) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(sin(k) * t_m) * Float64(Float64(t_m / l) * Float64(t_m / l))) * tan(k)) * fma(k, Float64(k / Float64(t_m * t_m)), 2.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * t_m) * k) * k) / cos(k)) / Float64(l * l))); 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, 1.2e-29], 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, 2.95e+54], N[(2.0 / N[(N[(N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[(t$95$m / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(k * N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(l * 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}\;k \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;\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 2.95 \cdot 10^{+54}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\sin k \cdot t\_m\right) \cdot \left(\frac{t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right)\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\_m\right) \cdot k\right) \cdot k}{\cos k}}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 1.19999999999999996e-29Initial program 55.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-/.f6478.0
Applied rewrites78.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 rewrites85.7%
Taylor expanded in k around 0
lower-*.f6472.8
Applied rewrites72.8%
if 1.19999999999999996e-29 < k < 2.9499999999999999e54Initial program 64.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.5
Applied rewrites85.5%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-pow.f64N/A
unpow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6485.7
Applied rewrites85.7%
if 2.9499999999999999e54 < k Initial program 41.4%
Applied rewrites37.4%
Taylor expanded in t around 0
lower-/.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.f64N/A
lower-cos.f6481.0
Applied rewrites81.0%
Applied rewrites81.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 (<= k 8e-55)
(/ 2.0 (* (* (/ t_m l) (* t_m (sin k))) (* (/ t_m l) (* 2.0 k))))
(if (<= k 460000.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
(/
(/ (* (* (* (- 0.5 (* 0.5 (cos (+ k k)))) t_m) k) k) (cos k))
(* l l)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 8e-55) {
tmp = 2.0 / (((t_m / l) * (t_m * sin(k))) * ((t_m / l) * (2.0 * k)));
} else if (k <= 460000.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 / ((((((0.5 - (0.5 * cos((k + k)))) * t_m) * k) * k) / cos(k)) / (l * l));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 8e-55) 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 <= 460000.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(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k + k)))) * t_m) * k) * k) / cos(k)) / Float64(l * l))); 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, 8e-55], 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, 460000.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[(2.0 / N[(N[(N[(N[(N[(N[(0.5 - N[(0.5 * N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] * k), $MachinePrecision] * k), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(l * 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}\;k \leq 8 \cdot 10^{-55}:\\
\;\;\;\;\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 460000:\\
\;\;\;\;\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}{\frac{\frac{\left(\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\_m\right) \cdot k\right) \cdot k}{\cos k}}{\ell \cdot \ell}}\\
\end{array}
\end{array}
if k < 7.99999999999999996e-55Initial program 55.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-/.f6477.9
Applied rewrites77.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 rewrites85.3%
Taylor expanded in k around 0
lower-*.f6473.1
Applied rewrites73.1%
if 7.99999999999999996e-55 < k < 4.6e5Initial program 65.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-/.f6492.8
Applied rewrites92.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 rewrites99.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-*.f6499.6
Applied rewrites99.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.1%
if 4.6e5 < k Initial program 42.7%
Applied rewrites36.0%
Taylor expanded in t around 0
lower-/.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.f64N/A
lower-cos.f6477.5
Applied rewrites77.5%
Applied rewrites77.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 0.0024)
(/
(/ 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) (* 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 <= 0.0024) {
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) * (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 <= 0.0024) 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(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, 0.0024], 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[(2.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 0.0024:\\
\;\;\;\;\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(2 \cdot k\right)\right)}\\
\end{array}
\end{array}
if t < 0.00239999999999999979Initial program 50.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-/.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 rewrites78.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-*.f6480.1
Applied rewrites80.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.8%
if 0.00239999999999999979 < t Initial program 61.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-/.f6485.1
Applied rewrites85.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 rewrites93.3%
Taylor expanded in k around 0
lower-*.f6480.6
Applied rewrites80.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 6.5e-35)
(/
(/ 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 3.3e+166)
(* (/ l (* k t_m)) (/ (/ l (* t_m t_m)) k))
(/ (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-35) {
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 <= 3.3e+166) {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
} 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-35) 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 <= 3.3e+166) tmp = Float64(Float64(l / Float64(k * t_m)) * Float64(Float64(l / Float64(t_m * t_m)) / k)); 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-35], 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, 3.3e+166], N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $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^{-35}:\\
\;\;\;\;\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 3.3 \cdot 10^{+166}:\\
\;\;\;\;\frac{\ell}{k \cdot t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{k}\\
\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.4999999999999999e-35Initial program 50.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-/.f6471.9
Applied rewrites71.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 rewrites77.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.8
Applied rewrites79.8%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.4%
if 6.4999999999999999e-35 < t < 3.3000000000000002e166Initial program 63.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-*.f6456.2
Applied rewrites56.2%
Applied rewrites56.2%
Applied rewrites64.1%
Applied rewrites70.2%
if 3.3000000000000002e166 < t Initial program 63.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-*.f6474.7
Applied rewrites74.7%
Applied rewrites74.7%
Applied rewrites75.1%
Applied rewrites89.5%
Final simplification70.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 6.5e-35)
(/
(/ 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)))
(* (/ l (* k t_m)) (/ (/ l (* t_m t_m)) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 6.5e-35) {
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 = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 6.5e-35) 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(l / Float64(k * t_m)) * Float64(Float64(l / Float64(t_m * t_m)) / 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-35], 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[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 6.5 \cdot 10^{-35}:\\
\;\;\;\;\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{\ell}{k \cdot t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{k}\\
\end{array}
\end{array}
if t < 6.4999999999999999e-35Initial program 50.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-/.f6471.9
Applied rewrites71.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 rewrites77.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.8
Applied rewrites79.8%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.4%
if 6.4999999999999999e-35 < t Initial program 63.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-*.f6464.3
Applied rewrites64.3%
Applied rewrites64.3%
Applied rewrites68.9%
Applied rewrites74.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 (<= k 1.4e-202)
(/ (* (/ l k) l) (* (* k (* t_m t_m)) t_m))
(/ (* (/ l t_m) (/ (/ (/ l k) k) t_m)) t_m))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.4e-202) {
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m);
} else {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 1.4d-202) then
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m)
else
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.4e-202) {
tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m);
} else {
tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m;
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 1.4e-202: tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m) else: tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 1.4e-202) tmp = Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * Float64(t_m * t_m)) * t_m)); else tmp = Float64(Float64(Float64(l / t_m) * Float64(Float64(Float64(l / k) / k) / t_m)) / t_m); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 1.4e-202) tmp = ((l / k) * l) / ((k * (t_m * t_m)) * t_m); else tmp = ((l / t_m) * (((l / k) / k) / t_m)) / t_m; end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 1.4e-202], N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * N[(N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.4 \cdot 10^{-202}:\\
\;\;\;\;\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot \left(t\_m \cdot t\_m\right)\right) \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \frac{\frac{\frac{\ell}{k}}{k}}{t\_m}}{t\_m}\\
\end{array}
\end{array}
if k < 1.4000000000000001e-202Initial program 55.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-*.f6453.8
Applied rewrites53.8%
Applied rewrites29.9%
Applied rewrites67.0%
if 1.4000000000000001e-202 < k Initial program 49.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-*.f6455.5
Applied rewrites55.5%
Applied rewrites55.5%
Applied rewrites58.8%
Applied rewrites68.8%
Final simplification67.7%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 2e-132)
(* (/ l (* k t_m)) (/ (/ l (* t_m t_m)) k))
(if (<= k 4.2e+92)
(/ (/ (* (/ l t_m) l) t_m) (* t_m (* k k)))
(* (/ 2.0 (* (* k k) t_m)) (* (/ l k) (/ l k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 2e-132) {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
} else if (k <= 4.2e+92) {
tmp = (((l / t_m) * l) / t_m) / (t_m * (k * k));
} else {
tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 2d-132) then
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k)
else if (k <= 4.2d+92) then
tmp = (((l / t_m) * l) / t_m) / (t_m * (k * k))
else
tmp = (2.0d0 / ((k * k) * t_m)) * ((l / k) * (l / k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 2e-132) {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
} else if (k <= 4.2e+92) {
tmp = (((l / t_m) * l) / t_m) / (t_m * (k * k));
} else {
tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 2e-132: tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k) elif k <= 4.2e+92: tmp = (((l / t_m) * l) / t_m) / (t_m * (k * k)) else: tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 2e-132) tmp = Float64(Float64(l / Float64(k * t_m)) * Float64(Float64(l / Float64(t_m * t_m)) / k)); elseif (k <= 4.2e+92) tmp = Float64(Float64(Float64(Float64(l / t_m) * l) / t_m) / Float64(t_m * Float64(k * k))); else tmp = Float64(Float64(2.0 / Float64(Float64(k * k) * t_m)) * Float64(Float64(l / k) * Float64(l / k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 2e-132) tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k); elseif (k <= 4.2e+92) tmp = (((l / t_m) * l) / t_m) / (t_m * (k * k)); else tmp = (2.0 / ((k * k) * t_m)) * ((l / k) * (l / k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 2e-132], N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4.2e+92], 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], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] * N[(l / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $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^{-132}:\\
\;\;\;\;\frac{\ell}{k \cdot t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{k}\\
\mathbf{elif}\;k \leq 4.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m}}{t\_m \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t\_m} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\
\end{array}
\end{array}
if k < 2e-132Initial program 54.9%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6452.4
Applied rewrites52.4%
Applied rewrites52.4%
Applied rewrites55.6%
Applied rewrites66.9%
if 2e-132 < k < 4.19999999999999972e92Initial program 60.4%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6473.0
Applied rewrites73.0%
Applied rewrites73.0%
Applied rewrites75.2%
Applied rewrites77.0%
if 4.19999999999999972e92 < k Initial program 38.3%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6462.9
Applied rewrites62.9%
Taylor expanded in k around 0
Applied rewrites58.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.5e-35)
(/ (/ (* (* l (/ (/ l k) k)) 2.0) k) (* t_m k))
(* (/ l (* k t_m)) (/ (/ l (* t_m t_m)) k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.5e-35) {
tmp = (((l * ((l / k) / k)) * 2.0) / k) / (t_m * k);
} else {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 1.5d-35) then
tmp = (((l * ((l / k) / k)) * 2.0d0) / k) / (t_m * k)
else
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.5e-35) {
tmp = (((l * ((l / k) / k)) * 2.0) / k) / (t_m * k);
} else {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 1.5e-35: tmp = (((l * ((l / k) / k)) * 2.0) / k) / (t_m * k) else: tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1.5e-35) tmp = Float64(Float64(Float64(Float64(l * Float64(Float64(l / k) / k)) * 2.0) / k) / Float64(t_m * k)); else tmp = Float64(Float64(l / Float64(k * t_m)) * Float64(Float64(l / Float64(t_m * t_m)) / k)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 1.5e-35) tmp = (((l * ((l / k) / k)) * 2.0) / k) / (t_m * k); else tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 1.5e-35], N[(N[(N[(N[(l * N[(N[(l / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] / k), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision], N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{\frac{\left(\ell \cdot \frac{\frac{\ell}{k}}{k}\right) \cdot 2}{k}}{t\_m \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{k \cdot t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{k}\\
\end{array}
\end{array}
if t < 1.49999999999999994e-35Initial program 50.0%
Taylor expanded in t around 0
associate-*r/N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-pow.f64N/A
lower-sin.f6463.0
Applied rewrites63.0%
Applied rewrites71.7%
Taylor expanded in k around 0
Applied rewrites59.3%
if 1.49999999999999994e-35 < t Initial program 63.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-*.f6464.3
Applied rewrites64.3%
Applied rewrites64.3%
Applied rewrites68.9%
Applied rewrites74.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 (<= k 9.4e-58)
(* (/ l (* k t_m)) (/ (/ l (* t_m t_m)) k))
(/ (* (/ l t_m) l) (* 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) {
double tmp;
if (k <= 9.4e-58) {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 9.4d-58) then
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k)
else
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 9.4e-58) {
tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 9.4e-58: tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k) else: tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 9.4e-58) tmp = Float64(Float64(l / Float64(k * t_m)) * Float64(Float64(l / Float64(t_m * t_m)) / k)); else tmp = Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(k * k) * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 9.4e-58) tmp = (l / (k * t_m)) * ((l / (t_m * t_m)) / k); else tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 9.4e-58], N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(l / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;k \leq 9.4 \cdot 10^{-58}:\\
\;\;\;\;\frac{\ell}{k \cdot t\_m} \cdot \frac{\frac{\ell}{t\_m \cdot t\_m}}{k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 9.39999999999999989e-58Initial program 55.5%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.3
Applied rewrites54.3%
Applied rewrites54.3%
Applied rewrites57.2%
Applied rewrites68.2%
if 9.39999999999999989e-58 < k Initial program 47.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-*.f6455.0
Applied rewrites55.0%
Applied rewrites55.0%
Applied rewrites59.0%
Applied rewrites63.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 5.8e-151)
(/ (* (/ l (* t_m t_m)) l) (* (* k t_m) k))
(/ (* (/ l t_m) l) (* 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) {
double tmp;
if (k <= 5.8e-151) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.8d-151) then
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k)
else
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 5.8e-151) {
tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k);
} else {
tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 5.8e-151: tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k) else: tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 5.8e-151) tmp = Float64(Float64(Float64(l / Float64(t_m * t_m)) * l) / Float64(Float64(k * t_m) * k)); else tmp = Float64(Float64(Float64(l / t_m) * l) / Float64(t_m * Float64(Float64(k * k) * t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 5.8e-151) tmp = ((l / (t_m * t_m)) * l) / ((k * t_m) * k); else tmp = ((l / t_m) * l) / (t_m * ((k * k) * t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 5.8e-151], 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 / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * 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 \begin{array}{l}
\mathbf{if}\;k \leq 5.8 \cdot 10^{-151}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m \cdot t\_m} \cdot \ell}{\left(k \cdot t\_m\right) \cdot k}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot t\_m\right)}\\
\end{array}
\end{array}
if k < 5.80000000000000025e-151Initial program 55.0%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6452.4
Applied rewrites52.4%
Applied rewrites52.4%
Applied rewrites56.3%
Applied rewrites62.1%
if 5.80000000000000025e-151 < k Initial program 50.2%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6458.1
Applied rewrites58.1%
Applied rewrites58.1%
Applied rewrites60.3%
Applied rewrites64.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 (/ (* (/ l t_m) l) (* 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 / t_m) * l) / (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 / t_m) * l) / (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 / t_m) * l) / (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 / t_m) * l) / (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(Float64(l / t_m) * l) / Float64(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 / t_m) * l) / (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[(N[(l / t$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(t$95$m * 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{\frac{\ell}{t\_m} \cdot \ell}{t\_m \cdot \left(\left(k \cdot k\right) \cdot t\_m\right)}
\end{array}
Initial program 53.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.5
Applied rewrites54.5%
Applied rewrites54.5%
Applied rewrites57.7%
Applied rewrites63.9%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* l (/ (/ 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 53.3%
Taylor expanded in k around 0
unpow2N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6454.5
Applied rewrites54.5%
Applied rewrites54.5%
Applied rewrites57.7%
Applied rewrites58.1%
herbie shell --seed 2024364
(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))))