
(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 18 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 (* (exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im)))) (cos (* (cbrt y.im) (* (log (hypot x.im x.re)) (pow (cbrt y.im) 2.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * cos((cbrt(y_46_im) * (log(hypot(x_46_im, x_46_re)) * pow(cbrt(y_46_im), 2.0))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 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(cbrt(y_46_im) * Float64(log(hypot(x_46_im, x_46_re)) * (cbrt(y_46_im) ^ 2.0))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[(N[Power[y$46$im, 1/3], $MachinePrecision] * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * N[Power[N[Power[y$46$im, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
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(\sqrt[3]{y.im} \cdot \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot {\left(\sqrt[3]{y.im}\right)}^{2}\right)\right)
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt79.4%
pow379.9%
fma-undefine79.9%
*-commutative79.9%
*-commutative79.9%
fma-define79.9%
Applied egg-rr79.9%
Taylor expanded in y.im around inf 45.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
hypot-undefine45.2%
unpow245.2%
unpow245.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
Simplified83.6%
rem-cube-cbrt83.7%
*-commutative83.7%
hypot-undefine44.5%
+-commutative44.5%
add-cube-cbrt45.9%
associate-*r*46.7%
+-commutative46.7%
hypot-undefine85.5%
pow285.5%
Applied egg-rr85.5%
Final simplification85.5%
(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)))))
(if (<= (* t_1 (cos (+ (* y.im t_0) (* y.re (atan2 x.im x.re))))) INFINITY)
(* (cos (* y.im (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)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
double t_1 = exp(((y_46_re * t_0) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if ((t_1 * cos(((y_46_im * t_0) + (y_46_re * atan2(x_46_im, x_46_re))))) <= ((double) INFINITY)) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_1;
} 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)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) t_1 = exp(Float64(Float64(y_46_re * t_0) - Float64(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (Float64(t_1 * cos(Float64(Float64(y_46_im * t_0) + Float64(y_46_re * atan(x_46_im, x_46_re))))) <= Inf) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_1); else tmp = 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)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * t$95$0), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Cos[N[(N[(y$46$im * t$95$0), $MachinePrecision] + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], 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$1), $MachinePrecision], 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]]]]
\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}\\
\mathbf{if}\;t\_1 \cdot \cos \left(y.im \cdot t\_0 + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \leq \infty:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_1\\
\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)}\\
\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 85.1%
Taylor expanded in y.re around 0 84.9%
unpow284.9%
unpow284.9%
hypot-undefine85.7%
Simplified85.7%
if +inf.0 < (*.f64 (exp.f64 (-.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.re) (*.f64 (atan2.f64 x.im x.re) y.im))) (cos.f64 (+.f64 (*.f64 (log.f64 (sqrt.f64 (+.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)))) y.im) (*.f64 (atan2.f64 x.im x.re) y.re)))) Initial program 0.0%
cancel-sign-sub-inv0.0%
fma-define0.0%
hypot-define0.0%
distribute-lft-neg-in0.0%
distribute-rgt-neg-out0.0%
fma-define0.0%
hypot-define77.4%
*-commutative77.4%
Simplified77.4%
add-cube-cbrt77.9%
pow379.0%
fma-undefine79.0%
*-commutative79.0%
*-commutative79.0%
fma-define79.0%
Applied egg-rr79.0%
Taylor expanded in y.im around inf 0.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-undefine81.5%
hypot-undefine0.0%
unpow20.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-undefine81.5%
Simplified81.5%
Taylor expanded in y.im around 0 78.8%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re 3.0)
(*
(exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im))))
(cos (pow (cbrt (* y.im (log (hypot x.im x.re)))) 3.0)))
(*
(cos (* y.im (exp (log (log x.re)))))
(exp (- (* y.re (log x.re)) (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= 3.0) {
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(pow(cbrt((y_46_im * log(hypot(x_46_im, x_46_re)))), 3.0));
} else {
tmp = cos((y_46_im * exp(log(log(x_46_re))))) * exp(((y_46_re * log(x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= 3.0) 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((cbrt(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) ^ 3.0))); else tmp = Float64(cos(Float64(y_46_im * exp(log(log(x_46_re))))) * exp(Float64(Float64(y_46_re * log(x_46_re)) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, 3.0], 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[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Exp[N[Log[N[Log[x$46$re], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq 3:\\
\;\;\;\;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({\left(\sqrt[3]{y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(y.im \cdot e^{\log \log x.re}\right) \cdot e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.re < 3Initial program 50.6%
cancel-sign-sub-inv50.6%
fma-define50.6%
hypot-define50.8%
distribute-lft-neg-in50.8%
distribute-rgt-neg-out50.8%
fma-define50.8%
hypot-define83.4%
*-commutative83.4%
Simplified83.4%
add-cube-cbrt82.4%
pow382.9%
fma-undefine82.9%
*-commutative82.9%
*-commutative82.9%
fma-define82.9%
Applied egg-rr82.9%
Taylor expanded in y.im around inf 53.0%
+-commutative53.0%
unpow253.0%
unpow253.0%
hypot-undefine86.7%
hypot-undefine53.0%
unpow253.0%
unpow253.0%
+-commutative53.0%
unpow253.0%
unpow253.0%
hypot-undefine86.7%
Simplified86.7%
if 3 < x.re Initial program 26.1%
cancel-sign-sub-inv26.1%
fma-define26.1%
hypot-define26.1%
distribute-lft-neg-in26.1%
distribute-rgt-neg-out26.1%
fma-define26.1%
hypot-define76.1%
*-commutative76.1%
Simplified76.1%
add-cube-cbrt70.2%
pow370.8%
fma-undefine70.8%
*-commutative70.8%
*-commutative70.8%
fma-define70.8%
Applied egg-rr70.8%
Taylor expanded in y.im around inf 21.0%
+-commutative21.0%
unpow221.0%
unpow221.0%
hypot-undefine74.0%
hypot-undefine21.0%
unpow221.0%
unpow221.0%
+-commutative21.0%
unpow221.0%
unpow221.0%
hypot-undefine74.0%
Simplified74.0%
Taylor expanded in x.im around 0 80.8%
neg-mul-180.8%
+-commutative80.8%
sub-neg80.8%
Simplified80.8%
add-exp-log81.6%
Applied egg-rr81.6%
Final simplification85.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im)))) (log1p (expm1 (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) {
return exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * log1p(expm1(cos((y_46_im * log(hypot(x_46_im, x_46_re))))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 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)))) * log1p(expm1(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[Log[1 + N[(Exp[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
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 \mathsf{log1p}\left(\mathsf{expm1}\left(\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right)\right)
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt79.4%
pow379.9%
fma-undefine79.9%
*-commutative79.9%
*-commutative79.9%
fma-define79.9%
Applied egg-rr79.9%
Taylor expanded in y.im around inf 45.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
hypot-undefine45.2%
unpow245.2%
unpow245.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
Simplified83.6%
rem-cube-cbrt83.7%
log1p-expm1-u83.7%
Applied egg-rr83.7%
(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 5e-283)
t_0
(* t_0 (cos (pow (cbrt (* y.im (log x.im))) 3.0))))))
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 <= 5e-283) {
tmp = t_0;
} else {
tmp = t_0 * cos(pow(cbrt((y_46_im * log(x_46_im))), 3.0));
}
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 <= 5e-283) tmp = t_0; else tmp = Float64(t_0 * cos((cbrt(Float64(y_46_im * log(x_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[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, 5e-283], t$95$0, N[(t$95$0 * N[Cos[N[Power[N[Power[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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 5 \cdot 10^{-283}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \cos \left({\left(\sqrt[3]{y.im \cdot \log x.im}\right)}^{3}\right)\\
\end{array}
\end{array}
if x.im < 5.0000000000000001e-283Initial program 43.3%
cancel-sign-sub-inv43.3%
fma-define43.3%
hypot-define43.6%
distribute-lft-neg-in43.6%
distribute-rgt-neg-out43.6%
fma-define43.6%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
add-cube-cbrt80.8%
pow382.6%
fma-undefine82.6%
*-commutative82.6%
*-commutative82.6%
fma-define82.6%
Applied egg-rr82.6%
Taylor expanded in y.im around inf 44.6%
+-commutative44.6%
unpow244.6%
unpow244.6%
hypot-undefine86.2%
hypot-undefine44.6%
unpow244.6%
unpow244.6%
+-commutative44.6%
unpow244.6%
unpow244.6%
hypot-undefine86.2%
Simplified86.2%
Taylor expanded in y.im around 0 83.0%
if 5.0000000000000001e-283 < x.im Initial program 45.7%
cancel-sign-sub-inv45.7%
fma-define45.7%
hypot-define45.7%
distribute-lft-neg-in45.7%
distribute-rgt-neg-out45.7%
fma-define45.7%
hypot-define81.8%
*-commutative81.8%
Simplified81.8%
add-cube-cbrt78.1%
pow377.5%
fma-undefine77.5%
*-commutative77.5%
*-commutative77.5%
fma-define77.5%
Applied egg-rr77.5%
Taylor expanded in y.im around inf 45.7%
+-commutative45.7%
unpow245.7%
unpow245.7%
hypot-undefine81.2%
hypot-undefine45.7%
unpow245.7%
unpow245.7%
+-commutative45.7%
unpow245.7%
unpow245.7%
hypot-undefine81.2%
Simplified81.2%
Taylor expanded in x.re around 0 82.6%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (<= y.re -0.00095)
(* (cos (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re 6.5e+38)
(* (cos (* y.im t_0)) (exp (* (atan2 x.im x.re) (- y.im))))
(pow E (* 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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -0.00095) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 6.5e+38) {
tmp = cos((y_46_im * t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = pow(((double) M_E), (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.log(Math.hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -0.00095) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 6.5e+38) {
tmp = Math.cos((y_46_im * t_0)) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = Math.pow(Math.E, (y_46_re * t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -0.00095: tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 6.5e+38: tmp = math.cos((y_46_im * t_0)) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = math.pow(math.e, (y_46_re * t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -0.00095) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 6.5e+38) tmp = Float64(cos(Float64(y_46_im * t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = exp(1) ^ Float64(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 = log(hypot(x_46_im, x_46_re)); tmp = 0.0; if (y_46_re <= -0.00095) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 6.5e+38) tmp = cos((y_46_im * t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = 2.71828182845904523536 ^ (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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00095], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+38], N[(N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[E, N[(y$46$re * t$95$0), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -0.00095:\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+38}:\\
\;\;\;\;\cos \left(y.im \cdot t\_0\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(y.re \cdot t\_0\right)}\\
\end{array}
\end{array}
if y.re < -9.49999999999999998e-4Initial program 39.3%
cancel-sign-sub-inv39.3%
fma-define39.3%
hypot-define40.0%
distribute-lft-neg-in40.0%
distribute-rgt-neg-out40.0%
fma-define40.0%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.im around 0 87.1%
unpow287.1%
unpow287.1%
hypot-undefine87.7%
Simplified87.7%
if -9.49999999999999998e-4 < y.re < 6.5e38Initial program 46.7%
cancel-sign-sub-inv46.7%
fma-define46.7%
hypot-define46.7%
distribute-lft-neg-in46.7%
distribute-rgt-neg-out46.7%
fma-define46.7%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.re around 0 46.0%
unpow246.0%
unpow246.0%
hypot-undefine84.4%
neg-mul-184.4%
distribute-lft-neg-in84.4%
Simplified84.4%
if 6.5e38 < y.re Initial program 45.5%
cancel-sign-sub-inv45.5%
fma-define45.5%
hypot-define45.5%
distribute-lft-neg-in45.5%
distribute-rgt-neg-out45.5%
fma-define45.5%
hypot-define65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in y.im around 0 52.9%
unpow252.9%
unpow252.9%
hypot-undefine52.9%
Simplified52.9%
Taylor expanded in y.re around 0 62.0%
*-un-lft-identity62.0%
pow-to-exp62.0%
hypot-undefine62.0%
+-commutative62.0%
*-un-lft-identity62.0%
exp-prod62.0%
*-commutative62.0%
+-commutative62.0%
hypot-undefine62.0%
Applied egg-rr62.0%
exp-1-e62.0%
Simplified62.0%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (fma (log (hypot x.re x.im)) y.re (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(fma(log(hypot(x_46_re, x_46_im)), y_46_re, (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(fma(log(hypot(x_46_re, x_46_im)), y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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]
\begin{array}{l}
\\
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)}
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
add-cube-cbrt79.4%
pow379.9%
fma-undefine79.9%
*-commutative79.9%
*-commutative79.9%
fma-define79.9%
Applied egg-rr79.9%
Taylor expanded in y.im around inf 45.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
hypot-undefine45.2%
unpow245.2%
unpow245.2%
+-commutative45.2%
unpow245.2%
unpow245.2%
hypot-undefine83.6%
Simplified83.6%
Taylor expanded in y.im around 0 80.4%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) y.im))))
(if (<= y.im -1.5e+144)
(/ (cos (* (- y.im) (log (/ -1.0 x.re)))) t_0)
(if (<= y.im 880000000.0)
(pow E (* y.re (log (hypot x.im x.re))))
(/ (cos (* y.im (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 = exp((atan2(x_46_im, x_46_re) * y_46_im));
double tmp;
if (y_46_im <= -1.5e+144) {
tmp = cos((-y_46_im * log((-1.0 / x_46_re)))) / t_0;
} else if (y_46_im <= 880000000.0) {
tmp = pow(((double) M_E), (y_46_re * log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos((y_46_im * log(x_46_im))) / t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
double tmp;
if (y_46_im <= -1.5e+144) {
tmp = Math.cos((-y_46_im * Math.log((-1.0 / x_46_re)))) / t_0;
} else if (y_46_im <= 880000000.0) {
tmp = Math.pow(Math.E, (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.cos((y_46_im * 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.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) tmp = 0 if y_46_im <= -1.5e+144: tmp = math.cos((-y_46_im * math.log((-1.0 / x_46_re)))) / t_0 elif y_46_im <= 880000000.0: tmp = math.pow(math.e, (y_46_re * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.cos((y_46_im * 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 = exp(Float64(atan(x_46_im, x_46_re) * y_46_im)) tmp = 0.0 if (y_46_im <= -1.5e+144) tmp = Float64(cos(Float64(Float64(-y_46_im) * log(Float64(-1.0 / x_46_re)))) / t_0); elseif (y_46_im <= 880000000.0) tmp = exp(1) ^ Float64(y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = Float64(cos(Float64(y_46_im * 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 = exp((atan2(x_46_im, x_46_re) * y_46_im)); tmp = 0.0; if (y_46_im <= -1.5e+144) tmp = cos((-y_46_im * log((-1.0 / x_46_re)))) / t_0; elseif (y_46_im <= 880000000.0) tmp = 2.71828182845904523536 ^ (y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = cos((y_46_im * 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.5e+144], N[(N[Cos[N[((-y$46$im) * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 880000000.0], N[Power[E, N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.5 \cdot 10^{+144}:\\
\;\;\;\;\frac{\cos \left(\left(-y.im\right) \cdot \log \left(\frac{-1}{x.re}\right)\right)}{t\_0}\\
\mathbf{elif}\;y.im \leq 880000000:\\
\;\;\;\;{e}^{\left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log x.im\right)}{t\_0}\\
\end{array}
\end{array}
if y.im < -1.49999999999999995e144Initial program 29.7%
exp-diff23.3%
exp-to-pow23.3%
hypot-define23.3%
*-commutative23.3%
exp-prod22.7%
fma-define22.7%
hypot-define49.2%
*-commutative49.2%
Simplified49.2%
expm1-log1p-u0.0%
expm1-undefine0.0%
fma-undefine0.0%
*-commutative0.0%
*-commutative0.0%
fma-define0.0%
Applied egg-rr0.0%
expm1-define0.0%
fma-define0.0%
+-commutative0.0%
fma-define0.0%
hypot-undefine0.0%
unpow20.0%
unpow20.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-undefine0.0%
Simplified0.0%
Taylor expanded in y.re around 0 23.4%
+-commutative23.4%
unpow223.4%
unpow223.4%
hypot-undefine56.4%
hypot-undefine23.4%
unpow223.4%
unpow223.4%
+-commutative23.4%
unpow223.4%
unpow223.4%
hypot-undefine56.4%
exp-prod55.8%
Simplified55.8%
Taylor expanded in x.re around -inf 38.8%
if -1.49999999999999995e144 < y.im < 8.8e8Initial program 48.5%
cancel-sign-sub-inv48.5%
fma-define48.5%
hypot-define48.7%
distribute-lft-neg-in48.7%
distribute-rgt-neg-out48.7%
fma-define48.7%
hypot-define87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in y.im around 0 67.0%
unpow267.0%
unpow267.0%
hypot-undefine82.3%
Simplified82.3%
Taylor expanded in y.re around 0 85.7%
*-un-lft-identity85.7%
pow-to-exp85.7%
hypot-undefine70.7%
+-commutative70.7%
*-un-lft-identity70.7%
exp-prod70.7%
*-commutative70.7%
+-commutative70.7%
hypot-undefine85.7%
Applied egg-rr85.7%
exp-1-e85.7%
Simplified85.7%
if 8.8e8 < y.im Initial program 42.4%
exp-diff35.1%
exp-to-pow35.1%
hypot-define35.1%
*-commutative35.1%
exp-prod33.4%
fma-define33.4%
hypot-define61.3%
*-commutative61.3%
Simplified61.3%
expm1-log1p-u40.3%
expm1-undefine40.3%
fma-undefine40.3%
*-commutative40.3%
*-commutative40.3%
fma-define40.3%
Applied egg-rr40.3%
expm1-define40.3%
fma-define40.3%
+-commutative40.3%
fma-define40.3%
hypot-undefine20.3%
unpow220.3%
unpow220.3%
+-commutative20.3%
unpow220.3%
unpow220.3%
hypot-undefine40.3%
Simplified40.3%
Taylor expanded in y.re around 0 36.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine65.0%
hypot-undefine36.7%
unpow236.7%
unpow236.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine65.0%
exp-prod64.4%
Simplified64.4%
Taylor expanded in x.re around 0 54.3%
Final simplification71.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -440000000000.0)
(pow (log (exp (hypot x.im x.re))) y.re)
(if (<= y.im 140000.0)
(pow E (* y.re (log (hypot x.im x.re))))
(/ (cos (* y.im (log x.im))) (exp (* (atan2 x.im x.re) y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -440000000000.0) {
tmp = pow(log(exp(hypot(x_46_im, x_46_re))), y_46_re);
} else if (y_46_im <= 140000.0) {
tmp = pow(((double) M_E), (y_46_re * log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos((y_46_im * log(x_46_im))) / exp((atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -440000000000.0) {
tmp = Math.pow(Math.log(Math.exp(Math.hypot(x_46_im, x_46_re))), y_46_re);
} else if (y_46_im <= 140000.0) {
tmp = Math.pow(Math.E, (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.cos((y_46_im * Math.log(x_46_im))) / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -440000000000.0: tmp = math.pow(math.log(math.exp(math.hypot(x_46_im, x_46_re))), y_46_re) elif y_46_im <= 140000.0: tmp = math.pow(math.e, (y_46_re * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.cos((y_46_im * math.log(x_46_im))) / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -440000000000.0) tmp = log(exp(hypot(x_46_im, x_46_re))) ^ y_46_re; elseif (y_46_im <= 140000.0) tmp = exp(1) ^ Float64(y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = Float64(cos(Float64(y_46_im * log(x_46_im))) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -440000000000.0) tmp = log(exp(hypot(x_46_im, x_46_re))) ^ y_46_re; elseif (y_46_im <= 140000.0) tmp = 2.71828182845904523536 ^ (y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = cos((y_46_im * log(x_46_im))) / exp((atan2(x_46_im, x_46_re) * y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -440000000000.0], N[Power[N[Log[N[Exp[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], If[LessEqual[y$46$im, 140000.0], N[Power[E, N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[N[(y$46$im * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -440000000000:\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 140000:\\
\;\;\;\;{e}^{\left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos \left(y.im \cdot \log x.im\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}
\end{array}
if y.im < -4.4e11Initial program 36.0%
cancel-sign-sub-inv36.0%
fma-define36.0%
hypot-define36.0%
distribute-lft-neg-in36.0%
distribute-rgt-neg-out36.0%
fma-define36.0%
hypot-define65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in y.im around 0 35.0%
unpow235.0%
unpow235.0%
hypot-undefine29.5%
Simplified29.5%
Taylor expanded in y.re around 0 29.5%
add-log-exp41.3%
Applied egg-rr41.3%
if -4.4e11 < y.im < 1.4e5Initial program 49.7%
cancel-sign-sub-inv49.7%
fma-define49.7%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.im around 0 70.4%
unpow270.4%
unpow270.4%
hypot-undefine90.3%
Simplified90.3%
Taylor expanded in y.re around 0 93.8%
*-un-lft-identity93.8%
pow-to-exp93.8%
hypot-undefine74.1%
+-commutative74.1%
*-un-lft-identity74.1%
exp-prod74.1%
*-commutative74.1%
+-commutative74.1%
hypot-undefine93.8%
Applied egg-rr93.8%
exp-1-e93.8%
Simplified93.8%
if 1.4e5 < y.im Initial program 42.4%
exp-diff35.1%
exp-to-pow35.1%
hypot-define35.1%
*-commutative35.1%
exp-prod33.4%
fma-define33.4%
hypot-define61.3%
*-commutative61.3%
Simplified61.3%
expm1-log1p-u40.3%
expm1-undefine40.3%
fma-undefine40.3%
*-commutative40.3%
*-commutative40.3%
fma-define40.3%
Applied egg-rr40.3%
expm1-define40.3%
fma-define40.3%
+-commutative40.3%
fma-define40.3%
hypot-undefine20.3%
unpow220.3%
unpow220.3%
+-commutative20.3%
unpow220.3%
unpow220.3%
hypot-undefine40.3%
Simplified40.3%
Taylor expanded in y.re around 0 36.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine65.0%
hypot-undefine36.7%
unpow236.7%
unpow236.7%
+-commutative36.7%
unpow236.7%
unpow236.7%
hypot-undefine65.0%
exp-prod64.4%
Simplified64.4%
Taylor expanded in x.re around 0 54.3%
Final simplification71.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -500000000000.0) (not (<= y.im 0.5))) (pow (log (exp (hypot x.im x.re))) y.re) (pow E (* y.re (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 tmp;
if ((y_46_im <= -500000000000.0) || !(y_46_im <= 0.5)) {
tmp = pow(log(exp(hypot(x_46_im, x_46_re))), y_46_re);
} else {
tmp = pow(((double) M_E), (y_46_re * 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 tmp;
if ((y_46_im <= -500000000000.0) || !(y_46_im <= 0.5)) {
tmp = Math.pow(Math.log(Math.exp(Math.hypot(x_46_im, x_46_re))), y_46_re);
} else {
tmp = Math.pow(Math.E, (y_46_re * 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): tmp = 0 if (y_46_im <= -500000000000.0) or not (y_46_im <= 0.5): tmp = math.pow(math.log(math.exp(math.hypot(x_46_im, x_46_re))), y_46_re) else: tmp = math.pow(math.e, (y_46_re * 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) tmp = 0.0 if ((y_46_im <= -500000000000.0) || !(y_46_im <= 0.5)) tmp = log(exp(hypot(x_46_im, x_46_re))) ^ y_46_re; else tmp = exp(1) ^ Float64(y_46_re * 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) tmp = 0.0; if ((y_46_im <= -500000000000.0) || ~((y_46_im <= 0.5))) tmp = log(exp(hypot(x_46_im, x_46_re))) ^ y_46_re; else tmp = 2.71828182845904523536 ^ (y_46_re * 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_] := If[Or[LessEqual[y$46$im, -500000000000.0], N[Not[LessEqual[y$46$im, 0.5]], $MachinePrecision]], N[Power[N[Log[N[Exp[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision], N[Power[E, N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -500000000000 \lor \neg \left(y.im \leq 0.5\right):\\
\;\;\;\;{\log \left(e^{\mathsf{hypot}\left(x.im, x.re\right)}\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{e}^{\left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\\
\end{array}
\end{array}
if y.im < -5e11 or 0.5 < y.im Initial program 39.1%
cancel-sign-sub-inv39.1%
fma-define39.1%
hypot-define39.1%
distribute-lft-neg-in39.1%
distribute-rgt-neg-out39.1%
fma-define39.1%
hypot-define71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in y.im around 0 40.8%
unpow240.8%
unpow240.8%
hypot-undefine33.9%
Simplified33.9%
Taylor expanded in y.re around 0 33.9%
add-log-exp47.9%
Applied egg-rr47.9%
if -5e11 < y.im < 0.5Initial program 50.1%
cancel-sign-sub-inv50.1%
fma-define50.1%
hypot-define50.4%
distribute-lft-neg-in50.4%
distribute-rgt-neg-out50.4%
fma-define50.4%
hypot-define91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.im around 0 70.2%
unpow270.2%
unpow270.2%
hypot-undefine90.3%
Simplified90.3%
Taylor expanded in y.re around 0 93.7%
*-un-lft-identity93.7%
pow-to-exp93.7%
hypot-undefine73.9%
+-commutative73.9%
*-un-lft-identity73.9%
exp-prod73.9%
*-commutative73.9%
+-commutative73.9%
hypot-undefine93.7%
Applied egg-rr93.7%
exp-1-e93.7%
Simplified93.7%
Final simplification70.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 0.5) (pow E (* y.re (log (hypot x.im x.re)))) (pow (pow (hypot x.im x.re) 2.0) (* y.re 0.5))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 0.5) {
tmp = pow(((double) M_E), (y_46_re * log(hypot(x_46_im, x_46_re))));
} else {
tmp = pow(pow(hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 0.5) {
tmp = Math.pow(Math.E, (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
} else {
tmp = Math.pow(Math.pow(Math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= 0.5: tmp = math.pow(math.e, (y_46_re * math.log(math.hypot(x_46_im, x_46_re)))) else: tmp = math.pow(math.pow(math.hypot(x_46_im, x_46_re), 2.0), (y_46_re * 0.5)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= 0.5) tmp = exp(1) ^ Float64(y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = (hypot(x_46_im, x_46_re) ^ 2.0) ^ Float64(y_46_re * 0.5); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= 0.5) tmp = 2.71828182845904523536 ^ (y_46_re * log(hypot(x_46_im, x_46_re))); else tmp = (hypot(x_46_im, x_46_re) ^ 2.0) ^ (y_46_re * 0.5); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, 0.5], N[Power[E, N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], 2.0], $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 0.5:\\
\;\;\;\;{e}^{\left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{2}\right)}^{\left(y.re \cdot 0.5\right)}\\
\end{array}
\end{array}
if y.im < 0.5Initial program 45.6%
cancel-sign-sub-inv45.6%
fma-define45.6%
hypot-define45.8%
distribute-lft-neg-in45.8%
distribute-rgt-neg-out45.8%
fma-define45.8%
hypot-define83.5%
*-commutative83.5%
Simplified83.5%
Taylor expanded in y.im around 0 59.0%
unpow259.0%
unpow259.0%
hypot-undefine71.0%
Simplified71.0%
Taylor expanded in y.re around 0 73.4%
*-un-lft-identity73.4%
pow-to-exp73.4%
hypot-undefine61.6%
+-commutative61.6%
*-un-lft-identity61.6%
exp-prod61.6%
*-commutative61.6%
+-commutative61.6%
hypot-undefine73.4%
Applied egg-rr73.4%
exp-1-e73.4%
Simplified73.4%
if 0.5 < y.im Initial program 41.8%
cancel-sign-sub-inv41.8%
fma-define41.8%
hypot-define41.8%
distribute-lft-neg-in41.8%
distribute-rgt-neg-out41.8%
fma-define41.8%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 45.6%
unpow245.6%
unpow245.6%
hypot-undefine37.5%
Simplified37.5%
Taylor expanded in y.re around 0 37.5%
hypot-undefine45.6%
+-commutative45.6%
*-un-lft-identity45.6%
sqrt-pow245.6%
add-sqr-sqrt45.6%
pow245.6%
+-commutative45.6%
hypot-undefine45.6%
div-inv45.6%
metadata-eval45.6%
Applied egg-rr45.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow E (* y.re (log (hypot x.im x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(((double) M_E), (y_46_re * log(hypot(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.E, (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re))));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.e, (y_46_re * math.log(math.hypot(x_46_im, x_46_re))))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return exp(1) ^ Float64(y_46_re * log(hypot(x_46_im, x_46_re))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 2.71828182845904523536 ^ (y_46_re * log(hypot(x_46_im, x_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[E, N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
{e}^{\left(y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 55.3%
unpow255.3%
unpow255.3%
hypot-undefine61.9%
Simplified61.9%
Taylor expanded in y.re around 0 63.6%
*-un-lft-identity63.6%
pow-to-exp63.6%
hypot-undefine57.2%
+-commutative57.2%
*-un-lft-identity57.2%
exp-prod57.2%
*-commutative57.2%
+-commutative57.2%
hypot-undefine63.6%
Applied egg-rr63.6%
exp-1-e63.6%
Simplified63.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (exp (* y.re (log (hypot 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_re * log(hypot(x_46_im, x_46_re))));
}
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(Math.hypot(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_re * math.log(math.hypot(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_re * log(hypot(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_re * log(hypot(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$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 55.3%
unpow255.3%
unpow255.3%
hypot-undefine61.9%
Simplified61.9%
Taylor expanded in y.re around 0 63.6%
*-un-lft-identity63.6%
pow-to-exp63.6%
hypot-undefine57.2%
+-commutative57.2%
*-commutative57.2%
+-commutative57.2%
hypot-undefine63.6%
Applied egg-rr63.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 55.3%
unpow255.3%
unpow255.3%
hypot-undefine61.9%
Simplified61.9%
Taylor expanded in y.re around 0 63.6%
Final simplification63.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.95) (not (<= y.re 0.000104))) (pow x.re y.re) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.95) || !(y_46_re <= 0.000104)) {
tmp = pow(x_46_re, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.95d0)) .or. (.not. (y_46re <= 0.000104d0))) then
tmp = x_46re ** y_46re
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.95) || !(y_46_re <= 0.000104)) {
tmp = Math.pow(x_46_re, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.95) or not (y_46_re <= 0.000104): tmp = math.pow(x_46_re, y_46_re) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.95) || !(y_46_re <= 0.000104)) tmp = x_46_re ^ y_46_re; else tmp = 1.0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.95) || ~((y_46_re <= 0.000104))) tmp = x_46_re ^ y_46_re; else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.95], N[Not[LessEqual[y$46$re, 0.000104]], $MachinePrecision]], N[Power[x$46$re, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.95 \lor \neg \left(y.re \leq 0.000104\right):\\
\;\;\;\;{x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -1.94999999999999996 or 1.03999999999999994e-4 < y.re Initial program 42.5%
cancel-sign-sub-inv42.5%
fma-define42.5%
hypot-define42.5%
distribute-lft-neg-in42.5%
distribute-rgt-neg-out42.5%
fma-define42.5%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.im around 0 71.0%
unpow271.0%
unpow271.0%
hypot-undefine71.0%
Simplified71.0%
Taylor expanded in y.re around 0 74.9%
Taylor expanded in x.im around 0 58.7%
if -1.94999999999999996 < y.re < 1.03999999999999994e-4Initial program 46.5%
cancel-sign-sub-inv46.5%
fma-define46.5%
hypot-define46.9%
distribute-lft-neg-in46.9%
distribute-rgt-neg-out46.9%
fma-define46.9%
hypot-define85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in y.im around 0 40.0%
unpow240.0%
unpow240.0%
hypot-undefine52.9%
Simplified52.9%
Taylor expanded in y.re around 0 52.4%
Taylor expanded in x.re around 0 27.8%
Taylor expanded in y.re around 0 52.1%
Final simplification55.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -54000000000000.0) (not (<= y.re 1.85))) (pow x.im y.re) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -54000000000000.0) || !(y_46_re <= 1.85)) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-54000000000000.0d0)) .or. (.not. (y_46re <= 1.85d0))) then
tmp = x_46im ** y_46re
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -54000000000000.0) || !(y_46_re <= 1.85)) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -54000000000000.0) or not (y_46_re <= 1.85): tmp = math.pow(x_46_im, y_46_re) else: tmp = 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -54000000000000.0) || !(y_46_re <= 1.85)) tmp = x_46_im ^ y_46_re; else tmp = 1.0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -54000000000000.0) || ~((y_46_re <= 1.85))) tmp = x_46_im ^ y_46_re; else tmp = 1.0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -54000000000000.0], N[Not[LessEqual[y$46$re, 1.85]], $MachinePrecision]], N[Power[x$46$im, y$46$re], $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -54000000000000 \lor \neg \left(y.re \leq 1.85\right):\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y.re < -5.4e13 or 1.8500000000000001 < y.re Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-define42.4%
hypot-define42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around 0 70.5%
unpow270.5%
unpow270.5%
hypot-undefine70.5%
Simplified70.5%
Taylor expanded in y.re around 0 74.5%
Taylor expanded in x.re around 0 54.1%
if -5.4e13 < y.re < 1.8500000000000001Initial program 46.6%
cancel-sign-sub-inv46.6%
fma-define46.6%
hypot-define46.9%
distribute-lft-neg-in46.9%
distribute-rgt-neg-out46.9%
fma-define46.9%
hypot-define85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in y.im around 0 40.9%
unpow240.9%
unpow240.9%
hypot-undefine53.6%
Simplified53.6%
Taylor expanded in y.re around 0 53.1%
Taylor expanded in x.re around 0 27.4%
Taylor expanded in y.re around 0 51.3%
Final simplification52.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= x.re -2.5e-63) (pow (- x.re) y.re) (if (<= x.re 8.5e-147) (pow x.im y.re) (pow x.re y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.5e-63) {
tmp = pow(-x_46_re, y_46_re);
} else if (x_46_re <= 8.5e-147) {
tmp = pow(x_46_im, y_46_re);
} else {
tmp = pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (x_46re <= (-2.5d-63)) then
tmp = -x_46re ** y_46re
else if (x_46re <= 8.5d-147) then
tmp = x_46im ** y_46re
else
tmp = x_46re ** y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (x_46_re <= -2.5e-63) {
tmp = Math.pow(-x_46_re, y_46_re);
} else if (x_46_re <= 8.5e-147) {
tmp = Math.pow(x_46_im, y_46_re);
} else {
tmp = Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if x_46_re <= -2.5e-63: tmp = math.pow(-x_46_re, y_46_re) elif x_46_re <= 8.5e-147: tmp = math.pow(x_46_im, y_46_re) else: tmp = math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (x_46_re <= -2.5e-63) tmp = Float64(-x_46_re) ^ y_46_re; elseif (x_46_re <= 8.5e-147) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (x_46_re <= -2.5e-63) tmp = -x_46_re ^ y_46_re; elseif (x_46_re <= 8.5e-147) tmp = x_46_im ^ y_46_re; else tmp = x_46_re ^ y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[x$46$re, -2.5e-63], N[Power[(-x$46$re), y$46$re], $MachinePrecision], If[LessEqual[x$46$re, 8.5e-147], N[Power[x$46$im, y$46$re], $MachinePrecision], N[Power[x$46$re, y$46$re], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.5 \cdot 10^{-63}:\\
\;\;\;\;{\left(-x.re\right)}^{y.re}\\
\mathbf{elif}\;x.re \leq 8.5 \cdot 10^{-147}:\\
\;\;\;\;{x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < -2.5000000000000001e-63Initial program 43.0%
cancel-sign-sub-inv43.0%
fma-define43.0%
hypot-define43.0%
distribute-lft-neg-in43.0%
distribute-rgt-neg-out43.0%
fma-define43.0%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in y.im around 0 52.0%
unpow252.0%
unpow252.0%
hypot-undefine57.7%
Simplified57.7%
Taylor expanded in y.re around 0 57.7%
Taylor expanded in x.re around -inf 56.6%
mul-1-neg56.6%
Simplified56.6%
if -2.5000000000000001e-63 < x.re < 8.5000000000000002e-147Initial program 49.4%
cancel-sign-sub-inv49.4%
fma-define49.4%
hypot-define50.0%
distribute-lft-neg-in50.0%
distribute-rgt-neg-out50.0%
fma-define50.0%
hypot-define80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in y.im around 0 61.7%
unpow261.7%
unpow261.7%
hypot-undefine64.8%
Simplified64.8%
Taylor expanded in y.re around 0 67.9%
Taylor expanded in x.re around 0 59.4%
if 8.5000000000000002e-147 < x.re Initial program 42.0%
cancel-sign-sub-inv42.0%
fma-define42.0%
hypot-define42.0%
distribute-lft-neg-in42.0%
distribute-rgt-neg-out42.0%
fma-define42.0%
hypot-define82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in y.im around 0 53.3%
unpow253.3%
unpow253.3%
hypot-undefine63.3%
Simplified63.3%
Taylor expanded in y.re around 0 65.4%
Taylor expanded in x.im around 0 61.2%
Final simplification59.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 1.0)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 1.0 end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 44.5%
cancel-sign-sub-inv44.5%
fma-define44.5%
hypot-define44.7%
distribute-lft-neg-in44.7%
distribute-rgt-neg-out44.7%
fma-define44.7%
hypot-define81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in y.im around 0 55.3%
unpow255.3%
unpow255.3%
hypot-undefine61.9%
Simplified61.9%
Taylor expanded in y.re around 0 63.6%
Taylor expanded in x.re around 0 40.4%
Taylor expanded in y.re around 0 27.6%
herbie shell --seed 2024113
(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)))))