Average Error: 33.0 → 7.5
Time: 1.1min
Precision: binary64
Cost: 123080
\[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 \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\\ t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log \left({\left(e^{\sqrt[3]{{t_2}^{2}}}\right)}^{\left(\sqrt[3]{t_2}\right)}\right) + t_0\right)\\ \mathbf{if}\;y.im \leq -1.9 \cdot 10^{+15}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 5.372312799744028 \cdot 10^{-8}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(\log \left({t_1}^{2}\right) + \log t_1\right)}^{y.im}} \cdot \sin \left(\mathsf{fma}\left(t_2, y.im, t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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)))
        (t_1 (cbrt (exp (exp (atan2 x.im x.re)))))
        (t_2 (log (hypot x.re x.im)))
        (t_3
         (*
          (exp
           (-
            (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
            (* y.im (atan2 x.im x.re))))
          (sin
           (+
            (* y.im (log (pow (exp (cbrt (pow t_2 2.0))) (cbrt t_2))))
            t_0)))))
   (if (<= y.im -1.9e+15)
     t_3
     (if (<= y.im 5.372312799744028e-8)
       (*
        (/
         (pow (hypot x.re x.im) y.re)
         (pow (+ (log (pow t_1 2.0)) (log t_1)) y.im))
        (sin (fma t_2 y.im t_0)))
       t_3))))
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);
	double t_1 = cbrt(exp(exp(atan2(x_46_im, x_46_re))));
	double t_2 = log(hypot(x_46_re, x_46_im));
	double t_3 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(((y_46_im * log(pow(exp(cbrt(pow(t_2, 2.0))), cbrt(t_2)))) + t_0));
	double tmp;
	if (y_46_im <= -1.9e+15) {
		tmp = t_3;
	} else if (y_46_im <= 5.372312799744028e-8) {
		tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow((log(pow(t_1, 2.0)) + log(t_1)), y_46_im)) * sin(fma(t_2, y_46_im, t_0));
	} else {
		tmp = t_3;
	}
	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 * atan(x_46_im, x_46_re))
	t_1 = cbrt(exp(exp(atan(x_46_im, x_46_re))))
	t_2 = log(hypot(x_46_re, x_46_im))
	t_3 = 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(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(Float64(y_46_im * log((exp(cbrt((t_2 ^ 2.0))) ^ cbrt(t_2)))) + t_0)))
	tmp = 0.0
	if (y_46_im <= -1.9e+15)
		tmp = t_3;
	elseif (y_46_im <= 5.372312799744028e-8)
		tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (Float64(log((t_1 ^ 2.0)) + log(t_1)) ^ y_46_im)) * sin(fma(t_2, y_46_im, t_0)));
	else
		tmp = t_3;
	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[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Exp[N[Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(y$46$im * N[Log[N[Power[N[Exp[N[Power[N[Power[t$95$2, 2.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision], N[Power[t$95$2, 1/3], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.9e+15], t$95$3, If[LessEqual[y$46$im, 5.372312799744028e-8], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[(N[Log[N[Power[t$95$1, 2.0], $MachinePrecision]], $MachinePrecision] + N[Log[t$95$1], $MachinePrecision]), $MachinePrecision], y$46$im], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(t$95$2 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$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)
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log \left({\left(e^{\sqrt[3]{{t_2}^{2}}}\right)}^{\left(\sqrt[3]{t_2}\right)}\right) + t_0\right)\\
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{+15}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y.im \leq 5.372312799744028 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(\log \left({t_1}^{2}\right) + \log t_1\right)}^{y.im}} \cdot \sin \left(\mathsf{fma}\left(t_2, y.im, t_0\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}

Error

Derivation

  1. Split input into 2 regimes
  2. if y.im < -1.9e15 or 5.3723127997440278e-8 < y.im

    1. Initial program 34.7

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

      \[\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(e^{\sqrt[3]{{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{2}}}\right)}^{\left(\sqrt[3]{\log \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) \]

    if -1.9e15 < y.im < 5.3723127997440278e-8

    1. Initial program 31.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. Simplified0.6

      \[\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))))): 68 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re))) (pow.f64 (exp.f64 (atan2.f64 x.im x.re)) y.im)) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (exp.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re)) (Rewrite<= exp-prod_binary64 (exp.f64 (*.f64 (atan2.f64 x.im x.re) y.im)))) (sin.f64 (fma.f64 (log.f64 (hypot.f64 x.re x.im)) y.im (*.f64 y.re (atan2.f64 x.im x.re))))): 1 points increase in error, 5 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))))): 1 points increase in error, 21 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))))): 97 points increase in error, 0 points decrease in error
      (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (fma.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im (Rewrite<= *-commutative_binary64 (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (sin.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re))))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr0.6

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\color{blue}{\left(\log \left({\left(\sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right)}^{2}\right) + \log \left(\sqrt[3]{e^{e^{\tan^{-1}_* \frac{x.im}{x.re}}}}\right)\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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification7.5

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

Alternatives

Alternative 1
Error7.2
Cost104392
\[\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^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log \left({\left(e^{\sqrt[3]{{t_1}^{2}}}\right)}^{\left(\sqrt[3]{t_1}\right)}\right) + t_0\right)\\ \mathbf{if}\;y.im \leq -1.9 \cdot 10^{+15}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 240.9437894319003:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot \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}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error7.4
Cost72072
\[\begin{array}{l} t_0 := \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)\\ t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \log \left(e^{t_0}\right)\\ \mathbf{if}\;y.im \leq -3223.0114933928676:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 5.652441524452082 \cdot 10^{-8}:\\ \;\;\;\;t_0 \cdot \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}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error7.2
Cost65224
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \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{if}\;y.im \leq -5.1 \cdot 10^{+29}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 240.9437894319003:\\ \;\;\;\;\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 \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}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error7.8
Cost46280
\[\begin{array}{l} t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \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{if}\;y.im \leq -300000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 5.372312799744028 \cdot 10^{-8}:\\ \;\;\;\;{\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, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error20.2
Cost46228
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := \sin t_2\\ t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_5 := e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ t_6 := y.im \cdot t_1\\ t_7 := \frac{t_4}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot t_6\\ \mathbf{if}\;x.re \leq -1 \cdot 10^{-70}:\\ \;\;\;\;t_3 \cdot t_5\\ \mathbf{elif}\;x.re \leq -1 \cdot 10^{-182}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;x.re \leq -3.5 \cdot 10^{-274}:\\ \;\;\;\;t_2 \cdot t_5\\ \mathbf{elif}\;x.re \leq 1.4 \cdot 10^{-295}:\\ \;\;\;\;y.im \cdot \left(t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{elif}\;x.re \leq 4.8 \cdot 10^{-240}:\\ \;\;\;\;t_7\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0} \cdot t_3\\ \mathbf{elif}\;x.re \leq 4.7 \cdot 10^{+33}:\\ \;\;\;\;\frac{t_4}{\frac{1}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}}\\ \mathbf{elif}\;x.re \leq 4.3 \cdot 10^{+105}:\\ \;\;\;\;t_3 \cdot e^{y.re \cdot \log x.re - t_0}\\ \mathbf{else}:\\ \;\;\;\;\sin t_6 \cdot \frac{t_4}{t_0 + 1}\\ \end{array} \]
Alternative 6
Error14.5
Cost46160
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_3 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot \frac{t_0}{e^{t_1}}\\ \mathbf{if}\;y.im \leq -1.5 \cdot 10^{+79}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_1} \cdot t_2\\ \mathbf{elif}\;y.im \leq -3.9082527352645433 \cdot 10^{-137}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 4.327775286785204 \cdot 10^{-153}:\\ \;\;\;\;\frac{t_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot t_2\\ \mathbf{elif}\;y.im \leq 240.9437894319003:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot 0\\ \end{array} \]
Alternative 7
Error14.7
Cost45964
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_3 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot \frac{t_0}{t_1 + 1}\\ \mathbf{if}\;y.im \leq -300000000000:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_1} \cdot t_2\\ \mathbf{elif}\;y.im \leq -3.9082527352645433 \cdot 10^{-137}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 4.327775286785204 \cdot 10^{-153}:\\ \;\;\;\;\frac{t_0}{{\left(e^{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{y.im}} \cdot t_2\\ \mathbf{elif}\;y.im \leq 920000:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot 0\\ \end{array} \]
Alternative 8
Error7.2
Cost45768
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{if}\;y.im \leq -300000000000:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t_0\\ \mathbf{elif}\;y.im \leq 255000000000:\\ \;\;\;\;t_1 \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 0\\ \end{array} \]
Alternative 9
Error21.0
Cost40020
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_3 := t_2 \cdot e^{y.re \cdot \log x.re - t_0}\\ t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{if}\;x.re \leq -3.5 \cdot 10^{-274}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq 1.4 \cdot 10^{-295}:\\ \;\;\;\;y.im \cdot \left(t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 4.7 \cdot 10^{+33}:\\ \;\;\;\;\frac{t_4}{\frac{1}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}}\\ \mathbf{elif}\;x.re \leq 4.3 \cdot 10^{+105}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot t_1\right) \cdot \frac{t_4}{t_0 + 1}\\ \end{array} \]
Alternative 10
Error17.2
Cost39748
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.im \leq -300000000000:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_1} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.im \leq 920000:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot \frac{t_0}{t_1 + 1}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot 0\\ \end{array} \]
Alternative 11
Error21.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 \cdot e^{y.re \cdot \log x.re - t_0}\\ t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{if}\;x.re \leq -3.5 \cdot 10^{-274}:\\ \;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq 1.4 \cdot 10^{-295}:\\ \;\;\;\;y.im \cdot \left(t_3 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.re \leq 4.7 \cdot 10^{+33}:\\ \;\;\;\;\frac{t_4}{\frac{1}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}}\\ \mathbf{elif}\;x.re \leq 6.6 \cdot 10^{+134}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \sin \left(y.im \cdot t_3\right)\\ \end{array} \]
Alternative 12
Error21.2
Cost33492
\[\begin{array}{l} t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ t_2 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ t_3 := t_2 \cdot e^{y.re \cdot \log x.re - t_0}\\ t_4 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ \mathbf{if}\;x.re \leq -3.5 \cdot 10^{-274}:\\ \;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\ \mathbf{elif}\;x.re \leq 1.4 \cdot 10^{-295}:\\ \;\;\;\;y.im \cdot \left(t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{elif}\;x.re \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.re \leq 4.7 \cdot 10^{+33}:\\ \;\;\;\;\frac{t_4}{\frac{1}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}}\\ \mathbf{elif}\;x.re \leq 6.6 \cdot 10^{+134}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_4 \cdot \sin \left(y.im \cdot t_1\right)\\ \end{array} \]
Alternative 13
Error16.7
Cost32904
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_1 := t_0 \cdot 0\\ \mathbf{if}\;y.im \leq -160000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 255000000000:\\ \;\;\;\;\frac{t_0}{\frac{1}{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error16.6
Cost32776
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\ t_1 := t_0 \cdot 0\\ \mathbf{if}\;y.im \leq -160000000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 255000000000:\\ \;\;\;\;t_0 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error16.8
Cost26376
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 0\\ \mathbf{if}\;y.im \leq -3223.0114933928676:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 405000000000:\\ \;\;\;\;y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 16
Error25.2
Cost19720
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 0\\ \mathbf{if}\;y.re \leq -5.230371234746753 \cdot 10^{-64}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 3.6149056026090035 \cdot 10^{-91}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 17
Error25.6
Cost13384
\[\begin{array}{l} t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot 0\\ \mathbf{if}\;y.re \leq -5.230371234746753 \cdot 10^{-64}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 3.6149056026090035 \cdot 10^{-91}:\\ \;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error55.2
Cost13124
\[\begin{array}{l} \mathbf{if}\;x.im \leq 2000000000:\\ \;\;\;\;\sin \left(y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 19
Error48.5
Cost13056
\[y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \]
Alternative 20
Error59.7
Cost12992
\[\sin \left(y.im \cdot \log x.im\right) \]

Error

Reproduce

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