
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.05e-6)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
t_0)
(if (<= y.re 950000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_0)
(* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.05e-6) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * t_0;
} else if (y_46_re <= 950000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.05e-6) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * t_0); elseif (y_46_re <= 950000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e-6], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 950000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{-6}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 950000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -1.0499999999999999e-6Initial program 40.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6482.7
Applied rewrites82.7%
if -1.0499999999999999e-6 < y.re < 9.5e11Initial program 43.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6452.0
Applied rewrites52.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.9
Applied rewrites79.9%
if 9.5e11 < y.re Initial program 35.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites71.2%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.4
Applied rewrites67.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (fma x.im x.im (* x.re x.re))))
(if (<= y.re -0.0105)
(* t_0 (pow t_1 (/ y.re 2.0)))
(if (<= y.re 950000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) t_0)
(* (pow (sqrt t_1) y.re) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double tmp;
if (y_46_re <= -0.0105) {
tmp = t_0 * pow(t_1, (y_46_re / 2.0));
} else if (y_46_re <= 950000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = pow(sqrt(t_1), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) tmp = 0.0 if (y_46_re <= -0.0105) tmp = Float64(t_0 * (t_1 ^ Float64(y_46_re / 2.0))); elseif (y_46_re <= 950000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64((sqrt(t_1) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0105], N[(t$95$0 * N[Power[t$95$1, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 950000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[Sqrt[t$95$1], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
\mathbf{if}\;y.re \leq -0.0105:\\
\;\;\;\;t\_0 \cdot {t\_1}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{elif}\;y.re \leq 950000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_1}\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -0.0105000000000000007Initial program 40.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-pow.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lower-/.f6479.2
Applied rewrites79.2%
if -0.0105000000000000007 < y.re < 9.5e11Initial program 43.3%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6452.0
Applied rewrites52.0%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.7
Applied rewrites79.7%
if 9.5e11 < y.re Initial program 35.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites71.2%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.4
Applied rewrites67.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma x.im x.im (* x.re x.re))))
(if (<= y.re -0.0105)
(* (cos (* y.re (atan2 x.im x.re))) (pow t_0 (/ y.re 2.0)))
(if (<= y.re 3300000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) 1.0)
(* (pow (sqrt t_0) y.re) 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, x_46_im, (x_46_re * x_46_re));
double tmp;
if (y_46_re <= -0.0105) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(t_0, (y_46_re / 2.0));
} else if (y_46_re <= 3300000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = pow(sqrt(t_0), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) tmp = 0.0 if (y_46_re <= -0.0105) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (t_0 ^ Float64(y_46_re / 2.0))); elseif (y_46_re <= 3300000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * 1.0); else tmp = Float64((sqrt(t_0) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0105], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[t$95$0, N[(y$46$re / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3300000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[Sqrt[t$95$0], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\\
\mathbf{if}\;y.re \leq -0.0105:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {t\_0}^{\left(\frac{y.re}{2}\right)}\\
\mathbf{elif}\;y.re \leq 3300000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{t\_0}\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -0.0105000000000000007Initial program 40.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
lift-pow.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
sqrt-pow2N/A
lower-pow.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lower-/.f6479.2
Applied rewrites79.2%
if -0.0105000000000000007 < y.re < 3.3e12Initial program 43.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites45.5%
Taylor expanded in y.re around 0
Applied rewrites51.7%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.6
Applied rewrites79.6%
if 3.3e12 < y.re Initial program 35.0%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites71.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))
(if (<= y.re -0.0105)
(* (cos (* y.re (atan2 x.im x.re))) t_0)
(if (<= y.re 3300000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) 1.0)
(* t_0 1.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -0.0105) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * t_0;
} else if (y_46_re <= 3300000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = t_0 * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re tmp = 0.0 if (y_46_re <= -0.0105) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_0); elseif (y_46_re <= 3300000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * 1.0); else tmp = Float64(t_0 * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.0105], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 3300000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * 1.0), $MachinePrecision], N[(t$95$0 * 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.0105:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{elif}\;y.re \leq 3300000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot 1\\
\end{array}
\end{array}
if y.re < -0.0105000000000000007Initial program 40.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6479.2
Applied rewrites79.2%
if -0.0105000000000000007 < y.re < 3.3e12Initial program 43.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites45.5%
Taylor expanded in y.re around 0
Applied rewrites51.7%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.6
Applied rewrites79.6%
if 3.3e12 < y.re Initial program 35.0%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites71.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.0155)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
1.0)
(if (<= y.re 3300000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) 1.0)
(* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.0155) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * 1.0;
} else if (y_46_re <= 3300000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * 1.0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.0155) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * 1.0); elseif (y_46_re <= 3300000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * 1.0); else tmp = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * 1.0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.0155], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 3300000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.0155:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\
\mathbf{elif}\;y.re \leq 3300000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -0.0155Initial program 40.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites43.1%
Taylor expanded in y.re around 0
Applied rewrites84.1%
if -0.0155 < y.re < 3.3e12Initial program 43.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites45.5%
Taylor expanded in y.re around 0
Applied rewrites51.7%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.6
Applied rewrites79.6%
if 3.3e12 < y.re Initial program 35.0%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.2%
Taylor expanded in y.re around 0
Applied rewrites71.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6467.3
Applied rewrites67.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) 1.0)))
(if (<= y.re -0.055)
t_0
(if (<= y.re 3300000000000.0)
(* (exp (- (* y.im (atan2 x.im x.re)))) 1.0)
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -0.055) {
tmp = t_0;
} else if (y_46_re <= 3300000000000.0) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -0.055) tmp = t_0; elseif (y_46_re <= 3300000000000.0) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * 1.0); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -0.055], t$95$0, If[LessEqual[y$46$re, 3300000000000.0], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -0.055:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3300000000000:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.0550000000000000003 or 3.3e12 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites47.6%
Taylor expanded in y.re around 0
Applied rewrites77.8%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6474.0
Applied rewrites74.0%
if -0.0550000000000000003 < y.re < 3.3e12Initial program 43.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites45.5%
Taylor expanded in y.re around 0
Applied rewrites51.7%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6479.6
Applied rewrites79.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re) 1.0))) (if (<= y.re -1.75e-13) t_0 (if (<= y.re 1.7e-42) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re) * 1.0;
double tmp;
if (y_46_re <= -1.75e-13) {
tmp = t_0;
} else if (y_46_re <= 1.7e-42) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -1.75e-13) tmp = t_0; elseif (y_46_re <= 1.7e-42) tmp = 1.0; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -1.75e-13], t$95$0, If[LessEqual[y$46$re, 1.7e-42], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -1.75 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-42}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.7500000000000001e-13 or 1.70000000000000011e-42 < y.re Initial program 38.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites47.3%
Taylor expanded in y.re around 0
Applied rewrites75.1%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6470.2
Applied rewrites70.2%
if -1.7500000000000001e-13 < y.re < 1.70000000000000011e-42Initial program 43.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6434.8
Applied rewrites34.8%
Taylor expanded in y.re around 0
Applied rewrites50.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im -3950000.0)
(* (pow (* -1.0 x.im) y.re) 1.0)
(if (<= x.im 7.5e-25)
(* (pow (sqrt (* x.re x.re)) y.re) 1.0)
(* (pow x.im y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -3950000.0) {
tmp = pow((-1.0 * x_46_im), y_46_re) * 1.0;
} else if (x_46_im <= 7.5e-25) {
tmp = pow(sqrt((x_46_re * x_46_re)), y_46_re) * 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-3950000.0d0)) then
tmp = (((-1.0d0) * x_46im) ** y_46re) * 1.0d0
else if (x_46im <= 7.5d-25) then
tmp = (sqrt((x_46re * x_46re)) ** y_46re) * 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -3950000.0) {
tmp = Math.pow((-1.0 * x_46_im), y_46_re) * 1.0;
} else if (x_46_im <= 7.5e-25) {
tmp = Math.pow(Math.sqrt((x_46_re * x_46_re)), y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -3950000.0: tmp = math.pow((-1.0 * x_46_im), y_46_re) * 1.0 elif x_46_im <= 7.5e-25: tmp = math.pow(math.sqrt((x_46_re * x_46_re)), y_46_re) * 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -3950000.0) tmp = Float64((Float64(-1.0 * x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 7.5e-25) tmp = Float64((sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re) * 1.0); else tmp = Float64((x_46_im ^ y_46_re) * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -3950000.0) tmp = ((-1.0 * x_46_im) ^ y_46_re) * 1.0; elseif (x_46_im <= 7.5e-25) tmp = (sqrt((x_46_re * x_46_re)) ^ y_46_re) * 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -3950000.0], N[(N[Power[N[(-1.0 * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 7.5e-25], N[(N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3950000:\\
\;\;\;\;{\left(-1 \cdot x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-25}:\\
\;\;\;\;{\left(\sqrt{x.re \cdot x.re}\right)}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -3.95e6Initial program 29.2%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites37.0%
Taylor expanded in y.re around 0
Applied rewrites59.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6450.9
Applied rewrites50.9%
Taylor expanded in x.im around -inf
lower-*.f6461.0
Applied rewrites61.0%
if -3.95e6 < x.im < 7.49999999999999989e-25Initial program 49.8%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites53.4%
Taylor expanded in y.re around 0
Applied rewrites68.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6457.2
Applied rewrites57.2%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6455.6
Applied rewrites55.6%
if 7.49999999999999989e-25 < x.im Initial program 34.7%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites43.2%
Taylor expanded in y.re around 0
Applied rewrites62.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.5
Applied rewrites51.5%
Taylor expanded in x.re around 0
Applied rewrites58.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -2.55e-33) (* (pow (* -1.0 x.im) y.re) 1.0) (if (<= x.im 1.2e-25) (* (pow x.re y.re) 1.0) (* (pow x.im y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.55e-33) {
tmp = pow((-1.0 * x_46_im), y_46_re) * 1.0;
} else if (x_46_im <= 1.2e-25) {
tmp = pow(x_46_re, y_46_re) * 1.0;
} else {
tmp = pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-2.55d-33)) then
tmp = (((-1.0d0) * x_46im) ** y_46re) * 1.0d0
else if (x_46im <= 1.2d-25) then
tmp = (x_46re ** y_46re) * 1.0d0
else
tmp = (x_46im ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -2.55e-33) {
tmp = Math.pow((-1.0 * x_46_im), y_46_re) * 1.0;
} else if (x_46_im <= 1.2e-25) {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -2.55e-33: tmp = math.pow((-1.0 * x_46_im), y_46_re) * 1.0 elif x_46_im <= 1.2e-25: tmp = math.pow(x_46_re, y_46_re) * 1.0 else: tmp = math.pow(x_46_im, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -2.55e-33) tmp = Float64((Float64(-1.0 * x_46_im) ^ y_46_re) * 1.0); elseif (x_46_im <= 1.2e-25) tmp = Float64((x_46_re ^ y_46_re) * 1.0); else tmp = Float64((x_46_im ^ y_46_re) * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -2.55e-33) tmp = ((-1.0 * x_46_im) ^ y_46_re) * 1.0; elseif (x_46_im <= 1.2e-25) tmp = (x_46_re ^ y_46_re) * 1.0; else tmp = (x_46_im ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -2.55e-33], N[(N[Power[N[(-1.0 * x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[x$46$im, 1.2e-25], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -2.55 \cdot 10^{-33}:\\
\;\;\;\;{\left(-1 \cdot x.im\right)}^{y.re} \cdot 1\\
\mathbf{elif}\;x.im \leq 1.2 \cdot 10^{-25}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\end{array}
\end{array}
if x.im < -2.55000000000000004e-33Initial program 32.5%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites39.6%
Taylor expanded in y.re around 0
Applied rewrites60.8%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.4
Applied rewrites51.4%
Taylor expanded in x.im around -inf
lower-*.f6458.9
Applied rewrites58.9%
if -2.55000000000000004e-33 < x.im < 1.20000000000000005e-25Initial program 49.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.9%
Taylor expanded in y.re around 0
Applied rewrites68.3%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6457.5
Applied rewrites57.5%
Taylor expanded in x.re around inf
Applied rewrites51.0%
if 1.20000000000000005e-25 < x.im Initial program 34.8%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites43.2%
Taylor expanded in y.re around 0
Applied rewrites62.4%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.3
Applied rewrites51.3%
Taylor expanded in x.re around 0
Applied rewrites58.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -7800000000.0) (* (pow x.im y.re) 1.0) (if (<= y.re 185.0) 1.0 (* (pow x.re y.re) 1.0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -7800000000.0) {
tmp = pow(x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= 185.0) {
tmp = 1.0;
} else {
tmp = pow(x_46_re, y_46_re) * 1.0;
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-7800000000.0d0)) then
tmp = (x_46im ** y_46re) * 1.0d0
else if (y_46re <= 185.0d0) then
tmp = 1.0d0
else
tmp = (x_46re ** y_46re) * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -7800000000.0) {
tmp = Math.pow(x_46_im, y_46_re) * 1.0;
} else if (y_46_re <= 185.0) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_re, y_46_re) * 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -7800000000.0: tmp = math.pow(x_46_im, y_46_re) * 1.0 elif y_46_re <= 185.0: tmp = 1.0 else: tmp = math.pow(x_46_re, y_46_re) * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -7800000000.0) tmp = Float64((x_46_im ^ y_46_re) * 1.0); elseif (y_46_re <= 185.0) tmp = 1.0; else tmp = Float64((x_46_re ^ y_46_re) * 1.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -7800000000.0) tmp = (x_46_im ^ y_46_re) * 1.0; elseif (y_46_re <= 185.0) tmp = 1.0; else tmp = (x_46_re ^ y_46_re) * 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -7800000000.0], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[y$46$re, 185.0], 1.0, N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -7800000000:\\
\;\;\;\;{x.im}^{y.re} \cdot 1\\
\mathbf{elif}\;y.re \leq 185:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot 1\\
\end{array}
\end{array}
if y.re < -7.8e9Initial program 40.2%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites43.2%
Taylor expanded in y.re around 0
Applied rewrites84.8%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6481.2
Applied rewrites81.2%
Taylor expanded in x.re around 0
Applied rewrites58.4%
if -7.8e9 < y.re < 185Initial program 43.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6435.0
Applied rewrites35.0%
Taylor expanded in y.re around 0
Applied rewrites47.8%
if 185 < y.re Initial program 35.6%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites52.5%
Taylor expanded in y.re around 0
Applied rewrites70.8%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6466.8
Applied rewrites66.8%
Taylor expanded in x.re around inf
Applied rewrites54.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (* (pow x.im y.re) 1.0))) (if (<= y.re -7800000000.0) t_0 (if (<= y.re 0.00062) 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -7800000000.0) {
tmp = t_0;
} else if (y_46_re <= 0.00062) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im ** y_46re) * 1.0d0
if (y_46re <= (-7800000000.0d0)) then
tmp = t_0
else if (y_46re <= 0.00062d0) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(x_46_im, y_46_re) * 1.0;
double tmp;
if (y_46_re <= -7800000000.0) {
tmp = t_0;
} else if (y_46_re <= 0.00062) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(x_46_im, y_46_re) * 1.0 tmp = 0 if y_46_re <= -7800000000.0: tmp = t_0 elif y_46_re <= 0.00062: tmp = 1.0 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64((x_46_im ^ y_46_re) * 1.0) tmp = 0.0 if (y_46_re <= -7800000000.0) tmp = t_0; elseif (y_46_re <= 0.00062) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im ^ y_46_re) * 1.0; tmp = 0.0; if (y_46_re <= -7800000000.0) tmp = t_0; elseif (y_46_re <= 0.00062) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[y$46$re, -7800000000.0], t$95$0, If[LessEqual[y$46$re, 0.00062], 1.0, t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x.im}^{y.re} \cdot 1\\
\mathbf{if}\;y.re \leq -7800000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 0.00062:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -7.8e9 or 6.2e-4 < y.re Initial program 37.9%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites47.9%
Taylor expanded in y.re around 0
Applied rewrites77.5%
Taylor expanded in y.im around 0
sqrt-pow2N/A
pow2N/A
pow2N/A
sqrt-pow2N/A
lower-pow.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6473.5
Applied rewrites73.5%
Taylor expanded in x.re around 0
Applied rewrites54.5%
if -7.8e9 < y.re < 6.2e-4Initial program 43.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6435.0
Applied rewrites35.0%
Taylor expanded in y.re around 0
Applied rewrites48.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 1.7e-42)
1.0
(if (<= y.re 4.5e+82)
(+ 1.0 (* y.re (log (sqrt (* x.im x.im)))))
(+ 1.0 (* y.re (log (sqrt (* x.re x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 1.7e-42) {
tmp = 1.0;
} else if (y_46_re <= 4.5e+82) {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_im * x_46_im))));
} else {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 1.7d-42) then
tmp = 1.0d0
else if (y_46re <= 4.5d+82) then
tmp = 1.0d0 + (y_46re * log(sqrt((x_46im * x_46im))))
else
tmp = 1.0d0 + (y_46re * log(sqrt((x_46re * x_46re))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 1.7e-42) {
tmp = 1.0;
} else if (y_46_re <= 4.5e+82) {
tmp = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_im * x_46_im))));
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_re * x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 1.7e-42: tmp = 1.0 elif y_46_re <= 4.5e+82: tmp = 1.0 + (y_46_re * math.log(math.sqrt((x_46_im * x_46_im)))) else: tmp = 1.0 + (y_46_re * math.log(math.sqrt((x_46_re * x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 1.7e-42) tmp = 1.0; elseif (y_46_re <= 4.5e+82) tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_im * x_46_im))))); else tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 1.7e-42) tmp = 1.0; elseif (y_46_re <= 4.5e+82) tmp = 1.0 + (y_46_re * log(sqrt((x_46_im * x_46_im)))); else tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 1.7e-42], 1.0, If[LessEqual[y$46$re, 4.5e+82], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 1.7 \cdot 10^{-42}:\\
\;\;\;\;1\\
\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{+82}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.im \cdot x.im}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\end{array}
\end{array}
if y.re < 1.70000000000000011e-42Initial program 42.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6450.4
Applied rewrites50.4%
Taylor expanded in y.re around 0
Applied rewrites33.0%
if 1.70000000000000011e-42 < y.re < 4.4999999999999997e82Initial program 39.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.4
Applied rewrites49.4%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6427.7
Applied rewrites27.7%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6420.9
Applied rewrites20.9%
if 4.4999999999999997e82 < y.re Initial program 34.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6459.2
Applied rewrites59.2%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6429.6
Applied rewrites29.6%
Taylor expanded in x.re around inf
pow2N/A
lift-*.f6421.0
Applied rewrites21.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 8e-20) 1.0 (* y.re (log (sqrt (fma x.im x.im (* x.re x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 8e-20) {
tmp = 1.0;
} else {
tmp = y_46_re * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 8e-20) tmp = 1.0; else tmp = Float64(y_46_re * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 8e-20], 1.0, N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 8 \cdot 10^{-20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\\
\end{array}
\end{array}
if y.re < 7.99999999999999956e-20Initial program 42.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6449.9
Applied rewrites49.9%
Taylor expanded in y.re around 0
Applied rewrites33.5%
if 7.99999999999999956e-20 < y.re Initial program 35.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6457.5
Applied rewrites57.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6428.8
Applied rewrites28.8%
Taylor expanded in y.re around inf
lower-*.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-log.f6428.2
Applied rewrites28.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 6e-36) 1.0 (+ 1.0 (* y.re (log (sqrt (* x.im x.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 6e-36) {
tmp = 1.0;
} else {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_im * x_46_im))));
}
return tmp;
}
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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 6d-36) then
tmp = 1.0d0
else
tmp = 1.0d0 + (y_46re * log(sqrt((x_46im * x_46im))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 6e-36) {
tmp = 1.0;
} else {
tmp = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_im * x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 6e-36: tmp = 1.0 else: tmp = 1.0 + (y_46_re * math.log(math.sqrt((x_46_im * x_46_im)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 6e-36) tmp = 1.0; else tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_im * x_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 6e-36) tmp = 1.0; else tmp = 1.0 + (y_46_re * log(sqrt((x_46_im * x_46_im)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 6e-36], 1.0, N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$im * x$46$im), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 6 \cdot 10^{-36}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.im \cdot x.im}\right)\\
\end{array}
\end{array}
if y.re < 6.0000000000000003e-36Initial program 42.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6450.2
Applied rewrites50.2%
Taylor expanded in y.re around 0
Applied rewrites33.2%
if 6.0000000000000003e-36 < y.re Initial program 36.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6456.3
Applied rewrites56.3%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6428.9
Applied rewrites28.9%
Taylor expanded in x.re around 0
pow2N/A
lift-*.f6419.6
Applied rewrites19.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 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(x_46re, x_46im, y_46re, y_46im)
use fmin_fmax_functions
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 40.6%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-pow.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6451.9
Applied rewrites51.9%
Taylor expanded in y.re around 0
Applied rewrites25.6%
herbie shell --seed 2025114
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))