?

Average Accuracy: 88.4% → 99.6%
Time: 8.1s
Precision: binary64
Cost: 1352

?

\[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]
\[\begin{array}{l} \mathbf{if}\;x.im \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\ \mathbf{elif}\;x.im \leq 4 \cdot 10^{+86}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (-
  (* (- (* x.re x.re) (* x.im x.im)) x.re)
  (* (+ (* x.re x.im) (* x.im x.re)) x.im)))
(FPCore (x.re x.im)
 :precision binary64
 (if (<= x.im -5e+154)
   (* (* x.im -3.0) (* x.re x.im))
   (if (<= x.im 4e+86)
     (-
      (* x.re (- (* x.re x.re) (* x.im x.im)))
      (* x.im (* x.re (+ x.im x.im))))
     (* x.im (* x.im (* x.re -3.0))))))
double code(double x_46_re, double x_46_im) {
	return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
double code(double x_46_re, double x_46_im) {
	double tmp;
	if (x_46_im <= -5e+154) {
		tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
	} else if (x_46_im <= 4e+86) {
		tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	}
	return tmp;
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = (((x_46re * x_46re) - (x_46im * x_46im)) * x_46re) - (((x_46re * x_46im) + (x_46im * x_46re)) * x_46im)
end function
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8) :: tmp
    if (x_46im <= (-5d+154)) then
        tmp = (x_46im * (-3.0d0)) * (x_46re * x_46im)
    else if (x_46im <= 4d+86) then
        tmp = (x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) - (x_46im * (x_46re * (x_46im + x_46im)))
    else
        tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
	return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
}
public static double code(double x_46_re, double x_46_im) {
	double tmp;
	if (x_46_im <= -5e+154) {
		tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
	} else if (x_46_im <= 4e+86) {
		tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	}
	return tmp;
}
def code(x_46_re, x_46_im):
	return (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im)
def code(x_46_re, x_46_im):
	tmp = 0
	if x_46_im <= -5e+154:
		tmp = (x_46_im * -3.0) * (x_46_re * x_46_im)
	elif x_46_im <= 4e+86:
		tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)))
	else:
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0))
	return tmp
function code(x_46_re, x_46_im)
	return Float64(Float64(Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im)) * x_46_re) - Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_im))
end
function code(x_46_re, x_46_im)
	tmp = 0.0
	if (x_46_im <= -5e+154)
		tmp = Float64(Float64(x_46_im * -3.0) * Float64(x_46_re * x_46_im));
	elseif (x_46_im <= 4e+86)
		tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) - Float64(x_46_im * Float64(x_46_re * Float64(x_46_im + x_46_im))));
	else
		tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0)));
	end
	return tmp
end
function tmp = code(x_46_re, x_46_im)
	tmp = (((x_46_re * x_46_re) - (x_46_im * x_46_im)) * x_46_re) - (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_im);
