Average Error: 33.1 → 3.7
Time: 30.1s
Precision: binary64
Cost: 58692
\[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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_3 := t_2 \cdot y.re\\ \mathbf{if}\;y.im \leq -3 \cdot 10^{-12}:\\ \;\;\;\;e^{t_3 - {\left(\sqrt[3]{t_0}\right)}^{3}} \cdot t_1\\ \mathbf{elif}\;y.im \leq 3 \cdot 10^{-63}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\mathsf{fma}\left(t_2, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{t_3 - t_0} \cdot \frac{1}{\frac{1}{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 (* y.im (atan2 x.im x.re)))
        (t_1 (sin (* y.im (log (hypot x.im x.re)))))
        (t_2 (log (hypot x.re x.im)))
        (t_3 (* t_2 y.re)))
   (if (<= y.im -3e-12)
     (* (exp (- t_3 (pow (cbrt t_0) 3.0))) t_1)
     (if (<= y.im 3e-63)
       (log1p
        (expm1
         (*
          (sin (fma t_2 y.im (* y.re (atan2 x.im x.re))))
          (pow (hypot x.re x.im) y.re))))
       (* (exp (- t_3 t_0)) (/ 1.0 (/ 1.0 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 = y_46_im * atan2(x_46_im, x_46_re);
	double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
	double t_2 = log(hypot(x_46_re, x_46_im));
	double t_3 = t_2 * y_46_re;
	double tmp;
	if (y_46_im <= -3e-12) {
		tmp = exp((t_3 - pow(cbrt(t_0), 3.0))) * t_1;
	} else if (y_46_im <= 3e-63) {
		tmp = log1p(expm1((sin(fma(t_2, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re))));
	} else {
		tmp = exp((t_3 - t_0)) * (1.0 / (1.0 / 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(y_46_im * atan(x_46_im, x_46_re))
	t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))
	t_2 = log(hypot(x_46_re, x_46_im))
	t_3 = Float64(t_2 * y_46_re)
	tmp = 0.0
	if (y_46_im <= -3e-12)
		tmp = Float64(exp(Float64(t_3 - (cbrt(t_0) ^ 3.0))) * t_1);
	elseif (y_46_im <= 3e-63)
		tmp = log1p(expm1(Float64(sin(fma(t_2, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re))));
	else
		tmp = Float64(exp(Float64(t_3 - t_0)) * Float64(1.0 / Float64(1.0 / 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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[(t$95$2 * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -3e-12], N[(N[Exp[N[(t$95$3 - N[Power[N[Power[t$95$0, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, 3e-63], N[Log[1 + N[(Exp[N[(N[Sin[N[(t$95$2 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(t$95$3 - t$95$0), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 / t$95$1), $MachinePrecision]), $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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := t_2 \cdot y.re\\
\mathbf{if}\;y.im \leq -3 \cdot 10^{-12}:\\
\;\;\;\;e^{t_3 - {\left(\sqrt[3]{t_0}\right)}^{3}} \cdot t_1\\

\mathbf{elif}\;y.im \leq 3 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\mathsf{fma}\left(t_2, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;e^{t_3 - t_0} \cdot \frac{1}{\frac{1}{t_1}}\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if y.im < -3.0000000000000001e-12

    1. Initial program 35.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 \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.2

      \[\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]35.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 \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 [=>]35.2

      \[ 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 [=>]35.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} \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 [=>]7.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} \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 [=>]7.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} \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. Applied egg-rr7.2

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

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

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

      [Start]35.2

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

      unpow2 [=>]35.2

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

      unpow2 [=>]35.2

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

      hypot-def [=>]7.2

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

    if -3.0000000000000001e-12 < y.im < 2.99999999999999979e-63

    1. Initial program 31.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. Simplified0.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]31.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) \]

      exp-diff [=>]31.6

      \[ \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/ [=>]31.6

      \[ \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 [<=]31.6

      \[ \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 [<=]31.6

      \[ \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 [=>]31.6

      \[ \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* [=>]31.6

      \[ \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 y.im around 0 0.2

      \[\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}{1}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}} \]
    4. Applied egg-rr0.3

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\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.re, x.im\right)\right)}^{y.re}\right)\right)} \]

    if 2.99999999999999979e-63 < y.im

    1. Initial program 34.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. Simplified6.6

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

      hypot-def [=>]34.3

      \[ 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 [=>]34.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 \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 [=>]6.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(\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 [=>]6.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(\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. Applied egg-rr14.2

      \[\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(e^{\mathsf{log1p}\left(\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)\right)} - 1\right)} \]
    4. Applied egg-rr6.6

      \[\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}{\frac{1}{\frac{1}{\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)}}} \]
    5. Taylor expanded in y.re around 0 34.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 \frac{1}{\frac{1}{\color{blue}{\sin \left(y.im \cdot \log \left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)\right)}}} \]
    6. Simplified7.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 \frac{1}{\frac{1}{\color{blue}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}}} \]
      Proof

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

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

      unpow2 [=>]34.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 \frac{1}{\frac{1}{\sin \left(y.im \cdot \log \left(\sqrt{x.im \cdot x.im + \color{blue}{x.re \cdot x.re}}\right)\right)}} \]

      hypot-def [=>]7.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 \frac{1}{\frac{1}{\sin \left(y.im \cdot \log \color{blue}{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification3.7

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

Alternatives

Alternative 1
Error3.4
Cost71552
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{t_0 \cdot y.re - {\left(\sqrt[3]{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}} \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 2
Error3.4
Cost71488
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \mathsf{log1p}\left(\mathsf{expm1}\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 3
Error3.4
Cost58688
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \end{array} \]
Alternative 4
Error3.7
Cost58568
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{t_1 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -3 \cdot 10^{-12}:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.im \leq 3 \cdot 10^{-63}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \frac{1}{\frac{1}{t_0}}\\ \end{array} \]
Alternative 5
Error3.6
Cost46216
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{t_1 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -3 \cdot 10^{-12}:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \frac{1}{\frac{1}{t_0}}\\ \end{array} \]
Alternative 6
Error4.0
Cost45961
\[\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 -54000 \lor \neg \left(y.im \leq 235\right):\\ \;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\left|t_1\right|\right)\\ \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 7
Error3.6
Cost45961
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \mathbf{if}\;y.im \leq -3 \cdot 10^{-12} \lor \neg \left(y.im \leq 3 \cdot 10^{-63}\right):\\ \;\;\;\;e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \end{array} \]
Alternative 8
Error4.0
Cost45896
\[\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}\\ t_2 := e^{t_0 \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -15600:\\ \;\;\;\;t_1 \cdot t_2\\ \mathbf{elif}\;y.im \leq 255:\\ \;\;\;\;\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}}}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \sin t_1\\ \end{array} \]
Alternative 9
Error12.0
Cost39825
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.im \leq -420:\\ \;\;\;\;t_0 \cdot t_1\\ \mathbf{elif}\;y.im \leq -1.15 \cdot 10^{-214} \lor \neg \left(y.im \leq 5 \cdot 10^{-279}\right) \land y.im \leq 450:\\ \;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin t_0\\ \end{array} \]
Alternative 10
Error24.4
Cost33625
\[\begin{array}{l} t_0 := \frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\\ t_1 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t_0}\\ t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_3 := \frac{t_2}{t_0}\\ \mathbf{if}\;x.im \leq -8.8 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.im \leq -2.6:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq -8 \cdot 10^{-121}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x.im \leq -3.5 \cdot 10^{-217}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq 2.9 \cdot 10^{-34} \lor \neg \left(x.im \leq 1.15 \cdot 10^{+253}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \end{array} \]
Alternative 11
Error12.0
Cost33424
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_2 := \frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\\ t_3 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{t_2}\\ \mathbf{if}\;y.im \leq -7200:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -2.25 \cdot 10^{-216}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 5 \cdot 10^{-279}:\\ \;\;\;\;\frac{\sin t_0}{t_2}\\ \mathbf{elif}\;y.im \leq 4900:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error24.7
Cost33300
\[\begin{array}{l} t_0 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := t_1 \cdot e^{y.re \cdot \log x.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;x.re \leq -9 \cdot 10^{+137}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.re \leq -1350:\\ \;\;\;\;\sin t_1 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;x.re \leq 4.7 \cdot 10^{-281}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.re \leq 1.16 \cdot 10^{-164}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.re \leq 7100:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.re \leq 1.7 \cdot 10^{+41}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\sin \left(t_1 + y.im \cdot \log x.re\right) \cdot {x.re}^{y.re}\\ \end{array} \]
Alternative 13
Error23.0
Cost32521
\[\begin{array}{l} \mathbf{if}\;y.re \leq -9 \cdot 10^{-58} \lor \neg \left(y.re \leq 7 \cdot 10^{-124}\right):\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)\right)\\ \end{array} \]
Alternative 14
Error23.0
Cost26505
\[\begin{array}{l} \mathbf{if}\;y.re \leq -2.4 \cdot 10^{-58} \lor \neg \left(y.re \leq 2.3 \cdot 10^{-124}\right):\\ \;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}{\frac{1}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)\right)\\ \end{array} \]
Alternative 15
Error36.8
Cost26249
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1.02 \lor \neg \left(y.re \leq 12000000000\right):\\ \;\;\;\;\sin \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)\right)\\ \end{array} \]
Alternative 16
Error37.3
Cost26057
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1 \lor \neg \left(y.re \leq 12000000000\right):\\ \;\;\;\;\sin \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \end{array} \]
Alternative 17
Error52.5
Cost13320
\[\begin{array}{l} \mathbf{if}\;x.re \leq -7.2 \cdot 10^{-62}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.re \leq 2.1 \cdot 10^{-280}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 18
Error53.2
Cost13256
\[\begin{array}{l} \mathbf{if}\;x.im \leq -1.6 \cdot 10^{-25}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.im\right)\right)\\ \mathbf{elif}\;x.im \leq 1.56 \cdot 10^{-68}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 19
Error55.0
Cost13124
\[\begin{array}{l} \mathbf{if}\;x.im \leq 1.78 \cdot 10^{-68}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 20
Error48.3
Cost13056
\[y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \]
Alternative 21
Error59.6
Cost12992
\[\sin \left(y.im \cdot \log x.im\right) \]

Error

Reproduce

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