Average Error: 25.5 → 21.9
Time: 15.8s
Precision: 64
Internal Precision: 576
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
\[\frac{\frac{x.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} - x.re \cdot \frac{y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 25.5

    \[\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 add-sqr-sqrt25.5

    \[\leadsto \frac{x.im \cdot y.re - 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}}}\]
  4. Applied associate-/r*25.4

    \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\]
  5. Using strategy rm
  6. Applied div-sub25.5

    \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} - \frac{x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
  7. Using strategy rm
  8. Applied associate-/l*23.6

    \[\leadsto \frac{\color{blue}{\frac{x.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}{y.re}}} - \frac{x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
  9. Using strategy rm
  10. Applied *-un-lft-identity23.6

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

    \[\leadsto \frac{\frac{x.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} - \frac{x.re \cdot y.im}{\color{blue}{\sqrt{1} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
  12. Applied times-frac21.9

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

    \[\leadsto \frac{\frac{x.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} - \color{blue}{x.re} \cdot \frac{y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
  14. Final simplification21.9

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

Runtime

Time bar (total: 15.8s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes21.921.921.50.40%
herbie shell --seed 2018274 
(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))))