\[\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: 10.0 s
Input Error: 26.2
Output Error: 14.5
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{c} - \frac{a \cdot d}{c \cdot c} & \text{when } c \le -1.3842965018545015 \cdot 10^{+45} \\ \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{1} \cdot \frac{d}{{c}^2 + {d}^2} & \text{when } c \le 2.962024194070207 \cdot 10^{+128} \\ \frac{b}{c} - \frac{a \cdot d}{c \cdot c} & \text{otherwise} \end{cases}\)

    if c < -1.3842965018545015e+45 or 2.962024194070207e+128 < c

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      39.5
    2. Using strategy rm
      39.5
    3. Applied add-cbrt-cube 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}{\sqrt[3]{{\left({c}^2 + {d}^2\right)}^3}}}\]
      47.8
    4. Applied taylor to get
      \[\frac{b \cdot c - a \cdot d}{\sqrt[3]{{\left({c}^2 + {d}^2\right)}^3}} \leadsto \frac{b}{c} - \frac{d \cdot a}{{c}^2}\]
      11.8
    5. 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}}\]
      11.8
    6. Applied simplify to get
      \[\frac{b}{c} - \frac{d \cdot a}{{c}^2} \leadsto \frac{b}{c} - \frac{a \cdot d}{c \cdot c}\]
      11.8

    7. Applied final simplification

    if -1.3842965018545015e+45 < c < 2.962024194070207e+128

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      18.4
    2. Using strategy rm
      18.4
    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}}\]
      18.4
    4. Using strategy rm
      18.4
    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)}}\]
      18.4
    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}}\]
      16.1

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