Average Error: 33.3 → 3.3
Time: 32.7s
Precision: binary64
Cost: 182016
\[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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ e^{\mathsf{fma}\left({\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{3 \cdot \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\right)\right)}^{2}, \sqrt[3]{3 \cdot \mathsf{fma}\left(y.re, t_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot 0.3333333333333333, \mathsf{fma}\left(-\sqrt[3]{t_0}, {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{y.im}\right)}^{2}, t_0\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\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
 (let* ((t_0 (* (atan2 x.im x.re) y.im)) (t_1 (log (hypot x.re x.im))))
   (*
    (exp
     (fma
      (pow
       (log1p
        (expm1
         (cbrt
          (*
           3.0
           (fma (atan2 x.im x.re) y.im (* y.re (log (hypot x.im x.re))))))))
       2.0)
      (*
       (cbrt (* 3.0 (fma y.re t_1 (* (atan2 x.im x.re) (- y.im)))))
       0.3333333333333333)
      (fma
       (- (cbrt t_0))
       (pow (* (cbrt (atan2 x.im x.re)) (cbrt y.im)) 2.0)
       t_0)))
    (sin (fma t_1 y.im (* (atan2 x.im x.re) y.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 t_0 = atan2(x_46_im, x_46_re) * y_46_im;
	double t_1 = log(hypot(x_46_re, x_46_im));
	return exp(fma(pow(log1p(expm1(cbrt((3.0 * fma(atan2(x_46_im, x_46_re), y_46_im, (y_46_re * log(hypot(x_46_im, x_46_re)))))))), 2.0), (cbrt((3.0 * fma(y_46_re, t_1, (atan2(x_46_im, x_46_re) * -y_46_im)))) * 0.3333333333333333), fma(-cbrt(t_0), pow((cbrt(atan2(x_46_im, x_46_re)) * cbrt(y_46_im)), 2.0), t_0))) * sin(fma(t_1, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)));
}
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 = log(hypot(x_46_re, x_46_im))
	return Float64(exp(fma((log1p(expm1(cbrt(Float64(3.0 * fma(atan(x_46_im, x_46_re), y_46_im, Float64(y_46_re * log(hypot(x_46_im, x_46_re)))))))) ^ 2.0), Float64(cbrt(Float64(3.0 * fma(y_46_re, t_1, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))) * 0.3333333333333333), fma(Float64(-cbrt(t_0)), (Float64(cbrt(atan(x_46_im, x_46_re)) * cbrt(y_46_im)) ^ 2.0), t_0))) * sin(fma(t_1, y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re))))
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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[Power[N[Log[1 + N[(Exp[N[Power[N[(3.0 * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * N[(N[Power[N[(3.0 * N[(y$46$re * t$95$1 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + N[((-N[Power[t$95$0, 1/3], $MachinePrecision]) * N[Power[N[(N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left({\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{3 \cdot \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\right)\right)}^{2}, \sqrt[3]{3 \cdot \mathsf{fma}\left(y.re, t_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot 0.3333333333333333, \mathsf{fma}\left(-\sqrt[3]{t_0}, {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{y.im}\right)}^{2}, t_0\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_1, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)
\end{array}

Error

Derivation

  1. Initial program 33.3

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

    \[\leadsto \color{blue}{\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)} \]
    Proof
    (*.f64 (/.f64 (pow.f64 (hypot.f64 x.re x.im) y.re) (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, 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) (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))))): 76 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))) (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, 0 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, 17 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))))): 83 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-rr3.3

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

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

    \[\leadsto e^{\mathsf{fma}\left({\color{blue}{\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{3 \cdot \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\right)\right)}}^{2}, \sqrt[3]{3 \cdot \mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot 0.3333333333333333, \mathsf{fma}\left(-\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}, {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)}^{2}, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)} \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) \]
  6. Applied egg-rr3.3

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

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

Alternatives

Alternative 1
Error3.3
Cost129984
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \sin \left(\mathsf{fma}\left(t_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot e^{\mathsf{fma}\left({\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{3 \cdot \mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\right)\right)}^{2}, \sqrt[3]{3 \cdot \mathsf{fma}\left(y.re, t_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot 0.3333333333333333, 0\right)} \end{array} \]
Alternative 2
Error3.3
Cost58944
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \sin \left(\mathsf{fma}\left(t_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot e^{0.3333333333333333 \cdot \left(3 \cdot \left(y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)} \end{array} \]
Alternative 3
Error3.3
Cost58688
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ \sin \left(\mathsf{fma}\left(t_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \end{array} \]
Alternative 4
Error3.3
Cost52616
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := e^{0.3333333333333333 \cdot \left(3 \cdot \left(y.re \cdot t_0 - t_1\right)\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{-9}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-12}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_1 + 1}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 5
Error3.3
Cost46216
\[\begin{array}{l} t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_1 := e^{0.3333333333333333 \cdot \left(3 \cdot \left(y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\ \mathbf{if}\;y.im \leq -2.8 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 10^{-18}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error3.5
Cost45896
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\ \mathbf{if}\;y.re \leq -3.8 \cdot 10^{-14}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-14}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error4.1
Cost45768
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\ \mathbf{if}\;y.im \leq -4000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 60000000000000:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error13.7
Cost39760
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin t_0 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\ \mathbf{if}\;y.re \leq -1 \cdot 10^{+16}:\\ \;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -9.5 \cdot 10^{-167}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-146}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-101}:\\ \;\;\;\;\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 9
Error10.4
Cost39692
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\ t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\ \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-167}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-146}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-101}:\\ \;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error17.0
Cost33108
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin t_0\\ t_2 := t_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right)\\ \mathbf{if}\;y.re \leq -2.15 \cdot 10^{-10}:\\ \;\;\;\;t_1 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -3.2 \cdot 10^{-178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 9 \cdot 10^{-207}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 2.4 \cdot 10^{-101}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+87}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot {x.im}^{y.re}\\ \end{array} \]
Alternative 11
Error13.5
Cost33036
\[\begin{array}{l} t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_2 := \sin t_1\\ \mathbf{if}\;y.re \leq -2.15 \cdot 10^{-10}:\\ \;\;\;\;t_2 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-167}:\\ \;\;\;\;t_2 \cdot t_0\\ \mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-146}:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_0\\ \mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-13}:\\ \;\;\;\;\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 \cdot {x.im}^{y.re}\\ \end{array} \]
Alternative 12
Error29.6
Cost26772
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin t_0\\ t_2 := e^{\mathsf{log1p}\left(t_0\right)} + -1\\ t_3 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ t_4 := t_0 \cdot t_3\\ \mathbf{if}\;y.im \leq -7.5 \cdot 10^{+221}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y.im \leq -1.15 \cdot 10^{+151}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -6.5 \cdot 10^{+117}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y.im \leq -660000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+150}:\\ \;\;\;\;t_3 \cdot t_1\\ \mathbf{elif}\;y.im \leq 4.8 \cdot 10^{+200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{+231}:\\ \;\;\;\;t_1 \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 13
Error20.7
Cost26564
\[\begin{array}{l} t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;y.re \leq -2.15 \cdot 10^{-10}:\\ \;\;\;\;t_0 \cdot {\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 8.4 \cdot 10^{+79}:\\ \;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot {x.im}^{y.re}\\ \end{array} \]
Alternative 14
Error20.7
Cost26504
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin t_0\\ \mathbf{if}\;y.re \leq -5:\\ \;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+93}:\\ \;\;\;\;t_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1 \cdot {x.im}^{y.re}\\ \end{array} \]
Alternative 15
Error29.7
Cost20572
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := e^{\mathsf{log1p}\left(t_0\right)} + -1\\ t_2 := t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\ \mathbf{if}\;y.im \leq -2.95 \cdot 10^{+221}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -4.4 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -7.8 \cdot 10^{+117}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -7.6 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 4 \cdot 10^{+150}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 6.2 \cdot 10^{+200}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+228}:\\ \;\;\;\;\sin t_0 \cdot {x.im}^{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 16
Error33.9
Cost20176
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin t_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -3.4 \cdot 10^{-9}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq -7.6 \cdot 10^{-139}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 1.56 \cdot 10^{-146}:\\ \;\;\;\;\sqrt[3]{{t_0}^{3}}\\ \mathbf{elif}\;y.re \leq 8 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error41.2
Cost19848
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(1 + \mathsf{expm1}\left(t_0\right)\right)\\ \mathbf{if}\;y.im \leq -2550000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 2.4 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error41.1
Cost19848
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := e^{\mathsf{log1p}\left(t_0\right)} + -1\\ \mathbf{if}\;y.im \leq -2550000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 5.2 \cdot 10^{-52}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 19
Error44.1
Cost19784
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sqrt[3]{{t_0}^{3}}\\ \mathbf{if}\;y.im \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 34000000000000:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 20
Error51.0
Cost6656
\[\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re \]

Error

Reproduce

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