?

Average Error: 26.2 → 16.1
Time: 27.2s
Precision: binary64
Cost: 7896

?

\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
\[\begin{array}{l} t_0 := x.im \cdot y.re - x.re \cdot y.im\\ t_1 := \left(-\frac{x.re}{y.im}\right) + y.re \cdot \frac{x.im}{{y.im}^{2}}\\ t_2 := y.re \cdot y.re + y.im \cdot y.im\\ \mathbf{if}\;y.im \leq -1.85 \cdot 10^{+124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-25}:\\ \;\;\;\;\frac{t_0}{t_2}\\ \mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-78}:\\ \;\;\;\;\frac{x.im}{y.re} + x.re \cdot \left(-\frac{y.im}{{y.re}^{2}}\right)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+16}:\\ \;\;\;\;\frac{2}{\frac{2}{y.re \cdot x.im - y.im \cdot x.re} \cdot t_2}\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+82}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_2}\\ \mathbf{elif}\;y.im \leq 4.4 \cdot 10^{+140}:\\ \;\;\;\;\frac{1}{t_2} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (- (* x.im y.re) (* x.re y.im)))
        (t_1 (+ (- (/ x.re y.im)) (* y.re (/ x.im (pow y.im 2.0)))))
        (t_2 (+ (* y.re y.re) (* y.im y.im))))
   (if (<= y.im -1.85e+124)
     t_1
     (if (<= y.im -1.7e-25)
       (/ t_0 t_2)
       (if (<= y.im 1.6e-78)
         (+ (/ x.im y.re) (* x.re (- (/ y.im (pow y.re 2.0)))))
         (if (<= y.im 2.35e+16)
           (/ 2.0 (* (/ 2.0 (- (* y.re x.im) (* y.im x.re))) t_2))
           (if (<= y.im 1.5e+82)
             (* x.re (/ y.im (- t_2)))
             (if (<= y.im 4.4e+140) (* (/ 1.0 t_2) t_0) t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
	double t_1 = -(x_46_re / y_46_im) + (y_46_re * (x_46_im / pow(y_46_im, 2.0)));
	double t_2 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
	double tmp;
	if (y_46_im <= -1.85e+124) {
		tmp = t_1;
	} else if (y_46_im <= -1.7e-25) {
		tmp = t_0 / t_2;
	} else if (y_46_im <= 1.6e-78) {
		tmp = (x_46_im / y_46_re) + (x_46_re * -(y_46_im / pow(y_46_re, 2.0)));
	} else if (y_46_im <= 2.35e+16) {
		tmp = 2.0 / ((2.0 / ((y_46_re * x_46_im) - (y_46_im * x_46_re))) * t_2);
	} else if (y_46_im <= 1.5e+82) {
		tmp = x_46_re * (y_46_im / -t_2);
	} else if (y_46_im <= 4.4e+140) {
		tmp = (1.0 / t_2) * t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (x_46im * y_46re) - (x_46re * y_46im)
    t_1 = -(x_46re / y_46im) + (y_46re * (x_46im / (y_46im ** 2.0d0)))
    t_2 = (y_46re * y_46re) + (y_46im * y_46im)
    if (y_46im <= (-1.85d+124)) then
        tmp = t_1
    else if (y_46im <= (-1.7d-25)) then
        tmp = t_0 / t_2
    else if (y_46im <= 1.6d-78) then
        tmp = (x_46im / y_46re) + (x_46re * -(y_46im / (y_46re ** 2.0d0)))
    else if (y_46im <= 2.35d+16) then
        tmp = 2.0d0 / ((2.0d0 / ((y_46re * x_46im) - (y_46im * x_46re))) * t_2)
    else if (y_46im <= 1.5d+82) then
        tmp = x_46re * (y_46im / -t_2)
    else if (y_46im <= 4.4d+140) then
        tmp = (1.0d0 / t_2) * t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
	double t_1 = -(x_46_re / y_46_im) + (y_46_re * (x_46_im / Math.pow(y_46_im, 2.0)));
	double t_2 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
	double tmp;
	if (y_46_im <= -1.85e+124) {
		tmp = t_1;
	} else if (y_46_im <= -1.7e-25) {
		tmp = t_0 / t_2;
	} else if (y_46_im <= 1.6e-78) {
		tmp = (x_46_im / y_46_re) + (x_46_re * -(y_46_im / Math.pow(y_46_re, 2.0)));
	} else if (y_46_im <= 2.35e+16) {
		tmp = 2.0 / ((2.0 / ((y_46_re * x_46_im) - (y_46_im * x_46_re))) * t_2);
	} else if (y_46_im <= 1.5e+82) {
		tmp = x_46_re * (y_46_im / -t_2);
	} else if (y_46_im <= 4.4e+140) {
		tmp = (1.0 / t_2) * t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im)
	t_1 = -(x_46_re / y_46_im) + (y_46_re * (x_46_im / math.pow(y_46_im, 2.0)))
	t_2 = (y_46_re * y_46_re) + (y_46_im * y_46_im)
	tmp = 0
	if y_46_im <= -1.85e+124:
		tmp = t_1
	elif y_46_im <= -1.7e-25:
		tmp = t_0 / t_2
	elif y_46_im <= 1.6e-78:
		tmp = (x_46_im / y_46_re) + (x_46_re * -(y_46_im / math.pow(y_46_re, 2.0)))
	elif y_46_im <= 2.35e+16:
		tmp = 2.0 / ((2.0 / ((y_46_re * x_46_im) - (y_46_im * x_46_re))) * t_2)
	elif y_46_im <= 1.5e+82:
		tmp = x_46_re * (y_46_im / -t_2)
	elif y_46_im <= 4.4e+140:
		tmp = (1.0 / t_2) * t_0
	else:
		tmp = t_1
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
end
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im))
	t_1 = Float64(Float64(-Float64(x_46_re / y_46_im)) + Float64(y_46_re * Float64(x_46_im / (y_46_im ^ 2.0))))
	t_2 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))
	tmp = 0.0
	if (y_46_im <= -1.85e+124)
		tmp = t_1;
	elseif (y_46_im <= -1.7e-25)
		tmp = Float64(t_0 / t_2);
	elseif (y_46_im <= 1.6e-78)
		tmp = Float64(Float64(x_46_im / y_46_re) + Float64(x_46_re * Float64(-Float64(y_46_im / (y_46_re ^ 2.0)))));
	elseif (y_46_im <= 2.35e+16)
		tmp = Float64(2.0 / Float64(Float64(2.0 / Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re))) * t_2));
	elseif (y_46_im <= 1.5e+82)
		tmp = Float64(x_46_re * Float64(y_46_im / Float64(-t_2)));
	elseif (y_46_im <= 4.4e+140)
		tmp = Float64(Float64(1.0 / t_2) * t_0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
	t_1 = -(x_46_re / y_46_im) + (y_46_re * (x_46_im / (y_46_im ^ 2.0)));
	t_2 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
	tmp = 0.0;
	if (y_46_im <= -1.85e+124)
		tmp = t_1;
	elseif (y_46_im <= -1.7e-25)
		tmp = t_0 / t_2;
	elseif (y_46_im <= 1.6e-78)
		tmp = (x_46_im / y_46_re) + (x_46_re * -(y_46_im / (y_46_re ^ 2.0)));
	elseif (y_46_im <= 2.35e+16)
		tmp = 2.0 / ((2.0 / ((y_46_re * x_46_im) - (y_46_im * x_46_re))) * t_2);
	elseif (y_46_im <= 1.5e+82)
		tmp = x_46_re * (y_46_im / -t_2);
	elseif (y_46_im <= 4.4e+140)
		tmp = (1.0 / t_2) * t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x$46$re / y$46$im), $MachinePrecision]) + N[(y$46$re * N[(x$46$im / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.85e+124], t$95$1, If[LessEqual[y$46$im, -1.7e-25], N[(t$95$0 / t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 1.6e-78], N[(N[(x$46$im / y$46$re), $MachinePrecision] + N[(x$46$re * (-N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.35e+16], N[(2.0 / N[(N[(2.0 / N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.5e+82], N[(x$46$re * N[(y$46$im / (-t$95$2)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.4e+140], N[(N[(1.0 / t$95$2), $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]]]]]]
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
t_0 := x.im \cdot y.re - x.re \cdot y.im\\
t_1 := \left(-\frac{x.re}{y.im}\right) + y.re \cdot \frac{x.im}{{y.im}^{2}}\\
t_2 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.im \leq -1.85 \cdot 10^{+124}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-25}:\\
\;\;\;\;\frac{t_0}{t_2}\\

\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-78}:\\
\;\;\;\;\frac{x.im}{y.re} + x.re \cdot \left(-\frac{y.im}{{y.re}^{2}}\right)\\

\mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+16}:\\
\;\;\;\;\frac{2}{\frac{2}{y.re \cdot x.im - y.im \cdot x.re} \cdot t_2}\\

\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+82}:\\
\;\;\;\;x.re \cdot \frac{y.im}{-t_2}\\

\mathbf{elif}\;y.im \leq 4.4 \cdot 10^{+140}:\\
\;\;\;\;\frac{1}{t_2} \cdot t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 6 regimes
  2. if y.im < -1.85000000000000004e124 or 4.3999999999999997e140 < y.im

    1. Initial program 43.1

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around 0 15.4

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{y.re \cdot x.im}{{y.im}^{2}}} \]
    3. Simplified13.9

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

      [Start]15.4

      \[ -1 \cdot \frac{x.re}{y.im} + \frac{y.re \cdot x.im}{{y.im}^{2}} \]

      rational.json-simplify-2 [=>]15.4

      \[ \color{blue}{\frac{x.re}{y.im} \cdot -1} + \frac{y.re \cdot x.im}{{y.im}^{2}} \]

      rational.json-simplify-9 [=>]15.4

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

      rational.json-simplify-2 [<=]15.4

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

      rational.json-simplify-49 [=>]13.9

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

    if -1.85000000000000004e124 < y.im < -1.70000000000000001e-25

    1. Initial program 18.4

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]

    if -1.70000000000000001e-25 < y.im < 1.6e-78

    1. Initial program 19.7

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Taylor expanded in y.re around inf 14.9

      \[\leadsto \color{blue}{\frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
    3. Simplified15.8

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

      [Start]14.9

      \[ \frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}} \]

      rational.json-simplify-2 [=>]14.9

      \[ \frac{x.im}{y.re} + -1 \cdot \frac{\color{blue}{y.im \cdot x.re}}{{y.re}^{2}} \]

      rational.json-simplify-49 [=>]15.8

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

      rational.json-simplify-43 [=>]15.8

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

      rational.json-simplify-9 [=>]15.8

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

    if 1.6e-78 < y.im < 2.35e16

    1. Initial program 11.5

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr11.6

      \[\leadsto \color{blue}{\frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)} \]
    3. Applied egg-rr11.7

      \[\leadsto \color{blue}{\frac{2}{\frac{2}{\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}}}} \]
    4. Applied egg-rr11.7

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

    if 2.35e16 < y.im < 1.49999999999999995e82

    1. Initial program 17.7

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr17.7

      \[\leadsto \color{blue}{\frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)} \]
    3. Taylor expanded in x.im around 0 30.3

      \[\leadsto \frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\left(-1 \cdot \left(x.re \cdot y.im\right)\right)} \]
    4. Simplified30.3

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

      [Start]30.3

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

      rational.json-simplify-43 [=>]30.3

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

      rational.json-simplify-9 [=>]30.3

      \[ \frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \left(x.re \cdot \color{blue}{\left(-y.im\right)}\right) \]
    5. Applied egg-rr26.6

      \[\leadsto \color{blue}{y.im \cdot \frac{-x.re}{y.re \cdot y.re + y.im \cdot y.im} + 0} \]
    6. Simplified25.2

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

      [Start]26.6

      \[ y.im \cdot \frac{-x.re}{y.re \cdot y.re + y.im \cdot y.im} + 0 \]

      rational.json-simplify-4 [=>]26.6

      \[ \color{blue}{y.im \cdot \frac{-x.re}{y.re \cdot y.re + y.im \cdot y.im}} \]

      rational.json-simplify-49 [<=]30.3

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

      rational.json-simplify-2 [<=]30.3

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

      rational.json-simplify-5 [<=]30.3

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

      rational.json-simplify-50 [=>]30.3

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

      rational.json-simplify-10 [=>]30.3

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

      rational.json-simplify-2 [=>]30.3

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

      rational.json-simplify-49 [=>]30.3

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

      rational.json-simplify-12 [<=]30.3

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

      rational.json-simplify-49 [=>]25.2

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

      rational.json-simplify-10 [=>]25.2

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

      rational.json-simplify-47 [=>]25.2

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

      metadata-eval [=>]25.2

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

      rational.json-simplify-7 [=>]25.2

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

    if 1.49999999999999995e82 < y.im < 4.3999999999999997e140

    1. Initial program 22.4

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr22.4

      \[\leadsto \color{blue}{\frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification16.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -1.85 \cdot 10^{+124}:\\ \;\;\;\;\left(-\frac{x.re}{y.im}\right) + y.re \cdot \frac{x.im}{{y.im}^{2}}\\ \mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-25}:\\ \;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-78}:\\ \;\;\;\;\frac{x.im}{y.re} + x.re \cdot \left(-\frac{y.im}{{y.re}^{2}}\right)\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+16}:\\ \;\;\;\;\frac{2}{\frac{2}{y.re \cdot x.im - y.im \cdot x.re} \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.im \leq 1.5 \cdot 10^{+82}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-\left(y.re \cdot y.re + y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.im \leq 4.4 \cdot 10^{+140}:\\ \;\;\;\;\frac{1}{y.re \cdot y.re + y.im \cdot y.im} \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x.re}{y.im}\right) + y.re \cdot \frac{x.im}{{y.im}^{2}}\\ \end{array} \]

Alternatives

Alternative 1
Error16.3
Cost7896
\[\begin{array}{l} t_0 := \left(-\frac{x.re}{y.im}\right) + y.re \cdot \frac{x.im}{{y.im}^{2}}\\ t_1 := y.re \cdot y.re + y.im \cdot y.im\\ \mathbf{if}\;y.im \leq -1.2 \cdot 10^{+116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -8.2 \cdot 10^{-260}:\\ \;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{t_1}\\ \mathbf{elif}\;y.im \leq 10^{-207}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+16}:\\ \;\;\;\;\frac{2}{\frac{2}{y.re \cdot x.im - y.im \cdot x.re} \cdot t_1}\\ \mathbf{elif}\;y.im \leq 6.8 \cdot 10^{+88}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_1}\\ \mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+107}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error16.3
Cost2136
\[\begin{array}{l} t_0 := y.re \cdot x.im - y.im \cdot x.re\\ t_1 := y.re \cdot y.re + y.im \cdot y.im\\ t_2 := -\frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -1.25 \cdot 10^{+152}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq -1.26 \cdot 10^{-259}:\\ \;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{t_1}\\ \mathbf{elif}\;y.im \leq 1.2 \cdot 10^{-212}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 2.1 \cdot 10^{+16}:\\ \;\;\;\;\frac{2}{\frac{2}{t_0} \cdot t_1}\\ \mathbf{elif}\;y.im \leq 3.7 \cdot 10^{+79}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_1}\\ \mathbf{elif}\;y.im \leq 1.1 \cdot 10^{+154}:\\ \;\;\;\;\frac{2}{\frac{2}{\frac{1}{t_1} \cdot t_0}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error16.3
Cost1880
\[\begin{array}{l} t_0 := y.re \cdot y.re + y.im \cdot y.im\\ t_1 := -\frac{x.re}{y.im}\\ t_2 := x.im \cdot y.re - x.re \cdot y.im\\ t_3 := \frac{t_2}{t_0}\\ \mathbf{if}\;y.im \leq -8.6 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -1.26 \cdot 10^{-259}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 9 \cdot 10^{-213}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 70000000000000:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.im \leq 2.6 \cdot 10^{+84}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_0}\\ \mathbf{elif}\;y.im \leq 6.2 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{t_0} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error16.3
Cost1880
\[\begin{array}{l} t_0 := y.re \cdot y.re + y.im \cdot y.im\\ t_1 := -\frac{x.re}{y.im}\\ t_2 := x.im \cdot y.re - x.re \cdot y.im\\ \mathbf{if}\;y.im \leq -4.7 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -4.5 \cdot 10^{-260}:\\ \;\;\;\;\frac{t_2}{t_0}\\ \mathbf{elif}\;y.im \leq 7.5 \cdot 10^{-208}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+16}:\\ \;\;\;\;\frac{2}{\frac{2}{y.re \cdot x.im - y.im \cdot x.re} \cdot t_0}\\ \mathbf{elif}\;y.im \leq 9.2 \cdot 10^{+81}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_0}\\ \mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+154}:\\ \;\;\;\;\frac{1}{t_0} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error16.3
Cost1752
\[\begin{array}{l} t_0 := y.re \cdot y.re + y.im \cdot y.im\\ t_1 := -\frac{x.re}{y.im}\\ t_2 := \frac{x.im \cdot y.re - x.re \cdot y.im}{t_0}\\ \mathbf{if}\;y.im \leq -2 \cdot 10^{+152}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-260}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 2.35 \cdot 10^{-209}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 70000000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+81}:\\ \;\;\;\;x.re \cdot \frac{y.im}{-t_0}\\ \mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error24.4
Cost1364
\[\begin{array}{l} t_0 := \frac{y.re}{y.re \cdot y.re + y.im \cdot y.im} \cdot x.im\\ t_1 := -\frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -5.2 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 1.35 \cdot 10^{-77}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{+16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 7.2 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+153}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error22.6
Cost1364
\[\begin{array}{l} t_0 := y.re \cdot y.re + y.im \cdot y.im\\ t_1 := -\frac{x.re}{y.im}\\ t_2 := x.re \cdot \frac{y.im}{-t_0}\\ \mathbf{if}\;y.im \leq -7.8 \cdot 10^{+127}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{-24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 9 \cdot 10^{-50}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 2.9 \cdot 10^{+86}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+154}:\\ \;\;\;\;\frac{y.re}{t_0} \cdot x.im\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error23.8
Cost784
\[\begin{array}{l} t_0 := -\frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -3.8 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 2.4 \cdot 10^{+88}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+110}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error38.1
Cost192
\[\frac{x.im}{y.re} \]

Error

Reproduce?

herbie shell --seed 2023066 
(FPCore (x.re x.im y.re y.im)
  :name "_divideComplex, imaginary part"
  :precision binary64
  (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))