\[\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: 33.3 s
Input Error: 3.4
Output Error: 3.4
Log:
Profile: 🕒
\(x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + {\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}^{1}\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.4
  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.5
  3. Using strategy rm
    3.5
  4. Applied pow1 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 - x.im\right)}^{1}}\right)\]
    3.3
  5. Applied pow1 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 - x.im\right)}^{1}\right) \leadsto x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \color{blue}{{\left(x.re + x.im\right)}^{1}} \cdot {\left(x.re - x.im\right)}^{1}\right)\]
    3.3
  6. Applied pow-prod-down to get
    \[x.im \cdot \left(\left(x.re + x.re\right) \cdot x.re + \color{red}{{\left(x.re + x.im\right)}^{1} \cdot {\left(x.re - x.im\right)}^{1}}\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 \left(x.re - x.im\right)\right)}^{1}}\right)\]
    3.4

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