
(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 12 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.re x.im))))
(if (<= y.re 6.5e+14)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(pow (hypot x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 6.5e+14) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 6.5e+14) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 6.5e+14], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 6.5 \cdot 10^{+14}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 6.5e14Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
if 6.5e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-undefine66.1%
Simplified66.1%
Taylor expanded in y.re around 0 78.1%
Final simplification84.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -42000000000000.0)
(*
t_0
(cos
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re))))))
(if (<= y.re 5600.0)
(*
(cos (* y.re (atan2 x.im x.re)))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -42000000000000.0) {
tmp = t_0 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re)))));
} else if (y_46_re <= 5600.0) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -42000000000000.0) {
tmp = t_0 * Math.cos((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) / y_46_re)))));
} else if (y_46_re <= 5600.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) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -42000000000000.0: tmp = t_0 * math.cos((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_re))))) elif y_46_re <= 5600.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) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -42000000000000.0) tmp = Float64(t_0 * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re)))))); elseif (y_46_re <= 5600.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) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -42000000000000.0) tmp = t_0 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re))))); elseif (y_46_re <= 5600.0) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -42000000000000.0], N[(t$95$0 * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5600.0], 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[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -42000000000000:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 5600:\\
\;\;\;\;\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}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4.2e13Initial program 50.0%
exp-diff38.7%
exp-to-pow38.7%
hypot-define38.7%
*-commutative38.7%
exp-prod38.7%
fma-define38.7%
hypot-define71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in y.re around inf 38.7%
+-commutative38.7%
associate-/l*38.7%
unpow238.7%
unpow238.7%
hypot-undefine71.0%
Simplified71.0%
Taylor expanded in y.im around 0 80.8%
unpow280.8%
unpow280.8%
hypot-undefine80.8%
Simplified80.8%
if -4.2e13 < y.re < 5600Initial program 39.5%
exp-diff39.5%
exp-to-pow39.5%
hypot-define39.5%
*-commutative39.5%
exp-prod39.4%
fma-define39.4%
hypot-define82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.im around 0 85.6%
if 5600 < y.re Initial program 33.3%
exp-diff31.6%
exp-to-pow31.6%
hypot-define31.6%
*-commutative31.6%
exp-prod31.6%
fma-define31.6%
hypot-define59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in y.im around 0 63.2%
unpow263.2%
unpow263.2%
hypot-undefine63.2%
Simplified63.2%
Taylor expanded in y.re around 0 73.8%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re 7.5e+14)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* y.re (atan2 x.im x.re))))
(pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 7.5e+14) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 7.5e+14) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 7.5e+14], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 7.5 \cdot 10^{+14}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < 7.5e14Initial program 42.3%
cancel-sign-sub-inv42.3%
fma-define42.3%
hypot-define42.3%
distribute-lft-neg-in42.3%
distribute-rgt-neg-out42.3%
fma-define42.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.im around 0 85.1%
if 7.5e14 < y.re Initial program 34.0%
exp-diff32.0%
exp-to-pow32.0%
hypot-define32.0%
*-commutative32.0%
exp-prod32.0%
fma-define32.0%
hypot-define56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in y.im around 0 66.1%
unpow266.1%
unpow266.1%
hypot-undefine66.1%
Simplified66.1%
Taylor expanded in y.re around 0 78.1%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -0.145)
(*
t_0
(cos
(*
y.re
(+ (atan2 x.im x.re) (* y.im (/ (log (hypot x.im x.re)) y.re))))))
(if (<= y.re 0.05) (exp (* (atan2 x.im x.re) (- 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.145) {
tmp = t_0 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re)))));
} else if (y_46_re <= 0.05) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.145) {
tmp = t_0 * Math.cos((y_46_re * (Math.atan2(x_46_im, x_46_re) + (y_46_im * (Math.log(Math.hypot(x_46_im, x_46_re)) / y_46_re)))));
} else if (y_46_re <= 0.05) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -0.145: tmp = t_0 * math.cos((y_46_re * (math.atan2(x_46_im, x_46_re) + (y_46_im * (math.log(math.hypot(x_46_im, x_46_re)) / y_46_re))))) elif y_46_re <= 0.05: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -0.145) tmp = Float64(t_0 * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(log(hypot(x_46_im, x_46_re)) / y_46_re)))))); elseif (y_46_re <= 0.05) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -0.145) tmp = t_0 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (log(hypot(x_46_im, x_46_re)) / y_46_re))))); elseif (y_46_re <= 0.05) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.145], N[(t$95$0 * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.05], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.145:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 0.05:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -0.14499999999999999Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.re around inf 37.5%
+-commutative37.5%
associate-/l*37.5%
unpow237.5%
unpow237.5%
hypot-undefine71.9%
Simplified71.9%
Taylor expanded in y.im around 0 81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
if -0.14499999999999999 < y.re < 0.050000000000000003Initial program 39.7%
cancel-sign-sub-inv39.7%
fma-define39.7%
hypot-define39.7%
distribute-lft-neg-in39.7%
distribute-rgt-neg-out39.7%
fma-define39.7%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.im around 0 85.3%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
Simplified84.2%
if 0.050000000000000003 < y.re Initial program 34.4%
exp-diff32.7%
exp-to-pow32.7%
hypot-define32.7%
*-commutative32.7%
exp-prod32.7%
fma-define32.7%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
Taylor expanded in y.re around 0 73.0%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.7e-5)
(* t_0 (cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 0.059) (exp (* (atan2 x.im x.re) (- 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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.7e-5) {
tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.059) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.7e-5) {
tmp = t_0 * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 0.059) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.7e-5: tmp = t_0 * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 0.059: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.7e-5) tmp = Float64(t_0 * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 0.059) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.7e-5) tmp = t_0 * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 0.059) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.7e-5], 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, 0.059], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{-5}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 0.059:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.7e-5Initial program 48.4%
exp-diff37.5%
exp-to-pow37.5%
hypot-define37.5%
*-commutative37.5%
exp-prod37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 79.9%
unpow279.9%
unpow279.9%
hypot-undefine79.9%
Simplified79.9%
if -1.7e-5 < y.re < 0.058999999999999997Initial program 39.7%
cancel-sign-sub-inv39.7%
fma-define39.7%
hypot-define39.7%
distribute-lft-neg-in39.7%
distribute-rgt-neg-out39.7%
fma-define39.7%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.im around 0 85.3%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
Simplified84.2%
if 0.058999999999999997 < y.re Initial program 34.4%
exp-diff32.7%
exp-to-pow32.7%
hypot-define32.7%
*-commutative32.7%
exp-prod32.7%
fma-define32.7%
hypot-define60.3%
*-commutative60.3%
Simplified60.3%
Taylor expanded in y.im around 0 63.8%
unpow263.8%
unpow263.8%
hypot-undefine63.8%
Simplified63.8%
Taylor expanded in y.re around 0 73.0%
Final simplification80.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -0.55)
(pow (exp y.im) (- (atan2 x.im x.re)))
(if (<= y.im 4.8e-10)
(pow (hypot x.im x.re) y.re)
(/ 1.0 (pow (exp y.im) (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -0.55) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else if (y_46_im <= 4.8e-10) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -0.55) {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else if (y_46_im <= 4.8e-10) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 1.0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -0.55: tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) elif y_46_im <= 4.8e-10: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 1.0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -0.55) tmp = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)); elseif (y_46_im <= 4.8e-10) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64(1.0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -0.55) tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); elseif (y_46_im <= 4.8e-10) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 1.0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -0.55], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision], If[LessEqual[y$46$im, 4.8e-10], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(1.0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -0.55:\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-10}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if y.im < -0.55000000000000004Initial program 39.7%
exp-diff33.8%
exp-to-pow33.8%
hypot-define33.8%
*-commutative33.8%
exp-prod33.8%
fma-define33.8%
hypot-define60.2%
*-commutative60.2%
Simplified60.2%
Taylor expanded in y.im around 0 61.9%
Taylor expanded in y.re around 0 61.0%
rec-exp61.0%
distribute-rgt-neg-in61.0%
neg-mul-161.0%
exp-prod66.5%
neg-mul-166.5%
Simplified66.5%
if -0.55000000000000004 < y.im < 4.8e-10Initial program 40.0%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod40.0%
fma-define40.0%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 60.9%
unpow260.9%
unpow260.9%
hypot-undefine89.1%
Simplified89.1%
Taylor expanded in y.re around 0 93.4%
if 4.8e-10 < y.im Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in y.im around 0 78.2%
Taylor expanded in y.re around 0 66.7%
neg-mul-166.7%
distribute-lft-neg-in66.7%
*-commutative66.7%
Simplified66.7%
distribute-rgt-neg-out66.7%
rec-exp66.7%
*-commutative66.7%
pow-exp71.0%
Applied egg-rr71.0%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -0.55) (not (<= y.im 4.8e-10))) (pow (exp y.im) (- (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -0.55) || !(y_46_im <= 4.8e-10)) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -0.55) || !(y_46_im <= 4.8e-10)) {
tmp = Math.pow(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);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -0.55) or not (y_46_im <= 4.8e-10): tmp = math.pow(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) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -0.55) || !(y_46_im <= 4.8e-10)) tmp = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -0.55) || ~((y_46_im <= 4.8e-10))) tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); else tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -0.55], N[Not[LessEqual[y$46$im, 4.8e-10]], $MachinePrecision]], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -0.55 \lor \neg \left(y.im \leq 4.8 \cdot 10^{-10}\right):\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -0.55000000000000004 or 4.8e-10 < y.im Initial program 41.3%
exp-diff35.4%
exp-to-pow35.4%
hypot-define35.4%
*-commutative35.4%
exp-prod35.3%
fma-define35.3%
hypot-define61.8%
*-commutative61.8%
Simplified61.8%
Taylor expanded in y.im around 0 64.2%
Taylor expanded in y.re around 0 63.9%
rec-exp63.9%
distribute-rgt-neg-in63.9%
neg-mul-163.9%
exp-prod68.7%
neg-mul-168.7%
Simplified68.7%
if -0.55000000000000004 < y.im < 4.8e-10Initial program 40.0%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod40.0%
fma-define40.0%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 60.9%
unpow260.9%
unpow260.9%
hypot-undefine89.1%
Simplified89.1%
Taylor expanded in y.re around 0 93.4%
Final simplification80.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.75) (not (<= y.re 0.059))) (pow (hypot x.im x.re) y.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.75) || !(y_46_re <= 0.059)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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.75) || !(y_46_re <= 0.059)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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.75) or not (y_46_re <= 0.059): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 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.75) || !(y_46_re <= 0.059)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 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.75) || ~((y_46_re <= 0.059))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 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.75], N[Not[LessEqual[y$46$re, 0.059]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.75 \lor \neg \left(y.re \leq 0.059\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -0.75 or 0.058999999999999997 < y.re Initial program 41.8%
exp-diff35.2%
exp-to-pow35.2%
hypot-define35.2%
*-commutative35.2%
exp-prod35.2%
fma-define35.2%
hypot-define66.4%
*-commutative66.4%
Simplified66.4%
Taylor expanded in y.im around 0 72.2%
unpow272.2%
unpow272.2%
hypot-undefine72.2%
Simplified72.2%
Taylor expanded in y.re around 0 75.8%
if -0.75 < y.re < 0.058999999999999997Initial program 39.7%
cancel-sign-sub-inv39.7%
fma-define39.7%
hypot-define39.7%
distribute-lft-neg-in39.7%
distribute-rgt-neg-out39.7%
fma-define39.7%
hypot-define82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in y.im around 0 85.3%
Taylor expanded in y.re around 0 84.2%
neg-mul-184.2%
distribute-lft-neg-in84.2%
*-commutative84.2%
Simplified84.2%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -15.0) (not (<= y.re 7200.0))) (pow x.re y.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 <= -15.0) || !(y_46_re <= 7200.0)) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-15.0d0)) .or. (.not. (y_46re <= 7200.0d0))) then
tmp = x_46re ** y_46re
else
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -15.0) || !(y_46_re <= 7200.0)) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = 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 <= -15.0) or not (y_46_re <= 7200.0): tmp = math.pow(x_46_re, y_46_re) else: tmp = 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 <= -15.0) || !(y_46_re <= 7200.0)) tmp = x_46_re ^ y_46_re; else tmp = 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 <= -15.0) || ~((y_46_re <= 7200.0))) tmp = x_46_re ^ y_46_re; else tmp = 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, -15.0], N[Not[LessEqual[y$46$re, 7200.0]], $MachinePrecision]], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -15 \lor \neg \left(y.re \leq 7200\right):\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -15 or 7200 < y.re Initial program 41.3%
exp-diff34.7%
exp-to-pow34.7%
hypot-define34.7%
*-commutative34.7%
exp-prod34.7%
fma-define34.7%
hypot-define66.1%
*-commutative66.1%
Simplified66.1%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
unpow272.0%
hypot-undefine72.0%
Simplified72.0%
Taylor expanded in x.im around 0 59.1%
Taylor expanded in y.re around 0 61.6%
if -15 < y.re < 7200Initial program 40.1%
cancel-sign-sub-inv40.1%
fma-define40.1%
hypot-define40.1%
distribute-lft-neg-in40.1%
distribute-rgt-neg-out40.1%
fma-define40.1%
hypot-define82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.im around 0 85.4%
Taylor expanded in y.re around 0 83.7%
neg-mul-183.7%
distribute-lft-neg-in83.7%
*-commutative83.7%
Simplified83.7%
Final simplification73.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -9.2e-17) (not (<= y.re 0.08))) (pow x.re y.re) (- 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) {
double tmp;
if ((y_46_re <= -9.2e-17) || !(y_46_re <= 0.08)) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = 1.0 - (atan2(x_46_im, x_46_re) * y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-9.2d-17)) .or. (.not. (y_46re <= 0.08d0))) then
tmp = x_46re ** y_46re
else
tmp = 1.0d0 - (atan2(x_46im, x_46re) * y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9.2e-17) || !(y_46_re <= 0.08)) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0 - (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 <= -9.2e-17) or not (y_46_re <= 0.08): tmp = math.pow(x_46_re, y_46_re) else: tmp = 1.0 - (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 <= -9.2e-17) || !(y_46_re <= 0.08)) tmp = x_46_re ^ y_46_re; else tmp = Float64(1.0 - Float64(atan(x_46_im, x_46_re) * 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 <= -9.2e-17) || ~((y_46_re <= 0.08))) tmp = x_46_re ^ y_46_re; else tmp = 1.0 - (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, -9.2e-17], N[Not[LessEqual[y$46$re, 0.08]], $MachinePrecision]], N[Power[x$46$re, y$46$re], $MachinePrecision], N[(1.0 - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-17} \lor \neg \left(y.re \leq 0.08\right):\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\end{array}
\end{array}
if y.re < -9.20000000000000035e-17 or 0.0800000000000000017 < y.re Initial program 43.2%
exp-diff36.8%
exp-to-pow36.8%
hypot-define36.8%
*-commutative36.8%
exp-prod36.8%
fma-define36.8%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 70.6%
unpow270.6%
unpow270.6%
hypot-undefine70.6%
Simplified70.6%
Taylor expanded in x.im around 0 58.0%
Taylor expanded in y.re around 0 60.4%
if -9.20000000000000035e-17 < y.re < 0.0800000000000000017Initial program 38.3%
cancel-sign-sub-inv38.3%
fma-define38.3%
hypot-define38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 85.0%
Taylor expanded in y.re around 0 83.3%
neg-mul-183.3%
distribute-lft-neg-in83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around 0 49.4%
neg-mul-149.4%
unsub-neg49.4%
*-commutative49.4%
Simplified49.4%
Final simplification54.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -9.2e-17) (not (<= y.re 0.064))) (pow x.re y.re) 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_re <= -9.2e-17) || !(y_46_re <= 0.064)) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-9.2d-17)) .or. (.not. (y_46re <= 0.064d0))) then
tmp = x_46re ** y_46re
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9.2e-17) || !(y_46_re <= 0.064)) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -9.2e-17) or not (y_46_re <= 0.064): tmp = math.pow(x_46_re, y_46_re) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -9.2e-17) || !(y_46_re <= 0.064)) tmp = x_46_re ^ y_46_re; else tmp = 1.0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -9.2e-17) || ~((y_46_re <= 0.064))) tmp = x_46_re ^ y_46_re; else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -9.2e-17], N[Not[LessEqual[y$46$re, 0.064]], $MachinePrecision]], N[Power[x$46$re, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-17} \lor \neg \left(y.re \leq 0.064\right):\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -9.20000000000000035e-17 or 0.064000000000000001 < y.re Initial program 43.2%
exp-diff36.8%
exp-to-pow36.8%
hypot-define36.8%
*-commutative36.8%
exp-prod36.8%
fma-define36.8%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 70.6%
unpow270.6%
unpow270.6%
hypot-undefine70.6%
Simplified70.6%
Taylor expanded in x.im around 0 58.0%
Taylor expanded in y.re around 0 60.4%
if -9.20000000000000035e-17 < y.re < 0.064000000000000001Initial program 38.3%
cancel-sign-sub-inv38.3%
fma-define38.3%
hypot-define38.3%
distribute-lft-neg-in38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 85.0%
Taylor expanded in y.re around 0 83.3%
neg-mul-183.3%
distribute-lft-neg-in83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.im around 0 49.0%
Final simplification54.6%
(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 40.7%
cancel-sign-sub-inv40.7%
fma-define40.7%
hypot-define40.7%
distribute-lft-neg-in40.7%
distribute-rgt-neg-out40.7%
fma-define40.7%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 82.2%
Taylor expanded in y.re around 0 58.6%
neg-mul-158.6%
distribute-lft-neg-in58.6%
*-commutative58.6%
Simplified58.6%
Taylor expanded in y.im around 0 26.7%
herbie shell --seed 2024139
(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)))))