\[\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: 14.6 s
Input Error: 12.9
Output Error: 2.0
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{c} - \frac{d}{c} \cdot \frac{a}{c} & \text{when } c \le -4.9221833f+10 \\ \frac{b \cdot c}{{c}^2 + d \cdot d} - \frac{a}{d + \frac{{c}^2}{d}} & \text{when } c \le 4.1923042f+15 \\ \frac{b}{c} - \frac{d}{c} \cdot \frac{a}{c} & \text{otherwise} \end{cases}\)

    if c < -4.9221833f+10 or 4.1923042f+15 < c

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

    if -4.9221833f+10 < c < 4.1923042f+15

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      8.7
    2. Using strategy rm
      8.7
    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}}\]
      8.8
    4. Using strategy rm
      8.8
    5. Applied associate-/l* to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \color{red}{\frac{a \cdot d}{{c}^2 + {d}^2}} \leadsto \frac{b \cdot c}{{c}^2 + {d}^2} - \color{blue}{\frac{a}{\frac{{c}^2 + {d}^2}{d}}}\]
      7.7
    6. Applied taylor to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{d + \frac{{c}^2}{d}}\]
      2.8
    7. Taylor expanded around 0 to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{\color{red}{d + \frac{{c}^2}{d}}} \leadsto \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{\color{blue}{d + \frac{{c}^2}{d}}}\]
      2.8
    8. Applied simplify to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{d + \frac{{c}^2}{d}} \leadsto \frac{c \cdot b}{d \cdot d + c \cdot c} - \frac{a}{d + \frac{c}{d} \cdot c}\]
      2.8

    9. Applied final simplification
    10. Applied simplify to get
      \[\color{red}{\frac{c \cdot b}{d \cdot d + c \cdot c} - \frac{a}{d + \frac{c}{d} \cdot c}} \leadsto \color{blue}{\frac{b \cdot c}{{c}^2 + d \cdot d} - \frac{a}{d + \frac{{c}^2}{d}}}\]
      2.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))))))