math.cube on complex, imaginary part

Percentage Accurate: 82.3% → 99.8%
Time: 8.2s
Alternatives: 15
Speedup: 1.3×

Specification

?
\[\begin{array}{l} \\ \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 \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)))
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);
}
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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 82.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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 \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)))
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);
}
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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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
\end{array}

Alternative 1: 99.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right)\\ \mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\ \;\;\;\;t_0 + x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 + x.re \cdot 0\\ \end{array} \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (let* ((t_0 (* (- x.re x.im) (* x.im (+ x.re x.im)))))
   (if (<=
        (+
         (* x.im (- (* x.re x.re) (* x.im x.im)))
         (* x.re (+ (* x.re x.im) (* x.re x.im))))
        INFINITY)
     (+ t_0 (* x.re (* x.re (+ x.im x.im))))
     (+ t_0 (* x.re 0.0)))))
double code(double x_46_re, double x_46_im) {
	double t_0 = (x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im));
	double tmp;
	if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= ((double) INFINITY)) {
		tmp = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = t_0 + (x_46_re * 0.0);
	}
	return tmp;
}
public static double code(double x_46_re, double x_46_im) {
	double t_0 = (x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im));
	double tmp;
	if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Double.POSITIVE_INFINITY) {
		tmp = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)));
	} else {
		tmp = t_0 + (x_46_re * 0.0);
	}
	return tmp;
}
def code(x_46_re, x_46_im):
	t_0 = (x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))
	tmp = 0
	if ((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= math.inf:
		tmp = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)))
	else:
		tmp = t_0 + (x_46_re * 0.0)
	return tmp
function code(x_46_re, x_46_im)
	t_0 = Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_re + x_46_im)))
	tmp = 0.0
	if (Float64(Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) - Float64(x_46_im * x_46_im))) + Float64(x_46_re * Float64(Float64(x_46_re * x_46_im) + Float64(x_46_re * x_46_im)))) <= Inf)
		tmp = Float64(t_0 + Float64(x_46_re * Float64(x_46_re * Float64(x_46_im + x_46_im))));
	else
		tmp = Float64(t_0 + Float64(x_46_re * 0.0));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im)
	t_0 = (x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im));
	tmp = 0.0;
	if (((x_46_im * ((x_46_re * x_46_re) - (x_46_im * x_46_im))) + (x_46_re * ((x_46_re * x_46_im) + (x_46_re * x_46_im)))) <= Inf)
		tmp = t_0 + (x_46_re * (x_46_re * (x_46_im + x_46_im)));
	else
		tmp = t_0 + (x_46_re * 0.0);
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] - N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(x$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 + N[(x$46$re * N[(x$46$re * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(x$46$re * 0.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right)\\
\mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\
\;\;\;\;t_0 + x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\

\mathbf{else}:\\
\;\;\;\;t_0 + x.re \cdot 0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re)) < +inf.0

    1. Initial program 91.8%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt91.4%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow391.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative91.5%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares91.5%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*99.4%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow399.4%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt99.7%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative99.7%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \cdot x.re \]
      2. distribute-lft-out99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr99.7%

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

    if +inf.0 < (+.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.im) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.re))

    1. Initial program 0.0%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt0.0%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow30.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative0.0%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares11.8%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*11.8%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr11.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow311.8%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt11.8%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative11.8%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr11.8%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative11.8%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \cdot x.re \]
      3. div-sub0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right)} \cdot x.re \]
      4. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      5. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      6. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      7. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      8. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      9. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      10. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}}\right) \cdot x.re \]
      11. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re}\right) \cdot x.re \]
    7. Applied egg-rr0.0%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re}\right)} \cdot x.re \]
    8. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) + x.re \cdot \left(x.re \cdot x.im + x.re \cdot x.im\right) \leq \infty:\\ \;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot 0\\ \end{array} \]

Alternative 2: 92.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -1.25 \cdot 10^{-105} \lor \neg \left(x.im \leq 3.1 \cdot 10^{-79}\right):\\ \;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (if (or (<= x.im -1.25e-105) (not (<= x.im 3.1e-79)))
   (+ (* (- x.re x.im) (* x.im (+ x.re x.im))) (* x.re 0.0))
   (* (* x.re x.im) (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
	double tmp;
	if ((x_46_im <= -1.25e-105) || !(x_46_im <= 3.1e-79)) {
		tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.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
    real(8) :: tmp
    if ((x_46im <= (-1.25d-105)) .or. (.not. (x_46im <= 3.1d-79))) then
        tmp = ((x_46re - x_46im) * (x_46im * (x_46re + x_46im))) + (x_46re * 0.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) {
	double tmp;
	if ((x_46_im <= -1.25e-105) || !(x_46_im <= 3.1e-79)) {
		tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0);
	} else {
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
	}
	return tmp;
}
def code(x_46_re, x_46_im):
	tmp = 0
	if (x_46_im <= -1.25e-105) or not (x_46_im <= 3.1e-79):
		tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.0)
	else:
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0)
	return tmp
function code(x_46_re, x_46_im)
	tmp = 0.0
	if ((x_46_im <= -1.25e-105) || !(x_46_im <= 3.1e-79))
		tmp = Float64(Float64(Float64(x_46_re - x_46_im) * Float64(x_46_im * Float64(x_46_re + x_46_im))) + Float64(x_46_re * 0.0));
	else
		tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im)
	tmp = 0.0;
	if ((x_46_im <= -1.25e-105) || ~((x_46_im <= 3.1e-79)))
		tmp = ((x_46_re - x_46_im) * (x_46_im * (x_46_re + x_46_im))) + (x_46_re * 0.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_] := If[Or[LessEqual[x$46$im, -1.25e-105], N[Not[LessEqual[x$46$im, 3.1e-79]], $MachinePrecision]], N[(N[(N[(x$46$re - x$46$im), $MachinePrecision] * N[(x$46$im * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$re * 0.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1.25 \cdot 10^{-105} \lor \neg \left(x.im \leq 3.1 \cdot 10^{-79}\right):\\
\;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot 0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < -1.24999999999999991e-105 or 3.0999999999999999e-79 < x.im

    1. Initial program 78.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. Step-by-step derivation
      1. add-cube-cbrt78.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow378.4%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative78.4%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares80.9%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*80.9%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr80.9%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow380.8%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt81.2%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative81.2%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr81.2%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative81.2%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \cdot x.re \]
      3. div-sub0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right)} \cdot x.re \]
      4. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      5. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      6. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      7. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      8. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      9. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      10. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}}\right) \cdot x.re \]
      11. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re}\right) \cdot x.re \]
    7. Applied egg-rr0.0%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re}\right)} \cdot x.re \]
    8. Step-by-step derivation
      1. +-inverses92.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{0} \cdot x.re \]
    9. Simplified92.7%

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

    if -1.24999999999999991e-105 < x.im < 3.0999999999999999e-79

    1. Initial program 81.2%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt80.8%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow380.9%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative80.9%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares80.9%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*99.4%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow399.4%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt99.7%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative99.7%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \cdot x.re \]
      2. distribute-lft-out99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr99.7%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    8. Taylor expanded in x.re around inf 79.2%

      \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in79.2%

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

        \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
      3. associate-*r*79.3%

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

        \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
      5. associate-*r*79.3%

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

        \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
      7. associate-*r*97.8%

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

        \[\leadsto \left(x.im \cdot x.re\right) \cdot \color{blue}{\left(3 \cdot x.re\right)} \]
    10. Simplified97.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -1.25 \cdot 10^{-105} \lor \neg \left(x.im \leq 3.1 \cdot 10^{-79}\right):\\ \;\;\;\;\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.re + x.im\right)\right) + x.re \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \end{array} \]

