\[\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: 14.3 s
Input Error: 7.0
Output Error: 7.0
Log:
Profile: 🕒
\(\left(x.im \cdot {x.re}^2 - {x.im}^{3}\right) + \left(x.im + x.im\right) \cdot {x.re}^2\)
  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.0
  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.0
  3. Using strategy rm
    7.0
  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.1
  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(x.im \cdot {x.re}^2 - {x.im}^{3}\right) + \left(x.im + x.im\right) \cdot {x.re}^2\]
    7.0
  6. Taylor expanded around 0 to get
    \[\color{red}{\left(x.im \cdot {x.re}^2 - {x.im}^{3}\right)} + \left(x.im + x.im\right) \cdot {x.re}^2 \leadsto \color{blue}{\left(x.im \cdot {x.re}^2 - {x.im}^{3}\right)} + \left(x.im + x.im\right) \cdot {x.re}^2\]
    7.0

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