
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t\_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (cos t_1))
(t_3 (log (hypot x.re x.im)))
(t_4 (* y.im (atan2 x.im x.re)))
(t_5
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_4))))
(if (<= y.im -4000.0)
(*
(exp (fma t_3 y.re (* y.im (- (atan2 x.im x.re)))))
(cos (fma t_3 y.im t_1)))
(if (<= y.im 2.9e-34)
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_4))
(fabs (cos (* y.im t_0))))
(if (<= y.im 2e+59)
(*
t_5
(+
t_2
(*
y.im
(- (* (* y.im -0.5) (* t_2 (pow t_0 2.0))) (* t_0 (sin t_1))))))
(* t_5 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = cos(t_1);
double t_3 = log(hypot(x_46_re, x_46_im));
double t_4 = y_46_im * atan2(x_46_im, x_46_re);
double t_5 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_4));
double tmp;
if (y_46_im <= -4000.0) {
tmp = exp(fma(t_3, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * cos(fma(t_3, y_46_im, t_1));
} else if (y_46_im <= 2.9e-34) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_4)) * fabs(cos((y_46_im * t_0)));
} else if (y_46_im <= 2e+59) {
tmp = t_5 * (t_2 + (y_46_im * (((y_46_im * -0.5) * (t_2 * pow(t_0, 2.0))) - (t_0 * sin(t_1)))));
} else {
tmp = t_5 * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = cos(t_1) t_3 = log(hypot(x_46_re, x_46_im)) t_4 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_5 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_4)) tmp = 0.0 if (y_46_im <= -4000.0) tmp = Float64(exp(fma(t_3, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * cos(fma(t_3, y_46_im, t_1))); elseif (y_46_im <= 2.9e-34) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_4)) * abs(cos(Float64(y_46_im * t_0)))); elseif (y_46_im <= 2e+59) tmp = Float64(t_5 * Float64(t_2 + Float64(y_46_im * Float64(Float64(Float64(y_46_im * -0.5) * Float64(t_2 * (t_0 ^ 2.0))) - Float64(t_0 * sin(t_1)))))); else tmp = Float64(t_5 * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = 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$4), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4000.0], N[(N[Exp[N[(t$95$3 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$3 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.9e-34], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$4), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e+59], N[(t$95$5 * N[(t$95$2 + N[(y$46$im * N[(N[(N[(y$46$im * -0.5), $MachinePrecision] * N[(t$95$2 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$5 * t$95$2), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \cos t\_1\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_5 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_4}\\
\mathbf{if}\;y.im \leq -4000:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_3, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_3, y.im, t\_1\right)\right)\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-34}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_4} \cdot \left|\cos \left(y.im \cdot t\_0\right)\right|\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+59}:\\
\;\;\;\;t\_5 \cdot \left(t\_2 + y.im \cdot \left(\left(y.im \cdot -0.5\right) \cdot \left(t\_2 \cdot {t\_0}^{2}\right) - t\_0 \cdot \sin t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_5 \cdot t\_2\\
\end{array}
\end{array}
if y.im < -4e3Initial program 37.2%
cancel-sign-sub-inv37.2%
fma-define37.2%
hypot-define37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-out37.2%
fma-define37.2%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
if -4e3 < y.im < 2.9000000000000002e-34Initial program 42.5%
exp-diff42.5%
exp-to-pow42.5%
hypot-define42.5%
*-commutative42.5%
exp-prod42.5%
fma-define42.5%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 89.2%
add-sqr-sqrt78.3%
sqrt-unprod95.8%
pow295.8%
hypot-undefine47.5%
+-commutative47.5%
hypot-undefine95.8%
Applied egg-rr95.8%
unpow295.8%
rem-sqrt-square95.8%
fma-undefine95.8%
*-commutative95.8%
+-commutative95.8%
fma-define95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in y.re around 0 48.3%
unpow248.3%
unpow248.3%
hypot-undefine96.6%
Simplified96.6%
if 2.9000000000000002e-34 < y.im < 1.99999999999999994e59Initial program 64.7%
Taylor expanded in y.im around 0 70.6%
associate-*r*70.6%
*-commutative70.6%
unpow270.6%
unpow270.6%
hypot-undefine70.6%
Simplified100.0%
if 1.99999999999999994e59 < y.im Initial program 33.5%
Taylor expanded in y.im around 0 71.9%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (* y.im (atan2 x.im x.re))))
(if (<= y.im -4000.0)
(*
(exp (fma t_1 y.re (* y.im (- (atan2 x.im x.re)))))
(cos (fma t_1 y.im t_0)))
(if (<= y.im 2.9e-34)
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_2))
(fabs (cos (* y.im (log (hypot x.im x.re))))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_2))
(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 t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = y_46_im * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -4000.0) {
tmp = exp(fma(t_1, y_46_re, (y_46_im * -atan2(x_46_im, x_46_re)))) * cos(fma(t_1, y_46_im, t_0));
} else if (y_46_im <= 2.9e-34) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_2)) * fabs(cos((y_46_im * log(hypot(x_46_im, x_46_re)))));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_2)) * 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)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(y_46_im * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -4000.0) tmp = Float64(exp(fma(t_1, y_46_re, Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))) * cos(fma(t_1, y_46_im, t_0))); elseif (y_46_im <= 2.9e-34) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_2)) * abs(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_2)) * 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]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4000.0], N[(N[Exp[N[(t$95$1 * y$46$re + N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.9e-34], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision] * N[Abs[N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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$2), $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}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -4000:\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \cdot \cos \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right)\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-34}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_2} \cdot \left|\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\right|\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_2} \cdot \cos t\_0\\
\end{array}
\end{array}
if y.im < -4e3Initial program 37.2%
cancel-sign-sub-inv37.2%
fma-define37.2%
hypot-define37.2%
distribute-lft-neg-in37.2%
distribute-rgt-neg-out37.2%
fma-define37.2%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
if -4e3 < y.im < 2.9000000000000002e-34Initial program 42.5%
exp-diff42.5%
exp-to-pow42.5%
hypot-define42.5%
*-commutative42.5%
exp-prod42.5%
fma-define42.5%
hypot-define88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in y.im around 0 89.2%
add-sqr-sqrt78.3%
sqrt-unprod95.8%
pow295.8%
hypot-undefine47.5%
+-commutative47.5%
hypot-undefine95.8%
Applied egg-rr95.8%
unpow295.8%
rem-sqrt-square95.8%
fma-undefine95.8%
*-commutative95.8%
+-commutative95.8%
fma-define95.8%
*-commutative95.8%
Simplified95.8%
Taylor expanded in y.re around 0 48.3%
unpow248.3%
unpow248.3%
hypot-undefine96.6%
Simplified96.6%
if 2.9000000000000002e-34 < y.im Initial program 41.5%
Taylor expanded in y.im around 0 71.6%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.im (log (hypot x.im x.re))))))
(if (or (<= y.re -5.2e-5) (not (<= y.re 3.55e+46)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
t_0)
(* t_0 (exp (* y.im (- (atan2 x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -5.2e-5) || !(y_46_re <= 3.55e+46)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -5.2e-5) || !(y_46_re <= 3.55e+46)) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_0 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if (y_46_re <= -5.2e-5) or not (y_46_re <= 3.55e+46): tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) * t_0 else: tmp = t_0 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_re <= -5.2e-5) || !(y_46_re <= 3.55e+46)) 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(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if ((y_46_re <= -5.2e-5) || ~((y_46_re <= 3.55e+46))) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0; else tmp = t_0 * exp((y_46_im * -atan2(x_46_im, x_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -5.2e-5], N[Not[LessEqual[y$46$re, 3.55e+46]], $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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -5.2 \cdot 10^{-5} \lor \neg \left(y.re \leq 3.55 \cdot 10^{+46}\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -5.19999999999999968e-5 or 3.55e46 < y.re Initial program 43.4%
Taylor expanded in y.re around 0 48.1%
*-commutative48.1%
unpow248.1%
unpow248.1%
hypot-undefine84.5%
Simplified84.5%
if -5.19999999999999968e-5 < y.re < 3.55e46Initial program 38.1%
cancel-sign-sub-inv38.1%
fma-define38.1%
hypot-define38.1%
distribute-lft-neg-in38.1%
distribute-rgt-neg-out38.1%
fma-define38.1%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.re around 0 37.8%
*-commutative37.8%
unpow237.8%
unpow237.8%
hypot-undefine78.2%
neg-mul-178.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
Final simplification81.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (cos (* y.im (log (hypot x.im x.re))))))
(if (<= y.re -1.25e-11)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(cos (* y.re (atan2 x.im x.re))))
(if (<= y.re 5.6e-12)
(* t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)) (fabs t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.25e-11) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.6e-12) {
tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * fabs(t_1);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1.25e-11) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 5.6e-12) {
tmp = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * Math.abs(t_1);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) tmp = 0 if y_46_re <= -1.25e-11: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) elif y_46_re <= 5.6e-12: tmp = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * math.fabs(t_1) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1.25e-11) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * cos(Float64(y_46_re * atan(x_46_im, x_46_re)))); elseif (y_46_re <= 5.6e-12) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) * abs(t_1)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = cos((y_46_im * log(hypot(x_46_im, x_46_re)))); tmp = 0.0; if (y_46_re <= -1.25e-11) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * cos((y_46_re * atan2(x_46_im, x_46_re))); elseif (y_46_re <= 5.6e-12) tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0)) * abs(t_1); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{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]}, If[LessEqual[y$46$re, -1.25e-11], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.6e-12], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $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 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{-11}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;y.re \leq 5.6 \cdot 10^{-12}:\\
\;\;\;\;t\_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0} \cdot \left|t\_1\right|\\
\end{array}
\end{array}
if y.re < -1.25000000000000005e-11Initial program 47.1%
Taylor expanded in y.im around 0 82.9%
if -1.25000000000000005e-11 < y.re < 5.6000000000000004e-12Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 39.9%
*-commutative39.9%
unpow239.9%
unpow239.9%
hypot-undefine80.9%
neg-mul-180.9%
distribute-rgt-neg-in80.9%
Simplified80.9%
if 5.6000000000000004e-12 < y.re Initial program 35.8%
exp-diff25.4%
exp-to-pow25.4%
hypot-define25.4%
*-commutative25.4%
exp-prod25.4%
fma-define25.4%
hypot-define49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in y.im around 0 65.8%
add-sqr-sqrt44.8%
sqrt-unprod74.7%
pow274.7%
hypot-undefine38.9%
+-commutative38.9%
hypot-undefine74.7%
Applied egg-rr74.7%
unpow274.7%
rem-sqrt-square74.7%
fma-undefine74.7%
*-commutative74.7%
+-commutative74.7%
fma-define74.7%
*-commutative74.7%
Simplified74.7%
Taylor expanded in y.re around 0 38.9%
unpow238.9%
unpow238.9%
hypot-undefine74.6%
Simplified74.6%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re)))))
(if (<= y.im -60.0)
(*
(cos (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (- (atan2 x.im x.re))))
(if (<= y.im 2.9e-34)
(* (fabs t_0) (pow (hypot x.im x.re) y.re))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -60.0) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
} else if (y_46_im <= 2.9e-34) {
tmp = fabs(t_0) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -60.0) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
} else if (y_46_im <= 2.9e-34) {
tmp = Math.abs(t_0) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re)))) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if y_46_im <= -60.0: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) elif y_46_im <= 2.9e-34: tmp = math.fabs(t_0) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -60.0) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); elseif (y_46_im <= 2.9e-34) tmp = Float64(abs(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_im <= -60.0) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); elseif (y_46_im <= 2.9e-34) tmp = abs(t_0) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -60.0], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.9e-34], N[(N[Abs[t$95$0], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $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.im \leq -60:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-34}:\\
\;\;\;\;\left|t\_0\right| \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\end{array}
\end{array}
if y.im < -60Initial program 36.7%
cancel-sign-sub-inv36.7%
fma-define36.7%
hypot-define36.7%
distribute-lft-neg-in36.7%
distribute-rgt-neg-out36.7%
fma-define36.7%
hypot-define69.0%
*-commutative69.0%
Simplified69.0%
Taylor expanded in y.re around 0 27.0%
*-commutative27.0%
unpow227.0%
unpow227.0%
hypot-undefine53.8%
neg-mul-153.8%
distribute-rgt-neg-in53.8%
mul-1-neg53.8%
exp-prod56.6%
mul-1-neg56.6%
Simplified56.6%
if -60 < y.im < 2.9000000000000002e-34Initial program 42.9%
cancel-sign-sub-inv42.9%
fma-define42.9%
hypot-define42.9%
distribute-lft-neg-in42.9%
distribute-rgt-neg-out42.9%
fma-define42.9%
hypot-define89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y.im around 0 62.2%
unpow262.2%
unpow262.2%
hypot-undefine88.7%
Simplified88.7%
add-sqr-sqrt77.7%
sqrt-unprod95.4%
pow295.4%
Applied egg-rr95.4%
unpow295.4%
rem-sqrt-square95.4%
Simplified95.4%
if 2.9000000000000002e-34 < y.im Initial program 41.5%
Taylor expanded in y.im around 0 71.6%
Final simplification78.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -7.5e-6)
(* t_0 t_1)
(if (<= y.re 1.15e-10)
(*
(cos (* y.im (log (hypot x.im x.re))))
(exp (* y.im (- (atan2 x.im x.re)))))
(* (fabs t_0) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.5e-6) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.15e-10) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else {
tmp = fabs(t_0) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -7.5e-6) {
tmp = t_0 * t_1;
} else if (y_46_re <= 1.15e-10) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.abs(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -7.5e-6: tmp = t_0 * t_1 elif y_46_re <= 1.15e-10: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) else: tmp = math.fabs(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -7.5e-6) tmp = Float64(t_0 * t_1); elseif (y_46_re <= 1.15e-10) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64(abs(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -7.5e-6) tmp = t_0 * t_1; elseif (y_46_re <= 1.15e-10) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((y_46_im * -atan2(x_46_im, x_46_re))); else tmp = abs(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e-6], N[(t$95$0 * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.15e-10], 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[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.15 \cdot 10^{-10}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right| \cdot t\_1\\
\end{array}
\end{array}
if y.re < -7.50000000000000019e-6Initial program 47.1%
cancel-sign-sub-inv47.1%
fma-define47.1%
hypot-define47.1%
distribute-lft-neg-in47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 77.3%
unpow277.3%
unpow277.3%
hypot-undefine77.3%
Simplified77.3%
if -7.50000000000000019e-6 < y.re < 1.15000000000000004e-10Initial program 39.9%
cancel-sign-sub-inv39.9%
fma-define39.9%
hypot-define39.9%
distribute-lft-neg-in39.9%
distribute-rgt-neg-out39.9%
fma-define39.9%
hypot-define81.0%
*-commutative81.0%
Simplified81.0%
Taylor expanded in y.re around 0 39.9%
*-commutative39.9%
unpow239.9%
unpow239.9%
hypot-undefine80.9%
neg-mul-180.9%
distribute-rgt-neg-in80.9%
Simplified80.9%
if 1.15000000000000004e-10 < y.re Initial program 35.8%
cancel-sign-sub-inv35.8%
fma-define35.8%
hypot-define35.8%
distribute-lft-neg-in35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in y.im around 0 62.9%
unpow262.9%
unpow262.9%
hypot-undefine62.9%
Simplified62.9%
add-sqr-sqrt38.9%
sqrt-unprod65.8%
pow265.8%
Applied egg-rr65.8%
unpow265.8%
rem-sqrt-square65.8%
Simplified65.8%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (or (<= y.im -6.2e+23) (not (<= y.im 0.16)))
(* -0.5 (* t_1 (pow t_0 2.0)))
(* (fabs (cos t_0)) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -6.2e+23) || !(y_46_im <= 0.16)) {
tmp = -0.5 * (t_1 * pow(t_0, 2.0));
} else {
tmp = fabs(cos(t_0)) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -6.2e+23) || !(y_46_im <= 0.16)) {
tmp = -0.5 * (t_1 * Math.pow(t_0, 2.0));
} else {
tmp = Math.abs(Math.cos(t_0)) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if (y_46_im <= -6.2e+23) or not (y_46_im <= 0.16): tmp = -0.5 * (t_1 * math.pow(t_0, 2.0)) else: tmp = math.fabs(math.cos(t_0)) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if ((y_46_im <= -6.2e+23) || !(y_46_im <= 0.16)) tmp = Float64(-0.5 * Float64(t_1 * (t_0 ^ 2.0))); else tmp = Float64(abs(cos(t_0)) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if ((y_46_im <= -6.2e+23) || ~((y_46_im <= 0.16))) tmp = -0.5 * (t_1 * (t_0 ^ 2.0)); else tmp = abs(cos(t_0)) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -6.2e+23], N[Not[LessEqual[y$46$im, 0.16]], $MachinePrecision]], N[(-0.5 * N[(t$95$1 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[Cos[t$95$0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -6.2 \cdot 10^{+23} \lor \neg \left(y.im \leq 0.16\right):\\
\;\;\;\;-0.5 \cdot \left(t\_1 \cdot {t\_0}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left|\cos t\_0\right| \cdot t\_1\\
\end{array}
\end{array}
if y.im < -6.19999999999999941e23 or 0.160000000000000003 < y.im Initial program 37.1%
cancel-sign-sub-inv37.1%
fma-define37.1%
hypot-define37.1%
distribute-lft-neg-in37.1%
distribute-rgt-neg-out37.1%
fma-define37.1%
hypot-define68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in y.im around 0 41.1%
unpow241.1%
unpow241.1%
hypot-undefine36.3%
Simplified36.3%
Taylor expanded in y.re around 0 27.5%
unpow227.5%
unpow227.5%
swap-sqr31.5%
unpow231.5%
Simplified31.5%
Taylor expanded in y.re around inf 39.7%
associate-*r*39.7%
unpow239.7%
unpow239.7%
swap-sqr43.7%
unpow243.7%
unpow243.7%
unpow243.7%
hypot-undefine45.5%
Simplified45.5%
if -6.19999999999999941e23 < y.im < 0.160000000000000003Initial program 44.3%
cancel-sign-sub-inv44.3%
fma-define44.3%
hypot-define44.3%
distribute-lft-neg-in44.3%
distribute-rgt-neg-out44.3%
fma-define44.3%
hypot-define88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in y.im around 0 63.4%
unpow263.4%
unpow263.4%
hypot-undefine86.9%
Simplified86.9%
add-sqr-sqrt75.5%
sqrt-unprod92.3%
pow292.3%
Applied egg-rr92.3%
unpow292.3%
rem-sqrt-square92.3%
Simplified92.3%
Final simplification69.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (or (<= y.im -9.5e+25) (not (<= y.im 4.6e+116)))
(* -0.5 (* t_1 (pow t_0 2.0)))
(* (cos t_0) t_1))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -9.5e+25) || !(y_46_im <= 4.6e+116)) {
tmp = -0.5 * (t_1 * pow(t_0, 2.0));
} else {
tmp = cos(t_0) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if ((y_46_im <= -9.5e+25) || !(y_46_im <= 4.6e+116)) {
tmp = -0.5 * (t_1 * Math.pow(t_0, 2.0));
} else {
tmp = Math.cos(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if (y_46_im <= -9.5e+25) or not (y_46_im <= 4.6e+116): tmp = -0.5 * (t_1 * math.pow(t_0, 2.0)) else: tmp = math.cos(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if ((y_46_im <= -9.5e+25) || !(y_46_im <= 4.6e+116)) tmp = Float64(-0.5 * Float64(t_1 * (t_0 ^ 2.0))); else tmp = Float64(cos(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if ((y_46_im <= -9.5e+25) || ~((y_46_im <= 4.6e+116))) tmp = -0.5 * (t_1 * (t_0 ^ 2.0)); else tmp = cos(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[Or[LessEqual[y$46$im, -9.5e+25], N[Not[LessEqual[y$46$im, 4.6e+116]], $MachinePrecision]], N[(-0.5 * N[(t$95$1 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{+25} \lor \neg \left(y.im \leq 4.6 \cdot 10^{+116}\right):\\
\;\;\;\;-0.5 \cdot \left(t\_1 \cdot {t\_0}^{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\cos t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.im < -9.5000000000000005e25 or 4.5999999999999999e116 < y.im Initial program 35.8%
cancel-sign-sub-inv35.8%
fma-define35.8%
hypot-define35.8%
distribute-lft-neg-in35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y.im around 0 37.6%
unpow237.6%
unpow237.6%
hypot-undefine32.8%
Simplified32.8%
Taylor expanded in y.re around 0 24.1%
unpow224.1%
unpow224.1%
swap-sqr29.0%
unpow229.0%
Simplified29.0%
Taylor expanded in y.re around inf 36.1%
associate-*r*36.1%
unpow236.1%
unpow236.1%
swap-sqr40.9%
unpow240.9%
unpow240.9%
unpow240.9%
hypot-undefine44.0%
Simplified44.0%
if -9.5000000000000005e25 < y.im < 4.5999999999999999e116Initial program 44.2%
cancel-sign-sub-inv44.2%
fma-define44.2%
hypot-define44.2%
distribute-lft-neg-in44.2%
distribute-rgt-neg-out44.2%
fma-define44.2%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.im around 0 62.7%
unpow262.7%
unpow262.7%
hypot-undefine82.3%
Simplified82.3%
Final simplification66.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (cos (* y.re (atan2 x.im x.re))) (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 cos((y_46_re * atan2(x_46_im, x_46_re))) * 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.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);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return 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)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (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 = cos((y_46_re * atan2(x_46_im, x_46_re))) * (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[(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]
\begin{array}{l}
\\
\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}
\end{array}
Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y.im around 0 52.5%
unpow252.5%
unpow252.5%
hypot-undefine62.2%
Simplified62.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -21000.0) (not (<= y.re 2.6e+134))) (* (cos (* y.re (atan2 x.im x.re))) (pow x.im y.re)) (+ 1.0 (log (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) {
double tmp;
if ((y_46_re <= -21000.0) || !(y_46_re <= 2.6e+134)) {
tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + log(pow(hypot(x_46_im, x_46_re), y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -21000.0) || !(y_46_re <= 2.6e+134)) {
tmp = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
} else {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_im, 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 (y_46_re <= -21000.0) or not (y_46_re <= 2.6e+134): tmp = math.cos((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re) else: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_im, 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 ((y_46_re <= -21000.0) || !(y_46_re <= 2.6e+134)) tmp = Float64(cos(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)); else tmp = Float64(1.0 + log((hypot(x_46_im, 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 ((y_46_re <= -21000.0) || ~((y_46_re <= 2.6e+134))) tmp = cos((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); else tmp = 1.0 + log((hypot(x_46_im, 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[Or[LessEqual[y$46$re, -21000.0], N[Not[LessEqual[y$46$re, 2.6e+134]], $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[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -21000 \lor \neg \left(y.re \leq 2.6 \cdot 10^{+134}\right):\\
\;\;\;\;\cos \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -21000 or 2.6000000000000002e134 < y.re Initial program 43.2%
cancel-sign-sub-inv43.2%
fma-define43.2%
hypot-define43.2%
distribute-lft-neg-in43.2%
distribute-rgt-neg-out43.2%
fma-define43.2%
hypot-define82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in y.im around 0 74.9%
unpow274.9%
unpow274.9%
hypot-undefine74.9%
Simplified74.9%
Taylor expanded in x.re around 0 54.5%
if -21000 < y.re < 2.6000000000000002e134Initial program 38.9%
cancel-sign-sub-inv38.9%
fma-define38.9%
hypot-define38.9%
distribute-lft-neg-in38.9%
distribute-rgt-neg-out38.9%
fma-define38.9%
hypot-define76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in y.im around 0 35.3%
unpow235.3%
unpow235.3%
hypot-undefine52.5%
Simplified52.5%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine45.1%
Simplified45.1%
*-commutative45.1%
add-log-exp54.4%
exp-to-pow54.4%
Applied egg-rr54.4%
Final simplification54.4%
(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 -235.0)
(* t_0 (pow x.re y.re))
(if (<= y.re 1.15e+133)
(+ 1.0 (log (pow (hypot x.im x.re) y.re)))
(* t_0 (pow x.im 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 <= -235.0) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.15e+133) {
tmp = 1.0 + log(pow(hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.cos((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_re <= -235.0) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else if (y_46_re <= 1.15e+133) {
tmp = 1.0 + Math.log(Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re));
} else {
tmp = t_0 * Math.pow(x_46_im, 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 <= -235.0: tmp = t_0 * math.pow(x_46_re, y_46_re) elif y_46_re <= 1.15e+133: tmp = 1.0 + math.log(math.pow(math.hypot(x_46_im, x_46_re), y_46_re)) else: tmp = t_0 * math.pow(x_46_im, 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 <= -235.0) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); elseif (y_46_re <= 1.15e+133) tmp = Float64(1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re))); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (y_46_re <= -235.0) tmp = t_0 * (x_46_re ^ y_46_re); elseif (y_46_re <= 1.15e+133) tmp = 1.0 + log((hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = t_0 * (x_46_im ^ 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, -235.0], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.15e+133], N[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, 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 -235:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.15 \cdot 10^{+133}:\\
\;\;\;\;1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -235Initial program 46.4%
cancel-sign-sub-inv46.4%
fma-define46.4%
hypot-define46.4%
distribute-lft-neg-in46.4%
distribute-rgt-neg-out46.4%
fma-define46.4%
hypot-define84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in y.im around 0 77.0%
unpow277.0%
unpow277.0%
hypot-undefine77.0%
Simplified77.0%
Taylor expanded in x.im around 0 67.0%
if -235 < y.re < 1.14999999999999995e133Initial program 38.9%
cancel-sign-sub-inv38.9%
fma-define38.9%
hypot-define38.9%
distribute-lft-neg-in38.9%
distribute-rgt-neg-out38.9%
fma-define38.9%
hypot-define76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in y.im around 0 35.3%
unpow235.3%
unpow235.3%
hypot-undefine52.5%
Simplified52.5%
Taylor expanded in y.re around 0 27.6%
unpow227.6%
unpow227.6%
hypot-undefine45.1%
Simplified45.1%
*-commutative45.1%
add-log-exp54.4%
exp-to-pow54.4%
Applied egg-rr54.4%
if 1.14999999999999995e133 < y.re Initial program 38.1%
cancel-sign-sub-inv38.1%
fma-define38.1%
hypot-define38.1%
distribute-lft-neg-in38.1%
distribute-rgt-neg-out38.1%
fma-define38.1%
hypot-define78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in y.im around 0 71.5%
unpow271.5%
unpow271.5%
hypot-undefine71.5%
Simplified71.5%
Taylor expanded in x.re around 0 59.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (log (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 1.0 + log(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 1.0 + Math.log(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 1.0 + math.log(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 Float64(1.0 + log((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 = 1.0 + log((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[(1.0 + N[Log[N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \log \left({\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\right)
\end{array}
Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y.im around 0 52.5%
unpow252.5%
unpow252.5%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 21.5%
unpow221.5%
unpow221.5%
hypot-undefine27.2%
Simplified27.2%
*-commutative27.2%
add-log-exp43.2%
exp-to-pow43.2%
Applied egg-rr43.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.023)
(+ 1.0 (* y.re (log1p (+ (hypot x.im x.re) -1.0))))
(if (<= y.re 8.2e+175)
(+ 1.0 (* y.re (log (hypot x.im x.re))))
(+ 1.0 (* y.re (log (+ x.re (/ (* 0.5 (pow x.im 2.0)) 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_re <= -0.023) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 8.2e+175) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * log((x_46_re + ((0.5 * pow(x_46_im, 2.0)) / 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_re <= -0.023) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 8.2e+175) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_re + ((0.5 * Math.pow(x_46_im, 2.0)) / x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -0.023: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_im, x_46_re) + -1.0))) elif y_46_re <= 8.2e+175: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) else: tmp = 1.0 + (y_46_re * math.log((x_46_re + ((0.5 * math.pow(x_46_im, 2.0)) / 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_re <= -0.023) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_im, x_46_re) + -1.0)))); elseif (y_46_re <= 8.2e+175) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_re + Float64(Float64(0.5 * (x_46_im ^ 2.0)) / x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -0.023], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.2e+175], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$re + N[(N[(0.5 * N[Power[x$46$im, 2.0], $MachinePrecision]), $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.023:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.im, x.re\right) + -1\right)\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+175}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.re + \frac{0.5 \cdot {x.im}^{2}}{x.re}\right)\\
\end{array}
\end{array}
if y.re < -0.023Initial program 47.1%
cancel-sign-sub-inv47.1%
fma-define47.1%
hypot-define47.1%
distribute-lft-neg-in47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 77.3%
unpow277.3%
unpow277.3%
hypot-undefine77.3%
Simplified77.3%
Taylor expanded in y.re around 0 6.3%
unpow26.3%
unpow26.3%
hypot-undefine3.9%
Simplified3.9%
log1p-expm1-u18.8%
expm1-undefine18.8%
add-exp-log18.8%
Applied egg-rr18.8%
if -0.023 < y.re < 8.19999999999999955e175Initial program 38.6%
cancel-sign-sub-inv38.6%
fma-define38.6%
hypot-define38.6%
distribute-lft-neg-in38.6%
distribute-rgt-neg-out38.6%
fma-define38.6%
hypot-define77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in y.im around 0 37.8%
unpow237.8%
unpow237.8%
hypot-undefine54.0%
Simplified54.0%
Taylor expanded in y.re around 0 27.4%
unpow227.4%
unpow227.4%
hypot-undefine42.6%
Simplified42.6%
if 8.19999999999999955e175 < y.re Initial program 37.5%
cancel-sign-sub-inv37.5%
fma-define37.5%
hypot-define37.5%
distribute-lft-neg-in37.5%
distribute-rgt-neg-out37.5%
fma-define37.5%
hypot-define71.9%
*-commutative71.9%
Simplified71.9%
Taylor expanded in y.im around 0 68.8%
unpow268.8%
unpow268.8%
hypot-undefine68.8%
Simplified68.8%
Taylor expanded in y.re around 0 26.9%
unpow226.9%
unpow226.9%
hypot-undefine3.9%
Simplified3.9%
Taylor expanded in x.im around 0 20.3%
associate-*r/20.3%
Simplified20.3%
Final simplification33.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.1)
(+ 1.0 (* y.re (log1p (+ (hypot x.im x.re) -1.0))))
(if (<= y.re 1.18e+48)
(+ 1.0 (* y.re (log (hypot x.im x.re))))
(+ 1.0 (* y.re (log (+ x.im (/ (* 0.5 (pow x.re 2.0)) x.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 <= -3.1) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 1.18e+48) {
tmp = 1.0 + (y_46_re * log(hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * log((x_46_im + ((0.5 * pow(x_46_re, 2.0)) / x_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 <= -3.1) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_im, x_46_re) + -1.0)));
} else if (y_46_re <= 1.18e+48) {
tmp = 1.0 + (y_46_re * Math.log(Math.hypot(x_46_im, x_46_re)));
} else {
tmp = 1.0 + (y_46_re * Math.log((x_46_im + ((0.5 * Math.pow(x_46_re, 2.0)) / x_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -3.1: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_im, x_46_re) + -1.0))) elif y_46_re <= 1.18e+48: tmp = 1.0 + (y_46_re * math.log(math.hypot(x_46_im, x_46_re))) else: tmp = 1.0 + (y_46_re * math.log((x_46_im + ((0.5 * math.pow(x_46_re, 2.0)) / x_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 <= -3.1) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_im, x_46_re) + -1.0)))); elseif (y_46_re <= 1.18e+48) tmp = Float64(1.0 + Float64(y_46_re * log(hypot(x_46_im, x_46_re)))); else tmp = Float64(1.0 + Float64(y_46_re * log(Float64(x_46_im + Float64(Float64(0.5 * (x_46_re ^ 2.0)) / x_46_im))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.1], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.18e+48], N[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y$46$re * N[Log[N[(x$46$im + N[(N[(0.5 * N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.1:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.im, x.re\right) + -1\right)\\
\mathbf{elif}\;y.re \leq 1.18 \cdot 10^{+48}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(x.im + \frac{0.5 \cdot {x.re}^{2}}{x.im}\right)\\
\end{array}
\end{array}
if y.re < -3.10000000000000009Initial program 47.1%
cancel-sign-sub-inv47.1%
fma-define47.1%
hypot-define47.1%
distribute-lft-neg-in47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 77.3%
unpow277.3%
unpow277.3%
hypot-undefine77.3%
Simplified77.3%
Taylor expanded in y.re around 0 6.3%
unpow26.3%
unpow26.3%
hypot-undefine3.9%
Simplified3.9%
log1p-expm1-u18.8%
expm1-undefine18.8%
add-exp-log18.8%
Applied egg-rr18.8%
if -3.10000000000000009 < y.re < 1.18000000000000007e48Initial program 38.1%
cancel-sign-sub-inv38.1%
fma-define38.1%
hypot-define38.1%
distribute-lft-neg-in38.1%
distribute-rgt-neg-out38.1%
fma-define38.1%
hypot-define78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in y.im around 0 32.4%
unpow232.4%
unpow232.4%
hypot-undefine52.1%
Simplified52.1%
Taylor expanded in y.re around 0 27.3%
unpow227.3%
unpow227.3%
hypot-undefine51.1%
Simplified51.1%
if 1.18000000000000007e48 < y.re Initial program 39.0%
cancel-sign-sub-inv39.0%
fma-define39.0%
hypot-define39.0%
distribute-lft-neg-in39.0%
distribute-rgt-neg-out39.0%
fma-define39.0%
hypot-define72.9%
*-commutative72.9%
Simplified72.9%
Taylor expanded in y.im around 0 66.2%
unpow266.2%
unpow266.2%
hypot-undefine66.2%
Simplified66.2%
Taylor expanded in y.re around 0 27.2%
unpow227.2%
unpow227.2%
hypot-undefine3.4%
Simplified3.4%
Taylor expanded in x.re around 0 10.9%
associate-*r/10.9%
Simplified10.9%
Final simplification33.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -1.5) (+ 1.0 (* y.re (log1p (+ (hypot x.im x.re) -1.0)))) (+ 1.0 (* 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_re <= -1.5) {
tmp = 1.0 + (y_46_re * log1p((hypot(x_46_im, x_46_re) + -1.0)));
} else {
tmp = 1.0 + (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_re <= -1.5) {
tmp = 1.0 + (y_46_re * Math.log1p((Math.hypot(x_46_im, x_46_re) + -1.0)));
} else {
tmp = 1.0 + (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_re <= -1.5: tmp = 1.0 + (y_46_re * math.log1p((math.hypot(x_46_im, x_46_re) + -1.0))) else: tmp = 1.0 + (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_re <= -1.5) tmp = Float64(1.0 + Float64(y_46_re * log1p(Float64(hypot(x_46_im, x_46_re) + -1.0)))); else tmp = Float64(1.0 + Float64(y_46_re * 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_] := If[LessEqual[y$46$re, -1.5], N[(1.0 + N[(y$46$re * N[Log[1 + N[(N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + 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.re \leq -1.5:\\
\;\;\;\;1 + y.re \cdot \mathsf{log1p}\left(\mathsf{hypot}\left(x.im, x.re\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\end{array}
\end{array}
if y.re < -1.5Initial program 47.1%
cancel-sign-sub-inv47.1%
fma-define47.1%
hypot-define47.1%
distribute-lft-neg-in47.1%
distribute-rgt-neg-out47.1%
fma-define47.1%
hypot-define84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y.im around 0 77.3%
unpow277.3%
unpow277.3%
hypot-undefine77.3%
Simplified77.3%
Taylor expanded in y.re around 0 6.3%
unpow26.3%
unpow26.3%
hypot-undefine3.9%
Simplified3.9%
log1p-expm1-u18.8%
expm1-undefine18.8%
add-exp-log18.8%
Applied egg-rr18.8%
if -1.5 < y.re Initial program 38.4%
cancel-sign-sub-inv38.4%
fma-define38.4%
hypot-define38.4%
distribute-lft-neg-in38.4%
distribute-rgt-neg-out38.4%
fma-define38.4%
hypot-define76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in y.im around 0 43.1%
unpow243.1%
unpow243.1%
hypot-undefine56.6%
Simplified56.6%
Taylor expanded in y.re around 0 27.3%
unpow227.3%
unpow227.3%
hypot-undefine36.0%
Simplified36.0%
Final simplification31.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (+ 1.0 (* 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 1.0 + (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 1.0 + (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 1.0 + (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 Float64(1.0 + 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 = 1.0 + (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[(1.0 + N[(y$46$re * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)
\end{array}
Initial program 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y.im around 0 52.5%
unpow252.5%
unpow252.5%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 21.5%
unpow221.5%
unpow221.5%
hypot-undefine27.2%
Simplified27.2%
(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 40.8%
cancel-sign-sub-inv40.8%
fma-define40.8%
hypot-define40.8%
distribute-lft-neg-in40.8%
distribute-rgt-neg-out40.8%
fma-define40.8%
hypot-define78.7%
*-commutative78.7%
Simplified78.7%
Taylor expanded in y.im around 0 52.5%
unpow252.5%
unpow252.5%
hypot-undefine62.2%
Simplified62.2%
Taylor expanded in y.re around 0 26.4%
herbie shell --seed 2024144
(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)))))