?

Average Error: 32.9 → 16.7
Time: 24.1s
Precision: binary64
Cost: 46600

?

\[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(-x.im\right)\\ t_2 := \sin \left(t_1 \cdot y.im + t_0\right)\\ t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_4 := e^{t_1 \cdot y.re - t_3} \cdot t_2\\ t_5 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_3}\\ t_6 := e^{\log x.im \cdot y.re - t_3}\\ \mathbf{if}\;x.im \leq -3.4 \cdot 10^{+34}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-203}:\\ \;\;\;\;t_5 \cdot t_2\\ \mathbf{elif}\;x.im \leq -2.2 \cdot 10^{-269}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 4 \cdot 10^{-248}:\\ \;\;\;\;t_5 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.im \leq 6.6 \cdot 10^{-173}:\\ \;\;\;\;t_6 \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;t_6 \cdot \sin \left(\log x.im \cdot y.im + t_0\right)\\ \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (*
  (exp
   (-
    (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
    (* (atan2 x.im x.re) y.im)))
  (sin
   (+
    (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im)
    (* (atan2 x.im x.re) y.re)))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (* (atan2 x.im x.re) y.re))
        (t_1 (log (- x.im)))
        (t_2 (sin (+ (* t_1 y.im) t_0)))
        (t_3 (* (atan2 x.im x.re) y.im))
        (t_4 (* (exp (- (* t_1 y.re) t_3)) t_2))
        (t_5
         (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_3)))
        (t_6 (exp (- (* (log x.im) y.re) t_3))))
   (if (<= x.im -3.4e+34)
     t_4
     (if (<= x.im -6.4e-203)
       (* t_5 t_2)
       (if (<= x.im -2.2e-269)
         t_4
         (if (<= x.im 4e-248)
           (* t_5 (* y.re (atan2 x.im x.re)))
           (if (<= x.im 6.6e-173)
             (* t_6 (sin (+ (* (log (- x.re)) y.im) t_0)))
             (* t_6 (sin (+ (* (log x.im) y.im) t_0))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = atan2(x_46_im, x_46_re) * y_46_re;
	double t_1 = log(-x_46_im);
	double t_2 = sin(((t_1 * y_46_im) + t_0));
	double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
	double t_4 = exp(((t_1 * y_46_re) - t_3)) * t_2;
	double t_5 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3));
	double t_6 = exp(((log(x_46_im) * y_46_re) - t_3));
	double tmp;
	if (x_46_im <= -3.4e+34) {
		tmp = t_4;
	} else if (x_46_im <= -6.4e-203) {
		tmp = t_5 * t_2;
	} else if (x_46_im <= -2.2e-269) {
		tmp = t_4;
	} else if (x_46_im <= 4e-248) {
		tmp = t_5 * (y_46_re * atan2(x_46_im, x_46_re));
	} else if (x_46_im <= 6.6e-173) {
		tmp = t_6 * sin(((log(-x_46_re) * y_46_im) + t_0));
	} else {
		tmp = t_6 * sin(((log(x_46_im) * y_46_im) + t_0));
	}
	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 = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
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) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: tmp
    t_0 = atan2(x_46im, x_46re) * y_46re
    t_1 = log(-x_46im)
    t_2 = sin(((t_1 * y_46im) + t_0))
    t_3 = atan2(x_46im, x_46re) * y_46im
    t_4 = exp(((t_1 * y_46re) - t_3)) * t_2
    t_5 = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - t_3))
    t_6 = exp(((log(x_46im) * y_46re) - t_3))
    if (x_46im <= (-3.4d+34)) then
        tmp = t_4
    else if (x_46im <= (-6.4d-203)) then
        tmp = t_5 * t_2
    else if (x_46im <= (-2.2d-269)) then
        tmp = t_4
    else if (x_46im <= 4d-248) then
        tmp = t_5 * (y_46re * atan2(x_46im, x_46re))
    else if (x_46im <= 6.6d-173) then
        tmp = t_6 * sin(((log(-x_46re) * y_46im) + t_0))
    else
        tmp = t_6 * sin(((log(x_46im) * y_46im) + t_0))
    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 Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_re;
	double t_1 = Math.log(-x_46_im);
	double t_2 = Math.sin(((t_1 * y_46_im) + t_0));
	double t_3 = Math.atan2(x_46_im, x_46_re) * y_46_im;
	double t_4 = Math.exp(((t_1 * y_46_re) - t_3)) * t_2;
	double t_5 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3));
	double t_6 = Math.exp(((Math.log(x_46_im) * y_46_re) - t_3));
	double tmp;
	if (x_46_im <= -3.4e+34) {
		tmp = t_4;
	} else if (x_46_im <= -6.4e-203) {
		tmp = t_5 * t_2;
	} else if (x_46_im <= -2.2e-269) {
		tmp = t_4;
	} else if (x_46_im <= 4e-248) {
		tmp = t_5 * (y_46_re * Math.atan2(x_46_im, x_46_re));
	} else if (x_46_im <= 6.6e-173) {
		tmp = t_6 * Math.sin(((Math.log(-x_46_re) * y_46_im) + t_0));
	} else {
		tmp = t_6 * Math.sin(((Math.log(x_46_im) * y_46_im) + t_0));
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = math.atan2(x_46_im, x_46_re) * y_46_re
	t_1 = math.log(-x_46_im)
	t_2 = math.sin(((t_1 * y_46_im) + t_0))
	t_3 = math.atan2(x_46_im, x_46_re) * y_46_im
	t_4 = math.exp(((t_1 * y_46_re) - t_3)) * t_2
	t_5 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3))
	t_6 = math.exp(((math.log(x_46_im) * y_46_re) - t_3))
	tmp = 0
	if x_46_im <= -3.4e+34:
		tmp = t_4
	elif x_46_im <= -6.4e-203:
		tmp = t_5 * t_2
	elif x_46_im <= -2.2e-269:
		tmp = t_4
	elif x_46_im <= 4e-248:
		tmp = t_5 * (y_46_re * math.atan2(x_46_im, x_46_re))
	elif x_46_im <= 6.6e-173:
		tmp = t_6 * math.sin(((math.log(-x_46_re) * y_46_im) + t_0))
	else:
		tmp = t_6 * math.sin(((math.log(x_46_im) * y_46_im) + t_0))
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re))))
end
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(atan(x_46_im, x_46_re) * y_46_re)
	t_1 = log(Float64(-x_46_im))
	t_2 = sin(Float64(Float64(t_1 * y_46_im) + t_0))
	t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im)
	t_4 = Float64(exp(Float64(Float64(t_1 * y_46_re) - t_3)) * t_2)
	t_5 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_3))
	t_6 = exp(Float64(Float64(log(x_46_im) * y_46_re) - t_3))
	tmp = 0.0
	if (x_46_im <= -3.4e+34)
		tmp = t_4;
	elseif (x_46_im <= -6.4e-203)
		tmp = Float64(t_5 * t_2);
	elseif (x_46_im <= -2.2e-269)
		tmp = t_4;
	elseif (x_46_im <= 4e-248)
		tmp = Float64(t_5 * Float64(y_46_re * atan(x_46_im, x_46_re)));
	elseif (x_46_im <= 6.6e-173)
		tmp = Float64(t_6 * sin(Float64(Float64(log(Float64(-x_46_re)) * y_46_im) + t_0)));
	else
		tmp = Float64(t_6 * sin(Float64(Float64(log(x_46_im) * y_46_im) + t_0)));
	end
	return tmp
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = atan2(x_46_im, x_46_re) * y_46_re;
	t_1 = log(-x_46_im);
	t_2 = sin(((t_1 * y_46_im) + t_0));
	t_3 = atan2(x_46_im, x_46_re) * y_46_im;
	t_4 = exp(((t_1 * y_46_re) - t_3)) * t_2;
	t_5 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_3));
	t_6 = exp(((log(x_46_im) * y_46_re) - t_3));
	tmp = 0.0;
	if (x_46_im <= -3.4e+34)
		tmp = t_4;
	elseif (x_46_im <= -6.4e-203)
		tmp = t_5 * t_2;
	elseif (x_46_im <= -2.2e-269)
		tmp = t_4;
	elseif (x_46_im <= 4e-248)
		tmp = t_5 * (y_46_re * atan2(x_46_im, x_46_re));
	elseif (x_46_im <= 6.6e-173)
		tmp = t_6 * sin(((log(-x_46_re) * y_46_im) + t_0));
	else
		tmp = t_6 * sin(((log(x_46_im) * y_46_im) + t_0));
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[(N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[Exp[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -3.4e+34], t$95$4, If[LessEqual[x$46$im, -6.4e-203], N[(t$95$5 * t$95$2), $MachinePrecision], If[LessEqual[x$46$im, -2.2e-269], t$95$4, If[LessEqual[x$46$im, 4e-248], N[(t$95$5 * N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 6.6e-173], N[(t$95$6 * N[Sin[N[(N[(N[Log[(-x$46$re)], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$6 * N[Sin[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := \log \left(-x.im\right)\\
t_2 := \sin \left(t_1 \cdot y.im + t_0\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := e^{t_1 \cdot y.re - t_3} \cdot t_2\\
t_5 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_3}\\
t_6 := e^{\log x.im \cdot y.re - t_3}\\
\mathbf{if}\;x.im \leq -3.4 \cdot 10^{+34}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-203}:\\
\;\;\;\;t_5 \cdot t_2\\

\mathbf{elif}\;x.im \leq -2.2 \cdot 10^{-269}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;x.im \leq 4 \cdot 10^{-248}:\\
\;\;\;\;t_5 \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\

\mathbf{elif}\;x.im \leq 6.6 \cdot 10^{-173}:\\
\;\;\;\;t_6 \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + t_0\right)\\

\mathbf{else}:\\
\;\;\;\;t_6 \cdot \sin \left(\log x.im \cdot y.im + t_0\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 5 regimes
  2. if x.im < -3.3999999999999999e34 or -6.40000000000000001e-203 < x.im < -2.19999999999999984e-269

    1. Initial program 41.2

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in x.im around -inf 26.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-1 \cdot x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Simplified26.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      Proof

      [Start]26.0

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-1 \cdot x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]26.0

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(x.im \cdot -1\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]26.0

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    4. Taylor expanded in x.im around -inf 10.1

      \[\leadsto e^{\log \color{blue}{\left(-1 \cdot x.im\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    5. Simplified10.1

      \[\leadsto e^{\log \color{blue}{\left(-x.im\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      Proof

      [Start]10.1

      \[ e^{\log \left(-1 \cdot x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]10.1

      \[ e^{\log \color{blue}{\left(x.im \cdot -1\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]10.1

      \[ e^{\log \color{blue}{\left(-x.im\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

    if -3.3999999999999999e34 < x.im < -6.40000000000000001e-203

    1. Initial program 20.8

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in x.im around -inf 18.6

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-1 \cdot x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Simplified18.6

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      Proof

      [Start]18.6

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-1 \cdot x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]18.6

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(x.im \cdot -1\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]18.6

      \[ e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.im\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

    if -2.19999999999999984e-269 < x.im < 3.99999999999999992e-248

    1. Initial program 35.9

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in y.im around 0 32.8

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]
    3. Taylor expanded in y.re around 0 32.9

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]

    if 3.99999999999999992e-248 < x.im < 6.6000000000000006e-173

    1. Initial program 33.7

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in x.re around 0 39.4

      \[\leadsto e^{\log \color{blue}{x.im} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Taylor expanded in x.re around -inf 39.4

      \[\leadsto e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    4. Simplified39.4

      \[\leadsto e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
      Proof

      [Start]39.4

      \[ e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-1 \cdot x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]39.4

      \[ e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(x.re \cdot -1\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]39.4

      \[ e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{\left(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]

    if 6.6000000000000006e-173 < x.im

    1. Initial program 32.5

      \[e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    2. Taylor expanded in x.re around 0 34.6

      \[\leadsto e^{\log \color{blue}{x.im} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
    3. Taylor expanded in x.re around 0 13.1

      \[\leadsto e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \color{blue}{x.im} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification16.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.im \leq -3.4 \cdot 10^{+34}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -6.4 \cdot 10^{-203}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq -2.2 \cdot 10^{-269}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;x.im \leq 4 \cdot 10^{-248}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.im \leq 6.6 \cdot 10^{-173}:\\ \;\;\;\;e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log x.im \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \end{array} \]

Alternatives

Alternative 1
Error16.4
Cost106568
\[\begin{array}{l} t_0 := \log \left(-x.im\right)\\ t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_3 := e^{t_1 \cdot y.re - t_2}\\ t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_5 := \sin \left(t_1 \cdot y.im + t_4\right)\\ t_6 := \sin \left(\log x.im \cdot y.im + t_4\right)\\ \mathbf{if}\;x.im \leq -7.2 \cdot 10^{+70}:\\ \;\;\;\;e^{t_0 \cdot y.re - t_2} \cdot \sin \left(t_0 \cdot y.im + t_4\right)\\ \mathbf{elif}\;x.im \leq -2.4 \cdot 10^{-185}:\\ \;\;\;\;t_3 \cdot \left(\left(t_5 \cdot \frac{1}{t_5}\right) \cdot t_5\right)\\ \mathbf{elif}\;x.im \leq -4 \cdot 10^{-310}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.im \leq 5 \cdot 10^{-54}:\\ \;\;\;\;t_3 \cdot t_6\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot t_6\\ \end{array} \]
Alternative 2
Error16.4
Cost53320
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \sin \left(\log x.im \cdot y.im + t_0\right)\\ t_2 := \log \left(-x.im\right)\\ t_3 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_5 := e^{t_3 \cdot y.re - t_4}\\ \mathbf{if}\;x.im \leq -2 \cdot 10^{+70}:\\ \;\;\;\;e^{t_2 \cdot y.re - t_4} \cdot \sin \left(t_2 \cdot y.im + t_0\right)\\ \mathbf{elif}\;x.im \leq -5.8 \cdot 10^{-186}:\\ \;\;\;\;t_5 \cdot \sin \left(t_3 \cdot y.im + t_0\right)\\ \mathbf{elif}\;x.im \leq 2.4 \cdot 10^{-308}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.im \leq 1.05 \cdot 10^{-53}:\\ \;\;\;\;t_5 \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_4} \cdot t_1\\ \end{array} \]
Alternative 3
Error20.6
Cost40212
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := e^{\log x.im \cdot y.re - t_1}\\ t_3 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_1} \cdot t_0\\ t_4 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{if}\;x.im \leq -7 \cdot 10^{+46}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - t_1} \cdot t_0\\ \mathbf{elif}\;x.im \leq -1.45 \cdot 10^{-182}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq -1.66 \cdot 10^{-301}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_0\\ \mathbf{elif}\;x.im \leq 2.05 \cdot 10^{-244}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x.im \leq 7 \cdot 10^{-173}:\\ \;\;\;\;t_2 \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + t_4\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \sin \left(\log x.im \cdot y.im + t_4\right)\\ \end{array} \]
Alternative 4
Error20.2
Cost40016
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_1} \cdot t_0\\ \mathbf{if}\;x.im \leq -1.95 \cdot 10^{+45}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - t_1} \cdot t_0\\ \mathbf{elif}\;x.im \leq -1.9 \cdot 10^{-182}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x.im \leq -3.7 \cdot 10^{-302}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_0\\ \mathbf{elif}\;x.im \leq 1.1 \cdot 10^{-245}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_1} \cdot \sin \left(\log x.im \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \end{array} \]
Alternative 5
Error17.7
Cost39948
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ t_1 := \log \left(-x.im\right)\\ t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_3 := e^{\log x.im \cdot y.re - t_2}\\ \mathbf{if}\;x.im \leq -1.22 \cdot 10^{-269}:\\ \;\;\;\;e^{t_1 \cdot y.re - t_2} \cdot \sin \left(t_1 \cdot y.im + t_0\right)\\ \mathbf{elif}\;x.im \leq 2.3 \cdot 10^{-244}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;x.im \leq 6.6 \cdot 10^{-173}:\\ \;\;\;\;t_3 \cdot \sin \left(\log \left(-x.re\right) \cdot y.im + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;t_3 \cdot \sin \left(\log x.im \cdot y.im + t_0\right)\\ \end{array} \]
Alternative 6
Error20.4
Cost33744
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0} \cdot t_1\\ t_3 := e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_1\\ \mathbf{if}\;y.re \leq -0.0024:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq -4 \cdot 10^{-273}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq 2.35 \cdot 10^{-303}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_0} \cdot \sin \left(y.im \cdot \log x.im\right)\\ \mathbf{elif}\;y.re \leq 0.0112:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error25.7
Cost33032
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;x.im \leq -2.05 \cdot 10^{-181}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - t_1} \cdot t_0\\ \mathbf{elif}\;x.im \leq 1.2 \cdot 10^{-105}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_1} \cdot \sin \left(y.im \cdot \log x.im\right)\\ \end{array} \]
Alternative 8
Error23.7
Cost26628
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ \mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\ \;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - t_1} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.re \cdot y.re - t_1} \cdot t_0\\ \end{array} \]
Alternative 9
Error29.8
Cost26564
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;x.re \leq 10^{-237}:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\ \end{array} \]
Alternative 10
Error27.2
Cost20104
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := t_0 \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -8.6 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 9000000000:\\ \;\;\;\;e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error36.9
Cost19912
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ \mathbf{if}\;y.re \leq -850000000:\\ \;\;\;\;t_0 \cdot {x.im}^{y.re}\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-18}:\\ \;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{else}:\\ \;\;\;\;\sin t_0 \cdot {x.im}^{y.re}\\ \end{array} \]
Alternative 12
Error36.9
Cost13512
\[\begin{array}{l} t_0 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\ \mathbf{if}\;y.re \leq -2200000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-18}:\\ \;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 13
Error51.2
Cost6656
\[\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re \]

Error

Reproduce?

herbie shell --seed 2023090 
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  :precision binary64
  (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))