powComplex, real part

?

Percentage Accurate: 41.8% → 80.9%
Time: 43.8s
Precision: binary64
Cost: 130884

?

\[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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
\[\begin{array}{l} t_0 := \log \left(-x.im\right)\\ t_1 := \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_0\right)\\ t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ t_3 := \mathsf{fma}\left(y.im, t_0, y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-40}:\\ \;\;\;\;t_2 \cdot \left(\cos t_1 \cdot \cos t_3 - \sin t_1 \cdot \sin t_3\right)\\ \mathbf{elif}\;x.im \leq 2.5 \cdot 10^{+141}:\\ \;\;\;\;t_2 \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (*
  (exp
   (-
    (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
    (* (atan2 x.im x.re) y.im)))
  (cos
   (+
    (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)
    (* (atan2 x.im x.re) y.re)))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (log (- x.im)))
        (t_1 (fma y.re (atan2 x.im x.re) (* y.im t_0)))
        (t_2
         (exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im))))
        (t_3 (fma y.im t_0 (* y.im (log (/ -1.0 x.im))))))
   (if (<= x.im -1.1e-40)
     (* t_2 (- (* (cos t_1) (cos t_3)) (* (sin t_1) (sin t_3))))
     (if (<= x.im 2.5e+141)
       (*
        t_2
        (cos
         (fma
          (* (log (hypot x.im x.re)) (pow (cbrt y.im) 2.0))
          (cbrt y.im)
          (* y.re (atan2 x.im x.re)))))
       t_2))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return 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))) * cos(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = log(-x_46_im);
	double t_1 = fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0));
	double t_2 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
	double t_3 = fma(y_46_im, t_0, (y_46_im * log((-1.0 / x_46_im))));
	double tmp;
	if (x_46_im <= -1.1e-40) {
		tmp = t_2 * ((cos(t_1) * cos(t_3)) - (sin(t_1) * sin(t_3)));
	} else if (x_46_im <= 2.5e+141) {
		tmp = t_2 * cos(fma((log(hypot(x_46_im, x_46_re)) * pow(cbrt(y_46_im), 2.0)), cbrt(y_46_im), (y_46_re * atan2(x_46_im, x_46_re))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return 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))) * cos(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = log(Float64(-x_46_im))
	t_1 = fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))
	t_2 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im)))
	t_3 = fma(y_46_im, t_0, Float64(y_46_im * log(Float64(-1.0 / x_46_im))))
	tmp = 0.0
	if (x_46_im <= -1.1e-40)
		tmp = Float64(t_2 * Float64(Float64(cos(t_1) * cos(t_3)) - Float64(sin(t_1) * sin(t_3))));
	elseif (x_46_im <= 2.5e+141)
		tmp = Float64(t_2 * cos(fma(Float64(log(hypot(x_46_im, x_46_re)) * (cbrt(y_46_im) ^ 2.0)), cbrt(y_46_im), Float64(y_46_re * atan(x_46_im, x_46_re)))));
	else
		tmp = t_2;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[Cos[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$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * 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[(y$46$im * t$95$0 + N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -1.1e-40], N[(t$95$2 * N[(N[(N[Cos[t$95$1], $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[t$95$1], $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 2.5e+141], N[(t$95$2 * N[Cos[N[(N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[y$46$im, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\begin{array}{l}
t_0 := \log \left(-x.im\right)\\
t_1 := \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_0\right)\\
t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \mathsf{fma}\left(y.im, t_0, y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\mathbf{if}\;x.im \leq -1.1 \cdot 10^{-40}:\\
\;\;\;\;t_2 \cdot \left(\cos t_1 \cdot \cos t_3 - \sin t_1 \cdot \sin t_3\right)\\

\mathbf{elif}\;x.im \leq 2.5 \cdot 10^{+141}:\\
\;\;\;\;t_2 \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 10 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Derivation?

  1. Split input into 3 regimes
  2. if x.im < -1.10000000000000004e-40

    1. Initial program 32.4%

      \[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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Simplified78.8%

      \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
      Step-by-step derivation

      [Start]32.4%

      \[ 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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Taylor expanded in x.im around -inf 81.3%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(-1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \cdot y.im\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    4. Simplified81.3%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)} \]
      Step-by-step derivation

      [Start]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(-1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \cdot y.im\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]

      +-commutative [=>]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + -1 \cdot \left(\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)} \]

      mul-1-neg [=>]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + \color{blue}{\left(-\log \left(\frac{-1}{x.im}\right) \cdot y.im\right)}\right) \]

      unsub-neg [=>]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)} \]

      *-commutative [=>]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - \color{blue}{y.im \cdot \log \left(\frac{-1}{x.im}\right)}\right) \]
    5. Applied egg-rr84.1%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right)} \]
      Step-by-step derivation

      [Start]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right) \]

      prod-diff [=>]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, -\log \left(\frac{-1}{x.im}\right) \cdot y.im\right) + \mathsf{fma}\left(-\log \left(\frac{-1}{x.im}\right), y.im, \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)} \]

      *-commutative [<=]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, -\color{blue}{y.im \cdot \log \left(\frac{-1}{x.im}\right)}\right) + \mathsf{fma}\left(-\log \left(\frac{-1}{x.im}\right), y.im, \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right) \]

      fma-neg [<=]81.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)} + \mathsf{fma}\left(-\log \left(\frac{-1}{x.im}\right), y.im, \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right) \]

      cos-sum [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right) \cdot \cos \left(\mathsf{fma}\left(-\log \left(\frac{-1}{x.im}\right), y.im, \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right) - \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right) \cdot \sin \left(\mathsf{fma}\left(-\log \left(\frac{-1}{x.im}\right), y.im, \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)\right)} \]
    6. Simplified84.1%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(-x.im\right), \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(-x.im\right), \log \left(\frac{-1}{x.im}\right) \cdot y.im\right)\right)\right)} \]
      Step-by-step derivation

      [Start]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

      *-commutative [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \color{blue}{\left(-1 \cdot x.im\right)}\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

      mul-1-neg [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \color{blue}{\left(-x.im\right)}\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

      *-commutative [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \color{blue}{\left(-1 \cdot x.im\right)}, y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

      mul-1-neg [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \color{blue}{\left(-x.im\right)}, y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

      *-commutative [=>]84.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(-x.im\right), \color{blue}{\log \left(\frac{-1}{x.im}\right) \cdot y.im}\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(x.im \cdot -1\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(x.im \cdot -1\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right) \]

    if -1.10000000000000004e-40 < x.im < 2.50000000000000013e141

    1. Initial program 59.8%

      \[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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Simplified80.4%

      \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
      Step-by-step derivation

      [Start]59.8%

      \[ 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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Applied egg-rr77.3%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}\right)}^{3}\right)} \]
      Step-by-step derivation

      [Start]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]

      *-commutative [<=]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \color{blue}{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right)\right) \]

      hypot-udef [=>]59.8%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \]

      fma-def [<=]59.8%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]

      add-cube-cbrt [=>]60.7%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re} \cdot \sqrt[3]{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right) \cdot \sqrt[3]{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right)} \]

      pow3 [=>]57.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left({\left(\sqrt[3]{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right)}^{3}\right)} \]

      *-commutative [=>]57.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left({\left(\sqrt[3]{\color{blue}{y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right)}^{3}\right) \]

      hypot-udef [<=]77.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re}\right)}^{3}\right) \]

      fma-def [=>]77.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left({\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}}\right)}^{3}\right) \]
    4. Applied egg-rr83.0%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
      Step-by-step derivation

      [Start]77.3%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}\right)}^{3}\right) \]

      unpow3 [=>]80.1%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)}\right)} \]

      add-cube-cbrt [<=]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)} \]

      fma-udef [=>]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)} \]

      *-commutative [=>]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) + \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right) \]

      *-commutative [<=]80.4%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im} + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]

      add-cube-cbrt [=>]80.9%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \color{blue}{\left(\left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right) \cdot \sqrt[3]{y.im}\right)} + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]

      associate-*r* [=>]83.0%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\color{blue}{\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im}} + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]

      fma-def [=>]83.0%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right), \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]

      hypot-udef [=>]61.6%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \color{blue}{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)} \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right), \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]

      +-commutative [=>]61.6%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\sqrt{\color{blue}{x.im \cdot x.im + x.re \cdot x.re}}\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right), \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]

      hypot-def [=>]83.0%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)} \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right), \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]

      pow2 [=>]83.0%

      \[ e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \color{blue}{{\left(\sqrt[3]{y.im}\right)}^{2}}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]

    if 2.50000000000000013e141 < x.im

    1. Initial program 0.0%

      \[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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Simplified81.4%

      \[\leadsto \color{blue}{e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
      Step-by-step derivation

      [Start]0.0%

      \[ 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 \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Taylor expanded in y.im around 0 84.1%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    4. Taylor expanded in y.re around 0 89.4%

      \[\leadsto e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-40}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \cos \left(\mathsf{fma}\left(y.im, \log \left(-x.im\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right) - \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log \left(-x.im\right)\right)\right) \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(-x.im\right), y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\right)\right)\\ \mathbf{elif}\;x.im \leq 2.5 \cdot 10^{+141}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy80.9%
Cost130884
\[\begin{array}{l} t_0 := \log \left(-x.im\right)\\ t_1 := \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t_0\right)\\ t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ t_3 := \mathsf{fma}\left(y.im, t_0, y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-40}:\\ \;\;\;\;t_2 \cdot \left(\cos t_1 \cdot \cos t_3 - \sin t_1 \cdot \sin t_3\right)\\ \mathbf{elif}\;x.im \leq 2.5 \cdot 10^{+141}:\\ \;\;\;\;t_2 \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Accuracy81.8%
Cost106180
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ t_2 := e^{y.re \cdot t_1 - t_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot t_1\right)\\ \mathbf{if}\;t_2 \leq \infty:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\ \end{array} \]
Alternative 3
Accuracy81.1%
Cost78212
\[\begin{array}{l} t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;x.im \leq 2 \cdot 10^{+143}:\\ \;\;\;\;t_0 \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}, \sqrt[3]{y.im}, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Accuracy80.1%
Cost65348
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re\\ \mathbf{if}\;x.re \leq 1.4 \cdot 10^{+142}:\\ \;\;\;\;e^{t_1 - t_0} \cdot \log \left(e^{\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{t_1 - \log \left(1 + \mathsf{expm1}\left(t_0\right)\right)}\\ \end{array} \]
Alternative 5
Accuracy80.1%
Cost58820
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := t_1 \cdot y.re\\ \mathbf{if}\;x.re \leq 1.4 \cdot 10^{+142}:\\ \;\;\;\;e^{t_2 - t_0} \cdot \cos \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{t_2 - \log \left(1 + \mathsf{expm1}\left(t_0\right)\right)}\\ \end{array} \]
Alternative 6
Accuracy81.9%
Cost26176
\[e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \]
Alternative 7
Accuracy73.5%
Cost20753
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;x.re \leq -8.2 \cdot 10^{-19}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq -5 \cdot 10^{-310}:\\ \;\;\;\;e^{y.re \cdot \log \left(\frac{\left(x.im \cdot x.im\right) \cdot -0.5}{x.re} - x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq 1.15 \cdot 10^{-122} \lor \neg \left(x.re \leq 1.6 \cdot 10^{-8}\right):\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log \left(x.re + \frac{\left(x.im \cdot x.im\right) \cdot 0.5}{x.re}\right) - t_0}\\ \end{array} \]
Alternative 8
Accuracy72.5%
Cost19908
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\ \;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 9
Accuracy54.2%
Cost19844
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;x.re \leq -1.75 \cdot 10^{-298}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 10
Accuracy36.2%
Cost19712
\[e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \]

Reproduce?

herbie shell --seed 2023277 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, real part"
  :precision binary64
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))