
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.im -98000.0) (not (<= y.im 9.5e-37)))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* y.im (- (atan2 x.im x.re)))))
(cos (* y.im (+ t_0 (/ (* y.re (atan2 x.im x.re)) y.im)))))
(* (pow (hypot x.im x.re) y.re) (cos (* 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_im <= -98000.0) || !(y_46_im <= 9.5e-37)) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * cos((y_46_im * (t_0 + ((y_46_re * atan2(x_46_im, x_46_re)) / y_46_im))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((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_im <= -98000.0) || !(y_46_im <= 9.5e-37)) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * cos(Float64(y_46_im * Float64(t_0 + Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) / y_46_im))))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(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[Or[LessEqual[y$46$im, -98000.0], N[Not[LessEqual[y$46$im, 9.5e-37]], $MachinePrecision]], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[(t$95$0 + N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[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.im \leq -98000 \lor \neg \left(y.im \leq 9.5 \cdot 10^{-37}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \cos \left(y.im \cdot \left(t\_0 + \frac{y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot t\_0\right)\\
\end{array}
\end{array}
if y.im < -98000 or 9.49999999999999927e-37 < y.im Initial program 33.9%
fma-neg33.9%
hypot-define33.9%
distribute-rgt-neg-out33.9%
fma-define33.9%
hypot-define70.7%
*-commutative70.7%
Simplified70.7%
Taylor expanded in y.im around inf 33.9%
unpow233.9%
unpow233.9%
hypot-undefine71.5%
Simplified71.5%
if -98000 < y.im < 9.49999999999999927e-37Initial program 46.6%
fma-neg46.6%
hypot-define46.6%
distribute-rgt-neg-out46.6%
fma-define46.6%
hypot-define82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in y.im around 0 62.7%
unpow262.7%
unpow262.7%
hypot-undefine82.8%
Simplified82.8%
add-cube-cbrt82.8%
pow382.8%
Applied egg-rr82.8%
Taylor expanded in y.im around inf 50.0%
unpow250.0%
unpow250.0%
hypot-undefine94.8%
Simplified94.8%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -4.8e-9)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 205.0)
(* t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -4.8e-9) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 205.0) {
tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((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_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -4.8e-9) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 205.0) {
tmp = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): 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_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -4.8e-9: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 205.0: tmp = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -4.8e-9) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 205.0) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) 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_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -4.8e-9) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 205.0) tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = t_0 * 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[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]}, Block[{t$95$1 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e-9], N[(t$95$0 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 205.0], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 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_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 205:\\
\;\;\;\;t\_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -4.8e-9Initial program 51.7%
Taylor expanded in y.im around 0 90.1%
if -4.8e-9 < y.re < 205Initial program 38.7%
fma-neg38.7%
hypot-define38.7%
distribute-rgt-neg-out38.7%
fma-define38.7%
hypot-define79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in y.re around 0 38.7%
*-commutative38.7%
unpow238.7%
unpow238.7%
hypot-undefine77.9%
neg-mul-177.9%
distribute-rgt-neg-in77.9%
Simplified77.9%
if 205 < y.re Initial program 30.2%
Taylor expanded in y.re around 0 36.5%
*-commutative36.5%
unpow236.5%
unpow236.5%
hypot-undefine74.7%
Simplified74.7%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -7e-8)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 6.8e-8)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* (pow (hypot x.im x.re) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -7e-8) {
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)))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 6.8e-8) {
tmp = 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) * 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.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -7e-8) {
tmp = 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)))) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 6.8e-8) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -7e-8: tmp = 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)))) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 6.8e-8: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -7e-8) 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)))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 6.8e-8) tmp = Float64(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) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -7e-8) 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)))) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 6.8e-8) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -7e-8], 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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.8e-8], N[(t$95$0 * 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] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{-8}:\\
\;\;\;\;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 \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-8}:\\
\;\;\;\;t\_0 \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 t\_0\\
\end{array}
\end{array}
if y.re < -7.00000000000000048e-8Initial program 51.7%
Taylor expanded in y.im around 0 90.1%
if -7.00000000000000048e-8 < y.re < 6.8e-8Initial program 39.3%
fma-neg39.3%
hypot-define39.3%
distribute-rgt-neg-out39.3%
fma-define39.3%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 6.8e-8 < y.re Initial program 29.2%
fma-neg29.2%
hypot-define29.2%
distribute-rgt-neg-out29.2%
fma-define29.2%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-undefine55.7%
Simplified55.7%
add-cube-cbrt49.3%
pow352.4%
Applied egg-rr52.4%
Taylor expanded in y.im around inf 33.9%
unpow233.9%
unpow233.9%
hypot-undefine71.1%
Simplified71.1%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.1e-10)
(* t_1 (cos (* y.re (pow (cbrt (atan2 x.im x.re)) 3.0))))
(if (<= y.re 6.2e-9)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.1e-10) {
tmp = t_1 * cos((y_46_re * pow(cbrt(atan2(x_46_im, x_46_re)), 3.0)));
} else if (y_46_re <= 6.2e-9) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * 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.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.1e-10) {
tmp = t_1 * Math.cos((y_46_re * Math.pow(Math.cbrt(Math.atan2(x_46_im, x_46_re)), 3.0)));
} else if (y_46_re <= 6.2e-9) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.1e-10) tmp = Float64(t_1 * cos(Float64(y_46_re * (cbrt(atan(x_46_im, x_46_re)) ^ 3.0)))); elseif (y_46_re <= 6.2e-9) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1e-10], N[(t$95$1 * N[Cos[N[(y$46$re * N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-9], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;t\_1 \cdot \cos \left(y.re \cdot {\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}\right)\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.09999999999999995e-10Initial program 51.7%
fma-neg51.7%
hypot-define51.7%
distribute-rgt-neg-out51.7%
fma-define51.7%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 86.8%
unpow286.8%
unpow286.8%
hypot-undefine86.8%
Simplified86.8%
add-cube-cbrt90.1%
pow388.4%
Applied egg-rr88.4%
if -1.09999999999999995e-10 < y.re < 6.2000000000000001e-9Initial program 39.3%
fma-neg39.3%
hypot-define39.3%
distribute-rgt-neg-out39.3%
fma-define39.3%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 6.2000000000000001e-9 < y.re Initial program 29.2%
fma-neg29.2%
hypot-define29.2%
distribute-rgt-neg-out29.2%
fma-define29.2%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-undefine55.7%
Simplified55.7%
add-cube-cbrt49.3%
pow352.4%
Applied egg-rr52.4%
Taylor expanded in y.im around inf 33.9%
unpow233.9%
unpow233.9%
hypot-undefine71.1%
Simplified71.1%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.8e-10)
(* t_1 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 1.6e-5)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(* t_1 t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.8e-10) {
tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.6e-5) {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * 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.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.8e-10) {
tmp = t_1 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.6e-5) {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.8e-10: tmp = t_1 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.6e-5: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.8e-10) tmp = Float64(t_1 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.6e-5) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.8e-10) tmp = t_1 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.6e-5) tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = t_1 * 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[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-10], N[(t$95$1 * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-5], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-10}:\\
\;\;\;\;t\_1 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-5}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.8e-10Initial program 51.7%
fma-neg51.7%
hypot-define51.7%
distribute-rgt-neg-out51.7%
fma-define51.7%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.im around 0 86.8%
unpow286.8%
unpow286.8%
hypot-undefine86.8%
Simplified86.8%
if -1.8e-10 < y.re < 1.59999999999999993e-5Initial program 39.3%
fma-neg39.3%
hypot-define39.3%
distribute-rgt-neg-out39.3%
fma-define39.3%
hypot-define79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in y.re around 0 39.3%
*-commutative39.3%
unpow239.3%
unpow239.3%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 1.59999999999999993e-5 < y.re Initial program 29.2%
fma-neg29.2%
hypot-define29.2%
distribute-rgt-neg-out29.2%
fma-define29.2%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 55.5%
unpow255.5%
unpow255.5%
hypot-undefine55.7%
Simplified55.7%
add-cube-cbrt49.3%
pow352.4%
Applied egg-rr52.4%
Taylor expanded in y.im around inf 33.9%
unpow233.9%
unpow233.9%
hypot-undefine71.1%
Simplified71.1%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -4.7e-17) (exp (- (* (log (/ -1.0 x.re)) (- y.re)) (* y.im (atan2 x.im x.re)))) (* (pow (hypot x.im x.re) y.re) (cos (* 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 (x_46_re <= -4.7e-17) {
tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((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 (x_46_re <= -4.7e-17) {
tmp = Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((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 x_46_re <= -4.7e-17: tmp = math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((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 (x_46_re <= -4.7e-17) tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(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 (x_46_re <= -4.7e-17) tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((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[LessEqual[x$46$re, -4.7e-17], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - 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[Cos[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}
\mathbf{if}\;x.re \leq -4.7 \cdot 10^{-17}:\\
\;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if x.re < -4.7e-17Initial program 24.3%
fma-neg24.3%
hypot-define24.3%
distribute-rgt-neg-out24.3%
fma-define24.3%
hypot-define75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x.re around -inf 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
*-commutative74.3%
+-commutative74.3%
neg-mul-174.3%
unsub-neg74.3%
mul-1-neg74.3%
distribute-rgt-neg-in74.3%
Simplified74.3%
Taylor expanded in y.re around 0 79.8%
cos-neg79.8%
Simplified79.8%
Taylor expanded in y.im around 0 78.4%
if -4.7e-17 < x.re Initial program 45.8%
fma-neg45.8%
hypot-define45.8%
distribute-rgt-neg-out45.8%
fma-define45.8%
hypot-define76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in y.im around 0 55.9%
unpow255.9%
unpow255.9%
hypot-undefine59.8%
Simplified59.8%
add-cube-cbrt57.8%
pow358.3%
Applied egg-rr58.3%
Taylor expanded in y.im around inf 37.9%
unpow237.9%
unpow237.9%
hypot-undefine63.1%
Simplified63.1%
Final simplification67.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -1.32e-157) (exp (- (* (log (/ -1.0 x.re)) (- y.re)) (* y.im (atan2 x.im x.re)))) (* (pow (hypot x.im x.re) y.re) (cos (* y.re (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1.32e-157) {
tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1.32e-157) {
tmp = Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -1.32e-157: tmp = math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -1.32e-157) tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -1.32e-157) tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -1.32e-157], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - 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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1.32 \cdot 10^{-157}:\\
\;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if x.re < -1.3200000000000001e-157Initial program 37.3%
fma-neg37.3%
hypot-define37.3%
distribute-rgt-neg-out37.3%
fma-define37.3%
hypot-define77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in x.re around -inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
*-commutative71.7%
+-commutative71.7%
neg-mul-171.7%
unsub-neg71.7%
mul-1-neg71.7%
distribute-rgt-neg-in71.7%
Simplified71.7%
Taylor expanded in y.re around 0 74.6%
cos-neg74.6%
Simplified74.6%
Taylor expanded in y.im around 0 76.6%
if -1.3200000000000001e-157 < x.re Initial program 41.2%
fma-neg41.2%
hypot-define41.2%
distribute-rgt-neg-out41.2%
fma-define41.2%
hypot-define75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in y.im around 0 51.2%
unpow251.2%
unpow251.2%
hypot-undefine55.8%
Simplified55.8%
Final simplification64.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= x.re -5.3e-202)
(exp (- (* (log (/ -1.0 x.re)) (- y.re)) (* y.im (atan2 x.im x.re))))
(if (<= x.re 2.2e-67) (* t_0 (pow x.im y.re)) (* t_0 (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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5.3e-202) {
tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re))));
} else if (x_46_re <= 2.2e-67) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 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) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= (-5.3d-202)) then
tmp = exp(((log(((-1.0d0) / x_46re)) * -y_46re) - (y_46im * atan2(x_46im, x_46re))))
else if (x_46re <= 2.2d-67) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (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.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -5.3e-202) {
tmp = Math.exp(((Math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
} else if (x_46_re <= 2.2e-67) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 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.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -5.3e-202: tmp = math.exp(((math.log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * math.atan2(x_46_im, x_46_re)))) elif x_46_re <= 2.2e-67: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * 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 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -5.3e-202) tmp = exp(Float64(Float64(log(Float64(-1.0 / x_46_re)) * Float64(-y_46_re)) - Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (x_46_re <= 2.2e-67) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (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 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -5.3e-202) tmp = exp(((log((-1.0 / x_46_re)) * -y_46_re) - (y_46_im * atan2(x_46_im, x_46_re)))); elseif (x_46_re <= 2.2e-67) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -5.3e-202], N[Exp[N[(N[(N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision] * (-y$46$re)), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$re, 2.2e-67], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -5.3 \cdot 10^{-202}:\\
\;\;\;\;e^{\log \left(\frac{-1}{x.re}\right) \cdot \left(-y.re\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;x.re \leq 2.2 \cdot 10^{-67}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -5.30000000000000042e-202Initial program 37.4%
fma-neg37.4%
hypot-define37.4%
distribute-rgt-neg-out37.4%
fma-define37.4%
hypot-define78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in x.re around -inf 71.2%
+-commutative71.2%
mul-1-neg71.2%
unsub-neg71.2%
*-commutative71.2%
+-commutative71.2%
neg-mul-171.2%
unsub-neg71.2%
mul-1-neg71.2%
distribute-rgt-neg-in71.2%
Simplified71.2%
Taylor expanded in y.re around 0 74.0%
cos-neg74.0%
Simplified74.0%
Taylor expanded in y.im around 0 75.9%
if -5.30000000000000042e-202 < x.re < 2.2000000000000001e-67Initial program 46.5%
fma-neg46.5%
hypot-define46.5%
distribute-rgt-neg-out46.5%
fma-define46.5%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.im around 0 55.2%
unpow255.2%
unpow255.2%
hypot-undefine59.8%
Simplified59.8%
Taylor expanded in x.re around 0 52.1%
if 2.2000000000000001e-67 < x.re Initial program 34.1%
fma-neg34.1%
hypot-define34.1%
distribute-rgt-neg-out34.1%
fma-define34.1%
hypot-define71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in y.im around 0 46.4%
unpow246.4%
unpow246.4%
hypot-undefine46.8%
Simplified46.8%
Taylor expanded in x.im around 0 46.8%
Final simplification60.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -2.6e+15)
(* t_0 (pow x.im y.re))
(if (<= y.re 1.85e+137)
(+ 1.0 (log (pow (hypot x.re x.im) y.re)))
(* t_0 (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 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.6e+15) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.85e+137) {
tmp = 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = t_0 * 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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -2.6e+15) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 1.85e+137) {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = t_0 * 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.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -2.6e+15: tmp = t_0 * math.pow(x_46_im, y_46_re) elif y_46_re <= 1.85e+137: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) else: tmp = t_0 * 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 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -2.6e+15) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 1.85e+137) tmp = Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(t_0 * (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 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -2.6e+15) tmp = t_0 * (x_46_im ^ y_46_re); elseif (y_46_re <= 1.85e+137) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = t_0 * (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[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+15], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.85e+137], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+15}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.85 \cdot 10^{+137}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -2.6e15Initial program 52.5%
fma-neg52.5%
hypot-define52.5%
distribute-rgt-neg-out52.5%
fma-define52.5%
hypot-define88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in y.im around 0 88.2%
unpow288.2%
unpow288.2%
hypot-undefine88.2%
Simplified88.2%
Taylor expanded in x.re around 0 66.5%
if -2.6e15 < y.re < 1.8500000000000001e137Initial program 35.9%
fma-neg35.9%
hypot-define35.9%
distribute-rgt-neg-out35.9%
fma-define35.9%
hypot-define74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in y.im around 0 33.0%
unpow233.0%
unpow233.0%
hypot-undefine43.5%
Simplified43.5%
Taylor expanded in y.re around 0 29.8%
+-commutative29.8%
unpow229.8%
unpow229.8%
hypot-undefine36.5%
Simplified36.5%
*-commutative36.5%
add-log-exp46.6%
exp-to-pow46.6%
Applied egg-rr46.6%
if 1.8500000000000001e137 < y.re Initial program 35.1%
fma-neg35.1%
hypot-define35.1%
distribute-rgt-neg-out35.1%
fma-define35.1%
hypot-define64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in y.im around 0 56.8%
unpow256.8%
unpow256.8%
hypot-undefine56.8%
Simplified56.8%
Taylor expanded in x.im around 0 51.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.05e+15) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 1.0 (log (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 tmp;
if (y_46_re <= -1.05e+15) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + log(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 tmp;
if (y_46_re <= -1.05e+15) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + Math.log(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): tmp = 0 if y_46_re <= -1.05e+15: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + math.log(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) tmp = 0.0 if (y_46_re <= -1.05e+15) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + log((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) tmp = 0.0; if (y_46_re <= -1.05e+15) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + log((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_] := If[LessEqual[y$46$re, -1.05e+15], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{+15}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -1.05e15Initial program 52.5%
fma-neg52.5%
hypot-define52.5%
distribute-rgt-neg-out52.5%
fma-define52.5%
hypot-define88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in y.im around 0 88.2%
unpow288.2%
unpow288.2%
hypot-undefine88.2%
Simplified88.2%
Taylor expanded in x.re around 0 66.5%
if -1.05e15 < y.re Initial program 35.7%
fma-neg35.7%
hypot-define35.7%
distribute-rgt-neg-out35.7%
fma-define35.7%
hypot-define72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in y.im around 0 37.4%
unpow237.4%
unpow237.4%
hypot-undefine46.0%
Simplified46.0%
Taylor expanded in y.re around 0 29.1%
+-commutative29.1%
unpow229.1%
unpow229.1%
hypot-undefine30.2%
Simplified30.2%
*-commutative30.2%
add-log-exp45.5%
exp-to-pow45.5%
Applied egg-rr45.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 8e+109) (cos (* y.im (log (hypot x.re x.im)))) (+ 1.0 (* y.re (log1p (+ (hypot x.re x.im) -1.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 8e+109) {
tmp = cos((y_46_im * log(hypot(x_46_re, x_46_im))));
} else {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0)));
}
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 <= 8e+109) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im))));
} else {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 8e+109: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) else: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 8e+109) tmp = cos(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))); else tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 8e+109], N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 8 \cdot 10^{+109}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right)\\
\end{array}
\end{array}
if y.im < 7.99999999999999985e109Initial program 40.5%
fma-neg40.5%
hypot-define40.5%
distribute-rgt-neg-out40.5%
fma-define40.5%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 56.9%
unpow256.9%
unpow256.9%
hypot-undefine63.8%
Simplified63.8%
Taylor expanded in y.re around 0 15.4%
+-commutative15.4%
unpow215.4%
unpow215.4%
hypot-undefine28.3%
Simplified28.3%
if 7.99999999999999985e109 < y.im Initial program 35.1%
fma-neg35.1%
hypot-define35.1%
distribute-rgt-neg-out35.1%
fma-define35.1%
hypot-define55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 21.9%
unpow221.9%
unpow221.9%
hypot-undefine20.4%
Simplified20.4%
Taylor expanded in y.re around 0 5.1%
+-commutative5.1%
unpow25.1%
unpow25.1%
hypot-undefine3.9%
Simplified3.9%
log1p-expm1-u13.2%
expm1-undefine13.2%
add-exp-log13.2%
Applied egg-rr13.2%
Final simplification25.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (log (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) {
return 1.0 + log(pow(hypot(x_46_re, x_46_im), y_46_re));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + log((hypot(x_46_re, x_46_im) ^ y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)
\end{array}
Initial program 39.6%
fma-neg39.6%
hypot-define39.6%
distribute-rgt-neg-out39.6%
fma-define39.6%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.im around 0 49.1%
unpow249.1%
unpow249.1%
hypot-undefine55.7%
Simplified55.7%
Taylor expanded in y.re around 0 23.6%
+-commutative23.6%
unpow223.6%
unpow223.6%
hypot-undefine23.9%
Simplified23.9%
*-commutative23.9%
add-log-exp37.7%
exp-to-pow37.7%
Applied egg-rr37.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* (log (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) {
return 1.0 + (log(hypot(x_46_re, x_46_im)) * y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 + (Math.log(Math.hypot(x_46_re, x_46_im)) * y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 + (math.log(math.hypot(x_46_re, x_46_im)) * y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 + Float64(log(hypot(x_46_re, x_46_im)) * y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 + (log(hypot(x_46_re, x_46_im)) * y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re
\end{array}
Initial program 39.6%
fma-neg39.6%
hypot-define39.6%
distribute-rgt-neg-out39.6%
fma-define39.6%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.im around 0 49.1%
unpow249.1%
unpow249.1%
hypot-undefine55.7%
Simplified55.7%
Taylor expanded in y.re around 0 23.6%
+-commutative23.6%
unpow223.6%
unpow223.6%
hypot-undefine23.9%
Simplified23.9%
Final simplification23.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
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 = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 39.6%
fma-neg39.6%
hypot-define39.6%
distribute-rgt-neg-out39.6%
fma-define39.6%
hypot-define76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.im around 0 49.1%
unpow249.1%
unpow249.1%
hypot-undefine55.7%
Simplified55.7%
Taylor expanded in y.re around 0 23.6%
herbie shell --seed 2024141
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))