
(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 (* y.re (atan2 x.im x.re)))
(t_1 (pow (hypot x.im x.re) y.re))
(t_2 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re -2.2e-18)
(* (exp (fma (log (hypot x.re x.im)) y.re t_2)) (cos t_0))
(if (<= y.re 1700000.0)
(* (cos (* y.im (pow (cbrt (log (hypot x.im x.re))) 3.0))) (exp t_2))
(if (<= y.re 8.5e+49)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_1)
(if (<= y.re 5e+67) (pow x.re y.re) t_1))))))
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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_2 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_re <= -2.2e-18) {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_2)) * cos(t_0);
} else if (y_46_re <= 1700000.0) {
tmp = cos((y_46_im * pow(cbrt(log(hypot(x_46_im, x_46_re))), 3.0))) * exp(t_2);
} else if (y_46_re <= 8.5e+49) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_1;
} else if (y_46_re <= 5e+67) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = t_1;
}
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 = hypot(x_46_im, x_46_re) ^ y_46_re t_2 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_re <= -2.2e-18) tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, t_2)) * cos(t_0)); elseif (y_46_re <= 1700000.0) tmp = Float64(cos(Float64(y_46_im * (cbrt(log(hypot(x_46_im, x_46_re))) ^ 3.0))) * exp(t_2)); elseif (y_46_re <= 8.5e+49) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_1); elseif (y_46_re <= 5e+67) tmp = x_46_re ^ y_46_re; else tmp = t_1; 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e-18], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1700000.0], N[(N[Cos[N[(y$46$im * N[Power[N[Power[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.5e+49], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 5e+67], N[Power[x$46$re, y$46$re], $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-18}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, t\_2\right)} \cdot \cos t\_0\\
\mathbf{elif}\;y.re \leq 1700000:\\
\;\;\;\;\cos \left(y.im \cdot {\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right) \cdot e^{t\_2}\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{+49}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{+67}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.1999999999999998e-18Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.re around inf 39.4%
+-commutative39.4%
associate-/l*39.4%
unpow239.4%
unpow239.4%
hypot-undefine87.3%
Simplified87.3%
Taylor expanded in y.im around 0 85.9%
if -2.1999999999999998e-18 < y.re < 1.7e6Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine80.4%
neg-mul-180.4%
Simplified80.4%
add-cube-cbrt78.9%
pow381.2%
Applied egg-rr81.2%
if 1.7e6 < y.re < 8.4999999999999996e49Initial program 60.0%
cancel-sign-sub-inv60.0%
fma-define60.0%
hypot-define60.0%
distribute-lft-neg-in60.0%
distribute-rgt-neg-out60.0%
fma-define60.0%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in y.re around 0 100.0%
unpow2100.0%
unpow2100.0%
swap-sqr100.0%
unpow2100.0%
Simplified100.0%
if 8.4999999999999996e49 < y.re < 4.99999999999999976e67Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 50.4%
unpow250.4%
unpow250.4%
hypot-undefine50.4%
Simplified50.4%
Taylor expanded in y.re around 0 75.4%
Taylor expanded in x.im around 0 100.0%
if 4.99999999999999976e67 < y.re Initial program 42.0%
cancel-sign-sub-inv42.0%
fma-define42.0%
hypot-define42.0%
distribute-lft-neg-in42.0%
distribute-rgt-neg-out42.0%
fma-define44.0%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.re around 0 74.1%
Final simplification82.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im)))))
(t_2
(*
y.re
(fma y.im (/ (log (hypot x.im x.re)) y.re) (atan2 x.im x.re)))))
(if (<= y.re 2e-45)
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
t_1
(* (cbrt (pow (cos t_2) 2.0)) (cbrt (cos (pow (cbrt t_2) 3.0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double t_2 = y_46_re * fma(y_46_im, (log(hypot(x_46_im, x_46_re)) / y_46_re), atan2(x_46_im, x_46_re));
double tmp;
if (y_46_re <= 2e-45) {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * (cbrt(pow(cos(t_2), 2.0)) * cbrt(cos(pow(cbrt(t_2), 3.0))));
}
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)) t_1 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) t_2 = Float64(y_46_re * fma(y_46_im, Float64(log(hypot(x_46_im, x_46_re)) / y_46_re), atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= 2e-45) tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * Float64(cbrt((cos(t_2) ^ 2.0)) * cbrt(cos((cbrt(t_2) ^ 3.0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(y$46$re * N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, 2e-45], N[(t$95$1 * 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[(t$95$1 * N[(N[Power[N[Power[N[Cos[t$95$2], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Cos[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
t_2 := y.re \cdot \mathsf{fma}\left(y.im, \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq 2 \cdot 10^{-45}:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\sqrt[3]{{\cos t\_2}^{2}} \cdot \sqrt[3]{\cos \left({\left(\sqrt[3]{t\_2}\right)}^{3}\right)}\right)\\
\end{array}
\end{array}
if y.re < 1.99999999999999997e-45Initial 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-define83.8%
*-commutative83.8%
Simplified83.8%
if 1.99999999999999997e-45 < y.re Initial program 45.2%
cancel-sign-sub-inv45.2%
fma-define45.2%
hypot-define45.2%
distribute-lft-neg-in45.2%
distribute-rgt-neg-out45.2%
fma-define46.6%
hypot-define68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in y.re around inf 48.0%
+-commutative48.0%
associate-/l*48.0%
unpow248.0%
unpow248.0%
hypot-undefine72.6%
Simplified72.6%
add-cube-cbrt72.6%
cbrt-unprod72.6%
pow272.6%
+-commutative72.6%
fma-define72.6%
+-commutative72.6%
Applied egg-rr71.3%
add-cube-cbrt74.0%
pow378.1%
Applied egg-rr78.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_1 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= (* t_1 (cos (+ t_2 (* y.im t_0)))) INFINITY)
(* t_1 (cos (* y.im (log (hypot x.im x.re)))))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos t_2)))))
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))));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((t_1 * cos((t_2 + (y_46_im * t_0)))) <= ((double) INFINITY)) {
tmp = t_1 * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
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(t_2);
}
return tmp;
}
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)))) t_1 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_1 * cos(Float64(t_2 + Float64(y_46_im * t_0)))) <= Inf) tmp = Float64(t_1 * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else 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(t_2)); 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[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Cos[N[(t$95$2 + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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[t$95$2], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_1 := e^{y.re \cdot t\_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;t\_1 \cdot \cos \left(t\_2 + y.im \cdot t\_0\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;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 t\_2\\
\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)))) < +inf.0Initial program 81.2%
Taylor expanded in y.re around 0 82.8%
unpow282.8%
unpow282.8%
hypot-undefine82.8%
Simplified82.8%
if +inf.0 < (*.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 0.0%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define76.7%
*-commutative76.7%
Simplified76.7%
Taylor expanded in y.re around inf 0.0%
+-commutative0.0%
associate-/l*0.0%
unpow20.0%
unpow20.0%
hypot-undefine68.7%
Simplified68.7%
Taylor expanded in y.im around 0 73.4%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(if (<= y.re 1.28e+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)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 1.28e+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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 1.28e+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 = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 1.28e+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[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 1.28 \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}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 1.28e14Initial 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-define83.2%
*-commutative83.2%
Simplified83.2%
if 1.28e14 < y.re Initial program 44.3%
Taylor expanded in y.re around 0 49.2%
unpow249.2%
unpow249.2%
hypot-undefine77.1%
Simplified77.1%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -9e-45)
(* (cos (fma (log (hypot x.re x.im)) y.im t_0)) t_1)
(if (<= y.re 13500000.0)
(*
(cos (* y.im (pow (cbrt (log (hypot x.im x.re))) 3.0)))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 2.75e+50)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_1)
(if (<= y.re 4e+68) (pow x.re y.re) t_1))))))
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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -9e-45) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_1;
} else if (y_46_re <= 13500000.0) {
tmp = cos((y_46_im * pow(cbrt(log(hypot(x_46_im, x_46_re))), 3.0))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 2.75e+50) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_1;
} else if (y_46_re <= 4e+68) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = t_1;
}
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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -9e-45) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * t_1); elseif (y_46_re <= 13500000.0) tmp = Float64(cos(Float64(y_46_im * (cbrt(log(hypot(x_46_im, x_46_re))) ^ 3.0))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 2.75e+50) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_1); elseif (y_46_re <= 4e+68) tmp = x_46_re ^ y_46_re; else tmp = t_1; 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -9e-45], 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] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 13500000.0], N[(N[Cos[N[(y$46$im * N[Power[N[Power[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.75e+50], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 4e+68], N[Power[x$46$re, y$46$re], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -9 \cdot 10^{-45}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 13500000:\\
\;\;\;\;\cos \left(y.im \cdot {\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 2.75 \cdot 10^{+50}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+68}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -8.9999999999999997e-45Initial program 40.0%
exp-diff36.0%
exp-to-pow36.0%
hypot-define36.0%
*-commutative36.0%
exp-prod36.0%
fma-define36.0%
hypot-define73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in y.im around 0 80.3%
unpow280.3%
unpow280.3%
hypot-undefine83.1%
Simplified83.1%
if -8.9999999999999997e-45 < y.re < 1.35e7Initial program 40.5%
cancel-sign-sub-inv40.5%
fma-define40.5%
hypot-define40.5%
distribute-lft-neg-in40.5%
distribute-rgt-neg-out40.5%
fma-define40.5%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 40.5%
unpow240.5%
unpow240.5%
hypot-undefine80.4%
neg-mul-180.4%
Simplified80.4%
add-cube-cbrt78.9%
pow381.2%
Applied egg-rr81.2%
if 1.35e7 < y.re < 2.7499999999999999e50Initial program 60.0%
cancel-sign-sub-inv60.0%
fma-define60.0%
hypot-define60.0%
distribute-lft-neg-in60.0%
distribute-rgt-neg-out60.0%
fma-define60.0%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in y.re around 0 100.0%
unpow2100.0%
unpow2100.0%
swap-sqr100.0%
unpow2100.0%
Simplified100.0%
if 2.7499999999999999e50 < y.re < 3.99999999999999981e68Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 50.4%
unpow250.4%
unpow250.4%
hypot-undefine50.4%
Simplified50.4%
Taylor expanded in y.re around 0 75.4%
Taylor expanded in x.im around 0 100.0%
if 3.99999999999999981e68 < y.re Initial program 42.0%
cancel-sign-sub-inv42.0%
fma-define42.0%
hypot-define42.0%
distribute-lft-neg-in42.0%
distribute-rgt-neg-out42.0%
fma-define44.0%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.re around 0 74.1%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -5e-14)
(* (cos t_0) t_1)
(if (<= y.re 9500000.0)
(*
(cos (* y.im (pow (cbrt (log (hypot x.im x.re))) 3.0)))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 3.6e+49)
(* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_1)
(if (<= y.re 4.2e+68) (pow x.re y.re) t_1))))))
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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5e-14) {
tmp = cos(t_0) * t_1;
} else if (y_46_re <= 9500000.0) {
tmp = cos((y_46_im * pow(cbrt(log(hypot(x_46_im, x_46_re))), 3.0))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.6e+49) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_1;
} else if (y_46_re <= 4.2e+68) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5e-14) {
tmp = Math.cos(t_0) * t_1;
} else if (y_46_re <= 9500000.0) {
tmp = Math.cos((y_46_im * Math.pow(Math.cbrt(Math.log(Math.hypot(x_46_im, x_46_re))), 3.0))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else if (y_46_re <= 3.6e+49) {
tmp = (1.0 + (-0.5 * Math.pow(t_0, 2.0))) * t_1;
} else if (y_46_re <= 4.2e+68) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = t_1;
}
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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64(cos(t_0) * t_1); elseif (y_46_re <= 9500000.0) tmp = Float64(cos(Float64(y_46_im * (cbrt(log(hypot(x_46_im, x_46_re))) ^ 3.0))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif (y_46_re <= 3.6e+49) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_1); elseif (y_46_re <= 4.2e+68) tmp = x_46_re ^ y_46_re; else tmp = t_1; 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[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 9500000.0], N[(N[Cos[N[(y$46$im * N[Power[N[Power[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.6e+49], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 4.2e+68], N[Power[x$46$re, y$46$re], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 9500000:\\
\;\;\;\;\cos \left(y.im \cdot {\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{+49}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 4.2 \cdot 10^{+68}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.im around 0 81.9%
unpow281.9%
unpow281.9%
hypot-undefine83.2%
Simplified83.2%
if -5.0000000000000002e-14 < y.re < 9.5e6Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine80.4%
neg-mul-180.4%
Simplified80.4%
add-cube-cbrt78.9%
pow381.2%
Applied egg-rr81.2%
if 9.5e6 < y.re < 3.59999999999999996e49Initial program 60.0%
cancel-sign-sub-inv60.0%
fma-define60.0%
hypot-define60.0%
distribute-lft-neg-in60.0%
distribute-rgt-neg-out60.0%
fma-define60.0%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 80.0%
unpow280.0%
unpow280.0%
hypot-undefine80.0%
Simplified80.0%
Taylor expanded in y.re around 0 100.0%
unpow2100.0%
unpow2100.0%
swap-sqr100.0%
unpow2100.0%
Simplified100.0%
if 3.59999999999999996e49 < y.re < 4.20000000000000002e68Initial program 50.0%
cancel-sign-sub-inv50.0%
fma-define50.0%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 50.4%
unpow250.4%
unpow250.4%
hypot-undefine50.4%
Simplified50.4%
Taylor expanded in y.re around 0 75.4%
Taylor expanded in x.im around 0 100.0%
if 4.20000000000000002e68 < y.re Initial program 42.0%
cancel-sign-sub-inv42.0%
fma-define42.0%
hypot-define42.0%
distribute-lft-neg-in42.0%
distribute-rgt-neg-out42.0%
fma-define44.0%
hypot-define66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 58.1%
unpow258.1%
unpow258.1%
hypot-undefine58.1%
Simplified58.1%
Taylor expanded in y.re around 0 74.1%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -5e-14)
(* (cos t_0) t_1)
(if (<= y.re 1700000.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re 9.5e+45) (* (+ 1.0 (* -0.5 (pow t_0 2.0))) t_1) t_1)))))
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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5e-14) {
tmp = cos(t_0) * t_1;
} else if (y_46_re <= 1700000.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 if (y_46_re <= 9.5e+45) {
tmp = (1.0 + (-0.5 * pow(t_0, 2.0))) * t_1;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -5e-14) {
tmp = Math.cos(t_0) * t_1;
} else if (y_46_re <= 1700000.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 if (y_46_re <= 9.5e+45) {
tmp = (1.0 + (-0.5 * Math.pow(t_0, 2.0))) * t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -5e-14: tmp = math.cos(t_0) * t_1 elif y_46_re <= 1700000.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)) elif y_46_re <= 9.5e+45: tmp = (1.0 + (-0.5 * math.pow(t_0, 2.0))) * t_1 else: tmp = t_1 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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -5e-14) tmp = Float64(cos(t_0) * t_1); elseif (y_46_re <= 1700000.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)))); elseif (y_46_re <= 9.5e+45) tmp = Float64(Float64(1.0 + Float64(-0.5 * (t_0 ^ 2.0))) * t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -5e-14) tmp = cos(t_0) * t_1; elseif (y_46_re <= 1700000.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)); elseif (y_46_re <= 9.5e+45) tmp = (1.0 + (-0.5 * (t_0 ^ 2.0))) * t_1; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1700000.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], If[LessEqual[y$46$re, 9.5e+45], N[(N[(1.0 + N[(-0.5 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1700000:\\
\;\;\;\;\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{elif}\;y.re \leq 9.5 \cdot 10^{+45}:\\
\;\;\;\;\left(1 + -0.5 \cdot {t\_0}^{2}\right) \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.im around 0 81.9%
unpow281.9%
unpow281.9%
hypot-undefine83.2%
Simplified83.2%
if -5.0000000000000002e-14 < y.re < 1.7e6Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-define40.9%
hypot-define40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-define40.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.re around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine80.4%
neg-mul-180.4%
Simplified80.4%
if 1.7e6 < y.re < 9.4999999999999998e45Initial program 55.6%
cancel-sign-sub-inv55.6%
fma-define55.6%
hypot-define55.6%
distribute-lft-neg-in55.6%
distribute-rgt-neg-out55.6%
fma-define55.6%
hypot-define77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in y.im around 0 77.8%
unpow277.8%
unpow277.8%
hypot-undefine77.8%
Simplified77.8%
Taylor expanded in y.re around 0 100.0%
unpow2100.0%
unpow2100.0%
swap-sqr100.0%
unpow2100.0%
Simplified100.0%
if 9.4999999999999998e45 < y.re Initial program 43.6%
cancel-sign-sub-inv43.6%
fma-define43.6%
hypot-define43.6%
distribute-lft-neg-in43.6%
distribute-rgt-neg-out43.6%
fma-define45.5%
hypot-define67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in y.im around 0 58.3%
unpow258.3%
unpow258.3%
hypot-undefine58.3%
Simplified58.3%
Taylor expanded in y.re around 0 74.7%
Final simplification80.6%
(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 -5e-14)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 3e+14)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(pow (pow (hypot x.re x.im) 2.0) (/ y.re 2.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3e+14) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(pow(hypot(x_46_re, x_46_im), 2.0), (y_46_re / 2.0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -5e-14) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 3e+14) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.pow(Math.hypot(x_46_re, x_46_im), 2.0), (y_46_re / 2.0));
}
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 <= -5e-14: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 3e+14: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.pow(math.hypot(x_46_re, x_46_im), 2.0), (y_46_re / 2.0)) 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 <= -5e-14) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 3e+14) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = (hypot(x_46_re, x_46_im) ^ 2.0) ^ Float64(y_46_re / 2.0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -5e-14) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 3e+14) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = (hypot(x_46_re, x_46_im) ^ 2.0) ^ (y_46_re / 2.0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-14], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3e+14], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re / 2.0), $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 -5 \cdot 10^{-14}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+14}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{2}\right)}^{\left(\frac{y.re}{2}\right)}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.im around 0 81.9%
unpow281.9%
unpow281.9%
hypot-undefine83.2%
Simplified83.2%
if -5.0000000000000002e-14 < y.re < 3e14Initial program 41.1%
cancel-sign-sub-inv41.1%
fma-define41.1%
hypot-define41.1%
distribute-lft-neg-in41.1%
distribute-rgt-neg-out41.1%
fma-define41.1%
hypot-define80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in y.re around inf 33.0%
+-commutative33.0%
associate-/l*33.0%
unpow233.0%
unpow233.0%
hypot-undefine64.1%
Simplified64.1%
Taylor expanded in y.im around 0 75.2%
Taylor expanded in y.re around 0 73.6%
if 3e14 < y.re Initial program 45.0%
cancel-sign-sub-inv45.0%
fma-define45.0%
hypot-define45.0%
distribute-lft-neg-in45.0%
distribute-rgt-neg-out45.0%
fma-define46.7%
hypot-define68.3%
*-commutative68.3%
Simplified68.3%
Taylor expanded in y.im around 0 58.4%
unpow258.4%
unpow258.4%
hypot-undefine58.4%
Simplified58.4%
Taylor expanded in y.re around 0 73.4%
*-un-lft-identity73.4%
sqr-pow73.4%
pow-prod-down73.4%
pow273.4%
Applied egg-rr73.4%
hypot-undefine73.4%
unpow273.4%
unpow273.4%
+-commutative73.4%
unpow273.4%
unpow273.4%
hypot-undefine73.4%
Simplified73.4%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -9e-45)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 76000000000000.0)
(exp (* (atan2 x.im x.re) (- y.im)))
(pow (log (exp (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 <= -9e-45) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 76000000000000.0) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(log(exp(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_re <= -9e-45) {
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 if (y_46_re <= 76000000000000.0) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.log(Math.exp(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_re <= -9e-45: 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) elif y_46_re <= 76000000000000.0: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.log(math.exp(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_re <= -9e-45) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 76000000000000.0) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = log(exp(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_re <= -9e-45) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 76000000000000.0) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = log(exp(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[LessEqual[y$46$re, -9e-45], 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], If[LessEqual[y$46$re, 76000000000000.0], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Log[N[Exp[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9 \cdot 10^{-45}:\\
\;\;\;\;\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{elif}\;y.re \leq 76000000000000:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -8.9999999999999997e-45Initial program 40.0%
cancel-sign-sub-inv40.0%
fma-define40.0%
hypot-define40.0%
distribute-lft-neg-in40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in y.im around 0 80.3%
unpow280.3%
unpow280.3%
hypot-undefine83.0%
Simplified83.0%
if -8.9999999999999997e-45 < y.re < 7.6e13Initial program 41.2%
cancel-sign-sub-inv41.2%
fma-define41.2%
hypot-define41.2%
distribute-lft-neg-in41.2%
distribute-rgt-neg-out41.2%
fma-define41.2%
hypot-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.re around inf 32.7%
+-commutative32.7%
associate-/l*32.7%
unpow232.7%
unpow232.7%
hypot-undefine63.2%
Simplified63.2%
Taylor expanded in y.im around 0 74.8%
Taylor expanded in y.re around 0 73.1%
neg-mul-173.1%
distribute-rgt-neg-in73.1%
Simplified73.1%
if 7.6e13 < y.re Initial program 44.3%
cancel-sign-sub-inv44.3%
fma-define44.3%
hypot-define44.3%
distribute-lft-neg-in44.3%
distribute-rgt-neg-out44.3%
fma-define45.9%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 59.1%
unpow259.1%
unpow259.1%
hypot-undefine59.1%
Simplified59.1%
Taylor expanded in y.re around 0 72.2%
add-log-exp72.2%
Applied egg-rr72.2%
Final simplification75.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5e-14)
(pow (hypot x.im x.re) y.re)
(if (<= y.re 1e+14)
(exp (* (atan2 x.im x.re) (- y.im)))
(pow (log (exp (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 <= -5e-14) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1e+14) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(log(exp(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_re <= -5e-14) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1e+14) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.log(Math.exp(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_re <= -5e-14: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 1e+14: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.log(math.exp(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_re <= -5e-14) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; elseif (y_46_re <= 1e+14) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = log(exp(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_re <= -5e-14) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; elseif (y_46_re <= 1e+14) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = log(exp(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[LessEqual[y$46$re, -5e-14], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 1e+14], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Log[N[Exp[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5 \cdot 10^{-14}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 10^{+14}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -5.0000000000000002e-14Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in y.im around 0 81.9%
unpow281.9%
unpow281.9%
hypot-undefine83.2%
Simplified83.2%
Taylor expanded in y.re around 0 81.8%
if -5.0000000000000002e-14 < y.re < 1e14Initial 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-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.re around inf 33.2%
+-commutative33.2%
associate-/l*33.2%
unpow233.2%
unpow233.2%
hypot-undefine63.8%
Simplified63.8%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.re around 0 73.4%
neg-mul-173.4%
distribute-rgt-neg-in73.4%
Simplified73.4%
if 1e14 < y.re Initial program 44.3%
cancel-sign-sub-inv44.3%
fma-define44.3%
hypot-define44.3%
distribute-lft-neg-in44.3%
distribute-rgt-neg-out44.3%
fma-define45.9%
hypot-define67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in y.im around 0 59.1%
unpow259.1%
unpow259.1%
hypot-undefine59.1%
Simplified59.1%
Taylor expanded in y.re around 0 72.2%
add-log-exp72.2%
Applied egg-rr72.2%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -5e-14) (not (<= y.re 1.05e+14))) (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 <= -5e-14) || !(y_46_re <= 1.05e+14)) {
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 <= -5e-14) || !(y_46_re <= 1.05e+14)) {
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 <= -5e-14) or not (y_46_re <= 1.05e+14): 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 <= -5e-14) || !(y_46_re <= 1.05e+14)) 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 <= -5e-14) || ~((y_46_re <= 1.05e+14))) 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, -5e-14], N[Not[LessEqual[y$46$re, 1.05e+14]], $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 -5 \cdot 10^{-14} \lor \neg \left(y.re \leq 1.05 \cdot 10^{+14}\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 < -5.0000000000000002e-14 or 1.05e14 < y.re Initial program 41.7%
cancel-sign-sub-inv41.7%
fma-define41.7%
hypot-define41.7%
distribute-lft-neg-in41.7%
distribute-rgt-neg-out41.7%
fma-define42.4%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.im around 0 71.4%
unpow271.4%
unpow271.4%
hypot-undefine72.1%
Simplified72.1%
Taylor expanded in y.re around 0 77.4%
if -5.0000000000000002e-14 < y.re < 1.05e14Initial 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-define80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in y.re around inf 33.2%
+-commutative33.2%
associate-/l*33.2%
unpow233.2%
unpow233.2%
hypot-undefine63.8%
Simplified63.8%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.re around 0 73.4%
neg-mul-173.4%
distribute-rgt-neg-in73.4%
Simplified73.4%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -14000000000000.0)
(pow x.re y.re)
(if (<= y.re 69000000000000.0)
(exp (* (atan2 x.im x.re) (- y.im)))
(pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -14000000000000.0) {
tmp = pow(x_46_re, y_46_re);
} else if (y_46_re <= 69000000000000.0) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-14000000000000.0d0)) then
tmp = x_46re ** y_46re
else if (y_46re <= 69000000000000.0d0) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -14000000000000.0) {
tmp = Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 69000000000000.0) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -14000000000000.0: tmp = math.pow(x_46_re, y_46_re) elif y_46_re <= 69000000000000.0: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -14000000000000.0) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 69000000000000.0) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -14000000000000.0) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 69000000000000.0) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -14000000000000.0], N[Power[x$46$re, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 69000000000000.0], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -14000000000000:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 69000000000000:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.4e13Initial program 37.9%
cancel-sign-sub-inv37.9%
fma-define37.9%
hypot-define37.9%
distribute-lft-neg-in37.9%
distribute-rgt-neg-out37.9%
fma-define37.9%
hypot-define87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in y.im around 0 83.5%
unpow283.5%
unpow283.5%
hypot-undefine83.5%
Simplified83.5%
Taylor expanded in y.re around 0 81.9%
Taylor expanded in x.im around 0 68.5%
if -1.4e13 < y.re < 6.9e13Initial program 41.7%
cancel-sign-sub-inv41.7%
fma-define41.7%
hypot-define41.7%
distribute-lft-neg-in41.7%
distribute-rgt-neg-out41.7%
fma-define41.7%
hypot-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in y.re around inf 33.8%
+-commutative33.8%
associate-/l*33.8%
unpow233.8%
unpow233.8%
hypot-undefine64.1%
Simplified64.1%
Taylor expanded in y.im around 0 74.9%
Taylor expanded in y.re around 0 73.6%
neg-mul-173.6%
distribute-rgt-neg-in73.6%
Simplified73.6%
if 6.9e13 < y.re Initial program 45.2%
cancel-sign-sub-inv45.2%
fma-define45.2%
hypot-define45.2%
distribute-lft-neg-in45.2%
distribute-rgt-neg-out45.2%
fma-define46.8%
hypot-define67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in y.im around 0 59.8%
unpow259.8%
unpow259.8%
hypot-undefine59.8%
Simplified59.8%
Taylor expanded in y.re around 0 71.1%
Taylor expanded in x.re around 0 63.2%
Final simplification69.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1650000000.0) (not (<= y.re 1700000.0))) (pow x.im 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 <= -1650000000.0) || !(y_46_re <= 1700000.0)) {
tmp = pow(x_46_im, 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 <= (-1650000000.0d0)) .or. (.not. (y_46re <= 1700000.0d0))) then
tmp = x_46im ** 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 <= -1650000000.0) || !(y_46_re <= 1700000.0)) {
tmp = Math.pow(x_46_im, 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 <= -1650000000.0) or not (y_46_re <= 1700000.0): tmp = math.pow(x_46_im, 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 <= -1650000000.0) || !(y_46_re <= 1700000.0)) tmp = x_46_im ^ 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 <= -1650000000.0) || ~((y_46_re <= 1700000.0))) tmp = x_46_im ^ 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, -1650000000.0], N[Not[LessEqual[y$46$re, 1700000.0]], $MachinePrecision]], N[Power[x$46$im, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1650000000 \lor \neg \left(y.re \leq 1700000\right):\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -1.65e9 or 1.7e6 < 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-define42.3%
hypot-define78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in y.im around 0 72.4%
unpow272.4%
unpow272.4%
hypot-undefine72.4%
Simplified72.4%
Taylor expanded in y.re around 0 76.3%
Taylor expanded in x.re around 0 61.1%
if -1.65e9 < y.re < 1.7e6Initial program 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define41.6%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 30.3%
unpow230.3%
unpow230.3%
hypot-undefine45.4%
Simplified45.4%
Taylor expanded in y.re around 0 45.5%
Taylor expanded in y.re around 0 43.3%
Final simplification52.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -0.8) (pow (- x.re) y.re) (if (<= x.re 4.2e-159) (pow x.im y.re) (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -0.8) {
tmp = pow(-x_46_re, y_46_re);
} else if (x_46_re <= 4.2e-159) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-0.8d0)) then
tmp = -x_46re ** y_46re
else if (x_46re <= 4.2d-159) then
tmp = x_46im ** y_46re
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -0.8) {
tmp = Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 4.2e-159) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -0.8: tmp = math.pow(-x_46_re, y_46_re) elif x_46_re <= 4.2e-159: tmp = math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -0.8) tmp = Float64(-x_46_re) ^ y_46_re; elseif (x_46_re <= 4.2e-159) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -0.8) tmp = -x_46_re ^ y_46_re; elseif (x_46_re <= 4.2e-159) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -0.8], N[Power[(-x$46$re), y$46$re], $MachinePrecision], If[LessEqual[x$46$re, 4.2e-159], N[Power[x$46$im, y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -0.8:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 4.2 \cdot 10^{-159}:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -0.80000000000000004Initial program 27.9%
cancel-sign-sub-inv27.9%
fma-define27.9%
hypot-define27.9%
distribute-lft-neg-in27.9%
distribute-rgt-neg-out27.9%
fma-define27.9%
hypot-define80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y.im around 0 43.6%
unpow243.6%
unpow243.6%
hypot-undefine54.8%
Simplified54.8%
Taylor expanded in y.re around 0 53.2%
Taylor expanded in x.re around -inf 53.2%
mul-1-neg53.2%
Simplified53.2%
if -0.80000000000000004 < x.re < 4.1999999999999998e-159Initial program 52.2%
cancel-sign-sub-inv52.2%
fma-define52.2%
hypot-define52.2%
distribute-lft-neg-in52.2%
distribute-rgt-neg-out52.2%
fma-define53.3%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.im around 0 50.8%
unpow250.8%
unpow250.8%
hypot-undefine54.1%
Simplified54.1%
Taylor expanded in y.re around 0 57.5%
Taylor expanded in x.re around 0 51.6%
if 4.1999999999999998e-159 < x.re Initial program 40.4%
cancel-sign-sub-inv40.4%
fma-define40.4%
hypot-define40.4%
distribute-lft-neg-in40.4%
distribute-rgt-neg-out40.4%
fma-define40.4%
hypot-define78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in y.im around 0 57.1%
unpow257.1%
unpow257.1%
hypot-undefine65.9%
Simplified65.9%
Taylor expanded in y.re around 0 68.8%
Taylor expanded in x.im around 0 65.5%
Final simplification57.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -8.6e-52) (pow (- x.im) y.re) (if (<= x.im 8.2e-10) (pow x.re y.re) (pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -8.6e-52) {
tmp = pow(-x_46_im, y_46_re);
} else if (x_46_im <= 8.2e-10) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-8.6d-52)) then
tmp = -x_46im ** y_46re
else if (x_46im <= 8.2d-10) then
tmp = x_46re ** y_46re
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -8.6e-52) {
tmp = Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 8.2e-10) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -8.6e-52: tmp = math.pow(-x_46_im, y_46_re) elif x_46_im <= 8.2e-10: tmp = math.pow(x_46_re, y_46_re) else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -8.6e-52) tmp = Float64(-x_46_im) ^ y_46_re; elseif (x_46_im <= 8.2e-10) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -8.6e-52) tmp = -x_46_im ^ y_46_re; elseif (x_46_im <= 8.2e-10) tmp = x_46_re ^ y_46_re; else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -8.6e-52], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 8.2e-10], N[Power[x$46$re, y$46$re], $MachinePrecision], N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -8.6 \cdot 10^{-52}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 8.2 \cdot 10^{-10}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -8.6000000000000007e-52Initial program 35.8%
cancel-sign-sub-inv35.8%
fma-define35.8%
hypot-define35.8%
distribute-lft-neg-in35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in y.im around 0 46.6%
unpow246.6%
unpow246.6%
hypot-undefine52.9%
Simplified52.9%
Taylor expanded in y.re around 0 56.6%
Taylor expanded in x.im around -inf 55.4%
mul-1-neg55.4%
Simplified55.4%
if -8.6000000000000007e-52 < x.im < 8.1999999999999996e-10Initial program 53.0%
cancel-sign-sub-inv53.0%
fma-define53.0%
hypot-define53.0%
distribute-lft-neg-in53.0%
distribute-rgt-neg-out53.0%
fma-define53.0%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 62.7%
unpow262.7%
unpow262.7%
hypot-undefine67.0%
Simplified67.0%
Taylor expanded in y.re around 0 65.0%
Taylor expanded in x.im around 0 55.5%
if 8.1999999999999996e-10 < x.im Initial program 33.4%
cancel-sign-sub-inv33.4%
fma-define33.4%
hypot-define33.4%
distribute-lft-neg-in33.4%
distribute-rgt-neg-out33.4%
fma-define34.6%
hypot-define76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in y.im around 0 43.3%
unpow243.3%
unpow243.3%
hypot-undefine55.8%
Simplified55.8%
Taylor expanded in y.re around 0 60.9%
Taylor expanded in x.re around 0 62.2%
Final simplification57.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -0.0052) (pow x.re y.re) (if (<= y.re 1700000.0) 1.0 (pow x.im y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.0052) {
tmp = pow(x_46_re, y_46_re);
} else if (y_46_re <= 1700000.0) {
tmp = 1.0;
} else {
tmp = pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-0.0052d0)) then
tmp = x_46re ** y_46re
else if (y_46re <= 1700000.0d0) then
tmp = 1.0d0
else
tmp = x_46im ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -0.0052) {
tmp = Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 1700000.0) {
tmp = 1.0;
} else {
tmp = Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -0.0052: tmp = math.pow(x_46_re, y_46_re) elif y_46_re <= 1700000.0: tmp = 1.0 else: tmp = math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -0.0052) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 1700000.0) tmp = 1.0; else tmp = x_46_im ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -0.0052) tmp = x_46_re ^ y_46_re; elseif (y_46_re <= 1700000.0) tmp = 1.0; else tmp = x_46_im ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.0052], N[Power[x$46$re, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 1700000.0], 1.0, N[Power[x$46$im, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.0052:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 1700000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.0051999999999999998Initial program 39.1%
cancel-sign-sub-inv39.1%
fma-define39.1%
hypot-define39.1%
distribute-lft-neg-in39.1%
distribute-rgt-neg-out39.1%
fma-define39.1%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in y.im around 0 82.7%
unpow282.7%
unpow282.7%
hypot-undefine82.7%
Simplified82.7%
Taylor expanded in y.re around 0 81.3%
Taylor expanded in x.im around 0 68.4%
if -0.0051999999999999998 < y.re < 1.7e6Initial program 41.0%
cancel-sign-sub-inv41.0%
fma-define41.0%
hypot-define41.0%
distribute-lft-neg-in41.0%
distribute-rgt-neg-out41.0%
fma-define41.0%
hypot-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in y.im around 0 29.4%
unpow229.4%
unpow229.4%
hypot-undefine44.9%
Simplified44.9%
Taylor expanded in y.re around 0 44.9%
Taylor expanded in y.re around 0 44.3%
if 1.7e6 < y.re Initial program 45.3%
cancel-sign-sub-inv45.3%
fma-define45.3%
hypot-define45.3%
distribute-lft-neg-in45.3%
distribute-rgt-neg-out45.3%
fma-define46.9%
hypot-define68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in y.im around 0 61.0%
unpow261.0%
unpow261.0%
hypot-undefine61.0%
Simplified61.0%
Taylor expanded in y.re around 0 70.4%
Taylor expanded in x.re around 0 62.8%
(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 41.6%
cancel-sign-sub-inv41.6%
fma-define41.6%
hypot-define41.6%
distribute-lft-neg-in41.6%
distribute-rgt-neg-out41.6%
fma-define42.0%
hypot-define79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in y.im around 0 51.7%
unpow251.7%
unpow251.7%
hypot-undefine59.1%
Simplified59.1%
Taylor expanded in y.re around 0 61.1%
Taylor expanded in y.re around 0 22.7%
herbie shell --seed 2024110
(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)))))