
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) -0.85)
(*
t_3
(fabs (cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* y.im t_0))) 3.0))))
(*
(exp
(*
y.re
(-
(fma
-1.0
t_0
(*
y.im
(/ (pow (pow (cbrt (cbrt (atan2 x.im x.re))) 3.0) 3.0) y.re))))))
(expm1 (log1p (cos (fma (log (hypot x.re x.im)) y.im t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= -0.85) {
tmp = t_3 * fabs(cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0))), 3.0)));
} else {
tmp = exp((y_46_re * -fma(-1.0, t_0, (y_46_im * (pow(pow(cbrt(cbrt(atan2(x_46_im, x_46_re))), 3.0), 3.0) / y_46_re))))) * expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.85) tmp = Float64(t_3 * abs(cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))) ^ 3.0)))); else tmp = Float64(exp(Float64(y_46_re * Float64(-fma(-1.0, t_0, Float64(y_46_im * Float64(((cbrt(cbrt(atan(x_46_im, x_46_re))) ^ 3.0) ^ 3.0) / y_46_re)))))) * expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$3 * N[Abs[N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(y$46$re * (-N[(-1.0 * t$95$0 + N[(y$46$im * N[(N[Power[N[Power[N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[(Exp[N[Log[1 + N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -0.85:\\
\;\;\;\;t\_3 \cdot \left|\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_0\right)}\right)}^{3}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left(-\mathsf{fma}\left(-1, t\_0, y.im \cdot \frac{{\left({\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{3}\right)}^{3}}{y.re}\right)\right)} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
add-cube-cbrt62.8%
pow362.9%
fma-undefine62.9%
*-commutative62.9%
fma-define62.9%
*-commutative62.9%
Applied egg-rr62.9%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
fma-undefine85.3%
*-commutative85.3%
rem-exp-log41.9%
*-commutative41.9%
expm1-log1p-u41.9%
expm1-undefine41.9%
rem-exp-log85.4%
*-commutative85.4%
*-commutative85.4%
fma-undefine85.4%
Applied egg-rr85.4%
expm1-define85.3%
Simplified85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) -0.85)
(*
t_3
(fabs (cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* y.im t_0))) 3.0))))
(*
(exp
(*
y.re
(-
(fma
-1.0
t_0
(*
y.im
(/ (pow (pow (cbrt (cbrt (atan2 x.im x.re))) 3.0) 3.0) y.re))))))
(cos (fma (log (hypot x.re x.im)) y.im t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= -0.85) {
tmp = t_3 * fabs(cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0))), 3.0)));
} else {
tmp = exp((y_46_re * -fma(-1.0, t_0, (y_46_im * (pow(pow(cbrt(cbrt(atan2(x_46_im, x_46_re))), 3.0), 3.0) / y_46_re))))) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.85) tmp = Float64(t_3 * abs(cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))) ^ 3.0)))); else tmp = Float64(exp(Float64(y_46_re * Float64(-fma(-1.0, t_0, Float64(y_46_im * Float64(((cbrt(cbrt(atan(x_46_im, x_46_re))) ^ 3.0) ^ 3.0) / y_46_re)))))) * cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$3 * N[Abs[N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(y$46$re * (-N[(-1.0 * t$95$0 + N[(y$46$im * N[(N[Power[N[Power[N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -0.85:\\
\;\;\;\;t\_3 \cdot \left|\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_0\right)}\right)}^{3}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left(-\mathsf{fma}\left(-1, t\_0, y.im \cdot \frac{{\left({\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{3}\right)}^{3}}{y.re}\right)\right)} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
add-cube-cbrt62.8%
pow362.9%
fma-undefine62.9%
*-commutative62.9%
fma-define62.9%
*-commutative62.9%
Applied egg-rr62.9%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) -0.85)
(*
t_3
(fabs (cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* y.im t_0))) 3.0))))
(*
(expm1 (log1p (cos (fma (log (hypot x.re x.im)) y.im t_1))))
(exp
(*
(fma -1.0 t_0 (* y.im (/ (pow (cbrt (atan2 x.im x.re)) 3.0) y.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_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= -0.85) {
tmp = t_3 * fabs(cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0))), 3.0)));
} else {
tmp = expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)))) * exp((fma(-1.0, t_0, (y_46_im * (pow(cbrt(atan2(x_46_im, x_46_re)), 3.0) / y_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_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.85) tmp = Float64(t_3 * abs(cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))) ^ 3.0)))); else tmp = Float64(expm1(log1p(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)))) * exp(Float64(fma(-1.0, t_0, Float64(y_46_im * Float64((cbrt(atan(x_46_im, x_46_re)) ^ 3.0) / y_46_re))) * Float64(-y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$3 * N[Abs[N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(Exp[N[Log[1 + N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision] * N[Exp[N[(N[(-1.0 * t$95$0 + N[(y$46$im * N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -0.85:\\
\;\;\;\;t\_3 \cdot \left|\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_0\right)}\right)}^{3}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right)\right)\right) \cdot e^{\mathsf{fma}\left(-1, t\_0, y.im \cdot \frac{{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}{y.re}\right) \cdot \left(-y.re\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
add-cube-cbrt62.8%
pow362.9%
fma-undefine62.9%
*-commutative62.9%
fma-define62.9%
*-commutative62.9%
Applied egg-rr62.9%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
fma-undefine85.3%
*-commutative85.3%
rem-exp-log41.9%
*-commutative41.9%
expm1-log1p-u41.9%
expm1-undefine41.9%
rem-exp-log85.4%
*-commutative85.4%
*-commutative85.4%
fma-undefine85.4%
Applied egg-rr85.3%
expm1-define85.3%
Simplified85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) -0.85)
(*
t_3
(fabs (cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* y.im t_0))) 3.0))))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_1))
(exp
(*
(fma -1.0 t_0 (* y.im (/ (pow (cbrt (atan2 x.im x.re)) 3.0) y.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_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= -0.85) {
tmp = t_3 * fabs(cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * t_0))), 3.0)));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp((fma(-1.0, t_0, (y_46_im * (pow(cbrt(atan2(x_46_im, x_46_re)), 3.0) / y_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_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.85) tmp = Float64(t_3 * abs(cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * t_0))) ^ 3.0)))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * exp(Float64(fma(-1.0, t_0, Float64(y_46_im * Float64((cbrt(atan(x_46_im, x_46_re)) ^ 3.0) / y_46_re))) * Float64(-y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$3 * N[Abs[N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(-1.0 * t$95$0 + N[(y$46$im * N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -0.85:\\
\;\;\;\;t\_3 \cdot \left|\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot t\_0\right)}\right)}^{3}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot e^{\mathsf{fma}\left(-1, t\_0, y.im \cdot \frac{{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}{y.re}\right) \cdot \left(-y.re\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
add-cube-cbrt62.8%
pow362.9%
fma-undefine62.9%
*-commutative62.9%
fma-define62.9%
*-commutative62.9%
Applied egg-rr62.9%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (* y.im t_3))))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp
(*
(fma -1.0 t_3 (* y.im (/ (pow (cbrt (atan2 x.im x.re)) 3.0) y.re)))
(- y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos((y_46_im * t_3)));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((fma(-1.0, t_3, (y_46_im * (pow(cbrt(atan2(x_46_im, x_46_re)), 3.0) / y_46_re))) * -y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(Float64(y_46_im * t_3)))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(fma(-1.0, t_3, Float64(y_46_im * Float64((cbrt(atan(x_46_im, x_46_re)) ^ 3.0) / y_46_re))) * Float64(-y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$im * t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(-1.0 * t$95$3 + N[(y$46$im * N[(N[Power[N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-y$46$re)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(y.im \cdot t\_3\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\mathsf{fma}\left(-1, t\_3, y.im \cdot \frac{{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)}^{3}}{y.re}\right) \cdot \left(-y.re\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.re around 0 62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
add-cube-cbrt85.3%
pow385.3%
Applied egg-rr85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* t_1 y.re) (* (atan2 x.im x.re) y.im))))
(t_3 (log (hypot x.im x.re))))
(if (<= (* t_2 (cos (+ (* t_1 y.im) t_0))) -0.85)
(* t_2 (fabs (cos (* y.im t_3))))
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* y.re (- (fma -1.0 t_3 (* y.im (/ (atan2 x.im x.re) y.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((t_1 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re));
double tmp;
if ((t_2 * cos(((t_1 * y_46_im) + t_0))) <= -0.85) {
tmp = t_2 * fabs(cos((y_46_im * t_3)));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((y_46_re * -fma(-1.0, t_3, (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re)))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(t_1 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(t_1 * y_46_im) + t_0))) <= -0.85) tmp = Float64(t_2 * abs(cos(Float64(y_46_im * t_3)))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(y_46_re * Float64(-fma(-1.0, t_3, Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re))))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(t$95$1 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(t$95$1 * y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$im * t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(y$46$re * (-N[(-1.0 * t$95$3 + N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{t\_1 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;t\_2 \cdot \cos \left(t\_1 \cdot y.im + t\_0\right) \leq -0.85:\\
\;\;\;\;t\_2 \cdot \left|\cos \left(y.im \cdot t\_3\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{y.re \cdot \left(-\mathsf{fma}\left(-1, t\_3, y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.re around 0 62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y.re around -inf 62.1%
mul-1-neg62.1%
fma-define62.1%
unpow262.1%
unpow262.1%
hypot-undefine85.3%
associate-/l*85.3%
Simplified85.3%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (exp (- (* t_2 y.re) (* (atan2 x.im x.re) y.im)))))
(if (<= (* t_3 (cos (+ (* t_2 y.im) t_1))) -0.85)
(* t_3 (fabs (cos (* y.im (log (hypot x.im x.re))))))
(*
(cos (fma t_0 y.im t_1))
(exp (fma t_0 y.re (* (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 t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_3 = exp(((t_2 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_3 * cos(((t_2 * y_46_im) + t_1))) <= -0.85) {
tmp = t_3 * fabs(cos((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else {
tmp = cos(fma(t_0, y_46_im, t_1)) * exp(fma(t_0, y_46_re, (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) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_3 = exp(Float64(Float64(t_2 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_3 * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.85) tmp = Float64(t_3 * abs(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(cos(fma(t_0, y_46_im, t_1)) * exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.85], N[(t$95$3 * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(t$95$0 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_3 := e^{t\_2 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;t\_3 \cdot \cos \left(t\_2 \cdot y.im + t\_1\right) \leq -0.85:\\
\;\;\;\;t\_3 \cdot \left|\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_0, y.im, t\_1\right)\right) \cdot e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < -0.849999999999999978Initial program 30.6%
fma-define30.6%
hypot-define30.6%
*-commutative30.6%
add-sqr-sqrt0.0%
sqrt-unprod62.8%
pow262.8%
fma-undefine62.8%
*-commutative62.8%
*-commutative62.8%
fma-define62.8%
Applied egg-rr62.8%
unpow262.8%
rem-sqrt-square62.8%
fma-define62.8%
+-commutative62.8%
fma-define62.8%
hypot-undefine62.8%
unpow262.8%
unpow262.8%
+-commutative62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
Taylor expanded in y.re around 0 62.8%
unpow262.8%
unpow262.8%
hypot-undefine62.8%
Simplified62.8%
if -0.849999999999999978 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define85.3%
*-commutative85.3%
Simplified85.3%
Final simplification83.3%
(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 (- (* t_0 y.re) (* (atan2 x.im x.re) y.im))))
(t_2 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= (* t_1 (cos (+ (* t_0 y.im) (* y.re (atan2 x.im x.re))))) INFINITY)
(* t_1 (fabs t_2))
(*
t_2
(/ (pow (hypot x.re x.im) y.re) (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 t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if ((t_1 * cos(((t_0 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= ((double) INFINITY)) {
tmp = t_1 * fabs(t_2);
} else {
tmp = t_2 * (pow(hypot(x_46_re, x_46_im), y_46_re) / 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 t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_1 = Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if ((t_1 * Math.cos(((t_0 * y_46_im) + (y_46_re * Math.atan2(x_46_im, x_46_re))))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 * Math.abs(t_2);
} else {
tmp = t_2 * (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)));
}
return tmp;
}
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)))) t_1 = math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if (t_1 * math.cos(((t_0 * y_46_im) + (y_46_re * math.atan2(x_46_im, x_46_re))))) <= math.inf: tmp = t_1 * math.fabs(t_2) else: tmp = t_2 * (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))) 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(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (Float64(t_1 * cos(Float64(Float64(t_0 * y_46_im) + Float64(y_46_re * atan(x_46_im, x_46_re))))) <= Inf) tmp = Float64(t_1 * abs(t_2)); else tmp = Float64(t_2 * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (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) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_1 = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); t_2 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if ((t_1 * cos(((t_0 * y_46_im) + (y_46_re * atan2(x_46_im, x_46_re))))) <= Inf) tmp = t_1 * abs(t_2); else tmp = t_2 * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (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_] := 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[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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]]]]]
\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^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;t\_1 \cdot \cos \left(t\_0 \cdot y.im + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \leq \infty:\\
\;\;\;\;t\_1 \cdot \left|t\_2\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2 \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}}}\\
\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 76.8%
fma-define76.8%
hypot-define76.1%
*-commutative76.1%
add-sqr-sqrt57.7%
sqrt-unprod81.4%
pow281.4%
fma-undefine81.4%
*-commutative81.4%
*-commutative81.4%
fma-define81.4%
Applied egg-rr81.4%
unpow281.4%
rem-sqrt-square81.4%
fma-define81.4%
+-commutative81.4%
fma-define81.4%
hypot-undefine81.4%
unpow281.4%
unpow281.4%
+-commutative81.4%
unpow281.4%
unpow281.4%
hypot-undefine81.4%
Simplified81.4%
Taylor expanded in y.re around 0 80.5%
unpow280.5%
unpow280.5%
hypot-undefine80.5%
Simplified80.5%
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%
exp-diff0.0%
exp-to-pow0.0%
hypot-define0.0%
*-commutative0.0%
exp-prod0.0%
fma-define0.0%
hypot-define77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in y.im around inf 0.0%
unpow20.0%
unpow20.0%
hypot-undefine80.2%
Simplified80.2%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (* (atan2 x.im x.re) (- y.im))))
(if (<= y.re -1.8e-20)
(*
(exp (fma t_1 y.re t_2))
(cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_0 y.re))))))
(if (<= y.re 1.05e-32)
(* (cos (fma t_1 y.im (* y.re (atan2 x.im x.re)))) (exp t_2))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.im t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = atan2(x_46_im, x_46_re) * -y_46_im;
double tmp;
if (y_46_re <= -1.8e-20) {
tmp = exp(fma(t_1, y_46_re, t_2)) * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_0 / y_46_re)))));
} else if (y_46_re <= 1.05e-32) {
tmp = cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp(t_2);
} else {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * t_0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) tmp = 0.0 if (y_46_re <= -1.8e-20) tmp = Float64(exp(fma(t_1, y_46_re, t_2)) * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_0 / y_46_re)))))); elseif (y_46_re <= 1.05e-32) tmp = Float64(cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(t_2)); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * t_0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e-20], N[(N[Exp[N[(t$95$1 * y$46$re + t$95$2), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.05e-32], N[(N[Cos[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{-20}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, t\_2\right)} \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_0}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{t\_2}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot t\_0\right)\\
\end{array}
\end{array}
if y.re < -1.79999999999999987e-20Initial program 45.5%
cancel-sign-sub-inv45.5%
fma-define45.5%
hypot-define45.5%
distribute-lft-neg-in45.5%
distribute-rgt-neg-out45.5%
fma-define45.5%
hypot-define89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y.re around inf 45.5%
+-commutative45.5%
associate-/l*46.8%
unpow246.8%
unpow246.8%
hypot-undefine90.7%
Simplified90.7%
if -1.79999999999999987e-20 < y.re < 1.05e-32Initial program 34.9%
cancel-sign-sub-inv34.9%
fma-define34.9%
hypot-define34.9%
distribute-lft-neg-in34.9%
distribute-rgt-neg-out34.9%
fma-define34.9%
hypot-define82.2%
*-commutative82.2%
Simplified82.2%
Taylor expanded in y.re around 0 82.2%
neg-mul-182.2%
distribute-lft-neg-in82.2%
Simplified82.2%
if 1.05e-32 < y.re Initial program 42.6%
Taylor expanded in y.re around 0 44.6%
unpow244.6%
unpow244.6%
hypot-undefine72.5%
Simplified72.5%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.im))) (t_1 (log (hypot x.im x.re))))
(if (<= x.im -2.7e+16)
(*
(cos (- (* y.re (atan2 x.im x.re)) (* y.im t_0)))
(exp (- (- (* y.re t_0)) (* (atan2 x.im x.re) y.im))))
(if (<= x.im 1.45e-148)
(*
(cos (* y.im t_1))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(*
(exp (* y.re (- (fma -1.0 t_1 (* y.im (/ (atan2 x.im x.re) y.re))))))
(cos (* y.im (log x.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_im));
double t_1 = log(hypot(x_46_im, x_46_re));
double tmp;
if (x_46_im <= -2.7e+16) {
tmp = cos(((y_46_re * atan2(x_46_im, x_46_re)) - (y_46_im * t_0))) * exp((-(y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else if (x_46_im <= 1.45e-148) {
tmp = cos((y_46_im * t_1)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = exp((y_46_re * -fma(-1.0, t_1, (y_46_im * (atan2(x_46_im, x_46_re) / y_46_re))))) * cos((y_46_im * log(x_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_im)) t_1 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (x_46_im <= -2.7e+16) tmp = Float64(cos(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) - Float64(y_46_im * t_0))) * exp(Float64(Float64(-Float64(y_46_re * t_0)) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); elseif (x_46_im <= 1.45e-148) tmp = Float64(cos(Float64(y_46_im * t_1)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(y_46_re * Float64(-fma(-1.0, t_1, Float64(y_46_im * Float64(atan(x_46_im, x_46_re) / y_46_re)))))) * cos(Float64(y_46_im * log(x_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -2.7e+16], N[(N[Cos[N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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]), $MachinePrecision], If[LessEqual[x$46$im, 1.45e-148], N[(N[Cos[N[(y$46$im * t$95$1), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(y$46$re * (-N[(-1.0 * t$95$1 + N[(y$46$im * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.im}\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;x.im \leq -2.7 \cdot 10^{+16}:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot t\_0\right) \cdot e^{\left(-y.re \cdot t\_0\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.im \leq 1.45 \cdot 10^{-148}:\\
\;\;\;\;\cos \left(y.im \cdot t\_1\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \left(-\mathsf{fma}\left(-1, t\_1, y.im \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.re}\right)\right)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -2.7e16Initial program 28.9%
cancel-sign-sub-inv28.9%
fma-define28.9%
hypot-define28.9%
distribute-lft-neg-in28.9%
distribute-rgt-neg-out28.9%
fma-define28.9%
hypot-define87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in x.im around -inf 88.6%
if -2.7e16 < x.im < 1.4499999999999999e-148Initial program 45.7%
exp-diff42.4%
exp-to-pow42.4%
hypot-define42.4%
*-commutative42.4%
exp-prod40.2%
fma-define40.2%
hypot-define70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in y.im around inf 44.2%
unpow244.2%
unpow244.2%
hypot-undefine75.1%
Simplified75.1%
if 1.4499999999999999e-148 < x.im Initial program 41.5%
cancel-sign-sub-inv41.5%
fma-define41.5%
hypot-define41.5%
distribute-lft-neg-in41.5%
distribute-rgt-neg-out41.5%
fma-define41.5%
hypot-define80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in y.re around -inf 59.4%
mul-1-neg59.4%
fma-define59.4%
unpow259.4%
unpow259.4%
hypot-undefine80.7%
associate-/l*80.7%
Simplified80.7%
Taylor expanded in x.re around 0 80.9%
Taylor expanded in y.re around 0 83.1%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.000122) (not (<= y.re 1.05e-32)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.im (log (hypot x.im x.re)))))
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.000122) || !(y_46_re <= 1.05e-32)) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.000122) || !(y_46_re <= 1.05e-32)) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.000122], N[Not[LessEqual[y$46$re, 1.05e-32]], $MachinePrecision]], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $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], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.000122 \lor \neg \left(y.re \leq 1.05 \cdot 10^{-32}\right):\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \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)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.21999999999999997e-4 or 1.05e-32 < y.re Initial program 45.8%
Taylor expanded in y.re around 0 47.9%
unpow247.9%
unpow247.9%
hypot-undefine81.1%
Simplified81.1%
if -1.21999999999999997e-4 < y.re < 1.05e-32Initial program 33.5%
cancel-sign-sub-inv33.5%
fma-define33.5%
hypot-define33.5%
distribute-lft-neg-in33.5%
distribute-rgt-neg-out33.5%
fma-define33.5%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.re around 0 81.4%
neg-mul-181.4%
distribute-lft-neg-in81.4%
Simplified81.4%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -2.05e-6)
(* (cos (* y.im (log (hypot x.im x.re)))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.05e-32)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -2.05e-6) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.05e-32) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.05e-6) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.05e-32) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.05e-6], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $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, 1.05e-32], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -2.05 \cdot 10^{-6}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\end{array}
\end{array}
if y.re < -2.0499999999999999e-6Initial program 47.9%
exp-diff42.5%
exp-to-pow42.5%
hypot-define42.5%
*-commutative42.5%
exp-prod39.7%
fma-define39.7%
hypot-define75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in y.im around inf 41.8%
unpow241.8%
unpow241.8%
hypot-undefine77.2%
Simplified77.2%
Taylor expanded in y.im around 0 84.4%
unpow284.4%
unpow284.4%
hypot-undefine85.6%
Simplified85.6%
if -2.0499999999999999e-6 < y.re < 1.05e-32Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.re around 0 81.9%
neg-mul-181.9%
distribute-lft-neg-in81.9%
Simplified81.9%
if 1.05e-32 < y.re Initial program 42.6%
Taylor expanded in y.im around 0 67.2%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -3.2e-6)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.05e-32)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.2e-6) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.05e-32) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * 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)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -3.2e-6) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.05e-32) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -3.2e-6: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 1.05e-32: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -3.2e-6) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.05e-32) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -3.2e-6) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 1.05e-32) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * 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))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -3.2e-6], 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, 1.05e-32], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -3.1999999999999999e-6Initial program 47.9%
exp-diff42.5%
exp-to-pow42.5%
hypot-define42.5%
*-commutative42.5%
exp-prod39.7%
fma-define39.7%
hypot-define75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in y.im around inf 41.8%
unpow241.8%
unpow241.8%
hypot-undefine77.2%
Simplified77.2%
Taylor expanded in y.im around 0 84.4%
unpow284.4%
unpow284.4%
hypot-undefine85.6%
Simplified85.6%
if -3.1999999999999999e-6 < y.re < 1.05e-32Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.re around 0 33.8%
unpow233.8%
unpow233.8%
hypot-undefine81.9%
neg-mul-181.9%
distribute-lft-neg-in81.9%
Simplified81.9%
if 1.05e-32 < y.re Initial program 42.6%
Taylor expanded in y.im around 0 67.2%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (or (<= y.re -2.3e-5) (not (<= y.re 220000000.0)))
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (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 t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -2.3e-5) || !(y_46_re <= 220000000.0)) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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 t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -2.3e-5) || !(y_46_re <= 220000000.0)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * 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): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if (y_46_re <= -2.3e-5) or not (y_46_re <= 220000000.0): tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * 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) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_re <= -2.3e-5) || !(y_46_re <= 220000000.0)) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * 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) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if ((y_46_re <= -2.3e-5) || ~((y_46_re <= 220000000.0))) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * 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_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -2.3e-5], N[Not[LessEqual[y$46$re, 220000000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{-5} \lor \neg \left(y.re \leq 220000000\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.3e-5 or 2.2e8 < y.re Initial program 45.2%
exp-diff36.5%
exp-to-pow36.5%
hypot-define36.5%
*-commutative36.5%
exp-prod34.9%
fma-define34.9%
hypot-define63.4%
*-commutative63.4%
Simplified63.4%
Taylor expanded in y.im around inf 36.9%
unpow236.9%
unpow236.9%
hypot-undefine67.8%
Simplified67.8%
Taylor expanded in y.im around 0 77.6%
unpow277.6%
unpow277.6%
hypot-undefine78.2%
Simplified78.2%
if -2.3e-5 < y.re < 2.2e8Initial program 34.8%
cancel-sign-sub-inv34.8%
fma-define34.8%
hypot-define34.8%
distribute-lft-neg-in34.8%
distribute-rgt-neg-out34.8%
fma-define34.8%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.re around 0 34.1%
unpow234.1%
unpow234.1%
hypot-undefine79.3%
neg-mul-179.3%
distribute-lft-neg-in79.3%
Simplified79.3%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 3.2e+163) (* (cos (* y.im (log (hypot x.im x.re)))) (pow (hypot x.im x.re) y.re)) (* (cos (* y.im (log x.im))) (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 <= 3.2e+163) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = cos((y_46_im * log(x_46_im))) * 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 <= 3.2e+163) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_im))) * 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 <= 3.2e+163: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.cos((y_46_im * math.log(x_46_im))) * 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 <= 3.2e+163) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(cos(Float64(y_46_im * log(x_46_im))) * (exp(Float64(-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 <= 3.2e+163) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = cos((y_46_im * log(x_46_im))) * (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, 3.2e+163], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 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 3.2 \cdot 10^{+163}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right) \cdot {\left(e^{-y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.im < 3.1999999999999998e163Initial program 39.5%
exp-diff35.9%
exp-to-pow35.9%
hypot-define35.9%
*-commutative35.9%
exp-prod34.6%
fma-define34.6%
hypot-define71.6%
*-commutative71.6%
Simplified71.6%
Taylor expanded in y.im around inf 35.3%
unpow235.3%
unpow235.3%
hypot-undefine73.7%
Simplified73.7%
Taylor expanded in y.im around 0 53.3%
unpow253.3%
unpow253.3%
hypot-undefine68.4%
Simplified68.4%
if 3.1999999999999998e163 < y.im Initial program 43.4%
cancel-sign-sub-inv43.4%
fma-define43.4%
hypot-define43.4%
distribute-lft-neg-in43.4%
distribute-rgt-neg-out43.4%
fma-define43.4%
hypot-define86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in y.re around -inf 80.1%
mul-1-neg80.1%
fma-define80.1%
unpow280.1%
unpow280.1%
hypot-undefine86.7%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in x.re around 0 70.1%
Taylor expanded in y.re around 0 70.1%
Taylor expanded in y.re around 0 66.8%
*-commutative66.8%
distribute-lft-neg-in66.8%
exp-prod66.8%
Simplified66.8%
Final simplification68.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 8e+25) (pow (hypot x.im x.re) y.re) (* (exp (* (atan2 x.im x.re) (- y.im))) (cos (* y.im (log x.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 8e+25) {
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)) * cos((y_46_im * log(x_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_im <= 8e+25) {
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)) * Math.cos((y_46_im * Math.log(x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 8e+25: 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)) * math.cos((y_46_im * math.log(x_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 8e+25) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * cos(Float64(y_46_im * log(x_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_im <= 8e+25) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * cos((y_46_im * log(x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 8e+25], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 8 \cdot 10^{+25}:\\
\;\;\;\;{\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)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if y.im < 8.00000000000000072e25Initial 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.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.im around 0 51.9%
unpow251.9%
unpow251.9%
hypot-undefine69.0%
Simplified69.0%
Taylor expanded in y.re around 0 70.9%
if 8.00000000000000072e25 < y.im Initial program 36.0%
cancel-sign-sub-inv36.0%
fma-define36.0%
hypot-define36.0%
distribute-lft-neg-in36.0%
distribute-rgt-neg-out36.0%
fma-define36.0%
hypot-define80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in y.re around -inf 67.2%
mul-1-neg67.2%
fma-define67.2%
unpow267.2%
unpow267.2%
hypot-undefine80.0%
associate-/l*80.0%
Simplified80.0%
Taylor expanded in x.re around 0 55.8%
Taylor expanded in y.re around 0 57.6%
Taylor expanded in y.re around 0 54.2%
*-commutative54.2%
distribute-lft-neg-in54.2%
Simplified54.2%
Final simplification67.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 0.000104) (pow (hypot x.im x.re) y.re) (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_im <= 0.000104) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} 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_im <= 0.000104) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} 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_im <= 0.000104: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) 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_im <= 0.000104) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; 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_im <= 0.000104) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; 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$im, 0.000104], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $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.im \leq 0.000104:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < 1.03999999999999994e-4Initial 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-define80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in y.im around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine70.2%
Simplified70.2%
Taylor expanded in y.re around 0 71.6%
if 1.03999999999999994e-4 < y.im Initial program 38.5%
cancel-sign-sub-inv38.5%
fma-define38.5%
hypot-define38.5%
distribute-lft-neg-in38.5%
distribute-rgt-neg-out38.5%
fma-define38.5%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y.im around 0 43.8%
unpow243.8%
unpow243.8%
hypot-undefine36.9%
Simplified36.9%
Taylor expanded in y.re around 0 36.9%
add-log-exp51.6%
Applied egg-rr51.6%
Final simplification66.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 1.48e-27) (pow (hypot x.im x.re) y.re) (pow (pow (hypot x.im x.re) 2.0) (* y.re 0.5))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 1.48e-27) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = pow(pow(hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
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 <= 1.48e-27) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.pow(Math.pow(Math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 1.48e-27: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.pow(math.pow(math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 1.48e-27) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = (hypot(x_46_im, x_46_re) ^ 2.0) ^ Float64(y_46_re * 0.5); 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 <= 1.48e-27) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = (hypot(x_46_im, x_46_re) ^ 2.0) ^ (y_46_re * 0.5); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 1.48e-27], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Power[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 1.48 \cdot 10^{-27}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{2}\right)}^{\left(y.re \cdot 0.5\right)}\\
\end{array}
\end{array}
if y.im < 1.48000000000000008e-27Initial program 39.0%
cancel-sign-sub-inv39.0%
fma-define39.0%
hypot-define39.0%
distribute-lft-neg-in39.0%
distribute-rgt-neg-out39.0%
fma-define39.0%
hypot-define79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.im around 0 50.9%
unpow250.9%
unpow250.9%
hypot-undefine69.4%
Simplified69.4%
Taylor expanded in y.re around 0 70.9%
if 1.48000000000000008e-27 < y.im Initial program 42.1%
cancel-sign-sub-inv42.1%
fma-define42.1%
hypot-define42.1%
distribute-lft-neg-in42.1%
distribute-rgt-neg-out42.1%
fma-define42.1%
hypot-define82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.im around 0 47.7%
unpow247.7%
unpow247.7%
hypot-undefine41.4%
Simplified41.4%
Taylor expanded in y.re around 0 41.4%
*-un-lft-identity41.4%
sqr-pow41.4%
pow-prod-down47.7%
pow247.7%
div-inv47.7%
metadata-eval47.7%
Applied egg-rr47.7%
Final simplification64.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.4%
Simplified61.4%
Taylor expanded in y.re around 0 62.5%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.00016) (not (<= y.re 1.7e-47))) (pow (* x.re (+ 1.0 (* 0.5 (* (/ x.im x.re) (/ x.im 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 <= -0.00016) || !(y_46_re <= 1.7e-47)) {
tmp = pow((x_46_re * (1.0 + (0.5 * ((x_46_im / x_46_re) * (x_46_im / 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 <= (-0.00016d0)) .or. (.not. (y_46re <= 1.7d-47))) then
tmp = (x_46re * (1.0d0 + (0.5d0 * ((x_46im / x_46re) * (x_46im / 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 <= -0.00016) || !(y_46_re <= 1.7e-47)) {
tmp = Math.pow((x_46_re * (1.0 + (0.5 * ((x_46_im / x_46_re) * (x_46_im / 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 <= -0.00016) or not (y_46_re <= 1.7e-47): tmp = math.pow((x_46_re * (1.0 + (0.5 * ((x_46_im / x_46_re) * (x_46_im / 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 <= -0.00016) || !(y_46_re <= 1.7e-47)) tmp = Float64(x_46_re * Float64(1.0 + Float64(0.5 * Float64(Float64(x_46_im / x_46_re) * Float64(x_46_im / 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 <= -0.00016) || ~((y_46_re <= 1.7e-47))) tmp = (x_46_re * (1.0 + (0.5 * ((x_46_im / x_46_re) * (x_46_im / 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, -0.00016], N[Not[LessEqual[y$46$re, 1.7e-47]], $MachinePrecision]], N[Power[N[(x$46$re * N[(1.0 + N[(0.5 * N[(N[(x$46$im / x$46$re), $MachinePrecision] * N[(x$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00016 \lor \neg \left(y.re \leq 1.7 \cdot 10^{-47}\right):\\
\;\;\;\;{\left(x.re \cdot \left(1 + 0.5 \cdot \left(\frac{x.im}{x.re} \cdot \frac{x.im}{x.re}\right)\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -1.60000000000000013e-4 or 1.7000000000000001e-47 < y.re Initial program 45.1%
cancel-sign-sub-inv45.1%
fma-define45.1%
hypot-define45.1%
distribute-lft-neg-in45.1%
distribute-rgt-neg-out45.1%
fma-define45.1%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around 0 68.6%
unpow268.6%
unpow268.6%
hypot-undefine68.1%
Simplified68.1%
Taylor expanded in y.re around 0 70.3%
Taylor expanded in x.re around inf 58.2%
add-sqr-sqrt58.2%
sqrt-div58.2%
sqrt-pow158.2%
metadata-eval58.2%
pow158.2%
sqrt-pow158.2%
metadata-eval58.2%
pow158.2%
sqrt-div58.2%
sqrt-pow163.9%
metadata-eval63.9%
pow163.9%
sqrt-pow165.3%
metadata-eval65.3%
pow165.3%
Applied egg-rr65.3%
if -1.60000000000000013e-4 < y.re < 1.7000000000000001e-47Initial program 33.5%
cancel-sign-sub-inv33.5%
fma-define33.5%
hypot-define33.5%
distribute-lft-neg-in33.5%
distribute-rgt-neg-out33.5%
fma-define33.5%
hypot-define83.9%
*-commutative83.9%
Simplified83.9%
Taylor expanded in y.im around 0 26.8%
unpow226.8%
unpow226.8%
hypot-undefine53.2%
Simplified53.2%
Taylor expanded in y.re around 0 52.8%
Taylor expanded in y.re around 0 52.5%
Final simplification59.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -32000000.0) (not (<= y.re 5.8e-11))) (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 <= -32000000.0) || !(y_46_re <= 5.8e-11)) {
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 <= (-32000000.0d0)) .or. (.not. (y_46re <= 5.8d-11))) 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 <= -32000000.0) || !(y_46_re <= 5.8e-11)) {
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 <= -32000000.0) or not (y_46_re <= 5.8e-11): 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 <= -32000000.0) || !(y_46_re <= 5.8e-11)) 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 <= -32000000.0) || ~((y_46_re <= 5.8e-11))) 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, -32000000.0], N[Not[LessEqual[y$46$re, 5.8e-11]], $MachinePrecision]], N[Power[x$46$im, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -32000000 \lor \neg \left(y.re \leq 5.8 \cdot 10^{-11}\right):\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -3.2e7 or 5.8e-11 < y.re Initial program 46.1%
cancel-sign-sub-inv46.1%
fma-define46.1%
hypot-define46.1%
distribute-lft-neg-in46.1%
distribute-rgt-neg-out46.1%
fma-define46.1%
hypot-define79.7%
*-commutative79.7%
Simplified79.7%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
unpow272.0%
hypot-undefine72.0%
Simplified72.0%
Taylor expanded in y.re around 0 74.5%
Taylor expanded in x.re around 0 56.1%
if -3.2e7 < y.re < 5.8e-11Initial program 33.8%
cancel-sign-sub-inv33.8%
fma-define33.8%
hypot-define33.8%
distribute-lft-neg-in33.8%
distribute-rgt-neg-out33.8%
fma-define33.8%
hypot-define81.2%
*-commutative81.2%
Simplified81.2%
Taylor expanded in y.im around 0 28.0%
unpow228.0%
unpow228.0%
hypot-undefine50.9%
Simplified50.9%
Taylor expanded in y.re around 0 50.5%
Taylor expanded in y.re around 0 49.5%
Final simplification52.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -0.62) (pow (- x.im) y.re) (if (<= x.im 7.8e-183) (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 <= -0.62) {
tmp = pow(-x_46_im, y_46_re);
} else if (x_46_im <= 7.8e-183) {
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 <= (-0.62d0)) then
tmp = -x_46im ** y_46re
else if (x_46im <= 7.8d-183) 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 <= -0.62) {
tmp = Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 7.8e-183) {
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 <= -0.62: tmp = math.pow(-x_46_im, y_46_re) elif x_46_im <= 7.8e-183: 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 <= -0.62) tmp = Float64(-x_46_im) ^ y_46_re; elseif (x_46_im <= 7.8e-183) 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 <= -0.62) tmp = -x_46_im ^ y_46_re; elseif (x_46_im <= 7.8e-183) 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, -0.62], N[Power[(-x$46$im), y$46$re], $MachinePrecision], If[LessEqual[x$46$im, 7.8e-183], 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 -0.62:\\
\;\;\;\;{\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 7.8 \cdot 10^{-183}:\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -0.619999999999999996Initial program 32.2%
cancel-sign-sub-inv32.2%
fma-define32.2%
hypot-define32.2%
distribute-lft-neg-in32.2%
distribute-rgt-neg-out32.2%
fma-define32.2%
hypot-define87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y.im around 0 54.7%
unpow254.7%
unpow254.7%
hypot-undefine71.2%
Simplified71.2%
Taylor expanded in y.re around 0 74.2%
Taylor expanded in x.im around -inf 74.2%
mul-1-neg74.2%
Simplified74.2%
if -0.619999999999999996 < x.im < 7.8e-183Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-define42.4%
hypot-define42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in y.im around 0 47.9%
unpow247.9%
unpow247.9%
hypot-undefine58.7%
Simplified58.7%
Taylor expanded in y.re around 0 60.7%
Taylor expanded in x.im around 0 51.1%
if 7.8e-183 < x.im Initial program 42.6%
cancel-sign-sub-inv42.6%
fma-define42.6%
hypot-define42.6%
distribute-lft-neg-in42.6%
distribute-rgt-neg-out42.6%
fma-define42.6%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.im around 0 48.8%
unpow248.8%
unpow248.8%
hypot-undefine57.7%
Simplified57.7%
Taylor expanded in y.re around 0 57.0%
Taylor expanded in x.re around 0 55.3%
Final simplification58.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -32000000.0) (pow x.im y.re) (if (<= y.re 2.3) 1.0 (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -32000000.0) {
tmp = pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3) {
tmp = 1.0;
} 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 (y_46re <= (-32000000.0d0)) then
tmp = x_46im ** y_46re
else if (y_46re <= 2.3d0) then
tmp = 1.0d0
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 (y_46_re <= -32000000.0) {
tmp = Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.3) {
tmp = 1.0;
} 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 y_46_re <= -32000000.0: tmp = math.pow(x_46_im, y_46_re) elif y_46_re <= 2.3: tmp = 1.0 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 (y_46_re <= -32000000.0) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 2.3) tmp = 1.0; 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 (y_46_re <= -32000000.0) tmp = x_46_im ^ y_46_re; elseif (y_46_re <= 2.3) tmp = 1.0; 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[y$46$re, -32000000.0], N[Power[x$46$im, y$46$re], $MachinePrecision], If[LessEqual[y$46$re, 2.3], 1.0, N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -32000000:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.3:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -3.2e7Initial program 48.6%
cancel-sign-sub-inv48.6%
fma-define48.6%
hypot-define48.6%
distribute-lft-neg-in48.6%
distribute-rgt-neg-out48.6%
fma-define48.6%
hypot-define90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y.im around 0 83.0%
unpow283.0%
unpow283.0%
hypot-undefine83.0%
Simplified83.0%
Taylor expanded in y.re around 0 85.8%
Taylor expanded in x.re around 0 69.0%
if -3.2e7 < y.re < 2.2999999999999998Initial program 34.2%
cancel-sign-sub-inv34.2%
fma-define34.2%
hypot-define34.2%
distribute-lft-neg-in34.2%
distribute-rgt-neg-out34.2%
fma-define34.2%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around 0 28.7%
unpow228.7%
unpow228.7%
hypot-undefine50.9%
Simplified50.9%
Taylor expanded in y.re around 0 49.9%
Taylor expanded in y.re around 0 48.1%
if 2.2999999999999998 < y.re Initial program 42.6%
cancel-sign-sub-inv42.6%
fma-define42.6%
hypot-define42.6%
distribute-lft-neg-in42.6%
distribute-rgt-neg-out42.6%
fma-define42.6%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 59.4%
unpow259.4%
unpow259.4%
hypot-undefine59.4%
Simplified59.4%
Taylor expanded in y.re around 0 63.1%
Taylor expanded in x.im around 0 46.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 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in y.im around 0 50.0%
unpow250.0%
unpow250.0%
hypot-undefine61.4%
Simplified61.4%
Taylor expanded in y.re around 0 62.5%
Taylor expanded in y.re around 0 26.1%
herbie shell --seed 2024137
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))