
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * 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.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
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
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * 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.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp (- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re)))))
(t_1 (* t_0 (cos (* y.re (atan2 x.im x.re)))))
(t_2 (* y.im (log (hypot x.im x.re)))))
(if (<= y.im -5e+129)
t_1
(if (<= y.im 2.5e+95)
(* t_0 (cos (pow (cbrt t_2) 3.0)))
(if (<= y.im 3.2e+164) (* t_0 (+ 1.0 (* -0.5 (pow t_2 2.0)))) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_1 = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -5e+129) {
tmp = t_1;
} else if (y_46_im <= 2.5e+95) {
tmp = t_0 * cos(pow(cbrt(t_2), 3.0));
} else if (y_46_im <= 3.2e+164) {
tmp = t_0 * (1.0 + (-0.5 * pow(t_2, 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double t_1 = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -5e+129) {
tmp = t_1;
} else if (y_46_im <= 2.5e+95) {
tmp = t_0 * Math.cos(Math.pow(Math.cbrt(t_2), 3.0));
} else if (y_46_im <= 3.2e+164) {
tmp = t_0 * (1.0 + (-0.5 * Math.pow(t_2, 2.0)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_1 = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_2 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -5e+129) tmp = t_1; elseif (y_46_im <= 2.5e+95) tmp = Float64(t_0 * cos((cbrt(t_2) ^ 3.0))); elseif (y_46_im <= 3.2e+164) tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (t_2 ^ 2.0)))); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+129], t$95$1, If[LessEqual[y$46$im, 2.5e+95], N[(t$95$0 * N[Cos[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e+164], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[t$95$2, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_1 := t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+95}:\\
\;\;\;\;t_0 \cdot \cos \left({\left(\sqrt[3]{t_2}\right)}^{3}\right)\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+164}:\\
\;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot {t_2}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -5.0000000000000003e129 or 3.1999999999999998e164 < y.im Initial program 33.8%
Simplified69.4%
Taylor expanded in y.im around 0 80.2%
if -5.0000000000000003e129 < y.im < 2.50000000000000012e95Initial program 40.5%
Simplified80.1%
fma-udef80.1%
hypot-udef40.5%
*-commutative40.5%
add-cube-cbrt43.6%
pow343.0%
hypot-udef82.4%
*-commutative82.4%
fma-udef82.4%
*-commutative82.4%
Applied egg-rr82.4%
Taylor expanded in y.re around 0 24.4%
unpow1/345.5%
+-commutative45.5%
unpow245.5%
unpow245.5%
hypot-def89.9%
hypot-def45.5%
unpow245.5%
unpow245.5%
+-commutative45.5%
unpow245.5%
unpow245.5%
hypot-def89.9%
Simplified89.9%
if 2.50000000000000012e95 < y.im < 3.1999999999999998e164Initial program 42.9%
Simplified57.2%
Taylor expanded in y.im around inf 47.7%
unpow247.7%
unpow247.7%
hypot-def62.0%
Simplified62.0%
Taylor expanded in y.im around 0 76.3%
unpow276.3%
unpow276.3%
unpow276.3%
unpow276.3%
hypot-def76.3%
unpow276.3%
unpow276.3%
hypot-def85.9%
swap-sqr85.9%
unpow185.9%
pow-plus85.9%
metadata-eval85.9%
Simplified85.9%
Final simplification86.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re))))))
(if (or (<= y.im -3.6e+153) (not (<= y.im 3.2e+164)))
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(* t_0 (+ 1.0 (* -0.5 (pow (* y.im (log (hypot x.im x.re))) 2.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164)) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * (1.0 + (-0.5 * pow((y_46_im * log(hypot(x_46_im, x_46_re))), 2.0)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164)) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * (1.0 + (-0.5 * Math.pow((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))), 2.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if (y_46_im <= -3.6e+153) or not (y_46_im <= 3.2e+164): tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * (1.0 + (-0.5 * math.pow((y_46_im * math.log(math.hypot(x_46_im, x_46_re))), 2.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_im <= -3.6e+153) || !(y_46_im <= 3.2e+164)) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if ((y_46_im <= -3.6e+153) || ~((y_46_im <= 3.2e+164))) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_0 * (1.0 + (-0.5 * ((y_46_im * log(hypot(x_46_im, x_46_re))) ^ 2.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -3.6e+153], N[Not[LessEqual[y$46$im, 3.2e+164]], $MachinePrecision]], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -3.6 \cdot 10^{+153} \lor \neg \left(y.im \leq 3.2 \cdot 10^{+164}\right):\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{2}\right)\\
\end{array}
\end{array}
if y.im < -3.6000000000000001e153 or 3.1999999999999998e164 < y.im Initial program 34.3%
Simplified69.2%
Taylor expanded in y.im around 0 81.1%
if -3.6000000000000001e153 < y.im < 3.1999999999999998e164Initial program 40.3%
Simplified77.2%
Taylor expanded in y.im around inf 44.0%
unpow244.0%
unpow244.0%
hypot-def83.6%
Simplified83.6%
Taylor expanded in y.im around 0 49.4%
unpow249.4%
unpow249.4%
unpow249.4%
unpow249.4%
hypot-def49.4%
unpow249.4%
unpow249.4%
hypot-def85.9%
swap-sqr85.9%
unpow185.9%
pow-plus85.9%
metadata-eval85.9%
Simplified85.9%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re))))))
(if (<= y.im 1.02e+165)
(* t_0 (cos (* y.im (log (hypot x.im x.re)))))
(* t_0 (cos (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= 1.02e+165) {
tmp = t_0 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= 1.02e+165) {
tmp = t_0 * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= 1.02e+165: tmp = t_0 * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= 1.02e+165) tmp = Float64(t_0 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= 1.02e+165) tmp = t_0 * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, 1.02e+165], N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq 1.02 \cdot 10^{+165}:\\
\;\;\;\;t_0 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.im < 1.02000000000000003e165Initial program 39.5%
Simplified76.6%
Taylor expanded in y.im around inf 42.6%
unpow242.6%
unpow242.6%
hypot-def82.0%
Simplified82.0%
if 1.02000000000000003e165 < y.im Initial program 34.3%
Simplified65.7%
Taylor expanded in y.im around 0 82.9%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re))))))
(if (<= y.im -2e+26) (* t_0 (cos (* y.re (atan2 x.im x.re)))) t_0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -2e+26) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -2e+26) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -2e+26: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -2e+26) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -2e+26) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -2e+26], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+26}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -2.0000000000000001e26Initial program 36.9%
Simplified70.4%
Taylor expanded in y.im around 0 74.8%
if -2.0000000000000001e26 < y.im Initial program 39.4%
Simplified76.7%
Taylor expanded in y.im around inf 42.5%
unpow242.5%
unpow242.5%
hypot-def82.5%
Simplified82.5%
Taylor expanded in y.im around 0 83.4%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (- (* (log (hypot x.re x.im)) y.re) (* y.im (atan2 x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
}
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.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp(((math.log(math.hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(Float64(log(hypot(x_46_re, x_46_im)) * y_46_re) - Float64(y_46_im * atan(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
\end{array}
Initial program 38.8%
Simplified75.1%
Taylor expanded in y.im around inf 41.5%
unpow241.5%
unpow241.5%
hypot-def79.8%
Simplified79.8%
Taylor expanded in y.im around 0 79.3%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= x.re -5e-310)
(exp (- (* (log (/ -1.0 x.re)) (- y.re)) t_0))
(exp (- (* y.re (log x.re)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -5e-310) {
tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - 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
real(8) :: t_0
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
if (x_46re <= (-5d-310)) then
tmp = exp(((log(((-1.0d0) / x_46re)) * -y_46re) - t_0))
else
tmp = exp(((y_46re * log(x_46re)) - 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) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -5e-310) {
tmp = Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -5e-310: tmp = math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -5e-310) tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -5e-310) tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - t_0)); else tmp = exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5e-310], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 36.9%
Simplified73.8%
Taylor expanded in y.im around inf 41.0%
unpow241.0%
unpow241.0%
hypot-def79.5%
Simplified79.5%
Taylor expanded in y.im around 0 79.5%
Taylor expanded in x.re around -inf 65.8%
mul-1-neg65.8%
*-commutative65.8%
Simplified65.8%
if -4.999999999999985e-310 < x.re Initial program 40.5%
Simplified76.3%
Taylor expanded in y.im around inf 42.0%
unpow242.0%
unpow242.0%
hypot-def80.1%
Simplified80.1%
Taylor expanded in y.im around 0 79.1%
Taylor expanded in x.im around 0 73.9%
*-commutative73.9%
Simplified73.9%
Final simplification70.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= x.im -5e-310)
(exp (- (* (log (/ -1.0 x.im)) (- y.re)) t_0))
(exp (- (* y.re (log x.im)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -5e-310) {
tmp = exp(((log((-1.0 / x_46_im)) * -y_46_re) - t_0));
} else {
tmp = exp(((y_46_re * log(x_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
real(8) :: t_0
real(8) :: tmp
t_0 = y_46im * atan2(x_46im, x_46re)
if (x_46im <= (-5d-310)) then
tmp = exp(((log(((-1.0d0) / x_46im)) * -y_46re) - t_0))
else
tmp = exp(((y_46re * log(x_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) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_im <= -5e-310) {
tmp = Math.exp(((Math.log((-1.0 / x_46_im)) * -y_46_re) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_im <= -5e-310: tmp = math.exp(((math.log((-1.0 / x_46_im)) * -y_46_re) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -5e-310) tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_im)) * Float64(-y_46_re)) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_im <= -5e-310) tmp = exp(((log((-1.0 / x_46_im)) * -y_46_re) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{\log \left(\frac{-1}{x.im}\right) \cdot \left(-y.re\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 34.0%
Simplified70.8%
Taylor expanded in y.im around inf 34.8%
unpow234.8%
unpow234.8%
hypot-def73.9%
Simplified73.9%
Taylor expanded in y.im around 0 78.1%
Taylor expanded in x.im around -inf 69.1%
associate-*r*69.1%
neg-mul-169.1%
Simplified69.1%
if -4.999999999999985e-310 < x.im Initial program 43.7%
Simplified79.6%
Taylor expanded in y.im around inf 48.4%
unpow248.4%
unpow248.4%
hypot-def85.9%
Simplified85.9%
Taylor expanded in x.re around 0 81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.im around 0 76.6%
Final simplification72.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im 2.35e-240) (pow (exp y.im) (- (atan2 x.im x.re))) (exp (- (* y.re (log x.im)) (* y.im (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= 2.35e-240) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re))));
}
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
real(8) :: tmp
if (x_46im <= 2.35d-240) then
tmp = exp(y_46im) ** -atan2(x_46im, x_46re)
else
tmp = exp(((y_46re * log(x_46im)) - (y_46im * atan2(x_46im, x_46re))))
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) {
double tmp;
if (x_46_im <= 2.35e-240) {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= 2.35e-240: tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - (y_46_im * math.atan2(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= 2.35e-240) tmp = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= 2.35e-240) tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); else tmp = exp(((y_46_re * log(x_46_im)) - (y_46_im * atan2(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, 2.35e-240], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2.35 \cdot 10^{-240}:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if x.im < 2.35000000000000006e-240Initial program 35.6%
Simplified72.9%
Taylor expanded in y.im around 0 78.2%
Taylor expanded in y.re around 0 61.5%
associate-*r*61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in y.re around 0 49.3%
distribute-rgt-neg-in49.3%
exp-prod52.7%
Simplified52.7%
if 2.35000000000000006e-240 < x.im Initial program 42.9%
Simplified77.9%
Taylor expanded in y.im around inf 48.2%
unpow248.2%
unpow248.2%
hypot-def85.0%
Simplified85.0%
Taylor expanded in x.re around 0 81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 77.2%
Final simplification63.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (exp y.im) (- (atan2 x.im x.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
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(y_46im) ** -atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}
\end{array}
Initial program 38.8%
Simplified75.1%
Taylor expanded in y.im around 0 78.5%
Taylor expanded in y.re around 0 64.0%
associate-*r*64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in y.re around 0 52.4%
distribute-rgt-neg-in52.4%
exp-prod54.2%
Simplified54.2%
Final simplification54.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
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((atan2(x_46im, x_46re) * -y_46im))
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.atan2(x_46_im, x_46_re) * -y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 38.8%
Simplified75.1%
Taylor expanded in y.im around 0 78.5%
Taylor expanded in y.re around 0 64.0%
associate-*r*64.0%
unpow264.0%
Simplified64.0%
Taylor expanded in y.re around 0 52.4%
distribute-rgt-neg-in52.4%
Simplified52.4%
Final simplification52.4%
herbie shell --seed 2023199
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))