
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 (log (hypot x.re x.im))) (t_1 (* (atan2 x.im x.re) y.im)))
(if (or (<= y.re -0.135) (not (<= y.re 1.85)))
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_1))
(sin (* y.re (atan2 x.im x.re))))
(*
(/ (exp (* t_0 y.re)) (exp t_1))
(sin (fma 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(hypot(x_46_re, x_46_im));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_re <= -0.135) || !(y_46_re <= 1.85)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_1)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = (exp((t_0 * y_46_re)) / exp(t_1)) * sin(fma(t_0, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if ((y_46_re <= -0.135) || !(y_46_re <= 1.85)) 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_1)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(Float64(exp(Float64(t_0 * y_46_re)) / exp(t_1)) * sin(fma(t_0, y_46_im, Float64(atan(x_46_im, 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.135], N[Not[LessEqual[y$46$re, 1.85]], $MachinePrecision]], 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$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(t$95$0 * y$46$re), $MachinePrecision]], $MachinePrecision] / N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + 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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -0.135 \lor \neg \left(y.re \leq 1.85\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_1} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{t\_0 \cdot y.re}}{e^{t\_1}} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.re < -0.13500000000000001 or 1.8500000000000001 < y.re Initial program 36.9%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6476.3
Applied rewrites76.3%
if -0.13500000000000001 < y.re < 1.8500000000000001Initial program 44.4%
Applied rewrites83.6%
Final simplification80.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (or (<= y.re -0.0062) (not (<= y.re 0.58)))
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(sin (* y.re (atan2 x.im x.re))))
(*
(/ 1.0 (exp t_0))
(sin (fma (log (hypot x.re x.im)) 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if ((y_46_re <= -0.0062) || !(y_46_re <= 0.58)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = (1.0 / exp(t_0)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (atan2(x_46_im, 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) tmp = 0.0 if ((y_46_re <= -0.0062) || !(y_46_re <= 0.58)) 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)) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(Float64(1.0 / exp(t_0)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(atan(x_46_im, 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]}, If[Or[LessEqual[y$46$re, -0.0062], N[Not[LessEqual[y$46$re, 0.58]], $MachinePrecision]], 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;y.re \leq -0.0062 \lor \neg \left(y.re \leq 0.58\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{e^{t\_0}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\\
\end{array}
\end{array}
if y.re < -0.00619999999999999978 or 0.57999999999999996 < y.re Initial program 36.9%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6476.3
Applied rewrites76.3%
if -0.00619999999999999978 < y.re < 0.57999999999999996Initial program 44.4%
Applied rewrites83.6%
Taylor expanded in y.re around 0
Applied rewrites82.4%
Final simplification79.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)))
(t_2 (* (atan2 x.im x.re) y.re))
(t_3 (log (hypot x.re x.im)))
(t_4 (* t_3 y.im)))
(if (<= x.im -6.5e-101)
(*
(exp (- (* t_3 y.re) t_0))
(sin (fma -1.0 (* y.im (log (/ -1.0 x.im))) t_1)))
(if (<= x.im 6e+154)
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(fma (sin t_4) (cos t_2) (* (cos t_4) (sin t_2))))
(*
(/ (exp (* y.re (log x.im))) (exp (* y.im (atan2 x.im x.re))))
(sin (fma y.im (log x.im) t_1)))))))
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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_3 = log(hypot(x_46_re, x_46_im));
double t_4 = t_3 * y_46_im;
double tmp;
if (x_46_im <= -6.5e-101) {
tmp = exp(((t_3 * y_46_re) - t_0)) * sin(fma(-1.0, (y_46_im * log((-1.0 / x_46_im))), t_1));
} else if (x_46_im <= 6e+154) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) * fma(sin(t_4), cos(t_2), (cos(t_4) * sin(t_2)));
} else {
tmp = (exp((y_46_re * log(x_46_im))) / exp((y_46_im * atan2(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_1));
}
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(atan(x_46_im, x_46_re) * y_46_re) t_3 = log(hypot(x_46_re, x_46_im)) t_4 = Float64(t_3 * y_46_im) tmp = 0.0 if (x_46_im <= -6.5e-101) tmp = Float64(exp(Float64(Float64(t_3 * y_46_re) - t_0)) * sin(fma(-1.0, Float64(y_46_im * log(Float64(-1.0 / x_46_im))), t_1))); elseif (x_46_im <= 6e+154) 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)) * fma(sin(t_4), cos(t_2), Float64(cos(t_4) * sin(t_2)))); else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_1))); 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -6.5e-101], N[(N[Exp[N[(N[(t$95$3 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(-1.0 * N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6e+154], 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[(N[Sin[t$95$4], $MachinePrecision] * N[Cos[t$95$2], $MachinePrecision] + N[(N[Cos[t$95$4], $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := t\_3 \cdot y.im\\
\mathbf{if}\;x.im \leq -6.5 \cdot 10^{-101}:\\
\;\;\;\;e^{t\_3 \cdot y.re - t\_0} \cdot \sin \left(\mathsf{fma}\left(-1, y.im \cdot \log \left(\frac{-1}{x.im}\right), t\_1\right)\right)\\
\mathbf{elif}\;x.im \leq 6 \cdot 10^{+154}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t\_0} \cdot \mathsf{fma}\left(\sin t\_4, \cos t\_2, \cos t\_4 \cdot \sin t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.im}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
\end{array}
\end{array}
if x.im < -6.4999999999999996e-101Initial program 37.7%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites40.1%
lift-sqrt.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6440.1
Applied rewrites40.1%
Taylor expanded in x.im around -inf
lower-sin.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lift-atan2.f64N/A
lift-*.f6472.0
Applied rewrites72.0%
if -6.4999999999999996e-101 < x.im < 6.00000000000000052e154Initial program 51.8%
lift-sin.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-sumN/A
lower-fma.f64N/A
Applied rewrites67.7%
if 6.00000000000000052e154 < x.im Initial program 0.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites80.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (log (hypot x.re x.im)) y.im))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (cos (* 0.5 PI)))
(t_4 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im))))
(t_5 (* t_4 (sin (+ (* t_2 y.im) t_1))))
(t_6 (log (pow (fma x.im x.im (* x.re x.re)) 0.5)))
(t_7 (sin (* y.re (atan2 x.im x.re))))
(t_8 (sin (* 0.5 PI))))
(if (<= t_5 (- INFINITY))
(*
t_4
(-
t_7
(*
(* -1.0 y.im)
(fma
-0.5
(* y.im (* (* t_6 t_6) t_7))
(*
(+
t_8
(*
y.re
(fma
y.re
(+
(* -0.5 (* t_8 (pow (atan2 x.im x.re) 2.0)))
(*
-0.16666666666666666
(* y.re (* t_3 (pow (atan2 x.im x.re) 3.0)))))
(* t_3 (atan2 x.im x.re)))))
t_6)))))
(if (<= t_5 INFINITY)
(* t_4 (fma (sin t_0) (cos t_1) (* (cos t_0) (sin t_1))))
(* t_4 t_7)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im)) * y_46_im;
double t_1 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = cos((0.5 * ((double) M_PI)));
double t_4 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_5 = t_4 * sin(((t_2 * y_46_im) + t_1));
double t_6 = log(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), 0.5));
double t_7 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_8 = sin((0.5 * ((double) M_PI)));
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = t_4 * (t_7 - ((-1.0 * y_46_im) * fma(-0.5, (y_46_im * ((t_6 * t_6) * t_7)), ((t_8 + (y_46_re * fma(y_46_re, ((-0.5 * (t_8 * pow(atan2(x_46_im, x_46_re), 2.0))) + (-0.16666666666666666 * (y_46_re * (t_3 * pow(atan2(x_46_im, x_46_re), 3.0))))), (t_3 * atan2(x_46_im, x_46_re))))) * t_6))));
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_4 * fma(sin(t_0), cos(t_1), (cos(t_0) * sin(t_1)));
} else {
tmp = t_4 * t_7;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(log(hypot(x_46_re, x_46_im)) * y_46_im) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = cos(Float64(0.5 * pi)) t_4 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_5 = Float64(t_4 * sin(Float64(Float64(t_2 * y_46_im) + t_1))) t_6 = log((fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ 0.5)) t_7 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_8 = sin(Float64(0.5 * pi)) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = Float64(t_4 * Float64(t_7 - Float64(Float64(-1.0 * y_46_im) * fma(-0.5, Float64(y_46_im * Float64(Float64(t_6 * t_6) * t_7)), Float64(Float64(t_8 + Float64(y_46_re * fma(y_46_re, Float64(Float64(-0.5 * Float64(t_8 * (atan(x_46_im, x_46_re) ^ 2.0))) + Float64(-0.16666666666666666 * Float64(y_46_re * Float64(t_3 * (atan(x_46_im, x_46_re) ^ 3.0))))), Float64(t_3 * atan(x_46_im, x_46_re))))) * t_6))))); elseif (t_5 <= Inf) tmp = Float64(t_4 * fma(sin(t_0), cos(t_1), Float64(cos(t_0) * sin(t_1)))); else tmp = Float64(t_4 * t_7); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Cos[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Log[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$8 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], N[(t$95$4 * N[(t$95$7 - N[(N[(-1.0 * y$46$im), $MachinePrecision] * N[(-0.5 * N[(y$46$im * N[(N[(t$95$6 * t$95$6), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$8 + N[(y$46$re * N[(y$46$re * N[(N[(-0.5 * N[(t$95$8 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(y$46$re * N[(t$95$3 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, Infinity], N[(t$95$4 * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision] + N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 * t$95$7), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := \cos \left(0.5 \cdot \pi\right)\\
t_4 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_5 := t\_4 \cdot \sin \left(t\_2 \cdot y.im + t\_1\right)\\
t_6 := \log \left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{0.5}\right)\\
t_7 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_8 := \sin \left(0.5 \cdot \pi\right)\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;t\_4 \cdot \left(t\_7 - \left(-1 \cdot y.im\right) \cdot \mathsf{fma}\left(-0.5, y.im \cdot \left(\left(t\_6 \cdot t\_6\right) \cdot t\_7\right), \left(t\_8 + y.re \cdot \mathsf{fma}\left(y.re, -0.5 \cdot \left(t\_8 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right) + -0.16666666666666666 \cdot \left(y.re \cdot \left(t\_3 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}\right)\right), t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot t\_6\right)\right)\\
\mathbf{elif}\;t\_5 \leq \infty:\\
\;\;\;\;t\_4 \cdot \mathsf{fma}\left(\sin t\_0, \cos t\_1, \cos t\_0 \cdot \sin t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 \cdot t\_7\\
\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))) (sin.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.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites47.8%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites60.9%
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))) (sin.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 90.0%
lift-sin.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-sumN/A
lower-fma.f64N/A
Applied rewrites91.9%
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))) (sin.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 0.0%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6447.4
Applied rewrites47.4%
Final simplification67.1%
(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 (cos (* 0.5 PI)))
(t_2 (exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (* t_2 (sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re)))))
(t_4 (log (pow (fma x.im x.im (* x.re x.re)) 0.5)))
(t_5 (sin (* y.re (atan2 x.im x.re))))
(t_6 (sin (* 0.5 PI))))
(if (<= t_3 (- INFINITY))
(*
t_2
(-
t_5
(*
(* -1.0 y.im)
(fma
-0.5
(* y.im (* (* t_4 t_4) t_5))
(*
(+
t_6
(*
y.re
(fma
y.re
(+
(* -0.5 (* t_6 (pow (atan2 x.im x.re) 2.0)))
(*
-0.16666666666666666
(* y.re (* t_1 (pow (atan2 x.im x.re) 3.0)))))
(* t_1 (atan2 x.im x.re)))))
t_4)))))
(if (<= t_3 INFINITY) t_3 (* t_2 t_5)))))
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 = cos((0.5 * ((double) M_PI)));
double t_2 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = t_2 * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
double t_4 = log(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), 0.5));
double t_5 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_6 = sin((0.5 * ((double) M_PI)));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_2 * (t_5 - ((-1.0 * y_46_im) * fma(-0.5, (y_46_im * ((t_4 * t_4) * t_5)), ((t_6 + (y_46_re * fma(y_46_re, ((-0.5 * (t_6 * pow(atan2(x_46_im, x_46_re), 2.0))) + (-0.16666666666666666 * (y_46_re * (t_1 * pow(atan2(x_46_im, x_46_re), 3.0))))), (t_1 * atan2(x_46_im, x_46_re))))) * t_4))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = t_2 * t_5;
}
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 = cos(Float64(0.5 * pi)) t_2 = exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(t_2 * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) t_4 = log((fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ 0.5)) t_5 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_6 = sin(Float64(0.5 * pi)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(t_2 * Float64(t_5 - Float64(Float64(-1.0 * y_46_im) * fma(-0.5, Float64(y_46_im * Float64(Float64(t_4 * t_4) * t_5)), Float64(Float64(t_6 + Float64(y_46_re * fma(y_46_re, Float64(Float64(-0.5 * Float64(t_6 * (atan(x_46_im, x_46_re) ^ 2.0))) + Float64(-0.16666666666666666 * Float64(y_46_re * Float64(t_1 * (atan(x_46_im, x_46_re) ^ 3.0))))), Float64(t_1 * atan(x_46_im, x_46_re))))) * t_4))))); elseif (t_3 <= Inf) tmp = t_3; else tmp = Float64(t_2 * t_5); 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[Cos[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(t$95$2 * N[Sin[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]}, Block[{t$95$4 = N[Log[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[Sin[N[(0.5 * Pi), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t$95$2 * N[(t$95$5 - N[(N[(-1.0 * y$46$im), $MachinePrecision] * N[(-0.5 * N[(y$46$im * N[(N[(t$95$4 * t$95$4), $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$6 + N[(y$46$re * N[(y$46$re * N[(N[(-0.5 * N[(t$95$6 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(y$46$re * N[(t$95$1 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$3, N[(t$95$2 * t$95$5), $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 := \cos \left(0.5 \cdot \pi\right)\\
t_2 := e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := t\_2 \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_4 := \log \left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{0.5}\right)\\
t_5 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_6 := \sin \left(0.5 \cdot \pi\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_2 \cdot \left(t\_5 - \left(-1 \cdot y.im\right) \cdot \mathsf{fma}\left(-0.5, y.im \cdot \left(\left(t\_4 \cdot t\_4\right) \cdot t\_5\right), \left(t\_6 + y.re \cdot \mathsf{fma}\left(y.re, -0.5 \cdot \left(t\_6 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\right) + -0.16666666666666666 \cdot \left(y.re \cdot \left(t\_1 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}\right)\right), t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot t\_4\right)\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_5\\
\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))) (sin.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.1%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites47.8%
Taylor expanded in y.re around 0
lower-+.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
Applied rewrites60.9%
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))) (sin.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 90.0%
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))) (sin.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 0.0%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6447.4
Applied rewrites47.4%
Final simplification66.3%
(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))))
(t_2 (sin (* y.re (atan2 x.im x.re)))))
(if (<= (* t_1 (sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re)))) 0.5)
(*
t_1
(-
t_2
(*
(* -1.0 y.im)
(*
(sin (fma y.re (atan2 x.im x.re) (/ PI 2.0)))
(log (pow (fma x.im x.im (* x.re x.re)) 0.5))))))
(* t_1 t_2))))
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 t_2 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((t_1 * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)))) <= 0.5) {
tmp = t_1 * (t_2 - ((-1.0 * y_46_im) * (sin(fma(y_46_re, atan2(x_46_im, x_46_re), (((double) M_PI) / 2.0))) * log(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), 0.5)))));
} else {
tmp = t_1 * t_2;
}
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))) t_2 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (Float64(t_1 * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) <= 0.5) tmp = Float64(t_1 * Float64(t_2 - Float64(Float64(-1.0 * y_46_im) * Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(pi / 2.0))) * log((fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ 0.5)))))); else tmp = Float64(t_1 * t_2); 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]}, Block[{t$95$2 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Sin[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], 0.5], N[(t$95$1 * N[(t$95$2 - N[(N[(-1.0 * y$46$im), $MachinePrecision] * N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$2), $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}\\
t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;t\_1 \cdot \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \leq 0.5:\\
\;\;\;\;t\_1 \cdot \left(t\_2 - \left(-1 \cdot y.im\right) \cdot \left(\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\pi}{2}\right)\right) \cdot \log \left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{0.5}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_2\\
\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))) (sin.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)))) < 0.5Initial program 84.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
Applied rewrites85.8%
if 0.5 < (*.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))) (sin.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 7.0%
Taylor expanded in y.re around inf
lower-*.f64N/A
lift-atan2.f6446.8
Applied rewrites46.8%
Final simplification63.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= x.im 1.1e+16)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(-
(sin t_0)
(*
(* -1.0 y.im)
(*
(sin (fma y.re (atan2 x.im x.re) (/ PI 2.0)))
(log (pow (fma x.im x.im (* x.re x.re)) 0.5))))))
(*
(/ (exp (* y.re (log x.im))) (exp (* y.im (atan2 x.im x.re))))
(sin (fma y.im (log 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= 1.1e+16) {
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))) * (sin(t_0) - ((-1.0 * y_46_im) * (sin(fma(y_46_re, atan2(x_46_im, x_46_re), (((double) M_PI) / 2.0))) * log(pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), 0.5)))));
} else {
tmp = (exp((y_46_re * log(x_46_im))) / exp((y_46_im * atan2(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= 1.1e+16) 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))) * Float64(sin(t_0) - Float64(Float64(-1.0 * y_46_im) * Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(pi / 2.0))) * log((fma(x_46_im, x_46_im, Float64(x_46_re * x_46_re)) ^ 0.5)))))); else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / exp(Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(fma(y_46_im, log(x_46_im), t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, 1.1e+16], 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] * N[(N[Sin[t$95$0], $MachinePrecision] - N[(N[(-1.0 * y$46$im), $MachinePrecision] * N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Log[N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq 1.1 \cdot 10^{+16}:\\
\;\;\;\;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 \left(\sin t\_0 - \left(-1 \cdot y.im\right) \cdot \left(\sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\pi}{2}\right)\right) \cdot \log \left({\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{0.5}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.im}}{e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_0\right)\right)\\
\end{array}
\end{array}
if x.im < 1.1e16Initial program 44.7%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
Applied rewrites50.8%
if 1.1e16 < x.im Initial program 27.6%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites76.8%
Final simplification56.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (fma x.im x.im (* x.re x.re)) 0.5))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (exp (* y.im (atan2 x.im x.re))))
(t_4
(* (/ (exp (* y.re (log x.im))) t_3) (sin (fma y.im (log x.im) t_1))))
(t_5 (pow t_0 y.re)))
(if (<= x.re -3.2e+84)
t_4
(if (<= x.re -3.4e-93)
(fma
y.im
(fma
-1.0
(* t_2 (* (atan2 x.im x.re) t_5))
(* (sin (fma y.re (atan2 x.im x.re) (/ PI 2.0))) (* (log t_0) t_5)))
(* t_2 t_5))
(if (<= x.re 6.5e-225)
t_4
(*
(/ (exp (* y.re (log x.re))) t_3)
(sin (fma y.im (log x.re) t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(fma(x_46_im, x_46_im, (x_46_re * x_46_re)), 0.5);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double t_4 = (exp((y_46_re * log(x_46_im))) / t_3) * sin(fma(y_46_im, log(x_46_im), t_1));
double t_5 = pow(t_0, y_46_re);
double tmp;
if (x_46_re <= -3.2e+84) {
tmp = t_4;
} else if (x_46_re <= -3.4e-93) {
tmp = fma(y_46_im, fma(-1.0, (t_2 * (atan2(x_46_im, x_46_re) * t_5)), (sin(fma(y_46_re, atan2(x_46_im, x_46_re), (((double) M_PI) / 2.0))) * (log(t_0) * t_5))), (t_2 * t_5));
} else if (x_46_re <= 6.5e-225) {
tmp = t_4;
} else {
tmp = (exp((y_46_re * log(x_46_re))) / t_3) * sin(fma(y_46_im, log(x_46_re), t_1));
}
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)) ^ 0.5 t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) t_4 = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / t_3) * sin(fma(y_46_im, log(x_46_im), t_1))) t_5 = t_0 ^ y_46_re tmp = 0.0 if (x_46_re <= -3.2e+84) tmp = t_4; elseif (x_46_re <= -3.4e-93) tmp = fma(y_46_im, fma(-1.0, Float64(t_2 * Float64(atan(x_46_im, x_46_re) * t_5)), Float64(sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(pi / 2.0))) * Float64(log(t_0) * t_5))), Float64(t_2 * t_5)); elseif (x_46_re <= 6.5e-225) tmp = t_4; else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_re))) / t_3) * sin(fma(y_46_im, log(x_46_re), t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[(x$46$im * x$46$im + N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Power[t$95$0, y$46$re], $MachinePrecision]}, If[LessEqual[x$46$re, -3.2e+84], t$95$4, If[LessEqual[x$46$re, -3.4e-93], N[(y$46$im * N[(-1.0 * N[(t$95$2 * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Log[t$95$0], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6.5e-225], t$95$4, N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x.im, x.im, x.re \cdot x.re\right)\right)}^{0.5}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_4 := \frac{e^{y.re \cdot \log x.im}}{t\_3} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_1\right)\right)\\
t_5 := {t\_0}^{y.re}\\
\mathbf{if}\;x.re \leq -3.2 \cdot 10^{+84}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x.re \leq -3.4 \cdot 10^{-93}:\\
\;\;\;\;\mathsf{fma}\left(y.im, \mathsf{fma}\left(-1, t\_2 \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t\_5\right), \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \frac{\pi}{2}\right)\right) \cdot \left(\log t\_0 \cdot t\_5\right)\right), t\_2 \cdot t\_5\right)\\
\mathbf{elif}\;x.re \leq 6.5 \cdot 10^{-225}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.re}}{t\_3} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_1\right)\right)\\
\end{array}
\end{array}
if x.re < -3.2000000000000001e84 or -3.40000000000000001e-93 < x.re < 6.5000000000000005e-225Initial program 26.8%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites39.0%
if -3.2000000000000001e84 < x.re < -3.40000000000000001e-93Initial program 63.9%
Taylor expanded in y.im around 0
lower-fma.f64N/A
Applied rewrites40.8%
if 6.5000000000000005e-225 < x.re Initial program 44.1%
Taylor expanded in x.im around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites63.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (log (sqrt (+ (pow x.im 2.0) (pow x.re 2.0)))))
(t_3 (exp (* y.im (atan2 x.im x.re)))))
(if (<= x.re -5.5e+151)
(* (/ (exp (* y.re (log x.im))) t_3) (sin (fma y.im (log x.im) t_0)))
(if (<= x.re 6.5e-225)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(-
t_1
(*
(pow y.im 2.0)
(fma
-1.0
(/ (* t_2 (sin (fma 0.5 PI t_0))) y.im)
(* 0.5 (* (pow t_2 2.0) t_1))))))
(*
(/ (exp (* y.re (log x.re))) t_3)
(sin (fma y.im (log x.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double t_2 = log(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))));
double t_3 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5.5e+151) {
tmp = (exp((y_46_re * log(x_46_im))) / t_3) * sin(fma(y_46_im, log(x_46_im), t_0));
} else if (x_46_re <= 6.5e-225) {
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_1 - (pow(y_46_im, 2.0) * fma(-1.0, ((t_2 * sin(fma(0.5, ((double) M_PI), t_0))) / y_46_im), (0.5 * (pow(t_2, 2.0) * t_1)))));
} else {
tmp = (exp((y_46_re * log(x_46_re))) / t_3) * sin(fma(y_46_im, log(x_46_re), t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) t_2 = log(sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0)))) t_3 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -5.5e+151) tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / t_3) * sin(fma(y_46_im, log(x_46_im), t_0))); elseif (x_46_re <= 6.5e-225) 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))) * Float64(t_1 - Float64((y_46_im ^ 2.0) * fma(-1.0, Float64(Float64(t_2 * sin(fma(0.5, pi, t_0))) / y_46_im), Float64(0.5 * Float64((t_2 ^ 2.0) * t_1)))))); else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_re))) / t_3) * sin(fma(y_46_im, log(x_46_re), t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5.5e+151], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6.5e-225], 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] * N[(t$95$1 - N[(N[Power[y$46$im, 2.0], $MachinePrecision] * N[(-1.0 * N[(N[(t$95$2 * N[Sin[N[(0.5 * Pi + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision] + N[(0.5 * N[(N[Power[t$95$2, 2.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
t_2 := \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\\
t_3 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;x.re \leq -5.5 \cdot 10^{+151}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.im}}{t\_3} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_0\right)\right)\\
\mathbf{elif}\;x.re \leq 6.5 \cdot 10^{-225}:\\
\;\;\;\;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 \left(t\_1 - {y.im}^{2} \cdot \mathsf{fma}\left(-1, \frac{t\_2 \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, t\_0\right)\right)}{y.im}, 0.5 \cdot \left({t\_2}^{2} \cdot t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.re}}{t\_3} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right)\\
\end{array}
\end{array}
if x.re < -5.4999999999999994e151Initial program 0.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites27.2%
if -5.4999999999999994e151 < x.re < 6.5000000000000005e-225Initial program 51.3%
Taylor expanded in y.im around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
Applied rewrites46.6%
Taylor expanded in y.im around inf
lower-*.f64N/A
lower-pow.f64N/A
Applied rewrites42.3%
if 6.5000000000000005e-225 < x.re Initial program 44.1%
Taylor expanded in x.im around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites63.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (exp (* y.im (atan2 x.im x.re)))))
(if (<= x.re 6.5e-225)
(* (/ (exp (* y.re (log x.im))) t_1) (sin (fma y.im (log x.im) t_0)))
(* (/ (exp (* y.re (log x.re))) t_1) (sin (fma y.im (log x.re) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 6.5e-225) {
tmp = (exp((y_46_re * log(x_46_im))) / t_1) * sin(fma(y_46_im, log(x_46_im), t_0));
} else {
tmp = (exp((y_46_re * log(x_46_re))) / t_1) * sin(fma(y_46_im, log(x_46_re), t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= 6.5e-225) tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / t_1) * sin(fma(y_46_im, log(x_46_im), t_0))); else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_re))) / t_1) * sin(fma(y_46_im, log(x_46_re), t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 6.5e-225], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;x.re \leq 6.5 \cdot 10^{-225}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.im}}{t\_1} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.re}}{t\_1} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.re, t\_0\right)\right)\\
\end{array}
\end{array}
if x.re < 6.5000000000000005e-225Initial program 38.0%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites31.6%
if 6.5000000000000005e-225 < x.re Initial program 44.1%
Taylor expanded in x.im around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites63.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (atan2 x.im x.re))))
(t_1 (log (/ 1.0 x.re)))
(t_2 (sin (* (* -1.0 y.im) t_1)))
(t_3 (* t_2 (pow (atan2 x.im x.re) 2.0)))
(t_4 (pow t_1 2.0))
(t_5 (sin (fma -1.0 (* y.im t_1) (* 0.5 PI))))
(t_6 (* t_5 (atan2 x.im x.re))))
(if (<= x.im -5e-310)
(fma
y.re
(fma
-1.0
(/ (* t_1 t_2) t_0)
(fma
y.re
(fma
-1.0
(/ (* t_1 t_6) t_0)
(fma
-0.5
(/ t_3 t_0)
(fma
0.5
(/ (* t_4 t_2) t_0)
(*
y.re
(+
(*
-0.16666666666666666
(/ (* t_5 (pow (atan2 x.im x.re) 3.0)) t_0))
(+
(* -0.16666666666666666 (/ (* (pow t_1 3.0) t_2) t_0))
(fma 0.5 (/ (* t_1 t_3) t_0) (* 0.5 (/ (* t_4 t_6) t_0)))))))))
(/ t_6 t_0)))
(/ t_2 t_0))
(*
(/ (exp (* y.re (log x.im))) t_0)
(sin (fma y.im (log x.im) (* y.re (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 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = log((1.0 / x_46_re));
double t_2 = sin(((-1.0 * y_46_im) * t_1));
double t_3 = t_2 * pow(atan2(x_46_im, x_46_re), 2.0);
double t_4 = pow(t_1, 2.0);
double t_5 = sin(fma(-1.0, (y_46_im * t_1), (0.5 * ((double) M_PI))));
double t_6 = t_5 * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -5e-310) {
tmp = fma(y_46_re, fma(-1.0, ((t_1 * t_2) / t_0), fma(y_46_re, fma(-1.0, ((t_1 * t_6) / t_0), fma(-0.5, (t_3 / t_0), fma(0.5, ((t_4 * t_2) / t_0), (y_46_re * ((-0.16666666666666666 * ((t_5 * pow(atan2(x_46_im, x_46_re), 3.0)) / t_0)) + ((-0.16666666666666666 * ((pow(t_1, 3.0) * t_2) / t_0)) + fma(0.5, ((t_1 * t_3) / t_0), (0.5 * ((t_4 * t_6) / t_0))))))))), (t_6 / t_0))), (t_2 / t_0));
} else {
tmp = (exp((y_46_re * log(x_46_im))) / t_0) * sin(fma(y_46_im, log(x_46_im), (y_46_re * 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 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) t_1 = log(Float64(1.0 / x_46_re)) t_2 = sin(Float64(Float64(-1.0 * y_46_im) * t_1)) t_3 = Float64(t_2 * (atan(x_46_im, x_46_re) ^ 2.0)) t_4 = t_1 ^ 2.0 t_5 = sin(fma(-1.0, Float64(y_46_im * t_1), Float64(0.5 * pi))) t_6 = Float64(t_5 * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -5e-310) tmp = fma(y_46_re, fma(-1.0, Float64(Float64(t_1 * t_2) / t_0), fma(y_46_re, fma(-1.0, Float64(Float64(t_1 * t_6) / t_0), fma(-0.5, Float64(t_3 / t_0), fma(0.5, Float64(Float64(t_4 * t_2) / t_0), Float64(y_46_re * Float64(Float64(-0.16666666666666666 * Float64(Float64(t_5 * (atan(x_46_im, x_46_re) ^ 3.0)) / t_0)) + Float64(Float64(-0.16666666666666666 * Float64(Float64((t_1 ^ 3.0) * t_2) / t_0)) + fma(0.5, Float64(Float64(t_1 * t_3) / t_0), Float64(0.5 * Float64(Float64(t_4 * t_6) / t_0))))))))), Float64(t_6 / t_0))), Float64(t_2 / t_0)); else tmp = Float64(Float64(exp(Float64(y_46_re * log(x_46_im))) / t_0) * sin(fma(y_46_im, log(x_46_im), Float64(y_46_re * 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[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Power[t$95$1, 2.0], $MachinePrecision]}, Block[{t$95$5 = N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[(y$46$re * N[(-1.0 * N[(N[(t$95$1 * t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(y$46$re * N[(-1.0 * N[(N[(t$95$1 * t$95$6), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(-0.5 * N[(t$95$3 / t$95$0), $MachinePrecision] + N[(0.5 * N[(N[(t$95$4 * t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(y$46$re * N[(N[(-0.16666666666666666 * N[(N[(t$95$5 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] * t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$1 * t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(0.5 * N[(N[(t$95$4 * t$95$6), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[x$46$im], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_1\right)\\
t_3 := t\_2 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_4 := {t\_1}^{2}\\
t_5 := \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, 0.5 \cdot \pi\right)\right)\\
t_6 := t\_5 \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \frac{t\_1 \cdot t\_2}{t\_0}, \mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \frac{t\_1 \cdot t\_6}{t\_0}, \mathsf{fma}\left(-0.5, \frac{t\_3}{t\_0}, \mathsf{fma}\left(0.5, \frac{t\_4 \cdot t\_2}{t\_0}, y.re \cdot \left(-0.16666666666666666 \cdot \frac{t\_5 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}}{t\_0} + \left(-0.16666666666666666 \cdot \frac{{t\_1}^{3} \cdot t\_2}{t\_0} + \mathsf{fma}\left(0.5, \frac{t\_1 \cdot t\_3}{t\_0}, 0.5 \cdot \frac{t\_4 \cdot t\_6}{t\_0}\right)\right)\right)\right)\right)\right), \frac{t\_6}{t\_0}\right)\right), \frac{t\_2}{t\_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{y.re \cdot \log x.im}}{t\_0} \cdot \sin \left(\mathsf{fma}\left(y.im, \log x.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 39.2%
Taylor expanded in y.re around 0
Applied rewrites8.7%
Taylor expanded in x.re around inf
Applied rewrites16.5%
if -4.999999999999985e-310 < x.im Initial program 42.4%
Taylor expanded in x.re around 0
lower-*.f64N/A
exp-diffN/A
lower-/.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
lift-atan2.f64N/A
lower-sin.f64N/A
lower-fma.f64N/A
Applied rewrites60.1%
Final simplification38.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (atan2 x.im x.re))))
(t_1 (log (/ 1.0 x.re)))
(t_2 (sin (fma -1.0 (* y.im t_1) (* 0.5 PI))))
(t_3 (sin (* (* -1.0 y.im) t_1)))
(t_4 (* t_3 (pow (atan2 x.im x.re) 2.0)))
(t_5 (* t_2 (atan2 x.im x.re)))
(t_6 (pow t_1 2.0)))
(fma
y.re
(fma
-1.0
(/ (* t_1 t_3) t_0)
(fma
y.re
(fma
-1.0
(/ (* t_1 t_5) t_0)
(fma
-0.5
(/ t_4 t_0)
(fma
0.5
(/ (* t_6 t_3) t_0)
(*
y.re
(+
(* -0.16666666666666666 (/ (* t_2 (pow (atan2 x.im x.re) 3.0)) t_0))
(+
(* -0.16666666666666666 (/ (* (pow t_1 3.0) t_3) t_0))
(fma 0.5 (/ (* t_1 t_4) t_0) (* 0.5 (/ (* t_6 t_5) t_0)))))))))
(/ t_5 t_0)))
(/ t_3 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = log((1.0 / x_46_re));
double t_2 = sin(fma(-1.0, (y_46_im * t_1), (0.5 * ((double) M_PI))));
double t_3 = sin(((-1.0 * y_46_im) * t_1));
double t_4 = t_3 * pow(atan2(x_46_im, x_46_re), 2.0);
double t_5 = t_2 * atan2(x_46_im, x_46_re);
double t_6 = pow(t_1, 2.0);
return fma(y_46_re, fma(-1.0, ((t_1 * t_3) / t_0), fma(y_46_re, fma(-1.0, ((t_1 * t_5) / t_0), fma(-0.5, (t_4 / t_0), fma(0.5, ((t_6 * t_3) / t_0), (y_46_re * ((-0.16666666666666666 * ((t_2 * pow(atan2(x_46_im, x_46_re), 3.0)) / t_0)) + ((-0.16666666666666666 * ((pow(t_1, 3.0) * t_3) / t_0)) + fma(0.5, ((t_1 * t_4) / t_0), (0.5 * ((t_6 * t_5) / t_0))))))))), (t_5 / t_0))), (t_3 / t_0));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) t_1 = log(Float64(1.0 / x_46_re)) t_2 = sin(fma(-1.0, Float64(y_46_im * t_1), Float64(0.5 * pi))) t_3 = sin(Float64(Float64(-1.0 * y_46_im) * t_1)) t_4 = Float64(t_3 * (atan(x_46_im, x_46_re) ^ 2.0)) t_5 = Float64(t_2 * atan(x_46_im, x_46_re)) t_6 = t_1 ^ 2.0 return fma(y_46_re, fma(-1.0, Float64(Float64(t_1 * t_3) / t_0), fma(y_46_re, fma(-1.0, Float64(Float64(t_1 * t_5) / t_0), fma(-0.5, Float64(t_4 / t_0), fma(0.5, Float64(Float64(t_6 * t_3) / t_0), Float64(y_46_re * Float64(Float64(-0.16666666666666666 * Float64(Float64(t_2 * (atan(x_46_im, x_46_re) ^ 3.0)) / t_0)) + Float64(Float64(-0.16666666666666666 * Float64(Float64((t_1 ^ 3.0) * t_3) / t_0)) + fma(0.5, Float64(Float64(t_1 * t_4) / t_0), Float64(0.5 * Float64(Float64(t_6 * t_5) / t_0))))))))), Float64(t_5 / t_0))), Float64(t_3 / t_0)) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$2 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Power[t$95$1, 2.0], $MachinePrecision]}, N[(y$46$re * N[(-1.0 * N[(N[(t$95$1 * t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(y$46$re * N[(-1.0 * N[(N[(t$95$1 * t$95$5), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(-0.5 * N[(t$95$4 / t$95$0), $MachinePrecision] + N[(0.5 * N[(N[(t$95$6 * t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(y$46$re * N[(N[(-0.16666666666666666 * N[(N[(t$95$2 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] * t$95$3), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$1 * t$95$4), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(0.5 * N[(N[(t$95$6 * t$95$5), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, 0.5 \cdot \pi\right)\right)\\
t_3 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_1\right)\\
t_4 := t\_3 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_5 := t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_6 := {t\_1}^{2}\\
\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \frac{t\_1 \cdot t\_3}{t\_0}, \mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \frac{t\_1 \cdot t\_5}{t\_0}, \mathsf{fma}\left(-0.5, \frac{t\_4}{t\_0}, \mathsf{fma}\left(0.5, \frac{t\_6 \cdot t\_3}{t\_0}, y.re \cdot \left(-0.16666666666666666 \cdot \frac{t\_2 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}}{t\_0} + \left(-0.16666666666666666 \cdot \frac{{t\_1}^{3} \cdot t\_3}{t\_0} + \mathsf{fma}\left(0.5, \frac{t\_1 \cdot t\_4}{t\_0}, 0.5 \cdot \frac{t\_6 \cdot t\_5}{t\_0}\right)\right)\right)\right)\right)\right), \frac{t\_5}{t\_0}\right)\right), \frac{t\_3}{t\_0}\right)
\end{array}
\end{array}
Initial program 40.8%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in x.re around inf
Applied rewrites19.9%
Final simplification19.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* y.im (atan2 x.im x.re))))
(t_1 (log (/ 1.0 x.re)))
(t_2 (sin (* (* -1.0 y.im) t_1))))
(fma
y.re
(fma
-1.0
(/ (* t_1 t_2) t_0)
(/ (* (sin (fma -1.0 (* y.im t_1) (* 0.5 PI))) (atan2 x.im x.re)) t_0))
(/ t_2 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double t_1 = log((1.0 / x_46_re));
double t_2 = sin(((-1.0 * y_46_im) * t_1));
return fma(y_46_re, fma(-1.0, ((t_1 * t_2) / t_0), ((sin(fma(-1.0, (y_46_im * t_1), (0.5 * ((double) M_PI)))) * atan2(x_46_im, x_46_re)) / t_0)), (t_2 / t_0));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) t_1 = log(Float64(1.0 / x_46_re)) t_2 = sin(Float64(Float64(-1.0 * y_46_im) * t_1)) return fma(y_46_re, fma(-1.0, Float64(Float64(t_1 * t_2) / t_0), Float64(Float64(sin(fma(-1.0, Float64(y_46_im * t_1), Float64(0.5 * pi))) * atan(x_46_im, x_46_re)) / t_0)), Float64(t_2 / t_0)) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]}, N[(y$46$re * N[(-1.0 * N[(N[(t$95$1 * t$95$2), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[Sin[N[(-1.0 * N[(y$46$im * t$95$1), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := \log \left(\frac{1}{x.re}\right)\\
t_2 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_1\right)\\
\mathsf{fma}\left(y.re, \mathsf{fma}\left(-1, \frac{t\_1 \cdot t\_2}{t\_0}, \frac{\sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_1, 0.5 \cdot \pi\right)\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}{t\_0}\right), \frac{t\_2}{t\_0}\right)
\end{array}
\end{array}
Initial program 40.8%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in x.re around inf
Applied rewrites19.9%
Taylor expanded in y.re around 0
Applied rewrites19.6%
Final simplification19.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ 1.0 x.re)))
(t_1 (sin (fma -1.0 (* y.im t_0) (* 0.5 PI))))
(t_2 (pow t_0 2.0))
(t_3 (* t_1 (atan2 x.im x.re)))
(t_4 (sin (* (* -1.0 y.im) t_0)))
(t_5 (* t_4 (pow (atan2 x.im x.re) 2.0)))
(t_6 (exp (* y.im (atan2 x.im x.re)))))
(*
(* -1.0 (pow y.re 3.0))
(-
(-
(* (- -0.16666666666666666) (/ (* t_1 (pow (atan2 x.im x.re) 3.0)) t_6))
(+
(* -0.16666666666666666 (/ (* (pow t_0 3.0) t_4) t_6))
(fma 0.5 (/ (* t_0 t_5) t_6) (* 0.5 (/ (* t_2 t_3) t_6)))))
(/
(fma
-1.0
(/ (* t_0 t_3) t_6)
(fma
-1.0
(/
(fma
-1.0
(fma -1.0 (/ (* t_0 t_4) t_6) (/ t_3 t_6))
(/ t_4 (* (* -1.0 y.re) t_6)))
y.re)
(fma -0.5 (/ t_5 t_6) (* 0.5 (/ (* t_2 t_4) t_6)))))
y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((1.0 / x_46_re));
double t_1 = sin(fma(-1.0, (y_46_im * t_0), (0.5 * ((double) M_PI))));
double t_2 = pow(t_0, 2.0);
double t_3 = t_1 * atan2(x_46_im, x_46_re);
double t_4 = sin(((-1.0 * y_46_im) * t_0));
double t_5 = t_4 * pow(atan2(x_46_im, x_46_re), 2.0);
double t_6 = exp((y_46_im * atan2(x_46_im, x_46_re)));
return (-1.0 * pow(y_46_re, 3.0)) * (((-(-0.16666666666666666) * ((t_1 * pow(atan2(x_46_im, x_46_re), 3.0)) / t_6)) - ((-0.16666666666666666 * ((pow(t_0, 3.0) * t_4) / t_6)) + fma(0.5, ((t_0 * t_5) / t_6), (0.5 * ((t_2 * t_3) / t_6))))) - (fma(-1.0, ((t_0 * t_3) / t_6), fma(-1.0, (fma(-1.0, fma(-1.0, ((t_0 * t_4) / t_6), (t_3 / t_6)), (t_4 / ((-1.0 * y_46_re) * t_6))) / y_46_re), fma(-0.5, (t_5 / t_6), (0.5 * ((t_2 * t_4) / t_6))))) / y_46_re));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(1.0 / x_46_re)) t_1 = sin(fma(-1.0, Float64(y_46_im * t_0), Float64(0.5 * pi))) t_2 = t_0 ^ 2.0 t_3 = Float64(t_1 * atan(x_46_im, x_46_re)) t_4 = sin(Float64(Float64(-1.0 * y_46_im) * t_0)) t_5 = Float64(t_4 * (atan(x_46_im, x_46_re) ^ 2.0)) t_6 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) return Float64(Float64(-1.0 * (y_46_re ^ 3.0)) * Float64(Float64(Float64(Float64(-(-0.16666666666666666)) * Float64(Float64(t_1 * (atan(x_46_im, x_46_re) ^ 3.0)) / t_6)) - Float64(Float64(-0.16666666666666666 * Float64(Float64((t_0 ^ 3.0) * t_4) / t_6)) + fma(0.5, Float64(Float64(t_0 * t_5) / t_6), Float64(0.5 * Float64(Float64(t_2 * t_3) / t_6))))) - Float64(fma(-1.0, Float64(Float64(t_0 * t_3) / t_6), fma(-1.0, Float64(fma(-1.0, fma(-1.0, Float64(Float64(t_0 * t_4) / t_6), Float64(t_3 / t_6)), Float64(t_4 / Float64(Float64(-1.0 * y_46_re) * t_6))) / y_46_re), fma(-0.5, Float64(t_5 / t_6), Float64(0.5 * Float64(Float64(t_2 * t_4) / t_6))))) / y_46_re))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(-1.0 * N[(y$46$im * t$95$0), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[(-1.0 * N[Power[y$46$re, 3.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[((--0.16666666666666666) * N[(N[(t$95$1 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] - N[(N[(-0.16666666666666666 * N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$0 * t$95$5), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(-1.0 * N[(N[(t$95$0 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(-1.0 * N[(N[(-1.0 * N[(-1.0 * N[(N[(t$95$0 * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(t$95$3 / t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 / N[(N[(-1.0 * y$46$re), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision] + N[(-0.5 * N[(t$95$5 / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{1}{x.re}\right)\\
t_1 := \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_0, 0.5 \cdot \pi\right)\right)\\
t_2 := {t\_0}^{2}\\
t_3 := t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_0\right)\\
t_5 := t\_4 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_6 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\left(-1 \cdot {y.re}^{3}\right) \cdot \left(\left(\left(--0.16666666666666666\right) \cdot \frac{t\_1 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}}{t\_6} - \left(-0.16666666666666666 \cdot \frac{{t\_0}^{3} \cdot t\_4}{t\_6} + \mathsf{fma}\left(0.5, \frac{t\_0 \cdot t\_5}{t\_6}, 0.5 \cdot \frac{t\_2 \cdot t\_3}{t\_6}\right)\right)\right) - \frac{\mathsf{fma}\left(-1, \frac{t\_0 \cdot t\_3}{t\_6}, \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \mathsf{fma}\left(-1, \frac{t\_0 \cdot t\_4}{t\_6}, \frac{t\_3}{t\_6}\right), \frac{t\_4}{\left(-1 \cdot y.re\right) \cdot t\_6}\right)}{y.re}, \mathsf{fma}\left(-0.5, \frac{t\_5}{t\_6}, 0.5 \cdot \frac{t\_2 \cdot t\_4}{t\_6}\right)\right)\right)}{y.re}\right)
\end{array}
\end{array}
Initial program 40.8%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in x.re around inf
Applied rewrites19.9%
Taylor expanded in y.re around -inf
Applied rewrites10.7%
Final simplification10.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ 1.0 x.re)))
(t_1 (sin (fma -1.0 (* y.im t_0) (* 0.5 PI))))
(t_2 (pow t_0 2.0))
(t_3 (* t_1 (atan2 x.im x.re)))
(t_4 (sin (* (* -1.0 y.im) t_0)))
(t_5 (* t_4 (pow (atan2 x.im x.re) 2.0)))
(t_6 (exp (* y.im (atan2 x.im x.re)))))
(*
(* -1.0 (pow y.re 3.0))
(-
(-
(* (- -0.16666666666666666) (/ (* t_1 (pow (atan2 x.im x.re) 3.0)) t_6))
(+
(* -0.16666666666666666 (/ (* (pow t_0 3.0) t_4) t_6))
(fma 0.5 (/ (* t_0 t_5) t_6) (* 0.5 (/ (* t_2 t_3) t_6)))))
(/
(+
(/ (* t_0 t_4) (* (* -1.0 y.re) t_6))
(fma
-1.0
(/ (* t_0 t_3) t_6)
(fma
-0.5
(/ t_5 t_6)
(fma 0.5 (/ (* t_2 t_4) t_6) (/ t_3 (* y.re t_6))))))
y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((1.0 / x_46_re));
double t_1 = sin(fma(-1.0, (y_46_im * t_0), (0.5 * ((double) M_PI))));
double t_2 = pow(t_0, 2.0);
double t_3 = t_1 * atan2(x_46_im, x_46_re);
double t_4 = sin(((-1.0 * y_46_im) * t_0));
double t_5 = t_4 * pow(atan2(x_46_im, x_46_re), 2.0);
double t_6 = exp((y_46_im * atan2(x_46_im, x_46_re)));
return (-1.0 * pow(y_46_re, 3.0)) * (((-(-0.16666666666666666) * ((t_1 * pow(atan2(x_46_im, x_46_re), 3.0)) / t_6)) - ((-0.16666666666666666 * ((pow(t_0, 3.0) * t_4) / t_6)) + fma(0.5, ((t_0 * t_5) / t_6), (0.5 * ((t_2 * t_3) / t_6))))) - ((((t_0 * t_4) / ((-1.0 * y_46_re) * t_6)) + fma(-1.0, ((t_0 * t_3) / t_6), fma(-0.5, (t_5 / t_6), fma(0.5, ((t_2 * t_4) / t_6), (t_3 / (y_46_re * t_6)))))) / y_46_re));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(1.0 / x_46_re)) t_1 = sin(fma(-1.0, Float64(y_46_im * t_0), Float64(0.5 * pi))) t_2 = t_0 ^ 2.0 t_3 = Float64(t_1 * atan(x_46_im, x_46_re)) t_4 = sin(Float64(Float64(-1.0 * y_46_im) * t_0)) t_5 = Float64(t_4 * (atan(x_46_im, x_46_re) ^ 2.0)) t_6 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) return Float64(Float64(-1.0 * (y_46_re ^ 3.0)) * Float64(Float64(Float64(Float64(-(-0.16666666666666666)) * Float64(Float64(t_1 * (atan(x_46_im, x_46_re) ^ 3.0)) / t_6)) - Float64(Float64(-0.16666666666666666 * Float64(Float64((t_0 ^ 3.0) * t_4) / t_6)) + fma(0.5, Float64(Float64(t_0 * t_5) / t_6), Float64(0.5 * Float64(Float64(t_2 * t_3) / t_6))))) - Float64(Float64(Float64(Float64(t_0 * t_4) / Float64(Float64(-1.0 * y_46_re) * t_6)) + fma(-1.0, Float64(Float64(t_0 * t_3) / t_6), fma(-0.5, Float64(t_5 / t_6), fma(0.5, Float64(Float64(t_2 * t_4) / t_6), Float64(t_3 / Float64(y_46_re * t_6)))))) / y_46_re))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(-1.0 * N[(y$46$im * t$95$0), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[(-1.0 * N[Power[y$46$re, 3.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[((--0.16666666666666666) * N[(N[(t$95$1 * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] - N[(N[(-0.16666666666666666 * N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$0 * t$95$5), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$4), $MachinePrecision] / N[(N[(-1.0 * y$46$re), $MachinePrecision] * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t$95$0 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(-0.5 * N[(t$95$5 / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(t$95$3 / N[(y$46$re * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{1}{x.re}\right)\\
t_1 := \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_0, 0.5 \cdot \pi\right)\right)\\
t_2 := {t\_0}^{2}\\
t_3 := t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_0\right)\\
t_5 := t\_4 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_6 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\left(-1 \cdot {y.re}^{3}\right) \cdot \left(\left(\left(--0.16666666666666666\right) \cdot \frac{t\_1 \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}}{t\_6} - \left(-0.16666666666666666 \cdot \frac{{t\_0}^{3} \cdot t\_4}{t\_6} + \mathsf{fma}\left(0.5, \frac{t\_0 \cdot t\_5}{t\_6}, 0.5 \cdot \frac{t\_2 \cdot t\_3}{t\_6}\right)\right)\right) - \frac{\frac{t\_0 \cdot t\_4}{\left(-1 \cdot y.re\right) \cdot t\_6} + \mathsf{fma}\left(-1, \frac{t\_0 \cdot t\_3}{t\_6}, \mathsf{fma}\left(-0.5, \frac{t\_5}{t\_6}, \mathsf{fma}\left(0.5, \frac{t\_2 \cdot t\_4}{t\_6}, \frac{t\_3}{y.re \cdot t\_6}\right)\right)\right)}{y.re}\right)
\end{array}
\end{array}
Initial program 40.8%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in x.re around inf
Applied rewrites19.9%
Taylor expanded in y.re around -inf
Applied rewrites9.4%
Final simplification9.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ 1.0 x.re)))
(t_1 (sin (fma -1.0 (* y.im t_0) (* 0.5 PI))))
(t_2 (pow t_0 2.0))
(t_3 (* t_1 (atan2 x.im x.re)))
(t_4 (sin (* (* -1.0 y.im) t_0)))
(t_5 (pow (atan2 x.im x.re) 2.0))
(t_6 (exp (* y.im (atan2 x.im x.re))))
(t_7 (pow (atan2 x.im x.re) 3.0))
(t_8 (* t_4 t_5)))
(*
(* -1.0 (pow y.re 3.0))
(-
(-
(* (- -0.16666666666666666) (/ (* t_1 t_7) t_6))
(+
(* -0.16666666666666666 (/ (* (pow t_0 3.0) t_4) t_6))
(fma 0.5 (/ (* t_0 t_8) t_6) (* 0.5 (/ (* t_2 t_3) t_6)))))
(/
(+
(/
(* t_0 t_4)
(*
(* -1.0 y.re)
(+
1.0
(*
y.im
(fma
y.im
(fma 0.16666666666666666 (* y.im t_7) (* 0.5 t_5))
(atan2 x.im x.re))))))
(fma
-1.0
(/ (* t_0 t_3) t_6)
(fma
-0.5
(/ t_8 t_6)
(fma 0.5 (/ (* t_2 t_4) t_6) (/ t_3 (* y.re t_6))))))
y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((1.0 / x_46_re));
double t_1 = sin(fma(-1.0, (y_46_im * t_0), (0.5 * ((double) M_PI))));
double t_2 = pow(t_0, 2.0);
double t_3 = t_1 * atan2(x_46_im, x_46_re);
double t_4 = sin(((-1.0 * y_46_im) * t_0));
double t_5 = pow(atan2(x_46_im, x_46_re), 2.0);
double t_6 = exp((y_46_im * atan2(x_46_im, x_46_re)));
double t_7 = pow(atan2(x_46_im, x_46_re), 3.0);
double t_8 = t_4 * t_5;
return (-1.0 * pow(y_46_re, 3.0)) * (((-(-0.16666666666666666) * ((t_1 * t_7) / t_6)) - ((-0.16666666666666666 * ((pow(t_0, 3.0) * t_4) / t_6)) + fma(0.5, ((t_0 * t_8) / t_6), (0.5 * ((t_2 * t_3) / t_6))))) - ((((t_0 * t_4) / ((-1.0 * y_46_re) * (1.0 + (y_46_im * fma(y_46_im, fma(0.16666666666666666, (y_46_im * t_7), (0.5 * t_5)), atan2(x_46_im, x_46_re)))))) + fma(-1.0, ((t_0 * t_3) / t_6), fma(-0.5, (t_8 / t_6), fma(0.5, ((t_2 * t_4) / t_6), (t_3 / (y_46_re * t_6)))))) / y_46_re));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(1.0 / x_46_re)) t_1 = sin(fma(-1.0, Float64(y_46_im * t_0), Float64(0.5 * pi))) t_2 = t_0 ^ 2.0 t_3 = Float64(t_1 * atan(x_46_im, x_46_re)) t_4 = sin(Float64(Float64(-1.0 * y_46_im) * t_0)) t_5 = atan(x_46_im, x_46_re) ^ 2.0 t_6 = exp(Float64(y_46_im * atan(x_46_im, x_46_re))) t_7 = atan(x_46_im, x_46_re) ^ 3.0 t_8 = Float64(t_4 * t_5) return Float64(Float64(-1.0 * (y_46_re ^ 3.0)) * Float64(Float64(Float64(Float64(-(-0.16666666666666666)) * Float64(Float64(t_1 * t_7) / t_6)) - Float64(Float64(-0.16666666666666666 * Float64(Float64((t_0 ^ 3.0) * t_4) / t_6)) + fma(0.5, Float64(Float64(t_0 * t_8) / t_6), Float64(0.5 * Float64(Float64(t_2 * t_3) / t_6))))) - Float64(Float64(Float64(Float64(t_0 * t_4) / Float64(Float64(-1.0 * y_46_re) * Float64(1.0 + Float64(y_46_im * fma(y_46_im, fma(0.16666666666666666, Float64(y_46_im * t_7), Float64(0.5 * t_5)), atan(x_46_im, x_46_re)))))) + fma(-1.0, Float64(Float64(t_0 * t_3) / t_6), fma(-0.5, Float64(t_8 / t_6), fma(0.5, Float64(Float64(t_2 * t_4) / t_6), Float64(t_3 / Float64(y_46_re * t_6)))))) / y_46_re))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(-1.0 * N[(y$46$im * t$95$0), $MachinePrecision] + N[(0.5 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sin[N[(N[(-1.0 * y$46$im), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$6 = N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]}, Block[{t$95$8 = N[(t$95$4 * t$95$5), $MachinePrecision]}, N[(N[(-1.0 * N[Power[y$46$re, 3.0], $MachinePrecision]), $MachinePrecision] * N[(N[(N[((--0.16666666666666666) * N[(N[(t$95$1 * t$95$7), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] - N[(N[(-0.16666666666666666 * N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[(t$95$0 * t$95$8), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(t$95$0 * t$95$4), $MachinePrecision] / N[(N[(-1.0 * y$46$re), $MachinePrecision] * N[(1.0 + N[(y$46$im * N[(y$46$im * N[(0.16666666666666666 * N[(y$46$im * t$95$7), $MachinePrecision] + N[(0.5 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t$95$0 * t$95$3), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(-0.5 * N[(t$95$8 / t$95$6), $MachinePrecision] + N[(0.5 * N[(N[(t$95$2 * t$95$4), $MachinePrecision] / t$95$6), $MachinePrecision] + N[(t$95$3 / N[(y$46$re * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{1}{x.re}\right)\\
t_1 := \sin \left(\mathsf{fma}\left(-1, y.im \cdot t\_0, 0.5 \cdot \pi\right)\right)\\
t_2 := {t\_0}^{2}\\
t_3 := t\_1 \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_4 := \sin \left(\left(-1 \cdot y.im\right) \cdot t\_0\right)\\
t_5 := {\tan^{-1}_* \frac{x.im}{x.re}}^{2}\\
t_6 := e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_7 := {\tan^{-1}_* \frac{x.im}{x.re}}^{3}\\
t_8 := t\_4 \cdot t\_5\\
\left(-1 \cdot {y.re}^{3}\right) \cdot \left(\left(\left(--0.16666666666666666\right) \cdot \frac{t\_1 \cdot t\_7}{t\_6} - \left(-0.16666666666666666 \cdot \frac{{t\_0}^{3} \cdot t\_4}{t\_6} + \mathsf{fma}\left(0.5, \frac{t\_0 \cdot t\_8}{t\_6}, 0.5 \cdot \frac{t\_2 \cdot t\_3}{t\_6}\right)\right)\right) - \frac{\frac{t\_0 \cdot t\_4}{\left(-1 \cdot y.re\right) \cdot \left(1 + y.im \cdot \mathsf{fma}\left(y.im, \mathsf{fma}\left(0.16666666666666666, y.im \cdot t\_7, 0.5 \cdot t\_5\right), \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} + \mathsf{fma}\left(-1, \frac{t\_0 \cdot t\_3}{t\_6}, \mathsf{fma}\left(-0.5, \frac{t\_8}{t\_6}, \mathsf{fma}\left(0.5, \frac{t\_2 \cdot t\_4}{t\_6}, \frac{t\_3}{y.re \cdot t\_6}\right)\right)\right)}{y.re}\right)
\end{array}
\end{array}
Initial program 40.8%
Taylor expanded in y.re around 0
Applied rewrites7.4%
Taylor expanded in x.re around inf
Applied rewrites19.9%
Taylor expanded in y.re around -inf
Applied rewrites9.4%
Taylor expanded in y.im around 0
lower-+.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-atan2.f64N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-atan2.f64N/A
lift-atan2.f647.5
Applied rewrites7.5%
Final simplification7.5%
herbie shell --seed 2025065
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))