?

Average Error: 34.0 → 22.9
Time: 41.1s
Precision: binary64
Cost: 53584

?

\[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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(-x.im\right)\\ t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\ t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_4 := e^{t_2 \cdot y.re - t_3}\\ t_5 := t_4 \cdot \sin t_0\\ t_6 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\ \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-175}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-287}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_3} \cdot \sin \left(\log x.im \cdot y.im + t_6\right)\\ \mathbf{elif}\;y.re \leq 1.52 \cdot 10^{-282}:\\ \;\;\;\;e^{t_1 \cdot y.re - t_3} \cdot \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;y.re \leq 3.15 \cdot 10^{-133}:\\ \;\;\;\;t_4 \cdot \sin \left(t_2 \cdot y.im + t_6\right)\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-11}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_5\\ \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 (* y.re (atan2 x.im x.re)))
        (t_1 (log (- x.im)))
        (t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
        (t_3 (* (atan2 x.im x.re) y.im))
        (t_4 (exp (- (* t_2 y.re) t_3)))
        (t_5 (* t_4 (sin t_0)))
        (t_6 (* (atan2 x.im x.re) y.re)))
   (if (<= y.re -2.1e-175)
     t_5
     (if (<= y.re 1.8e-287)
       (* (exp (- (* (log x.im) y.re) t_3)) (sin (+ (* (log x.im) y.im) t_6)))
       (if (<= y.re 1.52e-282)
         (* (exp (- (* t_1 y.re) t_3)) (* y.im t_1))
         (if (<= y.re 3.15e-133)
           (* t_4 (sin (+ (* t_2 y.im) t_6)))
           (if (<= y.re 7.4e-11)
             (* (exp (* (atan2 x.im x.re) (- y.im))) t_0)
             t_5)))))))
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 = y_46_re * atan2(x_46_im, x_46_re);
	double t_1 = log(-x_46_im);
	double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	double t_3 = atan2(x_46_im, x_46_re) * y_46_im;
	double t_4 = exp(((t_2 * y_46_re) - t_3));
	double t_5 = t_4 * sin(t_0);
	double t_6 = atan2(x_46_im, x_46_re) * y_46_re;
	double tmp;
	if (y_46_re <= -2.1e-175) {
		tmp = t_5;
	} else if (y_46_re <= 1.8e-287) {
		tmp = exp(((log(x_46_im) * y_46_re) - t_3)) * sin(((log(x_46_im) * y_46_im) + t_6));
	} else if (y_46_re <= 1.52e-282) {
		tmp = exp(((t_1 * y_46_re) - t_3)) * (y_46_im * t_1);
	} else if (y_46_re <= 3.15e-133) {
		tmp = t_4 * sin(((t_2 * y_46_im) + t_6));
	} else if (y_46_re <= 7.4e-11) {
		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
	} else {
		tmp = t_5;
	}
	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 = y_46re * atan2(x_46im, x_46re)
    t_1 = log(-x_46im)
    t_2 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
    t_3 = atan2(x_46im, x_46re) * y_46im
    t_4 = exp(((t_2 * y_46re) - t_3))
    t_5 = t_4 * sin(t_0)
    t_6 = atan2(x_46im, x_46re) * y_46re
    if (y_46re <= (-2.1d-175)) then
        tmp = t_5
    else if (y_46re <= 1.8d-287) then
        tmp = exp(((log(x_46im) * y_46re) - t_3)) * sin(((log(x_46im) * y_46im) + t_6))
    else if (y_46re <= 1.52d-282) then
        tmp = exp(((t_1 * y_46re) - t_3)) * (y_46im * t_1)
    else if (y_46re <= 3.15d-133) then
        tmp = t_4 * sin(((t_2 * y_46im) + t_6))
    else if (y_46re <= 7.4d-11) then
        tmp = exp((atan2(x_46im, x_46re) * -y_46im)) * t_0
    else
        tmp = t_5
    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 = y_46_re * Math.atan2(x_46_im, x_46_re);
	double t_1 = Math.log(-x_46_im);
	double t_2 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	double t_3 = Math.atan2(x_46_im, x_46_re) * y_46_im;
	double t_4 = Math.exp(((t_2 * y_46_re) - t_3));
	double t_5 = t_4 * Math.sin(t_0);
	double t_6 = Math.atan2(x_46_im, x_46_re) * y_46_re;
	double tmp;
	if (y_46_re <= -2.1e-175) {
		tmp = t_5;
	} else if (y_46_re <= 1.8e-287) {
		tmp = Math.exp(((Math.log(x_46_im) * y_46_re) - t_3)) * Math.sin(((Math.log(x_46_im) * y_46_im) + t_6));
	} else if (y_46_re <= 1.52e-282) {
		tmp = Math.exp(((t_1 * y_46_re) - t_3)) * (y_46_im * t_1);
	} else if (y_46_re <= 3.15e-133) {
		tmp = t_4 * Math.sin(((t_2 * y_46_im) + t_6));
	} else if (y_46_re <= 7.4e-11) {
		tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
	} else {
		tmp = t_5;
	}
	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 = y_46_re * math.atan2(x_46_im, x_46_re)
	t_1 = math.log(-x_46_im)
	t_2 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))
	t_3 = math.atan2(x_46_im, x_46_re) * y_46_im
	t_4 = math.exp(((t_2 * y_46_re) - t_3))
	t_5 = t_4 * math.sin(t_0)
	t_6 = math.atan2(x_46_im, x_46_re) * y_46_re
	tmp = 0
	if y_46_re <= -2.1e-175:
		tmp = t_5
	elif y_46_re <= 1.8e-287:
		tmp = math.exp(((math.log(x_46_im) * y_46_re) - t_3)) * math.sin(((math.log(x_46_im) * y_46_im) + t_6))
	elif y_46_re <= 1.52e-282:
		tmp = math.exp(((t_1 * y_46_re) - t_3)) * (y_46_im * t_1)
	elif y_46_re <= 3.15e-133:
		tmp = t_4 * math.sin(((t_2 * y_46_im) + t_6))
	elif y_46_re <= 7.4e-11:
		tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * t_0
	else:
		tmp = t_5
	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(y_46_re * atan(x_46_im, x_46_re))
	t_1 = log(Float64(-x_46_im))
	t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))
	t_3 = Float64(atan(x_46_im, x_46_re) * y_46_im)
	t_4 = exp(Float64(Float64(t_2 * y_46_re) - t_3))
	t_5 = Float64(t_4 * sin(t_0))
	t_6 = Float64(atan(x_46_im, x_46_re) * y_46_re)
	tmp = 0.0
	if (y_46_re <= -2.1e-175)
		tmp = t_5;
	elseif (y_46_re <= 1.8e-287)
		tmp = Float64(exp(Float64(Float64(log(x_46_im) * y_46_re) - t_3)) * sin(Float64(Float64(log(x_46_im) * y_46_im) + t_6)));
	elseif (y_46_re <= 1.52e-282)
		tmp = Float64(exp(Float64(Float64(t_1 * y_46_re) - t_3)) * Float64(y_46_im * t_1));
	elseif (y_46_re <= 3.15e-133)
		tmp = Float64(t_4 * sin(Float64(Float64(t_2 * y_46_im) + t_6)));
	elseif (y_46_re <= 7.4e-11)
		tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * t_0);
	else
		tmp = t_5;
	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 = y_46_re * atan2(x_46_im, x_46_re);
	t_1 = log(-x_46_im);
	t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
	t_3 = atan2(x_46_im, x_46_re) * y_46_im;
	t_4 = exp(((t_2 * y_46_re) - t_3));
	t_5 = t_4 * sin(t_0);
	t_6 = atan2(x_46_im, x_46_re) * y_46_re;
	tmp = 0.0;
	if (y_46_re <= -2.1e-175)
		tmp = t_5;
	elseif (y_46_re <= 1.8e-287)
		tmp = exp(((log(x_46_im) * y_46_re) - t_3)) * sin(((log(x_46_im) * y_46_im) + t_6));
	elseif (y_46_re <= 1.52e-282)
		tmp = exp(((t_1 * y_46_re) - t_3)) * (y_46_im * t_1);
	elseif (y_46_re <= 3.15e-133)
		tmp = t_4 * sin(((t_2 * y_46_im) + t_6));
	elseif (y_46_re <= 7.4e-11)
		tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * t_0;
	else
		tmp = t_5;
	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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[(-x$46$im)], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $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[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-175], t$95$5, If[LessEqual[y$46$re, 1.8e-287], N[(N[Exp[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(N[Log[x$46$im], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.52e-282], N[(N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - t$95$3), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.15e-133], N[(t$95$4 * N[Sin[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$6), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.4e-11], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], t$95$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)
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(-x.im\right)\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_4 := e^{t_2 \cdot y.re - t_3}\\
t_5 := t_4 \cdot \sin t_0\\
t_6 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-175}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-287}:\\
\;\;\;\;e^{\log x.im \cdot y.re - t_3} \cdot \sin \left(\log x.im \cdot y.im + t_6\right)\\

\mathbf{elif}\;y.re \leq 1.52 \cdot 10^{-282}:\\
\;\;\;\;e^{t_1 \cdot y.re - t_3} \cdot \left(y.im \cdot t_1\right)\\

\mathbf{elif}\;y.re \leq 3.15 \cdot 10^{-133}:\\
\;\;\;\;t_4 \cdot \sin \left(t_2 \cdot y.im + t_6\right)\\

\mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-11}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\

\mathbf{else}:\\
\;\;\;\;t_5\\


\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 y.re < -2.1e-175 or 7.4000000000000003e-11 < y.re

    1. Initial program 33.1

      \[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 13.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 \color{blue}{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \]

    if -2.1e-175 < y.re < 1.8000000000000001e-287

    1. Initial program 34.1

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

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

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

    if 1.8000000000000001e-287 < y.re < 1.52e-282

    1. Initial program 39.1

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

      \[\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(\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. Simplified47.8

      \[\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(\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) \]
      Proof

      [Start]47.8

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

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

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

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

      \[ 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(\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) \]
    4. Taylor expanded in x.im around -inf 45.7

      \[\leadsto e^{\log \left(-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) \]
    5. Simplified45.7

      \[\leadsto e^{\log \left(-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]45.7

      \[ e^{\log \left(-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.json-simplify-2 [=>]45.7

      \[ e^{\log \left(-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.json-simplify-9 [=>]45.7

      \[ e^{\log \left(-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) \]
    6. Taylor expanded in y.re around 0 49.0

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

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

    if 1.52e-282 < y.re < 3.1500000000000001e-133

    1. Initial program 36.3

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

    if 3.1500000000000001e-133 < y.re < 7.4000000000000003e-11

    1. Initial program 35.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 y.im around 0 40.7

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

      \[\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)} \]
    4. Taylor expanded in x.re around 0 41.3

      \[\leadsto e^{\log \color{blue}{x.im} \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) \]
    5. Taylor expanded in y.re around 0 20.5

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

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

      [Start]20.5

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

      rational.json-simplify-8 [=>]20.5

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.1 \cdot 10^{-175}:\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-287}:\\ \;\;\;\;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)\\ \mathbf{elif}\;y.re \leq 1.52 \cdot 10^{-282}:\\ \;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(y.im \cdot \log \left(-x.im\right)\right)\\ \mathbf{elif}\;y.re \leq 3.15 \cdot 10^{-133}:\\ \;\;\;\;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)\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-11}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;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(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error16.3
Cost39880
\[\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\\ \mathbf{if}\;x.im \leq -4.6 \cdot 10^{-52}:\\ \;\;\;\;e^{t_1 \cdot y.re - t_2} \cdot \sin \left(t_1 \cdot y.im + t_0\right)\\ \mathbf{elif}\;x.im \leq 8 \cdot 10^{-13}:\\ \;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot \sin \left(\log x.im \cdot y.im + t_0\right)\\ \end{array} \]
Alternative 2
Error23.1
Cost39752
\[\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 := \log \left(-x.im\right)\\ \mathbf{if}\;y.re \leq -1.1 \cdot 10^{-171}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-287}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_0} \cdot \sin \left(\log x.im \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{elif}\;y.re \leq 3.5 \cdot 10^{-264}:\\ \;\;\;\;e^{t_3 \cdot y.re - t_0} \cdot \left(y.im \cdot t_3\right)\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-11}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error16.4
Cost39752
\[\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\\ \mathbf{if}\;x.im \leq -2.4 \cdot 10^{-52}:\\ \;\;\;\;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 \cdot 10^{-9}:\\ \;\;\;\;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{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot \sin \left(\log x.im \cdot y.im + t_0\right)\\ \end{array} \]
Alternative 4
Error20.6
Cost33480
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := 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 t_0\\ \mathbf{if}\;y.re \leq -4 \cdot 10^{-16}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-11}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error25.0
Cost33360
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(-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 := t_3 \cdot t_0\\ \mathbf{if}\;x.im \leq -2.4 \cdot 10^{+28}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq -1.5 \cdot 10^{-59}:\\ \;\;\;\;t_3 \cdot \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;x.im \leq -7.2 \cdot 10^{-95}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 1.2 \cdot 10^{-307}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot \sin t_0\\ \end{array} \]
Alternative 6
Error24.9
Cost33360
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(-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 := t_3 \cdot t_0\\ \mathbf{if}\;x.im \leq -9.2 \cdot 10^{+23}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq -1.5 \cdot 10^{-59}:\\ \;\;\;\;t_3 \cdot \sin \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;x.im \leq -1.3 \cdot 10^{-95}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 3.5 \cdot 10^{-306}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot \sin t_0\\ \end{array} \]
Alternative 7
Error24.9
Cost33360
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \sin t_0\\ t_2 := \log \left(-x.im\right)\\ t_3 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_4 := e^{t_2 \cdot y.re - t_3}\\ \mathbf{if}\;x.im \leq -9.5 \cdot 10^{+23}:\\ \;\;\;\;t_4 \cdot t_1\\ \mathbf{elif}\;x.im \leq -4.2 \cdot 10^{-60}:\\ \;\;\;\;t_4 \cdot \sin \left(y.im \cdot t_2\right)\\ \mathbf{elif}\;x.im \leq -4.1 \cdot 10^{-95}:\\ \;\;\;\;t_4 \cdot t_0\\ \mathbf{elif}\;x.im \leq 4.1 \cdot 10^{-306}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_3} \cdot t_1\\ \end{array} \]
Alternative 8
Error25.1
Cost27344
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(-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 := t_3 \cdot t_0\\ \mathbf{if}\;x.im \leq -3.9 \cdot 10^{+25}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq -3.3 \cdot 10^{-59}:\\ \;\;\;\;t_3 \cdot \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;x.im \leq -1 \cdot 10^{-94}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 5.5 \cdot 10^{-306}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\left(0 - \left(-1 - \log x.im \cdot y.re\right)\right) - 1\right) - t_2} \cdot t_0\\ \end{array} \]
Alternative 9
Error28.1
Cost27156
\[\begin{array}{l} t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\ t_1 := \log \left(-x.im\right)\\ t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_3 := {x.im}^{y.re} \cdot t_2\\ t_4 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_2\\ \mathbf{if}\;y.re \leq -1.2 \cdot 10^{+179}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq -4 \cdot 10^{+142}:\\ \;\;\;\;e^{\log x.re \cdot y.re - t_0} \cdot t_2\\ \mathbf{elif}\;y.re \leq -1.15 \cdot 10^{+72}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y.re \leq -6.4 \cdot 10^{-236}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-265}:\\ \;\;\;\;e^{t_1 \cdot y.re - t_0} \cdot \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+20}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 10
Error25.1
Cost26960
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := \log \left(-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 := t_3 \cdot t_0\\ \mathbf{if}\;x.im \leq -4.8 \cdot 10^{+25}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq -1.75 \cdot 10^{-59}:\\ \;\;\;\;t_3 \cdot \left(y.im \cdot t_1\right)\\ \mathbf{elif}\;x.im \leq -4.7 \cdot 10^{-96}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;x.im \leq 5.8 \cdot 10^{-308}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;e^{\log x.im \cdot y.re - t_2} \cdot t_0\\ \end{array} \]
Alternative 11
Error27.9
Cost26696
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {x.im}^{y.re} \cdot t_0\\ \mathbf{if}\;y.re \leq -4.2 \cdot 10^{+179}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq -3 \cdot 10^{+140}:\\ \;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot t_0\\ \mathbf{elif}\;y.re \leq -1.3 \cdot 10^{+72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 2 \cdot 10^{+21}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error27.5
Cost20104
\[\begin{array}{l} t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\ t_1 := {x.im}^{y.re} \cdot t_0\\ \mathbf{if}\;y.re \leq -1.05 \cdot 10^{+72}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq 1.05 \cdot 10^{+20}:\\ \;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error42.1
Cost13248
\[{x.im}^{y.re} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \]

Error

Reproduce?

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