Average Error: 33.3 → 6.3
Time: 41.3s
Precision: binary64
Cost: 45960
\[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 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\ \mathbf{if}\;y.re \leq -1.2795022142120869 \cdot 10^{-8}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_1\\ \mathbf{elif}\;y.re \leq 1.4110851014167927 \cdot 10^{-26}:\\ \;\;\;\;\frac{1}{e^{t_0}} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \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 (sin (fma (log (hypot x.re x.im)) y.im t_1))))
   (if (<= y.re -1.2795022142120869e-8)
     (*
      (exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
      (sin t_1))
     (if (<= y.re 1.4110851014167927e-26)
       (* (/ 1.0 (exp t_0)) t_2)
       (* t_2 (pow (hypot x.im x.re) y.re))))))
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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
	double tmp;
	if (y_46_re <= -1.2795022142120869e-8) {
		tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
	} else if (y_46_re <= 1.4110851014167927e-26) {
		tmp = (1.0 / exp(t_0)) * t_2;
	} else {
		tmp = t_2 * pow(hypot(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)
	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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))
	tmp = 0.0
	if (y_46_re <= -1.2795022142120869e-8)
		tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(t_1));
	elseif (y_46_re <= 1.4110851014167927e-26)
		tmp = Float64(Float64(1.0 / exp(t_0)) * t_2);
	else
		tmp = Float64(t_2 * (hypot(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_] := 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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.2795022142120869e-8], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.4110851014167927e-26], N[(N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$2 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $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 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\
\mathbf{if}\;y.re \leq -1.2795022142120869 \cdot 10^{-8}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_1\\

\mathbf{elif}\;y.re \leq 1.4110851014167927 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{e^{t_0}} \cdot t_2\\

\mathbf{else}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if y.re < -1.2795022142120869e-8

    1. Initial program 36.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. Taylor expanded in y.im around 0 1.3

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

    if -1.2795022142120869e-8 < y.re < 1.4110851014167927e-26

    1. Initial program 34.7

      \[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. Simplified7.5

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{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
      (*.f64 (/.f64 (pow.f64 (hypot.f64 x.re x.im) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 81 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re))) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re)) (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 (atan2.f64 x.im x.re) y.im)))) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 2 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= exp-diff_binary64 (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 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 15 points decrease in error
      (*.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 (fma.f64 (log.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))))) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 82 points increase in error, 0 points decrease in error
      (*.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 (fma.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im (Rewrite<= *-commutative_binary64 (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
      (*.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 (Rewrite<= fma-def_binary64 (+.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 points increase in error, 0 points decrease in error
    3. Taylor expanded in y.re around 0 6.0

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

    if 1.4110851014167927e-26 < y.re

    1. Initial program 21.7

      \[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. Simplified18.2

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{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
      (*.f64 (/.f64 (pow.f64 (hypot.f64 x.re x.im) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (pow.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 81 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re))) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re)) (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 (atan2.f64 x.im x.re) y.im)))) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 2 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= exp-diff_binary64 (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 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 15 points decrease in error
      (*.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 (fma.f64 (log.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))))) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 82 points increase in error, 0 points decrease in error
      (*.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 (fma.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im (Rewrite<= *-commutative_binary64 (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
      (*.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 (Rewrite<= fma-def_binary64 (+.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 points increase in error, 0 points decrease in error
    3. Taylor expanded in y.im around 0 20.5

      \[\leadsto \color{blue}{{\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}} \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) \]
    4. Simplified17.1

      \[\leadsto \color{blue}{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}} \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
      (pow.f64 (hypot.f64 x.im x.re) y.re): 0 points increase in error, 0 points decrease in error
      (pow.f64 (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 x.im x.im) (*.f64 x.re x.re)))) y.re): 64 points increase in error, 29 points decrease in error
      (pow.f64 (sqrt.f64 (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 x.im 2)) (*.f64 x.re x.re))) y.re): 0 points increase in error, 0 points decrease in error
      (pow.f64 (sqrt.f64 (+.f64 (pow.f64 x.im 2) (Rewrite<= unpow2_binary64 (pow.f64 x.re 2)))) y.re): 0 points increase in error, 0 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification6.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.2795022142120869 \cdot 10^{-8}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \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 1.4110851014167927 \cdot 10^{-26}:\\ \;\;\;\;\frac{1}{e^{\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)\\ \mathbf{else}:\\ \;\;\;\;\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) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \end{array} \]

Alternatives

Alternative 1
Error8.2
Cost45768
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.im \leq -5 \cdot 10^{+41}:\\ \;\;\;\;\sin t_1 \cdot \frac{1}{t_0}\\ \mathbf{elif}\;y.im \leq 2.6059028859045788 \cdot 10^{-6}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_1}{t_0}\\ \end{array} \]
Alternative 2
Error12.5
Cost39748
\[\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 := \sin t_1\\ t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0}\\ \mathbf{if}\;y.re \leq -1.2795022142120869 \cdot 10^{-8}:\\ \;\;\;\;t_3 \cdot t_2\\ \mathbf{elif}\;y.re \leq -2.660103679763012 \cdot 10^{-125}:\\ \;\;\;\;\frac{t_2}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{elif}\;y.re \leq 5.027842109773716 \cdot 10^{-99}:\\ \;\;\;\;\frac{1}{e^{t_0}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+23}:\\ \;\;\;\;\frac{t_2}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot t_1\\ \end{array} \]
Alternative 3
Error24.5
Cost33752
\[\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 := \sin t_1\\ t_3 := t_2 \cdot e^{y.re \cdot \log x.re - t_0}\\ t_4 := t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ t_5 := \frac{1}{e^{t_0}}\\ \mathbf{if}\;x.re \leq -1.62 \cdot 10^{-124}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.re \leq -2.25 \cdot 10^{-176}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t_1 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{elif}\;x.re \leq -2.15 \cdot 10^{-299}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.re \leq 5.1 \cdot 10^{-173}:\\ \;\;\;\;t_5 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;x.re \leq 1.65 \cdot 10^{+156}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{+178}:\\ \;\;\;\;t_5 \cdot \sin \left(t_1 + y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error12.6
Cost33744
\[\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 \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_1\\ t_3 := \sin t_1\\ \mathbf{if}\;y.re \leq -1.2795022142120869 \cdot 10^{-8}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -2.660103679763012 \cdot 10^{-125}:\\ \;\;\;\;\frac{t_3}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{elif}\;y.re \leq 5.027842109773716 \cdot 10^{-99}:\\ \;\;\;\;\frac{1}{e^{t_0}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+23}:\\ \;\;\;\;\frac{t_3}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error24.5
Cost33624
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \frac{1}{e^{t_0}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2\\ t_4 := t_3 \cdot e^{y.re \cdot \log x.re - t_0}\\ t_5 := t_3 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{if}\;x.re \leq -1.62 \cdot 10^{-124}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x.re \leq -2.25 \cdot 10^{-176}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(t_2 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\ \mathbf{elif}\;x.re \leq -2.15 \cdot 10^{-299}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;x.re \leq 5.1 \cdot 10^{-173}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.re \leq 1.65 \cdot 10^{+156}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{+178}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 6
Error27.0
Cost33364
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \frac{1}{e^{t_0}}\\ t_2 := t_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_4 := t_3 \cdot e^{y.re \cdot \log x.im - t_0}\\ \mathbf{if}\;x.im \leq -1.7 \cdot 10^{+247}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq -2.7 \cdot 10^{+175}:\\ \;\;\;\;\sin t_3 \cdot t_1\\ \mathbf{elif}\;x.im \leq 6.7 \cdot 10^{-239}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq 9.8 \cdot 10^{-138}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 3.4 \cdot 10^{-109}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 7
Error23.8
Cost33360
\[\begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := \frac{1}{e^{t_1}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_3 := t_0 \cdot e^{y.re \cdot \log x.re - t_1}\\ \mathbf{if}\;x.re \leq -2.15 \cdot 10^{-299}:\\ \;\;\;\;t_0 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_1}\\ \mathbf{elif}\;x.re \leq 5.1 \cdot 10^{-173}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.re \leq 1.65 \cdot 10^{+156}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{+178}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 8
Error28.7
Cost26564
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq 6.5 \cdot 10^{-262}:\\ \;\;\;\;\sin t_1 \cdot \frac{1}{e^{t_0}}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 9
Error33.8
Cost26304
\[\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{1}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \]
Alternative 10
Error33.9
Cost19776
\[\frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \]

Error

Reproduce

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