
(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 15 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 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (fma t_1 y.re (- (* y.im (atan2 x.im x.re)))))))
(if (<= y.im -1.15e+89)
(* t_2 (sin (fabs (fma y.im (log (hypot x.im x.re)) t_0))))
(* t_2 (sin (fma t_1 y.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_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, -(y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.15e+89) {
tmp = t_2 * sin(fabs(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)));
} else {
tmp = t_2 * sin(fma(t_1, y_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_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(fma(t_1, y_46_re, Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -1.15e+89) tmp = Float64(t_2 * sin(abs(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)))); else tmp = Float64(t_2 * sin(fma(t_1, y_46_im, t_0))); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(t$95$1 * y$46$re + (-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.15e+89], N[(t$95$2 * N[Sin[N[Abs[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_1, y.re, -y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{+89}:\\
\;\;\;\;t\_2 \cdot \sin \left(\left|\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right|\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -1.1499999999999999e89Initial program 24.1%
fmm-def24.1%
hypot-define24.1%
distribute-rgt-neg-out24.1%
fma-define24.1%
hypot-define65.8%
*-commutative65.8%
Simplified65.8%
fma-undefine65.8%
hypot-define24.1%
*-commutative24.1%
add-sqr-sqrt12.1%
sqrt-unprod5.2%
pow25.2%
fma-define5.2%
hypot-define14.3%
Applied egg-rr14.3%
unpow214.3%
rem-sqrt-square74.6%
fma-undefine74.6%
hypot-undefine32.8%
unpow232.8%
unpow232.8%
+-commutative32.8%
*-commutative32.8%
*-commutative32.8%
fma-define32.8%
unpow232.8%
unpow232.8%
hypot-undefine74.6%
Simplified74.6%
if -1.1499999999999999e89 < y.im Initial program 36.7%
fmm-def36.7%
hypot-define36.7%
distribute-rgt-neg-out36.7%
fma-define36.7%
hypot-define82.1%
*-commutative82.1%
Simplified82.1%
Final simplification80.4%
(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 (- (* y.im (atan2 x.im x.re)))))
(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, -(y_46_im * atan2(x_46_im, x_46_re)))) * 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(-Float64(y_46_im * atan(x_46_im, x_46_re))))) * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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, -y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\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 33.8%
fmm-def33.8%
hypot-define33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Final simplification78.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (or (<= y.im -2.5e-100) (not (<= y.im 3.4e-119)))
(*
(exp (fma t_0 y.re (- (* y.im (atan2 x.im x.re)))))
(sin (* y.im (log (hypot x.im x.re)))))
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(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 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -2.5e-100) || !(y_46_im <= 3.4e-119)) {
tmp = exp(fma(t_0, y_46_re, -(y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * 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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -2.5e-100) || !(y_46_im <= 3.4e-119)) tmp = Float64(exp(fma(t_0, y_46_re, Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2.5e-100], N[Not[LessEqual[y$46$im, 3.4e-119]], $MachinePrecision]], N[(N[Exp[N[(t$95$0 * y$46$re + (-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $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[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.im \leq -2.5 \cdot 10^{-100} \lor \neg \left(y.im \leq 3.4 \cdot 10^{-119}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, -y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)} \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(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.5e-100 or 3.40000000000000024e-119 < y.im Initial program 31.0%
fmm-def31.0%
hypot-define31.0%
distribute-rgt-neg-out31.0%
fma-define31.0%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around inf 30.0%
unpow230.0%
unpow230.0%
hypot-undefine75.0%
Simplified75.0%
if -2.5e-100 < y.im < 3.40000000000000024e-119Initial program 41.0%
exp-diff41.0%
exp-to-pow41.0%
hypot-define41.0%
*-commutative41.0%
exp-prod41.0%
fma-define41.0%
hypot-define88.9%
*-commutative88.9%
Simplified88.9%
Taylor expanded in y.im around 0 88.9%
Final simplification78.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (- (* y.im (atan2 x.im x.re)))))
(if (<= y.im -8e+36)
(* y.re (* (atan2 x.im x.re) (exp t_1)))
(if (<= y.im 9.2e+57)
(*
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(pow (hypot x.re x.im) y.re))
(* (exp (fma t_0 y.re t_1)) (* y.im (log (hypot 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));
double t_1 = -(y_46_im * atan2(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -8e+36) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(t_1));
} else if (y_46_im <= 9.2e+57) {
tmp = sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = exp(fma(t_0, y_46_re, t_1)) * (y_46_im * log(hypot(x_46_im, x_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(-Float64(y_46_im * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -8e+36) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(t_1))); elseif (y_46_im <= 9.2e+57) tmp = Float64(sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(exp(fma(t_0, y_46_re, t_1)) * Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); end return tmp 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]}, Block[{t$95$1 = (-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[y$46$im, -8e+36], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e+57], N[(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] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$0 * y$46$re + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := -y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -8 \cdot 10^{+36}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{t\_1}\right)\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{+57}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, t\_1\right)} \cdot \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.im < -8.00000000000000034e36Initial program 21.2%
Taylor expanded in y.im around 0 44.5%
Taylor expanded in y.re around 0 62.4%
*-commutative62.4%
*-commutative62.4%
distribute-rgt-neg-in62.4%
Simplified62.4%
if -8.00000000000000034e36 < y.im < 9.1999999999999995e57Initial program 40.3%
exp-diff38.8%
exp-to-pow38.8%
hypot-define38.8%
*-commutative38.8%
exp-prod37.9%
fma-define37.9%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 82.1%
if 9.1999999999999995e57 < y.im Initial program 32.5%
fmm-def32.5%
hypot-define32.5%
distribute-rgt-neg-out32.5%
fma-define32.5%
hypot-define76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in y.im around inf 30.5%
unpow230.5%
unpow230.5%
hypot-undefine72.9%
Simplified72.9%
Taylor expanded in y.im around 0 44.2%
unpow244.2%
unpow244.2%
hypot-undefine70.2%
Simplified70.2%
Final simplification74.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re))))
(if (<= x.im 1.1e+160)
(*
(exp (fma (log (hypot x.re x.im)) y.re (- t_0)))
(* y.im (log (hypot x.im x.re))))
(*
(exp (- (* y.re (log x.im)) t_0))
(sin (+ (* y.re (atan2 x.im x.re)) (* y.im (log x.im))))))))
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 <= 1.1e+160) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, -t_0)) * (y_46_im * log(hypot(x_46_im, x_46_re)));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0)) * sin(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(x_46_im))));
}
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 <= 1.1e+160) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(-t_0))) * Float64(y_46_im * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) * sin(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) + Float64(y_46_im * log(x_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$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$im, 1.1e+160], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + (-t$95$0)), $MachinePrecision]], $MachinePrecision] * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 1.1 \cdot 10^{+160}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, -t\_0\right)} \cdot \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < 1.09999999999999996e160Initial program 38.7%
fmm-def38.7%
hypot-define38.7%
distribute-rgt-neg-out38.7%
fma-define38.7%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around inf 34.9%
unpow234.9%
unpow234.9%
hypot-undefine75.2%
Simplified75.2%
Taylor expanded in y.im around 0 43.1%
unpow243.1%
unpow243.1%
hypot-undefine71.5%
Simplified71.5%
if 1.09999999999999996e160 < x.im Initial program 0.0%
fmm-def0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in x.re around 0 74.9%
Taylor expanded in x.re around 0 74.9%
+-commutative74.9%
neg-mul-174.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.im (log (hypot x.im x.re))))))
(if (<= x.re -2e-310)
(* t_1 (exp (- (- t_0) (* y.re (log (/ -1.0 x.re))))))
(if (or (<= x.re 1.65e-12) (not (<= x.re 8.8e+24)))
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(*
(exp (- (* y.re (log (+ x.re (* (pow x.im 2.0) (/ 0.5 x.re))))) t_0))
(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 t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_1 * exp((-t_0 - (y_46_re * log((-1.0 / x_46_re)))));
} else if ((x_46_re <= 1.65e-12) || !(x_46_re <= 8.8e+24)) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else {
tmp = exp(((y_46_re * log((x_46_re + (pow(x_46_im, 2.0) * (0.5 / x_46_re))))) - t_0)) * 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 t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_1 * Math.exp((-t_0 - (y_46_re * Math.log((-1.0 / x_46_re)))));
} else if ((x_46_re <= 1.65e-12) || !(x_46_re <= 8.8e+24)) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log((x_46_re + (Math.pow(x_46_im, 2.0) * (0.5 / x_46_re))))) - t_0)) * 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): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if x_46_re <= -2e-310: tmp = t_1 * math.exp((-t_0 - (y_46_re * math.log((-1.0 / x_46_re))))) elif (x_46_re <= 1.65e-12) or not (x_46_re <= 8.8e+24): tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = math.exp(((y_46_re * math.log((x_46_re + (math.pow(x_46_im, 2.0) * (0.5 / x_46_re))))) - t_0)) * 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) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (x_46_re <= -2e-310) tmp = Float64(t_1 * exp(Float64(Float64(-t_0) - Float64(y_46_re * log(Float64(-1.0 / x_46_re)))))); elseif ((x_46_re <= 1.65e-12) || !(x_46_re <= 8.8e+24)) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(Float64(x_46_re + Float64((x_46_im ^ 2.0) * Float64(0.5 / x_46_re))))) - t_0)) * 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) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (x_46_re <= -2e-310) tmp = t_1 * exp((-t_0 - (y_46_re * log((-1.0 / x_46_re))))); elseif ((x_46_re <= 1.65e-12) || ~((x_46_re <= 8.8e+24))) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = exp(((y_46_re * log((x_46_re + ((x_46_im ^ 2.0) * (0.5 / x_46_re))))) - t_0)) * 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_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2e-310], N[(t$95$1 * N[Exp[N[((-t$95$0) - N[(y$46$re * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 1.65e-12], N[Not[LessEqual[x$46$re, 8.8e+24]], $MachinePrecision]], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[(x$46$re + N[(N[Power[x$46$im, 2.0], $MachinePrecision] * N[(0.5 / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $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}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot e^{\left(-t\_0\right) - y.re \cdot \log \left(\frac{-1}{x.re}\right)}\\
\mathbf{elif}\;x.re \leq 1.65 \cdot 10^{-12} \lor \neg \left(x.re \leq 8.8 \cdot 10^{+24}\right):\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(x.re + {x.im}^{2} \cdot \frac{0.5}{x.re}\right) - t\_0} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -1.999999999999994e-310Initial program 32.3%
fmm-def32.3%
hypot-define32.3%
distribute-rgt-neg-out32.3%
fma-define32.3%
hypot-define79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around inf 30.2%
unpow230.2%
unpow230.2%
hypot-undefine77.3%
Simplified77.3%
Taylor expanded in x.re around -inf 72.7%
+-commutative72.7%
neg-mul-172.7%
unsub-neg72.7%
mul-1-neg72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -1.999999999999994e-310 < x.re < 1.65e-12 or 8.80000000000000007e24 < x.re Initial program 32.5%
fmm-def32.5%
hypot-define32.5%
distribute-rgt-neg-out32.5%
fma-define32.5%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.im around inf 29.3%
unpow229.3%
unpow229.3%
hypot-undefine71.8%
Simplified71.8%
Taylor expanded in x.im around 0 69.3%
+-commutative69.3%
neg-mul-169.3%
unsub-neg69.3%
Simplified69.3%
if 1.65e-12 < x.re < 8.80000000000000007e24Initial program 69.8%
Taylor expanded in y.im around 0 90.0%
Taylor expanded in x.im around 0 90.2%
*-commutative90.2%
associate-*l/90.2%
associate-*r/90.2%
Simplified90.2%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1
(*
(* y.re (atan2 x.im x.re))
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))))
(if (<= x.re -5.5e-208)
t_1
(if (<= x.re 9e-302)
(* y.re (* (atan2 x.im x.re) (exp (- t_0))))
(if (or (<= x.re 1.35e-12) (not (<= x.re 8.8e+24)))
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (- (* y.re (log x.re)) t_0)))
t_1)))))
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 t_1 = (y_46_re * atan2(x_46_im, x_46_re)) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (x_46_re <= -5.5e-208) {
tmp = t_1;
} else if (x_46_re <= 9e-302) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-t_0));
} else if ((x_46_re <= 1.35e-12) || !(x_46_re <= 8.8e+24)) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_re)) - t_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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (x_46_re <= -5.5e-208) {
tmp = t_1;
} else if (x_46_re <= 9e-302) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp(-t_0));
} else if ((x_46_re <= 1.35e-12) || !(x_46_re <= 8.8e+24)) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = t_1;
}
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) t_1 = (y_46_re * math.atan2(x_46_im, x_46_re)) * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) tmp = 0 if x_46_re <= -5.5e-208: tmp = t_1 elif x_46_re <= 9e-302: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp(-t_0)) elif (x_46_re <= 1.35e-12) or not (x_46_re <= 8.8e+24): tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = t_1 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)) t_1 = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0))) tmp = 0.0 if (x_46_re <= -5.5e-208) tmp = t_1; elseif (x_46_re <= 9e-302) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(-t_0)))); elseif ((x_46_re <= 1.35e-12) || !(x_46_re <= 8.8e+24)) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = t_1; 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); t_1 = (y_46_re * atan2(x_46_im, x_46_re)) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)); tmp = 0.0; if (x_46_re <= -5.5e-208) tmp = t_1; elseif (x_46_re <= 9e-302) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-t_0)); elseif ((x_46_re <= 1.35e-12) || ~((x_46_re <= 8.8e+24))) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * 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] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -5.5e-208], t$95$1, If[LessEqual[x$46$re, 9e-302], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[(-t$95$0)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 1.35e-12], N[Not[LessEqual[x$46$re, 8.8e+24]], $MachinePrecision]], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{if}\;x.re \leq -5.5 \cdot 10^{-208}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x.re \leq 9 \cdot 10^{-302}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-t\_0}\right)\\
\mathbf{elif}\;x.re \leq 1.35 \cdot 10^{-12} \lor \neg \left(x.re \leq 8.8 \cdot 10^{+24}\right):\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x.re < -5.4999999999999997e-208 or 1.3499999999999999e-12 < x.re < 8.80000000000000007e24Initial program 33.6%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.re around 0 57.3%
if -5.4999999999999997e-208 < x.re < 9.00000000000000018e-302Initial program 41.3%
Taylor expanded in y.im around 0 29.1%
Taylor expanded in y.re around 0 51.4%
*-commutative51.4%
*-commutative51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
if 9.00000000000000018e-302 < x.re < 1.3499999999999999e-12 or 8.80000000000000007e24 < x.re Initial program 32.2%
fmm-def32.2%
hypot-define32.2%
distribute-rgt-neg-out32.2%
fma-define32.2%
hypot-define77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y.im around inf 29.8%
unpow229.8%
unpow229.8%
hypot-undefine73.0%
Simplified73.0%
Taylor expanded in x.im around 0 70.5%
+-commutative70.5%
neg-mul-170.5%
unsub-neg70.5%
Simplified70.5%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (sin (* y.im (log (hypot x.im x.re))))))
(if (<= x.re -2e-310)
(* t_1 (exp (- (- t_0) (* y.re (log (/ -1.0 x.re))))))
(if (or (<= x.re 2.7e-12) (not (<= x.re 1.05e+25)))
(* t_1 (exp (- (* y.re (log x.re)) t_0)))
(*
(* y.re (atan2 x.im x.re))
(exp
(- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im 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 t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_1 * exp((-t_0 - (y_46_re * log((-1.0 / x_46_re)))));
} else if ((x_46_re <= 2.7e-12) || !(x_46_re <= 1.05e+25)) {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
} else {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * 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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (x_46_re <= -2e-310) {
tmp = t_1 * Math.exp((-t_0 - (y_46_re * Math.log((-1.0 / x_46_re)))));
} else if ((x_46_re <= 2.7e-12) || !(x_46_re <= 1.05e+25)) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
} else {
tmp = (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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) t_1 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if x_46_re <= -2e-310: tmp = t_1 * math.exp((-t_0 - (y_46_re * math.log((-1.0 / x_46_re))))) elif (x_46_re <= 2.7e-12) or not (x_46_re <= 1.05e+25): tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) else: tmp = (y_46_re * math.atan2(x_46_im, x_46_re)) * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * 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)) t_1 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (x_46_re <= -2e-310) tmp = Float64(t_1 * exp(Float64(Float64(-t_0) - Float64(y_46_re * log(Float64(-1.0 / x_46_re)))))); elseif ((x_46_re <= 2.7e-12) || !(x_46_re <= 1.05e+25)) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); else tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * 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); t_1 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (x_46_re <= -2e-310) tmp = t_1 * exp((-t_0 - (y_46_re * log((-1.0 / x_46_re))))); elseif ((x_46_re <= 2.7e-12) || ~((x_46_re <= 1.05e+25))) tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); else tmp = (y_46_re * atan2(x_46_im, x_46_re)) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * 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]}, Block[{t$95$1 = N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -2e-310], N[(t$95$1 * N[Exp[N[((-t$95$0) - N[(y$46$re * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x$46$re, 2.7e-12], N[Not[LessEqual[x$46$re, 1.05e+25]], $MachinePrecision]], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * 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] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;x.re \leq -2 \cdot 10^{-310}:\\
\;\;\;\;t\_1 \cdot e^{\left(-t\_0\right) - y.re \cdot \log \left(\frac{-1}{x.re}\right)}\\
\mathbf{elif}\;x.re \leq 2.7 \cdot 10^{-12} \lor \neg \left(x.re \leq 1.05 \cdot 10^{+25}\right):\\
\;\;\;\;t\_1 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\end{array}
\end{array}
if x.re < -1.999999999999994e-310Initial program 32.3%
fmm-def32.3%
hypot-define32.3%
distribute-rgt-neg-out32.3%
fma-define32.3%
hypot-define79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around inf 30.2%
unpow230.2%
unpow230.2%
hypot-undefine77.3%
Simplified77.3%
Taylor expanded in x.re around -inf 72.7%
+-commutative72.7%
neg-mul-172.7%
unsub-neg72.7%
mul-1-neg72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
if -1.999999999999994e-310 < x.re < 2.6999999999999998e-12 or 1.05e25 < x.re Initial program 32.5%
fmm-def32.5%
hypot-define32.5%
distribute-rgt-neg-out32.5%
fma-define32.5%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
Taylor expanded in y.im around inf 29.3%
unpow229.3%
unpow229.3%
hypot-undefine71.8%
Simplified71.8%
Taylor expanded in x.im around 0 69.3%
+-commutative69.3%
neg-mul-169.3%
unsub-neg69.3%
Simplified69.3%
if 2.6999999999999998e-12 < x.re < 1.05e25Initial program 69.8%
Taylor expanded in y.im around 0 90.0%
Taylor expanded in y.re around 0 90.0%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.2e+39)
(* y.re (* (atan2 x.im x.re) (exp (- (* y.im (atan2 x.im x.re))))))
(if (<= y.im 2.2e+58)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(* y.re (* (atan2 x.im x.re) (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) {
double tmp;
if (y_46_im <= -1.2e+39) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 2.2e+58) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * pow(exp(y_46_im), -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 <= -1.2e+39) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (y_46_im <= 2.2e+58) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.pow(Math.exp(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 y_46_im <= -1.2e+39: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re)))) elif y_46_im <= 2.2e+58: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.pow(math.exp(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 (y_46_im <= -1.2e+39) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))))); elseif (y_46_im <= 2.2e+58) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * (exp(y_46_im) ^ Float64(-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 <= -1.2e+39) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re)))); elseif (y_46_im <= 2.2e+58) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * (exp(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[y$46$im, -1.2e+39], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+58], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+39}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+58}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\end{array}
\end{array}
if y.im < -1.2e39Initial program 21.2%
Taylor expanded in y.im around 0 44.5%
Taylor expanded in y.re around 0 62.4%
*-commutative62.4%
*-commutative62.4%
distribute-rgt-neg-in62.4%
Simplified62.4%
if -1.2e39 < y.im < 2.2000000000000001e58Initial program 40.3%
Taylor expanded in y.im around 0 44.3%
Taylor expanded in y.im around 0 43.6%
unpow243.6%
unpow243.6%
hypot-undefine48.7%
Simplified48.7%
if 2.2000000000000001e58 < y.im Initial program 32.5%
Taylor expanded in y.im around 0 50.5%
Taylor expanded in y.re around 0 60.5%
*-commutative60.5%
*-commutative60.5%
distribute-rgt-neg-in60.5%
Simplified60.5%
Taylor expanded in y.re around 0 60.5%
*-commutative60.5%
neg-mul-160.5%
distribute-rgt-neg-in60.5%
mul-1-neg60.5%
exp-prod62.4%
mul-1-neg62.4%
Simplified62.4%
Final simplification54.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -9e+37) (not (<= y.im 8e+57))) (* y.re (* (atan2 x.im x.re) (exp (- (* y.im (atan2 x.im x.re)))))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot 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 tmp;
if ((y_46_im <= -9e+37) || !(y_46_im <= 8e+57)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_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 <= -9e+37) || !(y_46_im <= 8e+57)) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -9e+37) or not (y_46_im <= 8e+57): tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_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 <= -9e+37) || !(y_46_im <= 8e+57)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))))); else tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_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 <= -9e+37) || ~((y_46_im <= 8e+57))) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re)))); else tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_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, -9e+37], N[Not[LessEqual[y$46$im, 8e+57]], $MachinePrecision]], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{+37} \lor \neg \left(y.im \leq 8 \cdot 10^{+57}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -8.99999999999999923e37 or 8.00000000000000039e57 < y.im Initial program 26.1%
Taylor expanded in y.im around 0 47.1%
Taylor expanded in y.re around 0 61.6%
*-commutative61.6%
*-commutative61.6%
distribute-rgt-neg-in61.6%
Simplified61.6%
if -8.99999999999999923e37 < y.im < 8.00000000000000039e57Initial program 40.3%
Taylor expanded in y.im around 0 44.3%
Taylor expanded in y.im around 0 43.6%
unpow243.6%
unpow243.6%
hypot-undefine48.7%
Simplified48.7%
Final simplification54.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -720000000000.0) (not (<= y.im 25000000000.0)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -720000000000.0) || !(y_46_im <= 25000000000.0)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(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.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -720000000000.0) || !(y_46_im <= 25000000000.0)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -720000000000.0) or not (y_46_im <= 25000000000.0): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -720000000000.0) || !(y_46_im <= 25000000000.0)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -720000000000.0], N[Not[LessEqual[y$46$im, 25000000000.0]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -720000000000 \lor \neg \left(y.im \leq 25000000000\right):\\
\;\;\;\;\log \left(1 + t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t\_0\right)\\
\end{array}
\end{array}
if y.im < -7.2e11 or 2.5e10 < y.im Initial program 27.6%
Taylor expanded in y.im around 0 47.0%
Taylor expanded in y.re around 0 56.3%
*-commutative56.3%
*-commutative56.3%
distribute-rgt-neg-in56.3%
Simplified56.3%
Taylor expanded in y.im around 0 4.9%
log1p-expm1-u14.3%
log1p-undefine30.5%
Applied egg-rr30.5%
if -7.2e11 < y.im < 2.5e10Initial program 40.1%
Taylor expanded in y.im around 0 44.0%
Taylor expanded in y.re around 0 15.9%
*-commutative15.9%
*-commutative15.9%
distribute-rgt-neg-in15.9%
Simplified15.9%
Taylor expanded in y.im around 0 15.2%
log1p-expm1-u21.0%
Applied egg-rr21.0%
Final simplification25.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -4.5e+46) (not (<= y.im 26000000000.0)))
(cbrt (pow t_0 3.0))
(log1p (expm1 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_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -4.5e+46) || !(y_46_im <= 26000000000.0)) {
tmp = cbrt(pow(t_0, 3.0));
} else {
tmp = log1p(expm1(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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -4.5e+46) || !(y_46_im <= 26000000000.0)) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else {
tmp = Math.log1p(Math.expm1(t_0));
}
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_im <= -4.5e+46) || !(y_46_im <= 26000000000.0)) tmp = cbrt((t_0 ^ 3.0)); else tmp = log1p(expm1(t_0)); 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$im, -4.5e+46], N[Not[LessEqual[y$46$im, 26000000000.0]], $MachinePrecision]], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{+46} \lor \neg \left(y.im \leq 26000000000\right):\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -4.5000000000000001e46 or 2.6e10 < y.im Initial program 27.4%
Taylor expanded in y.im around 0 48.1%
Taylor expanded in y.re around 0 57.8%
*-commutative57.8%
*-commutative57.8%
distribute-rgt-neg-in57.8%
Simplified57.8%
Taylor expanded in y.im around 0 5.1%
add-cbrt-cube23.5%
pow323.5%
Applied egg-rr23.5%
if -4.5000000000000001e46 < y.im < 2.6e10Initial program 39.7%
Taylor expanded in y.im around 0 43.2%
Taylor expanded in y.re around 0 16.6%
*-commutative16.6%
*-commutative16.6%
distribute-rgt-neg-in16.6%
Simplified16.6%
Taylor expanded in y.im around 0 14.5%
log1p-expm1-u20.7%
Applied egg-rr20.7%
Final simplification22.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 1.8e+203) (* y.re (* (atan2 x.im x.re) (exp (- (* y.im (atan2 x.im x.re)))))) (sqrt (pow (* y.re (atan2 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 tmp;
if (y_46_re <= 1.8e+203) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = sqrt(pow((y_46_re * atan2(x_46_im, x_46_re)), 2.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) :: tmp
if (y_46re <= 1.8d+203) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp(-(y_46im * atan2(x_46im, x_46re))))
else
tmp = sqrt(((y_46re * atan2(x_46im, x_46re)) ** 2.0d0))
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 (y_46_re <= 1.8e+203) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp(-(y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.sqrt(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 2.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 1.8e+203: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp(-(y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.sqrt(math.pow((y_46_re * math.atan2(x_46_im, x_46_re)), 2.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.8e+203) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(-Float64(y_46_im * atan(x_46_im, x_46_re)))))); else tmp = sqrt((Float64(y_46_re * atan(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) tmp = 0.0; if (y_46_re <= 1.8e+203) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp(-(y_46_im * atan2(x_46_im, x_46_re)))); else tmp = sqrt(((y_46_re * atan2(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_] := If[LessEqual[y$46$re, 1.8e+203], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[(-N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 1.8 \cdot 10^{+203}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{-y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\\
\end{array}
\end{array}
if y.re < 1.79999999999999991e203Initial program 35.2%
Taylor expanded in y.im around 0 45.5%
Taylor expanded in y.re around 0 38.6%
*-commutative38.6%
*-commutative38.6%
distribute-rgt-neg-in38.6%
Simplified38.6%
if 1.79999999999999991e203 < y.re Initial program 20.8%
Taylor expanded in y.im around 0 45.9%
Taylor expanded in y.re around 0 13.7%
*-commutative13.7%
*-commutative13.7%
distribute-rgt-neg-in13.7%
Simplified13.7%
add-sqr-sqrt9.2%
sqrt-unprod25.8%
pow225.8%
associate-*r*25.8%
*-commutative25.8%
associate-*l*25.8%
exp-prod25.8%
add-sqr-sqrt17.3%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod9.0%
add-sqr-sqrt34.1%
Applied egg-rr34.1%
Taylor expanded in y.im around 0 33.6%
*-commutative33.6%
unpow233.6%
unpow233.6%
swap-sqr33.9%
unpow233.9%
*-commutative33.9%
Simplified33.9%
Final simplification38.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log1p (expm1 (* 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 log1p(expm1((y_46_re * 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.log1p(Math.expm1((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 math.log1p(math.expm1((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 log1p(expm1(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_] := N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 33.8%
Taylor expanded in y.im around 0 45.5%
Taylor expanded in y.re around 0 36.3%
*-commutative36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
Simplified36.3%
Taylor expanded in y.im around 0 10.0%
log1p-expm1-u17.6%
Applied egg-rr17.6%
Final simplification17.6%
(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 33.8%
Taylor expanded in y.im around 0 45.5%
Taylor expanded in y.re around 0 36.3%
*-commutative36.3%
*-commutative36.3%
distribute-rgt-neg-in36.3%
Simplified36.3%
Taylor expanded in y.im around 0 10.0%
Final simplification10.0%
herbie shell --seed 2024112
(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)))))