end
function tmp_2 = code(x_46_re, x_46_im)
	tmp = 0.0;
	if (x_46_im <= -5e+154)
		tmp = (x_46_im * -3.0) * (x_46_re * x_46_im);
	elseif (x_46_im <= 4e+86)
		tmp = (x_46_re * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	else
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_] := N[(N[(N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] - N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$im, -5e+154], N[(N[(x$46$im * -3.0), $MachinePrecision] * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4e+86], N[(N[(x$46$re * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$im * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\begin{array}{l}
\mathbf{if}\;x.im \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\

\mathbf{elif}\;x.im \leq 4 \cdot 10^{+86}:\\
\;\;\;\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original88.4%
Target99.6%
Herbie99.6%
\[\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re - 3 \cdot x.im\right) \]

Derivation?

  1. Split input into 3 regimes
  2. if x.im < -5.00000000000000004e154

    1. Initial program 0.0%

      \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]
    2. Simplified0.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-2 \cdot \left(x.re \cdot x.im\right)\right)\right)} \]
      Proof

      [Start]0.0

      \[ \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      *-commutative [=>]0.0

      \[ \color{blue}{x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      fma-neg [=>]0.0

      \[ \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, -\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\right)} \]

      distribute-lft-neg-in [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, \color{blue}{\left(-\left(x.re \cdot x.im + x.im \cdot x.re\right)\right) \cdot x.im}\right) \]

      *-commutative [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, \color{blue}{x.im \cdot \left(-\left(x.re \cdot x.im + x.im \cdot x.re\right)\right)}\right) \]

      *-commutative [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-\left(\color{blue}{x.im \cdot x.re} + x.im \cdot x.re\right)\right)\right) \]

      count-2 [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-\color{blue}{2 \cdot \left(x.im \cdot x.re\right)}\right)\right) \]

      distribute-lft-neg-in [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \color{blue}{\left(\left(-2\right) \cdot \left(x.im \cdot x.re\right)\right)}\right) \]

      metadata-eval [=>]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(\color{blue}{-2} \cdot \left(x.im \cdot x.re\right)\right)\right) \]

      *-commutative [<=]0.0

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-2 \cdot \color{blue}{\left(x.re \cdot x.im\right)}\right)\right) \]
    3. Taylor expanded in x.re around 0 0.0%

      \[\leadsto \color{blue}{\left(-2 \cdot {x.im}^{2} + -1 \cdot {x.im}^{2}\right) \cdot x.re} \]
    4. Simplified0.0%

      \[\leadsto \color{blue}{x.re \cdot \left(x.im \cdot \left(x.im \cdot -3\right)\right)} \]
      Proof

      [Start]0.0

      \[ \left(-2 \cdot {x.im}^{2} + -1 \cdot {x.im}^{2}\right) \cdot x.re \]

      *-commutative [=>]0.0

      \[ \color{blue}{x.re \cdot \left(-2 \cdot {x.im}^{2} + -1 \cdot {x.im}^{2}\right)} \]

      distribute-rgt-out [=>]0.0

      \[ x.re \cdot \color{blue}{\left({x.im}^{2} \cdot \left(-2 + -1\right)\right)} \]

      unpow2 [=>]0.0

      \[ x.re \cdot \left(\color{blue}{\left(x.im \cdot x.im\right)} \cdot \left(-2 + -1\right)\right) \]

      metadata-eval [=>]0.0

      \[ x.re \cdot \left(\left(x.im \cdot x.im\right) \cdot \color{blue}{-3}\right) \]

      metadata-eval [<=]0.0

      \[ x.re \cdot \left(\left(x.im \cdot x.im\right) \cdot \color{blue}{\left(-1 + -2\right)}\right) \]

      associate-*l* [=>]0.0

      \[ x.re \cdot \color{blue}{\left(x.im \cdot \left(x.im \cdot \left(-1 + -2\right)\right)\right)} \]

      metadata-eval [=>]0.0

      \[ x.re \cdot \left(x.im \cdot \left(x.im \cdot \color{blue}{-3}\right)\right) \]
    5. Taylor expanded in x.re around 0 0.0%

      \[\leadsto \color{blue}{-3 \cdot \left(x.re \cdot {x.im}^{2}\right)} \]
    6. Simplified99.4%

      \[\leadsto \color{blue}{\left(-3 \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)} \]
      Proof

      [Start]0.0

      \[ -3 \cdot \left(x.re \cdot {x.im}^{2}\right) \]

      unpow2 [=>]0.0

      \[ -3 \cdot \left(x.re \cdot \color{blue}{\left(x.im \cdot x.im\right)}\right) \]

      associate-*r* [=>]99.5

      \[ -3 \cdot \color{blue}{\left(\left(x.re \cdot x.im\right) \cdot x.im\right)} \]

      *-commutative [<=]99.5

      \[ -3 \cdot \color{blue}{\left(x.im \cdot \left(x.re \cdot x.im\right)\right)} \]

      associate-*r* [=>]99.4

      \[ \color{blue}{\left(-3 \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)} \]

    if -5.00000000000000004e154 < x.im < 4.0000000000000001e86

    1. Initial program 99.7%

      \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)} \]
      Proof

      [Start]99.7

      \[ \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      *-commutative [=>]99.7

      \[ \color{blue}{x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      *-commutative [=>]99.7

      \[ x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - \color{blue}{x.im \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} \]

      *-commutative [<=]99.7

      \[ x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \]

      distribute-lft-out [=>]99.7

      \[ x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \]

    if 4.0000000000000001e86 < x.im

    1. Initial program 50.4%

      \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]
    2. Simplified50.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-2 \cdot \left(x.re \cdot x.im\right)\right)\right)} \]
      Proof

      [Start]50.4

      \[ \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      *-commutative [=>]50.4

      \[ \color{blue}{x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im \]

      fma-neg [=>]50.4

      \[ \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, -\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\right)} \]

      distribute-lft-neg-in [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, \color{blue}{\left(-\left(x.re \cdot x.im + x.im \cdot x.re\right)\right) \cdot x.im}\right) \]

      *-commutative [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, \color{blue}{x.im \cdot \left(-\left(x.re \cdot x.im + x.im \cdot x.re\right)\right)}\right) \]

      *-commutative [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-\left(\color{blue}{x.im \cdot x.re} + x.im \cdot x.re\right)\right)\right) \]

      count-2 [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-\color{blue}{2 \cdot \left(x.im \cdot x.re\right)}\right)\right) \]

      distribute-lft-neg-in [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \color{blue}{\left(\left(-2\right) \cdot \left(x.im \cdot x.re\right)\right)}\right) \]

      metadata-eval [=>]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(\color{blue}{-2} \cdot \left(x.im \cdot x.re\right)\right)\right) \]

      *-commutative [<=]50.4

      \[ \mathsf{fma}\left(x.re, x.re \cdot x.re - x.im \cdot x.im, x.im \cdot \left(-2 \cdot \color{blue}{\left(x.re \cdot x.im\right)}\right)\right) \]
    3. Taylor expanded in x.re around 0 49.7%

      \[\leadsto \color{blue}{\left(-2 \cdot {x.im}^{2} + -1 \cdot {x.im}^{2}\right) \cdot x.re} \]
    4. Simplified99.2%

      \[\leadsto \color{blue}{x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)} \]
      Proof

      [Start]49.7

      \[ \left(-2 \cdot {x.im}^{2} + -1 \cdot {x.im}^{2}\right) \cdot x.re \]

      distribute-rgt-out [=>]49.7

      \[ \color{blue}{\left({x.im}^{2} \cdot \left(-2 + -1\right)\right)} \cdot x.re \]

      metadata-eval [=>]49.7

      \[ \left({x.im}^{2} \cdot \color{blue}{-3}\right) \cdot x.re \]

      metadata-eval [<=]49.7

      \[ \left({x.im}^{2} \cdot \color{blue}{\left(-1 + -2\right)}\right) \cdot x.re \]

      associate-*l* [=>]50.1

      \[ \color{blue}{{x.im}^{2} \cdot \left(\left(-1 + -2\right) \cdot x.re\right)} \]

      *-commutative [<=]50.1

      \[ {x.im}^{2} \cdot \color{blue}{\left(x.re \cdot \left(-1 + -2\right)\right)} \]

      distribute-rgt-out [<=]50.1

      \[ {x.im}^{2} \cdot \color{blue}{\left(-1 \cdot x.re + -2 \cdot x.re\right)} \]

      unpow2 [=>]50.1

      \[ \color{blue}{\left(x.im \cdot x.im\right)} \cdot \left(-1 \cdot x.re + -2 \cdot x.re\right) \]

      associate-*l* [=>]99.2

      \[ \color{blue}{x.im \cdot \left(x.im \cdot \left(-1 \cdot x.re + -2 \cdot x.re\right)\right)} \]

      distribute-rgt-out [=>]99.2

      \[ x.im \cdot \left(x.im \cdot \color{blue}{\left(x.re \cdot \left(-1 + -2\right)\right)}\right) \]

      metadata-eval [=>]99.2

      \[ x.im \cdot \left(x.im \cdot \left(x.re \cdot \color{blue}{-3}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification99.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\ \mathbf{elif}\;x.im \leq 4 \cdot 10^{+86}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.6%
Cost1096
\[\begin{array}{l} \mathbf{if}\;x.im \leq -4 \cdot 10^{+98}:\\ \;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\ \mathbf{elif}\;x.im \leq 1.8 \cdot 10^{+86}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right) + -3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \end{array} \]
Alternative 2
Accuracy99.6%
Cost1088
\[\left(x.re \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) \]
Alternative 3
Accuracy79.8%
Cost713
\[\begin{array}{l} \mathbf{if}\;x.im \leq -2.1 \cdot 10^{-33} \lor \neg \left(x.im \leq 4.2 \cdot 10^{-18}\right):\\ \;\;\;\;-3 \cdot \left(x.re \cdot \left(x.im \cdot x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \end{array} \]
Alternative 4
Accuracy91.1%
Cost713
\[\begin{array}{l} \mathbf{if}\;x.im \leq -2.1 \cdot 10^{-33} \lor \neg \left(x.im \leq 4.2 \cdot 10^{-18}\right):\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \end{array} \]
Alternative 5
Accuracy91.0%
Cost712
\[\begin{array}{l} \mathbf{if}\;x.im \leq -1.75 \cdot 10^{-27}:\\ \;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\ \mathbf{elif}\;x.im \leq 4.2 \cdot 10^{-18}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \mathbf{else}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \end{array} \]
Alternative 6
Accuracy55.2%
Cost320
\[x.re \cdot \left(x.re \cdot x.re\right) \]

Error

Reproduce?

herbie shell --seed 2023147 
(FPCore (x.re x.im)
  :name "math.cube on complex, real part"
  :precision binary64

  :herbie-target
  (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))

  (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))