Alternative 3: 83.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x.im \leq -3.4 \cdot 10^{+39} \lor \neg \left(x.im \leq 7.5 \cdot 10^{-56}\right):\\ \;\;\;\;x.re \cdot 0 + \left(x.im \cdot x.im\right) \cdot \left(x.re - x.im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (if (or (<= x.im -3.4e+39) (not (<= x.im 7.5e-56)))
   (+ (* x.re 0.0) (* (* x.im x.im) (- x.re x.im)))
   (* (* x.re x.im) (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
	double tmp;
	if ((x_46_im <= -3.4e+39) || !(x_46_im <= 7.5e-56)) {
		tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (x_46_re - x_46_im));
	} 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
    real(8) :: tmp
    if ((x_46im <= (-3.4d+39)) .or. (.not. (x_46im <= 7.5d-56))) then
        tmp = (x_46re * 0.0d0) + ((x_46im * x_46im) * (x_46re - x_46im))
    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) {
	double tmp;
	if ((x_46_im <= -3.4e+39) || !(x_46_im <= 7.5e-56)) {
		tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (x_46_re - x_46_im));
	} else {
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
	}
	return tmp;
}
def code(x_46_re, x_46_im):
	tmp = 0
	if (x_46_im <= -3.4e+39) or not (x_46_im <= 7.5e-56):
		tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (x_46_re - x_46_im))
	else:
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0)
	return tmp
function code(x_46_re, x_46_im)
	tmp = 0.0
	if ((x_46_im <= -3.4e+39) || !(x_46_im <= 7.5e-56))
		tmp = Float64(Float64(x_46_re * 0.0) + Float64(Float64(x_46_im * x_46_im) * Float64(x_46_re - x_46_im)));
	else
		tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im)
	tmp = 0.0;
	if ((x_46_im <= -3.4e+39) || ~((x_46_im <= 7.5e-56)))
		tmp = (x_46_re * 0.0) + ((x_46_im * x_46_im) * (x_46_re - x_46_im));
	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_] := If[Or[LessEqual[x$46$im, -3.4e+39], N[Not[LessEqual[x$46$im, 7.5e-56]], $MachinePrecision]], N[(N[(x$46$re * 0.0), $MachinePrecision] + N[(N[(x$46$im * x$46$im), $MachinePrecision] * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -3.4 \cdot 10^{+39} \lor \neg \left(x.im \leq 7.5 \cdot 10^{-56}\right):\\
\;\;\;\;x.re \cdot 0 + \left(x.im \cdot x.im\right) \cdot \left(x.re - x.im\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < -3.3999999999999999e39 or 7.50000000000000041e-56 < x.im

    1. Initial program 73.5%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt73.2%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow373.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative73.3%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares76.4%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*76.4%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr76.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow376.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt76.6%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative76.6%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr76.6%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative76.6%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \cdot x.re \]
      3. div-sub0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right)} \cdot x.re \]
      4. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      5. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      6. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      7. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re} - \frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      8. pow20.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{\color{blue}{{\left(x.re \cdot x.im\right)}^{2}}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      9. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\color{blue}{\left(x.im \cdot x.re\right)}}^{2}}{x.re \cdot x.im - x.re \cdot x.im}\right) \cdot x.re \]
      10. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}}\right) \cdot x.re \]
      11. *-commutative0.0%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{\color{blue}{x.im \cdot x.re} - x.im \cdot x.re}\right) \cdot x.re \]
    7. Applied egg-rr0.0%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(\frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re} - \frac{{\left(x.im \cdot x.re\right)}^{2}}{x.im \cdot x.re - x.im \cdot x.re}\right)} \cdot x.re \]
    8. Step-by-step derivation
      1. +-inverses97.3%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{0} \cdot x.re \]
    9. Simplified97.3%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{0} \cdot x.re \]
    10. Taylor expanded in x.im around inf 86.9%

      \[\leadsto \left(x.re - x.im\right) \cdot \color{blue}{{x.im}^{2}} + 0 \cdot x.re \]
    11. Step-by-step derivation
      1. unpow286.9%

        \[\leadsto \left(x.re - x.im\right) \cdot \color{blue}{\left(x.im \cdot x.im\right)} + 0 \cdot x.re \]
    12. Simplified86.9%

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

    if -3.3999999999999999e39 < x.im < 7.50000000000000041e-56

    1. Initial program 85.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. Step-by-step derivation
      1. add-cube-cbrt85.4%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow385.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative85.5%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares85.5%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*99.4%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr99.4%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow399.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt99.7%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative99.7%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \cdot x.re \]
      2. distribute-lft-out99.7%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr99.7%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    8. Taylor expanded in x.re around inf 74.6%

      \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in74.6%

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

        \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
      3. associate-*r*74.6%

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

        \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
      5. associate-*r*74.6%

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

        \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
      7. associate-*r*88.5%

        \[\leadsto \color{blue}{\left(x.im \cdot x.re\right) \cdot \left(x.re \cdot 3\right)} \]
      8. *-commutative88.5%

        \[\leadsto \left(x.im \cdot x.re\right) \cdot \color{blue}{\left(3 \cdot x.re\right)} \]
    10. Simplified88.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -3.4 \cdot 10^{+39} \lor \neg \left(x.im \leq 7.5 \cdot 10^{-56}\right):\\ \;\;\;\;x.re \cdot 0 + \left(x.im \cdot x.im\right) \cdot \left(x.re - x.im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \end{array} \]

Alternative 4: 69.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x.im \cdot \left(x.im + x.im\right)\\ \mathbf{if}\;x.im \leq -3.8 \cdot 10^{+130}:\\ \;\;\;\;t_0 + t_0\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{+149}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im + x.im\right) - x.re \cdot \left(x.im \cdot x.im\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (let* ((t_0 (* x.im (+ x.im x.im))))
   (if (<= x.im -3.8e+130)
     (+ t_0 t_0)
     (if (<= x.im 8e+149)
       (* (* x.re x.im) (* x.re 3.0))
       (- (+ x.im x.im) (* x.re (* x.im x.im)))))))
