Average Error: 33.5 → 6.6
Time: 31.5s
Precision: 64
\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
\[\begin{array}{l} \mathbf{if}\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 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} \le 0.9471896592040253137767535918101202696562:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 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{else}:\\ \;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{\left(\sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}\right) \cdot \sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \left(\sqrt[3]{y.re} \cdot \left(\sqrt[3]{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \sqrt[3]{y.re}\right)\right)}}\\ \end{array}\]
e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\begin{array}{l}
\mathbf{if}\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 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} \le 0.9471896592040253137767535918101202696562:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot 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{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{\left(\sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}} \cdot \sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}\right) \cdot \sqrt[3]{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \left(\sqrt[3]{y.re} \cdot \left(\sqrt[3]{y.re} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \sqrt[3]{y.re}\right)\right)}}\\

\end{array}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r33318 = x_re;
        double r33319 = r33318 * r33318;
        double r33320 = x_im;
        double r33321 = r33320 * r33320;
        double r33322 = r33319 + r33321;
        double r33323 = sqrt(r33322);
        double r33324 = log(r33323);
        double r33325 = y_re;
        double r33326 = r33324 * r33325;
        double r33327 = atan2(r33320, r33318);
        double r33328 = y_im;
        double r33329 = r33327 * r33328;
        double r33330 = r33326 - r33329;
        double r33331 = exp(r33330);
        double r33332 = r33324 * r33328;
        double r33333 = r33327 * r33325;
        double r33334 = r33332 + r33333;
        double r33335 = sin(r33334);
        double r33336 = r33331 * r33335;
        return r33336;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r33337 = y_im;
        double r33338 = x_re;
        double r33339 = r33338 * r33338;
        double r33340 = x_im;
        double r33341 = r33340 * r33340;
        double r33342 = r33339 + r33341;
        double r33343 = sqrt(r33342);
        double r33344 = log(r33343);
        double r33345 = r33337 * r33344;
        double r33346 = atan2(r33340, r33338);
        double r33347 = y_re;
        double r33348 = r33346 * r33347;
        double r33349 = r33345 + r33348;
        double r33350 = sin(r33349);
        double r33351 = r33347 * r33344;
        double r33352 = r33346 * r33337;
        double r33353 = r33351 - r33352;
        double r33354 = exp(r33353);
        double r33355 = r33350 * r33354;
        double r33356 = 0.9471896592040253;
        bool r33357 = r33355 <= r33356;
        double r33358 = hypot(r33338, r33340);
        double r33359 = pow(r33358, r33347);
        double r33360 = cbrt(r33337);
        double r33361 = r33360 * r33360;
        double r33362 = exp(r33361);
        double r33363 = r33360 * r33346;
        double r33364 = pow(r33362, r33363);
        double r33365 = cbrt(r33364);
        double r33366 = r33365 * r33365;
        double r33367 = r33366 * r33365;
        double r33368 = log(r33358);
        double r33369 = cbrt(r33347);
        double r33370 = r33369 * r33346;
        double r33371 = r33369 * r33370;
        double r33372 = r33371 * r33369;
        double r33373 = fma(r33337, r33368, r33372);
        double r33374 = sin(r33373);
        double r33375 = r33367 / r33374;
        double r33376 = r33359 / r33375;
        double r33377 = r33357 ? r33355 : r33376;
        return r33377;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Split input into 2 regimes
  2. if (* (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)))) < 0.9471896592040253

    1. Initial program 2.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)\]

    if 0.9471896592040253 < (* (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))))

    1. Initial program 63.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. Simplified10.3

      \[\leadsto \color{blue}{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}}}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt10.3

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

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

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{\color{blue}{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt10.5

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot \color{blue}{\left(\left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right) \cdot \sqrt[3]{y.re}\right)}\right)\right)}}\]
    9. Applied associate-*r*10.5

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \color{blue}{\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right)\right) \cdot \sqrt[3]{y.re}}\right)\right)}}\]
    10. Simplified10.5

      \[\leadsto \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\frac{{\left(e^{\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}}\right)}^{\left(\sqrt[3]{y.im} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}}{\sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \color{blue}{\left(\sqrt[3]{y.re} \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right)\right)} \cdot \sqrt[3]{y.re}\right)\right)}}\]
    11. Using strategy rm
    12. Applied add-cube-cbrt10.5

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

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

Reproduce

herbie shell --seed 2019195 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  (* (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)))))