Average Error: 24.7 → 23.3
Time: 27.8s
Precision: 64
Internal Precision: 384
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
\[\begin{array}{l} \mathbf{if}\;x.re \le -4.853005009166494 \cdot 10^{-283}:\\ \;\;\;\;\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{1} \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{if}\;x.re \le 4.9595495246039594 \cdot 10^{+63}:\\ \;\;\;\;\frac{x.im}{\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{y.re}{\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\\ \end{array}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Split input into 3 regimes
  2. if x.re < -4.853005009166494e-283

    1. Initial program 24.8

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    2. Using strategy rm
    3. Applied div-sub24.8

      \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity24.8

      \[\leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{\color{blue}{1 \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}}\]
    6. Applied times-frac23.3

      \[\leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \color{blue}{\frac{x.re}{1} \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]

    if -4.853005009166494e-283 < x.re < 4.9595495246039594e+63

    1. Initial program 19.8

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    2. Using strategy rm
    3. Applied div-sub19.9

      \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt20.2

      \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{\left(\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}\right) \cdot \sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    6. Applied times-frac19.4

      \[\leadsto \color{blue}{\frac{x.im}{\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{y.re}{\sqrt[3]{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]

    if 4.9595495246039594e+63 < x.re

    1. Initial program 32.7

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
    2. Using strategy rm
    3. Applied div-sub32.7

      \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt32.7

      \[\leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
    6. Applied times-frac29.7

      \[\leadsto \frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \color{blue}{\frac{x.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 27.8s)Debug logProfile

herbie shell --seed '#(1070131407 1246090267 3027482374 2150728003 2026520792 2347815650)' 
(FPCore (x.re x.im y.re y.im)
  :name "_divideComplex, imaginary part"
  (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))