double code(double x_46_re, double x_46_im) {
	double t_0 = x_46_im * (x_46_im + x_46_im);
	double tmp;
	if (x_46_im <= -3.8e+130) {
		tmp = t_0 + t_0;
	} else if (x_46_im <= 8e+149) {
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
	} else {
		tmp = (x_46_im + x_46_im) - (x_46_re * (x_46_im * x_46_im));
	}
	return tmp;
}
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_46im * (x_46im + x_46im)
    if (x_46im <= (-3.8d+130)) then
        tmp = t_0 + t_0
    else if (x_46im <= 8d+149) then
        tmp = (x_46re * x_46im) * (x_46re * 3.0d0)
    else
        tmp = (x_46im + x_46im) - (x_46re * (x_46im * x_46im))
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im) {
	double t_0 = x_46_im * (x_46_im + x_46_im);
	double tmp;
	if (x_46_im <= -3.8e+130) {
		tmp = t_0 + t_0;
	} else if (x_46_im <= 8e+149) {
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
	} else {
		tmp = (x_46_im + x_46_im) - (x_46_re * (x_46_im * x_46_im));
	}
	return tmp;
}
def code(x_46_re, x_46_im):
	t_0 = x_46_im * (x_46_im + x_46_im)
	tmp = 0
	if x_46_im <= -3.8e+130:
		tmp = t_0 + t_0
	elif x_46_im <= 8e+149:
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0)
	else:
		tmp = (x_46_im + x_46_im) - (x_46_re * (x_46_im * x_46_im))
	return tmp
function code(x_46_re, x_46_im)
	t_0 = Float64(x_46_im * Float64(x_46_im + x_46_im))
	tmp = 0.0
	if (x_46_im <= -3.8e+130)
		tmp = Float64(t_0 + t_0);
	elseif (x_46_im <= 8e+149)
		tmp = Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0));
	else
		tmp = Float64(Float64(x_46_im + x_46_im) - Float64(x_46_re * Float64(x_46_im * x_46_im)));
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im)
	t_0 = x_46_im * (x_46_im + x_46_im);
	tmp = 0.0;
	if (x_46_im <= -3.8e+130)
		tmp = t_0 + t_0;
	elseif (x_46_im <= 8e+149)
		tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
	else
		tmp = (x_46_im + x_46_im) - (x_46_re * (x_46_im * x_46_im));
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_] := Block[{t$95$0 = N[(x$46$im * N[(x$46$im + x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -3.8e+130], N[(t$95$0 + t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 8e+149], N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + x$46$im), $MachinePrecision] - N[(x$46$re * N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x.im \cdot \left(x.im + x.im\right)\\
\mathbf{if}\;x.im \leq -3.8 \cdot 10^{+130}:\\
\;\;\;\;t_0 + t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x.im < -3.8000000000000002e130

    1. Initial program 58.5%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt58.5%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow358.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative58.5%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares61.0%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*61.0%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr61.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Taylor expanded in x.im around 0 3.0%

      \[\leadsto \color{blue}{2 \cdot \left({x.re}^{2} \cdot x.im\right)} \]
    5. Step-by-step derivation
      1. *-commutative3.0%

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

        \[\leadsto 2 \cdot \left(x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right) \]
      3. associate-*r*2.9%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
    6. Simplified2.9%

      \[\leadsto \color{blue}{2 \cdot \left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
    7. Step-by-step derivation
      1. *-commutative2.9%

        \[\leadsto \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot x.re\right) \cdot 2} \]
      2. *-commutative2.9%

        \[\leadsto \color{blue}{\left(x.re \cdot \left(x.im \cdot x.re\right)\right)} \cdot 2 \]
      3. associate-*l*2.9%

        \[\leadsto \color{blue}{x.re \cdot \left(\left(x.im \cdot x.re\right) \cdot 2\right)} \]
      4. *-commutative2.9%

        \[\leadsto x.re \cdot \color{blue}{\left(2 \cdot \left(x.im \cdot x.re\right)\right)} \]
      5. count-22.9%

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

        \[\leadsto x.re \cdot \color{blue}{\frac{\left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right) - \left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right)}{x.im \cdot x.re - x.im \cdot x.re}} \]
      7. *-commutative0.0%

        \[\leadsto x.re \cdot \frac{\left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right) - \left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right)}{\color{blue}{x.re \cdot x.im} - x.im \cdot x.re} \]
      8. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.im \cdot x.re} \]
      9. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{x.im \cdot x.re - x.im \cdot x.re}}{x.re \cdot x.im - x.im \cdot x.re} \]
      10. *-commutative0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{x.re \cdot x.im} - x.im \cdot x.re}{x.re \cdot x.im - x.im \cdot x.re} \]
      11. associate-*r/0.0%

        \[\leadsto \color{blue}{\frac{x.re \cdot \left(x.re \cdot x.im - x.im \cdot x.re\right)}{x.re \cdot x.im - x.im \cdot x.re}} \]
      12. *-commutative0.0%

        \[\leadsto \frac{x.re \cdot \left(\color{blue}{x.im \cdot x.re} - x.im \cdot x.re\right)}{x.re \cdot x.im - x.im \cdot x.re} \]
      13. +-inverses0.0%

        \[\leadsto \frac{x.re \cdot \color{blue}{0}}{x.re \cdot x.im - x.im \cdot x.re} \]
      14. +-inverses0.0%

        \[\leadsto \frac{x.re \cdot \color{blue}{\left(x.im - x.im\right)}}{x.re \cdot x.im - x.im \cdot x.re} \]
      15. distribute-lft-out--0.0%

        \[\leadsto \frac{\color{blue}{x.re \cdot x.im - x.re \cdot x.im}}{x.re \cdot x.im - x.im \cdot x.re} \]
      16. *-commutative0.0%

        \[\leadsto \frac{x.re \cdot x.im - \color{blue}{x.im \cdot x.re}}{x.re \cdot x.im - x.im \cdot x.re} \]
    8. Applied egg-rr86.6%

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

    if -3.8000000000000002e130 < x.im < 8.00000000000000039e149

    1. Initial program 89.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. Step-by-step derivation
      1. add-cube-cbrt89.1%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow389.2%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative89.2%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares89.2%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*98.8%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr98.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow398.7%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt99.1%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative99.1%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative99.1%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr99.1%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    8. Taylor expanded in x.re around inf 61.8%

      \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in61.8%

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

        \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
      3. associate-*r*61.8%

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

        \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
      5. associate-*r*61.9%

        \[\leadsto \color{blue}{\left(x.re \cdot \left(x.re \cdot 3\right)\right)} \cdot x.im \]
      6. *-commutative61.9%

        \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
      7. associate-*r*71.4%

        \[\leadsto \color{blue}{\left(x.im \cdot x.re\right) \cdot \left(x.re \cdot 3\right)} \]
      8. *-commutative71.4%

        \[\leadsto \left(x.im \cdot x.re\right) \cdot \color{blue}{\left(3 \cdot x.re\right)} \]
    10. Simplified71.4%

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

    if 8.00000000000000039e149 < x.im

    1. Initial program 46.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. Step-by-step derivation
      1. +-commutative46.7%

        \[\leadsto \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} \]
      2. *-commutative46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} + \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im \]
      3. fma-def50.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.im + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right)} \]
      4. *-commutative50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.im \cdot x.re} + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      5. distribute-rgt-out50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.re \cdot \left(x.im + x.im\right)}, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      6. *-commutative50.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot \left(x.im + x.im\right), x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} \]
      2. distribute-lft-in46.7%

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

        \[\leadsto x.re \cdot \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      4. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      5. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      6. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      7. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      8. flip-+56.7%

        \[\leadsto x.re \cdot \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      9. distribute-lft-in56.7%

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

        \[\leadsto \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      11. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      12. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      13. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      14. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      15. flip-+73.3%

        \[\leadsto \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      16. difference-of-squares100.0%

        \[\leadsto \left(x.im + x.im\right) + x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)} \]
      17. associate-*r*100.0%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(x.im + x.im\right) + \left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    6. Taylor expanded in x.im around 0 47.2%

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

      \[\leadsto \left(x.im + x.im\right) + \color{blue}{-1 \cdot \left(x.re \cdot {x.im}^{2}\right)} \]
    8. Step-by-step derivation
      1. unpow253.3%

        \[\leadsto \left(x.im + x.im\right) + -1 \cdot \left(x.re \cdot \color{blue}{\left(x.im \cdot x.im\right)}\right) \]
      2. associate-*r*53.3%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{\left(-1 \cdot x.re\right) \cdot \left(x.im \cdot x.im\right)} \]
      3. mul-1-neg53.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -3.8 \cdot 10^{+130}:\\ \;\;\;\;x.im \cdot \left(x.im + x.im\right) + x.im \cdot \left(x.im + x.im\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{+149}:\\ \;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x.im + x.im\right) - x.re \cdot \left(x.im \cdot x.im\right)\\ \end{array} \]

