?

Average Error: 33.4 → 3.8
Time: 30.2s
Precision: binary64
Cost: 52297

?

\[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} \mathbf{if}\;y.im \leq -9.2 \cdot 10^{-17} \lor \neg \left(y.im \leq 1.8 \cdot 10^{-71}\right):\\ \;\;\;\;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.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)\right)\right)\\ \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
 (if (or (<= y.im -9.2e-17) (not (<= y.im 1.8e-71)))
   (*
    (exp (- (* (log (hypot x.re x.im)) y.re) (* (atan2 x.im x.re) y.im)))
    (sin (* y.im (log (hypot x.im x.re)))))
   (*
    (pow (hypot x.re x.im) y.re)
    (sin
     (fma
      y.re
      (atan2 x.im x.re)
      (* y.im (* 3.0 (log (cbrt (hypot x.im x.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 tmp;
	if ((y_46_im <= -9.2e-17) || !(y_46_im <= 1.8e-71)) {
		tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
	} else {
		tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * (3.0 * log(cbrt(hypot(x_46_im, x_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)
	tmp = 0.0
	if ((y_46_im <= -9.2e-17) || !(y_46_im <= 1.8e-71))
		tmp = Float64(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))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))));
	else
		tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * Float64(3.0 * log(cbrt(hypot(x_46_im, x_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_] := If[Or[LessEqual[y$46$im, -9.2e-17], N[Not[LessEqual[y$46$im, 1.8e-71]], $MachinePrecision]], N[(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] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(3.0 * N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;y.im \leq -9.2 \cdot 10^{-17} \lor \neg \left(y.im \leq 1.8 \cdot 10^{-71}\right):\\
\;\;\;\;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.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\

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


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if y.im < -9.20000000000000035e-17 or 1.8e-71 < y.im

    1. Initial program 34.9

      \[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.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 \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.9

      \[ 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.9

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

    if -9.20000000000000035e-17 < y.im < 1.8e-71

    1. Initial program 32.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 \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{{\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(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\right)} \]
      Proof

      [Start]32.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 \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 [=>]32.0

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

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

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

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

      associate-*l/ [<=]32.0

      \[ \color{blue}{\frac{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}}} \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)} \]
    3. Applied egg-rr0.2

      \[\leadsto \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(y.re, \tan^{-1}_* \frac{x.im}{x.re}, \color{blue}{y.im \cdot \log \left({\left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)}^{2}\right) + y.im \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)}\right)\right) \]
    4. Simplified0.2

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

      [Start]0.2

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

      distribute-lft-out [=>]0.2

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

      log-pow [=>]0.2

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

      distribute-lft1-in [=>]0.2

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

      metadata-eval [=>]0.2

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

      hypot-def [<=]32.0

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

      unpow2 [<=]32.0

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

      unpow2 [<=]32.0

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

      +-commutative [<=]32.0

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

      unpow2 [=>]32.0

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

      unpow2 [=>]32.0

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

      hypot-def [=>]0.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -9.2 \cdot 10^{-17} \lor \neg \left(y.im \leq 1.8 \cdot 10^{-71}\right):\\ \;\;\;\;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.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error3.5
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 2
Error3.8
Cost45961
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \mathbf{if}\;y.im \leq -1.72 \cdot 10^{-16} \lor \neg \left(y.im \leq 1.8 \cdot 10^{-71}\right):\\ \;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_0, 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}\\ \end{array} \]
Alternative 3
Error4.2
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 -1300:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.im \leq 5200:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \sin \left(\left|t_0\right|\right)\\ \end{array} \]
Alternative 4
Error4.2
Cost45769
\[\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 -3600 \lor \neg \left(y.im \leq 600\right):\\ \;\;\;\;e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, t_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \end{array} \]
Alternative 5
Error13.1
Cost39692
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin t_0\\ 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 := t_2 \cdot t_0\\ t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_5 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_4\\ \mathbf{if}\;y.im \leq -13000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq -2.05 \cdot 10^{-138}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y.im \leq -3 \cdot 10^{-182}:\\ \;\;\;\;t_2 \cdot t_1\\ \mathbf{elif}\;y.im \leq -5.1 \cdot 10^{-301}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-233}:\\ \;\;\;\;t_4 \cdot t_1\\ \mathbf{elif}\;y.im \leq 1850:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error13.1
Cost33688
\[\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 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\ t_2 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_3 := t_2 \cdot \sin t_0\\ t_4 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_2\\ \mathbf{if}\;y.im \leq -240:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -2.05 \cdot 10^{-138}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y.im \leq -3 \cdot 10^{-182}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq -5.1 \cdot 10^{-301}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y.im \leq 1.05 \cdot 10^{-232}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 500:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error21.6
Cost33492
\[\begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_2 := t_1 \cdot t_0\\ t_3 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_1\\ \mathbf{if}\;y.im \leq -6.5 \cdot 10^{-136}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq -8 \cdot 10^{-183}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -5.1 \cdot 10^{-301}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 8.2 \cdot 10^{-233}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 1.2 \cdot 10^{+87}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array} \]
Alternative 8
Error23.9
Cost26377
\[\begin{array}{l} \mathbf{if}\;y.re \leq -7.2 \cdot 10^{-98} \lor \neg \left(y.re \leq 4.8 \cdot 10^{-43}\right):\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\ \end{array} \]
Alternative 9
Error37.1
Cost19721
\[\begin{array}{l} \mathbf{if}\;y.re \leq -3.4 \cdot 10^{-20} \lor \neg \left(y.re \leq 9.5\right):\\ \;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)\\ \end{array} \]
Alternative 10
Error46.6
Cost19657
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1.75 \cdot 10^{-88} \lor \neg \left(y.re \leq 3.2 \cdot 10^{-43}\right):\\ \;\;\;\;\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 11
Error54.0
Cost14288
\[\begin{array}{l} t_0 := y.im \cdot \log x.re\\ \mathbf{if}\;x.im \leq -1.55 \cdot 10^{+136}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\frac{x.re \cdot -0.5}{\frac{x.im}{x.re}} - x.im\right)\right)\\ \mathbf{elif}\;x.im \leq -1.6 \cdot 10^{-132}:\\ \;\;\;\;\sin t_0\\ \mathbf{elif}\;x.im \leq -2.8 \cdot 10^{-220}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.im \leq 3.4 \cdot 10^{-147}:\\ \;\;\;\;\sin \left(\frac{y.im \cdot 0.5}{\frac{x.re}{x.im} \cdot \frac{x.re}{x.im}} + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 12
Error53.9
Cost13636
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{if}\;x.im \leq -1 \cdot 10^{+138}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\frac{x.re \cdot -0.5}{\frac{x.im}{x.re}} - x.im\right)\right)\\ \mathbf{elif}\;x.im \leq -1.9 \cdot 10^{-132}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.im \leq -7.5 \cdot 10^{-220}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.im \leq 5.8 \cdot 10^{-147}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 13
Error53.8
Cost13520
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log x.re\right)\\ \mathbf{if}\;x.im \leq -1.8 \cdot 10^{+107}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.im\right)\right)\\ \mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-133}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x.im \leq -1.36 \cdot 10^{-223}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{-148}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 14
Error53.3
Cost13256
\[\begin{array}{l} \mathbf{if}\;x.im \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(-x.im\right)\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{-145}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 15
Error54.7
Cost13124
\[\begin{array}{l} \mathbf{if}\;x.im \leq 7 \cdot 10^{-147}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 16
Error59.4
Cost12992
\[\sin \left(y.im \cdot \log x.im\right) \]

Error

Reproduce?

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