\[\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: 13.7 s
Input Error: 25.2
Output Error: 8.6
Log:
Profile: 🕒
\(\begin{cases} \frac{b \cdot c}{{c}^2 + d \cdot d} - \frac{a}{d + \frac{{c}^2}{d}} & \text{when } d \le -3.2392491068805905 \cdot 10^{+80} \\ \frac{b}{\frac{d \cdot d}{c} + c} - \frac{a \cdot d}{c \cdot c + d \cdot d} & \text{when } d \le 1.0745561433792671 \cdot 10^{+141} \\ \frac{-a}{d + \frac{c \cdot c}{d}} & \text{otherwise} \end{cases}\)

    if d < -3.2392491068805905e+80

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      36.5
    2. Using strategy rm
      36.5
    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}}\]
      36.5
    4. Using strategy rm
      36.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}}}\]
      34.0
    6. Using strategy rm
      34.0
    7. Applied associate-/l* to get
      \[\color{red}{\frac{b \cdot c}{{c}^2 + {d}^2}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \color{blue}{\frac{b}{\frac{{c}^2 + {d}^2}{c}}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      34.3
    8. Applied taylor to get
      \[\frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a}{d + \frac{{c}^2}{d}}\]
      16.0
    9. Taylor expanded around 0 to get
      \[\frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a}{\color{red}{d + \frac{{c}^2}{d}}} \leadsto \frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a}{\color{blue}{d + \frac{{c}^2}{d}}}\]
      16.0
    10. Applied simplify to get
      \[\frac{b}{\frac{{c}^2 + {d}^2}{c}} - \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}\]
      12.9

    11. Applied final simplification
    12. 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}}}\]
      15.9

    if -3.2392491068805905e+80 < d < 1.0745561433792671e+141

    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.5
    4. Using strategy rm
      18.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}}}\]
      17.7
    6. Using strategy rm
      17.7
    7. Applied associate-/l* to get
      \[\color{red}{\frac{b \cdot c}{{c}^2 + {d}^2}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \color{blue}{\frac{b}{\frac{{c}^2 + {d}^2}{c}}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      15.5
    8. Applied taylor to get
      \[\frac{b}{\frac{{c}^2 + {d}^2}{c}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b}{c + \frac{{d}^2}{c}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      5.5
    9. Taylor expanded around 0 to get
      \[\frac{b}{\color{red}{c + \frac{{d}^2}{c}}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b}{\color{blue}{c + \frac{{d}^2}{c}}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}}\]
      5.5
    10. Applied simplify to get
      \[\frac{b}{c + \frac{{d}^2}{c}} - \frac{a}{\frac{{c}^2 + {d}^2}{d}} \leadsto \frac{b}{\frac{d \cdot d}{c} + c} - \frac{a \cdot d}{c \cdot c + d \cdot d}\]
      6.4

    11. Applied final simplification

    if 1.0745561433792671e+141 < d

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      40.8
    2. Using strategy rm
      40.8
    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}}\]
      40.8
    4. Using strategy rm
      40.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}}}\]
      39.8
    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}}\]
      13.5
    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}}}\]
      13.5
    8. Applied taylor to get
      \[\frac{b \cdot c}{{c}^2 + {d}^2} - \frac{a}{d + \frac{{c}^2}{d}} \leadsto 0 - \frac{a}{d + \frac{{c}^2}{d}}\]
      8.4
    9. Taylor expanded around 0 to get
      \[\color{red}{0} - \frac{a}{d + \frac{{c}^2}{d}} \leadsto \color{blue}{0} - \frac{a}{d + \frac{{c}^2}{d}}\]
      8.4
    10. Applied simplify to get
      \[0 - \frac{a}{d + \frac{{c}^2}{d}} \leadsto \frac{-a}{d + \frac{c \cdot c}{d}}\]
      8.4

    11. Applied final simplification

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