Alternative 5: 58.5% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 4.4 \cdot 10^{+154}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < 4.4000000000000002e154

    1. Initial program 84.0%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt83.6%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow383.7%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative83.7%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares84.1%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*91.9%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr91.9%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow391.9%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt92.2%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative92.2%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr92.2%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative92.2%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \cdot x.re \]
      2. distribute-lft-out92.2%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr92.2%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    8. Taylor expanded in x.re around inf 51.2%

      \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in51.2%

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

        \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
      3. associate-*r*51.2%

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

        \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
      5. associate-*r*51.2%

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

        \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
      7. associate-*r*59.0%

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

        \[\leadsto \left(x.im \cdot x.re\right) \cdot \color{blue}{\left(3 \cdot x.re\right)} \]
    10. Simplified59.0%

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

    if 4.4000000000000002e154 < x.im

    1. Initial program 46.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. Step-by-step derivation
      1. +-commutative46.7%

        \[\leadsto \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} \]
      2. *-commutative46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} + \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im \]
      3. fma-def50.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.im + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right)} \]
      4. *-commutative50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.im \cdot x.re} + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      5. distribute-rgt-out50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.re \cdot \left(x.im + x.im\right)}, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      6. *-commutative50.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot \left(x.im + x.im\right), x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} \]
      2. distribute-lft-in46.7%

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

        \[\leadsto x.re \cdot \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      4. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      5. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      6. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      7. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      8. flip-+56.7%

        \[\leadsto x.re \cdot \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      9. distribute-lft-in56.7%

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

        \[\leadsto \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      11. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      12. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      13. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      14. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      15. flip-+73.3%

        \[\leadsto \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      16. difference-of-squares100.0%

        \[\leadsto \left(x.im + x.im\right) + x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)} \]
      17. associate-*r*100.0%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(x.im + x.im\right) + \left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    6. Taylor expanded in x.im around 0 47.2%

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

      \[\leadsto \left(x.im + x.im\right) + \color{blue}{-1 \cdot \left(x.re \cdot {x.im}^{2}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg53.3%

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

        \[\leadsto \left(x.im + x.im\right) + \left(-x.re \cdot \color{blue}{\left(x.im \cdot x.im\right)}\right) \]
      3. associate-*r*43.9%

        \[\leadsto \left(x.im + x.im\right) + \left(-\color{blue}{\left(x.re \cdot x.im\right) \cdot x.im}\right) \]
      4. *-commutative43.9%

        \[\leadsto \left(x.im + x.im\right) + \left(-\color{blue}{x.im \cdot \left(x.re \cdot x.im\right)}\right) \]
      5. distribute-rgt-neg-in43.9%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{x.im \cdot \left(-x.re \cdot x.im\right)} \]
      6. *-commutative43.9%

        \[\leadsto \left(x.im + x.im\right) + x.im \cdot \left(-\color{blue}{x.im \cdot x.re}\right) \]
      7. distribute-rgt-neg-in43.9%

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

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

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

Alternative 6: 59.9% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.5 \cdot 10^{+150}:\\
\;\;\;\;\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x.im < 1.50000000000000006e150

    1. Initial program 84.0%

      \[\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. Step-by-step derivation
      1. add-cube-cbrt83.6%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow383.7%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative83.7%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      4. difference-of-squares84.1%

        \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      5. associate-*r*91.9%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. Applied egg-rr91.9%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. Step-by-step derivation
      1. unpow391.9%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      2. add-cube-cbrt92.2%

        \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
      3. *-commutative92.2%

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

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. Applied egg-rr92.2%

      \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    6. Step-by-step derivation
      1. *-commutative92.2%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \left(x.re \cdot x.im + \color{blue}{x.re \cdot x.im}\right) \cdot x.re \]
      2. distribute-lft-out92.2%

        \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    7. Applied egg-rr92.2%

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
    8. Taylor expanded in x.re around inf 51.2%

      \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt1-in51.2%

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

        \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
      3. associate-*r*51.2%

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

        \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
      5. associate-*r*51.2%

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

        \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
      7. associate-*r*59.0%

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

        \[\leadsto \left(x.im \cdot x.re\right) \cdot \color{blue}{\left(3 \cdot x.re\right)} \]
    10. Simplified59.0%

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

    if 1.50000000000000006e150 < x.im

    1. Initial program 46.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. Step-by-step derivation
      1. +-commutative46.7%

        \[\leadsto \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} \]
      2. *-commutative46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} + \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im \]
      3. fma-def50.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot x.im + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right)} \]
      4. *-commutative50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.im \cdot x.re} + x.im \cdot x.re, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      5. distribute-rgt-out50.0%

        \[\leadsto \mathsf{fma}\left(x.re, \color{blue}{x.re \cdot \left(x.im + x.im\right)}, \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im\right) \]
      6. *-commutative50.0%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, x.re \cdot \left(x.im + x.im\right), x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)\right)} \]
    4. Step-by-step derivation
      1. fma-udef46.7%

        \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im + x.im\right)\right) + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)} \]
      2. distribute-lft-in46.7%

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

        \[\leadsto x.re \cdot \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      4. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      5. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      6. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      7. +-inverses0.0%

        \[\leadsto x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      8. flip-+56.7%

        \[\leadsto x.re \cdot \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      9. distribute-lft-in56.7%

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

        \[\leadsto \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      11. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      12. +-inverses0.0%

        \[\leadsto \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      13. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      14. +-inverses0.0%

        \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      15. flip-+73.3%

        \[\leadsto \color{blue}{\left(x.im + x.im\right)} + x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right) \]
      16. difference-of-squares100.0%

        \[\leadsto \left(x.im + x.im\right) + x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)} \]
      17. associate-*r*100.0%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(x.im + x.im\right) + \left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \]
    6. Taylor expanded in x.im around 0 47.2%

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

      \[\leadsto \left(x.im + x.im\right) + \color{blue}{-1 \cdot \left(x.re \cdot {x.im}^{2}\right)} \]
    8. Step-by-step derivation
      1. unpow253.3%

        \[\leadsto \left(x.im + x.im\right) + -1 \cdot \left(x.re \cdot \color{blue}{\left(x.im \cdot x.im\right)}\right) \]
      2. associate-*r*53.3%

        \[\leadsto \left(x.im + x.im\right) + \color{blue}{\left(-1 \cdot x.re\right) \cdot \left(x.im \cdot x.im\right)} \]
      3. mul-1-neg53.3%

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

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

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

Alternative 7: 35.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right) \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* 2.0 (* x.re (* x.re x.im))))
double code(double x_46_re, double x_46_im) {
	return 2.0 * (x_46_re * (x_46_re * x_46_im));
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = 2.0d0 * (x_46re * (x_46re * x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
	return 2.0 * (x_46_re * (x_46_re * x_46_im));
}
def code(x_46_re, x_46_im):
	return 2.0 * (x_46_re * (x_46_re * x_46_im))
function code(x_46_re, x_46_im)
	return Float64(2.0 * Float64(x_46_re * Float64(x_46_re * x_46_im)))
end
function tmp = code(x_46_re, x_46_im)
	tmp = 2.0 * (x_46_re * (x_46_re * x_46_im));
end
code[x$46$re_, x$46$im_] := N[(2.0 * N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. add-cube-cbrt79.3%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow379.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative79.3%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. difference-of-squares80.9%

      \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. associate-*r*87.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  3. Applied egg-rr87.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  4. Taylor expanded in x.im around 0 31.9%

    \[\leadsto \color{blue}{2 \cdot \left({x.re}^{2} \cdot x.im\right)} \]
  5. Step-by-step derivation
    1. *-commutative31.9%

      \[\leadsto 2 \cdot \color{blue}{\left(x.im \cdot {x.re}^{2}\right)} \]
    2. unpow231.9%

      \[\leadsto 2 \cdot \left(x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right) \]
    3. associate-*r*32.9%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
  6. Simplified32.9%

    \[\leadsto \color{blue}{2 \cdot \left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
  7. Final simplification32.9%

    \[\leadsto 2 \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right) \]

Alternative 8: 49.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right) \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* x.im (* (* x.re x.re) 3.0)))
double code(double x_46_re, double x_46_im) {
	return x_46_im * ((x_46_re * x_46_re) * 3.0);
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = x_46im * ((x_46re * x_46re) * 3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
	return x_46_im * ((x_46_re * x_46_re) * 3.0);
}
def code(x_46_re, x_46_im):
	return x_46_im * ((x_46_re * x_46_re) * 3.0)
function code(x_46_re, x_46_im)
	return Float64(x_46_im * Float64(Float64(x_46_re * x_46_re) * 3.0))
end
function tmp = code(x_46_re, x_46_im)
	tmp = x_46_im * ((x_46_re * x_46_re) * 3.0);
end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(N[(x$46$re * x$46$re), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right)
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Taylor expanded in x.re around inf 46.4%

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

    \[\leadsto \color{blue}{\left(x.re \cdot x.re\right)} \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  4. Taylor expanded in x.im around 0 46.4%

    \[\leadsto \color{blue}{\left(2 \cdot {x.re}^{2} + {x.re}^{2}\right) \cdot x.im} \]
  5. Step-by-step derivation
    1. *-commutative46.4%

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

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

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

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

    \[\leadsto \color{blue}{x.im \cdot \left(3 \cdot \left(x.re \cdot x.re\right)\right)} \]
  7. Final simplification46.4%

    \[\leadsto x.im \cdot \left(\left(x.re \cdot x.re\right) \cdot 3\right) \]

Alternative 9: 49.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right) \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* x.im (* x.re (* x.re 3.0))))
double code(double x_46_re, double x_46_im) {
	return x_46_im * (x_46_re * (x_46_re * 3.0));
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = x_46im * (x_46re * (x_46re * 3.0d0))
end function
public static double code(double x_46_re, double x_46_im) {
	return x_46_im * (x_46_re * (x_46_re * 3.0));
}
def code(x_46_re, x_46_im):
	return x_46_im * (x_46_re * (x_46_re * 3.0))
function code(x_46_re, x_46_im)
	return Float64(x_46_im * Float64(x_46_re * Float64(x_46_re * 3.0)))
end
function tmp = code(x_46_re, x_46_im)
	tmp = x_46_im * (x_46_re * (x_46_re * 3.0));
end
code[x$46$re_, x$46$im_] := N[(x$46$im * N[(x$46$re * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. add-cube-cbrt79.3%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow379.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative79.3%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. difference-of-squares80.9%

      \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. associate-*r*87.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  3. Applied egg-rr87.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  4. Step-by-step derivation
    1. unpow387.7%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    2. add-cube-cbrt88.1%

      \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative88.1%

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

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  5. Applied egg-rr88.1%

    \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  6. Step-by-step derivation
    1. *-commutative88.1%

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

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
  7. Applied egg-rr88.1%

    \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
  8. Taylor expanded in x.re around inf 46.4%

    \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
  9. Step-by-step derivation
    1. distribute-rgt1-in46.4%

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

      \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
    3. associate-*r*46.4%

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

      \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
    5. associate-*r*46.4%

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

      \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
    7. *-commutative46.4%

      \[\leadsto x.im \cdot \left(x.re \cdot \color{blue}{\left(3 \cdot x.re\right)}\right) \]
  10. Simplified46.4%

    \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(3 \cdot x.re\right)\right)} \]
  11. Final simplification46.4%

    \[\leadsto x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right) \]

Alternative 10: 55.4% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right) \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.im) (* x.re 3.0)))
double code(double x_46_re, double x_46_im) {
	return (x_46_re * x_46_im) * (x_46_re * 3.0);
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = (x_46re * x_46im) * (x_46re * 3.0d0)
end function
public static double code(double x_46_re, double x_46_im) {
	return (x_46_re * x_46_im) * (x_46_re * 3.0);
}
def code(x_46_re, x_46_im):
	return (x_46_re * x_46_im) * (x_46_re * 3.0)
function code(x_46_re, x_46_im)
	return Float64(Float64(x_46_re * x_46_im) * Float64(x_46_re * 3.0))
end
function tmp = code(x_46_re, x_46_im)
	tmp = (x_46_re * x_46_im) * (x_46_re * 3.0);
end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(x$46$re * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right)
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. add-cube-cbrt79.3%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow379.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative79.3%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. difference-of-squares80.9%

      \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. associate-*r*87.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  3. Applied egg-rr87.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  4. Step-by-step derivation
    1. unpow387.7%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right) \cdot \sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    2. add-cube-cbrt88.1%

      \[\leadsto \color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative88.1%

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

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \color{blue}{\left(x.im + x.re\right)}\right) + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  5. Applied egg-rr88.1%

    \[\leadsto \color{blue}{\left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  6. Step-by-step derivation
    1. *-commutative88.1%

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

      \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
  7. Applied egg-rr88.1%

    \[\leadsto \left(x.re - x.im\right) \cdot \left(x.im \cdot \left(x.im + x.re\right)\right) + \color{blue}{\left(x.re \cdot \left(x.im + x.im\right)\right)} \cdot x.re \]
  8. Taylor expanded in x.re around inf 46.4%

    \[\leadsto \color{blue}{{x.re}^{2} \cdot \left(x.im + 2 \cdot x.im\right)} \]
  9. Step-by-step derivation
    1. distribute-rgt1-in46.4%

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

      \[\leadsto {x.re}^{2} \cdot \left(\color{blue}{3} \cdot x.im\right) \]
    3. associate-*r*46.4%

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

      \[\leadsto \left(\color{blue}{\left(x.re \cdot x.re\right)} \cdot 3\right) \cdot x.im \]
    5. associate-*r*46.4%

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

      \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot \left(x.re \cdot 3\right)\right)} \]
    7. associate-*r*53.3%

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

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

    \[\leadsto \color{blue}{\left(x.im \cdot x.re\right) \cdot \left(3 \cdot x.re\right)} \]
  11. Final simplification53.3%

    \[\leadsto \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot 3\right) \]

