?

Average Accuracy: 48.2% → 94.4%
Time: 28.1s
Precision: binary64
Cost: 58888

?

\[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 \sin \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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_3 := e^{t_2 \cdot y.re - t_0}\\ \mathbf{if}\;y.re \leq -1.55 \cdot 10^{-6}:\\ \;\;\;\;t_3 \cdot \sin t_1\\ \mathbf{elif}\;y.re \leq 3.1:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_2, y.im, t_1\right)\right)}{\frac{e^{t_0}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot t_1\\ \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)))
  (sin
   (+
    (* (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 (* (atan2 x.im x.re) y.im))
        (t_1 (* y.re (atan2 x.im x.re)))
        (t_2 (log (hypot x.re x.im)))
        (t_3 (exp (- (* t_2 y.re) t_0))))
   (if (<= y.re -1.55e-6)
     (* t_3 (sin t_1))
     (if (<= y.re 3.1)
       (/ (sin (fma t_2 y.im t_1)) (/ (exp t_0) (pow (hypot x.re x.im) y.re)))
       (* t_3 t_1)))))
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))) * sin(((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 = atan2(x_46_im, x_46_re) * y_46_im;
	double t_1 = y_46_re * atan2(x_46_im, x_46_re);
	double t_2 = log(hypot(x_46_re, x_46_im));
	double t_3 = exp(((t_2 * y_46_re) - t_0));
	double tmp;
	if (y_46_re <= -1.55e-6) {
		tmp = t_3 * sin(t_1);
	} else if (y_46_re <= 3.1) {
		tmp = sin(fma(t_2, y_46_im, t_1)) / (exp(t_0) / pow(hypot(x_46_re, x_46_im), y_46_re));
	} else {
		tmp = t_3 * t_1;
	}
	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))) * sin(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 = 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 = log(hypot(x_46_re, x_46_im))
	t_3 = exp(Float64(Float64(t_2 * y_46_re) - t_0))
	tmp = 0.0
	if (y_46_re <= -1.55e-6)
		tmp = Float64(t_3 * sin(t_1));
	elseif (y_46_re <= 3.1)
		tmp = Float64(sin(fma(t_2, y_46_im, t_1)) / Float64(exp(t_0) / (hypot(x_46_re, x_46_im) ^ y_46_re)));
	else
		tmp = Float64(t_3 * t_1);
	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[Sin[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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e-6], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.1], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] / N[(N[Exp[t$95$0], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * t$95$1), $MachinePrecision]]]]]]]
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 \sin \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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{t_2 \cdot y.re - t_0}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{-6}:\\
\;\;\;\;t_3 \cdot \sin t_1\\

