\[\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: 18.8 s
Input Error: 12.6
Output Error: 6.3
Log:
Profile: 🕒
\(\begin{cases} \frac{b \cdot c}{{d}^2} - \frac{a}{d} & \text{when } d \le -1.0358282f+21 \\ \frac{b \cdot c}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2} & \text{when } d \le 3.216231f+25 \\ \frac{b \cdot c}{{d}^2} - \frac{a}{d} & \text{otherwise} \end{cases}\)

    if d < -1.0358282f+21 or 3.216231f+25 < d

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      22.0
    2. Using strategy rm
      22.0
    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}\]
      22.0
    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}\]
      22.0
    5. Applied taylor to get
      \[\frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + {d}^2} \leadsto \frac{b \cdot c}{{d}^2} - \frac{a}{d}\]
      6.0
    6. Taylor expanded around inf to get
      \[\color{red}{\frac{b \cdot c}{{d}^2} - \frac{a}{d}} \leadsto \color{blue}{\frac{b \cdot c}{{d}^2} - \frac{a}{d}}\]
      6.0

    if -1.0358282f+21 < d < 3.216231f+25

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      10.2
    2. Using strategy rm
      10.2
    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}\]
      10.1
    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}\]
      7.4
    5. Using strategy rm
      7.4
    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}}\]
      7.4
    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}\]
      6.3
    8. Applied taylor to get
      \[\frac{b \cdot c - a \cdot d}{{\left(\left|c\right|\right)}^2 + {\left(\left|d\right|\right)}^2} \leadsto \frac{b \cdot c}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2}\]
      6.3
    9. Taylor expanded around 0 to get
      \[\color{red}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2}} \leadsto \color{blue}{\frac{b \cdot c}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2} - \frac{d \cdot a}{{\left(\left|d\right|\right)}^2 + {\left(\left|c\right|\right)}^2}}\]
      6.3

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