Alternative 11: 34.1% accurate, 3.8× speedup?

\[\begin{array}{l} \\ \left(x.re \cdot x.re\right) \cdot x.im \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* (* x.re x.re) x.im))
double code(double x_46_re, double x_46_im) {
	return (x_46_re * x_46_re) * x_46_im;
}
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
end function
public static double code(double x_46_re, double x_46_im) {
	return (x_46_re * x_46_re) * x_46_im;
}
def code(x_46_re, x_46_im):
	return (x_46_re * x_46_re) * x_46_im
function code(x_46_re, x_46_im)
	return Float64(Float64(x_46_re * x_46_re) * x_46_im)
end
function tmp = code(x_46_re, x_46_im)
	tmp = (x_46_re * x_46_re) * x_46_im;
end
code[x$46$re_, x$46$im_] := N[(N[(x$46$re * x$46$re), $MachinePrecision] * x$46$im), $MachinePrecision]
\begin{array}{l}

\\
\left(x.re \cdot x.re\right) \cdot x.im
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. *-commutative79.6%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{x.re \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} \]
    2. *-commutative79.6%

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

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \]
    4. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} \]
    5. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} \]
    6. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \]
    7. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \]
    8. flip-+62.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \color{blue}{\left(x.im + x.im\right)} \]
    9. distribute-lft-in62.0%

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

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \]
    11. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} \]
    12. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} \]
    13. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \]
    14. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \]
    15. flip-+49.4%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\left(x.im + x.im\right)} \]
  3. Applied egg-rr49.4%

    \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\left(x.im + x.im\right)} \]
  4. Taylor expanded in x.re around inf 31.5%

    \[\leadsto \color{blue}{{x.re}^{2} \cdot x.im} \]
  5. Step-by-step derivation
    1. *-commutative31.5%

      \[\leadsto \color{blue}{x.im \cdot {x.re}^{2}} \]
    2. unpow231.5%

      \[\leadsto x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)} \]
  6. Simplified31.5%

    \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot x.re\right)} \]
  7. Final simplification31.5%

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

