\[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
Test:
math.cube on complex, imaginary part
Bits:
128 bits
Bits error versus x.re
Bits error versus x.im
Time: 7.0 s
Input Error: 7.2
Output Error: 7.2
Log:
Profile: 🕒
\((\left(x.re - x.im\right) * \left(\left(x.re + x.im\right) \cdot x.im\right) + \left(\left(2 \cdot x.im\right) \cdot {x.re}^2\right))_*\)
  1. Started with
    \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
    7.2
  2. Applied simplify to get
    \[\color{red}{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re} \leadsto \color{blue}{(\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) * x.im + \left(\left(x.im + x.im\right) \cdot {x.re}^2\right))_*}\]
    7.2
  3. Using strategy rm
    7.2
  4. Applied fma-udef to get
    \[\color{red}{(\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) * x.im + \left(\left(x.im + x.im\right) \cdot {x.re}^2\right))_*} \leadsto \color{blue}{\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + \left(x.im + x.im\right) \cdot {x.re}^2}\]
    7.2
  5. Applied taylor to get
    \[\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + \left(x.im + x.im\right) \cdot {x.re}^2 \leadsto \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + 2 \cdot \left(x.im \cdot {x.re}^2\right)\]
    7.2
  6. Taylor expanded around inf to get
    \[\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + \color{red}{2 \cdot \left(x.im \cdot {x.re}^2\right)} \leadsto \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + \color{blue}{2 \cdot \left(x.im \cdot {x.re}^2\right)}\]
    7.2
  7. Applied simplify to get
    \[\left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) \cdot x.im + 2 \cdot \left(x.im \cdot {x.re}^2\right) \leadsto (\left(x.re - x.im\right) * \left(\left(x.re + x.im\right) \cdot x.im\right) + \left(\left(2 \cdot x.im\right) \cdot {x.re}^2\right))_*\]
    7.2

  8. Applied final simplification

  9. Removed slow pow expressions

Original test:


(lambda ((x.re default) (x.im default))
  #:name "math.cube on complex, imaginary part"
  (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))