\[\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: 21.4 s
Input Error: 3.2
Output Error: 0.2
Log:
Profile: 🕒
\(x.im \cdot \left({\left(\left(x.im + x.re\right) + \left(x.re + x.re\right)\right)}^{1} \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\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\]
    3.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}{x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}\]
    3.3
  3. Using strategy rm
    3.3
  4. Applied sub-neg to get
    \[x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot \color{red}{\left(x.re - x.im\right)}\right) \leadsto x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot \color{blue}{\left(x.re + \left(-x.im\right)\right)}\right)\]
    3.3
  5. Applied distribute-lft-in to get
    \[x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \color{red}{\left(x.re + x.im\right) \cdot \left(x.re + \left(-x.im\right)\right)}\right) \leadsto x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \color{blue}{\left(\left(x.re + x.im\right) \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)}\right)\]
    3.3
  6. Applied associate-+r+ to get
    \[x.im \cdot \color{red}{\left(\left(x.re + x.re\right) \cdot x.re + \left(\left(x.re + x.im\right) \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)\right)} \leadsto x.im \cdot \color{blue}{\left(\left(\left(x.re + x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot x.re\right) + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)}\]
    3.3
  7. Applied simplify to get
    \[x.im \cdot \left(\color{red}{\left(\left(x.re + x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot x.re\right)} + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right) \leadsto x.im \cdot \left(\color{blue}{\left(\left(x.im + x.re\right) + \left(x.re + x.re\right)\right) \cdot x.re} + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)\]
    3.3
  8. Using strategy rm
    3.3
  9. Applied pow1 to get
    \[x.im \cdot \left(\color{red}{\left(\left(x.im + x.re\right) + \left(x.re + x.re\right)\right)} \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right) \leadsto x.im \cdot \left(\color{blue}{{\left(\left(x.im + x.re\right) + \left(x.re + x.re\right)\right)}^{1}} \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)\]
    0.2

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