\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
Test:
_divideComplex, imaginary part
Bits:
128 bits
Bits error versus x.re
Bits error versus x.im
Bits error versus y.re
Bits error versus y.im
Time: 11.2 s
Input Error: 15.5
Output Error: 0.6
Log:
Profile: 🕒
\(\begin{cases} \frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im} & \text{when } y.im \le -7284053.5f0 \\ \frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re} & \text{when } y.im \le 0.00013428419f0 \\ \frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im} & \text{otherwise} \end{cases}\)

    if y.im < -7284053.5f0 or 0.00013428419f0 < y.im

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      17.8
    2. Using strategy rm
      17.8
    3. Applied add-sqr-sqrt to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{\color{red}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^2}}\]
      17.8
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}}^2}\]
      17.8
    5. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{y.im}^2}\]
      14.5
    6. Taylor expanded around 0 to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{y.im}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{y.im}}^2}\]
      14.5
    7. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{y.im}^2} \leadsto \frac{y.re \cdot x.im}{{y.im}^2} - \frac{x.re}{y.im}\]
      4.7
    8. Taylor expanded around 0 to get
      \[\color{red}{\frac{y.re \cdot x.im}{{y.im}^2} - \frac{x.re}{y.im}} \leadsto \color{blue}{\frac{y.re \cdot x.im}{{y.im}^2} - \frac{x.re}{y.im}}\]
      4.7
    9. Applied simplify to get
      \[\frac{y.re \cdot x.im}{{y.im}^2} - \frac{x.re}{y.im} \leadsto \frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\]
      0.4

    10. Applied final simplification

    if -7284053.5f0 < y.im < 0.00013428419f0

    1. Started with
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
      12.7
    2. Using strategy rm
      12.7
    3. Applied add-sqr-sqrt to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{\color{red}{y.re \cdot y.re + y.im \cdot y.im}} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^2}}\]
      12.7
    4. Applied simplify to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}}^2}\]
      12.7
    5. Applied taylor to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(\sqrt{{y.re}^2 + y.im \cdot y.im}\right)}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}\]
      10.6
    6. Taylor expanded around -inf to get
      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{red}{\left(-1 \cdot y.re\right)}}^2} \leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{{\color{blue}{\left(-1 \cdot y.re\right)}}^2}\]
      10.6
    7. Applied simplify to get
      \[\color{red}{\frac{x.im \cdot y.re - x.re \cdot y.im}{{\left(-1 \cdot y.re\right)}^2}} \leadsto \color{blue}{\frac{x.im}{y.re} - \frac{y.im}{y.re} \cdot \frac{x.re}{y.re}}\]
      0.8

  1. Removed slow pow expressions

Original test:


(lambda ((x.re default) (x.im default) (y.re default) (y.im default))
  #:name "_divideComplex, imaginary part"
  (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))