
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0)))
(t_2 (log (hypot x.re x.im))))
(if (<= y.re -1150000.0)
(* t_1 (cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_2 y.re))))))
(if (<= y.re 5.3e-17)
(*
(/ 1.0 (exp t_0))
(cos (pow (cbrt (fma y.re (atan2 x.im x.re) (* t_2 y.im))) 3.0)))
(* 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 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_2 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -1150000.0) {
tmp = t_1 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_2 / y_46_re)))));
} else if (y_46_re <= 5.3e-17) {
tmp = (1.0 / exp(t_0)) * cos(pow(cbrt(fma(y_46_re, atan2(x_46_im, x_46_re), (t_2 * y_46_im))), 3.0));
} else {
tmp = 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 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -1150000.0) tmp = Float64(t_1 * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_2 / y_46_re)))))); elseif (y_46_re <= 5.3e-17) tmp = Float64(Float64(1.0 / exp(t_0)) * cos((cbrt(fma(y_46_re, atan(x_46_im, x_46_re), Float64(t_2 * y_46_im))) ^ 3.0))); else tmp = Float64(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(y$46$re * N[Log[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$0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1150000.0], N[(t$95$1 * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$2 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.3e-17], N[(N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(t$95$2 * y$46$im), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -1150000:\\
\;\;\;\;t\_1 \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_2}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 5.3 \cdot 10^{-17}:\\
\;\;\;\;\frac{1}{e^{t\_0}} \cdot \cos \left({\left(\sqrt[3]{\mathsf{fma}\left(y.re, \tan^{-1}_* \frac{x.im}{x.re}, t\_2 \cdot y.im\right)}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;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 < -1.15e6Initial program 37.7%
expm1-log1p-u31.1%
expm1-undefine31.1%
*-commutative31.1%
hypot-define67.2%
Applied egg-rr67.2%
expm1-define67.2%
*-commutative67.2%
hypot-undefine31.1%
unpow231.1%
unpow231.1%
+-commutative31.1%
unpow231.1%
unpow231.1%
hypot-undefine67.2%
Simplified67.2%
Taylor expanded in y.re around inf 37.7%
+-commutative37.7%
associate-/l*37.7%
+-commutative37.7%
unpow237.7%
unpow237.7%
hypot-undefine83.7%
Simplified83.7%
if -1.15e6 < y.re < 5.2999999999999998e-17Initial program 47.7%
exp-diff47.7%
exp-to-pow47.7%
hypot-define47.7%
*-commutative47.7%
exp-prod47.4%
fma-define47.4%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
add-cube-cbrt87.8%
pow388.4%
hypot-define49.8%
*-commutative49.8%
fma-define49.8%
+-commutative49.8%
*-commutative49.8%
fma-define49.8%
*-commutative49.8%
hypot-define88.4%
Applied egg-rr88.4%
Taylor expanded in y.re around 0 88.3%
if 5.2999999999999998e-17 < y.re Initial program 41.7%
Taylor expanded in y.re around 0 45.0%
*-commutative45.0%
unpow245.0%
unpow245.0%
hypot-undefine72.4%
Simplified72.4%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(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)))))))
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));
return 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))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return 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))))) 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]}, 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]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
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)
\end{array}
\end{array}
Initial program 43.9%
cancel-sign-sub-inv43.9%
fma-define43.9%
hypot-define43.9%
distribute-lft-neg-in43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(t_1 (log (hypot x.re x.im))))
(if (<= y.re -1150000.0)
(* t_0 (cos (* y.re (+ (atan2 x.im x.re) (* y.im (/ t_1 y.re))))))
(if (<= y.re 8.5e-17)
(*
(cos (fma t_1 y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_0 (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 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -1150000.0) {
tmp = t_0 * cos((y_46_re * (atan2(x_46_im, x_46_re) + (y_46_im * (t_1 / y_46_re)))));
} else if (y_46_re <= 8.5e-17) {
tmp = cos(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * 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 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -1150000.0) tmp = Float64(t_0 * cos(Float64(y_46_re * Float64(atan(x_46_im, x_46_re) + Float64(y_46_im * Float64(t_1 / y_46_re)))))); elseif (y_46_re <= 8.5e-17) tmp = Float64(cos(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_0 * 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[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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1150000.0], N[(t$95$0 * N[Cos[N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + N[(y$46$im * N[(t$95$1 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.5e-17], N[(N[Cos[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -1150000:\\
\;\;\;\;t\_0 \cdot \cos \left(y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \frac{t\_1}{y.re}\right)\right)\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{-17}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \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 < -1.15e6Initial program 37.7%
expm1-log1p-u31.1%
expm1-undefine31.1%
*-commutative31.1%
hypot-define67.2%
Applied egg-rr67.2%
expm1-define67.2%
*-commutative67.2%
hypot-undefine31.1%
unpow231.1%
unpow231.1%
+-commutative31.1%
unpow231.1%
unpow231.1%
hypot-undefine67.2%
Simplified67.2%
Taylor expanded in y.re around inf 37.7%
+-commutative37.7%
associate-/l*37.7%
+-commutative37.7%
unpow237.7%
unpow237.7%
hypot-undefine83.7%
Simplified83.7%
if -1.15e6 < y.re < 8.5e-17Initial program 47.7%
cancel-sign-sub-inv47.7%
fma-define47.7%
hypot-define47.7%
distribute-lft-neg-in47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
if 8.5e-17 < y.re Initial program 41.7%
Taylor expanded in y.re around 0 45.0%
*-commutative45.0%
unpow245.0%
unpow245.0%
hypot-undefine72.4%
Simplified72.4%
Final simplification81.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1150000.0) (not (<= y.re 8.5e-17)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cos (* y.im (log (hypot x.im x.re)))))
(*
(cos (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1150000.0) || !(y_46_re <= 8.5e-17)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_im * log(hypot(x_46_im, x_46_re))));
} else {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1150000.0) || !(y_46_re <= 8.5e-17)) 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))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1150000.0], N[Not[LessEqual[y$46$re, 8.5e-17]], $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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1150000 \lor \neg \left(y.re \leq 8.5 \cdot 10^{-17}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.15e6 or 8.5e-17 < y.re Initial program 39.7%
Taylor expanded in y.re around 0 39.7%
*-commutative39.7%
unpow239.7%
unpow239.7%
hypot-undefine77.2%
Simplified77.2%
if -1.15e6 < y.re < 8.5e-17Initial program 47.7%
cancel-sign-sub-inv47.7%
fma-define47.7%
hypot-define47.7%
distribute-lft-neg-in47.7%
distribute-rgt-neg-out47.7%
fma-define47.7%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in y.re around 0 85.2%
neg-mul-185.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1e-7)
(*
(cos (fma (log (hypot x.re x.im)) y.im t_0))
(pow (hypot x.im x.re) y.re))
(if (<= y.re 2.7e-8)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(cos t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1e-7) {
tmp = cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 2.7e-8) {
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 = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1e-7) tmp = Float64(cos(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 2.7e-8) 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 = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e-7], N[(N[Cos[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.7e-8], 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], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{-7}:\\
\;\;\;\;\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-8}:\\
\;\;\;\;\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}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos t\_0\\
\end{array}
\end{array}
if y.re < -9.9999999999999995e-8Initial 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-define84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in y.im around 0 78.3%
unpow278.3%
unpow278.3%
hypot-undefine79.8%
Simplified79.8%
if -9.9999999999999995e-8 < y.re < 2.70000000000000002e-8Initial program 48.0%
cancel-sign-sub-inv48.0%
fma-define48.0%
hypot-define48.0%
distribute-lft-neg-in48.0%
distribute-rgt-neg-out48.0%
fma-define48.0%
hypot-define85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine85.6%
neg-mul-185.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
if 2.70000000000000002e-8 < y.re Initial program 39.8%
exp-diff36.5%
exp-to-pow36.7%
hypot-define36.7%
*-commutative36.7%
exp-prod36.7%
fma-define36.7%
hypot-define58.4%
*-commutative58.4%
Simplified58.4%
add-cube-cbrt51.7%
pow350.1%
hypot-define35.0%
*-commutative35.0%
fma-define35.0%
+-commutative35.0%
*-commutative35.0%
fma-define35.0%
*-commutative35.0%
hypot-define50.1%
Applied egg-rr50.1%
Taylor expanded in y.im around 0 51.7%
Taylor expanded in y.im around 0 48.4%
Taylor expanded in y.im around 0 63.5%
+-commutative63.5%
Simplified63.5%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3e-9) (not (<= y.re 2.6e-9)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))
(cos (* y.re (atan2 x.im x.re))))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3e-9) || !(y_46_re <= 2.6e-9)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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_re <= -3e-9) || !(y_46_re <= 2.6e-9)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos((y_46_re * 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)))) * 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_re <= -3e-9) or not (y_46_re <= 2.6e-9): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos((y_46_re * 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)))) * 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_re <= -3e-9) || !(y_46_re <= 2.6e-9)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(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)))); 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 <= -3e-9) || ~((y_46_re <= 2.6e-9))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im))) * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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[Or[LessEqual[y$46$re, -3e-9], N[Not[LessEqual[y$46$re, 2.6e-9]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3 \cdot 10^{-9} \lor \neg \left(y.re \leq 2.6 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -2.99999999999999998e-9 or 2.6000000000000001e-9 < y.re Initial program 39.4%
exp-diff32.2%
exp-to-pow32.3%
hypot-define32.3%
*-commutative32.3%
exp-prod32.3%
fma-define32.3%
hypot-define62.9%
*-commutative62.9%
Simplified62.9%
add-cube-cbrt60.5%
pow358.9%
hypot-define31.5%
*-commutative31.5%
fma-define31.5%
+-commutative31.5%
*-commutative31.5%
fma-define31.5%
*-commutative31.5%
hypot-define58.9%
Applied egg-rr58.9%
Taylor expanded in y.im around 0 58.5%
Taylor expanded in y.im around 0 57.8%
Taylor expanded in y.im around 0 71.6%
+-commutative71.6%
Simplified71.6%
if -2.99999999999999998e-9 < y.re < 2.6000000000000001e-9Initial program 48.0%
cancel-sign-sub-inv48.0%
fma-define48.0%
hypot-define48.0%
distribute-lft-neg-in48.0%
distribute-rgt-neg-out48.0%
fma-define48.0%
hypot-define85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine85.6%
neg-mul-185.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
Final simplification78.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -6.2e-11) (not (<= y.re 3.2e-8)))
(* (pow (hypot x.im x.re) y.re) (cos (* y.re (atan2 x.im x.re))))
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6.2e-11) || !(y_46_re <= 3.2e-8)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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_re <= -6.2e-11) || !(y_46_re <= 3.2e-8)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * 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)))) * 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_re <= -6.2e-11) or not (y_46_re <= 3.2e-8): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * 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)))) * 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_re <= -6.2e-11) || !(y_46_re <= 3.2e-8)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); else 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)))); 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 <= -6.2e-11) || ~((y_46_re <= 3.2e-8))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re))); else tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * 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[Or[LessEqual[y$46$re, -6.2e-11], N[Not[LessEqual[y$46$re, 3.2e-8]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * 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] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-11} \lor \neg \left(y.re \leq 3.2 \cdot 10^{-8}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\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)}\\
\end{array}
\end{array}
if y.re < -6.20000000000000056e-11 or 3.2000000000000002e-8 < y.re Initial program 39.4%
cancel-sign-sub-inv39.4%
fma-define39.4%
hypot-define39.4%
distribute-lft-neg-in39.4%
distribute-rgt-neg-out39.4%
fma-define39.4%
hypot-define76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.im around 0 66.3%
unpow266.3%
unpow266.3%
hypot-undefine66.7%
Simplified66.7%
if -6.20000000000000056e-11 < y.re < 3.2000000000000002e-8Initial program 48.0%
cancel-sign-sub-inv48.0%
fma-define48.0%
hypot-define48.0%
distribute-lft-neg-in48.0%
distribute-rgt-neg-out48.0%
fma-define48.0%
hypot-define85.7%
*-commutative85.7%
Simplified85.7%
Taylor expanded in y.re around 0 47.9%
*-commutative47.9%
unpow247.9%
unpow247.9%
hypot-undefine85.6%
neg-mul-185.6%
distribute-rgt-neg-in85.6%
Simplified85.6%
Final simplification76.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.2e+17) (not (<= y.im 1600000000000.0))) (pow (exp y.im) (- (atan2 x.im x.re))) (* (pow (hypot x.im x.re) y.re) (cos (* y.re (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.2e+17) || !(y_46_im <= 1600000000000.0)) {
tmp = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.2e+17) || !(y_46_im <= 1600000000000.0)) {
tmp = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.2e+17) or not (y_46_im <= 1600000000000.0): tmp = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) else: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.2e+17) || !(y_46_im <= 1600000000000.0)) tmp = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.2e+17) || ~((y_46_im <= 1600000000000.0))) tmp = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); else tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * cos((y_46_re * atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.2e+17], N[Not[LessEqual[y$46$im, 1600000000000.0]], $MachinePrecision]], N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+17} \lor \neg \left(y.im \leq 1600000000000\right):\\
\;\;\;\;{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\end{array}
\end{array}
if y.im < -1.2e17 or 1.6e12 < y.im Initial program 34.4%
exp-diff28.0%
exp-to-pow28.0%
hypot-define28.0%
*-commutative28.0%
exp-prod28.0%
fma-define28.0%
hypot-define61.4%
*-commutative61.4%
Simplified61.4%
add-cube-cbrt60.7%
pow361.4%
hypot-define30.6%
*-commutative30.6%
fma-define30.6%
+-commutative30.6%
*-commutative30.6%
fma-define30.6%
*-commutative30.6%
hypot-define61.4%
Applied egg-rr61.4%
Taylor expanded in y.im around 0 56.1%
Taylor expanded in y.re around 0 62.0%
rec-exp62.0%
distribute-rgt-neg-in62.0%
mul-1-neg62.0%
exp-prod62.7%
mul-1-neg62.7%
Simplified62.7%
if -1.2e17 < y.im < 1.6e12Initial program 52.8%
cancel-sign-sub-inv52.8%
fma-define52.8%
hypot-define52.8%
distribute-lft-neg-in52.8%
distribute-rgt-neg-out52.8%
fma-define52.8%
hypot-define89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y.im around 0 70.1%
unpow270.1%
unpow270.1%
hypot-undefine86.7%
Simplified86.7%
Final simplification75.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4.8e+100) (not (<= y.re 24.5))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (exp (* (atan2 x.im x.re) (- y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -4.8e+100) || !(y_46_re <= 24.5)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_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 ((y_46re <= (-4.8d+100)) .or. (.not. (y_46re <= 24.5d0))) then
tmp = cos((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
else
tmp = exp((atan2(x_46im, x_46re) * -y_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 ((y_46_re <= -4.8e+100) || !(y_46_re <= 24.5)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 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_re <= -4.8e+100) or not (y_46_re <= 24.5): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 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_re <= -4.8e+100) || !(y_46_re <= 24.5)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -4.8e+100) || ~((y_46_re <= 24.5))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 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[Or[LessEqual[y$46$re, -4.8e+100], N[Not[LessEqual[y$46$re, 24.5]], $MachinePrecision]], N[(N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{+100} \lor \neg \left(y.re \leq 24.5\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.80000000000000023e100 or 24.5 < y.re Initial program 37.6%
cancel-sign-sub-inv37.6%
fma-define37.6%
hypot-define37.6%
distribute-lft-neg-in37.6%
distribute-rgt-neg-out37.6%
fma-define37.6%
hypot-define78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in y.im around 0 68.9%
unpow268.9%
unpow268.9%
hypot-undefine68.9%
Simplified68.9%
Taylor expanded in x.re around 0 54.2%
if -4.80000000000000023e100 < y.re < 24.5Initial program 47.4%
exp-diff46.2%
exp-to-pow46.2%
hypot-define46.2%
*-commutative46.2%
exp-prod46.1%
fma-define46.1%
hypot-define80.8%
*-commutative80.8%
Simplified80.8%
add-cube-cbrt83.9%
pow383.8%
hypot-define48.0%
*-commutative48.0%
fma-define48.0%
+-commutative48.0%
*-commutative48.0%
fma-define48.0%
*-commutative48.0%
hypot-define83.8%
Applied egg-rr83.8%
Taylor expanded in y.im around 0 77.1%
Taylor expanded in y.re around 0 72.7%
rec-exp72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
Final simplification66.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.re -1.65e+101)
(* t_0 (pow x.im y.re))
(if (<= y.re 3.7e-8)
(exp (* (atan2 x.im x.re) (- y.im)))
(* t_0 (pow x.re y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.65e+101) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else if (y_46_re <= 3.7e-8) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * 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) :: t_0
real(8) :: tmp
t_0 = cos((y_46re * atan2(x_46im, x_46re)))
if (y_46re <= (-1.65d+101)) then
tmp = t_0 * (x_46im ** y_46re)
else if (y_46re <= 3.7d-8) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im))
else
tmp = t_0 * (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 t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -1.65e+101) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 3.7e-8) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_re <= -1.65e+101: tmp = t_0 * math.pow(x_46_im, y_46_re) elif y_46_re <= 3.7e-8: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1.65e+101) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); elseif (y_46_re <= 3.7e-8) tmp = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))); else tmp = Float64(t_0 * (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) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -1.65e+101) tmp = t_0 * (x_46_im ^ y_46_re); elseif (y_46_re <= 3.7e-8) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.65e+101], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.7e-8], N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+101}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{-8}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.65000000000000006e101Initial program 36.8%
cancel-sign-sub-inv36.8%
fma-define36.8%
hypot-define36.8%
distribute-lft-neg-in36.8%
distribute-rgt-neg-out36.8%
fma-define36.8%
hypot-define92.1%
*-commutative92.1%
Simplified92.1%
Taylor expanded in y.im around 0 89.6%
unpow289.6%
unpow289.6%
hypot-undefine89.6%
Simplified89.6%
Taylor expanded in x.re around 0 71.4%
if -1.65000000000000006e101 < y.re < 3.7e-8Initial program 47.1%
exp-diff45.8%
exp-to-pow45.8%
hypot-define45.8%
*-commutative45.8%
exp-prod45.6%
fma-define45.6%
hypot-define81.4%
*-commutative81.4%
Simplified81.4%
add-cube-cbrt84.0%
pow383.9%
hypot-define47.6%
*-commutative47.6%
fma-define47.6%
+-commutative47.6%
*-commutative47.6%
fma-define47.6%
*-commutative47.6%
hypot-define83.9%
Applied egg-rr83.9%
Taylor expanded in y.im around 0 77.6%
Taylor expanded in y.re around 0 74.5%
rec-exp74.5%
distribute-rgt-neg-in74.5%
Simplified74.5%
if 3.7e-8 < y.re Initial program 39.8%
cancel-sign-sub-inv39.8%
fma-define39.8%
hypot-define39.8%
distribute-lft-neg-in39.8%
distribute-rgt-neg-out39.8%
fma-define39.8%
hypot-define68.1%
*-commutative68.1%
Simplified68.1%
Taylor expanded in y.im around 0 55.1%
unpow255.1%
unpow255.1%
hypot-undefine55.1%
Simplified55.1%
Taylor expanded in x.im around 0 48.8%
Final simplification68.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (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) {
return pow(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.pow(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.pow(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(y_46_im) ^ Float64(-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[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]
\begin{array}{l}
\\
{\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}
\end{array}
Initial program 43.9%
exp-diff40.3%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.3%
fma-define40.3%
hypot-define74.5%
*-commutative74.5%
Simplified74.5%
add-cube-cbrt74.5%
pow374.1%
hypot-define41.1%
*-commutative41.1%
fma-define41.1%
+-commutative41.1%
*-commutative41.1%
fma-define41.1%
*-commutative41.1%
hypot-define74.1%
Applied egg-rr74.1%
Taylor expanded in y.im around 0 70.5%
Taylor expanded in y.re around 0 54.3%
rec-exp54.3%
distribute-rgt-neg-in54.3%
mul-1-neg54.3%
exp-prod54.6%
mul-1-neg54.6%
Simplified54.6%
(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 43.9%
exp-diff40.3%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.3%
fma-define40.3%
hypot-define74.5%
*-commutative74.5%
Simplified74.5%
add-cube-cbrt74.5%
pow374.1%
hypot-define41.1%
*-commutative41.1%
fma-define41.1%
+-commutative41.1%
*-commutative41.1%
fma-define41.1%
*-commutative41.1%
hypot-define74.1%
Applied egg-rr74.1%
Taylor expanded in y.im around 0 70.5%
Taylor expanded in y.re around 0 54.3%
rec-exp54.3%
distribute-rgt-neg-in54.3%
Simplified54.3%
Final simplification54.3%
(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) * 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 y.im}
\end{array}
Initial program 43.9%
exp-diff40.3%
exp-to-pow40.4%
hypot-define40.4%
*-commutative40.4%
exp-prod40.3%
fma-define40.3%
hypot-define74.5%
*-commutative74.5%
Simplified74.5%
add-cube-cbrt74.5%
pow374.1%
hypot-define41.1%
*-commutative41.1%
fma-define41.1%
+-commutative41.1%
*-commutative41.1%
fma-define41.1%
*-commutative41.1%
hypot-define74.1%
Applied egg-rr74.1%
Taylor expanded in y.im around 0 70.5%
div-inv70.5%
pow-to-exp70.5%
hypot-define56.6%
pow-exp56.8%
*-commutative56.8%
rec-exp56.8%
distribute-rgt-neg-out56.8%
exp-sum62.0%
*-commutative62.0%
hypot-define76.9%
fma-define76.9%
*-commutative76.9%
Applied egg-rr52.0%
Taylor expanded in y.re around 0 29.1%
Final simplification29.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 43.9%
cancel-sign-sub-inv43.9%
fma-define43.9%
hypot-define43.9%
distribute-lft-neg-in43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define81.3%
*-commutative81.3%
Simplified81.3%
Taylor expanded in y.im around 0 52.2%
unpow252.2%
unpow252.2%
hypot-undefine56.5%
Simplified56.5%
Taylor expanded in y.re around 0 25.7%
herbie shell --seed 2024136
(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)))))