Average Error: 33.8 → 3.5
Time: 8.3s
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)\]
\[e^{\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(1 \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\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(\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)
e^{\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(1 \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r15209 = x_re;
        double r15210 = r15209 * r15209;
        double r15211 = x_im;
        double r15212 = r15211 * r15211;
        double r15213 = r15210 + r15212;
        double r15214 = sqrt(r15213);
        double r15215 = log(r15214);
        double r15216 = y_re;
        double r15217 = r15215 * r15216;
        double r15218 = atan2(r15211, r15209);
        double r15219 = y_im;
        double r15220 = r15218 * r15219;
        double r15221 = r15217 - r15220;
        double r15222 = exp(r15221);
        double r15223 = r15215 * r15219;
        double r15224 = r15218 * r15216;
        double r15225 = r15223 + r15224;
        double r15226 = sin(r15225);
        double r15227 = r15222 * r15226;
        return r15227;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r15228 = 1.0;
        double r15229 = x_re;
        double r15230 = x_im;
        double r15231 = hypot(r15229, r15230);
        double r15232 = r15228 * r15231;
        double r15233 = log(r15232);
        double r15234 = y_re;
        double r15235 = r15233 * r15234;
        double r15236 = atan2(r15230, r15229);
        double r15237 = y_im;
        double r15238 = r15236 * r15237;
        double r15239 = r15235 - r15238;
        double r15240 = exp(r15239);
        double r15241 = log(r15231);
        double r15242 = r15241 * r15237;
        double r15243 = r15228 * r15242;
        double r15244 = r15236 * r15234;
        double r15245 = r15243 + r15244;
        double r15246 = sin(r15245);
        double r15247 = r15240 * r15246;
        return r15247;
}

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. Initial program 33.8

    \[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 hypot-def19.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(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  4. Using strategy rm
  5. Applied *-un-lft-identity19.6

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

    \[\leadsto e^{\log \color{blue}{\left(\sqrt{1} \cdot \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  7. Simplified19.6

    \[\leadsto e^{\log \left(\color{blue}{1} \cdot \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  8. Simplified3.5

    \[\leadsto e^{\log \left(1 \cdot \color{blue}{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  9. Using strategy rm
  10. Applied *-un-lft-identity3.5

    \[\leadsto e^{\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\color{blue}{1 \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  11. Final simplification3.5

    \[\leadsto e^{\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(1 \cdot \left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

Reproduce

herbie shell --seed 2020046 +o rules:numerics
(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)))))