Average Error: 32.9 → 6.5
Time: 43.9s
Precision: binary64
Cost: 65932
\[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.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;\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, t_1\right)\right)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(t_1 + y.im \cdot \log \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \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.re (/ (atan2 x.im x.re) (pow (exp y.im) (atan2 x.im x.re)))))
        (t_1 (* y.re (atan2 x.im x.re))))
   (if (<= y.im -8.5e+85)
     t_0
     (if (<= y.im 1.5e+21)
       (*
        (/ (pow (hypot x.re x.im) y.re) (pow (exp (atan2 x.im x.re)) y.im))
        (sin (fma (log (hypot x.re x.im)) y.im t_1)))
       (if (<= y.im 2.35e+118)
         (*
          (exp
           (-
            (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
            (* y.im (atan2 x.im x.re))))
          (sin (+ t_1 (* y.im (log (expm1 (log1p (hypot x.re x.im))))))))
         t_0)))))
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_re * (atan2(x_46_im, x_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
	double t_1 = y_46_re * atan2(x_46_im, x_46_re);
	double tmp;
	if (y_46_im <= -8.5e+85) {
		tmp = t_0;
	} else if (y_46_im <= 1.5e+21) {
		tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(atan2(x_46_im, x_46_re)), y_46_im)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
	} else if (y_46_im <= 2.35e+118) {
		tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((t_1 + (y_46_im * log(expm1(log1p(hypot(x_46_re, x_46_im)))))));
	} else {
		tmp = t_0;
	}
	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_re * Float64(atan(x_46_im, x_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))))
	t_1 = Float64(y_46_re * atan(x_46_im, x_46_re))
	tmp = 0.0
	if (y_46_im <= -8.5e+85)
		tmp = t_0;
	elseif (y_46_im <= 1.5e+21)
		tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(atan(x_46_im, x_46_re)) ^ y_46_im)) * sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)));
	elseif (y_46_im <= 2.35e+118)
		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))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(t_1 + Float64(y_46_im * log(expm1(log1p(hypot(x_46_re, x_46_im))))))));
	else
		tmp = t_0;
	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$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+85], t$95$0, If[LessEqual[y$46$im, 1.5e+21], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision] * 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]), $MachinePrecision], If[LessEqual[y$46$im, 2.35e+118], 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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[N[(Exp[N[Log[1 + N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$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)
\begin{array}{l}
t_0 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\
\;\;\;\;\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, t_1\right)\right)\\

\mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(t_1 + y.im \cdot \log \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error

Derivation

  1. Split input into 3 regimes
  2. if y.im < -8.4999999999999994e85 or 2.3499999999999999e118 < y.im

    1. Initial program 35.1

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

      \[\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. Taylor expanded in x.re around 0 38.9

      \[\leadsto e^{\log \color{blue}{x.im} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]
    4. Taylor expanded in y.re around 0 13.9

      \[\leadsto \color{blue}{e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    5. Simplified13.4

      \[\leadsto \color{blue}{y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}} \]
      Proof
      (*.f64 y.re (/.f64 (atan2.f64 x.im x.re) (pow.f64 (exp.f64 y.im) (atan2.f64 x.im x.re)))): 0 points increase in error, 0 points decrease in error
      (*.f64 y.re (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (atan2.f64 x.im x.re) 1)) (pow.f64 (exp.f64 y.im) (atan2.f64 x.im x.re)))): 0 points increase in error, 0 points decrease in error
      (*.f64 y.re (/.f64 (*.f64 (atan2.f64 x.im x.re) 1) (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 y.im (atan2.f64 x.im x.re)))))): 9 points increase in error, 8 points decrease in error
      (*.f64 y.re (Rewrite<= associate-*r/_binary64 (*.f64 (atan2.f64 x.im x.re) (/.f64 1 (exp.f64 (*.f64 y.im (atan2.f64 x.im x.re))))))): 0 points increase in error, 1 points decrease in error
      (*.f64 y.re (*.f64 (atan2.f64 x.im x.re) (Rewrite<= exp-neg_binary64 (exp.f64 (neg.f64 (*.f64 y.im (atan2.f64 x.im x.re))))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 y.re (atan2.f64 x.im x.re)) (exp.f64 (neg.f64 (*.f64 y.im (atan2.f64 x.im x.re)))))): 0 points increase in error, 1 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (exp.f64 (neg.f64 (*.f64 y.im (atan2.f64 x.im x.re)))) (*.f64 y.re (atan2.f64 x.im x.re)))): 0 points increase in error, 0 points decrease in error

    if -8.4999999999999994e85 < y.im < 1.5e21

    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. Simplified2.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))))): 64 points increase in error, 3 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))))): 0 points increase in error, 3 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, 11 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))))): 96 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, 1 points decrease in error

    if 1.5e21 < y.im < 2.3499999999999999e118

    1. Initial program 37.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. Applied egg-rr17.1

      \[\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(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.5

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

Alternatives

Alternative 1
Error6.5
Cost65224
\[\begin{array}{l} t_0 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt{{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error7.3
Cost59276
\[\begin{array}{l} t_0 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;\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 \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_1\right)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt{{\sin t_1}^{2}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error7.3
Cost58824
\[\begin{array}{l} t_0 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;\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 \mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t_1\right)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error13.7
Cost52496
\[\begin{array}{l} t_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}}\\ t_1 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ t_2 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ t_3 := t_0 \cdot t_2\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -7.256474683362451 \cdot 10^{-244}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 7.96072971257232 \cdot 10^{-171}:\\ \;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error14.3
Cost46280
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq -7.8 \cdot 10^{+65}:\\ \;\;\;\;\sin t_1 \cdot e^{y.re \cdot \log \left(\mathsf{fma}\left(-0.5, \frac{x.re}{\frac{x.im}{x.re}}, -x.im\right)\right) - t_0}\\ \mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \sin \left(t_1 + y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\ \end{array} \]
Alternative 6
Error15.2
Cost46216
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin t_1\\ \mathbf{if}\;x.im \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;\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 t_2\\ \mathbf{else}:\\ \;\;\;\;e^{y.re \cdot \log x.im - t_0} \cdot \sin \left(t_1 + y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\ \end{array} \]
Alternative 7
Error17.4
Cost45832
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log x.im - t_0}\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2\\ \mathbf{if}\;x.im \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;t_3 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;\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 t_3\\ \mathbf{elif}\;x.im \leq 10^{-25}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin \left(t_2 + y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 8
Error17.4
Cost39884
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := e^{y.re \cdot \log x.im - t_0}\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;\sin t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;\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 t_2\\ \mathbf{elif}\;x.im \leq 10^{-25}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot \sin \left(t_2 + y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 9
Error21.1
Cost39564
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ t_2 := y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{if}\;y.im \leq -2.6 \cdot 10^{+60}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -1.7 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+21}:\\ \;\;\;\;\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 t_0\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error19.8
Cost39496
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.im \leq -3.4 \cdot 10^{-22}:\\ \;\;\;\;\sin t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{elif}\;x.im \leq 7.5 \cdot 10^{-266}:\\ \;\;\;\;\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 t_1\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 11
Error25.2
Cost33492
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ 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}\\ \mathbf{if}\;x.re \leq -1 \cdot 10^{-290}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq 5.2 \cdot 10^{-80}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 1.15 \cdot 10^{-40}:\\ \;\;\;\;t_1 \cdot {x.im}^{y.re}\\ \mathbf{elif}\;x.re \leq 3.65 \cdot 10^{+37}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 4.2 \cdot 10^{+123}:\\ \;\;\;\;y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 12
Error20.0
Cost33480
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\ \mathbf{if}\;y.re \leq -0.6012382773989142:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 1.4746300019742417 \cdot 10^{-18}:\\ \;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error23.7
Cost33028
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{if}\;x.im \leq 0:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log x.im - t_0}\\ \end{array} \]
Alternative 14
Error27.1
Cost26376
\[\begin{array}{l} t_0 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -3.4 \cdot 10^{+66}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 10^{+41}:\\ \;\;\;\;y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error27.2
Cost20104
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -3.4 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 10^{+41}:\\ \;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error36.4
Cost13512
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -176:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 4.7294970538793573 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error51.2
Cost6656
\[y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} \]

Error

Reproduce

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