
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 14 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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* 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 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define79.9%
*-commutative79.9%
Simplified79.9%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.0) (not (<= y.re 17500000000.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin
(pow
(cbrt (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
3.0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.0) || !(y_46_re <= 17500000000.0)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin(pow(cbrt(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.0) || !(y_46_re <= 17500000000.0)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin((cbrt(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.0], N[Not[LessEqual[y$46$re, 17500000000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1 \lor \neg \left(y.re \leq 17500000000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left({\left(\sqrt[3]{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -1 or 1.75e10 < y.re Initial program 44.6%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine78.6%
Simplified78.6%
if -1 < y.re < 1.75e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
fma-undefine76.0%
hypot-define40.6%
*-commutative40.6%
add-cube-cbrt42.9%
pow342.0%
fma-define42.0%
hypot-define80.0%
Applied egg-rr80.0%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.35) (not (<= y.re 18000000000.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(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) {
double tmp;
if ((y_46_re <= -1.35) || !(y_46_re <= 18000000000.0)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.35) || !(y_46_re <= 18000000000.0)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.35], N[Not[LessEqual[y$46$re, 18000000000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.35 \lor \neg \left(y.re \leq 18000000000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.3500000000000001 or 1.8e10 < y.re Initial program 44.6%
Taylor expanded in y.re around 0 45.4%
unpow245.4%
unpow245.4%
hypot-undefine78.6%
Simplified78.6%
if -1.3500000000000001 < y.re < 1.8e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin (fma (log (hypot x.re x.im)) y.im t_0))))
(if (<= y.re -1.4)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (fabs t_0)))
(if (<= y.re 20000000000.0)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (pow (hypot x.re x.im) y.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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double tmp;
if (y_46_re <= -1.4) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fabs(t_0));
} else if (y_46_re <= 20000000000.0) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) tmp = 0.0 if (y_46_re <= -1.4) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(abs(t_0))); elseif (y_46_re <= 20000000000.0) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.4], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 20000000000.0], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
\mathbf{if}\;y.re \leq -1.4:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 20000000000:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.3999999999999999Initial program 45.9%
Taylor expanded in y.im around 0 78.5%
add-sqr-sqrt40.6%
fabs-sqr40.6%
add-sqr-sqrt81.2%
*-commutative81.2%
Applied egg-rr81.2%
if -1.3999999999999999 < y.re < 2e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
if 2e10 < y.re Initial program 42.9%
exp-diff30.4%
exp-to-pow30.4%
hypot-define30.4%
*-commutative30.4%
exp-prod30.4%
fma-define30.4%
hypot-define50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.im around 0 64.5%
Final simplification75.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -1.05) (not (<= y.re 17500000000.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(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) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.05) || !(y_46_re <= 17500000000.0)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
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)) tmp = 0.0 if ((y_46_re <= -1.05) || !(y_46_re <= 17500000000.0)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
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]}, If[Or[LessEqual[y$46$re, -1.05], N[Not[LessEqual[y$46$re, 17500000000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.05 \lor \neg \left(y.re \leq 17500000000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.05000000000000004 or 1.75e10 < y.re Initial program 44.6%
Taylor expanded in y.im around 0 70.9%
if -1.05000000000000004 < y.re < 1.75e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Final simplification73.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))))
(if (or (<= y.re -3.1) (not (<= y.re 17500000000.0)))
(* t_0 (pow (hypot x.re x.im) y.re))
(* t_0 (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) {
double t_0 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -3.1) || !(y_46_re <= 17500000000.0)) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_re <= -3.1) || !(y_46_re <= 17500000000.0)) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -3.1], N[Not[LessEqual[y$46$re, 17500000000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{if}\;y.re \leq -3.1 \lor \neg \left(y.re \leq 17500000000\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -3.10000000000000009 or 1.75e10 < y.re Initial program 44.6%
exp-diff32.3%
exp-to-pow32.3%
hypot-define32.3%
*-commutative32.3%
exp-prod31.5%
fma-define31.5%
hypot-define59.2%
*-commutative59.2%
Simplified59.2%
Taylor expanded in y.im around 0 73.3%
if -3.10000000000000009 < y.re < 1.75e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Final simplification74.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.98) (not (<= y.re 17500000000.0)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin
(*
y.im
(+ (log (hypot x.im x.re)) (* y.re (/ (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) {
double tmp;
if ((y_46_re <= -0.98) || !(y_46_re <= 17500000000.0)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.98) || !(y_46_re <= 17500000000.0)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.98) or not (y_46_re <= 17500000000.0): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.98) || !(y_46_re <= 17500000000.0)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.98) || ~((y_46_re <= 17500000000.0))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.98], N[Not[LessEqual[y$46$re, 17500000000.0]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.98 \lor \neg \left(y.re \leq 17500000000\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \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{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if y.re < -0.97999999999999998 or 1.75e10 < y.re Initial program 44.6%
Taylor expanded in y.im around 0 70.9%
if -0.97999999999999998 < y.re < 1.75e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Taylor expanded in y.im around inf 40.6%
unpow240.6%
unpow240.6%
hypot-undefine76.0%
associate-/l*76.0%
Simplified76.0%
Final simplification73.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.35) (not (<= y.re 19000000000.0)))
(* (pow (hypot x.re x.im) y.re) (sin (* y.re (atan2 x.im x.re))))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin
(*
y.im
(+ (log (hypot x.im x.re)) (* y.re (/ (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) {
double tmp;
if ((y_46_re <= -1.35) || !(y_46_re <= 19000000000.0)) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.35) || !(y_46_re <= 19000000000.0)) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) + (y_46_re * (Math.atan2(x_46_im, x_46_re) / y_46_im)))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.35) or not (y_46_re <= 19000000000.0): tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) + (y_46_re * (math.atan2(x_46_im, x_46_re) / y_46_im))))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.35) || !(y_46_re <= 19000000000.0)) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.35) || ~((y_46_re <= 19000000000.0))) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * (log(hypot(x_46_im, x_46_re)) + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im))))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.35], N[Not[LessEqual[y$46$re, 19000000000.0]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.35 \lor \neg \left(y.re \leq 19000000000\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\end{array}
\end{array}
if y.re < -1.3500000000000001 or 1.9e10 < y.re Initial program 44.6%
Taylor expanded in y.im around 0 70.9%
Taylor expanded in y.im around 0 67.1%
+-commutative67.1%
unpow267.1%
unpow267.1%
hypot-undefine67.1%
Simplified67.1%
if -1.3500000000000001 < y.re < 1.9e10Initial program 41.4%
cancel-sign-sub-inv41.4%
fma-define41.4%
hypot-define41.4%
distribute-lft-neg-in41.4%
distribute-rgt-neg-out41.4%
fma-define41.4%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.re around 0 76.0%
neg-mul-176.0%
*-commutative76.0%
distribute-rgt-neg-in76.0%
Simplified76.0%
Taylor expanded in y.im around inf 40.6%
unpow240.6%
unpow240.6%
hypot-undefine76.0%
associate-/l*76.0%
Simplified76.0%
Final simplification71.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin t_0))
(t_2 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -8.2e+183)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (- t_0 (* y.im (log (/ -1.0 x.im))))))
(if (<= x.im -2e-5)
(* t_1 (exp (- (* y.re (log (- x.im))) t_2)))
(if (<= x.im 8.5e-119)
(* (pow (hypot x.re x.im) y.re) t_1)
(* t_1 (exp (- (* y.re (log x.im)) t_2))))))))
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 = sin(t_0);
double t_2 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -8.2e+183) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_0 - (y_46_im * log((-1.0 / x_46_im)))));
} else if (x_46_im <= -2e-5) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_2));
} else if (x_46_im <= 8.5e-119) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_2));
}
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double t_2 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -8.2e+183) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((t_0 - (y_46_im * Math.log((-1.0 / x_46_im)))));
} else if (x_46_im <= -2e-5) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_2));
} else if (x_46_im <= 8.5e-119) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_2));
}
return tmp;
}
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.sin(t_0) t_2 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -8.2e+183: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((t_0 - (y_46_im * math.log((-1.0 / x_46_im))))) elif x_46_im <= -2e-5: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_2)) elif x_46_im <= 8.5e-119: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_1 else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_im)) - t_2)) return tmp
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 = sin(t_0) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -8.2e+183) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(t_0 - Float64(y_46_im * log(Float64(-1.0 / x_46_im)))))); elseif (x_46_im <= -2e-5) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_2))); elseif (x_46_im <= 8.5e-119) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_2))); end return tmp 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 = sin(t_0); t_2 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -8.2e+183) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_0 - (y_46_im * log((-1.0 / x_46_im))))); elseif (x_46_im <= -2e-5) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_2)); elseif (x_46_im <= 8.5e-119) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_1; else tmp = t_1 * exp(((y_46_re * log(x_46_im)) - t_2)); 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$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -8.2e+183], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 - N[(y$46$im * N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, -2e-5], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 8.5e-119], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -8.2 \cdot 10^{+183}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(t\_0 - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\mathbf{elif}\;x.im \leq -2 \cdot 10^{-5}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_2}\\
\mathbf{elif}\;x.im \leq 8.5 \cdot 10^{-119}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.im - t\_2}\\
\end{array}
\end{array}
if x.im < -8.20000000000000029e183Initial program 0.0%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y.re around 0 82.6%
neg-mul-182.6%
*-commutative82.6%
distribute-rgt-neg-in82.6%
Simplified82.6%
Taylor expanded in x.im around -inf 82.6%
+-commutative82.6%
mul-1-neg82.6%
unsub-neg82.6%
Simplified82.6%
if -8.20000000000000029e183 < x.im < -2.00000000000000016e-5Initial program 43.9%
Taylor expanded in y.im around 0 63.9%
Taylor expanded in x.im around -inf 75.3%
mul-1-neg75.3%
Simplified75.3%
if -2.00000000000000016e-5 < x.im < 8.49999999999999977e-119Initial program 50.8%
Taylor expanded in y.im around 0 53.5%
Taylor expanded in y.im around 0 46.4%
+-commutative46.4%
unpow246.4%
unpow246.4%
hypot-undefine47.8%
Simplified47.8%
if 8.49999999999999977e-119 < x.im Initial program 45.4%
Taylor expanded in y.im around 0 62.1%
Taylor expanded in x.re around 0 67.0%
*-commutative67.0%
*-commutative67.0%
Simplified67.0%
Final simplification62.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -0.0006)
(* t_1 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 7.2e-119)
(* (pow (hypot x.re x.im) y.re) t_1)
(* t_1 (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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -0.0006) {
tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 7.2e-119) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_im)) - 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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -0.0006) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 7.2e-119) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * t_1;
} else {
tmp = t_1 * 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 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -0.0006: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 7.2e-119: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * t_1 else: tmp = t_1 * 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(atan(x_46_im, x_46_re) * y_46_im) t_1 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -0.0006) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 7.2e-119) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * t_1); else tmp = Float64(t_1 * 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 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -0.0006) tmp = t_1 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 7.2e-119) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * t_1; else tmp = t_1 * 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -0.0006], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 7.2e-119], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -0.0006:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 7.2 \cdot 10^{-119}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < -5.99999999999999947e-4Initial program 28.1%
Taylor expanded in y.im around 0 49.2%
Taylor expanded in x.im around -inf 69.0%
mul-1-neg69.0%
Simplified69.0%
if -5.99999999999999947e-4 < x.im < 7.2e-119Initial program 50.8%
Taylor expanded in y.im around 0 53.5%
Taylor expanded in y.im around 0 46.4%
+-commutative46.4%
unpow246.4%
unpow246.4%
hypot-undefine47.8%
Simplified47.8%
if 7.2e-119 < x.im Initial program 45.4%
Taylor expanded in y.im around 0 62.1%
Taylor expanded in x.re around 0 67.0%
*-commutative67.0%
*-commutative67.0%
Simplified67.0%
Final simplification60.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.6e+43) (not (<= y.im 2e+82))) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im))))) (* (pow (hypot x.re x.im) y.re) (sin (* 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 tmp;
if ((y_46_im <= -2.6e+43) || !(y_46_im <= 2e+82)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) * sin((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 tmp;
if ((y_46_im <= -2.6e+43) || !(y_46_im <= 2e+82)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) * Math.sin((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): tmp = 0 if (y_46_im <= -2.6e+43) or not (y_46_im <= 2e+82): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) * math.sin((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) tmp = 0.0 if ((y_46_im <= -2.6e+43) || !(y_46_im <= 2e+82)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) * sin(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) tmp = 0.0; if ((y_46_im <= -2.6e+43) || ~((y_46_im <= 2e+82))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); else tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) * sin((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_] := If[Or[LessEqual[y$46$im, -2.6e+43], N[Not[LessEqual[y$46$im, 2e+82]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.6 \cdot 10^{+43} \lor \neg \left(y.im \leq 2 \cdot 10^{+82}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.im < -2.60000000000000021e43 or 1.9999999999999999e82 < y.im Initial program 41.5%
Taylor expanded in y.im around 0 53.7%
Taylor expanded in y.re around 0 56.6%
*-commutative56.6%
distribute-lft-neg-in56.6%
Simplified56.6%
if -2.60000000000000021e43 < y.im < 1.9999999999999999e82Initial program 44.1%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.im around 0 56.0%
+-commutative56.0%
unpow256.0%
unpow256.0%
hypot-undefine62.7%
Simplified62.7%
Final simplification60.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (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 y_46_re * (atan2(x_46_im, x_46_re) * 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 = y_46re * (atan2(x_46im, x_46re) * 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 y_46_re * (Math.atan2(x_46_im, x_46_re) * 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 y_46_re * (math.atan2(x_46_im, x_46_re) * 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 Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * 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 = y_46_re * (atan2(x_46_im, x_46_re) * 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[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)
\end{array}
Initial program 43.0%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 39.4%
*-commutative39.4%
distribute-lft-neg-in39.4%
Simplified39.4%
Final simplification39.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.re (* (atan2 x.im x.re) (- 1.0 (* (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 y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (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 = y_46re * (atan2(x_46im, x_46re) * (1.0d0 - (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 y_46_re * (Math.atan2(x_46_im, x_46_re) * (1.0 - (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 y_46_re * (math.atan2(x_46_im, x_46_re) * (1.0 - (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 Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * (atan2(x_46_im, x_46_re) * (1.0 - (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[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)
\end{array}
Initial program 43.0%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 39.4%
*-commutative39.4%
distribute-lft-neg-in39.4%
Simplified39.4%
Taylor expanded in y.im around 0 16.4%
neg-mul-116.4%
unsub-neg16.4%
*-commutative16.4%
Simplified16.4%
Final simplification16.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_re * 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 = y_46re * 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 y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 43.0%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 39.4%
*-commutative39.4%
distribute-lft-neg-in39.4%
Simplified39.4%
Taylor expanded in y.im around 0 14.7%
Final simplification14.7%
herbie shell --seed 2024055
(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)))))