| Alternative 1 | |
|---|---|
| Error | 18.5 |
| Cost | 46600 |
(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 (* (atan2 x.im x.re) y.re))
(t_2 (* (atan2 x.im x.re) y.im))
(t_3 (exp (- (* (log x.re) y.re) t_2)))
(t_4
(*
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_2))
t_0)))
(if (<= x.re -8.5e-9)
(*
(exp (- (* y.re (log (- x.re))) t_2))
(sin (/ (atan2 x.im x.re) (/ 1.0 y.re))))
(if (<= x.re -4e-180)
t_4
(if (<= x.re -9.5e-270)
(*
(exp (- (* (log (* x.re -1.0)) y.re) t_2))
(sin
(-
(* (atan2 x.im x.re) (- y.re))
(/ (* (atan2 x.im x.re) 2.0) (/ -1.0 y.re)))))
(if (<= x.re 2.65e-219)
(* t_0 (exp (- (* y.im (atan2 x.im x.re)))))
(if (<= x.re 8e-189)
t_4
(if (<= x.re 1.3e-162)
(* t_3 (sin (+ (* (log (- x.im)) y.im) t_1)))
(* t_3 (sin (+ (* (log x.re) y.im) t_1)))))))))))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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = exp(((log(x_46_re) * y_46_re) - t_2));
double t_4 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2)) * t_0;
double tmp;
if (x_46_re <= -8.5e-9) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_2)) * sin((atan2(x_46_im, x_46_re) / (1.0 / y_46_re)));
} else if (x_46_re <= -4e-180) {
tmp = t_4;
} else if (x_46_re <= -9.5e-270) {
tmp = exp(((log((x_46_re * -1.0)) * y_46_re) - t_2)) * sin(((atan2(x_46_im, x_46_re) * -y_46_re) - ((atan2(x_46_im, x_46_re) * 2.0) / (-1.0 / y_46_re))));
} else if (x_46_re <= 2.65e-219) {
tmp = t_0 * exp(-(y_46_im * atan2(x_46_im, x_46_re)));
} else if (x_46_re <= 8e-189) {
tmp = t_4;
} else if (x_46_re <= 1.3e-162) {
tmp = t_3 * sin(((log(-x_46_im) * y_46_im) + t_1));
} else {
tmp = t_3 * sin(((log(x_46_re) * y_46_im) + 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 = 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) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = atan2(x_46im, x_46re) * y_46re
t_2 = atan2(x_46im, x_46re) * y_46im
t_3 = exp(((log(x_46re) * y_46re) - t_2))
t_4 = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - t_2)) * t_0
if (x_46re <= (-8.5d-9)) then
tmp = exp(((y_46re * log(-x_46re)) - t_2)) * sin((atan2(x_46im, x_46re) / (1.0d0 / y_46re)))
else if (x_46re <= (-4d-180)) then
tmp = t_4
else if (x_46re <= (-9.5d-270)) then
tmp = exp(((log((x_46re * (-1.0d0))) * y_46re) - t_2)) * sin(((atan2(x_46im, x_46re) * -y_46re) - ((atan2(x_46im, x_46re) * 2.0d0) / ((-1.0d0) / y_46re))))
else if (x_46re <= 2.65d-219) then
tmp = t_0 * exp(-(y_46im * atan2(x_46im, x_46re)))
else if (x_46re <= 8d-189) then
tmp = t_4
else if (x_46re <= 1.3d-162) then
tmp = t_3 * sin(((log(-x_46im) * y_46im) + t_1))
else
tmp = t_3 * sin(((log(x_46re) * y_46im) + 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 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.atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_3 = Math.exp(((Math.log(x_46_re) * y_46_re) - t_2));
double t_4 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2)) * t_0;
double tmp;
if (x_46_re <= -8.5e-9) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_2)) * Math.sin((Math.atan2(x_46_im, x_46_re) / (1.0 / y_46_re)));
} else if (x_46_re <= -4e-180) {
tmp = t_4;
} else if (x_46_re <= -9.5e-270) {
tmp = Math.exp(((Math.log((x_46_re * -1.0)) * y_46_re) - t_2)) * Math.sin(((Math.atan2(x_46_im, x_46_re) * -y_46_re) - ((Math.atan2(x_46_im, x_46_re) * 2.0) / (-1.0 / y_46_re))));
} else if (x_46_re <= 2.65e-219) {
tmp = t_0 * Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (x_46_re <= 8e-189) {
tmp = t_4;
} else if (x_46_re <= 1.3e-162) {
tmp = t_3 * Math.sin(((Math.log(-x_46_im) * y_46_im) + t_1));
} else {
tmp = t_3 * Math.sin(((Math.log(x_46_re) * y_46_im) + t_1));
}
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.atan2(x_46_im, x_46_re) * y_46_re t_2 = math.atan2(x_46_im, x_46_re) * y_46_im t_3 = math.exp(((math.log(x_46_re) * y_46_re) - t_2)) t_4 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2)) * t_0 tmp = 0 if x_46_re <= -8.5e-9: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_2)) * math.sin((math.atan2(x_46_im, x_46_re) / (1.0 / y_46_re))) elif x_46_re <= -4e-180: tmp = t_4 elif x_46_re <= -9.5e-270: tmp = math.exp(((math.log((x_46_re * -1.0)) * y_46_re) - t_2)) * math.sin(((math.atan2(x_46_im, x_46_re) * -y_46_re) - ((math.atan2(x_46_im, x_46_re) * 2.0) / (-1.0 / y_46_re)))) elif x_46_re <= 2.65e-219: tmp = t_0 * math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re))) elif x_46_re <= 8e-189: tmp = t_4 elif x_46_re <= 1.3e-162: tmp = t_3 * math.sin(((math.log(-x_46_im) * y_46_im) + t_1)) else: tmp = t_3 * math.sin(((math.log(x_46_re) * y_46_im) + t_1)) 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 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_3 = exp(Float64(Float64(log(x_46_re) * y_46_re) - t_2)) t_4 = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_2)) * t_0) tmp = 0.0 if (x_46_re <= -8.5e-9) tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_2)) * sin(Float64(atan(x_46_im, x_46_re) / Float64(1.0 / y_46_re)))); elseif (x_46_re <= -4e-180) tmp = t_4; elseif (x_46_re <= -9.5e-270) tmp = Float64(exp(Float64(Float64(log(Float64(x_46_re * -1.0)) * y_46_re) - t_2)) * sin(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_re)) - Float64(Float64(atan(x_46_im, x_46_re) * 2.0) / Float64(-1.0 / y_46_re))))); elseif (x_46_re <= 2.65e-219) tmp = Float64(t_0 * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))); elseif (x_46_re <= 8e-189) tmp = t_4; elseif (x_46_re <= 1.3e-162) tmp = Float64(t_3 * sin(Float64(Float64(log(Float64(-x_46_im)) * y_46_im) + t_1))); else tmp = Float64(t_3 * sin(Float64(Float64(log(x_46_re) * y_46_im) + t_1))); 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 = atan2(x_46_im, x_46_re) * y_46_re; t_2 = atan2(x_46_im, x_46_re) * y_46_im; t_3 = exp(((log(x_46_re) * y_46_re) - t_2)); t_4 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_2)) * t_0; tmp = 0.0; if (x_46_re <= -8.5e-9) tmp = exp(((y_46_re * log(-x_46_re)) - t_2)) * sin((atan2(x_46_im, x_46_re) / (1.0 / y_46_re))); elseif (x_46_re <= -4e-180) tmp = t_4; elseif (x_46_re <= -9.5e-270) tmp = exp(((log((x_46_re * -1.0)) * y_46_re) - t_2)) * sin(((atan2(x_46_im, x_46_re) * -y_46_re) - ((atan2(x_46_im, x_46_re) * 2.0) / (-1.0 / y_46_re)))); elseif (x_46_re <= 2.65e-219) tmp = t_0 * exp(-(y_46_im * atan2(x_46_im, x_46_re))); elseif (x_46_re <= 8e-189) tmp = t_4; elseif (x_46_re <= 1.3e-162) tmp = t_3 * sin(((log(-x_46_im) * y_46_im) + t_1)); else tmp = t_3 * sin(((log(x_46_re) * y_46_im) + t_1)); 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(N[Log[x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = 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] - t$95$2), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[x$46$re, -8.5e-9], N[(N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, -4e-180], t$95$4, If[LessEqual[x$46$re, -9.5e-270], N[(N[Exp[N[(N[(N[Log[N[(x$46$re * -1.0), $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * 2.0), $MachinePrecision] / N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.65e-219], N[(t$95$0 * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8e-189], t$95$4, If[LessEqual[x$46$re, 1.3e-162], N[(t$95$3 * N[Sin[N[(N[(N[Log[(-x$46$im)], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(N[(N[Log[x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision] + t$95$1), $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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_3 := e^{\log x.re \cdot y.re - t_2}\\
t_4 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_2} \cdot t_0\\
\mathbf{if}\;x.re \leq -8.5 \cdot 10^{-9}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t_2} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)\\
\mathbf{elif}\;x.re \leq -4 \cdot 10^{-180}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x.re \leq -9.5 \cdot 10^{-270}:\\
\;\;\;\;e^{\log \left(x.re \cdot -1\right) \cdot y.re - t_2} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.re\right) - \frac{\tan^{-1}_* \frac{x.im}{x.re} \cdot 2}{\frac{-1}{y.re}}\right)\\
\mathbf{elif}\;x.re \leq 2.65 \cdot 10^{-219}:\\
\;\;\;\;t_0 \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;x.re \leq 8 \cdot 10^{-189}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x.re \leq 1.3 \cdot 10^{-162}:\\
\;\;\;\;t_3 \cdot \sin \left(\log \left(-x.im\right) \cdot y.im + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 \cdot \sin \left(\log x.re \cdot y.im + t_1\right)\\
\end{array}
Results
if x.re < -8.5e-9Initial program 40.0
Taylor expanded in y.im around 0 26.2
Applied egg-rr26.2
Taylor expanded in x.re around -inf 13.1
Simplified13.1
[Start]13.1 | \[ e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
|---|---|
rational.json-simplify-39 [=>]13.1 | \[ e^{\log \color{blue}{\left(x.re \cdot -1\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
Taylor expanded in y.re around 0 13.1
Simplified13.1
[Start]13.1 | \[ e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
|---|---|
rational.json-simplify-39 [=>]13.1 | \[ e^{\color{blue}{y.re \cdot \log \left(-1 \cdot x.re\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
rational.json-simplify-39 [=>]13.1 | \[ e^{y.re \cdot \log \color{blue}{\left(x.re \cdot -1\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
rational.json-simplify-71 [<=]13.1 | \[ e^{y.re \cdot \log \color{blue}{\left(-x.re\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
if -8.5e-9 < x.re < -4.0000000000000001e-180 or 2.6500000000000001e-219 < x.re < 8.00000000000000055e-189Initial program 19.4
Taylor expanded in y.im around 0 19.8
Taylor expanded in y.re around 0 20.1
if -4.0000000000000001e-180 < x.re < -9.5000000000000006e-270Initial program 31.9
Taylor expanded in y.im around 0 23.8
Applied egg-rr23.8
Taylor expanded in x.re around -inf 23.1
Simplified23.1
[Start]23.1 | \[ e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
|---|---|
rational.json-simplify-39 [=>]23.1 | \[ e^{\log \color{blue}{\left(x.re \cdot -1\right)} \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\frac{\tan^{-1}_* \frac{x.im}{x.re}}{\frac{1}{y.re}}\right)
\] |
Applied egg-rr23.2
if -9.5000000000000006e-270 < x.re < 2.6500000000000001e-219Initial program 31.6
Taylor expanded in y.im around 0 24.6
Taylor expanded in x.re around 0 39.1
Taylor expanded in y.re around 0 29.9
Simplified29.9
[Start]29.9 | \[ e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\] |
|---|---|
rational.json-simplify-39 [=>]29.9 | \[ \color{blue}{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}}
\] |
if 8.00000000000000055e-189 < x.re < 1.3e-162Initial program 33.1
Taylor expanded in x.re around inf 38.4
Taylor expanded in x.im around -inf 40.9
Simplified40.9
[Start]40.9 | \[ e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(-1 \cdot x.im + -0.5 \cdot \frac{{x.re}^{2}}{x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\] |
|---|---|
rational.json-simplify-39 [=>]40.9 | \[ e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(\color{blue}{x.im \cdot -1} + -0.5 \cdot \frac{{x.re}^{2}}{x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\] |
rational.json-simplify-18 [=>]40.9 | \[ e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(x.im \cdot -1 + \color{blue}{\frac{-0.5}{\frac{x.im}{{x.re}^{2}}}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\] |
rational.json-simplify-1 [=>]40.9 | \[ e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\log \left(x.im \cdot -1 + \color{blue}{\frac{{x.re}^{2}}{\frac{x.im}{-0.5}}}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\] |
Taylor expanded in x.re around 0 40.9
Simplified40.9
[Start]40.9 | \[ e^{\log x.re \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-39 [=>]40.9 | \[ e^{\log x.re \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-71 [<=]40.9 | \[ e^{\log x.re \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 1.3e-162 < x.re Initial program 36.9
Taylor expanded in x.re around inf 38.5
Taylor expanded in x.re around inf 16.3
Final simplification18.5
| Alternative 1 | |
|---|---|
| Error | 18.5 |
| Cost | 46600 |
| Alternative 2 | |
|---|---|
| Error | 18.8 |
| Cost | 46536 |
| Alternative 3 | |
|---|---|
| Error | 18.5 |
| Cost | 40344 |
| Alternative 4 | |
|---|---|
| Error | 17.3 |
| Cost | 39884 |
| Alternative 5 | |
|---|---|
| Error | 19.0 |
| Cost | 33744 |
| Alternative 6 | |
|---|---|
| Error | 21.7 |
| Cost | 33296 |
| Alternative 7 | |
|---|---|
| Error | 20.2 |
| Cost | 33224 |
| Alternative 8 | |
|---|---|
| Error | 20.1 |
| Cost | 33224 |
| Alternative 9 | |
|---|---|
| Error | 20.1 |
| Cost | 33224 |
| Alternative 10 | |
|---|---|
| Error | 20.2 |
| Cost | 33096 |
| Alternative 11 | |
|---|---|
| Error | 28.4 |
| Cost | 20104 |
| Alternative 12 | |
|---|---|
| Error | 28.4 |
| Cost | 20104 |
| Alternative 13 | |
|---|---|
| Error | 36.5 |
| Cost | 19912 |
| Alternative 14 | |
|---|---|
| Error | 36.5 |
| Cost | 13512 |
| Alternative 15 | |
|---|---|
| Error | 51.0 |
| Cost | 6656 |
herbie shell --seed 2023066
(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)))))