Average Error: 7.1 → 0.9
Time: 9.9s
Precision: binary64
Cost: 3656
\[\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} t_0 := x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+287}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+295}:\\ \;\;\;\;x.re \cdot \left(\left(x.re - x.im\right) \cdot \left(x.re + x.im\right)\right) - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.im \cdot \left(x.re \cdot \left(x.im \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
 (let* ((t_0
         (-
          (* x.re (- (* x.re x.re) (* x.im x.im)))
          (* x.im (+ (* x.re x.im) (* x.re x.im))))))
   (if (<= t_0 -4e+287)
     (* x.im (* x.im (* x.re -3.0)))
     (if (<= t_0 2e+295)
       (-
        (* x.re (* (- x.re x.im) (+ x.re x.im)))
        (* x.im (* x.re (+ x.im x.im))))
       (* x.im (* x.re (* x.im -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 t_0 = (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_re * x_46_im)));
	double tmp;
	if (t_0 <= -4e+287) {
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	} else if (t_0 <= 2e+295) {
		tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = x_46_im * (x_46_re * (x_46_im * -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) :: t_0
    real(8) :: tmp
    t_0 = (x_46re * ((x_46re * x_46re) - (x_46im * x_46im))) - (x_46im * ((x_46re * x_46im) + (x_46re * x_46im)))
    if (t_0 <= (-4d+287)) then
        tmp = x_46im * (x_46im * (x_46re * (-3.0d0)))
    else if (t_0 <= 2d+295) then
        tmp = (x_46re * ((x_46re - x_46im) * (x_46re + x_46im))) - (x_46im * (x_46re * (x_46im + x_46im)))
    else
        tmp = x_46im * (x_46re * (x_46im * (-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 t_0 = (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_re * x_46_im)));
	double tmp;
	if (t_0 <= -4e+287) {
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	} else if (t_0 <= 2e+295) {
		tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = x_46_im * (x_46_re * (x_46_im * -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):
	t_0 = (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_re * x_46_im)))
	tmp = 0
	if t_0 <= -4e+287:
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0))
	elif t_0 <= 2e+295:
		tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)))
	else:
		tmp = x_46_im * (x_46_re * (x_46_im * -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)
	t_0 = 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(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im))))
	tmp = 0.0
	if (t_0 <= -4e+287)
		tmp = Float64(x_46_im * Float64(x_46_im * Float64(x_46_re * -3.0)));
	elseif (t_0 <= 2e+295)
		tmp = Float64(Float64(x_46_re * Float64(Float64(x_46_re - x_46_im) * Float64(x_46_re + 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_re * Float64(x_46_im * -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)
	t_0 = (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_re * x_46_im)));
	tmp = 0.0;
	if (t_0 <= -4e+287)
		tmp = x_46_im * (x_46_im * (x_46_re * -3.0));
	elseif (t_0 <= 2e+295)
		tmp = (x_46_re * ((x_46_re - x_46_im) * (x_46_re + x_46_im))) - (x_46_im * (x_46_re * (x_46_im + x_46_im)));
	else
		tmp = x_46_im * (x_46_re * (x_46_im * -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_] := Block[{t$95$0 = 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[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -4e+287], N[(x$46$im * N[(x$46$im * N[(x$46$re * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+295], N[(N[(x$46$re * N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$re + 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$re * N[(x$46$im * -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}
t_0 := x.re \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) - x.im \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right)\\
\mathbf{if}\;t_0 \leq -4 \cdot 10^{+287}:\\
\;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\

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

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.1
Target0.2
Herbie0.9
\[\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 (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < -4.0000000000000003e287

    1. Initial program 54.6

      \[\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. Simplified54.6

      \[\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
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (*.f64 x.re (+.f64 x.im x.im)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 x.im x.re) (*.f64 x.im x.re))))): 5 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 x.re x.im)) (*.f64 x.im x.re)))): 0 points increase in error, 5 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im))): 5 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re)) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)): 0 points increase in error, 5 points decrease in error
    3. Taylor expanded in x.im around inf 60.9

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

      \[\leadsto \color{blue}{\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right)} \]
      Proof
      (*.f64 (*.f64 x.re -3) (*.f64 x.im x.im)): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 x.re (Rewrite<= metadata-eval (-.f64 -1 2))) (*.f64 x.im x.im)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 -1 x.re) (*.f64 2 x.re))) (*.f64 x.im x.im)): 4 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (*.f64 -1 x.re) (*.f64 2 x.re)) (Rewrite<= unpow2_binary64 (pow.f64 x.im 2))): 4 points increase in error, 0 points decrease in error
    5. Applied egg-rr6.6

      \[\leadsto \color{blue}{\left(1 + x.im \cdot \left(x.re \cdot \left(-3 \cdot x.im\right)\right)\right) - 1} \]
    6. Applied egg-rr6.6

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

    if -4.0000000000000003e287 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < 2e295

    1. Initial program 0.2

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

      \[\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
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (*.f64 x.re (+.f64 x.im x.im)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 x.im x.re) (*.f64 x.im x.re))))): 5 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 x.re x.im)) (*.f64 x.im x.re)))): 0 points increase in error, 5 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im))): 5 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re)) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)): 0 points increase in error, 5 points decrease in error
    3. Applied egg-rr0.2

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

    if 2e295 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im))

    1. Initial program 57.3

      \[\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. Simplified57.3

      \[\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
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (*.f64 x.re (+.f64 x.im x.im)))): 0 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (Rewrite<= distribute-rgt-out_binary64 (+.f64 (*.f64 x.im x.re) (*.f64 x.im x.re))))): 5 points increase in error, 0 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (*.f64 x.im (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 x.re x.im)) (*.f64 x.im x.re)))): 0 points increase in error, 5 points decrease in error
      (-.f64 (*.f64 x.re (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im))) (Rewrite<= *-commutative_binary64 (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im))): 5 points increase in error, 0 points decrease in error
      (-.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re)) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)): 0 points increase in error, 5 points decrease in error
    3. Taylor expanded in x.im around inf 61.9

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

      \[\leadsto \color{blue}{\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right)} \]
      Proof
      (*.f64 (*.f64 x.re -3) (*.f64 x.im x.im)): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 x.re (Rewrite<= metadata-eval (-.f64 -1 2))) (*.f64 x.im x.im)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= distribute-rgt-out--_binary64 (-.f64 (*.f64 -1 x.re) (*.f64 2 x.re))) (*.f64 x.im x.im)): 4 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (*.f64 -1 x.re) (*.f64 2 x.re)) (Rewrite<= unpow2_binary64 (pow.f64 x.im 2))): 4 points increase in error, 0 points decrease in error
    5. Applied egg-rr5.0

      \[\leadsto \color{blue}{\left(1 + x.im \cdot \left(x.re \cdot \left(-3 \cdot x.im\right)\right)\right) - 1} \]
    6. Applied egg-rr5.0

      \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re \cdot -3\right)\right) \cdot x.im} \]
    7. Taylor expanded in x.im around 0 5.0

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

      \[\leadsto \color{blue}{\left(x.re \cdot \left(-3 \cdot x.im\right)\right)} \cdot x.im \]
      Proof
      (*.f64 (*.f64 x.re (*.f64 -3 x.im)) x.im): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 -3 x.im) x.re)) x.im): 2 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= associate-*r*_binary64 (*.f64 -3 (*.f64 x.im x.re))) x.im): 4 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 -3 (Rewrite<= *-commutative_binary64 (*.f64 x.re x.im))) x.im): 0 points increase in error, 4 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification0.9

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

