\[\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.8 s
Input Error: 25.7
Output Error: 16.1
Log:
Profile: 🕒
\(\begin{cases} \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{d + \frac{{c}^2}{d}} & \text{when } d \le -1.0004943730608963 \cdot 10^{+62} \\ \frac{b}{1} \cdot \frac{c}{{c}^2 + {d}^2} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} & \text{when } d \le 3.7669070919763915 \cdot 10^{-141} \\ \frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{d + \frac{{c}^2}{d}} & \text{otherwise} \end{cases}\)

    if d < -1.0004943730608963e+62 or 3.7669070919763915e-141 < d

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

    if -1.0004943730608963e+62 < d < 3.7669070919763915e-141

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      19.4
    2. Using strategy rm
      19.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}}\]
      19.5
    4. Using strategy rm
      19.5
    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}}}\]
      20.2
    6. Using strategy rm
      20.2
    7. Applied *-un-lft-identity to get
      \[\frac{b \cdot c}{\color{red}{{c}^2 + {d}^2}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b \cdot c}{\color{blue}{1 \cdot \left({c}^2 + {d}^2\right)}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      20.2
    8. Applied times-frac to get
      \[\color{red}{\frac{b \cdot c}{1 \cdot \left({c}^2 + {d}^2\right)}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \color{blue}{\frac{b}{1} \cdot \frac{c}{{c}^2 + {d}^2}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      17.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))))))