Average Error: 32.8 → 22.3
Time: 9.0s
Precision: binary64
\[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}\;x.re \leq -1.7600018223762 \cdot 10^{-310}:\\ \;\;\;\;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(y.im \cdot \log \left(-x.re\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.re \leq 1.1131057807197489 \cdot 10^{-246} \lor \neg \left(x.re \leq 1.1812805417144586 \cdot 10^{-60}\right):\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\left|\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right| \cdot \sqrt{\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}}\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}\;x.re \leq -1.7600018223762 \cdot 10^{-310}:\\
\;\;\;\;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(y.im \cdot \log \left(-x.re\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\

\mathbf{elif}\;x.re \leq 1.1131057807197489 \cdot 10^{-246} \lor \neg \left(x.re \leq 1.1812805417144586 \cdot 10^{-60}\right):\\
\;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\

\mathbf{else}:\\
\;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\left|\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right| \cdot \sqrt{\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}}\right)\right)\\

\end{array}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_im)) + ((double) (((double) 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 VAR;
	if ((x_46_re <= -1.7600018223762e-310)) {
		VAR = ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (y_46_im * ((double) log(((double) -(x_46_re)))))) + ((double) (y_46_re * ((double) atan2(x_46_im, x_46_re))))))))));
	} else {
		double VAR_1;
		if (((x_46_re <= 1.1131057807197489e-246) || !(x_46_re <= 1.1812805417144586e-60))) {
			VAR_1 = ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (y_46_re * ((double) atan2(x_46_im, x_46_re)))) + ((double) (y_46_im * ((double) log(x_46_re))))))))));
		} else {
			VAR_1 = ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (y_46_re * ((double) atan2(x_46_im, x_46_re)))) + ((double) (y_46_im * ((double) log(((double) (((double) fabs(((double) cbrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * ((double) sqrt(((double) cbrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im))))))))))))))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x.re < -1.76000182238e-310

    1. Initial program 31.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. Taylor expanded around -inf 19.6

      \[\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(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified19.6

      \[\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(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -1.76000182238e-310 < x.re < 1.1131057807197489e-246 or 1.18128054171445861e-60 < x.re

    1. Initial program 38.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. Taylor expanded around inf 25.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(\left(\log 1 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) - y.im \cdot \log \left(\frac{1}{x.re}\right)\right)}\]
    3. Simplified25.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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log x.re\right)}\]

    if 1.1131057807197489e-246 < x.re < 1.18128054171445861e-60

    1. Initial program 24.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. Using strategy rm
    3. Applied add-cube-cbrt24.3

      \[\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 \left(\sqrt{\color{blue}{\left(\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im} \cdot \sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot \sqrt[3]{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)\]
    4. Applied sqrt-prod24.3

      \[\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(\sqrt{\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im} \cdot \sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}} \cdot \sqrt{\sqrt[3]{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)\]
    5. Simplified24.3

      \[\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 \left(\color{blue}{\left|\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right|} \cdot \sqrt{\sqrt[3]{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)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification22.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \leq -1.7600018223762 \cdot 10^{-310}:\\ \;\;\;\;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(y.im \cdot \log \left(-x.re\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.re \leq 1.1131057807197489 \cdot 10^{-246} \lor \neg \left(x.re \leq 1.1812805417144586 \cdot 10^{-60}\right):\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\ \mathbf{else}:\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\left|\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}\right| \cdot \sqrt{\sqrt[3]{x.re \cdot x.re + x.im \cdot x.im}}\right)\right)\\ \end{array}\]

Reproduce

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