
(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 18 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 4.8e-109)
(/ 2.0 (/ (* (/ (pow (* (sin k) k) 2.0) l) (/ t_m l)) (cos k)))
(if (<= t_m 1.4e+125)
(/
2.0
(*
(* (/ (* (* t_m t_m) (/ t_m l)) l) (sin k))
(* (tan k) (+ (+ (pow (/ k t_m) 2.0) 1.0) 1.0))))
(/
2.0
(/ (* (/ (* (pow (* (sin k) t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4.8e-109) {
tmp = 2.0 / (((pow((sin(k) * k), 2.0) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.4e+125) {
tmp = 2.0 / (((((t_m * t_m) * (t_m / l)) / l) * sin(k)) * (tan(k) * ((pow((k / t_m), 2.0) + 1.0) + 1.0)));
} else {
tmp = 2.0 / ((((pow((sin(k) * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 4.8d-109) then
tmp = 2.0d0 / (((((sin(k) * k) ** 2.0d0) / l) * (t_m / l)) / cos(k))
else if (t_m <= 1.4d+125) then
tmp = 2.0d0 / (((((t_m * t_m) * (t_m / l)) / l) * sin(k)) * (tan(k) * ((((k / t_m) ** 2.0d0) + 1.0d0) + 1.0d0)))
else
tmp = 2.0d0 / ((((((sin(k) * t_m) ** 2.0d0) * 2.0d0) / l) * (t_m / l)) / cos(k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4.8e-109) {
tmp = 2.0 / (((Math.pow((Math.sin(k) * k), 2.0) / l) * (t_m / l)) / Math.cos(k));
} else if (t_m <= 1.4e+125) {
tmp = 2.0 / (((((t_m * t_m) * (t_m / l)) / l) * Math.sin(k)) * (Math.tan(k) * ((Math.pow((k / t_m), 2.0) + 1.0) + 1.0)));
} else {
tmp = 2.0 / ((((Math.pow((Math.sin(k) * t_m), 2.0) * 2.0) / l) * (t_m / l)) / Math.cos(k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 4.8e-109: tmp = 2.0 / (((math.pow((math.sin(k) * k), 2.0) / l) * (t_m / l)) / math.cos(k)) elif t_m <= 1.4e+125: tmp = 2.0 / (((((t_m * t_m) * (t_m / l)) / l) * math.sin(k)) * (math.tan(k) * ((math.pow((k / t_m), 2.0) + 1.0) + 1.0))) else: tmp = 2.0 / ((((math.pow((math.sin(k) * t_m), 2.0) * 2.0) / l) * (t_m / l)) / math.cos(k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4.8e-109) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(sin(k) * k) ^ 2.0) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.4e+125) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(t_m * t_m) * Float64(t_m / l)) / l) * sin(k)) * Float64(tan(k) * Float64(Float64((Float64(k / t_m) ^ 2.0) + 1.0) + 1.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(sin(k) * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 4.8e-109) tmp = 2.0 / (((((sin(k) * k) ^ 2.0) / l) * (t_m / l)) / cos(k)); elseif (t_m <= 1.4e+125) tmp = 2.0 / (((((t_m * t_m) * (t_m / l)) / l) * sin(k)) * (tan(k) * ((((k / t_m) ^ 2.0) + 1.0) + 1.0))); else tmp = 2.0 / ((((((sin(k) * t_m) ^ 2.0) * 2.0) / l) * (t_m / l)) / cos(k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 4.8e-109], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.4e+125], N[(2.0 / N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(\sin k \cdot k\right)}^{2}}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{2}{\left(\frac{\left(t\_m \cdot t\_m\right) \cdot \frac{t\_m}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\left({\left(\frac{k}{t\_m}\right)}^{2} + 1\right) + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(\sin k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 4.79999999999999977e-109Initial program 51.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.7%
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.8%
Taylor expanded in t around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6468.8
Applied rewrites68.8%
if 4.79999999999999977e-109 < t < 1.4e125Initial program 80.1%
Applied rewrites83.5%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6483.4
Applied rewrites83.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-/.f6488.1
Applied rewrites88.1%
if 1.4e125 < t Initial program 70.7%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.9%
Applied rewrites81.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites92.0%
Taylor expanded in t around inf
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6492.0
Applied rewrites92.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
(/
2.0
(/
(*
(/ (fma (pow (* (sin k) t_m) 2.0) 2.0 (* (pow (sin k) 2.0) (* k k))) l)
(/ t_m l))
(cos k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / (((fma(pow((sin(k) * t_m), 2.0), 2.0, (pow(sin(k), 2.0) * (k * k))) / l) * (t_m / l)) / cos(k)));
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(fma((Float64(sin(k) * t_m) ^ 2.0), 2.0, Float64((sin(k) ^ 2.0) * Float64(k * k))) / l) * Float64(t_m / l)) / cos(k)))) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{2}{\frac{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\_m\right)}^{2}, 2, {\sin k}^{2} \cdot \left(k \cdot k\right)\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}
\end{array}
Initial program 61.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
Applied rewrites78.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.5%
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-sin.f64N/A
pow2N/A
lift-*.f6486.5
Applied rewrites86.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
(/
2.0
(/
(*
(/ (fma (pow (* (sin k) t_m) 2.0) 2.0 (pow (* (sin k) k) 2.0)) l)
(/ t_m l))
(cos k)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * (2.0 / (((fma(pow((sin(k) * t_m), 2.0), 2.0, pow((sin(k) * k), 2.0)) / l) * (t_m / l)) / cos(k)));
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(2.0 / Float64(Float64(Float64(fma((Float64(sin(k) * t_m) ^ 2.0), 2.0, (Float64(sin(k) * k) ^ 2.0)) / l) * Float64(t_m / l)) / cos(k)))) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(2.0 / N[(N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0 + N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \frac{2}{\frac{\frac{\mathsf{fma}\left({\left(\sin k \cdot t\_m\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}
\end{array}
Initial program 61.5%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites77.2%
Applied rewrites78.4%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.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 7.5e-109)
(/ 2.0 (/ (* (/ (pow (* (sin k) k) 2.0) l) (/ t_m l)) (cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (/ (/ (* (* t_m t_m) t_m) l) l) (sin k))
(* (tan k) (fma (/ k t_m) (/ k t_m) 2.0))))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 7.5e-109) {
tmp = 2.0 / (((pow((sin(k) * k), 2.0) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / l) / l) * sin(k)) * (tan(k) * fma((k / t_m), (k / t_m), 2.0)));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 7.5e-109) tmp = Float64(2.0 / Float64(Float64(Float64((Float64(sin(k) * k) ^ 2.0) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l) / l) * sin(k)) * Float64(tan(k) * fma(Float64(k / t_m), Float64(k / t_m), 2.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(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, 7.5e-109], N[(2.0 / N[(N[(N[(N[Power[N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(\sin k \cdot k\right)}^{2}}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 7.49999999999999982e-109Initial program 51.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.7%
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.8%
Taylor expanded in t around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
unpow-prod-downN/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6468.8
Applied rewrites68.8%
if 7.49999999999999982e-109 < t < 1.0499999999999999e90Initial program 84.3%
Applied rewrites88.1%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
associate-+l+N/A
unpow2N/A
metadata-evalN/A
lower-fma.f64N/A
lift-/.f64N/A
lift-/.f6488.1
Applied rewrites88.1%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.6%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ (* t_m t_m) l)))
(*
t_s
(if (<= t_m 7.5e-109)
(/
2.0
(/
(*
(*
(fma (fma t_2 -0.6666666666666666 (pow l -1.0)) (* k k) (* t_2 2.0))
(* k k))
(/ t_m l))
(cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (/ (/ (* (* t_m t_m) t_m) l) l) (sin k))
(* (tan k) (fma (/ k t_m) (/ k t_m) 2.0))))
(/
2.0
(/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = (t_m * t_m) / l;
double tmp;
if (t_m <= 7.5e-109) {
tmp = 2.0 / (((fma(fma(t_2, -0.6666666666666666, pow(l, -1.0)), (k * k), (t_2 * 2.0)) * (k * k)) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / l) / l) * sin(k)) * (tan(k) * fma((k / t_m), (k / t_m), 2.0)));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(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(Float64(t_m * t_m) / l) tmp = 0.0 if (t_m <= 7.5e-109) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(t_2, -0.6666666666666666, (l ^ -1.0)), Float64(k * k), Float64(t_2 * 2.0)) * Float64(k * k)) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l) / l) * sin(k)) * Float64(tan(k) * fma(Float64(k / t_m), Float64(k / t_m), 2.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(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[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 7.5e-109], N[(2.0 / N[(N[(N[(N[(N[(t$95$2 * -0.6666666666666666 + N[Power[l, -1.0], $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision] + N[(t$95$2 * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{t\_m \cdot t\_m}{\ell}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_2, -0.6666666666666666, {\ell}^{-1}\right), k \cdot k, t\_2 \cdot 2\right) \cdot \left(k \cdot k\right)\right) \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
\end{array}
if t < 7.49999999999999982e-109Initial program 51.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.7%
Applied rewrites75.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites86.8%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites50.3%
if 7.49999999999999982e-109 < t < 1.0499999999999999e90Initial program 84.3%
Applied rewrites88.1%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
associate-+l+N/A
unpow2N/A
metadata-evalN/A
lower-fma.f64N/A
lift-/.f64N/A
lift-/.f6488.1
Applied rewrites88.1%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.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 7.5e-109)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (/ (/ (* (* t_m t_m) t_m) l) l) (sin k))
(* (tan k) (fma (/ k t_m) (/ k t_m) 2.0))))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 7.5e-109) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / l) / l) * sin(k)) * (tan(k) * fma((k / t_m), (k / t_m), 2.0)));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 7.5e-109) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l) / l) * sin(k)) * Float64(tan(k) * fma(Float64(k / t_m), Float64(k / t_m), 2.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(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, 7.5e-109], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 7.49999999999999982e-109Initial program 51.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.7%
Applied rewrites75.7%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites54.4%
if 7.49999999999999982e-109 < t < 1.0499999999999999e90Initial program 84.3%
Applied rewrites88.1%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6488.1
Applied rewrites88.1%
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
associate-+l+N/A
unpow2N/A
metadata-evalN/A
lower-fma.f64N/A
lift-/.f64N/A
lift-/.f6488.1
Applied rewrites88.1%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.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 7.5e-109)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (/ (/ (* (* t_m t_m) t_m) l) l) (sin k))
(* (tan k) (+ (/ (* k k) (* t_m t_m)) 2.0))))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 7.5e-109) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / l) / l) * sin(k)) * (tan(k) * (((k * k) / (t_m * t_m)) + 2.0)));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 7.5e-109) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / l) / l) * sin(k)) * Float64(tan(k) * Float64(Float64(Float64(k * k) / Float64(t_m * t_m)) + 2.0)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(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, 7.5e-109], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(N[(N[(k * k), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 7.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\frac{\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell}}{\ell} \cdot \sin k\right) \cdot \left(\tan k \cdot \left(\frac{k \cdot k}{t\_m \cdot t\_m} + 2\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 7.49999999999999982e-109Initial program 51.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.7%
Applied rewrites75.7%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites46.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites54.4%
if 7.49999999999999982e-109 < t < 1.0499999999999999e90Initial program 84.3%
Applied rewrites88.1%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6488.1
Applied rewrites88.1%
Taylor expanded in t around inf
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6486.3
Applied rewrites86.3%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.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 5.2e-83)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (* (/ (* (* t_m t_m) t_m) (* l l)) (sin k)) (tan k))
(fma (/ k t_m) (/ k t_m) 2.0)))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.2e-83) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / (l * l)) * sin(k)) * tan(k)) * fma((k / t_m), (k / t_m), 2.0));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5.2e-83) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / Float64(l * l)) * sin(k)) * tan(k)) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(k))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.2e-83], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 5.20000000000000018e-83Initial program 53.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Applied rewrites76.0%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.5%
if 5.20000000000000018e-83 < t < 1.0499999999999999e90Initial program 84.4%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.3
Applied rewrites84.3%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-/.f64N/A
lift-pow.f64N/A
unpow2N/A
metadata-evalN/A
lower-fma.f64N/A
lift-/.f64N/A
lift-/.f6484.3
Applied rewrites84.3%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.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 5.2e-83)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(if (<= t_m 1.05e+90)
(/
2.0
(*
(* (* (/ (* (* t_m t_m) t_m) (* l l)) (sin k)) (tan k))
(+ (+ 1.0 (/ (* k k) (* t_m t_m))) 1.0)))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 5.2e-83) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else if (t_m <= 1.05e+90) {
tmp = 2.0 / ((((((t_m * t_m) * t_m) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k * k) / (t_m * t_m))) + 1.0));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 5.2e-83) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); elseif (t_m <= 1.05e+90) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) * t_m) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + Float64(Float64(k * k) / Float64(t_m * t_m))) + 1.0))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(k))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.2e-83], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.05e+90], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[(N[(k * k), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{elif}\;t\_m \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{\left(t\_m \cdot t\_m\right) \cdot t\_m}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \frac{k \cdot k}{t\_m \cdot t\_m}\right) + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 5.20000000000000018e-83Initial program 53.1%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.1%
Applied rewrites76.0%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.5%
if 5.20000000000000018e-83 < t < 1.0499999999999999e90Initial program 84.4%
lift-pow.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.3
Applied rewrites84.3%
Taylor expanded in t around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6484.3
Applied rewrites84.3%
if 1.0499999999999999e90 < t Initial program 67.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.1%
Applied rewrites82.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites89.6%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6489.6
Applied rewrites89.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 4e-44)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(/ 2.0 (/ (* (/ (* (pow (* k t_m) 2.0) 2.0) l) (/ t_m l)) (cos k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 4e-44) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else {
tmp = 2.0 / ((((pow((k * t_m), 2.0) * 2.0) / l) * (t_m / l)) / cos(k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 4e-44) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64((Float64(k * t_m) ^ 2.0) * 2.0) / l) * Float64(t_m / l)) / cos(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, 4e-44], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 4 \cdot 10^{-44}:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{{\left(k \cdot t\_m\right)}^{2} \cdot 2}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\end{array}
\end{array}
if t < 3.99999999999999981e-44Initial program 55.0%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites74.3%
Applied rewrites76.1%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites56.8%
if 3.99999999999999981e-44 < t Initial program 74.9%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.4%
Applied rewrites83.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites87.2%
Taylor expanded in k around 0
unpow-prod-downN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
unpow-prod-downN/A
*-commutativeN/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
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 3.3)
(/
2.0
(/
(*
(/
(*
(fma
(* (fma (* t_m t_m) -0.6666666666666666 1.0) k)
k
(* (* t_m t_m) 2.0))
(* k k))
l)
(/ t_m l))
(cos k)))
(/ (* l l) (* (pow (* k t_m) 2.0) t_m)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 3.3) {
tmp = 2.0 / ((((fma((fma((t_m * t_m), -0.6666666666666666, 1.0) * k), k, ((t_m * t_m) * 2.0)) * (k * k)) / l) * (t_m / l)) / cos(k));
} else {
tmp = (l * l) / (pow((k * t_m), 2.0) * t_m);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 3.3) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(fma(Float64(fma(Float64(t_m * t_m), -0.6666666666666666, 1.0) * k), k, Float64(Float64(t_m * t_m) * 2.0)) * Float64(k * k)) / l) * Float64(t_m / l)) / cos(k))); else tmp = Float64(Float64(l * l) / Float64((Float64(k * t_m) ^ 2.0) * 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[t$95$m, 3.3], N[(2.0 / N[(N[(N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] * -0.6666666666666666 + 1.0), $MachinePrecision] * k), $MachinePrecision] * k + N[(N[(t$95$m * t$95$m), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 3.3:\\
\;\;\;\;\frac{2}{\frac{\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_m \cdot t\_m, -0.6666666666666666, 1\right) \cdot k, k, \left(t\_m \cdot t\_m\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\ell} \cdot \frac{t\_m}{\ell}}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\_m\right)}^{2} \cdot t\_m}\\
\end{array}
\end{array}
if t < 3.2999999999999998Initial program 55.6%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites73.9%
Applied rewrites75.6%
Taylor expanded in k around 0
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites49.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites56.9%
if 3.2999999999999998 < t Initial program 75.9%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6462.7
Applied rewrites62.7%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6462.6
Applied rewrites62.6%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 1.72e+50)
(/ 2.0 (* (* (* (* (/ (* t_m t_m) l) (/ t_m l)) (sin k)) k) 2.0))
(/ 2.0 (* (/ (* (* k k) t_m) (* l l)) (* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.72e+50) {
tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * k) * 2.0);
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 1.72d+50) then
tmp = 2.0d0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * k) * 2.0d0)
else
tmp = 2.0d0 / ((((k * k) * t_m) / (l * l)) * (k * k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.72e+50) {
tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * Math.sin(k)) * k) * 2.0);
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 1.72e+50: tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * math.sin(k)) * k) * 2.0) else: tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 1.72e+50) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(Float64(Float64(t_m * t_m) / l) * Float64(t_m / l)) * sin(k)) * k) * 2.0)); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t_m) / Float64(l * l)) * Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 1.72e+50) tmp = 2.0 / ((((((t_m * t_m) / l) * (t_m / l)) * sin(k)) * k) * 2.0); else tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 1.72e+50], N[(2.0 / N[(N[(N[(N[(N[(N[(t$95$m * t$95$m), $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.72 \cdot 10^{+50}:\\
\;\;\;\;\frac{2}{\left(\left(\left(\frac{t\_m \cdot t\_m}{\ell} \cdot \frac{t\_m}{\ell}\right) \cdot \sin k\right) \cdot k\right) \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.72e50Initial program 61.7%
Taylor expanded in t around inf
Applied rewrites62.0%
Taylor expanded in k around 0
Applied rewrites59.9%
lift-*.f64N/A
lift-/.f64N/A
lift-pow.f64N/A
pow3N/A
pow2N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f6469.3
Applied rewrites69.3%
if 1.72e50 < k Initial program 60.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.3%
Taylor expanded in t around 0
lower-*.f64N/A
pow2N/A
lift-*.f6465.3
Applied rewrites65.3%
Final simplification68.4%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= t_m 0.49)
(/ 2.0 (* (* (* k k) (/ t_m (* l l))) (* k k)))
(/ (* l l) (* (pow (* k t_m) 2.0) t_m)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 0.49) {
tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k));
} else {
tmp = (l * l) / (pow((k * t_m), 2.0) * t_m);
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (t_m <= 0.49d0) then
tmp = 2.0d0 / (((k * k) * (t_m / (l * l))) * (k * k))
else
tmp = (l * l) / (((k * t_m) ** 2.0d0) * t_m)
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 0.49) {
tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k));
} else {
tmp = (l * l) / (Math.pow((k * t_m), 2.0) * t_m);
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if t_m <= 0.49: tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k)) else: tmp = (l * l) / (math.pow((k * t_m), 2.0) * t_m) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 0.49) tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(t_m / Float64(l * l))) * Float64(k * k))); else tmp = Float64(Float64(l * l) / Float64((Float64(k * t_m) ^ 2.0) * t_m)); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (t_m <= 0.49) tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k)); else tmp = (l * l) / (((k * t_m) ^ 2.0) * t_m); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 0.49], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(t$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k * t$95$m), $MachinePrecision], 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 0.49:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot \frac{t\_m}{\ell \cdot \ell}\right) \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\_m\right)}^{2} \cdot t\_m}\\
\end{array}
\end{array}
if t < 0.48999999999999999Initial program 55.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.8%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6458.7
Applied rewrites58.7%
if 0.48999999999999999 < t Initial program 75.9%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6462.7
Applied rewrites62.7%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6462.6
Applied rewrites62.6%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 1.1e-97)
(* l (/ l (* k (* k (pow t_m 3.0)))))
(if (<= k 1.9e+71)
(/
2.0
(*
(/
(* (fma (fma (* k k) 0.3333333333333333 2.0) (* t_m t_m) (* k k)) t_m)
(* l l))
(* k k)))
(/ 2.0 (* (/ (* (* k k) t_m) (* l l)) (* k k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.1e-97) {
tmp = l * (l / (k * (k * pow(t_m, 3.0))));
} else if (k <= 1.9e+71) {
tmp = 2.0 / (((fma(fma((k * k), 0.3333333333333333, 2.0), (t_m * t_m), (k * k)) * t_m) / (l * l)) * (k * k));
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 1.1e-97) tmp = Float64(l * Float64(l / Float64(k * Float64(k * (t_m ^ 3.0))))); elseif (k <= 1.9e+71) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(Float64(k * k), 0.3333333333333333, 2.0), Float64(t_m * t_m), Float64(k * k)) * t_m) / Float64(l * l)) * Float64(k * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t_m) / Float64(l * l)) * Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 1.1e-97], N[(l * N[(l / N[(k * N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e+71], N[(2.0 / N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * N[(t$95$m * t$95$m), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.1 \cdot 10^{-97}:\\
\;\;\;\;\ell \cdot \frac{\ell}{k \cdot \left(k \cdot {t\_m}^{3}\right)}\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{+71}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, 0.3333333333333333, 2\right), t\_m \cdot t\_m, k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.0999999999999999e-97Initial program 61.5%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6453.0
Applied rewrites53.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f6458.2
Applied rewrites58.2%
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-pow.f6465.0
Applied rewrites65.0%
if 1.0999999999999999e-97 < k < 1.9e71Initial program 67.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6479.7
Applied rewrites79.7%
if 1.9e71 < k Initial program 57.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in t around 0
lower-*.f64N/A
pow2N/A
lift-*.f6463.1
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 1.1e-97)
(* l (/ l (* (* k k) (* (* t_m t_m) t_m))))
(if (<= k 9e+72)
(/
2.0
(*
(/
(* (fma (fma (* k k) 0.3333333333333333 2.0) (* t_m t_m) (* k k)) t_m)
(* l l))
(* k k)))
(/ 2.0 (* (/ (* (* k k) t_m) (* l l)) (* k k)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 1.1e-97) {
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)));
} else if (k <= 9e+72) {
tmp = 2.0 / (((fma(fma((k * k), 0.3333333333333333, 2.0), (t_m * t_m), (k * k)) * t_m) / (l * l)) * (k * k));
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 1.1e-97) tmp = Float64(l * Float64(l / Float64(Float64(k * k) * Float64(Float64(t_m * t_m) * t_m)))); elseif (k <= 9e+72) tmp = Float64(2.0 / Float64(Float64(Float64(fma(fma(Float64(k * k), 0.3333333333333333, 2.0), Float64(t_m * t_m), Float64(k * k)) * t_m) / Float64(l * l)) * Float64(k * k))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t_m) / Float64(l * l)) * Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 1.1e-97], N[(l * N[(l / N[(N[(k * k), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9e+72], N[(2.0 / N[(N[(N[(N[(N[(N[(k * k), $MachinePrecision] * 0.3333333333333333 + 2.0), $MachinePrecision] * N[(t$95$m * t$95$m), $MachinePrecision] + N[(k * k), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 1.1 \cdot 10^{-97}:\\
\;\;\;\;\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\
\mathbf{elif}\;k \leq 9 \cdot 10^{+72}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(k \cdot k, 0.3333333333333333, 2\right), t\_m \cdot t\_m, k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 1.0999999999999999e-97Initial program 61.5%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6453.0
Applied rewrites53.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f6458.2
Applied rewrites58.2%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6458.2
Applied rewrites58.2%
if 1.0999999999999999e-97 < k < 8.9999999999999997e72Initial program 67.1%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites79.8%
Taylor expanded in t around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6479.7
Applied rewrites79.7%
if 8.9999999999999997e72 < k Initial program 57.9%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites63.1%
Taylor expanded in t around 0
lower-*.f64N/A
pow2N/A
lift-*.f6463.1
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+14)
(* l (/ l (* (* k k) (* (* t_m t_m) t_m))))
(/ 2.0 (* (/ (* (* k k) t_m) (* l l)) (* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 5.8e+14) {
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)));
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 5.8d+14) then
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)))
else
tmp = 2.0d0 / ((((k * k) * t_m) / (l * l)) * (k * k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 5.8e+14) {
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)));
} else {
tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 5.8e+14: tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m))) else: tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 5.8e+14) tmp = Float64(l * Float64(l / Float64(Float64(k * k) * Float64(Float64(t_m * t_m) * t_m)))); else tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k * k) * t_m) / Float64(l * l)) * Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 5.8e+14) tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m))); else tmp = 2.0 / ((((k * k) * t_m) / (l * l)) * (k * k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 5.8e+14], N[(l * N[(l / N[(N[(k * k), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[(k * k), $MachinePrecision] * t$95$m), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 5.8 \cdot 10^{+14}:\\
\;\;\;\;\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\left(k \cdot k\right) \cdot t\_m}{\ell \cdot \ell} \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 5.8e14Initial program 62.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6454.6
Applied rewrites54.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f6459.3
Applied rewrites59.3%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6459.3
Applied rewrites59.3%
if 5.8e14 < k Initial program 59.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in t around 0
lower-*.f64N/A
pow2N/A
lift-*.f6464.0
Applied rewrites64.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 6e+14)
(* l (/ l (* (* k k) (* (* t_m t_m) t_m))))
(/ 2.0 (* (* (* k k) (/ t_m (* l l))) (* k k))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 6e+14) {
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)));
} else {
tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: tmp
if (k <= 6d+14) then
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)))
else
tmp = 2.0d0 / (((k * k) * (t_m / (l * l))) * (k * k))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double tmp;
if (k <= 6e+14) {
tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m)));
} else {
tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): tmp = 0 if k <= 6e+14: tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m))) else: tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 6e+14) tmp = Float64(l * Float64(l / Float64(Float64(k * k) * Float64(Float64(t_m * t_m) * t_m)))); else tmp = Float64(2.0 / Float64(Float64(Float64(k * k) * Float64(t_m / Float64(l * l))) * Float64(k * k))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) tmp = 0.0; if (k <= 6e+14) tmp = l * (l / ((k * k) * ((t_m * t_m) * t_m))); else tmp = 2.0 / (((k * k) * (t_m / (l * l))) * (k * k)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[k, 6e+14], N[(l * N[(l / N[(N[(k * k), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k * k), $MachinePrecision] * N[(t$95$m / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 6 \cdot 10^{+14}:\\
\;\;\;\;\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot \frac{t\_m}{\ell \cdot \ell}\right) \cdot \left(k \cdot k\right)}\\
\end{array}
\end{array}
if k < 6e14Initial program 62.1%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6454.6
Applied rewrites54.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f6459.3
Applied rewrites59.3%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6459.3
Applied rewrites59.3%
if 6e14 < k Initial program 59.6%
Taylor expanded in k around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f6463.9
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 (* (* k k) (* (* t_m 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) {
return t_s * (l * (l / ((k * k) * ((t_m * t_m) * t_m))));
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * (l * (l / ((k * k) * ((t_m * t_m) * t_m))))
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * (l * (l / ((k * k) * ((t_m * t_m) * t_m))));
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * (l * (l / ((k * k) * ((t_m * t_m) * 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(l / Float64(Float64(k * k) * Float64(Float64(t_m * t_m) * t_m))))) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * (l * (l / ((k * k) * ((t_m * t_m) * 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[(l / N[(N[(k * k), $MachinePrecision] * N[(N[(t$95$m * t$95$m), $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 \left(\ell \cdot \frac{\ell}{\left(k \cdot k\right) \cdot \left(\left(t\_m \cdot t\_m\right) \cdot t\_m\right)}\right)
\end{array}
Initial program 61.5%
Taylor expanded in k around 0
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lift-pow.f6455.1
Applied rewrites55.1%
lift-*.f64N/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lift-pow.f64N/A
lower-/.f64N/A
pow2N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-*.f6459.2
Applied rewrites59.2%
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f6459.2
Applied rewrites59.2%
herbie shell --seed 2025027
(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))))