
(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 16 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 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* y.re t_3) t_0)))
(t_5 (cbrt (fma y.im (log (hypot x.im x.re)) t_1))))
(if (<= (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1))) -0.62)
(* t_4 (cos (fma t_3 y.im (pow (cbrt t_1) 3.0))))
(* t_4 (fabs (cbrt (pow (cos (* t_5 (pow t_5 2.0))) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((y_46_re * t_3) - t_0));
double t_5 = cbrt(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1));
double tmp;
if ((exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1))) <= -0.62) {
tmp = t_4 * cos(fma(t_3, y_46_im, pow(cbrt(t_1), 3.0)));
} else {
tmp = t_4 * fabs(cbrt(pow(cos((t_5 * pow(t_5, 2.0))), 3.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(y_46_re * t_3) - t_0)) t_5 = cbrt(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.62) tmp = Float64(t_4 * cos(fma(t_3, y_46_im, (cbrt(t_1) ^ 3.0)))); else tmp = Float64(t_4 * abs(cbrt((cos(Float64(t_5 * (t_5 ^ 2.0))) ^ 3.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], 1/3], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.62], N[(t$95$4 * N[Cos[N[(t$95$3 * y$46$im + N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Abs[N[Power[N[Power[N[Cos[N[(t$95$5 * N[Power[t$95$5, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{y.re \cdot t_3 - t_0}\\
t_5 := \sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_1\right)}\\
\mathbf{if}\;e^{t_2 \cdot y.re - t_0} \cdot \cos \left(t_2 \cdot y.im + t_1\right) \leq -0.62:\\
\;\;\;\;t_4 \cdot \cos \left(\mathsf{fma}\left(t_3, y.im, {\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left|\sqrt[3]{{\cos \left(t_5 \cdot {t_5}^{2}\right)}^{3}}\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.619999999999999996Initial program 51.8%
Simplified51.8%
*-commutative51.8%
add-cube-cbrt71.8%
pow371.8%
Applied egg-rr71.8%
if -0.619999999999999996 < (*.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 37.3%
Simplified81.1%
*-commutative81.1%
add-cube-cbrt81.1%
pow380.7%
Applied egg-rr80.7%
add-sqr-sqrt58.7%
sqrt-unprod84.4%
pow284.4%
rem-cube-cbrt84.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
fma-udef84.4%
*-commutative84.4%
fma-def84.4%
hypot-def37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
add-cbrt-cube84.4%
pow384.4%
Applied egg-rr84.4%
add-cube-cbrt84.5%
pow284.5%
Applied egg-rr84.5%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* y.re t_3) t_0))))
(if (<= (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1))) -0.62)
(* t_4 (cos (fma t_3 y.im (pow (cbrt t_1) 3.0))))
(*
t_4
(fabs
(cbrt
(pow
(cos (pow (cbrt (fma y.im (log (hypot x.im x.re)) t_1)) 3.0))
3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((y_46_re * t_3) - t_0));
double tmp;
if ((exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1))) <= -0.62) {
tmp = t_4 * cos(fma(t_3, y_46_im, pow(cbrt(t_1), 3.0)));
} else {
tmp = t_4 * fabs(cbrt(pow(cos(pow(cbrt(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)), 3.0)), 3.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(y_46_re * t_3) - t_0)) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.62) tmp = Float64(t_4 * cos(fma(t_3, y_46_im, (cbrt(t_1) ^ 3.0)))); else tmp = Float64(t_4 * abs(cbrt((cos((cbrt(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) ^ 3.0)) ^ 3.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.62], N[(t$95$4 * N[Cos[N[(t$95$3 * y$46$im + N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Abs[N[Power[N[Power[N[Cos[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{y.re \cdot t_3 - t_0}\\
\mathbf{if}\;e^{t_2 \cdot y.re - t_0} \cdot \cos \left(t_2 \cdot y.im + t_1\right) \leq -0.62:\\
\;\;\;\;t_4 \cdot \cos \left(\mathsf{fma}\left(t_3, y.im, {\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left|\sqrt[3]{{\cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_1\right)}\right)}^{3}\right)}^{3}}\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.619999999999999996Initial program 51.8%
Simplified51.8%
*-commutative51.8%
add-cube-cbrt71.8%
pow371.8%
Applied egg-rr71.8%
if -0.619999999999999996 < (*.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 37.3%
Simplified81.1%
*-commutative81.1%
add-cube-cbrt81.1%
pow380.7%
Applied egg-rr80.7%
add-sqr-sqrt58.7%
sqrt-unprod84.4%
pow284.4%
rem-cube-cbrt84.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
fma-udef84.4%
*-commutative84.4%
fma-def84.4%
hypot-def37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
add-cbrt-cube84.4%
pow384.4%
Applied egg-rr84.4%
add-cube-cbrt84.5%
pow384.4%
Applied egg-rr84.4%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* y.re t_3) t_0))))
(if (<= (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1))) -0.62)
(* t_4 (cos (fma t_3 y.im (pow (cbrt t_1) 3.0))))
(*
t_4
(fabs
(cbrt
(pow
(log (exp (cos (fma y.im (log (hypot x.im x.re)) t_1))))
3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((y_46_re * t_3) - t_0));
double tmp;
if ((exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1))) <= -0.62) {
tmp = t_4 * cos(fma(t_3, y_46_im, pow(cbrt(t_1), 3.0)));
} else {
tmp = t_4 * fabs(cbrt(pow(log(exp(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)))), 3.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(y_46_re * t_3) - t_0)) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.62) tmp = Float64(t_4 * cos(fma(t_3, y_46_im, (cbrt(t_1) ^ 3.0)))); else tmp = Float64(t_4 * abs(cbrt((log(exp(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)))) ^ 3.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.62], N[(t$95$4 * N[Cos[N[(t$95$3 * y$46$im + N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Abs[N[Power[N[Power[N[Log[N[Exp[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{y.re \cdot t_3 - t_0}\\
\mathbf{if}\;e^{t_2 \cdot y.re - t_0} \cdot \cos \left(t_2 \cdot y.im + t_1\right) \leq -0.62:\\
\;\;\;\;t_4 \cdot \cos \left(\mathsf{fma}\left(t_3, y.im, {\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left|\sqrt[3]{{\log \left(e^{\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_1\right)\right)}\right)}^{3}}\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.619999999999999996Initial program 51.8%
Simplified51.8%
*-commutative51.8%
add-cube-cbrt71.8%
pow371.8%
Applied egg-rr71.8%
if -0.619999999999999996 < (*.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 37.3%
Simplified81.1%
*-commutative81.1%
add-cube-cbrt81.1%
pow380.7%
Applied egg-rr80.7%
add-sqr-sqrt58.7%
sqrt-unprod84.4%
pow284.4%
rem-cube-cbrt84.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
fma-udef84.4%
*-commutative84.4%
fma-def84.4%
hypot-def37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
add-cbrt-cube84.4%
pow384.4%
Applied egg-rr84.4%
add-log-exp84.4%
Applied egg-rr84.4%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* y.re t_3) t_0))))
(if (<= (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1))) -0.62)
(* t_4 (cos (fma t_3 y.im (pow (cbrt t_1) 3.0))))
(*
t_4
(fabs (cbrt (pow (cos (fma y.im (log (hypot x.im x.re)) t_1)) 3.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((y_46_re * t_3) - t_0));
double tmp;
if ((exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1))) <= -0.62) {
tmp = t_4 * cos(fma(t_3, y_46_im, pow(cbrt(t_1), 3.0)));
} else {
tmp = t_4 * fabs(cbrt(pow(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)), 3.0)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(y_46_re * t_3) - t_0)) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.62) tmp = Float64(t_4 * cos(fma(t_3, y_46_im, (cbrt(t_1) ^ 3.0)))); else tmp = Float64(t_4 * abs(cbrt((cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)) ^ 3.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.62], N[(t$95$4 * N[Cos[N[(t$95$3 * y$46$im + N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Abs[N[Power[N[Power[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{y.re \cdot t_3 - t_0}\\
\mathbf{if}\;e^{t_2 \cdot y.re - t_0} \cdot \cos \left(t_2 \cdot y.im + t_1\right) \leq -0.62:\\
\;\;\;\;t_4 \cdot \cos \left(\mathsf{fma}\left(t_3, y.im, {\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left|\sqrt[3]{{\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_1\right)\right)}^{3}}\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.619999999999999996Initial program 51.8%
Simplified51.8%
*-commutative51.8%
add-cube-cbrt71.8%
pow371.8%
Applied egg-rr71.8%
if -0.619999999999999996 < (*.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 37.3%
Simplified81.1%
*-commutative81.1%
add-cube-cbrt81.1%
pow380.7%
Applied egg-rr80.7%
add-sqr-sqrt58.7%
sqrt-unprod84.4%
pow284.4%
rem-cube-cbrt84.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
fma-udef84.4%
*-commutative84.4%
fma-def84.4%
hypot-def37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
add-cbrt-cube84.4%
pow384.4%
Applied egg-rr84.4%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (- (* y.re t_3) t_0))))
(if (<= (* (exp (- (* t_2 y.re) t_0)) (cos (+ (* t_2 y.im) t_1))) -0.62)
(* t_4 (cos (fma t_3 y.im (pow (cbrt t_1) 3.0))))
(* t_4 (fabs (cos (fma y.im (log (hypot x.im x.re)) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(((y_46_re * t_3) - t_0));
double tmp;
if ((exp(((t_2 * y_46_re) - t_0)) * cos(((t_2 * y_46_im) + t_1))) <= -0.62) {
tmp = t_4 * cos(fma(t_3, y_46_im, pow(cbrt(t_1), 3.0)));
} else {
tmp = t_4 * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_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 = log(hypot(x_46_re, x_46_im)) t_4 = exp(Float64(Float64(y_46_re * t_3) - t_0)) tmp = 0.0 if (Float64(exp(Float64(Float64(t_2 * y_46_re) - t_0)) * cos(Float64(Float64(t_2 * y_46_im) + t_1))) <= -0.62) tmp = Float64(t_4 * cos(fma(t_3, y_46_im, (cbrt(t_1) ^ 3.0)))); else tmp = Float64(t_4 * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_1)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(N[(y$46$re * t$95$3), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Exp[N[(N[(t$95$2 * y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$2 * y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -0.62], N[(t$95$4 * N[Cos[N[(t$95$3 * y$46$im + N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$4 * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{y.re \cdot t_3 - t_0}\\
\mathbf{if}\;e^{t_2 \cdot y.re - t_0} \cdot \cos \left(t_2 \cdot y.im + t_1\right) \leq -0.62:\\
\;\;\;\;t_4 \cdot \cos \left(\mathsf{fma}\left(t_3, y.im, {\left(\sqrt[3]{t_1}\right)}^{3}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_1\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.619999999999999996Initial program 51.8%
Simplified51.8%
*-commutative51.8%
add-cube-cbrt71.8%
pow371.8%
Applied egg-rr71.8%
if -0.619999999999999996 < (*.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 37.3%
Simplified81.1%
*-commutative81.1%
add-cube-cbrt81.1%
pow380.7%
Applied egg-rr80.7%
add-sqr-sqrt58.7%
sqrt-unprod84.4%
pow284.4%
rem-cube-cbrt84.4%
Applied egg-rr84.4%
unpow284.4%
rem-sqrt-square84.4%
fma-udef84.4%
*-commutative84.4%
fma-def84.4%
hypot-def37.4%
unpow237.4%
unpow237.4%
+-commutative37.4%
unpow237.4%
unpow237.4%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (- (* y.re t_1) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 2e-71)
(* t_2 (fabs (cos (fma y.im (log (hypot x.im x.re)) t_0))))
(* t_2 (log1p (expm1 (cos (fma t_1 y.im t_0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(((y_46_re * t_1) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 2e-71) {
tmp = t_2 * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)));
} else {
tmp = t_2 * log1p(expm1(cos(fma(t_1, y_46_im, t_0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 2e-71) tmp = Float64(t_2 * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0)))); else tmp = Float64(t_2 * log1p(expm1(cos(fma(t_1, y_46_im, t_0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 2e-71], N[(t$95$2 * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Log[1 + N[(Exp[N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]] - 1), $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(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{y.re \cdot t_1 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 2 \cdot 10^{-71}:\\
\;\;\;\;t_2 \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t_0\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\mathsf{fma}\left(t_1, y.im, t_0\right)\right)\right)\right)\\
\end{array}
\end{array}
if x.re < 1.9999999999999998e-71Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
if 1.9999999999999998e-71 < x.re Initial program 28.3%
Simplified78.7%
*-commutative78.7%
add-cube-cbrt78.7%
pow378.7%
Applied egg-rr78.7%
log1p-expm1-u78.7%
rem-cube-cbrt78.7%
Applied egg-rr78.7%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 2e-75)
(*
t_0
(fabs
(cos (fma y.im (log (hypot x.im x.re)) (* y.re (atan2 x.im x.re))))))
(*
t_0
(log1p
(expm1 (cos (fma y.re (atan2 x.im x.re) (* y.im (log x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 2e-75) {
tmp = t_0 * fabs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), (y_46_re * atan2(x_46_im, x_46_re)))));
} else {
tmp = t_0 * log1p(expm1(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(x_46_re))))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 2e-75) tmp = Float64(t_0 * abs(cos(fma(y_46_im, log(hypot(x_46_im, x_46_re)), Float64(y_46_re * atan(x_46_im, x_46_re)))))); else tmp = Float64(t_0 * log1p(expm1(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(x_46_re))))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 2e-75], N[(t$95$0 * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Log[1 + N[(Exp[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 2 \cdot 10^{-75}:\\
\;\;\;\;t_0 \cdot \left|\cos \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log x.re\right)\right)\right)\right)\\
\end{array}
\end{array}
if x.re < 1.9999999999999999e-75Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
if 1.9999999999999999e-75 < x.re Initial program 28.3%
Simplified78.7%
Taylor expanded in x.im around 0 78.7%
log1p-expm1-u78.7%
+-commutative78.7%
fma-def78.7%
*-commutative78.7%
Applied egg-rr78.7%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 2e-75)
(* t_0 (fabs (cbrt (pow (cos (* y.im (log (hypot x.im x.re)))) 3.0))))
(*
t_0
(log1p
(expm1 (cos (fma y.re (atan2 x.im x.re) (* y.im (log x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 2e-75) {
tmp = t_0 * fabs(cbrt(pow(cos((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0)));
} else {
tmp = t_0 * log1p(expm1(cos(fma(y_46_re, atan2(x_46_im, x_46_re), (y_46_im * log(x_46_re))))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 2e-75) tmp = Float64(t_0 * abs(cbrt((cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0)))); else tmp = Float64(t_0 * log1p(expm1(cos(fma(y_46_re, atan(x_46_im, x_46_re), Float64(y_46_im * log(x_46_re))))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 2e-75], N[(t$95$0 * N[Abs[N[Power[N[Power[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Log[1 + N[(Exp[N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 2 \cdot 10^{-75}:\\
\;\;\;\;t_0 \cdot \left|\sqrt[3]{{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{3}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, y.im \cdot \log x.re\right)\right)\right)\right)\\
\end{array}
\end{array}
if x.re < 1.9999999999999999e-75Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
add-cbrt-cube84.9%
pow384.9%
Applied egg-rr84.9%
Taylor expanded in y.im around inf 41.5%
unpow241.5%
unpow241.5%
hypot-def84.5%
Simplified84.5%
if 1.9999999999999999e-75 < x.re Initial program 28.3%
Simplified78.7%
Taylor expanded in x.im around 0 78.7%
log1p-expm1-u78.7%
+-commutative78.7%
fma-def78.7%
*-commutative78.7%
Applied egg-rr78.7%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 1.25e-72)
(* t_1 (fabs (cbrt (pow (cos (* y.im (log (hypot x.im x.re)))) 3.0))))
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1.25e-72) {
tmp = t_1 * fabs(cbrt(pow(cos((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0)));
} else {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 1.25e-72) tmp = Float64(t_1 * abs(cbrt((cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0)))); else tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.25e-72], N[(t$95$1 * N[Abs[N[Power[N[Power[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 1.25 \cdot 10^{-72}:\\
\;\;\;\;t_1 \cdot \left|\sqrt[3]{{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}^{3}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if x.re < 1.2499999999999999e-72Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
add-cbrt-cube84.9%
pow384.9%
Applied egg-rr84.9%
Taylor expanded in y.im around inf 41.5%
unpow241.5%
unpow241.5%
hypot-def84.5%
Simplified84.5%
if 1.2499999999999999e-72 < x.re Initial program 28.3%
Simplified78.7%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 1e-72)
(* t_1 (fabs (cos (* y.im (log (hypot x.im x.re))))))
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1e-72) {
tmp = t_1 * fabs(cos((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 1e-72) tmp = Float64(t_1 * abs(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1e-72], N[(t$95$1 * 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[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{y.re \cdot t_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 10^{-72}:\\
\;\;\;\;t_1 \cdot \left|\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if x.re < 9.9999999999999997e-73Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def84.5%
*-rgt-identity84.5%
*-rgt-identity84.5%
Simplified84.5%
if 9.9999999999999997e-73 < x.re Initial program 28.3%
Simplified78.7%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(- (* y.re (log (hypot x.re x.im))) (* (atan2 x.im x.re) y.im)))))
(if (<= x.re 1.05e-71)
(* t_0 (fabs (cos (* y.im (log (hypot x.im x.re))))))
(* t_0 (cos (+ (* y.re (atan2 x.im x.re)) (* y.im (log x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1.05e-71) {
tmp = t_0 * fabs(cos((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else {
tmp = t_0 * cos(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(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.exp(((y_46_re * Math.log(Math.hypot(x_46_re, x_46_im))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (x_46_re <= 1.05e-71) {
tmp = t_0 * Math.abs(Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))));
} else {
tmp = t_0 * Math.cos(((y_46_re * Math.atan2(x_46_im, x_46_re)) + (y_46_im * Math.log(x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((y_46_re * math.log(math.hypot(x_46_re, x_46_im))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) tmp = 0 if x_46_re <= 1.05e-71: tmp = t_0 * math.fabs(math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re))))) else: tmp = t_0 * math.cos(((y_46_re * math.atan2(x_46_im, x_46_re)) + (y_46_im * math.log(x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(y_46_re * log(hypot(x_46_re, x_46_im))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (x_46_re <= 1.05e-71) tmp = Float64(t_0 * abs(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(t_0 * cos(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) + Float64(y_46_im * log(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 = exp(((y_46_re * log(hypot(x_46_re, x_46_im))) - (atan2(x_46_im, x_46_re) * y_46_im))); tmp = 0.0; if (x_46_re <= 1.05e-71) tmp = t_0 * abs(cos((y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = t_0 * cos(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(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[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.05e-71], N[(t$95$0 * 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[(t$95$0 * N[Cos[N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;x.re \leq 1.05 \cdot 10^{-71}:\\
\;\;\;\;t_0 \cdot \left|\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 1.0500000000000001e-71Initial program 42.4%
Simplified78.9%
*-commutative78.9%
add-cube-cbrt81.1%
pow380.5%
Applied egg-rr80.5%
add-sqr-sqrt56.1%
sqrt-unprod84.9%
pow284.9%
rem-cube-cbrt84.8%
Applied egg-rr84.8%
unpow284.8%
rem-sqrt-square84.8%
fma-udef84.8%
*-commutative84.8%
fma-def84.8%
hypot-def41.8%
unpow241.8%
unpow241.8%
+-commutative41.8%
unpow241.8%
unpow241.8%
hypot-def84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y.re around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def84.5%
*-rgt-identity84.5%
*-rgt-identity84.5%
Simplified84.5%
if 1.0500000000000001e-71 < x.re Initial program 28.3%
Simplified78.7%
Taylor expanded in x.im around 0 78.7%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -2.2e-8)
(exp (- (* y.re (log (- x.im))) t_0))
(if (<= x.im 4.2e-114)
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))
(exp (- (* y.re (log x.im)) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -2.2e-8) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 4.2e-114) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -2.2e-8) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 4.2e-114) {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -2.2e-8: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 4.2e-114: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_46_re)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -2.2e-8) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); elseif (x_46_im <= 4.2e-114) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -2.2e-8) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 4.2e-114) tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -2.2e-8], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, 4.2e-114], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -2.2 \cdot 10^{-8}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 4.2 \cdot 10^{-114}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -2.1999999999999998e-8Initial program 33.8%
Taylor expanded in y.im around 0 54.5%
Taylor expanded in y.re around 0 59.1%
Taylor expanded in x.im around -inf 81.3%
mul-1-neg81.3%
Simplified81.3%
if -2.1999999999999998e-8 < x.im < 4.19999999999999985e-114Initial program 43.4%
Taylor expanded in y.im around 0 59.9%
Taylor expanded in y.re around 0 60.9%
hypot-udef79.7%
*-commutative79.7%
log-pow78.7%
Applied egg-rr78.7%
if 4.19999999999999985e-114 < x.im Initial program 36.2%
Taylor expanded in y.im around 0 60.9%
Taylor expanded in y.re around 0 65.6%
Taylor expanded in x.re around 0 83.0%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (exp (- (* y.re (log (- x.im))) t_0))))
(if (<= x.im -1.6e-8)
t_1
(if (<= x.im -2.15e-173)
(exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) t_0))
(if (<= x.im -5e-310) t_1 (exp (- (* y.re (log x.im)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((y_46_re * log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.6e-8) {
tmp = t_1;
} else if (x_46_im <= -2.15e-173) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0));
} else if (x_46_im <= -5e-310) {
tmp = t_1;
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = exp(((y_46re * log(-x_46im)) - t_0))
if (x_46im <= (-1.6d-8)) then
tmp = t_1
else if (x_46im <= (-2.15d-173)) then
tmp = exp(((log(sqrt(((x_46re * x_46re) + (x_46im * x_46im)))) * y_46re) - t_0))
else if (x_46im <= (-5d-310)) then
tmp = t_1
else
tmp = exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.6e-8) {
tmp = t_1;
} else if (x_46_im <= -2.15e-173) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0));
} else if (x_46_im <= -5e-310) {
tmp = t_1;
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) tmp = 0 if x_46_im <= -1.6e-8: tmp = t_1 elif x_46_im <= -2.15e-173: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)) elif x_46_im <= -5e-310: tmp = t_1 else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)) tmp = 0.0 if (x_46_im <= -1.6e-8) tmp = t_1; elseif (x_46_im <= -2.15e-173) tmp = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - t_0)); elseif (x_46_im <= -5e-310) tmp = t_1; else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = exp(((y_46_re * log(-x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -1.6e-8) tmp = t_1; elseif (x_46_im <= -2.15e-173) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - t_0)); elseif (x_46_im <= -5e-310) tmp = t_1; else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.6e-8], t$95$1, If[LessEqual[x$46$im, -2.15e-173], 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] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$im, -5e-310], t$95$1, N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{if}\;x.im \leq -1.6 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.im \leq -2.15 \cdot 10^{-173}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - t_0}\\
\mathbf{elif}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -1.6000000000000001e-8 or -2.1500000000000002e-173 < x.im < -4.999999999999985e-310Initial program 36.0%
Taylor expanded in y.im around 0 58.0%
Taylor expanded in y.re around 0 62.4%
Taylor expanded in x.im around -inf 81.9%
mul-1-neg81.9%
Simplified81.9%
if -1.6000000000000001e-8 < x.im < -2.1500000000000002e-173Initial program 63.3%
Taylor expanded in y.im around 0 67.0%
Taylor expanded in y.re around 0 70.3%
if -4.999999999999985e-310 < x.im Initial program 34.6%
Taylor expanded in y.im around 0 57.7%
Taylor expanded in y.re around 0 60.1%
Taylor expanded in x.re around 0 73.6%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im -5e-310)
(exp (- (* y.re (log (- x.im))) t_0))
(exp (- (* y.re (log x.im)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_im)) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_im)) - t_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) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46im <= (-5d-310)) then
tmp = exp(((y_46re * log(-x_46im)) - t_0))
else
tmp = exp(((y_46re * log(x_46im)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_im <= -5e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_im <= -5e-310: tmp = math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_im <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_im <= -5e-310) tmp = exp(((y_46_re * log(-x_46_im)) - t_0)); else tmp = exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$im, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.im \leq -5 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -4.999999999999985e-310Initial program 42.9%
Taylor expanded in y.im around 0 60.2%
Taylor expanded in y.re around 0 64.4%
Taylor expanded in x.im around -inf 75.1%
mul-1-neg75.1%
Simplified75.1%
if -4.999999999999985e-310 < x.im Initial program 34.6%
Taylor expanded in y.im around 0 57.7%
Taylor expanded in y.re around 0 60.1%
Taylor expanded in x.re around 0 73.6%
Final simplification74.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -5.4e-285)
(exp (- (* y.re (log x.im)) t_0))
(exp (- (* y.re (log x.re)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -5.4e-285) {
tmp = exp(((y_46_re * log(x_46_im)) - t_0));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_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) :: t_0
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
if (x_46re <= (-5.4d-285)) then
tmp = exp(((y_46re * log(x_46im)) - t_0))
else
tmp = exp(((y_46re * log(x_46re)) - t_0))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -5.4e-285) {
tmp = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im tmp = 0 if x_46_re <= -5.4e-285: tmp = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -5.4e-285) tmp = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)); else tmp = exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; tmp = 0.0; if (x_46_re <= -5.4e-285) tmp = exp(((y_46_re * log(x_46_im)) - t_0)); else tmp = exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -5.4e-285], N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -5.4 \cdot 10^{-285}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -5.3999999999999997e-285Initial program 41.8%
Taylor expanded in y.im around 0 61.0%
Taylor expanded in y.re around 0 62.7%
Taylor expanded in x.re around 0 40.2%
if -5.3999999999999997e-285 < x.re Initial program 34.7%
Taylor expanded in y.im around 0 56.5%
Taylor expanded in y.re around 0 61.4%
Taylor expanded in x.re around inf 67.0%
Final simplification53.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = exp(((y_46re * log(x_46im)) - (atan2(x_46im, x_46re) * y_46im)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.exp(((y_46_re * Math.log(x_46_im)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp(((y_46_re * math.log(x_46_im)) - (math.atan2(x_46_im, x_46_re) * y_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(atan(x_46_im, x_46_re) * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}
\end{array}
Initial program 38.4%
Taylor expanded in y.im around 0 58.9%
Taylor expanded in y.re around 0 62.1%
Taylor expanded in x.re around 0 39.4%
Final simplification39.4%
herbie shell --seed 2023196
(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)))))