Alternative 12: 34.9% accurate, 3.8× speedup?

\[\begin{array}{l} \\ x.re \cdot \left(x.re \cdot x.im\right) \end{array} \]
(FPCore (x.re x.im) :precision binary64 (* x.re (* x.re x.im)))
double code(double x_46_re, double x_46_im) {
	return x_46_re * (x_46_re * x_46_im);
}
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)
end function
public static double code(double x_46_re, double x_46_im) {
	return x_46_re * (x_46_re * x_46_im);
}
def code(x_46_re, x_46_im):
	return x_46_re * (x_46_re * x_46_im)
function code(x_46_re, x_46_im)
	return Float64(x_46_re * Float64(x_46_re * x_46_im))
end
function tmp = code(x_46_re, x_46_im)
	tmp = x_46_re * (x_46_re * x_46_im);
end
code[x$46$re_, x$46$im_] := N[(x$46$re * N[(x$46$re * x$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x.re \cdot \left(x.re \cdot x.im\right)
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. *-commutative79.6%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{x.re \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)} \]
    2. *-commutative79.6%

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

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \]
    4. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} \]
    5. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} \]
    6. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \]
    7. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \]
    8. flip-+62.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + x.re \cdot \color{blue}{\left(x.im + x.im\right)} \]
    9. distribute-lft-in62.0%

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

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\frac{\left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right) - \left(x.re \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)}{x.re \cdot x.im - x.re \cdot x.im}} \]
    11. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{\color{blue}{0}}{x.re \cdot x.im - x.re \cdot x.im} \]
    12. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.re \cdot x.im - x.re \cdot x.im} \]
    13. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \]
    14. +-inverses0.0%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \]
    15. flip-+49.4%

      \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\left(x.im + x.im\right)} \]
  3. Applied egg-rr49.4%

    \[\leadsto \left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \color{blue}{\left(x.im + x.im\right)} \]
  4. Taylor expanded in x.re around inf 31.5%

    \[\leadsto \color{blue}{{x.re}^{2} \cdot x.im} \]
  5. Step-by-step derivation
    1. *-commutative31.5%

      \[\leadsto \color{blue}{x.im \cdot {x.re}^{2}} \]
    2. unpow231.5%

      \[\leadsto x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)} \]
    3. associate-*r*32.3%

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

    \[\leadsto \color{blue}{\left(x.im \cdot x.re\right) \cdot x.re} \]
  7. Final simplification32.3%

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

Alternative 13: 3.0% accurate, 6.3× speedup?

\[\begin{array}{l} \\ x.im + x.im \end{array} \]
(FPCore (x.re x.im) :precision binary64 (+ x.im x.im))
double code(double x_46_re, double x_46_im) {
	return x_46_im + x_46_im;
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = x_46im + x_46im
end function
public static double code(double x_46_re, double x_46_im) {
	return x_46_im + x_46_im;
}
def code(x_46_re, x_46_im):
	return x_46_im + x_46_im
function code(x_46_re, x_46_im)
	return Float64(x_46_im + x_46_im)
end
function tmp = code(x_46_re, x_46_im)
	tmp = x_46_im + x_46_im;
end
code[x$46$re_, x$46$im_] := N[(x$46$im + x$46$im), $MachinePrecision]
\begin{array}{l}

\\
x.im + x.im
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. add-cube-cbrt79.3%

      \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right) \cdot \sqrt[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. pow379.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    3. *-commutative79.3%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{x.im \cdot \left(x.re \cdot x.re - x.im \cdot x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    4. difference-of-squares80.9%

      \[\leadsto {\left(\sqrt[3]{x.im \cdot \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
    5. associate-*r*87.8%

      \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}}\right)}^{3} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  3. Applied egg-rr87.8%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x.im \cdot \left(x.re + x.im\right)\right) \cdot \left(x.re - x.im\right)}\right)}^{3}} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re \]
  4. Taylor expanded in x.im around 0 31.9%

    \[\leadsto \color{blue}{2 \cdot \left({x.re}^{2} \cdot x.im\right)} \]
  5. Step-by-step derivation
    1. *-commutative31.9%

      \[\leadsto 2 \cdot \color{blue}{\left(x.im \cdot {x.re}^{2}\right)} \]
    2. unpow231.9%

      \[\leadsto 2 \cdot \left(x.im \cdot \color{blue}{\left(x.re \cdot x.re\right)}\right) \]
    3. associate-*r*32.9%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
  6. Simplified32.9%

    \[\leadsto \color{blue}{2 \cdot \left(\left(x.im \cdot x.re\right) \cdot x.re\right)} \]
  7. Step-by-step derivation
    1. associate-*r*32.9%

      \[\leadsto \color{blue}{\left(2 \cdot \left(x.im \cdot x.re\right)\right) \cdot x.re} \]
    2. count-232.9%

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

      \[\leadsto \color{blue}{\frac{\left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right) - \left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right)}{x.im \cdot x.re - x.im \cdot x.re}} \cdot x.re \]
    4. +-inverses0.0%

      \[\leadsto \frac{\color{blue}{0}}{x.im \cdot x.re - x.im \cdot x.re} \cdot x.re \]
    5. +-inverses0.0%

      \[\leadsto \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.im \cdot x.re - x.im \cdot x.re} \cdot x.re \]
    6. +-inverses0.0%

      \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \cdot x.re \]
    7. +-inverses0.0%

      \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \cdot x.re \]
    8. flip-+20.2%

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

      \[\leadsto \color{blue}{\left(2 \cdot x.im\right)} \cdot x.re \]
    10. associate-*r*20.2%

      \[\leadsto \color{blue}{2 \cdot \left(x.im \cdot x.re\right)} \]
    11. count-220.2%

      \[\leadsto \color{blue}{x.im \cdot x.re + x.im \cdot x.re} \]
    12. flip-+0.0%

      \[\leadsto \color{blue}{\frac{\left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right) - \left(x.im \cdot x.re\right) \cdot \left(x.im \cdot x.re\right)}{x.im \cdot x.re - x.im \cdot x.re}} \]
    13. +-inverses0.0%

      \[\leadsto \frac{\color{blue}{0}}{x.im \cdot x.re - x.im \cdot x.re} \]
    14. +-inverses0.0%

      \[\leadsto \frac{\color{blue}{x.im \cdot x.im - x.im \cdot x.im}}{x.im \cdot x.re - x.im \cdot x.re} \]
    15. +-inverses0.0%

      \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{0}} \]
    16. +-inverses0.0%

      \[\leadsto \frac{x.im \cdot x.im - x.im \cdot x.im}{\color{blue}{x.im - x.im}} \]
    17. flip-+3.0%

      \[\leadsto \color{blue}{x.im + x.im} \]
  8. Applied egg-rr3.0%

    \[\leadsto \color{blue}{x.im + x.im} \]
  9. Final simplification3.0%

    \[\leadsto x.im + x.im \]

