\[\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: 13.6 s
Input Error: 3.2
Output Error: 0.3
Log:
Profile: 🕒
\(x.im \cdot \left(\left(x.im + x.re\right) \cdot \left(-x.im\right)\right) + \left(x.re \cdot x.im\right) \cdot \left(3 \cdot x.re + x.im\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. Applied taylor to get
    \[x.im \cdot \left(\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(\left(x.im + 3 \cdot x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)\]
    3.3
  9. Taylor expanded around 0 to get
    \[x.im \cdot \left(\color{red}{\left(x.im + 3 \cdot x.re\right)} \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right) \leadsto x.im \cdot \left(\color{blue}{\left(x.im + 3 \cdot x.re\right)} \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right)\]
    3.3
  10. Applied simplify to get
    \[x.im \cdot \left(\left(x.im + 3 \cdot x.re\right) \cdot x.re + \left(x.re + x.im\right) \cdot \left(-x.im\right)\right) \leadsto x.im \cdot \left(\left(x.im + x.re\right) \cdot \left(-x.im\right)\right) + \left(x.re \cdot x.im\right) \cdot \left(3 \cdot x.re + x.im\right)\]
    0.3

  11. Applied final simplification

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