\[\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.6 s
Input Error: 26.2
Output Error: 16.4
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{c} - \frac{a \cdot d}{c \cdot c} & \text{when } c \le -9.997857431534436 \cdot 10^{+74} \\ \left(b \cdot c - a \cdot d\right) \cdot \frac{1}{{c}^2 + {d}^2} & \text{when } c \le 1.4423407179873904 \cdot 10^{+147} \\ \frac{b}{c} - \frac{a \cdot d}{c \cdot c} & \text{otherwise} \end{cases}\)

    if c < -9.997857431534436e+74 or 1.4423407179873904e+147 < c

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      41.7
    2. Using strategy rm
      41.7
    3. Applied div-inv to get
      \[\color{red}{\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\left(b \cdot c - a \cdot d\right) \cdot \frac{1}{{c}^2 + {d}^2}}\]
      41.7
    4. Using strategy rm
      41.7
    5. Applied add-cube-cbrt to get
      \[\left(b \cdot c - a \cdot d\right) \cdot \color{red}{\frac{1}{{c}^2 + {d}^2}} \leadsto \left(b \cdot c - a \cdot d\right) \cdot \color{blue}{{\left(\sqrt[3]{\frac{1}{{c}^2 + {d}^2}}\right)}^3}\]
      41.8
    6. Applied taylor to get
      \[\left(b \cdot c - a \cdot d\right) \cdot {\left(\sqrt[3]{\frac{1}{{c}^2 + {d}^2}}\right)}^3 \leadsto \frac{b}{c} - \frac{d \cdot a}{{c}^2}\]
      12.1
    7. Taylor expanded around inf to get
      \[\color{red}{\frac{b}{c} - \frac{d \cdot a}{{c}^2}} \leadsto \color{blue}{\frac{b}{c} - \frac{d \cdot a}{{c}^2}}\]
      12.1
    8. Applied simplify to get
      \[\frac{b}{c} - \frac{d \cdot a}{{c}^2} \leadsto \frac{b}{c} - \frac{a \cdot d}{c \cdot c}\]
      12.1

    9. Applied final simplification

    if -9.997857431534436e+74 < c < 1.4423407179873904e+147

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      18.3
    2. Using strategy rm
      18.3
    3. Applied div-inv to get
      \[\color{red}{\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\left(b \cdot c - a \cdot d\right) \cdot \frac{1}{{c}^2 + {d}^2}}\]
      18.6

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