Alternative 14: 2.7% accurate, 19.0× speedup?

\[\begin{array}{l} \\ -10 \end{array} \]
(FPCore (x.re x.im) :precision binary64 -10.0)
double code(double x_46_re, double x_46_im) {
	return -10.0;
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = -10.0d0
end function
public static double code(double x_46_re, double x_46_im) {
	return -10.0;
}
def code(x_46_re, x_46_im):
	return -10.0
function code(x_46_re, x_46_im)
	return -10.0
end
function tmp = code(x_46_re, x_46_im)
	tmp = -10.0;
end
code[x$46$re_, x$46$im_] := -10.0
\begin{array}{l}

\\
-10
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. +-commutative79.6%

      \[\leadsto \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} \]
    2. *-commutative79.6%

      \[\leadsto \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)} \]
    3. sub-neg79.6%

      \[\leadsto \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \color{blue}{\left(x.re \cdot x.re + \left(-x.im \cdot x.im\right)\right)} \]
    4. distribute-lft-in78.1%

      \[\leadsto \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + \color{blue}{\left(x.im \cdot \left(x.re \cdot x.re\right) + x.im \cdot \left(-x.im \cdot x.im\right)\right)} \]
    5. associate-+r+78.1%

      \[\leadsto \color{blue}{\left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) + x.im \cdot \left(-x.im \cdot x.im\right)} \]
    6. distribute-rgt-neg-out78.1%

      \[\leadsto \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) + \color{blue}{\left(-x.im \cdot \left(x.im \cdot x.im\right)\right)} \]
    7. unsub-neg78.1%

      \[\leadsto \color{blue}{\left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right)} \]
    8. associate-*r*84.9%

      \[\leadsto \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + \color{blue}{\left(x.im \cdot x.re\right) \cdot x.re}\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    9. distribute-rgt-out84.9%

      \[\leadsto \color{blue}{x.re \cdot \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) + x.im \cdot x.re\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    10. *-commutative84.9%

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

      \[\leadsto x.re \cdot \left(\color{blue}{2 \cdot \left(x.im \cdot x.re\right)} + x.im \cdot x.re\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    12. distribute-lft1-in84.9%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \left(x.im \cdot x.re\right)\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    13. metadata-eval84.9%

      \[\leadsto x.re \cdot \left(\color{blue}{3} \cdot \left(x.im \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    14. *-commutative84.9%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot 3\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    15. *-commutative84.9%

      \[\leadsto x.re \cdot \left(\color{blue}{\left(x.re \cdot x.im\right)} \cdot 3\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    16. associate-*r*85.0%

      \[\leadsto x.re \cdot \color{blue}{\left(x.re \cdot \left(x.im \cdot 3\right)\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    17. cube-unmult85.0%

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

    \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}} \]
  4. Step-by-step derivation
    1. associate-*r*85.0%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(x.re \cdot x.im\right) \cdot 3\right)} - {x.im}^{3} \]
    2. associate-*l*85.0%

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

      \[\leadsto \color{blue}{\frac{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) - {x.im}^{3} \cdot {x.im}^{3}}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3 + {x.im}^{3}}} \]
    4. div-inv25.4%

      \[\leadsto \color{blue}{\left(\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) - {x.im}^{3} \cdot {x.im}^{3}\right) \cdot \frac{1}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3 + {x.im}^{3}}} \]
    5. swap-sqr25.4%

      \[\leadsto \left(\color{blue}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot \left(x.re \cdot \left(x.re \cdot x.im\right)\right)\right) \cdot \left(3 \cdot 3\right)} - {x.im}^{3} \cdot {x.im}^{3}\right) \cdot \frac{1}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3 + {x.im}^{3}} \]
    6. pow225.4%

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

      \[\leadsto \left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot \color{blue}{9} - {x.im}^{3} \cdot {x.im}^{3}\right) \cdot \frac{1}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3 + {x.im}^{3}} \]
    8. pow-prod-up25.4%

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

      \[\leadsto \left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 - {x.im}^{\color{blue}{6}}\right) \cdot \frac{1}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3 + {x.im}^{3}} \]
    10. associate-*l*25.3%

      \[\leadsto \left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 - {x.im}^{6}\right) \cdot \frac{1}{\color{blue}{x.re \cdot \left(\left(x.re \cdot x.im\right) \cdot 3\right)} + {x.im}^{3}} \]
    11. associate-*r*25.3%

      \[\leadsto \left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 - {x.im}^{6}\right) \cdot \frac{1}{x.re \cdot \color{blue}{\left(x.re \cdot \left(x.im \cdot 3\right)\right)} + {x.im}^{3}} \]
    12. fma-def25.3%

      \[\leadsto \left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 - {x.im}^{6}\right) \cdot \frac{1}{\color{blue}{\mathsf{fma}\left(x.re, x.re \cdot \left(x.im \cdot 3\right), {x.im}^{3}\right)}} \]
  5. Applied egg-rr25.3%

    \[\leadsto \color{blue}{\left({\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 - {x.im}^{6}\right) \cdot \frac{1}{\mathsf{fma}\left(x.re, x.re \cdot \left(x.im \cdot 3\right), {x.im}^{3}\right)}} \]
  6. Simplified2.7%

    \[\leadsto \color{blue}{-10} \]
  7. Final simplification2.7%

    \[\leadsto -10 \]

Alternative 15: 2.7% accurate, 19.0× speedup?

\[\begin{array}{l} \\ 0.1 \end{array} \]
(FPCore (x.re x.im) :precision binary64 0.1)
double code(double x_46_re, double x_46_im) {
	return 0.1;
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = 0.1d0
end function
public static double code(double x_46_re, double x_46_im) {
	return 0.1;
}
def code(x_46_re, x_46_im):
	return 0.1
function code(x_46_re, x_46_im)
	return 0.1
end
function tmp = code(x_46_re, x_46_im)
	tmp = 0.1;
end
code[x$46$re_, x$46$im_] := 0.1
\begin{array}{l}

\\
0.1
\end{array}
Derivation
  1. Initial program 79.6%

    \[\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. Step-by-step derivation
    1. +-commutative79.6%

      \[\leadsto \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} \]
    2. *-commutative79.6%

      \[\leadsto \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)} \]
    3. sub-neg79.6%

      \[\leadsto \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \color{blue}{\left(x.re \cdot x.re + \left(-x.im \cdot x.im\right)\right)} \]
    4. distribute-lft-in78.1%

      \[\leadsto \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + \color{blue}{\left(x.im \cdot \left(x.re \cdot x.re\right) + x.im \cdot \left(-x.im \cdot x.im\right)\right)} \]
    5. associate-+r+78.1%

      \[\leadsto \color{blue}{\left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) + x.im \cdot \left(-x.im \cdot x.im\right)} \]
    6. distribute-rgt-neg-out78.1%

      \[\leadsto \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) + \color{blue}{\left(-x.im \cdot \left(x.im \cdot x.im\right)\right)} \]
    7. unsub-neg78.1%

      \[\leadsto \color{blue}{\left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + x.im \cdot \left(x.re \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right)} \]
    8. associate-*r*84.9%

      \[\leadsto \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re + \color{blue}{\left(x.im \cdot x.re\right) \cdot x.re}\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    9. distribute-rgt-out84.9%

      \[\leadsto \color{blue}{x.re \cdot \left(\left(x.re \cdot x.im + x.im \cdot x.re\right) + x.im \cdot x.re\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    10. *-commutative84.9%

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

      \[\leadsto x.re \cdot \left(\color{blue}{2 \cdot \left(x.im \cdot x.re\right)} + x.im \cdot x.re\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    12. distribute-lft1-in84.9%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \left(x.im \cdot x.re\right)\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    13. metadata-eval84.9%

      \[\leadsto x.re \cdot \left(\color{blue}{3} \cdot \left(x.im \cdot x.re\right)\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    14. *-commutative84.9%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(x.im \cdot x.re\right) \cdot 3\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    15. *-commutative84.9%

      \[\leadsto x.re \cdot \left(\color{blue}{\left(x.re \cdot x.im\right)} \cdot 3\right) - x.im \cdot \left(x.im \cdot x.im\right) \]
    16. associate-*r*85.0%

      \[\leadsto x.re \cdot \color{blue}{\left(x.re \cdot \left(x.im \cdot 3\right)\right)} - x.im \cdot \left(x.im \cdot x.im\right) \]
    17. cube-unmult85.0%

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

    \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) - {x.im}^{3}} \]
  4. Step-by-step derivation
    1. sub-neg85.0%

      \[\leadsto \color{blue}{x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right) + \left(-{x.im}^{3}\right)} \]
    2. associate-*r*85.0%

      \[\leadsto x.re \cdot \color{blue}{\left(\left(x.re \cdot x.im\right) \cdot 3\right)} + \left(-{x.im}^{3}\right) \]
    3. associate-*l*85.0%

      \[\leadsto \color{blue}{\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3} + \left(-{x.im}^{3}\right) \]
    4. flip3-+18.9%

      \[\leadsto \color{blue}{\frac{{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)}} \]
    5. associate-*r*17.0%

      \[\leadsto \frac{{\left(\color{blue}{\left(\left(x.re \cdot x.re\right) \cdot x.im\right)} \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
    6. associate-*r*16.9%

      \[\leadsto \frac{{\color{blue}{\left(\left(x.re \cdot x.re\right) \cdot \left(x.im \cdot 3\right)\right)}}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
    7. unpow-prod-down8.8%

      \[\leadsto \frac{\color{blue}{{\left(x.re \cdot x.re\right)}^{3} \cdot {\left(x.im \cdot 3\right)}^{3}} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
    8. pow28.8%

      \[\leadsto \frac{{\color{blue}{\left({x.re}^{2}\right)}}^{3} \cdot {\left(x.im \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
    9. pow-pow8.8%

      \[\leadsto \frac{\color{blue}{{x.re}^{\left(2 \cdot 3\right)}} \cdot {\left(x.im \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
    10. metadata-eval8.8%

      \[\leadsto \frac{{x.re}^{\color{blue}{6}} \cdot {\left(x.im \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{\left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(\left(x.re \cdot \left(x.re \cdot x.im\right)\right) \cdot 3\right) \cdot \left(-{x.im}^{3}\right)\right)} \]
  5. Applied egg-rr8.8%

    \[\leadsto \color{blue}{\frac{{x.re}^{6} \cdot {\left(x.im \cdot 3\right)}^{3} + {\left(-{x.im}^{3}\right)}^{3}}{{\left(x.re \cdot \left(x.re \cdot x.im\right)\right)}^{2} \cdot 9 + \left(\left(-{x.im}^{3}\right) \cdot \left(-{x.im}^{3}\right) - \left(x.re \cdot \left(x.re \cdot \left(x.im \cdot 3\right)\right)\right) \cdot \left(-{x.im}^{3}\right)\right)}} \]
  6. Simplified2.8%

    \[\leadsto \color{blue}{0.1} \]
  7. Final simplification2.8%

    \[\leadsto 0.1 \]

Developer target: 91.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \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) \end{array} \]
(FPCore (x.re x.im)
 :precision binary64
 (+ (* (* x.re x.im) (* 2.0 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im))))
double code(double x_46_re, double x_46_im) {
	return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
real(8) function code(x_46re, x_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    code = ((x_46re * x_46im) * (2.0d0 * x_46re)) + ((x_46im * (x_46re - x_46im)) * (x_46re + x_46im))
end function
public static double code(double x_46_re, double x_46_im) {
	return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
}
def code(x_46_re, x_46_im):
	return ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im))
function code(x_46_re, x_46_im)
	return Float64(Float64(Float64(x_46_re * x_46_im) * Float64(2.0 * x_46_re)) + Float64(Float64(x_46_im * Float64(x_46_re - x_46_im)) * Float64(x_46_re + x_46_im)))
end
function tmp = code(x_46_re, x_46_im)
	tmp = ((x_46_re * x_46_im) * (2.0 * x_46_re)) + ((x_46_im * (x_46_re - x_46_im)) * (x_46_re + x_46_im));
end
code[x$46$re_, x$46$im_] := N[(N[(N[(x$46$re * x$46$im), $MachinePrecision] * N[(2.0 * x$46$re), $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$im * N[(x$46$re - x$46$im), $MachinePrecision]), $MachinePrecision] * N[(x$46$re + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)
\end{array}

Reproduce

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