
(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 17 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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (cos t_1))
(t_3 (- (log x.re))))
(if (<= x.re -1e+138)
(* (exp (- (* (log (* -1.0 x.re)) y.re) t_0)) t_2)
(if (<= x.re 2e-10)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
t_2)
(*
(cos (fma -1.0 (* y.im t_3) t_1))
(exp (- (* -1.0 (* y.re t_3)) (* y.im (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = cos(t_1);
double t_3 = -log(x_46_re);
double tmp;
if (x_46_re <= -1e+138) {
tmp = exp(((log((-1.0 * x_46_re)) * y_46_re) - t_0)) * t_2;
} else if (x_46_re <= 2e-10) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_2;
} else {
tmp = cos(fma(-1.0, (y_46_im * t_3), t_1)) * exp(((-1.0 * (y_46_re * t_3)) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = cos(t_1) t_3 = Float64(-log(x_46_re)) tmp = 0.0 if (x_46_re <= -1e+138) tmp = Float64(exp(Float64(Float64(log(Float64(-1.0 * x_46_re)) * y_46_re) - t_0)) * t_2); elseif (x_46_re <= 2e-10) 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) - t_0)) * t_2); else tmp = Float64(cos(fma(-1.0, Float64(y_46_im * t_3), t_1)) * exp(Float64(Float64(-1.0 * Float64(y_46_re * t_3)) - Float64(y_46_im * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = (-N[Log[x$46$re], $MachinePrecision])}, If[LessEqual[x$46$re, -1e+138], N[(N[Exp[N[(N[(N[Log[N[(-1.0 * x$46$re), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[x$46$re, 2e-10], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Cos[N[(-1.0 * N[(y$46$im * t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos t\_1\\
t_3 := -\log x.re\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{+138}:\\
\;\;\;\;e^{\log \left(-1 \cdot x.re\right) \cdot y.re - t\_0} \cdot t\_2\\
\mathbf{elif}\;x.re \leq 2 \cdot 10^{-10}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(-1, y.im \cdot t\_3, t\_1\right)\right) \cdot e^{-1 \cdot \left(y.re \cdot t\_3\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if x.re < -1e138Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in x.re around -inf
lower-*.f6437.6
Applied rewrites37.6%
if -1e138 < x.re < 2.00000000000000007e-10Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
if 2.00000000000000007e-10 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (- (log x.im)))
(t_3 (log (* -1.0 x.im))))
(if (<= x.im -9.3e+58)
(*
(exp (- (* t_3 y.re) t_0))
(cos (+ (* t_3 y.im) (* (atan2 x.im x.re) y.re))))
(if (<= x.im 6.2e+20)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(cos t_1))
(*
(cos (fma -1.0 (* y.im t_2) t_1))
(exp (- (* -1.0 (* y.re t_2)) (* y.im (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = -log(x_46_im);
double t_3 = log((-1.0 * x_46_im));
double tmp;
if (x_46_im <= -9.3e+58) {
tmp = exp(((t_3 * y_46_re) - t_0)) * cos(((t_3 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
} else if (x_46_im <= 6.2e+20) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * cos(t_1);
} else {
tmp = cos(fma(-1.0, (y_46_im * t_2), t_1)) * exp(((-1.0 * (y_46_re * t_2)) - (y_46_im * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(-log(x_46_im)) t_3 = log(Float64(-1.0 * x_46_im)) tmp = 0.0 if (x_46_im <= -9.3e+58) tmp = Float64(exp(Float64(Float64(t_3 * y_46_re) - t_0)) * cos(Float64(Float64(t_3 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))); elseif (x_46_im <= 6.2e+20) 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) - t_0)) * cos(t_1)); else tmp = Float64(cos(fma(-1.0, Float64(y_46_im * t_2), t_1)) * exp(Float64(Float64(-1.0 * Float64(y_46_re * t_2)) - Float64(y_46_im * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = (-N[Log[x$46$im], $MachinePrecision])}, Block[{t$95$3 = N[Log[N[(-1.0 * x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -9.3e+58], N[(N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$3 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6.2e+20], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(-1.0 * N[(y$46$im * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(-1.0 * N[(y$46$re * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := -\log x.im\\
t_3 := \log \left(-1 \cdot x.im\right)\\
\mathbf{if}\;x.im \leq -9.3 \cdot 10^{+58}:\\
\;\;\;\;e^{t\_3 \cdot y.re - t\_0} \cdot \cos \left(t\_3 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;x.im \leq 6.2 \cdot 10^{+20}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \cos t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(-1, y.im \cdot t\_2, t\_1\right)\right) \cdot e^{-1 \cdot \left(y.re \cdot t\_2\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if x.im < -9.29999999999999977e58Initial program 39.9%
Taylor expanded in x.im around -inf
lower-*.f6417.2
Applied rewrites17.2%
Taylor expanded in x.im around -inf
lower-*.f6435.3
Applied rewrites35.3%
if -9.29999999999999977e58 < x.im < 6.2e20Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
if 6.2e20 < x.im Initial program 39.9%
Taylor expanded in x.im around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites35.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (cos t_1)))
(if (<= x.re -1e+138)
(* (exp (- (* (log (* -1.0 x.re)) y.re) t_0)) t_2)
(if (<= x.re 1.18e+73)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
t_2)
(* (cos (fma -1.0 (* y.im (- (log x.re))) t_1)) (pow 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = cos(t_1);
double tmp;
if (x_46_re <= -1e+138) {
tmp = exp(((log((-1.0 * x_46_re)) * y_46_re) - t_0)) * t_2;
} else if (x_46_re <= 1.18e+73) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * t_2;
} else {
tmp = cos(fma(-1.0, (y_46_im * -log(x_46_re)), t_1)) * pow(x_46_re, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = cos(t_1) tmp = 0.0 if (x_46_re <= -1e+138) tmp = Float64(exp(Float64(Float64(log(Float64(-1.0 * x_46_re)) * y_46_re) - t_0)) * t_2); elseif (x_46_re <= 1.18e+73) 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) - t_0)) * t_2); else tmp = Float64(cos(fma(-1.0, Float64(y_46_im * Float64(-log(x_46_re))), t_1)) * (x_46_re ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -1e+138], N[(N[Exp[N[(N[(N[Log[N[(-1.0 * x$46$re), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[x$46$re, 1.18e+73], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[Cos[N[(-1.0 * N[(y$46$im * (-N[Log[x$46$re], $MachinePrecision])), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos t\_1\\
\mathbf{if}\;x.re \leq -1 \cdot 10^{+138}:\\
\;\;\;\;e^{\log \left(-1 \cdot x.re\right) \cdot y.re - t\_0} \cdot t\_2\\
\mathbf{elif}\;x.re \leq 1.18 \cdot 10^{+73}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(-1, y.im \cdot \left(-\log x.re\right), t\_1\right)\right) \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -1e138Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in x.re around -inf
lower-*.f6437.6
Applied rewrites37.6%
if -1e138 < x.re < 1.18000000000000004e73Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
if 1.18000000000000004e73 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
Taylor expanded in y.im around 0
lower-pow.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (* y.re (atan2 x.im x.re))))
(if (<= x.re -24500000000.0)
(* (exp (- (* (log (* -1.0 x.re)) y.re) t_0)) (cos t_1))
(if (<= x.re 6.5e-168)
(* (sin (* 0.5 PI)) (pow (fabs x.im) y.re))
(if (<= x.re 1.1e+73)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(+ 1.0 (* -0.5 (pow t_1 2.0))))
(* (cos (fma -1.0 (* y.im (- (log x.re))) t_1)) (pow 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -24500000000.0) {
tmp = exp(((log((-1.0 * x_46_re)) * y_46_re) - t_0)) * cos(t_1);
} else if (x_46_re <= 6.5e-168) {
tmp = sin((0.5 * ((double) M_PI))) * pow(fabs(x_46_im), y_46_re);
} else if (x_46_re <= 1.1e+73) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * (1.0 + (-0.5 * pow(t_1, 2.0)));
} else {
tmp = cos(fma(-1.0, (y_46_im * -log(x_46_re)), t_1)) * pow(x_46_re, y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -24500000000.0) tmp = Float64(exp(Float64(Float64(log(Float64(-1.0 * x_46_re)) * y_46_re) - t_0)) * cos(t_1)); elseif (x_46_re <= 6.5e-168) tmp = Float64(sin(Float64(0.5 * pi)) * (abs(x_46_im) ^ y_46_re)); elseif (x_46_re <= 1.1e+73) 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) - t_0)) * Float64(1.0 + Float64(-0.5 * (t_1 ^ 2.0)))); else tmp = Float64(cos(fma(-1.0, Float64(y_46_im * Float64(-log(x_46_re))), t_1)) * (x_46_re ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -24500000000.0], N[(N[Exp[N[(N[(N[Log[N[(-1.0 * x$46$re), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6.5e-168], N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.1e+73], 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] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(-0.5 * N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(-1.0 * N[(y$46$im * (-N[Log[x$46$re], $MachinePrecision])), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -24500000000:\\
\;\;\;\;e^{\log \left(-1 \cdot x.re\right) \cdot y.re - t\_0} \cdot \cos t\_1\\
\mathbf{elif}\;x.re \leq 6.5 \cdot 10^{-168}:\\
\;\;\;\;\sin \left(0.5 \cdot \pi\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 1.1 \cdot 10^{+73}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \left(1 + -0.5 \cdot {t\_1}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(-1, y.im \cdot \left(-\log x.re\right), t\_1\right)\right) \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.45e10Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in x.re around -inf
lower-*.f6437.6
Applied rewrites37.6%
if -2.45e10 < x.re < 6.4999999999999997e-168Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6452.7
Applied rewrites52.7%
if 6.4999999999999997e-168 < x.re < 1.1e73Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6449.1
Applied rewrites49.1%
if 1.1e73 < x.re Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
Taylor expanded in y.im around 0
lower-pow.f6426.5
Applied rewrites26.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_1 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_1 (cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re)))) INFINITY)
(* t_1 (cos (* y.im (log (sqrt (fma x.im x.im (* x.re x.re)))))))
(* (sin (* 0.5 PI)) (pow (fabs x.im) 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))));
double t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_1 * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)))) <= ((double) INFINITY)) {
tmp = t_1 * cos((y_46_im * log(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))))));
} else {
tmp = sin((0.5 * ((double) M_PI))) * pow(fabs(x_46_im), y_46_re);
}
return tmp;
}
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)))) t_1 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_1 * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) <= Inf) tmp = Float64(t_1 * cos(Float64(y_46_im * log(sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))))))); else tmp = Float64(sin(Float64(0.5 * pi)) * (abs(x_46_im) ^ y_46_re)); end return tmp 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]}, Block[{t$95$1 = 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]}, If[LessEqual[N[(t$95$1 * 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], Infinity], N[(t$95$1 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_1 := e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_1 \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \cos \left(y.im \cdot \log \left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.5 \cdot \pi\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 39.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
lower-sqrt.f64N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6440.6
Applied rewrites40.6%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6452.7
Applied rewrites52.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ 1.0 (* -0.5 (pow (* y.re (atan2 x.im x.re)) 2.0))))
(t_1 (sin (* 0.5 PI))))
(if (<= y.re -8.2e+80)
(* t_1 (pow (+ (fabs x.im) (* 0.5 (/ (* x.re x.re) (fabs x.im)))) y.re))
(if (<= y.re -4.7e-166)
(*
(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 4.1e+15)
(* t_0 (pow (fabs x.im) y.re))
(* t_1 (pow (sqrt (fma x.im x.im (* x.re 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 = 1.0 + (-0.5 * pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0));
double t_1 = sin((0.5 * ((double) M_PI)));
double tmp;
if (y_46_re <= -8.2e+80) {
tmp = t_1 * pow((fabs(x_46_im) + (0.5 * ((x_46_re * x_46_re) / fabs(x_46_im)))), y_46_re);
} else if (y_46_re <= -4.7e-166) {
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 <= 4.1e+15) {
tmp = t_0 * pow(fabs(x_46_im), y_46_re);
} else {
tmp = t_1 * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + Float64(-0.5 * (Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0))) t_1 = sin(Float64(0.5 * pi)) tmp = 0.0 if (y_46_re <= -8.2e+80) tmp = Float64(t_1 * (Float64(abs(x_46_im) + Float64(0.5 * Float64(Float64(x_46_re * x_46_re) / abs(x_46_im)))) ^ y_46_re)); elseif (y_46_re <= -4.7e-166) 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 <= 4.1e+15) tmp = Float64(t_0 * (abs(x_46_im) ^ y_46_re)); else tmp = Float64(t_1 * (sqrt(fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re))) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 + N[(-0.5 * N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e+80], N[(t$95$1 * N[Power[N[(N[Abs[x$46$im], $MachinePrecision] + N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / N[Abs[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -4.7e-166], 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, 4.1e+15], N[(t$95$0 * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 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]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + -0.5 \cdot {\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}\\
t_1 := \sin \left(0.5 \cdot \pi\right)\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{+80}:\\
\;\;\;\;t\_1 \cdot {\left(\left|x.im\right| + 0.5 \cdot \frac{x.re \cdot x.re}{\left|x.im\right|}\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -4.7 \cdot 10^{-166}:\\
\;\;\;\;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 4.1 \cdot 10^{+15}:\\
\;\;\;\;t\_0 \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -8.20000000000000003e80Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
lower-+.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f64N/A
lower-*.f64N/A
lower-/.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6454.5
Applied rewrites54.5%
if -8.20000000000000003e80 < y.re < -4.70000000000000014e-166Initial program 39.9%
Taylor expanded in y.im around 0
lower-cos.f64N/A
lower-*.f64N/A
lift-atan2.f6462.1
Applied rewrites62.1%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6449.1
Applied rewrites49.1%
if -4.70000000000000014e-166 < y.re < 4.1e15Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6440.4
Applied rewrites40.4%
if 4.1e15 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sqrt (fma x.im x.im (* x.re x.re))))
(t_1 (* (sin (* 0.5 PI)) (pow t_0 y.re))))
(if (<= y.re -1.45e-12)
t_1
(if (<= y.re -3.2e-164)
(*
(exp (- (* y.im (atan2 x.im x.re))))
(sin (fma 0.5 PI (* y.im (log t_0)))))
(if (<= y.re 4.1e+15)
(*
(+ 1.0 (* -0.5 (pow (* y.re (atan2 x.im x.re)) 2.0)))
(pow (fabs x.im) y.re))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re)));
double t_1 = sin((0.5 * ((double) M_PI))) * pow(t_0, y_46_re);
double tmp;
if (y_46_re <= -1.45e-12) {
tmp = t_1;
} else if (y_46_re <= -3.2e-164) {
tmp = exp(-(y_46_im * atan2(x_46_im, x_46_re))) * sin(fma(0.5, ((double) M_PI), (y_46_im * log(t_0))));
} else if (y_46_re <= 4.1e+15) {
tmp = (1.0 + (-0.5 * pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0))) * pow(fabs(x_46_im), y_46_re);
} else {
tmp = t_1;
}
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))) t_1 = Float64(sin(Float64(0.5 * pi)) * (t_0 ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.45e-12) tmp = t_1; elseif (y_46_re <= -3.2e-164) tmp = Float64(exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(fma(0.5, pi, Float64(y_46_im * log(t_0))))); elseif (y_46_re <= 4.1e+15) tmp = Float64(Float64(1.0 + Float64(-0.5 * (Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0))) * (abs(x_46_im) ^ y_46_re)); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sqrt[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[Power[t$95$0, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.45e-12], t$95$1, If[LessEqual[y$46$re, -3.2e-164], N[(N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision] * N[Sin[N[(0.5 * Pi + N[(y$46$im * N[Log[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.1e+15], N[(N[(1.0 + N[(-0.5 * N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\\
t_1 := \sin \left(0.5 \cdot \pi\right) \cdot {t\_0}^{y.re}\\
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-164}:\\
\;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, y.im \cdot \log t\_0\right)\right)\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + -0.5 \cdot {\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.4500000000000001e-12 or 4.1e15 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
if -1.4500000000000001e-12 < y.re < -3.2e-164Initial program 39.9%
Taylor expanded in y.re around 0
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
lift-atan2.f6426.8
Applied rewrites26.8%
lift-cos.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-log.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
Applied rewrites26.9%
Taylor expanded in y.re around 0
lower-fma.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
pow2N/A
pow2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-log.f6426.8
Applied rewrites26.8%
if -3.2e-164 < y.re < 4.1e15Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6440.4
Applied rewrites40.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* 0.5 PI)) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -9e-13)
t_0
(if (<= y.re -5.2e-166)
(* (cos (* y.im (log x.re))) (exp (- (* y.im (atan2 x.im x.re)))))
(if (<= y.re 4.1e+15)
(*
(+ 1.0 (* -0.5 (pow (* y.re (atan2 x.im x.re)) 2.0)))
(pow (fabs x.im) y.re))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -9e-13) {
tmp = t_0;
} else if (y_46_re <= -5.2e-166) {
tmp = cos((y_46_im * log(x_46_re))) * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4.1e+15) {
tmp = (1.0 + (-0.5 * pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0))) * pow(fabs(x_46_im), y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(0.5 * pi)) * (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 <= -9e-13) tmp = t_0; elseif (y_46_re <= -5.2e-166) tmp = Float64(cos(Float64(y_46_im * log(x_46_re))) * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4.1e+15) tmp = Float64(Float64(1.0 + Float64(-0.5 * (Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0))) * (abs(x_46_im) ^ y_46_re)); 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[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision]}, If[LessEqual[y$46$re, -9e-13], t$95$0, If[LessEqual[y$46$re, -5.2e-166], N[(N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.1e+15], N[(N[(1.0 + N[(-0.5 * N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -5.2 \cdot 10^{-166}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.re\right) \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + -0.5 \cdot {\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9e-13 or 4.1e15 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
if -9e-13 < y.re < -5.19999999999999979e-166Initial program 39.9%
Taylor expanded in x.re around inf
lower-*.f64N/A
lower-cos.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
log-recN/A
lower-neg.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites34.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift-atan2.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-exp.f6423.1
Applied rewrites23.1%
if -5.19999999999999979e-166 < y.re < 4.1e15Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6440.4
Applied rewrites40.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(* (sin (* 0.5 PI)) (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))
(if (<= y.re -1.15e-98)
t_0
(if (<= y.re 4.1e+15)
(*
(+ 1.0 (* -0.5 (pow (* y.re (atan2 x.im x.re)) 2.0)))
(pow (fabs x.im) y.re))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI))) * pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re);
double tmp;
if (y_46_re <= -1.15e-98) {
tmp = t_0;
} else if (y_46_re <= 4.1e+15) {
tmp = (1.0 + (-0.5 * pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0))) * pow(fabs(x_46_im), y_46_re);
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(0.5 * pi)) * (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 <= -1.15e-98) tmp = t_0; elseif (y_46_re <= 4.1e+15) tmp = Float64(Float64(1.0 + Float64(-0.5 * (Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0))) * (abs(x_46_im) ^ y_46_re)); 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[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.15e-98], t$95$0, If[LessEqual[y$46$re, 4.1e+15], N[(N[(1.0 + N[(-0.5 * N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right) \cdot {\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{-98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + -0.5 \cdot {\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.15e-98 or 4.1e15 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
if -1.15e-98 < y.re < 4.1e15Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
pow-prod-downN/A
lower-pow.f64N/A
lift-atan2.f64N/A
lift-*.f6439.6
Applied rewrites39.6%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6440.4
Applied rewrites40.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* 0.5 PI))) (t_1 (* t_0 (pow (fabs x.im) y.re))))
(if (<= x.im -2.8e-50)
t_1
(if (<= x.im 320.0) (* t_0 (pow (sqrt (* x.re x.re)) y.re)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((0.5 * ((double) M_PI)));
double t_1 = t_0 * pow(fabs(x_46_im), y_46_re);
double tmp;
if (x_46_im <= -2.8e-50) {
tmp = t_1;
} else if (x_46_im <= 320.0) {
tmp = t_0 * pow(sqrt((x_46_re * x_46_re)), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((0.5 * Math.PI));
double t_1 = t_0 * Math.pow(Math.abs(x_46_im), y_46_re);
double tmp;
if (x_46_im <= -2.8e-50) {
tmp = t_1;
} else if (x_46_im <= 320.0) {
tmp = t_0 * Math.pow(Math.sqrt((x_46_re * x_46_re)), y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((0.5 * math.pi)) t_1 = t_0 * math.pow(math.fabs(x_46_im), y_46_re) tmp = 0 if x_46_im <= -2.8e-50: tmp = t_1 elif x_46_im <= 320.0: tmp = t_0 * math.pow(math.sqrt((x_46_re * x_46_re)), y_46_re) else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(0.5 * pi)) t_1 = Float64(t_0 * (abs(x_46_im) ^ y_46_re)) tmp = 0.0 if (x_46_im <= -2.8e-50) tmp = t_1; elseif (x_46_im <= 320.0) tmp = Float64(t_0 * (sqrt(Float64(x_46_re * x_46_re)) ^ y_46_re)); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((0.5 * pi)); t_1 = t_0 * (abs(x_46_im) ^ y_46_re); tmp = 0.0; if (x_46_im <= -2.8e-50) tmp = t_1; elseif (x_46_im <= 320.0) tmp = t_0 * (sqrt((x_46_re * x_46_re)) ^ y_46_re); else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -2.8e-50], t$95$1, If[LessEqual[x$46$im, 320.0], N[(t$95$0 * N[Power[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(0.5 \cdot \pi\right)\\
t_1 := t\_0 \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\mathbf{if}\;x.im \leq -2.8 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.im \leq 320:\\
\;\;\;\;t\_0 \cdot {\left(\sqrt{x.re \cdot x.re}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.im < -2.7999999999999998e-50 or 320 < x.im Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6452.7
Applied rewrites52.7%
if -2.7999999999999998e-50 < x.im < 320Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.im around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6446.0
Applied rewrites46.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -2e+130) (+ 1.0 (log (pow (* -1.0 x.re) y.re))) (* (sin (* 0.5 PI)) (pow (fabs x.im) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2e+130) {
tmp = 1.0 + log(pow((-1.0 * x_46_re), y_46_re));
} else {
tmp = sin((0.5 * ((double) M_PI))) * pow(fabs(x_46_im), y_46_re);
}
return tmp;
}
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_re <= -2e+130) {
tmp = 1.0 + Math.log(Math.pow((-1.0 * x_46_re), y_46_re));
} else {
tmp = Math.sin((0.5 * Math.PI)) * Math.pow(Math.abs(x_46_im), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -2e+130: tmp = 1.0 + math.log(math.pow((-1.0 * x_46_re), y_46_re)) else: tmp = math.sin((0.5 * math.pi)) * math.pow(math.fabs(x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -2e+130) tmp = Float64(1.0 + log((Float64(-1.0 * x_46_re) ^ y_46_re))); else tmp = Float64(sin(Float64(0.5 * pi)) * (abs(x_46_im) ^ y_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 (x_46_re <= -2e+130) tmp = 1.0 + log(((-1.0 * x_46_re) ^ y_46_re)); else tmp = sin((0.5 * pi)) * (abs(x_46_im) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -2e+130], N[(1.0 + N[Log[N[Power[N[(-1.0 * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision] * N[Power[N[Abs[x$46$im], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2 \cdot 10^{+130}:\\
\;\;\;\;1 + \log \left({\left(-1 \cdot x.re\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.5 \cdot \pi\right) \cdot {\left(\left|x.im\right|\right)}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.0000000000000001e130Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
lift-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f6426.0
Applied rewrites26.0%
if -2.0000000000000001e130 < x.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-*.f64N/A
lift-PI.f6454.7
Applied rewrites54.7%
Taylor expanded in x.re around 0
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6452.7
Applied rewrites52.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ 1.0 (log (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re)))))
(if (<= y.re -2.75e-27)
t_0
(if (<= y.re 1.45e-11) (+ 1.0 (* y.re (log (fabs x.im)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 + log(pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re));
double tmp;
if (y_46_re <= -2.75e-27) {
tmp = t_0;
} else if (y_46_re <= 1.45e-11) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + log((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 <= -2.75e-27) tmp = t_0; elseif (y_46_re <= 1.45e-11) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_im)))); 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[(1.0 + N[Log[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]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.75e-27], t$95$0, If[LessEqual[y$46$re, 1.45e-11], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \log \left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\right)\\
\mathbf{if}\;y.re \leq -2.75 \cdot 10^{-27}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-11}:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.im\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.7500000000000001e-27 or 1.45e-11 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
lift-log.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f6431.9
Applied rewrites31.9%
if -2.7500000000000001e-27 < y.re < 1.45e-11Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x.re around 0
lower-log.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (+ 1.0 (log (pow (sqrt (fma x.im x.im (* x.re x.re))) y.re))))) (if (<= y.re -2.75e-27) t_0 (if (<= y.re 1.45e-11) (sin (* 0.5 PI)) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 + log(pow(sqrt(fma(x_46_im, x_46_im, (x_46_re * x_46_re))), y_46_re));
double tmp;
if (y_46_re <= -2.75e-27) {
tmp = t_0;
} else if (y_46_re <= 1.45e-11) {
tmp = sin((0.5 * ((double) M_PI)));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + log((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 <= -2.75e-27) tmp = t_0; elseif (y_46_re <= 1.45e-11) tmp = sin(Float64(0.5 * pi)); 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[(1.0 + N[Log[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]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.75e-27], t$95$0, If[LessEqual[y$46$re, 1.45e-11], N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \log \left({\left(\sqrt{\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)}\right)}^{y.re}\right)\\
\mathbf{if}\;y.re \leq -2.75 \cdot 10^{-27}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-11}:\\
\;\;\;\;\sin \left(0.5 \cdot \pi\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.7500000000000001e-27 or 1.45e-11 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
lift-*.f64N/A
lift-log.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-pow.f6431.9
Applied rewrites31.9%
if -2.7500000000000001e-27 < y.re < 1.45e-11Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
lift-cos.f64N/A
lift-*.f64N/A
lift-atan2.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lower-fma.f64N/A
lift-atan2.f64N/A
lower-/.f64N/A
lower-PI.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-sin.f64N/A
lower-*.f64N/A
lift-PI.f6425.5
Applied rewrites25.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.8e-21)
(+ 1.0 (* y.re (log (sqrt (* x.re x.re)))))
(if (<= y.re 6200000.0)
(+ 1.0 (* y.re (log (fabs x.im))))
(+ 1.0 (log (pow (* -1.0 x.re) y.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 <= -2.8e-21) {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_im)));
} else {
tmp = 1.0 + log(pow((-1.0 * x_46_re), y_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 <= (-2.8d-21)) then
tmp = 1.0d0 + (y_46re * log(sqrt((x_46re * x_46re))))
else if (y_46re <= 6200000.0d0) then
tmp = 1.0d0 + (y_46re * log(abs(x_46im)))
else
tmp = 1.0d0 + log((((-1.0d0) * x_46re) ** y_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 <= -2.8e-21) {
tmp = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_re * x_46_re))));
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * Math.log(Math.abs(x_46_im)));
} else {
tmp = 1.0 + Math.log(Math.pow((-1.0 * x_46_re), y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -2.8e-21: tmp = 1.0 + (y_46_re * math.log(math.sqrt((x_46_re * x_46_re)))) elif y_46_re <= 6200000.0: tmp = 1.0 + (y_46_re * math.log(math.fabs(x_46_im))) else: tmp = 1.0 + math.log(math.pow((-1.0 * x_46_re), y_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 <= -2.8e-21) tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))); elseif (y_46_re <= 6200000.0) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_im)))); else tmp = Float64(1.0 + log((Float64(-1.0 * x_46_re) ^ y_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 <= -2.8e-21) tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re)))); elseif (y_46_re <= 6200000.0) tmp = 1.0 + (y_46_re * log(abs(x_46_im))); else tmp = 1.0 + log(((-1.0 * x_46_re) ^ y_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, -2.8e-21], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6200000.0], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[N[Power[N[(-1.0 * x$46$re), $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\mathbf{elif}\;y.re \leq 6200000:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.im\right|\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(-1 \cdot x.re\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -2.80000000000000004e-21Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.80000000000000004e-21 < y.re < 6.2e6Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x.re around 0
lower-log.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
if 6.2e6 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
lift-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
lower-log.f64N/A
lower-pow.f6426.0
Applied rewrites26.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.8e-21)
(+ 1.0 (* y.re (log (sqrt (* x.re x.re)))))
(if (<= y.re 1.45e-11)
(+ 1.0 (* y.re (log (fabs x.im))))
(+ 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 <= -2.8e-21) {
tmp = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
} else if (y_46_re <= 1.45e-11) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_im)));
} else {
tmp = 1.0 + (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 <= -2.8e-21) tmp = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))); elseif (y_46_re <= 1.45e-11) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_im)))); else tmp = Float64(1.0 + 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, -2.8e-21], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.45e-11], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-11}:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.im\right|\right)\\
\mathbf{else}:\\
\;\;\;\;1 + 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 < -2.80000000000000004e-21Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.80000000000000004e-21 < y.re < 1.45e-11Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x.re around 0
lower-log.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
if 1.45e-11 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ 1.0 (* y.re (log (sqrt (* x.re x.re)))))))
(if (<= y.re -2.8e-21)
t_0
(if (<= y.re 6200000.0) (+ 1.0 (* y.re (log (fabs x.im)))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re))));
double tmp;
if (y_46_re <= -2.8e-21) {
tmp = t_0;
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * log(fabs(x_46_im)));
} 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 = 1.0d0 + (y_46re * log(sqrt((x_46re * x_46re))))
if (y_46re <= (-2.8d-21)) then
tmp = t_0
else if (y_46re <= 6200000.0d0) then
tmp = 1.0d0 + (y_46re * log(abs(x_46im)))
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 = 1.0 + (y_46_re * Math.log(Math.sqrt((x_46_re * x_46_re))));
double tmp;
if (y_46_re <= -2.8e-21) {
tmp = t_0;
} else if (y_46_re <= 6200000.0) {
tmp = 1.0 + (y_46_re * Math.log(Math.abs(x_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 + (y_46_re * math.log(math.sqrt((x_46_re * x_46_re)))) tmp = 0 if y_46_re <= -2.8e-21: tmp = t_0 elif y_46_re <= 6200000.0: tmp = 1.0 + (y_46_re * math.log(math.fabs(x_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 + Float64(y_46_re * log(sqrt(Float64(x_46_re * x_46_re))))) tmp = 0.0 if (y_46_re <= -2.8e-21) tmp = t_0; elseif (y_46_re <= 6200000.0) tmp = Float64(1.0 + Float64(y_46_re * log(abs(x_46_im)))); 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 = 1.0 + (y_46_re * log(sqrt((x_46_re * x_46_re)))); tmp = 0.0; if (y_46_re <= -2.8e-21) tmp = t_0; elseif (y_46_re <= 6200000.0) tmp = 1.0 + (y_46_re * log(abs(x_46_im))); 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[(1.0 + N[(y$46$re * N[Log[N[Sqrt[N[(x$46$re * x$46$re), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.8e-21], t$95$0, If[LessEqual[y$46$re, 6200000.0], N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + y.re \cdot \log \left(\sqrt{x.re \cdot x.re}\right)\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 6200000:\\
\;\;\;\;1 + y.re \cdot \log \left(\left|x.im\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -2.80000000000000004e-21 or 6.2e6 < y.re Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.im around 0
lower-sqrt.f64N/A
pow2N/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.80000000000000004e-21 < y.re < 6.2e6Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x.re around 0
lower-log.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (log (fabs x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (y_46_re * log(fabs(x_46_im)));
}
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 + (y_46re * log(abs(x_46im)))
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 + (y_46_re * Math.log(Math.abs(x_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (y_46_re * math.log(math.fabs(x_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(y_46_re * log(abs(x_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (y_46_re * log(abs(x_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Abs[x$46$im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\left|x.im\right|\right)
\end{array}
Initial program 39.9%
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-*.f6452.5
Applied rewrites52.5%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
pow2N/A
pow2N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-sqrt.f6424.7
Applied rewrites24.7%
Taylor expanded in x.re around -inf
lower-*.f6413.3
Applied rewrites13.3%
Taylor expanded in x.re around 0
lower-log.f64N/A
pow2N/A
rem-sqrt-squareN/A
lower-fabs.f6425.7
Applied rewrites25.7%
herbie shell --seed 2025142
(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)))))