?

Average Error: 88.1% → 99.7%
Time: 18.1s
Precision: binary64
Cost: 7304.00

?

\[\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 \]
\[\begin{array}{l} \mathbf{if}\;x.re \leq -4 \cdot 10^{+109}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 9 \cdot 10^{+84}:\\ \;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right) - {x.im}^{3}\\ \mathbf{else}:\\ \;\;\;\;x.re \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.im)
  (* (+ (* x.re x.im) (* x.im x.re)) x.re)))
(FPCore (x.re x.im)
 :precision binary64
 (if (<= x.re -4e+109)
   (* 3.0 (* x.re (* x.re x.im)))
   (if (<= x.re 9e+84)
     (- (* 3.0 (* x.im (* x.re x.re))) (pow x.im 3.0))
     (* x.re (* 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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
double code(double x_46_re, double x_46_im) {
	double tmp;
	if (x_46_re <= -4e+109) {
		tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
	} else if (x_46_re <= 9e+84) {
		tmp = (3.0 * (x_46_im * (x_46_re * x_46_re))) - pow(x_46_im, 3.0);
	} else {
		tmp = x_46_re * (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_46im) + (((x_46re * x_46im) + (x_46im * x_46re)) * x_46re)
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_46re <= (-4d+109)) then
        tmp = 3.0d0 * (x_46re * (x_46re * x_46im))
    else if (x_46re <= 9d+84) then
        tmp = (3.0d0 * (x_46im * (x_46re * x_46re))) - (x_46im ** 3.0d0)
    else
        tmp = x_46re * (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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
}
public static double code(double x_46_re, double x_46_im) {
	double tmp;
	if (x_46_re <= -4e+109) {
		tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
	} else if (x_46_re <= 9e+84) {
		tmp = (3.0 * (x_46_im * (x_46_re * x_46_re))) - Math.pow(x_46_im, 3.0);
	} else {
		tmp = x_46_re * (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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re)
def code(x_46_re, x_46_im):
	tmp = 0
	if x_46_re <= -4e+109:
		tmp = 3.0 * (x_46_re * (x_46_re * x_46_im))
	elif x_46_re <= 9e+84:
		tmp = (3.0 * (x_46_im * (x_46_re * x_46_re))) - math.pow(x_46_im, 3.0)
	else:
		tmp = x_46_re * (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_im) + Float64(Float64(Float64(x_46_re * x_46_im) + Float64(x_46_im * x_46_re)) * x_46_re))
end
function code(x_46_re, x_46_im)
	tmp = 0.0
	if (x_46_re <= -4e+109)
		tmp = Float64(3.0 * Float64(x_46_re * Float64(x_46_re * x_46_im)));
	elseif (x_46_re <= 9e+84)
		tmp = Float64(Float64(3.0 * Float64(x_46_im * Float64(x_46_re * x_46_re))) - (x_46_im ^ 3.0));
	else
		tmp = Float64(x_46_re * 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_im) + (((x_46_re * x_46_im) + (x_46_im * x_46_re)) * x_46_re);
end
function tmp_2 = code(x_46_re, x_46_im)
	tmp = 0.0;
	if (x_46_re <= -4e+109)
		tmp = 3.0 * (x_46_re * (x_46_re * x_46_im));
	elseif (x_46_re <= 9e+84)
		tmp = (3.0 * (x_46_im * (x_46_re * x_46_re))) - (x_46_im ^ 3.0);
	else
		tmp = x_46_re * (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$im), $MachinePrecision] + N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_] := If[LessEqual[x$46$re, -4e+109], N[(3.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9e+84], N[(N[(3.0 * N[(x$46$im * N[(x$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[x$46$im, 3.0], $MachinePrecision]), $MachinePrecision], N[(x$46$re * 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.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\begin{array}{l}
\mathbf{if}\;x.re \leq -4 \cdot 10^{+109}:\\
\;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;x.re \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.1%
Target99.6%
Herbie99.7%
\[\left(x.re \cdot x.im\right) \cdot \left(2 \cdot x.re\right) + \left(x.im \cdot \left(x.re - x.im\right)\right) \cdot \left(x.re + x.im\right) \]

Derivation?

  1. Split input into 3 regimes
  2. if x.re < -3.99999999999999993e109

    1. Initial program 36.9

      \[\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 \]
    2. Simplified36.6

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

      [Start]36.9

      \[ \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 \]

      *-commutative [=>]36.9

      \[ \color{blue}{x.im \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.re \]

      *-commutative [<=]36.9

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

      distribute-rgt-out [=>]36.9

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

      associate-*l* [=>]36.6

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

      distribute-lft-out [=>]36.6

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

      +-commutative [<=]36.6

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

      associate-+r- [=>]36.6

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

      count-2 [=>]36.6

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

      associate-*l* [=>]36.6

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

      distribute-lft1-in [=>]36.6

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

      fma-neg [=>]36.6

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

      metadata-eval [=>]36.6

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

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

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

      [Start]36.9

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

      unpow2 [=>]36.9

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

      associate-*l* [=>]99.4

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

    if -3.99999999999999993e109 < x.re < 8.9999999999999994e84

    1. Initial program 99.7

      \[\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 \]
    2. Simplified99.8

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

      [Start]99.7

      \[ \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 \]

      +-commutative [=>]99.7

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

      *-commutative [=>]99.7

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

      distribute-rgt-out-- [<=]99.7

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

      associate-+r- [=>]99.7

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

      *-commutative [<=]99.7

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

      *-commutative [<=]99.7

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

      count-2 [=>]99.7

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

      associate-*l* [=>]99.7

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

      *-commutative [<=]99.7

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

      associate-*r* [=>]99.7

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

      distribute-lft1-in [=>]99.7

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

      metadata-eval [=>]99.7

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

      cube-unmult [=>]99.8

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

    if 8.9999999999999994e84 < x.re

    1. Initial program 51.3

      \[\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 \]
    2. Simplified51.0

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

      [Start]51.3

      \[ \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 \]

      *-commutative [=>]51.3

      \[ \color{blue}{x.im \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.re \]

      *-commutative [<=]51.3

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

      distribute-rgt-out [=>]51.3

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

      associate-*l* [=>]51.0

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

      distribute-lft-out [=>]50.9

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

      +-commutative [<=]50.9

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

      associate-+r- [=>]50.9

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

      count-2 [=>]50.9

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

      associate-*l* [=>]50.9

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

      distribute-lft1-in [=>]50.9

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

      fma-neg [=>]51.0

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

      metadata-eval [=>]51.0

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

      \[\leadsto \color{blue}{3 \cdot \left({x.re}^{2} \cdot x.im\right)} \]
    4. Simplified50.8

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

      [Start]50.8

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

      *-commutative [=>]50.8

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

      unpow2 [=>]50.8

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

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

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

      [Start]50.8

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

      associate-*r* [=>]50.5

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

      unpow2 [=>]50.5

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

      *-commutative [<=]50.5

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

      associate-*l* [=>]50.5

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

      associate-*l* [=>]99.0

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

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

Alternatives

Alternative 1
Error99.7%
Cost7040.00
\[x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3} \]
Alternative 2
Error99.7%
Cost7040.00
\[x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right) - {x.im}^{3} \]
Alternative 3
Error99.6%
Cost1352.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -2 \cdot 10^{+154}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 1.5 \cdot 10^{+85}:\\ \;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(\left(x.re \cdot x.im\right) \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\ \end{array} \]
Alternative 4
Error99.6%
Cost968.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -1.96 \cdot 10^{+96}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 8 \cdot 10^{+96}:\\ \;\;\;\;x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right) - x.im \cdot x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\ \end{array} \]
Alternative 5
Error91.7%
Cost840.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -4.1 \cdot 10^{-23}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 2.55 \cdot 10^{-82}:\\ \;\;\;\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\ \end{array} \]
Alternative 6
Error91.7%
Cost840.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -1.85 \cdot 10^{-25}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 2.55 \cdot 10^{-82}:\\ \;\;\;\;\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\ \end{array} \]
Alternative 7
Error80.0%
Cost713.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -2.9 \cdot 10^{-26} \lor \neg \left(x.re \leq 2.55 \cdot 10^{-82}\right):\\ \;\;\;\;3 \cdot \left(x.im \cdot \left(x.re \cdot x.re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(-x.im\right)\\ \end{array} \]
Alternative 8
Error91.5%
Cost713.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -7 \cdot 10^{-27} \lor \neg \left(x.re \leq 2.55 \cdot 10^{-82}\right):\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(-x.im\right)\\ \end{array} \]
Alternative 9
Error91.5%
Cost712.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -7.5 \cdot 10^{-27}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 2.55 \cdot 10^{-82}:\\ \;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(-x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(3 \cdot \left(x.re \cdot x.im\right)\right)\\ \end{array} \]
Alternative 10
Error91.5%
Cost712.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -7 \cdot 10^{-27}:\\ \;\;\;\;3 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.re \leq 2.55 \cdot 10^{-82}:\\ \;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(-x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(x.re \cdot 3\right)\right)\\ \end{array} \]
Alternative 11
Error59.6%
Cost649.00
\[\begin{array}{l} \mathbf{if}\;x.re \leq -1750000000000 \lor \neg \left(x.re \leq 8.8 \cdot 10^{+23}\right):\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im \cdot x.im\right) \cdot \left(-x.im\right)\\ \end{array} \]
Alternative 12
Error31.0%
Cost320.00
\[x.im \cdot \left(x.re \cdot x.re\right) \]
Alternative 13
Error33.0%
Cost320.00
\[x.re \cdot \left(x.re \cdot x.im\right) \]
Alternative 14
Error26.7%
Cost192.00
\[x.im \cdot 0 \]

Error

Reproduce?

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

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

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