
(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}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (t l k) :precision binary64 (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) + 1.0));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t
real(8), intent (in) :: l
real(8), intent (in) :: k
code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) + 1.0d0))
end function
public static double code(double t, double l, double k) {
return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) + 1.0));
}
def code(t, l, k): return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) + 1.0))
function code(t, l, k) return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) + 1.0))) end
function tmp = code(t, l, k) tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) + 1.0)); end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)}
\end{array}
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (/ k (* t_m t_m))))
(*
t_s
(if (<= t_m 2.2e-91)
(* l (* 2.0 (/ (* l (cos k)) (* (pow k 2.0) (* t_m (pow (sin k) 2.0))))))
(if (<= t_m 2.55e+45)
(/
2.0
(*
(* (* (/ t_m l) t_m) t_m)
(* (sin k) (* (/ (tan k) l) (fma k t_2 2.0)))))
(*
l
(/
(* 2.0 (/ l (* (* (sin k) t_m) t_m)))
(* (* (fma t_2 k 2.0) (tan k)) t_m))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = k / (t_m * t_m);
double tmp;
if (t_m <= 2.2e-91) {
tmp = l * (2.0 * ((l * cos(k)) / (pow(k, 2.0) * (t_m * pow(sin(k), 2.0)))));
} else if (t_m <= 2.55e+45) {
tmp = 2.0 / ((((t_m / l) * t_m) * t_m) * (sin(k) * ((tan(k) / l) * fma(k, t_2, 2.0))));
} else {
tmp = l * ((2.0 * (l / ((sin(k) * t_m) * t_m))) / ((fma(t_2, k, 2.0) * tan(k)) * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(k / Float64(t_m * t_m)) tmp = 0.0 if (t_m <= 2.2e-91) tmp = Float64(l * Float64(2.0 * Float64(Float64(l * cos(k)) / Float64((k ^ 2.0) * Float64(t_m * (sin(k) ^ 2.0)))))); elseif (t_m <= 2.55e+45) tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m / l) * t_m) * t_m) * Float64(sin(k) * Float64(Float64(tan(k) / l) * fma(k, t_2, 2.0))))); else tmp = Float64(l * Float64(Float64(2.0 * Float64(l / Float64(Float64(sin(k) * t_m) * t_m))) / Float64(Float64(fma(t_2, k, 2.0) * tan(k)) * t_m))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 2.2e-91], N[(l * N[(2.0 * N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[Power[k, 2.0], $MachinePrecision] * N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 2.55e+45], N[(2.0 / N[(N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Tan[k], $MachinePrecision] / l), $MachinePrecision] * N[(k * t$95$2 + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(2.0 * N[(l / N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(t$95$2 * k + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \frac{k}{t\_m \cdot t\_m}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 2.2 \cdot 10^{-91}:\\
\;\;\;\;\ell \cdot \left(2 \cdot \frac{\ell \cdot \cos k}{{k}^{2} \cdot \left(t\_m \cdot {\sin k}^{2}\right)}\right)\\
\mathbf{elif}\;t\_m \leq 2.55 \cdot 10^{+45}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot t\_m\right) \cdot \left(\sin k \cdot \left(\frac{\tan k}{\ell} \cdot \mathsf{fma}\left(k, t\_2, 2\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{2 \cdot \frac{\ell}{\left(\sin k \cdot t\_m\right) \cdot t\_m}}{\left(\mathsf{fma}\left(t\_2, k, 2\right) \cdot \tan k\right) \cdot t\_m}\\
\end{array}
\end{array}
\end{array}
if t < 2.2000000000000001e-91Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-sin.f6464.8
Applied rewrites64.8%
if 2.2000000000000001e-91 < t < 2.5499999999999999e45Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.5%
if 2.5499999999999999e45 < t Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
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 (* (fma (/ k (* t_m t_m)) k 2.0) (tan k)))
(t_3 (* (sin k) t_m))
(t_4 (/ l t_3)))
(*
t_s
(if (<= t_m 1.05e-161)
(/ (* t_4 (/ (/ l k) t_m)) t_m)
(if (<= t_m 1.2e+125)
(* t_4 (/ (/ (+ l l) t_2) (* t_m t_m)))
(* l (/ (* 2.0 (/ l (* t_3 t_m))) (* t_2 t_m))))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = fma((k / (t_m * t_m)), k, 2.0) * tan(k);
double t_3 = sin(k) * t_m;
double t_4 = l / t_3;
double tmp;
if (t_m <= 1.05e-161) {
tmp = (t_4 * ((l / k) / t_m)) / t_m;
} else if (t_m <= 1.2e+125) {
tmp = t_4 * (((l + l) / t_2) / (t_m * t_m));
} else {
tmp = l * ((2.0 * (l / (t_3 * t_m))) / (t_2 * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(fma(Float64(k / Float64(t_m * t_m)), k, 2.0) * tan(k)) t_3 = Float64(sin(k) * t_m) t_4 = Float64(l / t_3) tmp = 0.0 if (t_m <= 1.05e-161) tmp = Float64(Float64(t_4 * Float64(Float64(l / k) / t_m)) / t_m); elseif (t_m <= 1.2e+125) tmp = Float64(t_4 * Float64(Float64(Float64(l + l) / t_2) / Float64(t_m * t_m))); else tmp = Float64(l * Float64(Float64(2.0 * Float64(l / Float64(t_3 * t_m))) / Float64(t_2 * t_m))); end return Float64(t_s * tmp) end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * k + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]}, Block[{t$95$4 = N[(l / t$95$3), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$m, 1.05e-161], N[(N[(t$95$4 * N[(N[(l / k), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], If[LessEqual[t$95$m, 1.2e+125], N[(t$95$4 * N[(N[(N[(l + l), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(2.0 * N[(l / N[(t$95$3 * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \mathsf{fma}\left(\frac{k}{t\_m \cdot t\_m}, k, 2\right) \cdot \tan k\\
t_3 := \sin k \cdot t\_m\\
t_4 := \frac{\ell}{t\_3}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.05 \cdot 10^{-161}:\\
\;\;\;\;\frac{t\_4 \cdot \frac{\frac{\ell}{k}}{t\_m}}{t\_m}\\
\mathbf{elif}\;t\_m \leq 1.2 \cdot 10^{+125}:\\
\;\;\;\;t\_4 \cdot \frac{\frac{\ell + \ell}{t\_2}}{t\_m \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{2 \cdot \frac{\ell}{t\_3 \cdot t\_m}}{t\_2 \cdot t\_m}\\
\end{array}
\end{array}
\end{array}
if t < 1.05e-161Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6468.9
Applied rewrites68.9%
if 1.05e-161 < t < 1.2e125Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
Applied rewrites61.7%
if 1.2e125 < t Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.5
Applied rewrites63.5%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 1.75e-6)
(*
(/ 2.0 (* (fma (/ k t_m) (/ k t_m) 2.0) (tan k)))
(* (/ (/ l (* k t_m)) t_m) (/ l t_m)))
(/
(*
(/ (+ l l) (* (* (fma (/ k (* t_m t_m)) k 2.0) (tan k)) (* (sin k) t_m)))
(/ l 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.75e-6) {
tmp = (2.0 / (fma((k / t_m), (k / t_m), 2.0) * tan(k))) * (((l / (k * t_m)) / t_m) * (l / t_m));
} else {
tmp = (((l + l) / ((fma((k / (t_m * t_m)), k, 2.0) * tan(k)) * (sin(k) * t_m))) * (l / 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.75e-6) tmp = Float64(Float64(2.0 / Float64(fma(Float64(k / t_m), Float64(k / t_m), 2.0) * tan(k))) * Float64(Float64(Float64(l / Float64(k * t_m)) / t_m) * Float64(l / t_m))); else tmp = Float64(Float64(Float64(Float64(l + l) / Float64(Float64(fma(Float64(k / Float64(t_m * t_m)), k, 2.0) * tan(k)) * Float64(sin(k) * t_m))) * Float64(l / t_m)) / 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, 1.75e-6], N[(N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l + l), $MachinePrecision] / N[(N[(N[(N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * k + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / 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.75 \cdot 10^{-6}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right) \cdot \tan k} \cdot \left(\frac{\frac{\ell}{k \cdot t\_m}}{t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\ell + \ell}{\left(\mathsf{fma}\left(\frac{k}{t\_m \cdot t\_m}, k, 2\right) \cdot \tan k\right) \cdot \left(\sin k \cdot t\_m\right)} \cdot \frac{\ell}{t\_m}}{t\_m}\\
\end{array}
\end{array}
if k < 1.74999999999999997e-6Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
if 1.74999999999999997e-6 < k Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
Applied rewrites65.9%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(*
t_s
(if (<= k 3.7e-58)
(*
(/ 2.0 (* (fma (/ k t_m) (/ k t_m) 2.0) (tan k)))
(* (/ (/ l (* k t_m)) t_m) (/ l t_m)))
(if (<= k 1.7e+127)
(*
l
(/
(/
(+ l l)
(* (* (* (fma (/ k (* t_m t_m)) k 2.0) (tan k)) t_m) (sin k)))
(* t_m t_m)))
(/ (/ (* (/ l k) l) (* (* 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) {
double tmp;
if (k <= 3.7e-58) {
tmp = (2.0 / (fma((k / t_m), (k / t_m), 2.0) * tan(k))) * (((l / (k * t_m)) / t_m) * (l / t_m));
} else if (k <= 1.7e+127) {
tmp = l * (((l + l) / (((fma((k / (t_m * t_m)), k, 2.0) * tan(k)) * t_m) * sin(k))) / (t_m * t_m));
} else {
tmp = (((l / k) * l) / ((k * t_m) * t_m)) / t_m;
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (k <= 3.7e-58) tmp = Float64(Float64(2.0 / Float64(fma(Float64(k / t_m), Float64(k / t_m), 2.0) * tan(k))) * Float64(Float64(Float64(l / Float64(k * t_m)) / t_m) * Float64(l / t_m))); elseif (k <= 1.7e+127) tmp = Float64(l * Float64(Float64(Float64(l + l) / Float64(Float64(Float64(fma(Float64(k / Float64(t_m * t_m)), k, 2.0) * tan(k)) * t_m) * sin(k))) / Float64(t_m * t_m))); else tmp = Float64(Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * t_m) * t_m)) / 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, 3.7e-58], N[(N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.7e+127], N[(l * N[(N[(N[(l + l), $MachinePrecision] / N[(N[(N[(N[(N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * k + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;k \leq 3.7 \cdot 10^{-58}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right) \cdot \tan k} \cdot \left(\frac{\frac{\ell}{k \cdot t\_m}}{t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\mathbf{elif}\;k \leq 1.7 \cdot 10^{+127}:\\
\;\;\;\;\ell \cdot \frac{\frac{\ell + \ell}{\left(\left(\mathsf{fma}\left(\frac{k}{t\_m \cdot t\_m}, k, 2\right) \cdot \tan k\right) \cdot t\_m\right) \cdot \sin k}}{t\_m \cdot t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot t\_m\right) \cdot t\_m}}{t\_m}\\
\end{array}
\end{array}
if k < 3.7000000000000003e-58Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
if 3.7000000000000003e-58 < k < 1.69999999999999989e127Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites57.5%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-*.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites57.5%
if 1.69999999999999989e127 < k Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f6466.8
Applied rewrites66.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.8e-143)
(*
(/ 2.0 (* (fma (/ k t_m) (/ k t_m) 2.0) (tan k)))
(* (/ (/ l (* k t_m)) t_m) (/ l t_m)))
(*
l
(/
(* 2.0 (/ l (* (* (sin k) t_m) t_m)))
(* (* (fma (/ k (* t_m t_m)) k 2.0) (tan k)) t_m))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (t_m <= 1.8e-143) {
tmp = (2.0 / (fma((k / t_m), (k / t_m), 2.0) * tan(k))) * (((l / (k * t_m)) / t_m) * (l / t_m));
} else {
tmp = l * ((2.0 * (l / ((sin(k) * t_m) * t_m))) / ((fma((k / (t_m * t_m)), k, 2.0) * tan(k)) * t_m));
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (t_m <= 1.8e-143) tmp = Float64(Float64(2.0 / Float64(fma(Float64(k / t_m), Float64(k / t_m), 2.0) * tan(k))) * Float64(Float64(Float64(l / Float64(k * t_m)) / t_m) * Float64(l / t_m))); else tmp = Float64(l * Float64(Float64(2.0 * Float64(l / Float64(Float64(sin(k) * t_m) * t_m))) / Float64(Float64(fma(Float64(k / Float64(t_m * t_m)), k, 2.0) * tan(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[t$95$m, 1.8e-143], N[(N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(2.0 * N[(l / N[(N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * k + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $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}\;t\_m \leq 1.8 \cdot 10^{-143}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right) \cdot \tan k} \cdot \left(\frac{\frac{\ell}{k \cdot t\_m}}{t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{2 \cdot \frac{\ell}{\left(\sin k \cdot t\_m\right) \cdot t\_m}}{\left(\mathsf{fma}\left(\frac{k}{t\_m \cdot t\_m}, k, 2\right) \cdot \tan k\right) \cdot t\_m}\\
\end{array}
\end{array}
if t < 1.7999999999999999e-143Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
if 1.7999999999999999e-143 < t Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites56.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6463.5
Applied rewrites63.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 (<= l 1.1e+96)
(*
(/ 2.0 (* (fma (/ k t_m) (/ k t_m) 2.0) (tan k)))
(* (/ (/ l (* k t_m)) t_m) (/ l t_m)))
(/ 2.0 (* (* (* t_m (* (* (/ t_m l) t_m) (/ (sin k) l))) (tan k)) 2.0)))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double tmp;
if (l <= 1.1e+96) {
tmp = (2.0 / (fma((k / t_m), (k / t_m), 2.0) * tan(k))) * (((l / (k * t_m)) / t_m) * (l / t_m));
} else {
tmp = 2.0 / (((t_m * (((t_m / l) * t_m) * (sin(k) / l))) * tan(k)) * 2.0);
}
return t_s * tmp;
}
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) tmp = 0.0 if (l <= 1.1e+96) tmp = Float64(Float64(2.0 / Float64(fma(Float64(k / t_m), Float64(k / t_m), 2.0) * tan(k))) * Float64(Float64(Float64(l / Float64(k * t_m)) / t_m) * Float64(l / t_m))); else tmp = Float64(2.0 / Float64(Float64(Float64(t_m * Float64(Float64(Float64(t_m / l) * t_m) * Float64(sin(k) / l))) * tan(k)) * 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[l, 1.1e+96], N[(N[(2.0 / N[(N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision] + 2.0), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / N[(k * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m * N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 1.1 \cdot 10^{+96}:\\
\;\;\;\;\frac{2}{\mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right) \cdot \tan k} \cdot \left(\frac{\frac{\ell}{k \cdot t\_m}}{t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(t\_m \cdot \left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \frac{\sin k}{\ell}\right)\right) \cdot \tan k\right) \cdot 2}\\
\end{array}
\end{array}
if l < 1.0999999999999999e96Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.8
Applied rewrites69.8%
if 1.0999999999999999e96 < l Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
Taylor expanded in t around inf
Applied rewrites65.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 (<= l 4.6e+70)
(/
2.0
(*
(* (* t_m (* (* (/ t_m l) t_m) (/ k l))) (tan k))
(fma (/ k t_m) (/ k t_m) 2.0)))
(* (/ 1.0 k) (* (/ l (* (* k t_m) t_m)) (/ l 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 (l <= 4.6e+70) {
tmp = 2.0 / (((t_m * (((t_m / l) * t_m) * (k / l))) * tan(k)) * fma((k / t_m), (k / t_m), 2.0));
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 4.6e+70) tmp = Float64(2.0 / Float64(Float64(Float64(t_m * Float64(Float64(Float64(t_m / l) * t_m) * Float64(k / l))) * tan(k)) * fma(Float64(k / t_m), Float64(k / t_m), 2.0))); else tmp = Float64(Float64(1.0 / k) * Float64(Float64(l / Float64(Float64(k * t_m) * t_m)) * Float64(l / 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[l, 4.6e+70], N[(2.0 / N[(N[(N[(t$95$m * N[(N[(N[(t$95$m / l), $MachinePrecision] * t$95$m), $MachinePrecision] * N[(k / l), $MachinePrecision]), $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[(N[(1.0 / k), $MachinePrecision] * N[(N[(l / N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / 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}\;\ell \leq 4.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{2}{\left(\left(t\_m \cdot \left(\left(\frac{t\_m}{\ell} \cdot t\_m\right) \cdot \frac{k}{\ell}\right)\right) \cdot \tan k\right) \cdot \mathsf{fma}\left(\frac{k}{t\_m}, \frac{k}{t\_m}, 2\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \left(\frac{\ell}{\left(k \cdot t\_m\right) \cdot t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\end{array}
\end{array}
if l < 4.59999999999999987e70Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*r/N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-pow.f64N/A
pow2N/A
metadata-evalN/A
lift-fma.f6473.1
Applied rewrites73.1%
Taylor expanded in k around 0
lower-/.f6466.7
Applied rewrites66.7%
if 4.59999999999999987e70 < l Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in k around 0
lower-/.f6466.0
Applied rewrites66.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 (<= l 1.95e-262)
(/ (* (/ l (sin k)) (/ (/ l k) (* t_m t_m))) t_m)
(if (<= l 5e+37)
(/
(/
(* (/ l k) l)
(* (* k (+ t_m (* -0.16666666666666666 (* (pow k 2.0) t_m)))) t_m))
t_m)
(* (/ 1.0 k) (* (/ l (* (* k t_m) t_m)) (/ l 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 (l <= 1.95e-262) {
tmp = ((l / sin(k)) * ((l / k) / (t_m * t_m))) / t_m;
} else if (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95d-262) then
tmp = ((l / sin(k)) * ((l / k) / (t_m * t_m))) / t_m
else if (l <= 5d+37) then
tmp = (((l / k) * l) / ((k * (t_m + ((-0.16666666666666666d0) * ((k ** 2.0d0) * t_m)))) * t_m)) / t_m
else
tmp = (1.0d0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95e-262) {
tmp = ((l / Math.sin(k)) * ((l / k) / (t_m * t_m))) / t_m;
} else if (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (Math.pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 l <= 1.95e-262: tmp = ((l / math.sin(k)) * ((l / k) / (t_m * t_m))) / t_m elif l <= 5e+37: tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (math.pow(k, 2.0) * t_m)))) * t_m)) / t_m else: tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95e-262) tmp = Float64(Float64(Float64(l / sin(k)) * Float64(Float64(l / k) / Float64(t_m * t_m))) / t_m); elseif (l <= 5e+37) tmp = Float64(Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * Float64(t_m + Float64(-0.16666666666666666 * Float64((k ^ 2.0) * t_m)))) * t_m)) / t_m); else tmp = Float64(Float64(1.0 / k) * Float64(Float64(l / Float64(Float64(k * t_m) * t_m)) * Float64(l / 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 (l <= 1.95e-262) tmp = ((l / sin(k)) * ((l / k) / (t_m * t_m))) / t_m; elseif (l <= 5e+37) tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * ((k ^ 2.0) * t_m)))) * t_m)) / t_m; else tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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[l, 1.95e-262], N[(N[(N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(l / k), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], If[LessEqual[l, 5e+37], N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * N[(t$95$m + N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(N[(l / N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / 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}\;\ell \leq 1.95 \cdot 10^{-262}:\\
\;\;\;\;\frac{\frac{\ell}{\sin k} \cdot \frac{\frac{\ell}{k}}{t\_m \cdot t\_m}}{t\_m}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+37}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot \left(t\_m + -0.16666666666666666 \cdot \left({k}^{2} \cdot t\_m\right)\right)\right) \cdot t\_m}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \left(\frac{\ell}{\left(k \cdot t\_m\right) \cdot t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\end{array}
\end{array}
if l < 1.94999999999999992e-262Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6463.5
Applied rewrites63.5%
if 1.94999999999999992e-262 < l < 4.99999999999999989e37Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
if 4.99999999999999989e37 < l Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in k around 0
lower-/.f6466.0
Applied rewrites66.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 (<= l 1.95e-262)
(/ (* (/ l k) (/ l (* (sin k) t_m))) (* t_m t_m))
(if (<= l 5e+37)
(/
(/
(* (/ l k) l)
(* (* k (+ t_m (* -0.16666666666666666 (* (pow k 2.0) t_m)))) t_m))
t_m)
(* (/ 1.0 k) (* (/ l (* (* k t_m) t_m)) (/ l 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 (l <= 1.95e-262) {
tmp = ((l / k) * (l / (sin(k) * t_m))) / (t_m * t_m);
} else if (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95d-262) then
tmp = ((l / k) * (l / (sin(k) * t_m))) / (t_m * t_m)
else if (l <= 5d+37) then
tmp = (((l / k) * l) / ((k * (t_m + ((-0.16666666666666666d0) * ((k ** 2.0d0) * t_m)))) * t_m)) / t_m
else
tmp = (1.0d0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95e-262) {
tmp = ((l / k) * (l / (Math.sin(k) * t_m))) / (t_m * t_m);
} else if (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (Math.pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 l <= 1.95e-262: tmp = ((l / k) * (l / (math.sin(k) * t_m))) / (t_m * t_m) elif l <= 5e+37: tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (math.pow(k, 2.0) * t_m)))) * t_m)) / t_m else: tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 1.95e-262) tmp = Float64(Float64(Float64(l / k) * Float64(l / Float64(sin(k) * t_m))) / Float64(t_m * t_m)); elseif (l <= 5e+37) tmp = Float64(Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * Float64(t_m + Float64(-0.16666666666666666 * Float64((k ^ 2.0) * t_m)))) * t_m)) / t_m); else tmp = Float64(Float64(1.0 / k) * Float64(Float64(l / Float64(Float64(k * t_m) * t_m)) * Float64(l / 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 (l <= 1.95e-262) tmp = ((l / k) * (l / (sin(k) * t_m))) / (t_m * t_m); elseif (l <= 5e+37) tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * ((k ^ 2.0) * t_m)))) * t_m)) / t_m; else tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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[l, 1.95e-262], N[(N[(N[(l / k), $MachinePrecision] * N[(l / N[(N[Sin[k], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e+37], N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * N[(t$95$m + N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(N[(l / N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / 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}\;\ell \leq 1.95 \cdot 10^{-262}:\\
\;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{\sin k \cdot t\_m}}{t\_m \cdot t\_m}\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+37}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot \left(t\_m + -0.16666666666666666 \cdot \left({k}^{2} \cdot t\_m\right)\right)\right) \cdot t\_m}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \left(\frac{\ell}{\left(k \cdot t\_m\right) \cdot t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\end{array}
\end{array}
if l < 1.94999999999999992e-262Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-/l/N/A
lift-*.f64N/A
lower-/.f64N/A
Applied rewrites63.2%
if 1.94999999999999992e-262 < l < 4.99999999999999989e37Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
if 4.99999999999999989e37 < l Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in k around 0
lower-/.f6466.0
Applied rewrites66.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 (<= l 5e+37)
(/
(/
(* (/ l k) l)
(* (* k (+ t_m (* -0.16666666666666666 (* (pow k 2.0) t_m)))) t_m))
t_m)
(* (/ 1.0 k) (* (/ l (* (* k t_m) t_m)) (/ l 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 (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 5d+37) then
tmp = (((l / k) * l) / ((k * (t_m + ((-0.16666666666666666d0) * ((k ** 2.0d0) * t_m)))) * t_m)) / t_m
else
tmp = (1.0d0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 5e+37) {
tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (Math.pow(k, 2.0) * t_m)))) * t_m)) / t_m;
} else {
tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 l <= 5e+37: tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * (math.pow(k, 2.0) * t_m)))) * t_m)) / t_m else: tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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 (l <= 5e+37) tmp = Float64(Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * Float64(t_m + Float64(-0.16666666666666666 * Float64((k ^ 2.0) * t_m)))) * t_m)) / t_m); else tmp = Float64(Float64(1.0 / k) * Float64(Float64(l / Float64(Float64(k * t_m) * t_m)) * Float64(l / 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 (l <= 5e+37) tmp = (((l / k) * l) / ((k * (t_m + (-0.16666666666666666 * ((k ^ 2.0) * t_m)))) * t_m)) / t_m; else tmp = (1.0 / k) * ((l / ((k * t_m) * t_m)) * (l / 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[l, 5e+37], N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * N[(t$95$m + N[(-0.16666666666666666 * N[(N[Power[k, 2.0], $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(N[(l / N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / 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}\;\ell \leq 5 \cdot 10^{+37}:\\
\;\;\;\;\frac{\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot \left(t\_m + -0.16666666666666666 \cdot \left({k}^{2} \cdot t\_m\right)\right)\right) \cdot t\_m}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \left(\frac{\ell}{\left(k \cdot t\_m\right) \cdot t\_m} \cdot \frac{\ell}{t\_m}\right)\\
\end{array}
\end{array}
if l < 4.99999999999999989e37Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6468.2
Applied rewrites68.2%
if 4.99999999999999989e37 < l Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in k around 0
lower-/.f6466.0
Applied rewrites66.0%
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
:precision binary64
(let* ((t_2 (* (* k t_m) t_m)))
(*
t_s
(if (<= l 19000000000000.0)
(/ (/ (* (/ l k) l) t_2) t_m)
(* (/ 1.0 k) (* (/ l t_2) (/ l t_m)))))))t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
double t_2 = (k * t_m) * t_m;
double tmp;
if (l <= 19000000000000.0) {
tmp = (((l / k) * l) / t_2) / t_m;
} else {
tmp = (1.0 / k) * ((l / t_2) * (l / t_m));
}
return t_s * tmp;
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8) :: t_2
real(8) :: tmp
t_2 = (k * t_m) * t_m
if (l <= 19000000000000.0d0) then
tmp = (((l / k) * l) / t_2) / t_m
else
tmp = (1.0d0 / k) * ((l / t_2) * (l / t_m))
end if
code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
double t_2 = (k * t_m) * t_m;
double tmp;
if (l <= 19000000000000.0) {
tmp = (((l / k) * l) / t_2) / t_m;
} else {
tmp = (1.0 / k) * ((l / t_2) * (l / t_m));
}
return t_s * tmp;
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): t_2 = (k * t_m) * t_m tmp = 0 if l <= 19000000000000.0: tmp = (((l / k) * l) / t_2) / t_m else: tmp = (1.0 / k) * ((l / t_2) * (l / t_m)) return t_s * tmp
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) t_2 = Float64(Float64(k * t_m) * t_m) tmp = 0.0 if (l <= 19000000000000.0) tmp = Float64(Float64(Float64(Float64(l / k) * l) / t_2) / t_m); else tmp = Float64(Float64(1.0 / k) * Float64(Float64(l / t_2) * Float64(l / t_m))); end return Float64(t_s * tmp) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp_2 = code(t_s, t_m, l, k) t_2 = (k * t_m) * t_m; tmp = 0.0; if (l <= 19000000000000.0) tmp = (((l / k) * l) / t_2) / t_m; else tmp = (1.0 / k) * ((l / t_2) * (l / t_m)); end tmp_2 = t_s * tmp; end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(N[(k * t$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * If[LessEqual[l, 19000000000000.0], N[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / t$95$2), $MachinePrecision] / t$95$m), $MachinePrecision], N[(N[(1.0 / k), $MachinePrecision] * N[(N[(l / t$95$2), $MachinePrecision] * N[(l / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
\begin{array}{l}
t_2 := \left(k \cdot t\_m\right) \cdot t\_m\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\ell \leq 19000000000000:\\
\;\;\;\;\frac{\frac{\frac{\ell}{k} \cdot \ell}{t\_2}}{t\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{k} \cdot \left(\frac{\ell}{t\_2} \cdot \frac{\ell}{t\_m}\right)\\
\end{array}
\end{array}
\end{array}
if l < 1.9e13Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f6466.8
Applied rewrites66.8%
if 1.9e13 < l Initial program 54.6%
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites55.0%
Taylor expanded in k around 0
Applied rewrites52.2%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.5
Applied rewrites66.5%
Taylor expanded in k around 0
lower-/.f6466.0
Applied rewrites66.0%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (/ (/ (* (/ l k) l) (* (* 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 / k) * l) / ((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 / k) * l) / ((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 / k) * l) / ((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 / k) * l) / ((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(Float64(Float64(Float64(l / k) * l) / Float64(Float64(k * 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 / k) * l) / ((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[(N[(N[(N[(l / k), $MachinePrecision] * l), $MachinePrecision] / N[(N[(k * t$95$m), $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 \frac{\frac{\frac{\ell}{k} \cdot \ell}{\left(k \cdot t\_m\right) \cdot t\_m}}{t\_m}
\end{array}
Initial program 54.6%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
unpow3N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6466.2
Applied rewrites66.2%
Applied rewrites57.6%
Taylor expanded in k around 0
lower-/.f6463.4
Applied rewrites63.4%
Taylor expanded in k around 0
lower-*.f6466.8
Applied rewrites66.8%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ l (* (* t_m (* t_m (* k t_m))) k)) l)))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / ((t_m * (t_m * (k * t_m))) * k)) * l);
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l / ((t_m * (t_m * (k * t_m))) * k)) * l)
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / ((t_m * (t_m * (k * t_m))) * k)) * l);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l / ((t_m * (t_m * (k * t_m))) * k)) * l)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l / Float64(Float64(t_m * Float64(t_m * Float64(k * t_m))) * k)) * l)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l / ((t_m * (t_m * (k * t_m))) * k)) * l); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l / N[(N[(t$95$m * N[(t$95$m * N[(k * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell}{\left(t\_m \cdot \left(t\_m \cdot \left(k \cdot t\_m\right)\right)\right) \cdot k} \cdot \ell\right)
\end{array}
Initial program 54.6%
Taylor expanded in k around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f6451.0
Applied rewrites51.0%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
lift-pow.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6455.5
lift-*.f64N/A
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites59.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied rewrites63.2%
t\_m = (fabs.f64 t) t\_s = (copysign.f64 #s(literal 1 binary64) t) (FPCore (t_s t_m l k) :precision binary64 (* t_s (* (/ l (* t_m (* (* t_m t_m) (* k k)))) l)))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (t_m * ((t_m * t_m) * (k * k)))) * l);
}
t\_m = private
t\_s = private
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(t_s, t_m, l, k)
use fmin_fmax_functions
real(8), intent (in) :: t_s
real(8), intent (in) :: t_m
real(8), intent (in) :: l
real(8), intent (in) :: k
code = t_s * ((l / (t_m * ((t_m * t_m) * (k * k)))) * l)
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
return t_s * ((l / (t_m * ((t_m * t_m) * (k * k)))) * l);
}
t\_m = math.fabs(t) t\_s = math.copysign(1.0, t) def code(t_s, t_m, l, k): return t_s * ((l / (t_m * ((t_m * t_m) * (k * k)))) * l)
t\_m = abs(t) t\_s = copysign(1.0, t) function code(t_s, t_m, l, k) return Float64(t_s * Float64(Float64(l / Float64(t_m * Float64(Float64(t_m * t_m) * Float64(k * k)))) * l)) end
t\_m = abs(t); t\_s = sign(t) * abs(1.0); function tmp = code(t_s, t_m, l, k) tmp = t_s * ((l / (t_m * ((t_m * t_m) * (k * k)))) * l); end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * N[(N[(l / N[(t$95$m * N[(N[(t$95$m * t$95$m), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)
\\
t\_s \cdot \left(\frac{\ell}{t\_m \cdot \left(\left(t\_m \cdot t\_m\right) \cdot \left(k \cdot k\right)\right)} \cdot \ell\right)
\end{array}
Initial program 54.6%
Taylor expanded in k around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f6451.0
Applied rewrites51.0%
lift-/.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
pow3N/A
lift-pow.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6455.5
lift-*.f64N/A
lift-pow.f64N/A
pow3N/A
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites59.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.6
Applied rewrites59.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.2
Applied rewrites58.2%
herbie shell --seed 2025157
(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))))