Alternatives

Alternative 1
Error0.2
Cost7040
\[{x.re}^{3} + \left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right) \]
Alternative 2
Error0.2
Cost7040
\[{x.re}^{3} + x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right) \]
Alternative 3
Error0.3
Cost1216
\[\frac{x.re \cdot \left(x.re - x.im\right)}{\frac{1}{x.re + x.im}} - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) \]
Alternative 4
Error0.3
Cost1216
\[\frac{x.re - x.im}{\frac{\frac{1}{x.re}}{x.re + x.im}} - x.im \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) \]
Alternative 5
Error0.2
Cost968
\[\begin{array}{l} \mathbf{if}\;x.im \leq -3.75 \cdot 10^{+143}:\\ \;\;\;\;x.im \cdot \left(-3 \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{elif}\;x.im \leq 6 \cdot 10^{+120}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re + x.im \cdot \left(x.im \cdot -3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im \cdot -3\right) \cdot \left(x.re \cdot x.im\right)\\ \end{array} \]
Alternative 6
Error5.5
Cost713
\[\begin{array}{l} \mathbf{if}\;x.im \leq -5.8 \cdot 10^{-58} \lor \neg \left(x.im \leq 3.2 \cdot 10^{-70}\right):\\ \;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \end{array} \]
Alternative 7
Error5.5
Cost712
\[\begin{array}{l} \mathbf{if}\;x.im \leq -4.7 \cdot 10^{-61}:\\ \;\;\;\;x.im \cdot \left(x.im \cdot \left(x.re \cdot -3\right)\right)\\ \mathbf{elif}\;x.im \leq 3.2 \cdot 10^{-70}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \mathbf{else}:\\ \;\;\;\;-3 \cdot \left(x.im \cdot \left(x.re \cdot x.im\right)\right)\\ \end{array} \]
Alternative 8
Error27.1
Cost649
\[\begin{array}{l} \mathbf{if}\;x.re \leq -8 \cdot 10^{-105} \lor \neg \left(x.re \leq 2.6 \cdot 10^{-92}\right):\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.im \cdot \left(-x.im\right)\right)\\ \end{array} \]
Alternative 9
Error25.8
Cost649
\[\begin{array}{l} \mathbf{if}\;x.im \leq -1.12 \cdot 10^{+27} \lor \neg \left(x.im \leq 26000000000000\right):\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(-x.im\right)\\ \mathbf{else}:\\ \;\;\;\;x.re \cdot \left(x.re \cdot x.re\right)\\ \end{array} \]
Alternative 10
Error28.3
Cost320
\[x.re \cdot \left(x.re \cdot x.re\right) \]

Error

Reproduce

herbie shell --seed 2022343 
(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)))