\[\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: 11.8 s
Input Error: 7.0
Output Error: 0.2
Log:
Profile: 🕒
\(3 \cdot \left(\left(x.im \cdot x.re\right) \cdot x.re\right) - {x.im}^{3}\)
  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}{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)}\]
    7.0
  3. Applied taylor to get
    \[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) \leadsto 3 \cdot \left(x.im \cdot {x.re}^2\right) - {x.im}^{3}\]
    6.9
  4. Taylor expanded around inf to get
    \[\color{red}{3 \cdot \left(x.im \cdot {x.re}^2\right) - {x.im}^{3}} \leadsto \color{blue}{3 \cdot \left(x.im \cdot {x.re}^2\right) - {x.im}^{3}}\]
    6.9
  5. Using strategy rm
    6.9
  6. Applied square-mult to get
    \[3 \cdot \left(x.im \cdot \color{red}{{x.re}^2}\right) - {x.im}^{3} \leadsto 3 \cdot \left(x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right) - {x.im}^{3}\]
    6.9
  7. Applied associate-*r* to get
    \[3 \cdot \color{red}{\left(x.im \cdot \left(x.re \cdot x.re\right)\right)} - {x.im}^{3} \leadsto 3 \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot x.re\right)} - {x.im}^{3}\]
    0.2

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