\mathbf{elif}\;y.re \leq 3.1:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_2, y.im, t_1\right)\right)}{\frac{e^{t_0}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\

\mathbf{else}:\\
\;\;\;\;t_3 \cdot t_1\\


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if y.re < -1.55e-6

    1. Initial program 42.6%

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \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. Simplified99.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 \sin \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)} \]
      Proof

      [Start]42.6

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

      hypot-def [=>]42.6

      \[ e^{\log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \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) \]

      fma-def [=>]42.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 \sin \color{blue}{\left(\mathsf{fma}\left(\log \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)} \]

      hypot-def [=>]99.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 \sin \left(\mathsf{fma}\left(\log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \]

      *-commutative [=>]99.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 \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
    3. Taylor expanded in y.im around 0 99.5%

      \[\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}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]

    if -1.55e-6 < y.re < 3.10000000000000009

    1. Initial program 46.3%

      \[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 \sin \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. Simplified88.2%

      \[\leadsto \color{blue}{\frac{\sin \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)}{\frac{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}} \]
      Proof

      [Start]46.3

      \[ 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 \sin \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) \]

      exp-diff [=>]46.3

      \[ \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \cdot \sin \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) \]

      associate-*l/ [=>]46.3

      \[ \color{blue}{\frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \sin \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)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}} \]

      /-rgt-identity [<=]46.3

      \[ \frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \sin \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)}{\color{blue}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{1}}} \]

      exp-0 [<=]46.3

      \[ \frac{e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re} \cdot \sin \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{\color{blue}{e^{0}}}} \]

      *-commutative [=>]46.3

      \[ \frac{\color{blue}{\sin \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) \cdot e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re}}}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{e^{0}}} \]

      associate-/l* [=>]46.3

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

      \[\leadsto \frac{\sin \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)}{\frac{\color{blue}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]

    if 3.10000000000000009 < y.re

    1. Initial program 69.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 \sin \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. Simplified99.1%

      \[\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 \sin \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)} \]
      Proof

      [Start]69.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 \sin \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) \]

      hypot-def [=>]69.4

      \[ e^{\log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \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) \]

      fma-def [=>]69.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 \sin \color{blue}{\left(\mathsf{fma}\left(\log \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)} \]

      hypot-def [=>]99.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 \sin \left(\mathsf{fma}\left(\log \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \]

      *-commutative [=>]99.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 \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \color{blue}{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\right) \]
    3. Taylor expanded in y.im around 0 99.9%

      \[\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}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    4. Taylor expanded in y.re around 0 99.8%

      \[\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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.55 \cdot 10^{-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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 3.1:\\ \;\;\;\;\frac{\sin \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)}{\frac{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \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} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy94.2%
Cost71488
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\right) \end{array} \]
Alternative 2
Accuracy93.8%
Cost58760
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;y.im \leq -36000000:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.im \leq 5.1 \cdot 10^{-17}:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 3
Accuracy94.2%
Cost58688
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \end{array} \]
Alternative 4
Accuracy93.8%
Cost45960
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{t_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{if}\;y.im \leq -32000000:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.im \leq 5.2 \cdot 10^{-17}:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \end{array} \]
Alternative 5
Accuracy93.1%
Cost45897
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.im \leq -31000000 \lor \neg \left(y.im \leq 265000000000\right):\\ \;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \end{array} \]
Alternative 6
Accuracy78.1%
Cost39824
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_2 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0}\\ t_3 := t_2 \cdot t_1\\ t_4 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.re \leq -4.8 \cdot 10^{-55}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 9.2 \cdot 10^{-259}:\\ \;\;\;\;t_2 \cdot t_4\\ \mathbf{elif}\;x.re \leq 350000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 1.5 \cdot 10^{+44}:\\ \;\;\;\;t_2 \cdot \sin t_4\\ \mathbf{else}:\\ \;\;\;\;\sin t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 7
Accuracy76.4%
Cost39560
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := -\log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -8.2 \cdot 10^{+37}:\\ \;\;\;\;y.im \cdot \left(e^{y.re \cdot t_1 - t_0} \cdot t_1\right)\\ \mathbf{elif}\;x.re \leq 1.45 \cdot 10^{+44}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 8
Accuracy76.2%
Cost39496
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := -\log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -4.8 \cdot 10^{+36}:\\ \;\;\;\;y.im \cdot \left(e^{y.re \cdot t_1 - t_0} \cdot t_1\right)\\ \mathbf{elif}\;x.re \leq 3 \cdot 10^{+44}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t_0}\\ \end{array} \]
Alternative 9
Accuracy63.1%
Cost33624
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := e^{y.re \cdot \log x.re - t_0}\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2 \cdot t_1\\ t_4 := -\log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -1.3 \cdot 10^{-131}:\\ \;\;\;\;y.im \cdot \left(e^{y.re \cdot t_4 - t_0} \cdot t_4\right)\\ \mathbf{elif}\;x.re \leq -3.4 \cdot 10^{-284}:\\ \;\;\;\;t_2 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;x.re \leq 8.5 \cdot 10^{-299}:\\ \;\;\;\;\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \left(y.im \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\ \mathbf{elif}\;x.re \leq 5.4 \cdot 10^{-79}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \left(y.im \cdot \log x.im\right)\\ \mathbf{elif}\;x.re \leq 2.8 \cdot 10^{+48}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 10
Accuracy74.9%
Cost33160
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := -\log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -2.6 \cdot 10^{+37}:\\ \;\;\;\;y.im \cdot \left(e^{y.re \cdot t_1 - t_0} \cdot t_1\right)\\ \mathbf{elif}\;x.re \leq 2.25 \cdot 10^{+49}:\\ \;\;\;\;e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - t_0} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0} \cdot \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 11
Accuracy50.2%
Cost27557
\[\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 := t_1 \cdot {x.re}^{y.re}\\ t_3 := t_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{if}\;x.im \leq -7 \cdot 10^{+59}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq -9.2 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-69}:\\ \;\;\;\;t_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;x.im \leq 2.3 \cdot 10^{-233}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq 1.08 \cdot 10^{-136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq 3.45 \cdot 10^{-102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq 1.15 \cdot 10^{-24}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq 6.5 \cdot 10^{+50} \lor \neg \left(x.im \leq 8 \cdot 10^{+50}\right):\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \left(y.im \cdot \log x.im\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - t_0} \cdot \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 12
Accuracy58.8%
Cost27220
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := t_1 \cdot {x.re}^{y.re}\\ t_3 := t_1 \cdot t_0\\ \mathbf{if}\;y.re \leq -6 \cdot 10^{+149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -4 \cdot 10^{+111}:\\ \;\;\;\;e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.im \cdot \log x.im\right)\\ \mathbf{elif}\;y.re \leq -1.5 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -7 \cdot 10^{-221}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-266}:\\ \;\;\;\;\log \left(\sqrt{x.im \cdot x.im + x.re \cdot x.re}\right) \cdot \left(y.im \cdot t_0\right)\\ \mathbf{elif}\;y.re \leq 0.41:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Accuracy60.7%
Cost26960
\[\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 := e^{y.re \cdot \log x.re - t_0}\\ t_3 := -\log \left(\frac{-1}{x.re}\right)\\ \mathbf{if}\;x.re \leq -7.6 \cdot 10^{-131}:\\ \;\;\;\;y.im \cdot \left(e^{y.re \cdot t_3 - t_0} \cdot t_3\right)\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-215}:\\ \;\;\;\;t_1 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\ \mathbf{elif}\;x.re \leq 3.2 \cdot 10^{-15}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \left(y.im \cdot \log x.im\right)\\ \mathbf{elif}\;x.re \leq 1.45 \cdot 10^{+44}:\\ \;\;\;\;t_1 \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 14
Accuracy57.5%
Cost26884
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(\frac{-1}{x.im}\right)\\ \mathbf{if}\;x.im \leq -1.1 \cdot 10^{-57}:\\ \;\;\;\;t_1 \cdot \left(y.im \cdot \left(-e^{y.re \cdot \left(-t_1\right) - t_0}\right)\right)\\ \mathbf{elif}\;x.im \leq 2.1 \cdot 10^{-183}:\\ \;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 15
Accuracy54.8%
Cost26764
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{if}\;x.re \leq -1.3 \cdot 10^{+223}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.re \leq -6 \cdot 10^{+81}:\\ \;\;\;\;t_0 \cdot {x.re}^{y.re}\\ \mathbf{elif}\;x.re \leq 1.2:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 16
Accuracy58.8%
Cost20105
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.re \leq -3.5 \cdot 10^{+37} \lor \neg \left(y.re \leq 0.41\right):\\ \;\;\;\;t_0 \cdot {x.re}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \end{array} \]
Alternative 17
Accuracy34.4%
Cost13248
\[\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.re}^{y.re} \]

Error

Reproduce?

herbie shell --seed 2023131 
(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)))))