
(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 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re -2e-187)
(* t_2 (cos (fma t_1 y.im t_0)))
(if (<= y.re 1e+263)
(* t_2 (cos (pow (* (cbrt t_1) (cbrt y.im)) 3.0)))
(* t_2 (cos (pow (pow (cbrt (cbrt (fma y.im t_1 t_0))) 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 = 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(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= -2e-187) {
tmp = t_2 * cos(fma(t_1, y_46_im, t_0));
} else if (y_46_re <= 1e+263) {
tmp = t_2 * cos(pow((cbrt(t_1) * cbrt(y_46_im)), 3.0));
} else {
tmp = t_2 * cos(pow(pow(cbrt(cbrt(fma(y_46_im, t_1, t_0))), 3.0), 3.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(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= -2e-187) tmp = Float64(t_2 * cos(fma(t_1, y_46_im, t_0))); elseif (y_46_re <= 1e+263) tmp = Float64(t_2 * cos((Float64(cbrt(t_1) * cbrt(y_46_im)) ^ 3.0))); else tmp = Float64(t_2 * cos(((cbrt(cbrt(fma(y_46_im, t_1, t_0))) ^ 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[(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[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2e-187], N[(t$95$2 * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1e+263], N[(t$95$2 * N[Cos[N[Power[N[(N[Power[t$95$1, 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[Power[N[Power[N[Power[N[Power[N[(y$46$im * t$95$1 + t$95$0), $MachinePrecision], 1/3], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{-187}:\\
\;\;\;\;t\_2 \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\mathbf{elif}\;y.re \leq 10^{+263}:\\
\;\;\;\;t\_2 \cdot \cos \left({\left(\sqrt[3]{t\_1} \cdot \sqrt[3]{y.im}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \cos \left({\left({\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(y.im, t\_1, t\_0\right)}}\right)}^{3}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -2e-187Initial program 44.2%
fmm-def44.2%
hypot-define44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
if -2e-187 < y.re < 1.00000000000000002e263Initial program 31.7%
fmm-def31.7%
hypot-define31.7%
distribute-rgt-neg-out31.7%
fma-define31.7%
hypot-define76.1%
*-commutative76.1%
Simplified76.1%
add-cube-cbrt77.8%
pow378.6%
fma-undefine78.6%
*-commutative78.6%
*-commutative78.6%
fma-define78.6%
Applied egg-rr78.6%
Taylor expanded in y.im around inf 33.1%
+-commutative33.1%
unpow233.1%
unpow233.1%
hypot-undefine85.3%
Simplified85.3%
*-commutative85.3%
cbrt-prod85.8%
Applied egg-rr85.8%
if 1.00000000000000002e263 < y.re Initial program 20.0%
fmm-def20.0%
hypot-define20.0%
distribute-rgt-neg-out20.0%
fma-define20.0%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
add-cube-cbrt80.0%
pow380.0%
fma-undefine80.0%
*-commutative80.0%
*-commutative80.0%
fma-define80.0%
Applied egg-rr80.0%
add-cube-cbrt90.0%
pow390.0%
Applied egg-rr90.0%
Final simplification87.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_1
(*
(exp (- (* y.re t_0) (* (atan2 x.im x.re) y.im)))
(cos (+ (* y.re (atan2 x.im x.re)) (* y.im t_0)))))
(t_2 (log (hypot x.re x.im))))
(if (<= t_1 INFINITY)
t_1
(*
(exp (fma t_2 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (pow (cbrt (* t_2 y.im)) 3.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * t_0)));
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = exp(fma(t_2, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(pow(cbrt((t_2 * y_46_im)), 3.0));
}
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 = Float64(exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) + Float64(y_46_im * t_0)))) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(exp(fma(t_2, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos((cbrt(Float64(t_2 * y_46_im)) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[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[(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] * 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]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[Exp[N[(t$95$2 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[Power[N[Power[N[(t$95$2 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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^{y.re \cdot t\_0 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot t\_0\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_2, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left({\left(\sqrt[3]{t\_2 \cdot y.im}\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)))) < +inf.0Initial program 83.6%
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%
fmm-def0.0%
hypot-define0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define78.9%
*-commutative78.9%
Simplified78.9%
add-cube-cbrt81.3%
pow381.5%
fma-undefine81.5%
*-commutative81.5%
*-commutative81.5%
fma-define81.5%
Applied egg-rr81.5%
Taylor expanded in y.im around inf 0.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-undefine84.7%
Simplified84.7%
Final simplification84.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2
(*
(exp (- (* y.re t_1) t_0))
(cos (+ (* y.re (atan2 x.im x.re)) (* y.im t_1))))))
(if (<= t_2 INFINITY)
t_2
(exp (- (log (pow (hypot x.re x.im) y.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 t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((y_46_re * t_1) - t_0)) * cos(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * t_1)));
double tmp;
if (t_2 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - 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 t_1 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = Math.exp(((y_46_re * t_1) - t_0)) * Math.cos(((y_46_re * Math.atan2(x_46_im, x_46_re)) + (y_46_im * t_1)));
double tmp;
if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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 t_1 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_2 = math.exp(((y_46_re * t_1) - t_0)) * math.cos(((y_46_re * math.atan2(x_46_im, x_46_re)) + (y_46_im * t_1))) tmp = 0 if t_2 <= math.inf: tmp = t_2 else: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = Float64(exp(Float64(Float64(y_46_re * t_1) - t_0)) * cos(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) + Float64(y_46_im * t_1)))) tmp = 0.0 if (t_2 <= Inf) tmp = t_2; else tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_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; t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_2 = exp(((y_46_re * t_1) - t_0)) * cos(((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * t_1))); tmp = 0.0; if (t_2 <= Inf) tmp = t_2; else tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_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]}, 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[(N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] + N[(y$46$im * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, Infinity], t$95$2, 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]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{y.re \cdot t\_1 - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot t\_1\right)\\
\mathbf{if}\;t\_2 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\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 83.6%
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%
Taylor expanded in y.im around 0 40.5%
Taylor expanded in y.re around 0 42.5%
add-log-exp42.5%
hypot-define79.2%
pow-to-exp79.2%
Applied egg-rr79.2%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (cbrt (* t_0 y.im)))
(t_2 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= x.im -4.5e-148)
(* t_2 (cos (pow t_1 3.0)))
(if (<= x.im 1.36e+78)
(* t_2 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
t_2
(cos
(pow (* (pow (pow t_1 2.0) 0.3333333333333333) (cbrt 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 = log(hypot(x_46_re, x_46_im));
double t_1 = cbrt((t_0 * y_46_im));
double t_2 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (x_46_im <= -4.5e-148) {
tmp = t_2 * cos(pow(t_1, 3.0));
} else if (x_46_im <= 1.36e+78) {
tmp = t_2 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_2 * cos(pow((pow(pow(t_1, 2.0), 0.3333333333333333) * cbrt(t_1)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = cbrt(Float64(t_0 * y_46_im)) t_2 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (x_46_im <= -4.5e-148) tmp = Float64(t_2 * cos((t_1 ^ 3.0))); elseif (x_46_im <= 1.36e+78) tmp = Float64(t_2 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_2 * cos((Float64(((t_1 ^ 2.0) ^ 0.3333333333333333) * cbrt(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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(t$95$0 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[x$46$im, -4.5e-148], N[(t$95$2 * N[Cos[N[Power[t$95$1, 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.36e+78], N[(t$95$2 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Cos[N[Power[N[(N[Power[N[Power[t$95$1, 2.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[t$95$1, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sqrt[3]{t\_0 \cdot y.im}\\
t_2 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;x.im \leq -4.5 \cdot 10^{-148}:\\
\;\;\;\;t\_2 \cdot \cos \left({t\_1}^{3}\right)\\
\mathbf{elif}\;x.im \leq 1.36 \cdot 10^{+78}:\\
\;\;\;\;t\_2 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \cos \left({\left({\left({t\_1}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{t\_1}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.im < -4.50000000000000015e-148Initial program 30.5%
fmm-def30.5%
hypot-define30.5%
distribute-rgt-neg-out30.5%
fma-define30.5%
hypot-define73.9%
*-commutative73.9%
Simplified73.9%
add-cube-cbrt78.3%
pow376.2%
fma-undefine76.2%
*-commutative76.2%
*-commutative76.2%
fma-define76.2%
Applied egg-rr76.2%
Taylor expanded in y.im around inf 29.3%
+-commutative29.3%
unpow229.3%
unpow229.3%
hypot-undefine80.8%
Simplified80.8%
if -4.50000000000000015e-148 < x.im < 1.35999999999999999e78Initial program 46.7%
fmm-def46.7%
hypot-define46.7%
distribute-rgt-neg-out46.7%
fma-define46.7%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
if 1.35999999999999999e78 < x.im Initial program 20.0%
fmm-def20.0%
hypot-define20.0%
distribute-rgt-neg-out20.0%
fma-define20.0%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
add-cube-cbrt78.3%
pow376.6%
fma-undefine76.6%
*-commutative76.6%
*-commutative76.6%
fma-define76.6%
Applied egg-rr76.6%
Taylor expanded in y.im around inf 21.7%
+-commutative21.7%
unpow221.7%
unpow221.7%
hypot-undefine81.6%
Simplified81.6%
pow1/353.3%
add-cube-cbrt53.3%
unpow-prod-down53.3%
pow253.3%
pow1/388.3%
Applied egg-rr88.3%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re -5e-186)
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(* t_1 (cos (pow (* (cbrt t_0) (cbrt y.im)) 3.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= -5e-186) {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * cos(pow((cbrt(t_0) * cbrt(y_46_im)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= -5e-186) tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * cos((Float64(cbrt(t_0) * cbrt(y_46_im)) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-186], N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[Power[N[(N[Power[t$95$0, 1/3], $MachinePrecision] * N[Power[y$46$im, 1/3], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-186}:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left({\left(\sqrt[3]{t\_0} \cdot \sqrt[3]{y.im}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -5e-186Initial program 44.2%
fmm-def44.2%
hypot-define44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
if -5e-186 < y.re Initial program 31.0%
fmm-def31.0%
hypot-define31.0%
distribute-rgt-neg-out31.0%
fma-define31.0%
hypot-define75.8%
*-commutative75.8%
Simplified75.8%
add-cube-cbrt78.0%
pow378.7%
fma-undefine78.7%
*-commutative78.7%
*-commutative78.7%
fma-define78.7%
Applied egg-rr78.7%
Taylor expanded in y.im around inf 31.8%
+-commutative31.8%
unpow231.8%
unpow231.8%
hypot-undefine82.7%
Simplified82.7%
*-commutative82.7%
cbrt-prod83.2%
Applied egg-rr83.2%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re -5e-186)
(* t_1 (cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(* t_1 (cos (pow (cbrt (* t_0 y.im)) 3.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= -5e-186) {
tmp = t_1 * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = t_1 * cos(pow(cbrt((t_0 * y_46_im)), 3.0));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= -5e-186) tmp = Float64(t_1 * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(t_1 * cos((cbrt(Float64(t_0 * y_46_im)) ^ 3.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -5e-186], N[(t$95$1 * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Cos[N[Power[N[Power[N[(t$95$0 * y$46$im), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-186}:\\
\;\;\;\;t\_1 \cdot \cos \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \cos \left({\left(\sqrt[3]{t\_0 \cdot y.im}\right)}^{3}\right)\\
\end{array}
\end{array}
if y.re < -5e-186Initial program 44.2%
fmm-def44.2%
hypot-define44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
if -5e-186 < y.re Initial program 31.0%
fmm-def31.0%
hypot-define31.0%
distribute-rgt-neg-out31.0%
fma-define31.0%
hypot-define75.8%
*-commutative75.8%
Simplified75.8%
add-cube-cbrt78.0%
pow378.7%
fma-undefine78.7%
*-commutative78.7%
*-commutative78.7%
fma-define78.7%
Applied egg-rr78.7%
Taylor expanded in y.im around inf 31.8%
+-commutative31.8%
unpow231.8%
unpow231.8%
hypot-undefine82.7%
Simplified82.7%
Final simplification85.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))))
(if (or (<= y.im -1.6e+147) (not (<= y.im 0.0048)))
(* t_1 (cos (* y.im (+ t_0 (* y.re (/ (atan2 x.im x.re) y.im))))))
(* t_1 (+ 1.0 (* -0.5 (pow (* y.im t_0) 2.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 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if ((y_46_im <= -1.6e+147) || !(y_46_im <= 0.0048)) {
tmp = t_1 * cos((y_46_im * (t_0 + (y_46_re * (atan2(x_46_im, x_46_re) / y_46_im)))));
} else {
tmp = t_1 * (1.0 + (-0.5 * pow((y_46_im * t_0), 2.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 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if ((y_46_im <= -1.6e+147) || !(y_46_im <= 0.0048)) tmp = Float64(t_1 * cos(Float64(y_46_im * Float64(t_0 + Float64(y_46_re * Float64(atan(x_46_im, x_46_re) / y_46_im)))))); else tmp = Float64(t_1 * Float64(1.0 + Float64(-0.5 * (Float64(y_46_im * t_0) ^ 2.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[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.6e+147], N[Not[LessEqual[y$46$im, 0.0048]], $MachinePrecision]], N[(t$95$1 * N[Cos[N[(y$46$im * N[(t$95$0 + N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(1.0 + N[(-0.5 * N[Power[N[(y$46$im * t$95$0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+147} \lor \neg \left(y.im \leq 0.0048\right):\\
\;\;\;\;t\_1 \cdot \cos \left(y.im \cdot \left(t\_0 + y.re \cdot \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(1 + -0.5 \cdot {\left(y.im \cdot t\_0\right)}^{2}\right)\\
\end{array}
\end{array}
if y.im < -1.59999999999999989e147 or 0.00479999999999999958 < y.im Initial program 39.8%
fmm-def39.8%
hypot-define39.8%
distribute-rgt-neg-out39.8%
fma-define39.8%
hypot-define75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in y.im around inf 39.8%
unpow239.8%
unpow239.8%
hypot-undefine75.1%
associate-/l*76.1%
Simplified76.1%
if -1.59999999999999989e147 < y.im < 0.00479999999999999958Initial program 32.3%
fmm-def32.3%
hypot-define32.3%
distribute-rgt-neg-out32.3%
fma-define32.3%
hypot-define84.6%
*-commutative84.6%
Simplified84.6%
add-cube-cbrt84.0%
pow382.8%
fma-undefine82.8%
*-commutative82.8%
*-commutative82.8%
fma-define82.8%
Applied egg-rr82.8%
Taylor expanded in y.im around inf 33.3%
+-commutative33.3%
unpow233.3%
unpow233.3%
hypot-undefine88.0%
Simplified88.0%
Taylor expanded in y.im around 0 36.2%
unpow236.2%
+-commutative36.2%
unpow236.2%
unpow236.2%
hypot-undefine88.1%
unpow288.1%
swap-sqr88.1%
unpow288.1%
Simplified88.1%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= x.im -1e-308)
(* t_0 (cos (- (* y.re (atan2 x.im x.re)) (* y.im (log (/ -1.0 x.im))))))
(* t_0 (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 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (x_46_im <= -1e-308) {
tmp = t_0 * cos(((y_46_re * atan2(x_46_im, x_46_re)) - (y_46_im * log((-1.0 / x_46_im)))));
} else {
tmp = t_0 * 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 = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (x_46_im <= -1e-308) tmp = Float64(t_0 * cos(Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) - Float64(y_46_im * log(Float64(-1.0 / x_46_im)))))); else tmp = Float64(t_0 * 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[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1e-308], 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[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;x.im \leq -1 \cdot 10^{-308}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} - y.im \cdot \log \left(\frac{-1}{x.im}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -9.9999999999999991e-309Initial program 32.7%
fmm-def32.7%
hypot-define32.7%
distribute-rgt-neg-out32.7%
fma-define32.7%
hypot-define76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x.im around -inf 77.2%
+-commutative77.2%
mul-1-neg77.2%
unsub-neg77.2%
Simplified77.2%
if -9.9999999999999991e-309 < x.im Initial program 37.4%
fmm-def37.4%
hypot-define37.4%
distribute-rgt-neg-out37.4%
fma-define37.4%
hypot-define84.2%
*-commutative84.2%
Simplified84.2%
add-cube-cbrt80.0%
pow380.0%
fma-undefine80.0%
*-commutative80.0%
*-commutative80.0%
fma-define80.0%
Applied egg-rr80.0%
Taylor expanded in y.im around inf 36.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine86.4%
Simplified86.4%
Taylor expanded in x.re around 0 83.8%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im 2e-123)
(*
(exp
(-
(* 2.0 (log (sqrt (pow (hypot x.im x.re) y.re))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (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 (x_46_im <= 2e-123) {
tmp = exp(((2.0 * log(sqrt(pow(hypot(x_46_im, x_46_re), y_46_re)))) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_im * log(x_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= 2e-123) tmp = Float64(exp(Float64(Float64(2.0 * log(sqrt((hypot(x_46_im, x_46_re) ^ 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)))); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(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_] := If[LessEqual[x$46$im, 2e-123], N[(N[Exp[N[(N[(2.0 * N[Log[N[Sqrt[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 2 \cdot 10^{-123}:\\
\;\;\;\;e^{2 \cdot \log \left(\sqrt{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < 2.0000000000000001e-123Initial program 34.5%
Taylor expanded in y.im around 0 59.2%
add-log-exp59.2%
hypot-define77.8%
pow-to-exp77.8%
add-sqr-sqrt77.8%
log-prod77.8%
Applied egg-rr77.8%
count-277.8%
hypot-undefine59.2%
unpow259.2%
unpow259.2%
+-commutative59.2%
unpow259.2%
unpow259.2%
hypot-undefine77.8%
Simplified77.8%
if 2.0000000000000001e-123 < x.im Initial program 36.5%
fmm-def36.5%
hypot-define36.5%
distribute-rgt-neg-out36.5%
fma-define36.5%
hypot-define80.2%
*-commutative80.2%
Simplified80.2%
add-cube-cbrt81.2%
pow381.2%
fma-undefine81.2%
*-commutative81.2%
*-commutative81.2%
fma-define81.2%
Applied egg-rr81.2%
Taylor expanded in y.im around inf 39.6%
+-commutative39.6%
unpow239.6%
unpow239.6%
hypot-undefine87.5%
Simplified87.5%
Taylor expanded in x.re around 0 84.9%
Final simplification80.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -9e-12)
(exp (- (* y.re (log (- x.re))) t_0))
(if (<= x.re 5e-282)
(exp (- (log (pow (hypot x.re x.im) y.re)) t_0))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double tmp;
if (x_46_re <= -9e-12) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 5e-282) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - t_0));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((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 = Float64(atan(x_46_im, x_46_re) * y_46_im) tmp = 0.0 if (x_46_re <= -9e-12) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0)); elseif (x_46_re <= 5e-282) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - t_0)); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, If[LessEqual[x$46$re, -9e-12], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[x$46$re, 5e-282], 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[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $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 -9 \cdot 10^{-12}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{elif}\;x.re \leq 5 \cdot 10^{-282}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -8.99999999999999962e-12Initial program 34.2%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 53.5%
Taylor expanded in x.re around -inf 88.7%
mul-1-neg88.7%
Simplified88.7%
if -8.99999999999999962e-12 < x.re < 5.0000000000000001e-282Initial program 44.1%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 60.5%
add-log-exp58.8%
hypot-define78.6%
pow-to-exp78.6%
Applied egg-rr78.6%
if 5.0000000000000001e-282 < x.re Initial program 31.7%
fmm-def31.7%
hypot-define31.7%
distribute-rgt-neg-out31.7%
fma-define31.7%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
add-cube-cbrt79.7%
pow379.0%
fma-undefine79.0%
*-commutative79.0%
*-commutative79.0%
fma-define79.0%
Applied egg-rr79.0%
Taylor expanded in y.im around inf 28.5%
+-commutative28.5%
unpow228.5%
unpow228.5%
hypot-undefine77.2%
Simplified77.2%
Taylor expanded in x.re around inf 80.5%
mul-1-neg80.5%
distribute-rgt-neg-in80.5%
log-rec80.5%
remove-double-neg80.5%
Simplified80.5%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.im 1.2e-304)
(exp (- (log (pow (hypot x.re x.im) y.re)) (* (atan2 x.im x.re) y.im)))
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (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 (x_46_im <= 1.2e-304) {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((y_46_im * log(x_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= 1.2e-304) tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_46_re)) - Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(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_] := If[LessEqual[x$46$im, 1.2e-304], N[Exp[N[(N[Log[N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq 1.2 \cdot 10^{-304}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < 1.2e-304Initial program 33.3%
Taylor expanded in y.im around 0 56.3%
Taylor expanded in y.re around 0 57.4%
add-log-exp56.6%
hypot-define75.8%
pow-to-exp75.8%
Applied egg-rr75.8%
if 1.2e-304 < x.im Initial program 37.0%
fmm-def37.0%
hypot-define37.0%
distribute-rgt-neg-out37.0%
fma-define37.0%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
add-cube-cbrt80.6%
pow380.6%
fma-undefine80.6%
*-commutative80.6%
*-commutative80.6%
fma-define80.6%
Applied egg-rr80.6%
Taylor expanded in y.im around inf 37.0%
+-commutative37.0%
unpow237.0%
unpow237.0%
hypot-undefine87.1%
Simplified87.1%
Taylor expanded in x.re around 0 84.4%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -8.5e-12)
(exp (- (* y.re (log (- x.re))) t_0))
(exp (- (log (pow (hypot x.re x.im) y.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 <= -8.5e-12) {
tmp = exp(((y_46_re * log(-x_46_re)) - t_0));
} else {
tmp = exp((log(pow(hypot(x_46_re, x_46_im), y_46_re)) - 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_re <= -8.5e-12) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else {
tmp = Math.exp((Math.log(Math.pow(Math.hypot(x_46_re, x_46_im), y_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 <= -8.5e-12: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) else: tmp = math.exp((math.log(math.pow(math.hypot(x_46_re, x_46_im), y_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 <= -8.5e-12) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0)); else tmp = exp(Float64(log((hypot(x_46_re, x_46_im) ^ y_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 <= -8.5e-12) tmp = exp(((y_46_re * log(-x_46_re)) - t_0)); else tmp = exp((log((hypot(x_46_re, x_46_im) ^ y_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, -8.5e-12], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
\mathbf{if}\;x.re \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - t\_0}\\
\end{array}
\end{array}
if x.re < -8.4999999999999997e-12Initial program 34.2%
Taylor expanded in y.im around 0 50.3%
Taylor expanded in y.re around 0 53.5%
Taylor expanded in x.re around -inf 88.7%
mul-1-neg88.7%
Simplified88.7%
if -8.4999999999999997e-12 < x.re Initial program 35.7%
Taylor expanded in y.im around 0 58.4%
Taylor expanded in y.re around 0 58.4%
add-log-exp57.8%
hypot-define75.6%
pow-to-exp75.6%
Applied egg-rr75.6%
Final simplification79.3%
(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 32.7%
Taylor expanded in y.im around 0 55.9%
Taylor expanded in y.re around 0 57.0%
Taylor expanded in x.im around -inf 66.1%
mul-1-neg66.1%
Simplified66.1%
if -4.999999999999985e-310 < x.im Initial program 37.4%
Taylor expanded in y.im around 0 56.2%
Taylor expanded in y.re around 0 56.9%
Taylor expanded in x.re around 0 75.5%
Final simplification71.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.re -5e-310)
(exp (- (* y.re (log (- x.re))) 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 <= -5e-310) {
tmp = exp(((y_46_re * log(-x_46_re)) - 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 <= (-5d-310)) then
tmp = exp(((y_46re * log(-x_46re)) - 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 <= -5e-310) {
tmp = Math.exp(((y_46_re * Math.log(-x_46_re)) - 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 <= -5e-310: tmp = math.exp(((y_46_re * math.log(-x_46_re)) - 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 <= -5e-310) tmp = exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - 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 <= -5e-310) tmp = exp(((y_46_re * log(-x_46_re)) - 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, -5e-310], N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $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 \cdot 10^{-310}:\\
\;\;\;\;e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -4.999999999999985e-310Initial program 39.2%
Taylor expanded in y.im around 0 54.9%
Taylor expanded in y.re around 0 57.5%
Taylor expanded in x.re around -inf 77.5%
mul-1-neg77.5%
Simplified77.5%
if -4.999999999999985e-310 < x.re Initial program 31.2%
Taylor expanded in y.im around 0 57.3%
Taylor expanded in y.re around 0 56.5%
Taylor expanded in x.re around inf 70.0%
Final simplification73.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im)))
(if (<= x.im 7.5e-293)
(exp (- (* y.re (log x.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 <= 7.5e-293) {
tmp = exp(((y_46_re * log(x_46_re)) - 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 <= 7.5d-293) then
tmp = exp(((y_46re * log(x_46re)) - 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 <= 7.5e-293) {
tmp = Math.exp(((y_46_re * Math.log(x_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 <= 7.5e-293: tmp = math.exp(((y_46_re * math.log(x_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 <= 7.5e-293) tmp = exp(Float64(Float64(y_46_re * log(x_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 <= 7.5e-293) tmp = exp(((y_46_re * log(x_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, 7.5e-293], N[Exp[N[(N[(y$46$re * N[Log[x$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 7.5 \cdot 10^{-293}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_0}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.im - t\_0}\\
\end{array}
\end{array}
if x.im < 7.50000000000000038e-293Initial program 33.3%
Taylor expanded in y.im around 0 56.5%
Taylor expanded in y.re around 0 57.6%
Taylor expanded in x.re around inf 34.1%
if 7.50000000000000038e-293 < x.im Initial program 37.0%
Taylor expanded in y.im around 0 55.6%
Taylor expanded in y.re around 0 56.4%
Taylor expanded in x.re around 0 77.0%
Final simplification56.7%
(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 35.3%
Taylor expanded in y.im around 0 56.1%
Taylor expanded in y.re around 0 57.0%
Taylor expanded in x.re around 0 41.0%
Final simplification41.0%
herbie shell --seed 2024115
(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)))))