
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * sin(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -7.2e+15)
(* y.im (fabs (* t_0 (pow (hypot x.im x.re) y.re))))
(if (<= y.re 1.85e+39)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* 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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -7.2e+15) {
tmp = y_46_im * fabs((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_re <= 1.85e+39) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(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))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -7.2e+15) tmp = Float64(y_46_im * abs(Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)))); elseif (y_46_re <= 1.85e+39) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ 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(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e+15], N[(y$46$im * N[Abs[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.85e+39], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(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], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{+15}:\\
\;\;\;\;y.im \cdot \left|t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{+39}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot \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{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot t_0\right)\\
\end{array}
\end{array}
if y.re < -7.2e15Initial program 37.3%
exp-diff29.9%
exp-to-pow29.9%
hypot-def29.9%
*-commutative29.9%
exp-prod28.4%
fma-def28.4%
hypot-def62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in y.im around inf 23.9%
unpow223.9%
unpow223.9%
hypot-def58.2%
Simplified58.2%
Taylor expanded in y.im around 0 32.9%
unpow232.9%
unpow232.9%
hypot-def76.2%
unpow276.2%
unpow276.2%
hypot-def76.2%
Simplified76.2%
add-sqr-sqrt70.3%
sqrt-unprod86.7%
pow286.7%
Applied egg-rr86.7%
unpow286.7%
rem-sqrt-square86.7%
Simplified86.7%
if -7.2e15 < y.re < 1.85000000000000006e39Initial program 51.0%
exp-diff51.0%
exp-to-pow51.0%
hypot-def51.0%
*-commutative51.0%
exp-prod50.7%
fma-def50.7%
hypot-def88.0%
*-commutative88.0%
Simplified88.0%
if 1.85000000000000006e39 < y.re Initial program 46.2%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def80.9%
Simplified80.9%
Final simplification86.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 1.92e+39)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re))))))))
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_re <= 1.92e+39) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
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_re <= 1.92e+39) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); 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(atan(x_46_im, x_46_re) * y_46_im))) * 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1.92e+39], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 1.92 \cdot 10^{+39}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 1.92000000000000014e39Initial program 46.5%
fma-neg46.5%
hypot-def46.5%
distribute-rgt-neg-out46.5%
fma-def46.5%
hypot-def87.3%
*-commutative87.3%
Simplified87.3%
if 1.92000000000000014e39 < y.re Initial program 46.2%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def80.9%
Simplified80.9%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -7.8e+24)
(* y.im (fabs (* t_0 (pow (hypot x.im x.re) y.re))))
(if (<= y.re 1000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* 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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * fabs((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_re <= 1000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((y_46_im * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -7.8e+24) tmp = Float64(y_46_im * abs(Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)))); elseif (y_46_re <= 1000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); 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(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.8e+24], N[(y$46$im * N[Abs[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1000000000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -7.8 \cdot 10^{+24}:\\
\;\;\;\;y.im \cdot \left|t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.re \leq 1000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.im \cdot t_0\right)\\
\end{array}
\end{array}
if y.re < -7.7999999999999995e24Initial program 37.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-def29.7%
*-commutative29.7%
exp-prod28.1%
fma-def28.1%
hypot-def64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in y.im around inf 23.4%
unpow223.4%
unpow223.4%
hypot-def59.4%
Simplified59.4%
Taylor expanded in y.im around 0 32.8%
unpow232.8%
unpow232.8%
hypot-def78.2%
unpow278.2%
unpow278.2%
hypot-def78.2%
Simplified78.2%
add-sqr-sqrt71.9%
sqrt-unprod89.1%
pow289.1%
Applied egg-rr89.1%
unpow289.1%
rem-sqrt-square89.1%
Simplified89.1%
if -7.7999999999999995e24 < y.re < 1e9Initial program 49.2%
fma-neg49.2%
hypot-def49.2%
distribute-rgt-neg-out49.2%
fma-def49.2%
hypot-def87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
if 1e9 < y.re Initial program 50.0%
Taylor expanded in y.re around 0 51.8%
unpow251.8%
unpow251.8%
hypot-def80.4%
Simplified80.4%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -7.8e+24)
(* y.im (fabs (* t_0 (pow (hypot x.im x.re) y.re))))
(if (<= y.re 1000000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* (sin (* y.im t_0)) (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_im, x_46_re));
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * fabs((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_re <= 1000000000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = sin((y_46_im * t_0)) * 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_im, x_46_re)) tmp = 0.0 if (y_46_re <= -7.8e+24) tmp = Float64(y_46_im * abs(Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)))); elseif (y_46_re <= 1000000000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(sin(Float64(y_46_im * t_0)) * (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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.8e+24], N[(y$46$im * N[Abs[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1000000000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * t$95$0), $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.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -7.8 \cdot 10^{+24}:\\
\;\;\;\;y.im \cdot \left|t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.re \leq 1000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot t_0\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.7999999999999995e24Initial program 37.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-def29.7%
*-commutative29.7%
exp-prod28.1%
fma-def28.1%
hypot-def64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in y.im around inf 23.4%
unpow223.4%
unpow223.4%
hypot-def59.4%
Simplified59.4%
Taylor expanded in y.im around 0 32.8%
unpow232.8%
unpow232.8%
hypot-def78.2%
unpow278.2%
unpow278.2%
hypot-def78.2%
Simplified78.2%
add-sqr-sqrt71.9%
sqrt-unprod89.1%
pow289.1%
Applied egg-rr89.1%
unpow289.1%
rem-sqrt-square89.1%
Simplified89.1%
if -7.7999999999999995e24 < y.re < 1e9Initial program 49.2%
fma-neg49.2%
hypot-def49.2%
distribute-rgt-neg-out49.2%
fma-def49.2%
hypot-def87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
if 1e9 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 78.7%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.re (atan2 x.im x.re)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= y.re -1.08e-38)
(* y.im (fabs t_2))
(if (<= y.re -4.3e-138)
t_0
(if (<= y.re 1.9e-219)
(/ (sin (* y.im t_1)) (fma (atan2 x.im x.re) y.im 1.0))
(if (<= y.re 1200000000.0) t_0 (* y.im t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.08e-38) {
tmp = y_46_im * fabs(t_2);
} else if (y_46_re <= -4.3e-138) {
tmp = t_0;
} else if (y_46_re <= 1.9e-219) {
tmp = sin((y_46_im * t_1)) / fma(atan2(x_46_im, x_46_re), y_46_im, 1.0);
} else if (y_46_re <= 1200000000.0) {
tmp = t_0;
} else {
tmp = y_46_im * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.08e-38) tmp = Float64(y_46_im * abs(t_2)); elseif (y_46_re <= -4.3e-138) tmp = t_0; elseif (y_46_re <= 1.9e-219) tmp = Float64(sin(Float64(y_46_im * t_1)) / fma(atan(x_46_im, x_46_re), y_46_im, 1.0)); elseif (y_46_re <= 1200000000.0) tmp = t_0; else tmp = Float64(y_46_im * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.08e-38], N[(y$46$im * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -4.3e-138], t$95$0, If[LessEqual[y$46$re, 1.9e-219], N[(N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision] / N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1200000000.0], t$95$0, N[(y$46$im * t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.08 \cdot 10^{-38}:\\
\;\;\;\;y.im \cdot \left|t_2\right|\\
\mathbf{elif}\;y.re \leq -4.3 \cdot 10^{-138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-219}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot t_1\right)}{\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.im, 1\right)}\\
\mathbf{elif}\;y.re \leq 1200000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot t_2\\
\end{array}
\end{array}
if y.re < -1.08e-38Initial program 36.6%
exp-diff30.1%
exp-to-pow30.1%
hypot-def30.1%
*-commutative30.1%
exp-prod28.6%
fma-def28.6%
hypot-def62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in y.im around inf 23.5%
unpow223.5%
unpow223.5%
hypot-def57.2%
Simplified57.2%
Taylor expanded in y.im around 0 32.6%
unpow232.6%
unpow232.6%
hypot-def70.4%
unpow270.4%
unpow270.4%
hypot-def71.7%
Simplified71.7%
add-sqr-sqrt65.1%
sqrt-unprod80.8%
pow280.8%
Applied egg-rr80.8%
unpow280.8%
rem-sqrt-square80.8%
Simplified80.8%
if -1.08e-38 < y.re < -4.3e-138 or 1.90000000000000012e-219 < y.re < 1.2e9Initial program 46.2%
fma-neg46.2%
hypot-def46.2%
distribute-rgt-neg-out46.2%
fma-def46.2%
hypot-def89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.re around 0 87.6%
neg-mul-187.6%
distribute-rgt-neg-in87.6%
Simplified87.6%
Taylor expanded in y.im around 0 63.8%
if -4.3e-138 < y.re < 1.90000000000000012e-219Initial program 58.6%
exp-diff58.6%
exp-to-pow58.6%
hypot-def58.6%
*-commutative58.6%
exp-prod58.6%
fma-def58.6%
hypot-def90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y.im around inf 55.5%
unpow255.5%
unpow255.5%
hypot-def87.5%
Simplified87.5%
Taylor expanded in y.im around 0 49.3%
Taylor expanded in y.re around 0 30.9%
+-commutative30.9%
unpow230.9%
unpow230.9%
hypot-def49.3%
hypot-def30.9%
unpow230.9%
unpow230.9%
+-commutative30.9%
unpow230.9%
unpow230.9%
hypot-def49.3%
+-commutative49.3%
*-commutative49.3%
fma-udef49.3%
Simplified49.3%
if 1.2e9 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
unpow269.8%
hypot-def73.3%
unpow273.3%
unpow273.3%
hypot-def73.3%
Simplified73.3%
Final simplification68.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (log (hypot x.im x.re)))
(t_2 (sin (* y.im t_1))))
(if (<= y.re -7.8e+24)
(* y.im (fabs (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= y.re 9.5e-163)
(* t_2 t_0)
(if (<= y.re 1050000000.0)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(* t_2 (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 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = sin((y_46_im * t_1));
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * fabs((t_1 * pow(hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_re <= 9.5e-163) {
tmp = t_2 * t_0;
} else if (y_46_re <= 1050000000.0) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = t_2 * pow(hypot(x_46_re, x_46_im), 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 t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_2 = Math.sin((y_46_im * t_1));
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * Math.abs((t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)));
} else if (y_46_re <= 9.5e-163) {
tmp = t_2 * t_0;
} else if (y_46_re <= 1050000000.0) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_2 * Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.log(math.hypot(x_46_im, x_46_re)) t_2 = math.sin((y_46_im * t_1)) tmp = 0 if y_46_re <= -7.8e+24: tmp = y_46_im * math.fabs((t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re))) elif y_46_re <= 9.5e-163: tmp = t_2 * t_0 elif y_46_re <= 1050000000.0: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = t_2 * math.pow(math.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 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = sin(Float64(y_46_im * t_1)) tmp = 0.0 if (y_46_re <= -7.8e+24) tmp = Float64(y_46_im * abs(Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)))); elseif (y_46_re <= 9.5e-163) tmp = Float64(t_2 * t_0); elseif (y_46_re <= 1050000000.0) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(t_2 * (hypot(x_46_re, x_46_im) ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = log(hypot(x_46_im, x_46_re)); t_2 = sin((y_46_im * t_1)); tmp = 0.0; if (y_46_re <= -7.8e+24) tmp = y_46_im * abs((t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))); elseif (y_46_re <= 9.5e-163) tmp = t_2 * t_0; elseif (y_46_re <= 1050000000.0) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = t_2 * (hypot(x_46_re, x_46_im) ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7.8e+24], N[(y$46$im * N[Abs[N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-163], N[(t$95$2 * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1050000000.0], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \sin \left(y.im \cdot t_1\right)\\
\mathbf{if}\;y.re \leq -7.8 \cdot 10^{+24}:\\
\;\;\;\;y.im \cdot \left|t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right|\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-163}:\\
\;\;\;\;t_2 \cdot t_0\\
\mathbf{elif}\;y.re \leq 1050000000:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -7.7999999999999995e24Initial program 37.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-def29.7%
*-commutative29.7%
exp-prod28.1%
fma-def28.1%
hypot-def64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in y.im around inf 23.4%
unpow223.4%
unpow223.4%
hypot-def59.4%
Simplified59.4%
Taylor expanded in y.im around 0 32.8%
unpow232.8%
unpow232.8%
hypot-def78.2%
unpow278.2%
unpow278.2%
hypot-def78.2%
Simplified78.2%
add-sqr-sqrt71.9%
sqrt-unprod89.1%
pow289.1%
Applied egg-rr89.1%
unpow289.1%
rem-sqrt-square89.1%
Simplified89.1%
if -7.7999999999999995e24 < y.re < 9.50000000000000012e-163Initial program 48.0%
fma-neg48.0%
hypot-def48.0%
distribute-rgt-neg-out48.0%
fma-def48.0%
hypot-def86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
Taylor expanded in y.im around inf 41.1%
unpow240.8%
unpow240.8%
hypot-def72.8%
Simplified73.4%
if 9.50000000000000012e-163 < y.re < 1.05e9Initial program 53.0%
fma-neg53.0%
hypot-def53.0%
distribute-rgt-neg-out53.0%
fma-def53.0%
hypot-def90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in y.re around 0 85.3%
neg-mul-185.3%
distribute-rgt-neg-in85.3%
Simplified85.3%
Taylor expanded in y.im around 0 77.8%
if 1.05e9 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 78.7%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= y.re -7.8e+24)
(* y.im (fabs t_2))
(if (<= y.re 7.6e-163)
(* (sin (* y.im t_1)) t_0)
(if (<= y.re 2100000000.0)
(* t_0 (sin (* y.re (atan2 x.im x.re))))
(* y.im t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * fabs(t_2);
} else if (y_46_re <= 7.6e-163) {
tmp = sin((y_46_im * t_1)) * t_0;
} else if (y_46_re <= 2100000000.0) {
tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_im * t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_2 = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.8e+24) {
tmp = y_46_im * Math.abs(t_2);
} else if (y_46_re <= 7.6e-163) {
tmp = Math.sin((y_46_im * t_1)) * t_0;
} else if (y_46_re <= 2100000000.0) {
tmp = t_0 * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = y_46_im * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = math.log(math.hypot(x_46_im, x_46_re)) t_2 = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -7.8e+24: tmp = y_46_im * math.fabs(t_2) elif y_46_re <= 7.6e-163: tmp = math.sin((y_46_im * t_1)) * t_0 elif y_46_re <= 2100000000.0: tmp = t_0 * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = y_46_im * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -7.8e+24) tmp = Float64(y_46_im * abs(t_2)); elseif (y_46_re <= 7.6e-163) tmp = Float64(sin(Float64(y_46_im * t_1)) * t_0); elseif (y_46_re <= 2100000000.0) tmp = Float64(t_0 * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(y_46_im * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = log(hypot(x_46_im, x_46_re)); t_2 = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -7.8e+24) tmp = y_46_im * abs(t_2); elseif (y_46_re <= 7.6e-163) tmp = sin((y_46_im * t_1)) * t_0; elseif (y_46_re <= 2100000000.0) tmp = t_0 * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = y_46_im * t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.8e+24], N[(y$46$im * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.6e-163], N[(N[Sin[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2100000000.0], N[(t$95$0 * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$im * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -7.8 \cdot 10^{+24}:\\
\;\;\;\;y.im \cdot \left|t_2\right|\\
\mathbf{elif}\;y.re \leq 7.6 \cdot 10^{-163}:\\
\;\;\;\;\sin \left(y.im \cdot t_1\right) \cdot t_0\\
\mathbf{elif}\;y.re \leq 2100000000:\\
\;\;\;\;t_0 \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot t_2\\
\end{array}
\end{array}
if y.re < -7.7999999999999995e24Initial program 37.5%
exp-diff29.7%
exp-to-pow29.7%
hypot-def29.7%
*-commutative29.7%
exp-prod28.1%
fma-def28.1%
hypot-def64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in y.im around inf 23.4%
unpow223.4%
unpow223.4%
hypot-def59.4%
Simplified59.4%
Taylor expanded in y.im around 0 32.8%
unpow232.8%
unpow232.8%
hypot-def78.2%
unpow278.2%
unpow278.2%
hypot-def78.2%
Simplified78.2%
add-sqr-sqrt71.9%
sqrt-unprod89.1%
pow289.1%
Applied egg-rr89.1%
unpow289.1%
rem-sqrt-square89.1%
Simplified89.1%
if -7.7999999999999995e24 < y.re < 7.6000000000000001e-163Initial program 48.0%
fma-neg48.0%
hypot-def48.0%
distribute-rgt-neg-out48.0%
fma-def48.0%
hypot-def86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
Taylor expanded in y.im around inf 41.1%
unpow240.8%
unpow240.8%
hypot-def72.8%
Simplified73.4%
if 7.6000000000000001e-163 < y.re < 2.1e9Initial program 53.0%
fma-neg53.0%
hypot-def53.0%
distribute-rgt-neg-out53.0%
fma-def53.0%
hypot-def90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in y.re around 0 85.3%
neg-mul-185.3%
distribute-rgt-neg-in85.3%
Simplified85.3%
Taylor expanded in y.im around 0 77.8%
if 2.1e9 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
unpow269.8%
hypot-def73.3%
unpow273.3%
unpow273.3%
hypot-def73.3%
Simplified73.3%
Final simplification77.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.re (atan2 x.im x.re)))))
(t_2 (log (hypot x.im x.re)))
(t_3 (* y.im t_2)))
(if (<= y.re -8500000000000.0)
(fabs (* t_3 t_0))
(if (<= y.re -7e-138)
t_1
(if (<= y.re 1.8e-217)
t_3
(if (<= y.re 1100000000.0) t_1 (* y.im (* t_2 t_0))))))))
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);
double t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = log(hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double tmp;
if (y_46_re <= -8500000000000.0) {
tmp = fabs((t_3 * t_0));
} else if (y_46_re <= -7e-138) {
tmp = t_1;
} else if (y_46_re <= 1.8e-217) {
tmp = t_3;
} else if (y_46_re <= 1100000000.0) {
tmp = t_1;
} else {
tmp = y_46_im * (t_2 * 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.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_2 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_3 = y_46_im * t_2;
double tmp;
if (y_46_re <= -8500000000000.0) {
tmp = Math.abs((t_3 * t_0));
} else if (y_46_re <= -7e-138) {
tmp = t_1;
} else if (y_46_re <= 1.8e-217) {
tmp = t_3;
} else if (y_46_re <= 1100000000.0) {
tmp = t_1;
} else {
tmp = y_46_im * (t_2 * t_0);
}
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) t_1 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_2 = math.log(math.hypot(x_46_im, x_46_re)) t_3 = y_46_im * t_2 tmp = 0 if y_46_re <= -8500000000000.0: tmp = math.fabs((t_3 * t_0)) elif y_46_re <= -7e-138: tmp = t_1 elif y_46_re <= 1.8e-217: tmp = t_3 elif y_46_re <= 1100000000.0: tmp = t_1 else: tmp = y_46_im * (t_2 * t_0) return tmp
function 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 t_1 = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_2 = log(hypot(x_46_im, x_46_re)) t_3 = Float64(y_46_im * t_2) tmp = 0.0 if (y_46_re <= -8500000000000.0) tmp = abs(Float64(t_3 * t_0)); elseif (y_46_re <= -7e-138) tmp = t_1; elseif (y_46_re <= 1.8e-217) tmp = t_3; elseif (y_46_re <= 1100000000.0) tmp = t_1; else tmp = Float64(y_46_im * Float64(t_2 * t_0)); 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; t_1 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re))); t_2 = log(hypot(x_46_im, x_46_re)); t_3 = y_46_im * t_2; tmp = 0.0; if (y_46_re <= -8500000000000.0) tmp = abs((t_3 * t_0)); elseif (y_46_re <= -7e-138) tmp = t_1; elseif (y_46_re <= 1.8e-217) tmp = t_3; elseif (y_46_re <= 1100000000.0) tmp = t_1; else tmp = y_46_im * (t_2 * 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(y$46$im * t$95$2), $MachinePrecision]}, If[LessEqual[y$46$re, -8500000000000.0], N[Abs[N[(t$95$3 * t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$re, -7e-138], t$95$1, If[LessEqual[y$46$re, 1.8e-217], t$95$3, If[LessEqual[y$46$re, 1100000000.0], t$95$1, N[(y$46$im * N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := y.im \cdot t_2\\
\mathbf{if}\;y.re \leq -8500000000000:\\
\;\;\;\;\left|t_3 \cdot t_0\right|\\
\mathbf{elif}\;y.re \leq -7 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-217}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y.re \leq 1100000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot \left(t_2 \cdot t_0\right)\\
\end{array}
\end{array}
if y.re < -8.5e12Initial program 37.3%
exp-diff29.9%
exp-to-pow29.9%
hypot-def29.9%
*-commutative29.9%
exp-prod28.4%
fma-def28.4%
hypot-def62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in y.im around inf 23.9%
unpow223.9%
unpow223.9%
hypot-def58.2%
Simplified58.2%
Taylor expanded in y.im around 0 32.9%
unpow232.9%
unpow232.9%
hypot-def76.2%
unpow276.2%
unpow276.2%
hypot-def76.2%
Simplified76.2%
add-sqr-sqrt74.7%
sqrt-unprod85.2%
pow285.2%
*-commutative85.2%
*-commutative85.2%
associate-*l*85.2%
add-log-exp38.8%
exp-to-pow38.8%
Applied egg-rr38.8%
unpow238.8%
rem-sqrt-square38.8%
log-pow85.2%
Simplified85.2%
if -8.5e12 < y.re < -6.9999999999999997e-138 or 1.79999999999999991e-217 < y.re < 1.1e9Initial program 44.6%
fma-neg44.6%
hypot-def44.6%
distribute-rgt-neg-out44.6%
fma-def44.6%
hypot-def86.5%
*-commutative86.5%
Simplified86.5%
Taylor expanded in y.re around 0 82.7%
neg-mul-182.7%
distribute-rgt-neg-in82.7%
Simplified82.7%
Taylor expanded in y.im around 0 60.5%
if -6.9999999999999997e-138 < y.re < 1.79999999999999991e-217Initial program 58.6%
exp-diff58.6%
exp-to-pow58.6%
hypot-def58.6%
*-commutative58.6%
exp-prod58.6%
fma-def58.6%
hypot-def90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y.im around inf 55.5%
unpow255.5%
unpow255.5%
hypot-def87.5%
Simplified87.5%
Taylor expanded in y.im around 0 34.9%
unpow234.9%
unpow234.9%
hypot-def35.9%
unpow235.9%
unpow235.9%
hypot-def48.3%
Simplified48.3%
Taylor expanded in y.re around 0 35.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
hypot-def35.2%
unpow235.2%
unpow235.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
Simplified48.3%
if 1.1e9 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
unpow269.8%
hypot-def73.3%
unpow273.3%
unpow273.3%
hypot-def73.3%
Simplified73.3%
Final simplification67.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.re (atan2 x.im x.re)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* t_1 (pow (hypot x.im x.re) y.re))))
(if (<= y.re -1.08e-38)
(* y.im (fabs t_2))
(if (<= y.re -4.3e-138)
t_0
(if (<= y.re 1.55e-219)
(* y.im t_1)
(if (<= y.re 3600000000000.0) t_0 (* y.im t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.08e-38) {
tmp = y_46_im * fabs(t_2);
} else if (y_46_re <= -4.3e-138) {
tmp = t_0;
} else if (y_46_re <= 1.55e-219) {
tmp = y_46_im * t_1;
} else if (y_46_re <= 3600000000000.0) {
tmp = t_0;
} else {
tmp = y_46_im * t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_2 = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.08e-38) {
tmp = y_46_im * Math.abs(t_2);
} else if (y_46_re <= -4.3e-138) {
tmp = t_0;
} else if (y_46_re <= 1.55e-219) {
tmp = y_46_im * t_1;
} else if (y_46_re <= 3600000000000.0) {
tmp = t_0;
} else {
tmp = y_46_im * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.log(math.hypot(x_46_im, x_46_re)) t_2 = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.08e-38: tmp = y_46_im * math.fabs(t_2) elif y_46_re <= -4.3e-138: tmp = t_0 elif y_46_re <= 1.55e-219: tmp = y_46_im * t_1 elif y_46_re <= 3600000000000.0: tmp = t_0 else: tmp = y_46_im * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.08e-38) tmp = Float64(y_46_im * abs(t_2)); elseif (y_46_re <= -4.3e-138) tmp = t_0; elseif (y_46_re <= 1.55e-219) tmp = Float64(y_46_im * t_1); elseif (y_46_re <= 3600000000000.0) tmp = t_0; else tmp = Float64(y_46_im * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re))); t_1 = log(hypot(x_46_im, x_46_re)); t_2 = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1.08e-38) tmp = y_46_im * abs(t_2); elseif (y_46_re <= -4.3e-138) tmp = t_0; elseif (y_46_re <= 1.55e-219) tmp = y_46_im * t_1; elseif (y_46_re <= 3600000000000.0) tmp = t_0; else tmp = y_46_im * t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.08e-38], N[(y$46$im * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -4.3e-138], t$95$0, If[LessEqual[y$46$re, 1.55e-219], N[(y$46$im * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 3600000000000.0], t$95$0, N[(y$46$im * t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.08 \cdot 10^{-38}:\\
\;\;\;\;y.im \cdot \left|t_2\right|\\
\mathbf{elif}\;y.re \leq -4.3 \cdot 10^{-138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{-219}:\\
\;\;\;\;y.im \cdot t_1\\
\mathbf{elif}\;y.re \leq 3600000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot t_2\\
\end{array}
\end{array}
if y.re < -1.08e-38Initial program 36.6%
exp-diff30.1%
exp-to-pow30.1%
hypot-def30.1%
*-commutative30.1%
exp-prod28.6%
fma-def28.6%
hypot-def62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in y.im around inf 23.5%
unpow223.5%
unpow223.5%
hypot-def57.2%
Simplified57.2%
Taylor expanded in y.im around 0 32.6%
unpow232.6%
unpow232.6%
hypot-def70.4%
unpow270.4%
unpow270.4%
hypot-def71.7%
Simplified71.7%
add-sqr-sqrt65.1%
sqrt-unprod80.8%
pow280.8%
Applied egg-rr80.8%
unpow280.8%
rem-sqrt-square80.8%
Simplified80.8%
if -1.08e-38 < y.re < -4.3e-138 or 1.5499999999999999e-219 < y.re < 3.6e12Initial program 46.2%
fma-neg46.2%
hypot-def46.2%
distribute-rgt-neg-out46.2%
fma-def46.2%
hypot-def89.8%
*-commutative89.8%
Simplified89.8%
Taylor expanded in y.re around 0 87.6%
neg-mul-187.6%
distribute-rgt-neg-in87.6%
Simplified87.6%
Taylor expanded in y.im around 0 63.8%
if -4.3e-138 < y.re < 1.5499999999999999e-219Initial program 58.6%
exp-diff58.6%
exp-to-pow58.6%
hypot-def58.6%
*-commutative58.6%
exp-prod58.6%
fma-def58.6%
hypot-def90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y.im around inf 55.5%
unpow255.5%
unpow255.5%
hypot-def87.5%
Simplified87.5%
Taylor expanded in y.im around 0 34.9%
unpow234.9%
unpow234.9%
hypot-def35.9%
unpow235.9%
unpow235.9%
hypot-def48.3%
Simplified48.3%
Taylor expanded in y.re around 0 35.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
hypot-def35.2%
unpow235.2%
unpow235.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
Simplified48.3%
if 3.6e12 < y.re Initial program 50.0%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod44.6%
fma-def44.6%
hypot-def62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in y.im around inf 46.4%
unpow246.4%
unpow246.4%
hypot-def71.4%
Simplified71.4%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
unpow269.8%
hypot-def73.3%
unpow273.3%
unpow273.3%
hypot-def73.3%
Simplified73.3%
Final simplification68.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.re (atan2 x.im x.re)))))
(t_1 (log (hypot x.im x.re)))
(t_2 (* y.im (* t_1 (pow (hypot x.im x.re) y.re)))))
(if (<= y.re -2.55)
t_2
(if (<= y.re -4.3e-138)
t_0
(if (<= y.re 1.05e-218)
(* y.im t_1)
(if (<= y.re 600000000000.0) t_0 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = log(hypot(x_46_im, x_46_re));
double t_2 = y_46_im * (t_1 * pow(hypot(x_46_im, x_46_re), y_46_re));
double tmp;
if (y_46_re <= -2.55) {
tmp = t_2;
} else if (y_46_re <= -4.3e-138) {
tmp = t_0;
} else if (y_46_re <= 1.05e-218) {
tmp = y_46_im * t_1;
} else if (y_46_re <= 600000000000.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_2 = y_46_im * (t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
double tmp;
if (y_46_re <= -2.55) {
tmp = t_2;
} else if (y_46_re <= -4.3e-138) {
tmp = t_0;
} else if (y_46_re <= 1.05e-218) {
tmp = y_46_im * t_1;
} else if (y_46_re <= 600000000000.0) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.log(math.hypot(x_46_im, x_46_re)) t_2 = y_46_im * (t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) tmp = 0 if y_46_re <= -2.55: tmp = t_2 elif y_46_re <= -4.3e-138: tmp = t_0 elif y_46_re <= 1.05e-218: tmp = y_46_im * t_1 elif y_46_re <= 600000000000.0: tmp = t_0 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))) t_1 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(y_46_im * Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re))) tmp = 0.0 if (y_46_re <= -2.55) tmp = t_2; elseif (y_46_re <= -4.3e-138) tmp = t_0; elseif (y_46_re <= 1.05e-218) tmp = Float64(y_46_im * t_1); elseif (y_46_re <= 600000000000.0) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_re * atan2(x_46_im, x_46_re))); t_1 = log(hypot(x_46_im, x_46_re)); t_2 = y_46_im * (t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); tmp = 0.0; if (y_46_re <= -2.55) tmp = t_2; elseif (y_46_re <= -4.3e-138) tmp = t_0; elseif (y_46_re <= 1.05e-218) tmp = y_46_im * t_1; elseif (y_46_re <= 600000000000.0) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.55], t$95$2, If[LessEqual[y$46$re, -4.3e-138], t$95$0, If[LessEqual[y$46$re, 1.05e-218], N[(y$46$im * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 600000000000.0], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := y.im \cdot \left(t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{if}\;y.re \leq -2.55:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.re \leq -4.3 \cdot 10^{-138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-218}:\\
\;\;\;\;y.im \cdot t_1\\
\mathbf{elif}\;y.re \leq 600000000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.re < -2.5499999999999998 or 6e11 < y.re Initial program 42.9%
exp-diff37.3%
exp-to-pow37.3%
hypot-def37.3%
*-commutative37.3%
exp-prod35.7%
fma-def35.7%
hypot-def62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in y.im around inf 34.1%
unpow234.1%
unpow234.1%
hypot-def64.3%
Simplified64.3%
Taylor expanded in y.im around 0 50.1%
unpow250.1%
unpow250.1%
hypot-def74.7%
unpow274.7%
unpow274.7%
hypot-def74.7%
Simplified74.7%
if -2.5499999999999998 < y.re < -4.3e-138 or 1.04999999999999997e-218 < y.re < 6e11Initial program 45.0%
fma-neg45.0%
hypot-def45.0%
distribute-rgt-neg-out45.0%
fma-def45.0%
hypot-def87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in y.re around 0 84.5%
neg-mul-184.5%
distribute-rgt-neg-in84.5%
Simplified84.5%
Taylor expanded in y.im around 0 61.4%
if -4.3e-138 < y.re < 1.04999999999999997e-218Initial program 58.6%
exp-diff58.6%
exp-to-pow58.6%
hypot-def58.6%
*-commutative58.6%
exp-prod58.6%
fma-def58.6%
hypot-def90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y.im around inf 55.5%
unpow255.5%
unpow255.5%
hypot-def87.5%
Simplified87.5%
Taylor expanded in y.im around 0 34.9%
unpow234.9%
unpow234.9%
hypot-def35.9%
unpow235.9%
unpow235.9%
hypot-def48.3%
Simplified48.3%
Taylor expanded in y.re around 0 35.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
hypot-def35.2%
unpow235.2%
unpow235.2%
+-commutative35.2%
unpow235.2%
unpow235.2%
hypot-def48.3%
Simplified48.3%
Final simplification65.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* y.im (* (log (hypot 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) {
return y_46_im * (log(hypot(x_46_im, x_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) * (hypot(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) tmp = y_46_im * (log(hypot(x_46_im, x_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.im \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)
\end{array}
Initial program 46.4%
exp-diff43.7%
exp-to-pow43.7%
hypot-def43.7%
*-commutative43.7%
exp-prod42.8%
fma-def42.8%
hypot-def75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y.im around inf 36.1%
unpow236.1%
unpow236.1%
hypot-def66.7%
Simplified66.7%
Taylor expanded in y.im around 0 33.3%
unpow233.3%
unpow233.3%
hypot-def47.0%
unpow247.0%
unpow247.0%
hypot-def52.7%
Simplified52.7%
Final simplification52.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))) (t_1 (log (/ -1.0 x.re))))
(if (<= x.re -980000.0)
(* y.im (* t_1 (- (exp (* t_1 (- y.re))))))
(if (<= x.re 8.8e-212)
(* y.im (* t_0 (- (exp (* y.re (- t_0))))))
(* y.im (* (log x.re) (pow 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((-1.0 / x_46_im));
double t_1 = log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -980000.0) {
tmp = y_46_im * (t_1 * -exp((t_1 * -y_46_re)));
} else if (x_46_re <= 8.8e-212) {
tmp = y_46_im * (t_0 * -exp((y_46_re * -t_0)));
} else {
tmp = y_46_im * (log(x_46_re) * pow(x_46_re, y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = log(((-1.0d0) / x_46im))
t_1 = log(((-1.0d0) / x_46re))
if (x_46re <= (-980000.0d0)) then
tmp = y_46im * (t_1 * -exp((t_1 * -y_46re)))
else if (x_46re <= 8.8d-212) then
tmp = y_46im * (t_0 * -exp((y_46re * -t_0)))
else
tmp = y_46im * (log(x_46re) * (x_46re ** y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log((-1.0 / x_46_im));
double t_1 = Math.log((-1.0 / x_46_re));
double tmp;
if (x_46_re <= -980000.0) {
tmp = y_46_im * (t_1 * -Math.exp((t_1 * -y_46_re)));
} else if (x_46_re <= 8.8e-212) {
tmp = y_46_im * (t_0 * -Math.exp((y_46_re * -t_0)));
} else {
tmp = y_46_im * (Math.log(x_46_re) * Math.pow(x_46_re, y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) t_1 = math.log((-1.0 / x_46_re)) tmp = 0 if x_46_re <= -980000.0: tmp = y_46_im * (t_1 * -math.exp((t_1 * -y_46_re))) elif x_46_re <= 8.8e-212: tmp = y_46_im * (t_0 * -math.exp((y_46_re * -t_0))) else: tmp = y_46_im * (math.log(x_46_re) * math.pow(x_46_re, y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_im)) t_1 = log(Float64(-1.0 / x_46_re)) tmp = 0.0 if (x_46_re <= -980000.0) tmp = Float64(y_46_im * Float64(t_1 * Float64(-exp(Float64(t_1 * Float64(-y_46_re)))))); elseif (x_46_re <= 8.8e-212) tmp = Float64(y_46_im * Float64(t_0 * Float64(-exp(Float64(y_46_re * Float64(-t_0)))))); else tmp = Float64(y_46_im * Float64(log(x_46_re) * (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) t_0 = log((-1.0 / x_46_im)); t_1 = log((-1.0 / x_46_re)); tmp = 0.0; if (x_46_re <= -980000.0) tmp = y_46_im * (t_1 * -exp((t_1 * -y_46_re))); elseif (x_46_re <= 8.8e-212) tmp = y_46_im * (t_0 * -exp((y_46_re * -t_0))); else tmp = y_46_im * (log(x_46_re) * (x_46_re ^ y_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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -980000.0], N[(y$46$im * N[(t$95$1 * (-N[Exp[N[(t$95$1 * (-y$46$re)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 8.8e-212], N[(y$46$im * N[(t$95$0 * (-N[Exp[N[(y$46$re * (-t$95$0)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(y$46$im * N[(N[Log[x$46$re], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
t_1 := \log \left(\frac{-1}{x.re}\right)\\
\mathbf{if}\;x.re \leq -980000:\\
\;\;\;\;y.im \cdot \left(t_1 \cdot \left(-e^{t_1 \cdot \left(-y.re\right)}\right)\right)\\
\mathbf{elif}\;x.re \leq 8.8 \cdot 10^{-212}:\\
\;\;\;\;y.im \cdot \left(t_0 \cdot \left(-e^{y.re \cdot \left(-t_0\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot \left(\log x.re \cdot {x.re}^{y.re}\right)\\
\end{array}
\end{array}
if x.re < -9.8e5Initial program 28.3%
exp-diff26.8%
exp-to-pow26.8%
hypot-def26.8%
*-commutative26.8%
exp-prod26.8%
fma-def26.8%
hypot-def75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in y.im around inf 21.0%
unpow221.0%
unpow221.0%
hypot-def68.7%
Simplified68.7%
Taylor expanded in y.im around 0 28.1%
unpow228.1%
unpow228.1%
hypot-def49.5%
unpow249.5%
unpow249.5%
hypot-def58.0%
Simplified58.0%
Taylor expanded in x.re around -inf 55.7%
associate-*r*55.7%
mul-1-neg55.7%
*-commutative55.7%
associate-*r*55.7%
mul-1-neg55.7%
Simplified55.7%
if -9.8e5 < x.re < 8.80000000000000012e-212Initial program 58.9%
exp-diff53.7%
exp-to-pow53.7%
hypot-def53.7%
*-commutative53.7%
exp-prod53.7%
fma-def53.7%
hypot-def77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around inf 45.8%
unpow245.8%
unpow245.8%
hypot-def67.8%
Simplified67.8%
Taylor expanded in y.im around 0 33.9%
unpow233.9%
unpow233.9%
hypot-def44.6%
unpow244.6%
unpow244.6%
hypot-def46.8%
Simplified46.8%
Taylor expanded in x.im around -inf 28.9%
associate-*r*28.9%
mul-1-neg28.9%
*-commutative28.9%
associate-*r*28.9%
mul-1-neg28.9%
Simplified28.9%
if 8.80000000000000012e-212 < x.re Initial program 46.6%
exp-diff45.6%
exp-to-pow45.6%
hypot-def45.6%
*-commutative45.6%
exp-prod43.1%
fma-def43.1%
hypot-def73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.im around inf 37.1%
unpow237.1%
unpow237.1%
hypot-def64.2%
Simplified64.2%
Taylor expanded in y.im around 0 36.4%
unpow236.4%
unpow236.4%
hypot-def47.8%
unpow247.8%
unpow247.8%
hypot-def54.9%
Simplified54.9%
Taylor expanded in x.im around 0 46.5%
Final simplification42.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))))
(if (<= x.im -5.6e-204)
(* y.im (* t_0 (- (exp (* y.re (- t_0))))))
(if (<= x.im 1.1e-197)
(* y.im (* (log x.re) (pow x.re y.re)))
(* y.im (* (log x.im) (pow 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((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -5.6e-204) {
tmp = y_46_im * (t_0 * -exp((y_46_re * -t_0)));
} else if (x_46_im <= 1.1e-197) {
tmp = y_46_im * (log(x_46_re) * pow(x_46_re, y_46_re));
} else {
tmp = y_46_im * (log(x_46_im) * pow(x_46_im, y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = log(((-1.0d0) / x_46im))
if (x_46im <= (-5.6d-204)) then
tmp = y_46im * (t_0 * -exp((y_46re * -t_0)))
else if (x_46im <= 1.1d-197) then
tmp = y_46im * (log(x_46re) * (x_46re ** y_46re))
else
tmp = y_46im * (log(x_46im) * (x_46im ** y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log((-1.0 / x_46_im));
double tmp;
if (x_46_im <= -5.6e-204) {
tmp = y_46_im * (t_0 * -Math.exp((y_46_re * -t_0)));
} else if (x_46_im <= 1.1e-197) {
tmp = y_46_im * (Math.log(x_46_re) * Math.pow(x_46_re, y_46_re));
} else {
tmp = y_46_im * (Math.log(x_46_im) * Math.pow(x_46_im, y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_im)) tmp = 0 if x_46_im <= -5.6e-204: tmp = y_46_im * (t_0 * -math.exp((y_46_re * -t_0))) elif x_46_im <= 1.1e-197: tmp = y_46_im * (math.log(x_46_re) * math.pow(x_46_re, y_46_re)) else: tmp = y_46_im * (math.log(x_46_im) * math.pow(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(Float64(-1.0 / x_46_im)) tmp = 0.0 if (x_46_im <= -5.6e-204) tmp = Float64(y_46_im * Float64(t_0 * Float64(-exp(Float64(y_46_re * Float64(-t_0)))))); elseif (x_46_im <= 1.1e-197) tmp = Float64(y_46_im * Float64(log(x_46_re) * (x_46_re ^ y_46_re))); else tmp = Float64(y_46_im * Float64(log(x_46_im) * (x_46_im ^ y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_im)); tmp = 0.0; if (x_46_im <= -5.6e-204) tmp = y_46_im * (t_0 * -exp((y_46_re * -t_0))); elseif (x_46_im <= 1.1e-197) tmp = y_46_im * (log(x_46_re) * (x_46_re ^ y_46_re)); else tmp = y_46_im * (log(x_46_im) * (x_46_im ^ y_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[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -5.6e-204], N[(y$46$im * N[(t$95$0 * (-N[Exp[N[(y$46$re * (-t$95$0)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.1e-197], N[(y$46$im * N[(N[Log[x$46$re], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$im * N[(N[Log[x$46$im], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
\mathbf{if}\;x.im \leq -5.6 \cdot 10^{-204}:\\
\;\;\;\;y.im \cdot \left(t_0 \cdot \left(-e^{y.re \cdot \left(-t_0\right)}\right)\right)\\
\mathbf{elif}\;x.im \leq 1.1 \cdot 10^{-197}:\\
\;\;\;\;y.im \cdot \left(\log x.re \cdot {x.re}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot \left(\log x.im \cdot {x.im}^{y.re}\right)\\
\end{array}
\end{array}
if x.im < -5.60000000000000001e-204Initial program 45.7%
exp-diff41.8%
exp-to-pow41.8%
hypot-def41.8%
*-commutative41.8%
exp-prod41.8%
fma-def41.8%
hypot-def74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around inf 34.7%
unpow234.7%
unpow234.7%
hypot-def64.4%
Simplified64.4%
Taylor expanded in y.im around 0 34.8%
unpow234.8%
unpow234.8%
hypot-def45.8%
unpow245.8%
unpow245.8%
hypot-def53.1%
Simplified53.1%
Taylor expanded in x.im around -inf 44.7%
associate-*r*44.7%
mul-1-neg44.7%
*-commutative44.7%
associate-*r*44.7%
mul-1-neg44.7%
Simplified44.7%
if -5.60000000000000001e-204 < x.im < 1.1e-197Initial program 53.5%
exp-diff53.5%
exp-to-pow53.5%
hypot-def53.5%
*-commutative53.5%
exp-prod49.8%
fma-def49.8%
hypot-def78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in y.im around inf 43.5%
unpow243.5%
unpow243.5%
hypot-def74.2%
Simplified74.2%
Taylor expanded in y.im around 0 48.5%
unpow248.5%
unpow248.5%
hypot-def61.9%
unpow261.9%
unpow261.9%
hypot-def65.1%
Simplified65.1%
Taylor expanded in x.im around 0 34.0%
if 1.1e-197 < x.im Initial program 42.4%
exp-diff39.0%
exp-to-pow39.0%
hypot-def39.0%
*-commutative39.0%
exp-prod39.0%
fma-def39.0%
hypot-def75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around inf 32.6%
unpow232.6%
unpow232.6%
hypot-def64.3%
Simplified64.3%
Taylor expanded in y.im around 0 20.9%
unpow220.9%
unpow220.9%
hypot-def38.1%
unpow238.1%
unpow238.1%
hypot-def43.6%
Simplified43.6%
Taylor expanded in x.re around 0 35.0%
Final simplification38.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -560000.0) (not (<= y.re 0.84))) (* y.im (* (log x.im) (pow x.im y.re))) (* 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 tmp;
if ((y_46_re <= -560000.0) || !(y_46_re <= 0.84)) {
tmp = y_46_im * (log(x_46_im) * pow(x_46_im, y_46_re));
} else {
tmp = y_46_im * log(hypot(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 <= -560000.0) || !(y_46_re <= 0.84)) {
tmp = y_46_im * (Math.log(x_46_im) * Math.pow(x_46_im, y_46_re));
} else {
tmp = y_46_im * Math.log(Math.hypot(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 <= -560000.0) or not (y_46_re <= 0.84): tmp = y_46_im * (math.log(x_46_im) * math.pow(x_46_im, y_46_re)) else: tmp = y_46_im * math.log(math.hypot(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 <= -560000.0) || !(y_46_re <= 0.84)) tmp = Float64(y_46_im * Float64(log(x_46_im) * (x_46_im ^ y_46_re))); else tmp = Float64(y_46_im * log(hypot(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 <= -560000.0) || ~((y_46_re <= 0.84))) tmp = y_46_im * (log(x_46_im) * (x_46_im ^ y_46_re)); else tmp = y_46_im * log(hypot(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, -560000.0], N[Not[LessEqual[y$46$re, 0.84]], $MachinePrecision]], N[(y$46$im * N[(N[Log[x$46$im], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -560000 \lor \neg \left(y.re \leq 0.84\right):\\
\;\;\;\;y.im \cdot \left(\log x.im \cdot {x.im}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -5.6e5 or 0.839999999999999969 < y.re Initial program 43.3%
exp-diff37.8%
exp-to-pow37.8%
hypot-def37.8%
*-commutative37.8%
exp-prod36.2%
fma-def36.2%
hypot-def63.8%
*-commutative63.8%
Simplified63.8%
Taylor expanded in y.im around inf 34.6%
unpow234.6%
unpow234.6%
hypot-def64.6%
Simplified64.6%
Taylor expanded in y.im around 0 50.5%
unpow250.5%
unpow250.5%
hypot-def74.9%
unpow274.9%
unpow274.9%
hypot-def74.9%
Simplified74.9%
Taylor expanded in x.re around 0 25.4%
if -5.6e5 < y.re < 0.839999999999999969Initial program 49.5%
exp-diff49.5%
exp-to-pow49.5%
hypot-def49.5%
*-commutative49.5%
exp-prod49.2%
fma-def49.2%
hypot-def87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in y.im around inf 37.6%
unpow237.6%
unpow237.6%
hypot-def68.9%
Simplified68.9%
Taylor expanded in y.im around 0 16.4%
unpow216.4%
unpow216.4%
hypot-def19.6%
unpow219.6%
unpow219.6%
hypot-def30.8%
Simplified30.8%
Taylor expanded in y.re around 0 16.7%
+-commutative16.7%
unpow216.7%
unpow216.7%
hypot-def30.8%
hypot-def16.7%
unpow216.7%
unpow216.7%
+-commutative16.7%
unpow216.7%
unpow216.7%
hypot-def30.8%
Simplified30.8%
Final simplification28.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 1.2e-282) (* y.im (log (hypot x.im x.re))) (* y.im (* (log x.re) (pow 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 (x_46_re <= 1.2e-282) {
tmp = y_46_im * log(hypot(x_46_im, x_46_re));
} else {
tmp = y_46_im * (log(x_46_re) * pow(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 (x_46_re <= 1.2e-282) {
tmp = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
} else {
tmp = y_46_im * (Math.log(x_46_re) * Math.pow(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 x_46_re <= 1.2e-282: tmp = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) else: tmp = y_46_im * (math.log(x_46_re) * math.pow(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 (x_46_re <= 1.2e-282) tmp = Float64(y_46_im * log(hypot(x_46_im, x_46_re))); else tmp = Float64(y_46_im * Float64(log(x_46_re) * (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 (x_46_re <= 1.2e-282) tmp = y_46_im * log(hypot(x_46_im, x_46_re)); else tmp = y_46_im * (log(x_46_re) * (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[LessEqual[x$46$re, 1.2e-282], N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$im * N[(N[Log[x$46$re], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 1.2 \cdot 10^{-282}:\\
\;\;\;\;y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y.im \cdot \left(\log x.re \cdot {x.re}^{y.re}\right)\\
\end{array}
\end{array}
if x.re < 1.19999999999999998e-282Initial program 47.0%
exp-diff42.7%
exp-to-pow42.7%
hypot-def42.7%
*-commutative42.7%
exp-prod42.7%
fma-def42.7%
hypot-def77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around inf 34.7%
unpow234.7%
unpow234.7%
hypot-def67.7%
Simplified67.7%
Taylor expanded in y.im around 0 31.5%
unpow231.5%
unpow231.5%
hypot-def45.5%
unpow245.5%
unpow245.5%
hypot-def51.1%
Simplified51.1%
Taylor expanded in y.re around 0 16.8%
+-commutative16.8%
unpow216.8%
unpow216.8%
hypot-def18.2%
hypot-def16.8%
unpow216.8%
unpow216.8%
+-commutative16.8%
unpow216.8%
unpow216.8%
hypot-def18.2%
Simplified18.2%
if 1.19999999999999998e-282 < x.re Initial program 45.8%
exp-diff44.9%
exp-to-pow44.9%
hypot-def44.9%
*-commutative44.9%
exp-prod42.9%
fma-def42.9%
hypot-def73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in y.im around inf 37.9%
unpow237.9%
unpow237.9%
hypot-def65.6%
Simplified65.6%
Taylor expanded in y.im around 0 35.4%
unpow235.4%
unpow235.4%
hypot-def48.9%
unpow248.9%
unpow248.9%
hypot-def54.6%
Simplified54.6%
Taylor expanded in x.im around 0 42.1%
Final simplification29.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_im * log(hypot(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 y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_im * math.log(math.hypot(x_46_im, x_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_im * log(hypot(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_im * log(hypot(x_46_im, x_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 46.4%
exp-diff43.7%
exp-to-pow43.7%
hypot-def43.7%
*-commutative43.7%
exp-prod42.8%
fma-def42.8%
hypot-def75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y.im around inf 36.1%
unpow236.1%
unpow236.1%
hypot-def66.7%
Simplified66.7%
Taylor expanded in y.im around 0 33.3%
unpow233.3%
unpow233.3%
hypot-def47.0%
unpow247.0%
unpow247.0%
hypot-def52.7%
Simplified52.7%
Taylor expanded in y.re around 0 16.0%
+-commutative16.0%
unpow216.0%
unpow216.0%
hypot-def17.1%
hypot-def16.0%
unpow216.0%
unpow216.0%
+-commutative16.0%
unpow216.0%
unpow216.0%
hypot-def17.1%
Simplified17.1%
Final simplification17.1%
herbie shell --seed 2024026
(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)))))