\left(\left(\left(x.re \cdot x.re\right) - \left(x.im \cdot x.im\right)\right) \cdot x.re\right) - \left(\left(\frac{\left(x.re \cdot x.im\right)}{\left(x.im \cdot x.re\right)}\right) \cdot x.im\right)\left(\mathsf{qms}\left(\left(\left(\left(\left(\left(x.re \cdot \left(x.im + x.re\right)\right) \cdot \left(x.re - x.im\right)\right)\right)\right)\right), \left(\left(x.re + x.re\right) \cdot x.im\right), x.im\right)\right)double f(double x_re, double x_im) {
double r1984610 = x_re;
double r1984611 = r1984610 * r1984610;
double r1984612 = x_im;
double r1984613 = r1984612 * r1984612;
double r1984614 = r1984611 - r1984613;
double r1984615 = r1984614 * r1984610;
double r1984616 = r1984610 * r1984612;
double r1984617 = r1984612 * r1984610;
double r1984618 = r1984616 + r1984617;
double r1984619 = r1984618 * r1984612;
double r1984620 = r1984615 - r1984619;
return r1984620;
}
double f(double x_re, double x_im) {
double r1984621 = x_re;
double r1984622 = x_im;
double r1984623 = r1984622 + r1984621;
double r1984624 = r1984621 * r1984623;
double r1984625 = r1984621 - r1984622;
double r1984626 = r1984624 * r1984625;
double r1984627 = /*Error: no posit support in C */;
double r1984628 = /*Error: no posit support in C */;
double r1984629 = /*Error: no posit support in C */;
double r1984630 = r1984621 + r1984621;
double r1984631 = r1984630 * r1984622;
double r1984632 = /*Error: no posit support in C */;
double r1984633 = /*Error: no posit support in C */;
return r1984633;
}



Bits error versus x.re



Bits error versus x.im
Initial program 0.4
rmApplied introduce-quire0.4
Applied insert-quire-fdp-sub0.3
Simplified0.3
rmApplied associate-*l*0.3
rmApplied distribute-lft-in0.3
Applied distribute-rgt-in0.4
rmApplied introduce-quire0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2019162 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
(-.p16 (*.p16 (-.p16 (*.p16 x.re x.re) (*.p16 x.im x.im)) x.re) (*.p16 (+.p16 (*.p16 x.re x.im) (*.p16 x.im x.re)) x.im)))