Average Error: 26.3 → 26.2
Time: 20.0s
Precision: 64
Internal Precision: 128
\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
\[\frac{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)}{\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 26.3

    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
  2. Initial simplification26.3

    \[\leadsto \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt26.3

    \[\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}}}\]
  5. Applied associate-/r*26.2

    \[\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}}}\]
  6. Using strategy rm
  7. Applied div-inv26.2

    \[\leadsto \frac{\color{blue}{\left(x.im \cdot y.re - x.re \cdot y.im\right) \cdot \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]
  8. Final simplification26.2

    \[\leadsto \frac{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}\]

Runtime

Time bar (total: 20.0s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes26.226.223.62.60%
herbie shell --seed 2018351 
(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))))