\[\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: 11.4 s
Input Error: 27.7
Output Error: 7.7
Log:
Profile: 🕒
\(\begin{cases} \frac{b}{c} & \text{when } c \le -6.683374268310304 \cdot 10^{+118} \\ \frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2} & \text{when } c \le -1.0134394410721208 \cdot 10^{-159} \\ -\frac{a}{d} & \text{when } c \le 7.847989728268068 \cdot 10^{-133} \\ \frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2} & \text{when } c \le 1.2667703140962172 \cdot 10^{+134} \\ \frac{b}{c} & \text{otherwise} \end{cases}\)

    if c < -6.683374268310304e+118 or 1.2667703140962172e+134 < c

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

    9. Applied final simplification

    if -6.683374268310304e+118 < c < -1.0134394410721208e-159 or 7.847989728268068e-133 < c < 1.2667703140962172e+134

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      16.9

    if -1.0134394410721208e-159 < c < 7.847989728268068e-133

    1. Started with
      \[\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}\]
      32.3
    2. Using strategy rm
      32.3
    3. Applied clear-num to get
      \[\color{red}{\frac{b \cdot c - a \cdot d}{{c}^2 + {d}^2}} \leadsto \color{blue}{\frac{1}{\frac{{c}^2 + {d}^2}{b \cdot c - a \cdot d}}}\]
      32.3
    4. Using strategy rm
      32.3
    5. Applied add-exp-log to get
      \[\frac{1}{\frac{{c}^2 + {d}^2}{\color{red}{b \cdot c - a \cdot d}}} \leadsto \frac{1}{\frac{{c}^2 + {d}^2}{\color{blue}{e^{\log \left(b \cdot c - a \cdot d\right)}}}}\]
      48.9
    6. Applied add-exp-log to get
      \[\frac{1}{\frac{\color{red}{{c}^2 + {d}^2}}{e^{\log \left(b \cdot c - a \cdot d\right)}}} \leadsto \frac{1}{\frac{\color{blue}{e^{\log \left({c}^2 + {d}^2\right)}}}{e^{\log \left(b \cdot c - a \cdot d\right)}}}\]
      49.0
    7. Applied div-exp to get
      \[\frac{1}{\color{red}{\frac{e^{\log \left({c}^2 + {d}^2\right)}}{e^{\log \left(b \cdot c - a \cdot d\right)}}}} \leadsto \frac{1}{\color{blue}{e^{\log \left({c}^2 + {d}^2\right) - \log \left(b \cdot c - a \cdot d\right)}}}\]
      49.1
    8. Applied taylor to get
      \[\frac{1}{e^{\log \left({c}^2 + {d}^2\right) - \log \left(b \cdot c - a \cdot d\right)}} \leadsto \frac{1}{e^{\log d - \left(\log a + \log -1\right)}}\]
      62.7
    9. Taylor expanded around 0 to get
      \[\frac{1}{\color{red}{e^{\log d - \left(\log a + \log -1\right)}}} \leadsto \frac{1}{\color{blue}{e^{\log d - \left(\log a + \log -1\right)}}}\]
      62.7
    10. Applied simplify to get
      \[\frac{1}{e^{\log d - \left(\log a + \log -1\right)}} \leadsto \frac{1}{d} \cdot \left(a \cdot -1\right)\]
      0.2

    11. Applied final simplification
    12. Applied simplify to get
      \[\color{red}{\frac{1}{d} \cdot \left(a \cdot -1\right)} \leadsto \color{blue}{-\frac{a}{d}}\]
      0

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