
(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 13 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))))))
(t_3 (cbrt (fma y.im t_1 t_0))))
(if (or (<= y.im 2.3e-209) (not (<= y.im 5.6e+72)))
(* t_2 (sin (fma t_1 y.im t_0)))
(* t_2 (sin (* t_3 (pow (pow (cbrt t_3) 2.0) 3.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 t_3 = cbrt(fma(y_46_im, t_1, t_0));
double tmp;
if ((y_46_im <= 2.3e-209) || !(y_46_im <= 5.6e+72)) {
tmp = t_2 * sin(fma(t_1, y_46_im, t_0));
} else {
tmp = t_2 * sin((t_3 * pow(pow(cbrt(t_3), 2.0), 3.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(y_46_im * Float64(-atan(x_46_im, x_46_re))))) t_3 = cbrt(fma(y_46_im, t_1, t_0)) tmp = 0.0 if ((y_46_im <= 2.3e-209) || !(y_46_im <= 5.6e+72)) tmp = Float64(t_2 * sin(fma(t_1, y_46_im, t_0))); else tmp = Float64(t_2 * sin(Float64(t_3 * ((cbrt(t_3) ^ 2.0) ^ 3.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]}, Block[{t$95$3 = N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision]}, If[Or[LessEqual[y$46$im, 2.3e-209], N[Not[LessEqual[y$46$im, 5.6e+72]], $MachinePrecision]], N[(t$95$2 * N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Sin[N[(t$95$3 * N[Power[N[Power[N[Power[t$95$3, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision]), $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 \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)}\\
t_3 := \sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}\\
\mathbf{if}\;y.im \leq 2.3 \cdot 10^{-209} \lor \neg \left(y.im \leq 5.6 \cdot 10^{+72}\right):\\
\;\;\;\;t\_2 \cdot \sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \sin \left(t\_3 \cdot {\left({\left(\sqrt[3]{t\_3}\right)}^{2}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.im < 2.3e-209 or 5.5999999999999998e72 < y.im Initial program 42.9%
fma-neg42.9%
distribute-rgt-neg-out42.9%
hypot-define42.9%
fma-define42.9%
hypot-define84.5%
*-commutative84.5%
Simplified84.5%
if 2.3e-209 < y.im < 5.5999999999999998e72Initial program 36.9%
fma-neg36.9%
distribute-rgt-neg-out36.9%
hypot-define36.9%
fma-define36.9%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
add-cube-cbrt75.6%
pow372.9%
fma-undefine72.9%
*-commutative72.9%
*-commutative72.9%
fma-define72.9%
Applied egg-rr72.9%
add-cube-cbrt79.1%
unpow-prod-down87.3%
pow287.3%
pow384.6%
add-cube-cbrt86.2%
Applied egg-rr86.2%
Final simplification85.0%
(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)))
(t_2 (sin (fma (log (hypot x.re x.im)) y.im t_1)))
(t_3
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -1.05e+26)
(*
(exp (- (* y.re (log (log1p (expm1 (hypot x.re x.im))))) t_0))
(sin t_1))
(if (<= y.re 0.0018)
(*
t_2
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.re 6e+35)
(* (pow (hypot x.im x.re) y.re) (sqrt (pow t_2 2.0)))
(if (<= y.re 2e+49)
(*
t_3
(+
t_1
(*
-0.16666666666666666
(* (pow y.re 3.0) (pow (atan2 x.im x.re) 3.0)))))
(* t_3 (sin (* 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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
double t_3 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -1.05e+26) {
tmp = exp(((y_46_re * log(log1p(expm1(hypot(x_46_re, x_46_im))))) - t_0)) * sin(t_1);
} else if (y_46_re <= 0.0018) {
tmp = t_2 * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 6e+35) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sqrt(pow(t_2, 2.0));
} else if (y_46_re <= 2e+49) {
tmp = t_3 * (t_1 + (-0.16666666666666666 * (pow(y_46_re, 3.0) * pow(atan2(x_46_im, x_46_re), 3.0))));
} else {
tmp = t_3 * sin((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 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) t_3 = 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 (y_46_re <= -1.05e+26) tmp = Float64(exp(Float64(Float64(y_46_re * log(log1p(expm1(hypot(x_46_re, x_46_im))))) - t_0)) * sin(t_1)); elseif (y_46_re <= 0.0018) tmp = Float64(t_2 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_re <= 6e+35) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sqrt((t_2 ^ 2.0))); elseif (y_46_re <= 2e+49) tmp = Float64(t_3 * Float64(t_1 + Float64(-0.16666666666666666 * Float64((y_46_re ^ 3.0) * (atan(x_46_im, x_46_re) ^ 3.0))))); else tmp = Float64(t_3 * sin(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = 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]}, If[LessEqual[y$46$re, -1.05e+26], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Log[1 + N[(Exp[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.0018], N[(t$95$2 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6e+35], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sqrt[N[Power[t$95$2, 2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+49], N[(t$95$3 * N[(t$95$1 + N[(-0.16666666666666666 * N[(N[Power[y$46$re, 3.0], $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\\
t_3 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{+26}:\\
\;\;\;\;e^{y.re \cdot \log \left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\right) - t\_0} \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 0.0018:\\
\;\;\;\;t\_2 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+35}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sqrt{{t\_2}^{2}}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+49}:\\
\;\;\;\;t\_3 \cdot \left(t\_1 + -0.16666666666666666 \cdot \left({y.re}^{3} \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.05e26Initial program 26.7%
Taylor expanded in y.im around 0 81.7%
hypot-define85.0%
log1p-expm1-u83.4%
Applied egg-rr83.4%
if -1.05e26 < y.re < 0.0018Initial program 44.9%
exp-diff44.9%
exp-to-pow44.9%
hypot-define44.9%
*-commutative44.9%
exp-prod44.8%
fma-define44.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
if 0.0018 < y.re < 5.99999999999999981e35Initial program 30.0%
exp-diff30.0%
exp-to-pow30.0%
hypot-define30.0%
*-commutative30.0%
exp-prod30.0%
fma-define30.0%
hypot-define50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.im around 0 50.1%
unpow250.1%
unpow250.1%
hypot-undefine50.1%
Simplified50.1%
add-sqr-sqrt50.1%
sqrt-unprod90.1%
pow290.1%
*-commutative90.1%
Applied egg-rr90.1%
if 5.99999999999999981e35 < y.re < 1.99999999999999989e49Initial program 0.0%
Taylor expanded in y.im around 0 66.7%
Taylor expanded in y.re around 0 100.0%
if 1.99999999999999989e49 < y.re Initial program 51.6%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine80.6%
Simplified80.6%
Final simplification84.1%
(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(y_46_im * Float64(-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 \left(-\tan^{-1}_* \frac{x.im}{x.re}\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 41.2%
fma-neg41.2%
distribute-rgt-neg-out41.2%
hypot-define41.2%
fma-define41.2%
hypot-define81.8%
*-commutative81.8%
Simplified81.8%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -0.0115)
(* (sin t_0) (pow (hypot x.re x.im) y.re))
(if (<= y.re 18000000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* y.im (- (atan2 x.im x.re)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin (* 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -0.0115) {
tmp = sin(t_0) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_re <= 18000000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin((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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -0.0115) tmp = Float64(sin(t_0) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_re <= 18000000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else 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(y_46_im * atan(x_46_im, x_46_re)))) * sin(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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.0115], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 18000000000000.0], 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[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $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[(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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -0.0115:\\
\;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 18000000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -0.0115Initial program 26.8%
Taylor expanded in y.im around 0 82.2%
Taylor expanded in y.im around 0 82.2%
+-commutative82.2%
unpow282.2%
unpow282.2%
hypot-undefine83.6%
Simplified83.6%
if -0.0115 < y.re < 1.8e13Initial program 44.9%
fma-neg44.9%
distribute-rgt-neg-out44.9%
hypot-define44.9%
fma-define44.9%
hypot-define82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in y.re around 0 81.4%
neg-mul-181.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if 1.8e13 < y.re Initial program 48.6%
Taylor expanded in y.re around 0 47.1%
unpow247.1%
unpow247.1%
hypot-undefine80.0%
Simplified80.0%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -0.00035)
(* (sin t_0) (pow (hypot x.re x.im) y.re))
(if (<= y.re 32000000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* y.im (- (atan2 x.im x.re)))))
(*
(pow (hypot x.im x.re) y.re)
(sin (* 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -0.00035) {
tmp = sin(t_0) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_re <= 32000000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -0.00035) tmp = Float64(sin(t_0) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_re <= 32000000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -0.00035], N[(N[Sin[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 32000000000000.0], 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[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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 -0.00035:\\
\;\;\;\;\sin t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 32000000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.49999999999999996e-4Initial program 26.8%
Taylor expanded in y.im around 0 82.2%
Taylor expanded in y.im around 0 82.2%
+-commutative82.2%
unpow282.2%
unpow282.2%
hypot-undefine83.6%
Simplified83.6%
if -3.49999999999999996e-4 < y.re < 3.2e13Initial program 44.9%
fma-neg44.9%
distribute-rgt-neg-out44.9%
hypot-define44.9%
fma-define44.9%
hypot-define82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in y.re around 0 81.4%
neg-mul-181.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if 3.2e13 < y.re Initial program 48.6%
exp-diff37.1%
exp-to-pow37.1%
hypot-define37.1%
*-commutative37.1%
exp-prod35.7%
fma-define35.7%
hypot-define58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in y.im around 0 73.0%
unpow273.0%
unpow273.0%
hypot-undefine73.0%
Simplified73.0%
Taylor expanded in y.im around inf 41.5%
unpow241.5%
unpow241.5%
hypot-undefine74.4%
Simplified74.4%
Final simplification80.1%
(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 -2400000.0) (not (<= y.im 9.2e+19)))
(*
(sin t_0)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -2400000.0) || !(y_46_im <= 9.2e+19)) {
tmp = sin(t_0) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -2400000.0) || !(y_46_im <= 9.2e+19)) tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ 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]}, If[Or[LessEqual[y$46$im, -2400000.0], N[Not[LessEqual[y$46$im, 9.2e+19]], $MachinePrecision]], N[(N[Sin[t$95$0], $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] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $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 + t$95$0), $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}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2400000 \lor \neg \left(y.im \leq 9.2 \cdot 10^{+19}\right):\\
\;\;\;\;\sin t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\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 {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -2.4e6 or 9.2e19 < y.im Initial program 40.9%
Taylor expanded in y.im around 0 66.6%
if -2.4e6 < y.im < 9.2e19Initial program 41.4%
exp-diff40.6%
exp-to-pow40.7%
hypot-define40.7%
*-commutative40.7%
exp-prod40.6%
fma-define40.6%
hypot-define89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in y.im around 0 65.2%
unpow265.2%
unpow265.2%
hypot-undefine87.5%
Simplified87.5%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))))
(t_2
(*
(pow (hypot x.im x.re) y.re)
(sin (* y.im (log (hypot x.im x.re)))))))
(if (<= y.im -980.0)
t_1
(if (<= y.im -3.6e-140)
t_2
(if (<= y.im 2.2e-209)
(* t_0 (pow (hypot x.re x.im) y.re))
(if (<= y.im 1.8e+26) t_2 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -980.0) {
tmp = t_1;
} else if (y_46_im <= -3.6e-140) {
tmp = t_2;
} else if (y_46_im <= 2.2e-209) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 1.8e+26) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -980.0) {
tmp = t_1;
} else if (y_46_im <= -3.6e-140) {
tmp = t_2;
} else if (y_46_im <= 2.2e-209) {
tmp = t_0 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 1.8e+26) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -980.0: tmp = t_1 elif y_46_im <= -3.6e-140: tmp = t_2 elif y_46_im <= 2.2e-209: tmp = t_0 * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) elif y_46_im <= 1.8e+26: tmp = t_2 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = Float64(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re))))) t_2 = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) tmp = 0.0 if (y_46_im <= -980.0) tmp = t_1; elseif (y_46_im <= -3.6e-140) tmp = t_2; elseif (y_46_im <= 2.2e-209) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 1.8e+26) tmp = t_2; 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 = sin((y_46_re * atan2(x_46_im, x_46_re))); t_1 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); t_2 = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -980.0) tmp = t_1; elseif (y_46_im <= -3.6e-140) tmp = t_2; elseif (y_46_im <= 2.2e-209) tmp = t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re); elseif (y_46_im <= 1.8e+26) tmp = t_2; 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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -980.0], t$95$1, If[LessEqual[y$46$im, -3.6e-140], t$95$2, If[LessEqual[y$46$im, 2.2e-209], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+26], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.im \leq -980:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-140}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{-209}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+26}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -980 or 1.80000000000000012e26 < y.im Initial program 42.3%
Taylor expanded in y.im around 0 66.9%
if -980 < y.im < -3.6e-140 or 2.2000000000000001e-209 < y.im < 1.80000000000000012e26Initial program 36.9%
exp-diff36.9%
exp-to-pow36.9%
hypot-define36.9%
*-commutative36.9%
exp-prod36.9%
fma-define36.9%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 59.7%
unpow259.7%
unpow259.7%
hypot-undefine82.1%
Simplified82.1%
Taylor expanded in y.im around inf 33.3%
unpow233.3%
unpow233.3%
hypot-undefine75.3%
Simplified75.3%
if -3.6e-140 < y.im < 2.2000000000000001e-209Initial program 46.7%
Taylor expanded in y.im around 0 71.3%
Taylor expanded in y.im around 0 71.3%
+-commutative71.3%
unpow271.3%
unpow271.3%
hypot-undefine85.5%
Simplified85.5%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(pow (hypot x.im x.re) y.re)
(sin (* y.im (log (hypot x.im x.re))))))
(t_1
(* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re))))))))
(if (<= y.im -1.25e+19)
t_1
(if (<= y.im -1.85e-145)
t_0
(if (<= y.im 2.5e-209)
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re))
(if (<= y.im 8.5e+18) 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 = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.25e+19) {
tmp = t_1;
} else if (y_46_im <= -1.85e-145) {
tmp = t_0;
} else if (y_46_im <= 2.5e-209) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 8.5e+18) {
tmp = 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 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_im <= -1.25e+19) {
tmp = t_1;
} else if (y_46_im <= -1.85e-145) {
tmp = t_0;
} else if (y_46_im <= 2.5e-209) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else if (y_46_im <= 8.5e+18) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re)))) tmp = 0 if y_46_im <= -1.25e+19: tmp = t_1 elif y_46_im <= -1.85e-145: tmp = t_0 elif y_46_im <= 2.5e-209: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) elif y_46_im <= 8.5e+18: tmp = 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((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))) t_1 = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))) tmp = 0.0 if (y_46_im <= -1.25e+19) tmp = t_1; elseif (y_46_im <= -1.85e-145) tmp = t_0; elseif (y_46_im <= 2.5e-209) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); elseif (y_46_im <= 8.5e+18) tmp = 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 = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_im <= -1.25e+19) tmp = t_1; elseif (y_46_im <= -1.85e-145) tmp = t_0; elseif (y_46_im <= 2.5e-209) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re); elseif (y_46_im <= 8.5e+18) tmp = 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[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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, -1.25e+19], t$95$1, If[LessEqual[y$46$im, -1.85e-145], t$95$0, If[LessEqual[y$46$im, 2.5e-209], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.5e+18], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.85 \cdot 10^{-145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{-209}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.25e19 or 8.5e18 < y.im Initial program 41.6%
Taylor expanded in y.im around 0 66.0%
Taylor expanded in y.re around 0 57.6%
distribute-rgt-neg-in57.6%
Simplified57.6%
if -1.25e19 < y.im < -1.85000000000000006e-145 or 2.5000000000000002e-209 < y.im < 8.5e18Initial program 37.8%
exp-diff36.8%
exp-to-pow36.8%
hypot-define36.8%
*-commutative36.8%
exp-prod36.8%
fma-define36.8%
hypot-define83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in y.im around 0 60.9%
unpow260.9%
unpow260.9%
hypot-undefine81.7%
Simplified81.7%
Taylor expanded in y.im around inf 31.2%
unpow231.2%
unpow231.2%
hypot-undefine73.0%
Simplified73.0%
if -1.85000000000000006e-145 < y.im < 2.5000000000000002e-209Initial program 46.7%
Taylor expanded in y.im around 0 71.3%
Taylor expanded in y.im around 0 71.3%
+-commutative71.3%
unpow271.3%
unpow271.3%
hypot-undefine85.5%
Simplified85.5%
Final simplification68.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.00014) (not (<= y.re 15000000000000.0))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re)) (* y.re (* (atan2 x.im x.re) (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_re <= -0.00014) || !(y_46_re <= 15000000000000.0)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_re, x_46_im), 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))));
}
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.00014) || !(y_46_re <= 15000000000000.0)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
} else {
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))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.00014) or not (y_46_re <= 15000000000000.0): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_re, x_46_im), y_46_re) else: 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)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.00014) || !(y_46_re <= 15000000000000.0)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(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_re <= -0.00014) || ~((y_46_re <= 15000000000000.0))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ 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[Or[LessEqual[y$46$re, -0.00014], N[Not[LessEqual[y$46$re, 15000000000000.0]], $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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00014 \lor \neg \left(y.re \leq 15000000000000\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.3999999999999999e-4 or 1.5e13 < y.re Initial program 38.4%
Taylor expanded in y.im around 0 76.8%
Taylor expanded in y.im around 0 74.0%
+-commutative74.0%
unpow274.0%
unpow274.0%
hypot-undefine74.7%
Simplified74.7%
if -1.3999999999999999e-4 < y.re < 1.5e13Initial program 44.4%
Taylor expanded in y.im around 0 38.9%
Taylor expanded in y.re around 0 51.5%
distribute-rgt-neg-in51.5%
Simplified51.5%
Final simplification64.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.15e-27) (not (<= y.im 8.8e-39))) (* y.re (* (atan2 x.im x.re) (exp (* y.im (- (atan2 x.im x.re)))))) (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) {
double tmp;
if ((y_46_im <= -3.15e-27) || !(y_46_im <= 8.8e-39)) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((y_46_im * -atan2(x_46_im, x_46_re))));
} else {
tmp = log1p(expm1((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 <= -3.15e-27) || !(y_46_im <= 8.8e-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 {
tmp = Math.log1p(Math.expm1((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 <= -3.15e-27) or not (y_46_im <= 8.8e-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: tmp = math.log1p(math.expm1((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 <= -3.15e-27) || !(y_46_im <= 8.8e-39)) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))))); else tmp = log1p(expm1(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3.15e-27], N[Not[LessEqual[y$46$im, 8.8e-39]], $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[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.15 \cdot 10^{-27} \lor \neg \left(y.im \leq 8.8 \cdot 10^{-39}\right):\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -3.15000000000000005e-27 or 8.80000000000000003e-39 < y.im Initial program 42.9%
Taylor expanded in y.im around 0 60.8%
Taylor expanded in y.re around 0 48.4%
distribute-rgt-neg-in48.4%
Simplified48.4%
if -3.15000000000000005e-27 < y.im < 8.80000000000000003e-39Initial program 39.1%
Taylor expanded in y.im around 0 57.6%
Taylor expanded in y.re around 0 19.0%
distribute-rgt-neg-in19.0%
Simplified19.0%
Taylor expanded in y.im around 0 19.0%
*-commutative19.0%
log1p-expm1-u30.2%
Applied egg-rr30.2%
Final simplification40.3%
(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 -4.4e-10) (not (<= y.im 2.8e-100)))
(log (+ t_0 1.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 <= -4.4e-10) || !(y_46_im <= 2.8e-100)) {
tmp = log((t_0 + 1.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 <= -4.4e-10) || !(y_46_im <= 2.8e-100)) {
tmp = Math.log((t_0 + 1.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 <= -4.4e-10) or not (y_46_im <= 2.8e-100): tmp = math.log((t_0 + 1.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 <= -4.4e-10) || !(y_46_im <= 2.8e-100)) tmp = log(Float64(t_0 + 1.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, -4.4e-10], N[Not[LessEqual[y$46$im, 2.8e-100]], $MachinePrecision]], N[Log[N[(t$95$0 + 1.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 -4.4 \cdot 10^{-10} \lor \neg \left(y.im \leq 2.8 \cdot 10^{-100}\right):\\
\;\;\;\;\log \left(t\_0 + 1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t\_0\right)\\
\end{array}
\end{array}
if y.im < -4.3999999999999998e-10 or 2.79999999999999995e-100 < y.im Initial program 43.2%
Taylor expanded in y.im around 0 62.2%
Taylor expanded in y.re around 0 45.9%
distribute-rgt-neg-in45.9%
Simplified45.9%
Taylor expanded in y.im around 0 6.7%
log1p-expm1-u18.6%
log1p-undefine33.4%
*-commutative33.4%
Applied egg-rr33.4%
if -4.3999999999999998e-10 < y.im < 2.79999999999999995e-100Initial program 38.3%
Taylor expanded in y.im around 0 55.5%
Taylor expanded in y.re around 0 20.3%
distribute-rgt-neg-in20.3%
Simplified20.3%
Taylor expanded in y.im around 0 20.3%
*-commutative20.3%
log1p-expm1-u28.8%
Applied egg-rr28.8%
Final simplification31.5%
(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 41.2%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Taylor expanded in y.im around 0 12.4%
*-commutative12.4%
log1p-expm1-u22.9%
Applied egg-rr22.9%
Final simplification22.9%
(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 41.2%
Taylor expanded in y.im around 0 59.4%
Taylor expanded in y.re around 0 35.2%
distribute-rgt-neg-in35.2%
Simplified35.2%
Taylor expanded in y.im around 0 12.4%
Final simplification12.4%
herbie shell --seed 2024046
(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)))))