\[\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: 11.0 s
Input Error: 13.0
Output Error: 4.2
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{\left|d\right|} \cdot \frac{c}{\left|d\right|} - \frac{a}{\left|d\right|} \cdot \frac{d}{\left|d\right|} & \text{when } d \le -1.3048426f+21 \\ \frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + {\left(\left|d\right|\right)}^2} & \text{when } d \le 2.715476f+14 \\ \frac{b}{\left|d\right|} \cdot \frac{c}{\left|d\right|} - \frac{a}{\left|d\right|} \cdot \frac{d}{\left|d\right|} & \text{otherwise} \end{cases}\)

    if d < -1.3048426f+21

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      22.5
    2. Using strategy rm
      22.5
    3. Applied add-sqr-sqrt to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + \color{red}{{d}^2}} \leadsto \frac{b \cdot c - a \cdot d}{{c}^2 + \color{blue}{{\left(\sqrt{{d}^2}\right)}^2}}\]
      22.5
    4. Applied simplify to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {\color{red}{\left(\sqrt{{d}^2}\right)}}^2} \leadsto \frac{b \cdot c - a \cdot d}{{c}^2 + {\color{blue}{\left(\left|d\right|\right)}}^2}\]
      16.0
    5. Applied taylor to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {\left(\left|d\right|\right)}^2} \leadsto \frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}\]
      14.1
    6. Taylor expanded around 0 to get
      \[\color{red}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}} \leadsto \color{blue}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}}\]
      14.1
    7. Applied simplify to get
      \[\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2} \leadsto \frac{b}{\left|d\right|} \cdot \frac{c}{\left|d\right|} - \frac{a}{\left|d\right|} \cdot \frac{d}{\left|d\right|}\]
      0

    8. Applied final simplification

    if -1.3048426f+21 < d < 2.715476f+14

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      9.4
    2. Using strategy rm
      9.4
    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}\right)}^2} + {d}^2}\]
      9.4
    4. Applied simplify to get
      \[\frac{b \cdot c - a \cdot d}{{\color{red}{\left(\sqrt{{c}^2}\right)}}^2 + {d}^2} \leadsto \frac{b \cdot c - a \cdot d}{{\color{blue}{\left(\left|c\right|\right)}}^2 + {d}^2}\]
      6.5
    5. Using strategy rm
      6.5
    6. Applied add-sqr-sqrt to get
      \[\frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + \color{red}{{d}^2}} \leadsto \frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + \color{blue}{{\left(\sqrt{{d}^2}\right)}^2}}\]
      6.5
    7. Applied simplify to get
      \[\frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + {\color{red}{\left(\sqrt{{d}^2}\right)}}^2} \leadsto \frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + {\color{blue}{\left(\left|d\right|\right)}}^2}\]
      5.9

    if 2.715476f+14 < d

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      21.0
    2. Using strategy rm
      21.0
    3. Applied add-sqr-sqrt to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + \color{red}{{d}^2}} \leadsto \frac{b \cdot c - a \cdot d}{{c}^2 + \color{blue}{{\left(\sqrt{{d}^2}\right)}^2}}\]
      21.0
    4. Applied simplify to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {\color{red}{\left(\sqrt{{d}^2}\right)}}^2} \leadsto \frac{b \cdot c - a \cdot d}{{c}^2 + {\color{blue}{\left(\left|d\right|\right)}}^2}\]
      15.7
    5. Applied taylor to get
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {\left(\left|d\right|\right)}^2} \leadsto \frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}\]
      13.2
    6. Taylor expanded around 0 to get
      \[\color{red}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}} \leadsto \color{blue}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2}}\]
      13.2
    7. Applied simplify to get
      \[\frac{b \cdot c}{{\left(\left|d\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2} \leadsto \frac{b}{\left|d\right|} \cdot \frac{c}{\left|d\right|} - \frac{a}{\left|d\right|} \cdot \frac{d}{\left|d\right|}\]
      0

    8. Applied final simplification

  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))))))