
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= y.re -9.5e+78)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_1))
(if (<= y.re 7e+68)
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(cos (fma t_0 y.im (* y.re (atan2 x.im x.re)))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(cos (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -9.5e+78) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_1);
} else if (y_46_re <= 7e+68) {
tmp = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -9.5e+78) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_1)); elseif (y_46_re <= 7e+68) tmp = Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * cos(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.5e+78], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e+68], N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t_1}\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+68}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -9.5000000000000006e78Initial program 32.7%
exp-diff26.5%
exp-to-pow26.5%
hypot-def26.5%
*-commutative26.5%
exp-prod26.5%
fma-def26.5%
hypot-def69.4%
*-commutative69.4%
Simplified69.4%
add-cube-cbrt71.4%
pow369.4%
fma-udef69.4%
*-commutative69.4%
*-commutative69.4%
fma-def69.4%
Applied egg-rr69.4%
Taylor expanded in y.im around inf 75.5%
Taylor expanded in y.im around 0 91.9%
if -9.5000000000000006e78 < y.re < 6.99999999999999955e68Initial program 45.2%
cancel-sign-sub-inv45.2%
fma-def45.2%
hypot-def45.2%
distribute-lft-neg-in45.2%
distribute-rgt-neg-out45.2%
fma-def45.2%
hypot-def84.3%
*-commutative84.3%
Simplified84.3%
if 6.99999999999999955e68 < y.re Initial program 32.1%
Taylor expanded in y.re around 0 39.3%
unpow239.3%
unpow239.3%
hypot-def85.8%
Simplified85.8%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* y.re t_1) (* y.im (atan2 x.im x.re))))))
(if (<= (* t_2 (cos (+ (* y.im t_1) t_0))) INFINITY)
(* t_2 (fabs (cos t_0)))
(*
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))
(cos (* y.im (cbrt (pow (log (hypot x.im x.re)) 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(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((y_46_re * t_1) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if ((t_2 * cos(((y_46_im * t_1) + t_0))) <= ((double) INFINITY)) {
tmp = t_2 * fabs(cos(t_0));
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * cos((y_46_im * cbrt(pow(log(hypot(x_46_im, x_46_re)), 3.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 = y_46_re * Math.atan2(x_46_im, x_46_re);
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) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if ((t_2 * Math.cos(((y_46_im * t_1) + t_0))) <= Double.POSITIVE_INFINITY) {
tmp = t_2 * Math.abs(Math.cos(t_0));
} else {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re))) * Math.cos((y_46_im * Math.cbrt(Math.pow(Math.log(Math.hypot(x_46_im, x_46_re)), 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(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(y_46_im * t_1) + t_0))) <= Inf) tmp = Float64(t_2 * abs(cos(t_0))); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * cos(Float64(y_46_im * cbrt((log(hypot(x_46_im, x_46_re)) ^ 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[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(y$46$im * t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * N[Abs[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y$46$im * N[Power[N[Power[N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{y.re \cdot t_1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;t_2 \cdot \cos \left(y.im \cdot t_1 + t_0\right) \leq \infty:\\
\;\;\;\;t_2 \cdot \left|\cos t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \cos \left(y.im \cdot \sqrt[3]{{\log \left(\mathsf{hypot}\left(x.im, x.re\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)))) < +inf.0Initial program 81.2%
Taylor expanded in y.im around 0 84.5%
add-sqr-sqrt71.0%
sqrt-unprod90.0%
pow290.0%
*-commutative90.0%
Applied egg-rr90.0%
unpow290.0%
rem-sqrt-square90.0%
*-commutative90.0%
Simplified90.0%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
exp-diff0.0%
exp-to-pow0.0%
hypot-def0.0%
*-commutative0.0%
exp-prod0.0%
fma-def0.0%
hypot-def70.3%
*-commutative70.3%
Simplified70.3%
add-cube-cbrt70.4%
pow369.6%
fma-udef69.6%
*-commutative69.6%
*-commutative69.6%
fma-def69.6%
Applied egg-rr69.6%
Taylor expanded in y.re around 0 0.0%
pow-base-10.0%
*-lft-identity0.0%
unpow20.0%
unpow20.0%
hypot-def76.2%
Simplified76.2%
add-cbrt-cube76.4%
pow378.0%
Applied egg-rr78.0%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(t_2 (exp (- (* y.re t_1) (* y.im (atan2 x.im x.re))))))
(if (<= (* t_2 (cos (+ (* y.im t_1) t_0))) INFINITY)
(* t_2 (fabs (cos t_0)))
(*
(cos (* y.im (log (hypot x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_2 = exp(((y_46_re * t_1) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if ((t_2 * cos(((y_46_im * t_1) + t_0))) <= ((double) INFINITY)) {
tmp = t_2 * fabs(cos(t_0));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.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) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double tmp;
if ((t_2 * Math.cos(((y_46_im * t_1) + t_0))) <= Double.POSITIVE_INFINITY) {
tmp = t_2 * Math.abs(Math.cos(t_0));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) t_2 = math.exp(((y_46_re * t_1) - (y_46_im * math.atan2(x_46_im, x_46_re)))) tmp = 0 if (t_2 * math.cos(((y_46_im * t_1) + t_0))) <= math.inf: tmp = t_2 * math.fabs(math.cos(t_0)) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_2 = exp(Float64(Float64(y_46_re * t_1) - Float64(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (Float64(t_2 * cos(Float64(Float64(y_46_im * t_1) + t_0))) <= Inf) tmp = Float64(t_2 * abs(cos(t_0))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); t_2 = exp(((y_46_re * t_1) - (y_46_im * atan2(x_46_im, x_46_re)))); tmp = 0.0; if ((t_2 * cos(((y_46_im * t_1) + t_0))) <= Inf) tmp = t_2 * abs(cos(t_0)); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * ((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * t$95$1), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 * N[Cos[N[(N[(y$46$im * t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$2 * N[Abs[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
t_2 := e^{y.re \cdot t_1 - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;t_2 \cdot \cos \left(y.im \cdot t_1 + t_0\right) \leq \infty:\\
\;\;\;\;t_2 \cdot \left|\cos t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) < +inf.0Initial program 81.2%
Taylor expanded in y.im around 0 84.5%
add-sqr-sqrt71.0%
sqrt-unprod90.0%
pow290.0%
*-commutative90.0%
Applied egg-rr90.0%
unpow290.0%
rem-sqrt-square90.0%
*-commutative90.0%
Simplified90.0%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
exp-diff0.0%
exp-to-pow0.0%
hypot-def0.0%
*-commutative0.0%
exp-prod0.0%
fma-def0.0%
hypot-def70.3%
*-commutative70.3%
Simplified70.3%
add-cube-cbrt70.4%
pow369.6%
fma-udef69.6%
*-commutative69.6%
*-commutative69.6%
fma-def69.6%
Applied egg-rr69.6%
Taylor expanded in y.re around 0 0.0%
pow-base-10.0%
*-lft-identity0.0%
unpow20.0%
unpow20.0%
hypot-def76.2%
Simplified76.2%
Final simplification83.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)) (t_1 (* y.im (atan2 x.im x.re))))
(if (<= y.re -3.9e+77)
(/ t_0 (+ 1.0 t_1))
(if (<= y.re 3.15)
(*
(cos (* y.re (atan2 x.im x.re)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(cos (* y.im (log (hypot x.im x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -3.9e+77) {
tmp = t_0 / (1.0 + t_1);
} else if (y_46_re <= 3.15) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_1 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -3.9e+77) {
tmp = t_0 / (1.0 + t_1);
} else if (y_46_re <= 3.15) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_1 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -3.9e+77: tmp = t_0 / (1.0 + t_1) elif y_46_re <= 3.15: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re t_1 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -3.9e+77) tmp = Float64(t_0 / Float64(1.0 + t_1)); elseif (y_46_re <= 3.15) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; t_1 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -3.9e+77) tmp = t_0 / (1.0 + t_1); elseif (y_46_re <= 3.15) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * cos((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.9e+77], N[(t$95$0 / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.15], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_1 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -3.9 \cdot 10^{+77}:\\
\;\;\;\;\frac{t_0}{1 + t_1}\\
\mathbf{elif}\;y.re \leq 3.15:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -3.8999999999999998e77Initial program 32.7%
exp-diff26.5%
exp-to-pow26.5%
hypot-def26.5%
*-commutative26.5%
exp-prod26.5%
fma-def26.5%
hypot-def69.4%
*-commutative69.4%
Simplified69.4%
add-cube-cbrt71.4%
pow369.4%
fma-udef69.4%
*-commutative69.4%
*-commutative69.4%
fma-def69.4%
Applied egg-rr69.4%
Taylor expanded in y.im around inf 75.5%
Taylor expanded in y.im around 0 91.9%
if -3.8999999999999998e77 < y.re < 3.14999999999999991Initial program 44.4%
exp-diff44.4%
exp-to-pow44.4%
hypot-def44.4%
*-commutative44.4%
exp-prod44.2%
fma-def44.2%
hypot-def82.9%
*-commutative82.9%
Simplified82.9%
add-cube-cbrt84.5%
pow384.4%
fma-udef84.4%
*-commutative84.4%
*-commutative84.4%
fma-def84.4%
Applied egg-rr84.4%
Taylor expanded in y.im around 0 82.8%
pow-base-182.8%
*-lft-identity82.8%
Simplified82.8%
if 3.14999999999999991 < y.re Initial program 36.2%
Taylor expanded in y.re around 0 42.0%
unpow242.0%
unpow242.0%
hypot-def82.7%
Simplified82.7%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1e+78)
(/ t_0 (+ 1.0 (* y.im (atan2 x.im x.re))))
(if (<= y.re 3.15)
(*
(cos (* y.re (atan2 x.im x.re)))
(/ t_0 (pow (exp y.im) (atan2 x.im x.re))))
(* (cos (* y.im (log (hypot x.im x.re)))) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1e+78) {
tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.15) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_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.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1e+78) {
tmp = t_0 / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 3.15) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * (t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1e+78: tmp = t_0 / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 3.15: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * (t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re))) else: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1e+78) tmp = Float64(t_0 / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 3.15) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); else tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, 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 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1e+78) tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 3.15) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re))); else tmp = cos((y_46_im * log(hypot(x_46_im, 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[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1e+78], N[(t$95$0 / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.15], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+78}:\\
\;\;\;\;\frac{t_0}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 3.15:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_0\\
\end{array}
\end{array}
if y.re < -1.00000000000000001e78Initial program 32.7%
exp-diff26.5%
exp-to-pow26.5%
hypot-def26.5%
*-commutative26.5%
exp-prod26.5%
fma-def26.5%
hypot-def69.4%
*-commutative69.4%
Simplified69.4%
add-cube-cbrt71.4%
pow369.4%
fma-udef69.4%
*-commutative69.4%
*-commutative69.4%
fma-def69.4%
Applied egg-rr69.4%
Taylor expanded in y.im around inf 75.5%
Taylor expanded in y.im around 0 91.9%
if -1.00000000000000001e78 < y.re < 3.14999999999999991Initial program 44.4%
exp-diff44.4%
exp-to-pow44.4%
hypot-def44.4%
*-commutative44.4%
exp-prod44.2%
fma-def44.2%
hypot-def82.9%
*-commutative82.9%
Simplified82.9%
add-cube-cbrt84.5%
pow384.4%
fma-udef84.4%
*-commutative84.4%
*-commutative84.4%
fma-def84.4%
Applied egg-rr84.4%
Taylor expanded in y.im around 0 82.8%
pow-base-182.8%
*-lft-identity82.8%
Simplified82.8%
if 3.14999999999999991 < y.re Initial program 36.2%
exp-diff30.4%
exp-to-pow30.4%
hypot-def30.4%
*-commutative30.4%
exp-prod30.4%
fma-def30.4%
hypot-def55.1%
*-commutative55.1%
Simplified55.1%
add-cube-cbrt55.1%
pow355.1%
fma-udef55.1%
*-commutative55.1%
*-commutative55.1%
fma-def55.1%
Applied egg-rr55.1%
Taylor expanded in y.re around 0 33.3%
pow-base-133.3%
*-lft-identity33.3%
unpow233.3%
unpow233.3%
hypot-def71.0%
Simplified71.0%
Taylor expanded in y.im around 0 79.8%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.re x.im) y.re))
(t_2 (* y.im (atan2 x.im x.re))))
(if (<= y.re -5e-12)
(/ t_1 (+ 1.0 t_2))
(if (<= y.re 1.2e-16) (* t_0 (/ 1.0 (exp t_2))) (* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -5e-12) {
tmp = t_1 / (1.0 + t_2);
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 * (1.0 / exp(t_2));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double t_2 = y_46_im * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -5e-12) {
tmp = t_1 / (1.0 + t_2);
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 * (1.0 / Math.exp(t_2));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) t_2 = y_46_im * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -5e-12: tmp = t_1 / (1.0 + t_2) elif y_46_re <= 1.2e-16: tmp = t_0 * (1.0 / math.exp(t_2)) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -5e-12) tmp = Float64(t_1 / Float64(1.0 + t_2)); elseif (y_46_re <= 1.2e-16) tmp = Float64(t_0 * Float64(1.0 / exp(t_2))); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; t_2 = y_46_im * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -5e-12) tmp = t_1 / (1.0 + t_2); elseif (y_46_re <= 1.2e-16) tmp = t_0 * (1.0 / exp(t_2)); else tmp = t_0 * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e-12], N[(t$95$1 / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-16], N[(t$95$0 * N[(1.0 / N[Exp[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{-12}:\\
\;\;\;\;\frac{t_1}{1 + t_2}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;t_0 \cdot \frac{1}{e^{t_2}}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot t_1\\
\end{array}
\end{array}
if y.re < -4.9999999999999997e-12Initial program 33.3%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
fma-def28.6%
hypot-def71.4%
*-commutative71.4%
Simplified71.4%
add-cube-cbrt74.6%
pow373.0%
fma-udef73.0%
*-commutative73.0%
*-commutative73.0%
fma-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.im around inf 78.4%
Taylor expanded in y.im around 0 88.0%
if -4.9999999999999997e-12 < y.re < 1.20000000000000002e-16Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-def46.5%
*-commutative46.5%
exp-prod46.3%
fma-def46.3%
hypot-def83.8%
*-commutative83.8%
Simplified83.8%
add-cube-cbrt84.8%
pow384.7%
fma-udef84.7%
*-commutative84.7%
*-commutative84.7%
fma-def84.7%
Applied egg-rr84.7%
Taylor expanded in y.re around 0 46.3%
pow-base-146.3%
*-lft-identity46.3%
unpow246.3%
unpow246.3%
hypot-def83.8%
Simplified83.8%
Taylor expanded in y.re around 0 84.6%
if 1.20000000000000002e-16 < y.re Initial program 34.7%
exp-diff29.2%
exp-to-pow29.2%
hypot-def29.2%
*-commutative29.2%
exp-prod29.2%
fma-def29.2%
hypot-def55.5%
*-commutative55.5%
Simplified55.5%
add-cube-cbrt55.5%
pow355.5%
fma-udef55.5%
*-commutative55.5%
*-commutative55.5%
fma-def55.5%
Applied egg-rr55.5%
Taylor expanded in y.re around 0 32.0%
pow-base-132.0%
*-lft-identity32.0%
unpow232.0%
unpow232.0%
hypot-def69.8%
Simplified69.8%
Taylor expanded in y.im around 0 78.3%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1.5e-10)
(/ t_0 (+ 1.0 (* y.im (atan2 x.im x.re))))
(if (<= y.re 1.2e-16)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.5e-10) {
tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.5e-10) {
tmp = t_0 / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.5e-10: tmp = t_0 / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.2e-16: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.5e-10) tmp = Float64(t_0 / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.2e-16) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.5e-10) tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.2e-16) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e-10], N[(t$95$0 / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-16], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{-10}:\\
\;\;\;\;\frac{t_0}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -1.5e-10Initial program 33.3%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
fma-def28.6%
hypot-def71.4%
*-commutative71.4%
Simplified71.4%
add-cube-cbrt74.6%
pow373.0%
fma-udef73.0%
*-commutative73.0%
*-commutative73.0%
fma-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.im around inf 78.4%
Taylor expanded in y.im around 0 88.0%
if -1.5e-10 < y.re < 1.20000000000000002e-16Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-def46.5%
*-commutative46.5%
exp-prod46.3%
fma-def46.3%
hypot-def83.8%
*-commutative83.8%
Simplified83.8%
add-cube-cbrt84.8%
pow384.7%
fma-udef84.7%
*-commutative84.7%
*-commutative84.7%
fma-def84.7%
Applied egg-rr84.7%
Taylor expanded in y.re around 0 46.3%
pow-base-146.3%
*-lft-identity46.3%
unpow246.3%
unpow246.3%
hypot-def83.8%
Simplified83.8%
Taylor expanded in y.re around 0 84.6%
rec-exp82.5%
distribute-lft-neg-in82.5%
Simplified84.6%
if 1.20000000000000002e-16 < y.re Initial program 34.7%
exp-diff29.2%
exp-to-pow29.2%
hypot-def29.2%
*-commutative29.2%
exp-prod29.2%
fma-def29.2%
hypot-def55.5%
*-commutative55.5%
Simplified55.5%
add-cube-cbrt55.5%
pow355.5%
fma-udef55.5%
*-commutative55.5%
*-commutative55.5%
fma-def55.5%
Applied egg-rr55.5%
Taylor expanded in y.im around inf 67.1%
Taylor expanded in y.im around 0 74.2%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1.1e-10)
(/ t_1 (+ 1.0 (* y.im (atan2 x.im x.re))))
(if (<= y.re 1.2e-16)
(* t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(* t_0 t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.1e-10) {
tmp = t_1 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.1e-10) {
tmp = t_1 / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.1e-10: tmp = t_1 / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.2e-16: tmp = t_0 * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.1e-10) tmp = Float64(t_1 / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.2e-16) tmp = Float64(t_0 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); t_1 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.1e-10) tmp = t_1 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.2e-16) tmp = t_0 * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0 * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.1e-10], N[(t$95$1 / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-16], N[(t$95$0 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{-10}:\\
\;\;\;\;\frac{t_1}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;t_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot t_1\\
\end{array}
\end{array}
if y.re < -1.09999999999999995e-10Initial program 33.3%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
fma-def28.6%
hypot-def71.4%
*-commutative71.4%
Simplified71.4%
add-cube-cbrt74.6%
pow373.0%
fma-udef73.0%
*-commutative73.0%
*-commutative73.0%
fma-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.im around inf 78.4%
Taylor expanded in y.im around 0 88.0%
if -1.09999999999999995e-10 < y.re < 1.20000000000000002e-16Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-def46.5%
*-commutative46.5%
exp-prod46.3%
fma-def46.3%
hypot-def83.8%
*-commutative83.8%
Simplified83.8%
add-cube-cbrt84.8%
pow384.7%
fma-udef84.7%
*-commutative84.7%
*-commutative84.7%
fma-def84.7%
Applied egg-rr84.7%
Taylor expanded in y.re around 0 46.3%
pow-base-146.3%
*-lft-identity46.3%
unpow246.3%
unpow246.3%
hypot-def83.8%
Simplified83.8%
Taylor expanded in y.re around 0 84.6%
rec-exp82.5%
distribute-lft-neg-in82.5%
Simplified84.6%
if 1.20000000000000002e-16 < y.re Initial program 34.7%
exp-diff29.2%
exp-to-pow29.2%
hypot-def29.2%
*-commutative29.2%
exp-prod29.2%
fma-def29.2%
hypot-def55.5%
*-commutative55.5%
Simplified55.5%
add-cube-cbrt55.5%
pow355.5%
fma-udef55.5%
*-commutative55.5%
*-commutative55.5%
fma-def55.5%
Applied egg-rr55.5%
Taylor expanded in y.re around 0 32.0%
pow-base-132.0%
*-lft-identity32.0%
unpow232.0%
unpow232.0%
hypot-def69.8%
Simplified69.8%
Taylor expanded in y.im around 0 78.3%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1.85e+94)
(/ t_0 (+ 1.0 (* y.im (atan2 x.im x.re))))
(if (<= y.re 1.2e-16) (/ t_0 (pow (exp y.im) (atan2 x.im x.re))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.85e+94) {
tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 / pow(exp(y_46_im), atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.85e+94) {
tmp = t_0 / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = t_0 / Math.pow(Math.exp(y_46_im), Math.atan2(x_46_im, x_46_re));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.85e+94: tmp = t_0 / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.2e-16: tmp = t_0 / math.pow(math.exp(y_46_im), math.atan2(x_46_im, x_46_re)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.85e+94) tmp = Float64(t_0 / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.2e-16) tmp = Float64(t_0 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.85e+94) tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.2e-16) tmp = t_0 / (exp(y_46_im) ^ atan2(x_46_im, x_46_re)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.85e+94], N[(t$95$0 / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-16], N[(t$95$0 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.85 \cdot 10^{+94}:\\
\;\;\;\;\frac{t_0}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{t_0}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -1.8500000000000001e94Initial program 32.6%
exp-diff25.6%
exp-to-pow25.6%
hypot-def25.6%
*-commutative25.6%
exp-prod25.6%
fma-def25.6%
hypot-def69.8%
*-commutative69.8%
Simplified69.8%
add-cube-cbrt72.1%
pow369.8%
fma-udef69.8%
*-commutative69.8%
*-commutative69.8%
fma-def69.8%
Applied egg-rr69.8%
Taylor expanded in y.im around inf 74.4%
Taylor expanded in y.im around 0 93.1%
if -1.8500000000000001e94 < y.re < 1.20000000000000002e-16Initial program 44.9%
exp-diff44.9%
exp-to-pow44.9%
hypot-def44.9%
*-commutative44.9%
exp-prod44.7%
fma-def44.7%
hypot-def82.5%
*-commutative82.5%
Simplified82.5%
add-cube-cbrt84.1%
pow384.0%
fma-udef84.0%
*-commutative84.0%
*-commutative84.0%
fma-def84.0%
Applied egg-rr84.0%
Taylor expanded in y.im around inf 82.7%
if 1.20000000000000002e-16 < y.re Initial program 34.7%
exp-diff29.2%
exp-to-pow29.2%
hypot-def29.2%
*-commutative29.2%
exp-prod29.2%
fma-def29.2%
hypot-def55.5%
*-commutative55.5%
Simplified55.5%
add-cube-cbrt55.5%
pow355.5%
fma-udef55.5%
*-commutative55.5%
*-commutative55.5%
fma-def55.5%
Applied egg-rr55.5%
Taylor expanded in y.im around inf 67.1%
Taylor expanded in y.im around 0 74.2%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.re x.im) y.re)))
(if (<= y.re -1.85e-11)
(/ t_0 (+ 1.0 (* y.im (atan2 x.im x.re))))
(if (<= y.re 1.2e-16) (exp (* (atan2 x.im x.re) (- y.im))) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.85e-11) {
tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
double tmp;
if (y_46_re <= -1.85e-11) {
tmp = t_0 / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 1.2e-16) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) tmp = 0 if y_46_re <= -1.85e-11: tmp = t_0 / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 1.2e-16: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.85e-11) tmp = Float64(t_0 / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 1.2e-16) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_re, x_46_im) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.85e-11) tmp = t_0 / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 1.2e-16) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.85e-11], N[(t$95$0 / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-16], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.85 \cdot 10^{-11}:\\
\;\;\;\;\frac{t_0}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.re < -1.8500000000000001e-11Initial program 33.3%
exp-diff28.6%
exp-to-pow28.6%
hypot-def28.6%
*-commutative28.6%
exp-prod28.6%
fma-def28.6%
hypot-def71.4%
*-commutative71.4%
Simplified71.4%
add-cube-cbrt74.6%
pow373.0%
fma-udef73.0%
*-commutative73.0%
*-commutative73.0%
fma-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.im around inf 78.4%
Taylor expanded in y.im around 0 88.0%
if -1.8500000000000001e-11 < y.re < 1.20000000000000002e-16Initial program 46.5%
exp-diff46.5%
exp-to-pow46.5%
hypot-def46.5%
*-commutative46.5%
exp-prod46.3%
fma-def46.3%
hypot-def83.8%
*-commutative83.8%
Simplified83.8%
add-cube-cbrt84.8%
pow384.7%
fma-udef84.7%
*-commutative84.7%
*-commutative84.7%
fma-def84.7%
Applied egg-rr84.7%
Taylor expanded in y.im around inf 82.0%
Taylor expanded in y.re around 0 82.5%
rec-exp82.5%
distribute-lft-neg-in82.5%
Simplified82.5%
if 1.20000000000000002e-16 < y.re Initial program 34.7%
exp-diff29.2%
exp-to-pow29.2%
hypot-def29.2%
*-commutative29.2%
exp-prod29.2%
fma-def29.2%
hypot-def55.5%
*-commutative55.5%
Simplified55.5%
add-cube-cbrt55.5%
pow355.5%
fma-udef55.5%
*-commutative55.5%
*-commutative55.5%
fma-def55.5%
Applied egg-rr55.5%
Taylor expanded in y.im around inf 67.1%
Taylor expanded in y.im around 0 74.2%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7500000000.0) (not (<= y.im 4.2e-24))) (exp (* (atan2 x.im x.re) (- y.im))) (pow (hypot x.re x.im) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -7500000000.0) || !(y_46_im <= 4.2e-24)) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -7500000000.0) || !(y_46_im <= 4.2e-24)) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -7500000000.0) or not (y_46_im <= 4.2e-24): tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -7500000000.0) || !(y_46_im <= 4.2e-24)) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = hypot(x_46_re, x_46_im) ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -7500000000.0) || ~((y_46_im <= 4.2e-24))) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = hypot(x_46_re, x_46_im) ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -7500000000.0], N[Not[LessEqual[y$46$im, 4.2e-24]], $MachinePrecision]], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -7500000000 \lor \neg \left(y.im \leq 4.2 \cdot 10^{-24}\right):\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -7.5e9 or 4.1999999999999999e-24 < y.im Initial program 32.7%
exp-diff27.0%
exp-to-pow27.0%
hypot-def27.0%
*-commutative27.0%
exp-prod26.9%
fma-def26.9%
hypot-def58.0%
*-commutative58.0%
Simplified58.0%
add-cube-cbrt61.5%
pow360.6%
fma-udef60.6%
*-commutative60.6%
*-commutative60.6%
fma-def60.6%
Applied egg-rr60.6%
Taylor expanded in y.im around inf 56.3%
Taylor expanded in y.re around 0 64.3%
rec-exp64.3%
distribute-lft-neg-in64.3%
Simplified64.3%
if -7.5e9 < y.im < 4.1999999999999999e-24Initial program 46.6%
exp-diff46.6%
exp-to-pow46.6%
hypot-def46.6%
*-commutative46.6%
exp-prod46.6%
fma-def46.6%
hypot-def86.4%
*-commutative86.4%
Simplified86.4%
add-cube-cbrt85.7%
pow385.7%
fma-udef85.7%
*-commutative85.7%
*-commutative85.7%
fma-def85.7%
Applied egg-rr85.7%
Taylor expanded in y.im around inf 96.0%
Taylor expanded in y.im around 0 96.7%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.im -1e-310) (cos (* y.im (log (- x.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 <= -1e-310) {
tmp = cos((y_46_im * log(-x_46_im)));
} else {
tmp = cos((y_46_im * log(x_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46im <= (-1d-310)) then
tmp = cos((y_46im * log(-x_46im)))
else
tmp = cos((y_46im * log(x_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_im <= -1e-310) {
tmp = Math.cos((y_46_im * Math.log(-x_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_im <= -1e-310: tmp = math.cos((y_46_im * math.log(-x_46_im))) else: tmp = math.cos((y_46_im * math.log(x_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_im <= -1e-310) tmp = cos(Float64(y_46_im * log(Float64(-x_46_im)))); else tmp = cos(Float64(y_46_im * log(x_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_im <= -1e-310) tmp = cos((y_46_im * log(-x_46_im))); else tmp = cos((y_46_im * log(x_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$im, -1e-310], N[Cos[N[(y$46$im * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.im \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.im\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right)\\
\end{array}
\end{array}
if x.im < -9.999999999999969e-311Initial program 42.7%
exp-diff38.8%
exp-to-pow38.8%
hypot-def38.8%
*-commutative38.8%
exp-prod38.6%
fma-def38.6%
hypot-def71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in y.im around 0 55.8%
Taylor expanded in y.re around 0 13.8%
Taylor expanded in x.im around -inf 21.8%
mul-1-neg21.8%
Simplified21.8%
if -9.999999999999969e-311 < x.im Initial program 37.2%
exp-diff35.7%
exp-to-pow35.7%
hypot-def35.7%
*-commutative35.7%
exp-prod35.7%
fma-def35.7%
hypot-def74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in y.im around 0 66.4%
Taylor expanded in y.re around 0 18.6%
Taylor expanded in x.im around inf 32.0%
Final simplification26.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -1e-309) (cos (* y.im (log (- x.re)))) (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 tmp;
if (x_46_re <= -1e-309) {
tmp = cos((y_46_im * log(-x_46_re)));
} else {
tmp = cos((y_46_im * log(x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-1d-309)) then
tmp = cos((y_46im * log(-x_46re)))
else
tmp = cos((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -1e-309) {
tmp = Math.cos((y_46_im * Math.log(-x_46_re)));
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -1e-309: tmp = math.cos((y_46_im * math.log(-x_46_re))) else: tmp = math.cos((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -1e-309) tmp = cos(Float64(y_46_im * log(Float64(-x_46_re)))); else tmp = cos(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) tmp = 0.0; if (x_46_re <= -1e-309) tmp = cos((y_46_im * log(-x_46_re))); else tmp = cos((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_] := If[LessEqual[x$46$re, -1e-309], N[Cos[N[(y$46$im * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(-x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -1.000000000000002e-309Initial program 43.9%
exp-diff40.2%
exp-to-pow40.2%
hypot-def40.2%
*-commutative40.2%
exp-prod40.1%
fma-def40.1%
hypot-def76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.im around 0 61.5%
Taylor expanded in y.re around 0 16.6%
Taylor expanded in x.re around -inf 26.5%
mul-1-neg26.5%
Simplified26.5%
if -1.000000000000002e-309 < x.re Initial program 35.7%
exp-diff34.1%
exp-to-pow34.1%
hypot-def34.1%
*-commutative34.1%
exp-prod33.9%
fma-def33.9%
hypot-def68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in y.im around 0 60.8%
Taylor expanded in y.re around 0 15.9%
Taylor expanded in x.im around 0 28.0%
Final simplification27.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re 4.3e-283) (cos (* y.im (log x.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 tmp;
if (x_46_re <= 4.3e-283) {
tmp = cos((y_46_im * log(x_46_im)));
} else {
tmp = cos((y_46_im * log(x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= 4.3d-283) then
tmp = cos((y_46im * log(x_46im)))
else
tmp = cos((y_46im * log(x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 4.3e-283) {
tmp = Math.cos((y_46_im * Math.log(x_46_im)));
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= 4.3e-283: tmp = math.cos((y_46_im * math.log(x_46_im))) else: tmp = math.cos((y_46_im * math.log(x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 4.3e-283) tmp = cos(Float64(y_46_im * log(x_46_im))); else tmp = cos(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) tmp = 0.0; if (x_46_re <= 4.3e-283) tmp = cos((y_46_im * log(x_46_im))); else tmp = cos((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_] := If[LessEqual[x$46$re, 4.3e-283], N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Cos[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 4.3 \cdot 10^{-283}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.im\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < 4.30000000000000002e-283Initial program 43.1%
exp-diff39.4%
exp-to-pow39.4%
hypot-def39.4%
*-commutative39.4%
exp-prod39.4%
fma-def39.4%
hypot-def75.1%
*-commutative75.1%
Simplified75.1%
Taylor expanded in y.im around 0 60.7%
Taylor expanded in y.re around 0 16.7%
Taylor expanded in x.im around inf 13.6%
if 4.30000000000000002e-283 < x.re Initial program 36.4%
exp-diff34.7%
exp-to-pow34.7%
hypot-def34.7%
*-commutative34.7%
exp-prod34.5%
fma-def34.5%
hypot-def70.1%
*-commutative70.1%
Simplified70.1%
Taylor expanded in y.im around 0 61.7%
Taylor expanded in y.re around 0 15.7%
Taylor expanded in x.im around 0 28.3%
Final simplification20.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* (atan2 x.im x.re) (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((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((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((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((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(atan(x_46_im, x_46_re) * Float64(-y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}
\end{array}
Initial program 39.9%
exp-diff37.2%
exp-to-pow37.2%
hypot-def37.2%
*-commutative37.2%
exp-prod37.1%
fma-def37.1%
hypot-def72.8%
*-commutative72.8%
Simplified72.8%
add-cube-cbrt74.1%
pow373.6%
fma-udef73.6%
*-commutative73.6%
*-commutative73.6%
fma-def73.6%
Applied egg-rr73.6%
Taylor expanded in y.im around inf 76.9%
Taylor expanded in y.re around 0 55.0%
rec-exp55.0%
distribute-lft-neg-in55.0%
Simplified55.0%
Final simplification55.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* y.im (atan2 x.im x.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp((y_46_im * atan2(x_46_im, x_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
code = exp((y_46im * atan2(x_46im, x_46re)))
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_im * Math.atan2(x_46_im, x_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.exp((y_46_im * math.atan2(x_46_im, x_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(Float64(y_46_im * atan(x_46_im, x_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = exp((y_46_im * atan2(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Exp[N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}
\end{array}
Initial program 39.9%
exp-diff37.2%
exp-to-pow37.2%
hypot-def37.2%
*-commutative37.2%
exp-prod37.1%
fma-def37.1%
hypot-def72.8%
*-commutative72.8%
Simplified72.8%
add-cube-cbrt74.1%
pow373.6%
fma-udef73.6%
*-commutative73.6%
*-commutative73.6%
fma-def73.6%
Applied egg-rr73.6%
Taylor expanded in y.im around inf 76.9%
Taylor expanded in y.re around 0 55.0%
rec-exp55.0%
distribute-lft-neg-in55.0%
Simplified55.0%
expm1-log1p-u34.3%
expm1-udef34.3%
add-sqr-sqrt18.3%
sqrt-unprod31.0%
sqr-neg31.0%
sqrt-unprod12.8%
add-sqr-sqrt27.4%
Applied egg-rr27.4%
expm1-def27.4%
expm1-log1p30.0%
Simplified30.0%
Final simplification30.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (cos (* y.im (log x.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return cos((y_46_im * log(x_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 = cos((y_46im * log(x_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.cos((y_46_im * Math.log(x_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.cos((y_46_im * math.log(x_46_im)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return cos(Float64(y_46_im * log(x_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = cos((y_46_im * log(x_46_im))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\cos \left(y.im \cdot \log x.im\right)
\end{array}
Initial program 39.9%
exp-diff37.2%
exp-to-pow37.2%
hypot-def37.2%
*-commutative37.2%
exp-prod37.1%
fma-def37.1%
hypot-def72.8%
*-commutative72.8%
Simplified72.8%
Taylor expanded in y.im around 0 61.2%
Taylor expanded in y.re around 0 16.2%
Taylor expanded in x.im around inf 16.1%
Final simplification16.1%
herbie shell --seed 2023334
(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)))))