\[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
Test:
Complex division, imag part
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Bits error versus d
Time: 12.7 s
Input Error: 26.2
Output Error: 24.4
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a \cdot d}{{c}^2 + {d}^2} & \text{when } a \le 3.4702874472757573 \cdot 10^{-07} \\ {\left(\frac{\sqrt{c \cdot b - d \cdot a}}{\sqrt{c^2 + d^2}^*}\right)}^2 & \text{when } a \le 4.878738521506449 \cdot 10^{+49} \\ \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{1} \cdot \frac{d}{{c}^2 + {d}^2} & \text{otherwise} \end{cases}\)

    if a < 3.4702874472757573e-07

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      24.2
    2. Using strategy rm
      24.2
    3. Applied div-sub to get
      \[\color{red}{\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a \cdot d}{{c}^2 + {d}^2}}\]
      24.2
    4. Using strategy rm
      24.2
    5. Applied associate-/l* to get
      \[\color{red}{\frac{b \cdot c}{{c}^2 + {d}^2}} - \frac{a \cdot d}{{c}^2 + {d}^2} \leadsto \color{blue}{\frac{b}{\frac{{c}^2 + {d}^2}{c}}} - \frac{a \cdot d}{{c}^2 + {d}^2}\]
      23.0

    if 3.4702874472757573e-07 < a < 4.878738521506449e+49

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      28.8
    2. Using strategy rm
      28.8
    3. Applied add-sqr-sqrt to get
      \[\frac{b \cdot c - a \cdot d}{\color{red}{{c}^2 + {d}^2}} \leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{\left(\sqrt{{c}^2 + {d}^2}\right)}^2}}\]
      28.8
    4. Applied add-sqr-sqrt to get
      \[\frac{\color{red}{b \cdot c - a \cdot d}}{{\left(\sqrt{{c}^2 + {d}^2}\right)}^2} \leadsto \frac{\color{blue}{{\left(\sqrt{b \cdot c - a \cdot d}\right)}^2}}{{\left(\sqrt{{c}^2 + {d}^2}\right)}^2}\]
      28.9
    5. Applied square-undiv to get
      \[\color{red}{\frac{{\left(\sqrt{b \cdot c - a \cdot d}\right)}^2}{{\left(\sqrt{{c}^2 + {d}^2}\right)}^2}} \leadsto \color{blue}{{\left(\frac{\sqrt{b \cdot c - a \cdot d}}{\sqrt{{c}^2 + {d}^2}}\right)}^2}\]
      28.9
    6. Applied simplify to get
      \[{\color{red}{\left(\frac{\sqrt{b \cdot c - a \cdot d}}{\sqrt{{c}^2 + {d}^2}}\right)}}^2 \leadsto {\color{blue}{\left(\frac{\sqrt{c \cdot b - d \cdot a}}{\sqrt{c^2 + d^2}^*}\right)}}^2\]
      10.8

    if 4.878738521506449e+49 < a

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      33.1
    2. Using strategy rm
      33.1
    3. Applied div-sub to get
      \[\color{red}{\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a \cdot d}{{c}^2 + {d}^2}}\]
      33.2
    4. Using strategy rm
      33.2
    5. Applied *-un-lft-identity to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a \cdot d}{\color{red}{{c}^2 + {d}^2}} \leadsto \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a \cdot d}{\color{blue}{1 \cdot \left({c}^2 + {d}^2\right)}}\]
      33.2
    6. Applied times-frac to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \color{red}{\frac{a \cdot d}{1 \cdot \left({c}^2 + {d}^2\right)}} \leadsto \frac{b \cdot c}{{c}^2 + {d}^2} - \color{blue}{\frac{a}{1} \cdot \frac{d}{{c}^2 + {d}^2}}\]
      30.8

  1. Removed slow pow expressions

Original test:


(lambda ((a default) (b default) (c default) (d default))
  #:name "Complex division, imag part"
  (/ (- (* b c) (* a d)) (+ (sqr c) (sqr d)))
  #:target
  (if (< (fabs d) (fabs c)) (/ (- b (* a (/ d c))) (+ c (* d (/ d c)))) (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d))))))