
(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 17 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.re -1.06e+98) (not (<= y.re 1.15e+54)))
(*
(exp
(-
(* y.re (log1p (+ (hypot x.re x.im) -1.0)))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im t_0)))
(*
(pow E (* y.re (- t_0 (* y.im (/ (atan2 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 t_0 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -1.06e+98) || !(y_46_re <= 1.15e+54)) {
tmp = exp(((y_46_re * log1p((hypot(x_46_re, x_46_im) + -1.0))) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * t_0));
} else {
tmp = pow(((double) M_E), (y_46_re * (t_0 - (y_46_im * (atan2(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 t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -1.06e+98) || !(y_46_re <= 1.15e+54)) {
tmp = Math.exp(((y_46_re * Math.log1p((Math.hypot(x_46_re, x_46_im) + -1.0))) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((y_46_im * t_0));
} else {
tmp = Math.pow(Math.E, (y_46_re * (t_0 - (y_46_im * (Math.atan2(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): t_0 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if (y_46_re <= -1.06e+98) or not (y_46_re <= 1.15e+54): tmp = math.exp(((y_46_re * math.log1p((math.hypot(x_46_re, x_46_im) + -1.0))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((y_46_im * t_0)) else: tmp = math.pow(math.e, (y_46_re * (t_0 - (y_46_im * (math.atan2(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) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.06e+98) || !(y_46_re <= 1.15e+54)) tmp = Float64(exp(Float64(Float64(y_46_re * log1p(Float64(hypot(x_46_re, x_46_im) + -1.0))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * t_0))); else tmp = Float64((exp(1) ^ Float64(y_46_re * Float64(t_0 - Float64(y_46_im * Float64(atan(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
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$re, -1.06e+98], N[Not[LessEqual[y$46$re, 1.15e+54]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[E, N[(y$46$re * N[(t$95$0 - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1.06 \cdot 10^{+98} \lor \neg \left(y.re \leq 1.15 \cdot 10^{+54}\right):\\
\;\;\;\;e^{y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.re, x.im\right) + -1\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(y.re \cdot \left(t\_0 - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -1.0600000000000001e98 or 1.14999999999999997e54 < y.re Initial program 44.2%
Taylor expanded in y.re around 0 49.5%
*-commutative49.5%
unpow249.5%
unpow249.5%
hypot-undefine83.2%
Simplified83.2%
log1p-expm1-u82.2%
hypot-define84.2%
expm1-undefine84.2%
add-exp-log84.2%
Applied egg-rr84.2%
if -1.0600000000000001e98 < y.re < 1.14999999999999997e54Initial program 37.4%
cancel-sign-sub-inv37.4%
fma-define37.4%
hypot-define37.4%
distribute-lft-neg-in37.4%
distribute-rgt-neg-out37.4%
fma-define37.4%
hypot-define83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in y.re around -inf 50.8%
mul-1-neg50.8%
fma-define50.8%
unpow250.8%
unpow250.8%
hypot-undefine83.1%
associate-/l*83.1%
Simplified83.1%
*-un-lft-identity83.1%
exp-prod83.2%
distribute-rgt-neg-in83.2%
Applied egg-rr83.2%
exp-1-e83.2%
hypot-undefine50.8%
unpow250.8%
unpow250.8%
associate-*r/50.8%
fma-define50.8%
+-commutative50.8%
mul-1-neg50.8%
unsub-neg50.8%
associate-*r/50.8%
Simplified83.2%
Taylor expanded in y.im around 0 84.1%
*-commutative84.1%
Simplified84.1%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (fma y.re (atan2 x.im x.re) (* y.im t_3)))))
(*
(pow
E
(*
y.re
(-
t_3
(*
y.im
(/ (pow (pow (cbrt (cbrt (atan2 x.im x.re))) 3.0) 3.0) y.re)))))
(cos (fma (log (hypot x.re x.im)) y.im t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_3))));
} else {
tmp = pow(((double) M_E), (y_46_re * (t_3 - (y_46_im * (pow(pow(cbrt(cbrt(atan2(x_46_im, x_46_re))), 3.0), 3.0) / y_46_re))))) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_3))))); else tmp = Float64((exp(1) ^ Float64(y_46_re * Float64(t_3 - Float64(y_46_im * Float64(((cbrt(cbrt(atan(x_46_im, x_46_re))) ^ 3.0) ^ 3.0) / y_46_re))))) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[E, N[(y$46$re * N[(t$95$3 - N[(y$46$im * N[(N[Power[N[Power[N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_3\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(y.re \cdot \left(t\_3 - y.im \cdot \frac{{\left({\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{3}\right)}^{3}}{y.re}\right)\right)} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
*-commutative62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
*-un-lft-identity85.3%
exp-prod85.3%
distribute-rgt-neg-in85.3%
Applied egg-rr85.3%
exp-1-e85.3%
hypot-undefine62.1%
unpow262.1%
unpow262.1%
associate-*r/62.1%
fma-define62.1%
+-commutative62.1%
mul-1-neg62.1%
unsub-neg62.1%
associate-*r/62.1%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
add-cube-cbrt85.4%
pow385.4%
Applied egg-rr85.4%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (fma y.re (atan2 x.im x.re) (* y.im t_3)))))
(*
(pow
E
(* y.re (- t_3 (* y.im (/ (pow (cbrt (atan2 x.im x.re)) 3.0) y.re)))))
(expm1 (log1p (cos (fma (log (hypot x.re x.im)) y.im t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_3))));
} else {
tmp = pow(((double) M_E), (y_46_re * (t_3 - (y_46_im * (pow(cbrt(atan2(x_46_im, x_46_re)), 3.0) / y_46_re))))) * expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_3))))); else tmp = Float64((exp(1) ^ Float64(y_46_re * Float64(t_3 - Float64(y_46_im * Float64((cbrt(atan(x_46_im, x_46_re)) ^ 3.0) / y_46_re))))) * expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[E, N[(y$46$re * N[(t$95$3 - N[(y$46$im * N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(Exp[N[Log[1 + N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_3\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(y.re \cdot \left(t\_3 - y.im \cdot \frac{{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}{y.re}\right)\right)} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
*-commutative62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
*-un-lft-identity85.3%
exp-prod85.3%
distribute-rgt-neg-in85.3%
Applied egg-rr85.3%
exp-1-e85.3%
hypot-undefine62.1%
unpow262.1%
unpow262.1%
associate-*r/62.1%
fma-define62.1%
+-commutative62.1%
mul-1-neg62.1%
unsub-neg62.1%
associate-*r/62.1%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
expm1-log1p-u85.4%
Applied egg-rr85.4%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (fma y.re (atan2 x.im x.re) (* y.im t_3)))))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(pow
E
(*
y.re
(- t_3 (* y.im (/ (pow (cbrt (atan2 x.im x.re)) 3.0) y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_3))));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(((double) M_E), (y_46_re * (t_3 - (y_46_im * (pow(cbrt(atan2(x_46_im, x_46_re)), 3.0) / y_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_3))))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (exp(1) ^ Float64(y_46_re * Float64(t_3 - Float64(y_46_im * Float64((cbrt(atan(x_46_im, x_46_re)) ^ 3.0) / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[E, N[(y$46$re * N[(t$95$3 - N[(y$46$im * N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_3\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {e}^{\left(y.re \cdot \left(t\_3 - y.im \cdot \frac{{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}{y.re}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
*-commutative62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
*-un-lft-identity85.3%
exp-prod85.3%
distribute-rgt-neg-in85.3%
Applied egg-rr85.3%
exp-1-e85.3%
hypot-undefine62.1%
unpow262.1%
unpow262.1%
associate-*r/62.1%
fma-define62.1%
+-commutative62.1%
mul-1-neg62.1%
unsub-neg62.1%
associate-*r/62.1%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (fma y.re (atan2 x.im x.re) (* y.im t_3)))))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(pow E (* y.re (- t_3 (* 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_3))));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(((double) M_E), (y_46_re * (t_3 - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_3))))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (exp(1) ^ Float64(y_46_re * Float64(t_3 - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[E, N[(y$46$re * N[(t$95$3 - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_3\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {e}^{\left(y.re \cdot \left(t\_3 - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
*-commutative62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
*-un-lft-identity85.3%
exp-prod85.3%
distribute-rgt-neg-in85.3%
Applied egg-rr85.3%
exp-1-e85.3%
hypot-undefine62.1%
unpow262.1%
unpow262.1%
associate-*r/62.1%
fma-define62.1%
+-commutative62.1%
mul-1-neg62.1%
unsub-neg62.1%
associate-*r/62.1%
Simplified85.3%
Final simplification83.3%
(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 -0.000135)
(*
t_0
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im))))
(if (<= y.re 220000000.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(pow
(pow (* t_0 (pow (hypot x.im x.re) y.re)) 3.0)
0.3333333333333333)))))
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 <= -0.000135) {
tmp = t_0 * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 220000000.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow((t_0 * pow(hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
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 <= -0.000135) {
tmp = t_0 * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 220000000.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.pow((t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333);
}
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 <= -0.000135: tmp = t_0 * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_re <= 220000000.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.pow((t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re)), 3.0), 0.3333333333333333) 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 <= -0.000135) tmp = Float64(t_0 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 220000000.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = (Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; 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 <= -0.000135) tmp = t_0 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))); elseif (y_46_re <= 220000000.0) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = ((t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)) ^ 3.0) ^ 0.3333333333333333; 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, -0.000135], N[(t$95$0 * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 220000000.0], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $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 -0.000135:\\
\;\;\;\;t\_0 \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 220000000:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)}^{3}\right)}^{0.3333333333333333}\\
\end{array}
\end{array}
if y.re < -1.35000000000000002e-4Initial program 48.6%
exp-diff43.1%
exp-to-pow43.1%
hypot-define43.1%
*-commutative43.1%
exp-prod40.3%
fma-define40.3%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 83.4%
Taylor expanded in y.im around 0 86.2%
*-commutative88.9%
Simplified86.2%
if -1.35000000000000002e-4 < y.re < 2.2e8Initial program 34.5%
cancel-sign-sub-inv34.5%
fma-define34.5%
hypot-define34.5%
distribute-lft-neg-in34.5%
distribute-rgt-neg-out34.5%
fma-define34.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around 0 33.9%
*-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 2.2e8 < y.re Initial program 41.5%
cancel-sign-sub-inv41.5%
fma-define41.5%
hypot-define41.5%
distribute-lft-neg-in41.5%
distribute-rgt-neg-out41.5%
fma-define41.5%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 60.5%
unpow260.5%
unpow260.5%
hypot-undefine60.5%
Simplified60.5%
add-cbrt-cube60.5%
pow1/364.3%
pow364.3%
Applied egg-rr64.3%
Final simplification77.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.00013)
(*
(cos (* y.re (atan2 x.im x.re)))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im))))
(if (<= y.re 220000000.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
(pow (hypot x.im x.re) y.re)
(cos (* y.re (log1p (expm1 (atan2 x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.00013) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 220000000.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((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_re * log1p(expm1(atan2(x_46_im, x_46_re)))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.00013) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else if (y_46_re <= 220000000.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.log1p(Math.expm1(Math.atan2(x_46_im, x_46_re)))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -0.00013: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) elif y_46_re <= 220000000.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.log1p(math.expm1(math.atan2(x_46_im, x_46_re))))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.00013) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (y_46_re <= 220000000.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * log1p(expm1(atan(x_46_im, x_46_re)))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.00013], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 220000000.0], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $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[Log[1 + N[(Exp[N[ArcTan[x$46$im / x$46$re], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00013:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;y.re \leq 220000000:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1.29999999999999989e-4Initial program 48.6%
exp-diff43.1%
exp-to-pow43.1%
hypot-define43.1%
*-commutative43.1%
exp-prod40.3%
fma-define40.3%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 83.4%
Taylor expanded in y.im around 0 86.2%
*-commutative88.9%
Simplified86.2%
if -1.29999999999999989e-4 < y.re < 2.2e8Initial program 34.5%
cancel-sign-sub-inv34.5%
fma-define34.5%
hypot-define34.5%
distribute-lft-neg-in34.5%
distribute-rgt-neg-out34.5%
fma-define34.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around 0 33.9%
*-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
if 2.2e8 < y.re Initial program 41.5%
cancel-sign-sub-inv41.5%
fma-define41.5%
hypot-define41.5%
distribute-lft-neg-in41.5%
distribute-rgt-neg-out41.5%
fma-define41.5%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 60.5%
unpow260.5%
unpow260.5%
hypot-undefine60.5%
Simplified60.5%
log1p-expm1-u62.4%
Applied egg-rr62.4%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (pow E (* y.re (- (log (hypot x.im x.re)) (* y.im (/ (atan2 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) {
return pow(((double) M_E), (y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.E, (y_46_re * (Math.log(Math.hypot(x_46_im, x_46_re)) - (y_46_im * (Math.atan2(x_46_im, x_46_re) / y_46_re))))) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.e, (y_46_re * (math.log(math.hypot(x_46_im, x_46_re)) - (y_46_im * (math.atan2(x_46_im, x_46_re) / y_46_re))))) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64((exp(1) ^ Float64(y_46_re * Float64(log(hypot(x_46_im, x_46_re)) - Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (2.71828182845904523536 ^ (y_46_re * (log(hypot(x_46_im, x_46_re)) - (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * cos((y_46_re * atan2(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Power[E, N[(y$46$re * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] - N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{e}^{\left(y.re \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)
\end{array}
Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around -inf 59.3%
mul-1-neg59.3%
fma-define59.3%
unpow259.3%
unpow259.3%
hypot-undefine80.4%
associate-/l*80.4%
Simplified80.4%
*-un-lft-identity80.4%
exp-prod80.4%
distribute-rgt-neg-in80.4%
Applied egg-rr80.4%
exp-1-e80.4%
hypot-undefine59.3%
unpow259.3%
unpow259.3%
associate-*r/59.3%
fma-define59.3%
+-commutative59.3%
mul-1-neg59.3%
unsub-neg59.3%
associate-*r/59.3%
Simplified80.4%
Taylor expanded in y.im around 0 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.00013) (not (<= y.re 220000000.0)))
(*
(cos (* y.re (atan2 x.im x.re)))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im))))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.00013) || !(y_46_re <= 220000000.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.00013) || !(y_46_re <= 220000000.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.00013) or not (y_46_re <= 220000000.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.00013) || !(y_46_re <= 220000000.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.00013) || ~((y_46_re <= 220000000.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.00013], N[Not[LessEqual[y$46$re, 220000000.0]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00013 \lor \neg \left(y.re \leq 220000000\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.29999999999999989e-4 or 2.2e8 < y.re Initial program 45.6%
exp-diff36.8%
exp-to-pow36.8%
hypot-define36.8%
*-commutative36.8%
exp-prod35.2%
fma-define35.2%
hypot-define63.2%
*-commutative63.2%
Simplified63.2%
Taylor expanded in y.im around 0 73.7%
Taylor expanded in y.im around 0 76.1%
*-commutative80.0%
Simplified76.1%
if -1.29999999999999989e-4 < y.re < 2.2e8Initial program 34.5%
cancel-sign-sub-inv34.5%
fma-define34.5%
hypot-define34.5%
distribute-lft-neg-in34.5%
distribute-rgt-neg-out34.5%
fma-define34.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around 0 33.9%
*-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.00012) (not (<= y.re 220000000.0)))
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.00012) || !(y_46_re <= 220000000.0)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.00012) || !(y_46_re <= 220000000.0)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.00012) or not (y_46_re <= 220000000.0): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.00012) || !(y_46_re <= 220000000.0)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.00012) || ~((y_46_re <= 220000000.0))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.00012], N[Not[LessEqual[y$46$re, 220000000.0]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00012 \lor \neg \left(y.re \leq 220000000\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.20000000000000003e-4 or 2.2e8 < y.re Initial program 45.6%
cancel-sign-sub-inv45.6%
fma-define45.6%
hypot-define45.6%
distribute-lft-neg-in45.6%
distribute-rgt-neg-out45.6%
fma-define45.6%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 73.7%
unpow273.7%
unpow273.7%
hypot-undefine73.7%
Simplified73.7%
if -1.20000000000000003e-4 < y.re < 2.2e8Initial program 34.5%
cancel-sign-sub-inv34.5%
fma-define34.5%
hypot-define34.5%
distribute-lft-neg-in34.5%
distribute-rgt-neg-out34.5%
fma-define34.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around 0 33.9%
*-commutative33.9%
unpow233.9%
unpow233.9%
hypot-undefine78.9%
neg-mul-178.9%
distribute-rgt-neg-in78.9%
Simplified78.9%
Final simplification76.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3e-7) (not (<= y.re 1.1e-32))) (* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (- 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3e-7) || !(y_46_re <= 1.1e-32)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 - log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3e-7) || !(y_46_re <= 1.1e-32)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 - Math.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3e-7) or not (y_46_re <= 1.1e-32): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 1.0 - math.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3e-7) || !(y_46_re <= 1.1e-32)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(1.0 - log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3e-7], N[Not[LessEqual[y$46$re, 1.1e-32]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Log[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{-7} \lor \neg \left(y.re \leq 1.1 \cdot 10^{-32}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 - \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.re < -2.9999999999999999e-7 or 1.1e-32 < y.re Initial program 45.8%
cancel-sign-sub-inv45.8%
fma-define45.8%
hypot-define45.8%
distribute-lft-neg-in45.8%
distribute-rgt-neg-out45.8%
fma-define45.8%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.im around 0 70.9%
unpow270.9%
unpow270.9%
hypot-undefine71.0%
Simplified71.0%
if -2.9999999999999999e-7 < y.re < 1.1e-32Initial program 33.5%
cancel-sign-sub-inv33.5%
fma-define33.5%
hypot-define33.5%
distribute-lft-neg-in33.5%
distribute-rgt-neg-out33.5%
fma-define33.5%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.re around 0 33.5%
*-commutative33.5%
unpow233.5%
unpow233.5%
hypot-undefine81.3%
neg-mul-181.3%
distribute-rgt-neg-in81.3%
mul-1-neg81.3%
exp-prod80.4%
mul-1-neg80.4%
Simplified80.4%
Taylor expanded in y.im around 0 51.6%
neg-mul-151.6%
unsub-neg51.6%
Simplified51.6%
log1p-expm1-u64.5%
Applied egg-rr64.5%
Final simplification67.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -32000000.0) (not (<= y.re 5.8e-11))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (- 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -32000000.0) || !(y_46_re <= 5.8e-11)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 - log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -32000000.0) || !(y_46_re <= 5.8e-11)) {
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.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -32000000.0) or not (y_46_re <= 5.8e-11): 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.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -32000000.0) || !(y_46_re <= 5.8e-11)) 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 - log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -32000000.0], N[Not[LessEqual[y$46$re, 5.8e-11]], $MachinePrecision]], 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[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -32000000 \lor \neg \left(y.re \leq 5.8 \cdot 10^{-11}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 - \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\end{array}
\end{array}
if y.re < -3.2e7 or 5.8e-11 < y.re Initial program 46.1%
cancel-sign-sub-inv46.1%
fma-define46.1%
hypot-define46.1%
distribute-lft-neg-in46.1%
distribute-rgt-neg-out46.1%
fma-define46.1%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
unpow272.0%
hypot-undefine72.0%
Simplified72.0%
Taylor expanded in x.re around 0 51.3%
*-commutative51.3%
Simplified51.3%
if -3.2e7 < y.re < 5.8e-11Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in y.re around 0 33.2%
*-commutative33.2%
unpow233.2%
unpow233.2%
hypot-undefine79.3%
neg-mul-179.3%
distribute-rgt-neg-in79.3%
mul-1-neg79.3%
exp-prod78.4%
mul-1-neg78.4%
Simplified78.4%
Taylor expanded in y.im around 0 50.0%
neg-mul-150.0%
unsub-neg50.0%
Simplified50.0%
log1p-expm1-u62.3%
Applied egg-rr62.3%
Final simplification56.8%
(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 -32000000.0)
(* t_0 (pow x.im y.re))
(if (<= y.re 2.3)
(- 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im))))
(* 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 <= -32000000.0) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3) {
tmp = 1.0 - log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
} 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 <= -32000000.0) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3) {
tmp = 1.0 - Math.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
} 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 <= -32000000.0: tmp = t_0 * math.pow(x_46_im, y_46_re) elif y_46_re <= 2.3: tmp = 1.0 - math.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im))) 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 <= -32000000.0) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 2.3) tmp = Float64(1.0 - log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -32000000.0], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.3], N[(1.0 - N[Log[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $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 -32000000:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.3:\\
\;\;\;\;1 - \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.2e7Initial program 48.6%
cancel-sign-sub-inv48.6%
fma-define48.6%
hypot-define48.6%
distribute-lft-neg-in48.6%
distribute-rgt-neg-out48.6%
fma-define48.6%
hypot-define90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y.im around 0 83.0%
unpow283.0%
unpow283.0%
hypot-undefine83.0%
Simplified83.0%
Taylor expanded in x.re around 0 64.7%
*-commutative64.7%
Simplified64.7%
if -3.2e7 < y.re < 2.2999999999999998Initial program 34.2%
cancel-sign-sub-inv34.2%
fma-define34.2%
hypot-define34.2%
distribute-lft-neg-in34.2%
distribute-rgt-neg-out34.2%
fma-define34.2%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 33.0%
*-commutative33.0%
unpow233.0%
unpow233.0%
hypot-undefine77.7%
neg-mul-177.7%
distribute-rgt-neg-in77.7%
mul-1-neg77.7%
exp-prod76.9%
mul-1-neg76.9%
Simplified76.9%
Taylor expanded in y.im around 0 48.6%
neg-mul-148.6%
unsub-neg48.6%
Simplified48.6%
log1p-expm1-u60.6%
Applied egg-rr60.6%
if 2.2999999999999998 < y.re Initial program 42.6%
cancel-sign-sub-inv42.6%
fma-define42.6%
hypot-define42.6%
distribute-lft-neg-in42.6%
distribute-rgt-neg-out42.6%
fma-define42.6%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 59.4%
unpow259.4%
unpow259.4%
hypot-undefine59.4%
Simplified59.4%
Taylor expanded in x.im around 0 50.5%
*-commutative50.5%
Simplified50.5%
Final simplification59.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (- 1.0 (log1p (expm1 (* (atan2 x.im x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - log1p(expm1((atan2(x_46_im, x_46_re) * y_46_im)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - Math.log1p(Math.expm1((Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 - math.log1p(math.expm1((math.atan2(x_46_im, x_46_re) * y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 - log1p(expm1(Float64(atan(x_46_im, x_46_re) * y_46_im)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 - N[Log[1 + N[(Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)
\end{array}
Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 25.7%
*-commutative25.7%
unpow225.7%
unpow225.7%
hypot-undefine55.8%
neg-mul-155.8%
distribute-rgt-neg-in55.8%
mul-1-neg55.8%
exp-prod56.8%
mul-1-neg56.8%
Simplified56.8%
Taylor expanded in y.im around 0 26.4%
neg-mul-126.4%
unsub-neg26.4%
Simplified26.4%
log1p-expm1-u36.9%
Applied egg-rr36.9%
Final simplification36.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* y.re (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 1.0 + (y_46_re * 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 1.0 + (y_46_re * 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 1.0 + (y_46_re * 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(1.0 + Float64(y_46_re * 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 = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.4%
Simplified61.4%
Taylor expanded in y.re around 0 19.1%
+-commutative19.1%
unpow219.1%
unpow219.1%
hypot-undefine26.5%
Simplified26.5%
Final simplification26.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (- 1.0 (* (atan2 x.im x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0 - (atan2(x_46im, x_46re) * y_46im)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0 - (Math.atan2(x_46_im, x_46_re) * y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0 - (math.atan2(x_46_im, x_46_re) * y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(1.0 - Float64(atan(x_46_im, x_46_re) * y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im
\end{array}
Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 25.7%
*-commutative25.7%
unpow225.7%
unpow225.7%
hypot-undefine55.8%
neg-mul-155.8%
distribute-rgt-neg-in55.8%
mul-1-neg55.8%
exp-prod56.8%
mul-1-neg56.8%
Simplified56.8%
Taylor expanded in y.im around 0 26.4%
neg-mul-126.4%
unsub-neg26.4%
Simplified26.4%
Final simplification26.4%
(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.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.4%
Simplified61.4%
Taylor expanded in y.re around 0 26.1%
herbie shell --seed 2024137
(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)))))