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

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

\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin t_2\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if y.re < -8.8235575812018323e-9

    1. Initial program 35.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. Applied egg-rr1.7

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

    if -8.8235575812018323e-9 < y.re < 1

    1. Initial program 34.5

      \[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}{\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))))): 72 points increase in error, 1 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))))): 1 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, 9 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, 16 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))))): 76 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))))): 1 points increase in error, 0 points decrease in error
    3. Taylor expanded in x.im around 0 5.4

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

    if 1 < y.re

    1. Initial program 19.5

      \[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 8.7

      \[\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification4.7

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

Alternatives

Alternative 1
Error4.5
Cost58888
\[\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 \sin t_1\\ \mathbf{if}\;y.re \leq -135000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 1:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error8.0
Cost52616
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1}\\ \mathbf{if}\;y.im \leq -2.7 \cdot 10^{+27}:\\ \;\;\;\;t_2 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_1 + 1}\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \sin t_0\\ \end{array} \]
Alternative 3
Error8.2
Cost46148
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := 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}\\ \mathbf{if}\;y.im \leq -2.7 \cdot 10^{+27}:\\ \;\;\;\;t_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin t_0\\ \end{array} \]
Alternative 4
Error8.2
Cost45768
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := 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 t_0\\ \mathbf{if}\;y.im \leq -2.7 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error16.7
Cost40144
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ 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 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{t_0}} \cdot t_1\\ \mathbf{if}\;y.re \leq -135000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq 2.695932303530782 \cdot 10^{-159}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left({\left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{3}\right)\right)\\ \mathbf{elif}\;y.re \leq 1:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error17.4
Cost39760
\[\begin{array}{l} t_0 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{if}\;y.re \leq -2.3 \cdot 10^{+86}:\\ \;\;\;\;t_1 \cdot \left(y.im \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 2.695932303530782 \cdot 10^{-159}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left({\left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{3}\right)\right)\\ \mathbf{elif}\;y.re \leq 1:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot t_1\right) \cdot {x.re}^{y.re}\\ \end{array} \]
Alternative 7
Error24.9
Cost33304
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.916570742622494 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -5.99641231983366 \cdot 10^{-115}:\\ \;\;\;\;\sin \left(y.im \cdot t_0\right) \cdot {\left(\frac{-0.5}{\frac{x.re}{x.im \cdot x.im}} - x.re\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 6.16554716068044 \cdot 10^{-112}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left({\left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{3}\right)\right)\\ \mathbf{elif}\;y.re \leq 3.1964462484204797 \cdot 10^{-86}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.0599994730395986 \cdot 10^{-75}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(e^{\left(3 \cdot t_0\right) \cdot 0.3333333333333333}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error19.3
Cost33104
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}\\ \mathbf{if}\;y.im \leq -2.7 \cdot 10^{+27}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\frac{-0.5}{\frac{x.re}{x.im \cdot x.im}} - x.re\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq -1.0386495720004931 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 4.0616349600219117 \cdot 10^{-171}:\\ \;\;\;\;\sin t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;t_1\\ \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 9
Error19.8
Cost33104
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2\\ \mathbf{if}\;y.im \leq -1.65 \cdot 10^{+26}:\\ \;\;\;\;t_3 \cdot e^{y.re \cdot \log x.re - t_0}\\ \mathbf{elif}\;y.im \leq -1.0386495720004931 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 4.0616349600219117 \cdot 10^{-171}:\\ \;\;\;\;t_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 10
Error15.9
Cost33104
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\left(-y.re\right)}}\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2\\ \mathbf{if}\;y.im \leq -411298.913539476:\\ \;\;\;\;t_3 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{elif}\;y.im \leq -1.0386495720004931 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 4.0616349600219117 \cdot 10^{-171}:\\ \;\;\;\;t_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.im \leq 57000000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 11
Error24.9
Cost32848
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.916570742622494 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -5.99641231983366 \cdot 10^{-115}:\\ \;\;\;\;t_0 \cdot {\left(\frac{-0.5}{\frac{x.re}{x.im \cdot x.im}} - x.re\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 6.16554716068044 \cdot 10^{-112}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left({\left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{3}\right)\right)\\ \mathbf{elif}\;y.re \leq 3.1964462484204797 \cdot 10^{-86}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.0599994730395986 \cdot 10^{-75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 12
Error24.9
Cost32784
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.916570742622494 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -5.99641231983366 \cdot 10^{-115}:\\ \;\;\;\;t_0 \cdot {\left(\frac{-0.5}{\frac{x.re}{x.im \cdot x.im}} - x.re\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 6.16554716068044 \cdot 10^{-112}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t_0\right)\right)\\ \mathbf{elif}\;y.re \leq 3.1964462484204797 \cdot 10^{-86}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.0599994730395986 \cdot 10^{-75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error24.9
Cost27092
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -1.916570742622494 \cdot 10^{-47}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -5.99641231983366 \cdot 10^{-115}:\\ \;\;\;\;t_0 \cdot {\left(\frac{-0.5}{\frac{x.re}{x.im \cdot x.im}} - x.re\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 6.16554716068044 \cdot 10^{-112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 3.1964462484204797 \cdot 10^{-86}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.0599994730395986 \cdot 10^{-75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error23.8
Cost26828
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 6.16554716068044 \cdot 10^{-112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 3.1964462484204797 \cdot 10^{-86}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.0599994730395986 \cdot 10^{-75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 15
Error23.5
Cost26376
\[\begin{array}{l} t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.re \leq -3.833862264261435 \cdot 10^{-203}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 6.123693673871671 \cdot 10^{-125}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error26.6
Cost26112
\[\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot \left(y.im \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right) \]
Alternative 17
Error40.7
Cost19848
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log x.im\right) \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -132000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+25}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error40.9
Cost19848
\[\begin{array}{l} \mathbf{if}\;x.re \leq -5 \cdot 10^{-15}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{elif}\;x.re \leq 1.45 \cdot 10^{-292}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right) \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 19
Error36.6
Cost19848
\[\begin{array}{l} t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{if}\;y.re \leq -132000000000:\\ \;\;\;\;\left(1 + t_0\right) + -1\\ \mathbf{elif}\;y.re \leq 110000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;{x.re}^{y.re} \cdot \sin \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 20
Error47.6
Cost19456
\[\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \]
Alternative 21
Error55.0
Cost13124
\[\begin{array}{l} \mathbf{if}\;x.re \leq 9.2 \cdot 10^{-303}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \end{array} \]
Alternative 22
Error48.3
Cost13056
\[y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \]
Alternative 23
Error59.5
Cost12992
\[\sin \left(y.im \cdot \log x.im\right) \]

Error

Reproduce

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