
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(cos (+ (* t_0 y.im) (* (atan2 x.im x.re) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
t_0 = log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))
code = exp(((t_0 * y_46re) - (atan2(x_46im, x_46re) * y_46im))) * cos(((t_0 * y_46im) + (atan2(x_46im, x_46re) * y_46re)))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))));
return Math.exp(((t_0 * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.cos(((t_0 * y_46_im) + (Math.atan2(x_46_im, x_46_re) * y_46_re)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) return math.exp(((t_0 * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.cos(((t_0 * y_46_im) + (math.atan2(x_46_im, x_46_re) * y_46_re)))
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) return Float64(exp(Float64(Float64(t_0 * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * cos(Float64(Float64(t_0 * y_46_im) + Float64(atan(x_46_im, x_46_re) * y_46_re)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))); tmp = exp(((t_0 * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((t_0 * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(N[(t$95$0 * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(t$95$0 * y$46$im), $MachinePrecision] + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\\
e^{t_0 \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(t_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (cos (* (atan2 x.im x.re) y.re)))
(t_2 (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0))))
(if (<= y.re -6e+24)
(* t_1 t_2)
(if (<= y.re 1.08e-47)
(* t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(if (<= y.re 2e+246)
(* (cos (* y.im (log (hypot x.im x.re)))) t_2)
(* t_1 (/ (pow (hypot x.im x.re) y.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2e+246) {
tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2;
} else {
tmp = t_1 * (pow(hypot(x_46_im, x_46_re), y_46_re) / t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2e+246) {
tmp = Math.cos((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_2;
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) / t_0);
}
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((math.atan2(x_46_im, x_46_re) * y_46_re)) t_2 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0) tmp = 0 if y_46_re <= -6e+24: tmp = t_1 * t_2 elif y_46_re <= 1.08e-47: tmp = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 2e+246: tmp = math.cos((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_2 else: tmp = t_1 * (math.pow(math.hypot(x_46_im, x_46_re), y_46_re) / t_0) 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(atan(x_46_im, x_46_re) * y_46_re)) t_2 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) tmp = 0.0 if (y_46_re <= -6e+24) tmp = Float64(t_1 * t_2); elseif (y_46_re <= 1.08e-47) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_re <= 2e+246) tmp = Float64(cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2); else tmp = Float64(t_1 * Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)); t_2 = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0); tmp = 0.0; if (y_46_re <= -6e+24) tmp = t_1 * t_2; elseif (y_46_re <= 1.08e-47) tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 2e+246) tmp = cos((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2; else tmp = t_1 * ((hypot(x_46_im, x_46_re) ^ y_46_re) / t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$re, -6e+24], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.08e-47], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+246], N[(N[Cos[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t_0}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+24}:\\
\;\;\;\;t_1 \cdot t_2\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;t_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+246}:\\
\;\;\;\;\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{t_0}\\
\end{array}
\end{array}
if y.re < -5.9999999999999999e24Initial program 34.0%
exp-diff27.7%
exp-to-pow27.7%
hypot-def27.7%
*-commutative27.7%
exp-prod21.3%
fma-def21.3%
hypot-def66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 85.2%
Taylor expanded in y.im around 0 87.3%
if -5.9999999999999999e24 < y.re < 1.08000000000000005e-47Initial program 38.1%
exp-diff38.1%
exp-to-pow38.1%
hypot-def38.1%
*-commutative38.1%
exp-prod37.0%
fma-def37.0%
hypot-def76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.re around 0 76.9%
rec-exp76.9%
distribute-rgt-neg-in76.9%
Simplified76.9%
Taylor expanded in y.im around 0 82.7%
if 1.08000000000000005e-47 < y.re < 2.00000000000000014e246Initial program 41.7%
exp-diff38.9%
exp-to-pow38.9%
hypot-def38.9%
*-commutative38.9%
exp-prod38.9%
fma-def38.9%
hypot-def54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.re around 0 48.7%
unpow248.7%
unpow248.7%
hypot-def78.0%
Simplified78.0%
if 2.00000000000000014e246 < y.re Initial program 50.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-def25.0%
*-commutative25.0%
exp-prod25.0%
fma-def25.0%
hypot-def41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around inf 91.7%
unpow291.7%
unpow291.7%
hypot-def91.7%
Simplified91.7%
Final simplification82.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (- (atan2 x.im x.re))))
(t_1 (log (hypot x.re x.im)))
(t_2 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -8e+136)
(* (cos t_2) (exp t_0))
(if (<= y.im 4.5e-6)
(log
(pow
(exp
(/ (pow (hypot x.re x.im) y.re) (fma y.im (atan2 x.im x.re) 1.0)))
(cos (* y.im (log (hypot x.im x.re))))))
(* (exp (fma t_1 y.re t_0)) (cos (fma t_1 y.im t_2)))))))
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 = log(hypot(x_46_re, x_46_im));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -8e+136) {
tmp = cos(t_2) * exp(t_0);
} else if (y_46_im <= 4.5e-6) {
tmp = log(pow(exp((pow(hypot(x_46_re, x_46_im), y_46_re) / fma(y_46_im, atan2(x_46_im, x_46_re), 1.0))), cos((y_46_im * log(hypot(x_46_im, x_46_re))))));
} else {
tmp = exp(fma(t_1, y_46_re, t_0)) * cos(fma(t_1, y_46_im, t_2));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -8e+136) tmp = Float64(cos(t_2) * exp(t_0)); elseif (y_46_im <= 4.5e-6) tmp = log((exp(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / fma(y_46_im, atan(x_46_im, x_46_re), 1.0))) ^ cos(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))))); else tmp = Float64(exp(fma(t_1, y_46_re, t_0)) * cos(fma(t_1, y_46_im, t_2))); end return 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -8e+136], N[(N[Cos[t$95$2], $MachinePrecision] * N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.5e-6], N[Log[N[Power[N[Exp[N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $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]], $MachinePrecision], N[(N[Exp[N[(t$95$1 * y$46$re + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(t$95$1 * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -8 \cdot 10^{+136}:\\
\;\;\;\;\cos t_2 \cdot e^{t_0}\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\log \left({\left(e^{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)}}\right)}^{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_1, y.re, t_0\right)} \cdot \cos \left(\mathsf{fma}\left(t_1, y.im, t_2\right)\right)\\
\end{array}
\end{array}
if y.im < -8.00000000000000047e136Initial program 21.2%
exp-diff12.4%
exp-to-pow12.4%
hypot-def12.4%
*-commutative12.4%
exp-prod12.4%
fma-def12.4%
hypot-def36.5%
*-commutative36.5%
Simplified36.5%
Taylor expanded in y.re around 0 46.1%
rec-exp46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
Taylor expanded in y.im around 0 66.7%
if -8.00000000000000047e136 < y.im < 4.50000000000000011e-6Initial program 42.8%
exp-diff42.2%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod41.2%
fma-def41.2%
hypot-def79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around 0 76.6%
add-log-exp80.4%
exp-prod80.4%
+-commutative80.4%
fma-def80.4%
Applied egg-rr80.4%
Taylor expanded in y.im around inf 58.2%
unpow223.9%
unpow223.9%
hypot-def49.5%
Simplified87.2%
if 4.50000000000000011e-6 < y.im Initial program 39.2%
cancel-sign-sub-inv39.2%
fma-def39.2%
hypot-def39.2%
distribute-lft-neg-in39.2%
distribute-rgt-neg-out39.2%
fma-def39.2%
hypot-def80.3%
*-commutative80.3%
Simplified80.3%
Final simplification82.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re)))
(t_1 (* y.im (log (hypot x.im x.re))))
(t_2 (exp (* y.im (- (atan2 x.im x.re))))))
(if (<= y.im -6.2e+136)
(* t_0 t_2)
(if (<= y.im 4.5e-6)
(log
(pow
(exp
(/ (pow (hypot x.re x.im) y.re) (fma y.im (atan2 x.im x.re) 1.0)))
(cos t_1)))
(if (<= y.im 1.8e+190)
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(* (cos (pow (cbrt t_1) 3.0)) t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_2 = exp((y_46_im * -atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -6.2e+136) {
tmp = t_0 * t_2;
} else if (y_46_im <= 4.5e-6) {
tmp = log(pow(exp((pow(hypot(x_46_re, x_46_im), y_46_re) / fma(y_46_im, atan2(x_46_im, x_46_re), 1.0))), cos(t_1)));
} else if (y_46_im <= 1.8e+190) {
tmp = t_0 * 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))));
} else {
tmp = cos(pow(cbrt(t_1), 3.0)) * t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_im <= -6.2e+136) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 4.5e-6) tmp = log((exp(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / fma(y_46_im, atan(x_46_im, x_46_re), 1.0))) ^ cos(t_1))); elseif (y_46_im <= 1.8e+190) tmp = Float64(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(y_46_im * atan(x_46_im, x_46_re))))); else tmp = Float64(cos((cbrt(t_1) ^ 3.0)) * t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -6.2e+136], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 4.5e-6], N[Log[N[Power[N[Exp[N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Cos[t$95$1], $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[y$46$im, 1.8e+190], N[(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.im \leq -6.2 \cdot 10^{+136}:\\
\;\;\;\;t_0 \cdot t_2\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\log \left({\left(e^{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{\mathsf{fma}\left(y.im, \tan^{-1}_* \frac{x.im}{x.re}, 1\right)}}\right)}^{\cos t_1}\right)\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+190}:\\
\;\;\;\;t_0 \cdot 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}}\\
\mathbf{else}:\\
\;\;\;\;\cos \left({\left(\sqrt[3]{t_1}\right)}^{3}\right) \cdot t_2\\
\end{array}
\end{array}
if y.im < -6.19999999999999967e136Initial program 21.2%
exp-diff12.4%
exp-to-pow12.4%
hypot-def12.4%
*-commutative12.4%
exp-prod12.4%
fma-def12.4%
hypot-def36.5%
*-commutative36.5%
Simplified36.5%
Taylor expanded in y.re around 0 46.1%
rec-exp46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
Taylor expanded in y.im around 0 66.7%
if -6.19999999999999967e136 < y.im < 4.50000000000000011e-6Initial program 42.8%
exp-diff42.2%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod41.2%
fma-def41.2%
hypot-def79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in y.im around 0 76.6%
add-log-exp80.4%
exp-prod80.4%
+-commutative80.4%
fma-def80.4%
Applied egg-rr80.4%
Taylor expanded in y.im around inf 58.2%
unpow223.9%
unpow223.9%
hypot-def49.5%
Simplified87.2%
if 4.50000000000000011e-6 < y.im < 1.79999999999999989e190Initial program 38.0%
Taylor expanded in y.im around 0 72.3%
if 1.79999999999999989e190 < y.im Initial program 41.7%
exp-diff41.7%
exp-to-pow41.7%
hypot-def41.7%
*-commutative41.7%
exp-prod37.5%
fma-def37.5%
hypot-def54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in y.re around 0 66.9%
rec-exp66.9%
distribute-rgt-neg-in66.9%
Simplified66.9%
Taylor expanded in y.im around inf 37.6%
unpow237.6%
unpow237.6%
hypot-def66.9%
Simplified66.9%
add-cube-cbrt79.4%
pow379.4%
Applied egg-rr79.4%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (cos (* (atan2 x.im x.re) y.re)))
(t_2 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -6e+24)
(* t_1 t_2)
(if (<= y.re 1.08e-47)
(* t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(if (<= y.re 4e+244)
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0))
(* t_1 (/ t_2 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_im * atan2(x_46_im, x_46_re);
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+244) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
} else {
tmp = t_1 * (t_2 / 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 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 4e+244) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
} else {
tmp = t_1 * (t_2 / t_0);
}
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((math.atan2(x_46_im, x_46_re) * y_46_re)) t_2 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -6e+24: tmp = t_1 * t_2 elif y_46_re <= 1.08e-47: tmp = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 4e+244: tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0) else: tmp = t_1 * (t_2 / t_0) 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(atan(x_46_im, x_46_re) * y_46_re)) t_2 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -6e+24) tmp = Float64(t_1 * t_2); elseif (y_46_re <= 1.08e-47) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_re <= 4e+244) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)); else tmp = Float64(t_1 * Float64(t_2 / t_0)); 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((atan2(x_46_im, x_46_re) * y_46_re)); t_2 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -6e+24) tmp = t_1 * t_2; elseif (y_46_re <= 1.08e-47) tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 4e+244) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0); else tmp = t_1 * (t_2 / 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -6e+24], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.08e-47], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4e+244], 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[(t$95$1 * N[(t$95$2 / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+24}:\\
\;\;\;\;t_1 \cdot t_2\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;t_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+244}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{t_2}{t_0}\\
\end{array}
\end{array}
if y.re < -5.9999999999999999e24Initial program 34.0%
exp-diff27.7%
exp-to-pow27.7%
hypot-def27.7%
*-commutative27.7%
exp-prod21.3%
fma-def21.3%
hypot-def66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 85.2%
Taylor expanded in y.im around 0 83.1%
unpow283.1%
unpow283.1%
hypot-def83.1%
Simplified83.1%
if -5.9999999999999999e24 < y.re < 1.08000000000000005e-47Initial program 38.1%
exp-diff38.1%
exp-to-pow38.1%
hypot-def38.1%
*-commutative38.1%
exp-prod37.0%
fma-def37.0%
hypot-def76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.re around 0 76.9%
rec-exp76.9%
distribute-rgt-neg-in76.9%
Simplified76.9%
Taylor expanded in y.im around 0 82.7%
if 1.08000000000000005e-47 < y.re < 4.0000000000000003e244Initial program 41.7%
exp-diff38.9%
exp-to-pow38.9%
hypot-def38.9%
*-commutative38.9%
exp-prod38.9%
fma-def38.9%
hypot-def54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.im around 0 64.6%
Taylor expanded in y.re around 0 71.9%
if 4.0000000000000003e244 < y.re Initial program 50.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-def25.0%
*-commutative25.0%
exp-prod25.0%
fma-def25.0%
hypot-def41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around inf 91.7%
unpow291.7%
unpow291.7%
hypot-def91.7%
Simplified91.7%
Final simplification80.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (cos (* (atan2 x.im x.re) y.re)))
(t_2 (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0))))
(if (<= y.re -6e+24)
(* t_1 t_2)
(if (<= y.re 1.08e-47)
(* t_1 (exp (* y.im (- (atan2 x.im x.re)))))
(if (<= y.re 2.15e+248)
t_2
(* t_1 (/ (pow (hypot x.im x.re) y.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2.15e+248) {
tmp = t_2;
} else {
tmp = t_1 * (pow(hypot(x_46_im, x_46_re), y_46_re) / t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0);
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_1 * t_2;
} else if (y_46_re <= 1.08e-47) {
tmp = t_1 * Math.exp((y_46_im * -Math.atan2(x_46_im, x_46_re)));
} else if (y_46_re <= 2.15e+248) {
tmp = t_2;
} else {
tmp = t_1 * (Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) / t_0);
}
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((math.atan2(x_46_im, x_46_re) * y_46_re)) t_2 = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0) tmp = 0 if y_46_re <= -6e+24: tmp = t_1 * t_2 elif y_46_re <= 1.08e-47: tmp = t_1 * math.exp((y_46_im * -math.atan2(x_46_im, x_46_re))) elif y_46_re <= 2.15e+248: tmp = t_2 else: tmp = t_1 * (math.pow(math.hypot(x_46_im, x_46_re), y_46_re) / t_0) 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(atan(x_46_im, x_46_re) * y_46_re)) t_2 = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) tmp = 0.0 if (y_46_re <= -6e+24) tmp = Float64(t_1 * t_2); elseif (y_46_re <= 1.08e-47) tmp = Float64(t_1 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); elseif (y_46_re <= 2.15e+248) tmp = t_2; else tmp = Float64(t_1 * Float64((hypot(x_46_im, x_46_re) ^ y_46_re) / t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = cos((atan2(x_46_im, x_46_re) * y_46_re)); t_2 = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0); tmp = 0.0; if (y_46_re <= -6e+24) tmp = t_1 * t_2; elseif (y_46_re <= 1.08e-47) tmp = t_1 * exp((y_46_im * -atan2(x_46_im, x_46_re))); elseif (y_46_re <= 2.15e+248) tmp = t_2; else tmp = t_1 * ((hypot(x_46_im, x_46_re) ^ y_46_re) / t_0); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[y$46$re, -6e+24], N[(t$95$1 * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 1.08e-47], N[(t$95$1 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.15e+248], t$95$2, N[(t$95$1 * N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t_0}\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+24}:\\
\;\;\;\;t_1 \cdot t_2\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;t_1 \cdot e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{elif}\;y.re \leq 2.15 \cdot 10^{+248}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}}{t_0}\\
\end{array}
\end{array}
if y.re < -5.9999999999999999e24Initial program 34.0%
exp-diff27.7%
exp-to-pow27.7%
hypot-def27.7%
*-commutative27.7%
exp-prod21.3%
fma-def21.3%
hypot-def66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 85.2%
Taylor expanded in y.im around 0 87.3%
if -5.9999999999999999e24 < y.re < 1.08000000000000005e-47Initial program 38.1%
exp-diff38.1%
exp-to-pow38.1%
hypot-def38.1%
*-commutative38.1%
exp-prod37.0%
fma-def37.0%
hypot-def76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.re around 0 76.9%
rec-exp76.9%
distribute-rgt-neg-in76.9%
Simplified76.9%
Taylor expanded in y.im around 0 82.7%
if 1.08000000000000005e-47 < y.re < 2.15e248Initial program 41.7%
exp-diff38.9%
exp-to-pow38.9%
hypot-def38.9%
*-commutative38.9%
exp-prod38.9%
fma-def38.9%
hypot-def54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in y.im around 0 63.8%
Taylor expanded in y.im around 0 64.6%
Taylor expanded in y.re around 0 71.9%
if 2.15e248 < y.re Initial program 50.0%
exp-diff25.0%
exp-to-pow25.0%
hypot-def25.0%
*-commutative25.0%
exp-prod25.0%
fma-def25.0%
hypot-def41.7%
*-commutative41.7%
Simplified41.7%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around 0 75.0%
Taylor expanded in y.im around inf 91.7%
unpow291.7%
unpow291.7%
hypot-def91.7%
Simplified91.7%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (cos (* (atan2 x.im x.re) y.re))))
(if (<= y.re -6e+24)
(* t_0 (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.08e-47)
(* t_0 (exp (* y.im (- (atan2 x.im x.re)))))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* 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((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.08e-47) {
tmp = t_0 * 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 + (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((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -6e+24) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.08e-47) {
tmp = t_0 * 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 + (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((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if y_46_re <= -6e+24: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 1.08e-47: tmp = t_0 * 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 + (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(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -6e+24) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.08e-47) tmp = Float64(t_0 * exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re))))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = cos((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -6e+24) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 1.08e-47) tmp = t_0 * 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 + (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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -6e+24], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.08e-47], N[(t$95$0 * N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + 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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -6 \cdot 10^{+24}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;t_0 \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 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -5.9999999999999999e24Initial program 34.0%
exp-diff27.7%
exp-to-pow27.7%
hypot-def27.7%
*-commutative27.7%
exp-prod21.3%
fma-def21.3%
hypot-def66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in y.im around 0 85.2%
Taylor expanded in y.im around 0 83.1%
unpow283.1%
unpow283.1%
hypot-def83.1%
Simplified83.1%
if -5.9999999999999999e24 < y.re < 1.08000000000000005e-47Initial program 38.1%
exp-diff38.1%
exp-to-pow38.1%
hypot-def38.1%
*-commutative38.1%
exp-prod37.0%
fma-def37.0%
hypot-def76.5%
*-commutative76.5%
Simplified76.5%
Taylor expanded in y.re around 0 76.9%
rec-exp76.9%
distribute-rgt-neg-in76.9%
Simplified76.9%
Taylor expanded in y.im around 0 82.7%
if 1.08000000000000005e-47 < y.re Initial program 42.9%
exp-diff36.9%
exp-to-pow36.9%
hypot-def36.9%
*-commutative36.9%
exp-prod36.9%
fma-def36.9%
hypot-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.im around 0 65.4%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in y.re around 0 68.7%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -0.00052)
(* (cos (* (atan2 x.im x.re) y.re)) (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.08e-47)
(exp (* y.im (- (atan2 x.im x.re))))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* 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 tmp;
if (y_46_re <= -0.00052) {
tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.08e-47) {
tmp = 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 + (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 tmp;
if (y_46_re <= -0.00052) {
tmp = Math.cos((Math.atan2(x_46_im, x_46_re) * y_46_re)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.08e-47) {
tmp = 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 + (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): tmp = 0 if y_46_re <= -0.00052: tmp = math.cos((math.atan2(x_46_im, x_46_re) * y_46_re)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) elif y_46_re <= 1.08e-47: tmp = 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 + (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) tmp = 0.0 if (y_46_re <= -0.00052) tmp = Float64(cos(Float64(atan(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.08e-47) tmp = exp(Float64(y_46_im * Float64(-atan(x_46_im, x_46_re)))); else tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -0.00052) tmp = cos((atan2(x_46_im, x_46_re) * y_46_re)) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= 1.08e-47) tmp = 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 + (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_] := If[LessEqual[y$46$re, -0.00052], N[(N[Cos[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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, 1.08e-47], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00052:\\
\;\;\;\;\cos \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;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 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -5.19999999999999954e-4Initial program 34.0%
exp-diff28.3%
exp-to-pow28.3%
hypot-def28.3%
*-commutative28.3%
exp-prod20.8%
fma-def20.8%
hypot-def60.4%
*-commutative60.4%
Simplified60.4%
Taylor expanded in y.im around 0 79.5%
Taylor expanded in y.im around 0 77.6%
unpow277.6%
unpow277.6%
hypot-def77.6%
Simplified77.6%
if -5.19999999999999954e-4 < y.re < 1.08000000000000005e-47Initial program 38.3%
exp-diff38.3%
exp-to-pow38.3%
hypot-def38.3%
*-commutative38.3%
exp-prod38.0%
fma-def38.0%
hypot-def79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.re around 0 79.7%
rec-exp79.7%
distribute-rgt-neg-in79.7%
Simplified79.7%
Taylor expanded in y.im around inf 38.3%
unpow238.3%
unpow238.3%
hypot-def79.7%
Simplified79.7%
Taylor expanded in y.im around 0 84.2%
if 1.08000000000000005e-47 < y.re Initial program 42.9%
exp-diff36.9%
exp-to-pow36.9%
hypot-def36.9%
*-commutative36.9%
exp-prod36.9%
fma-def36.9%
hypot-def52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in y.im around 0 65.4%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in y.re around 0 68.7%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.00052) (not (<= y.re 1.08e-47))) (/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re)))) (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 tmp;
if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) {
tmp = pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = 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 tmp;
if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) {
tmp = Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = 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): tmp = 0 if (y_46_re <= -0.00052) or not (y_46_re <= 1.08e-47): tmp = math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = 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) tmp = 0.0 if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) tmp = Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = 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) tmp = 0.0; if ((y_46_re <= -0.00052) || ~((y_46_re <= 1.08e-47))) tmp = (hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); else tmp = 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_] := If[Or[LessEqual[y$46$re, -0.00052], N[Not[LessEqual[y$46$re, 1.08e-47]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00052 \lor \neg \left(y.re \leq 1.08 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -5.19999999999999954e-4 or 1.08000000000000005e-47 < y.re Initial program 39.4%
exp-diff33.6%
exp-to-pow33.6%
hypot-def33.6%
*-commutative33.6%
exp-prod30.7%
fma-def30.7%
hypot-def55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 70.8%
Taylor expanded in y.im around 0 72.0%
Taylor expanded in y.re around 0 72.2%
if -5.19999999999999954e-4 < y.re < 1.08000000000000005e-47Initial program 38.3%
exp-diff38.3%
exp-to-pow38.3%
hypot-def38.3%
*-commutative38.3%
exp-prod38.0%
fma-def38.0%
hypot-def79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.re around 0 79.7%
rec-exp79.7%
distribute-rgt-neg-in79.7%
Simplified79.7%
Taylor expanded in y.im around inf 38.3%
unpow238.3%
unpow238.3%
hypot-def79.7%
Simplified79.7%
Taylor expanded in y.im around 0 84.2%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -0.00052) (not (<= y.re 1.08e-47))) (pow (hypot x.im x.re) y.re) (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 tmp;
if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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 tmp;
if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = 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): tmp = 0 if (y_46_re <= -0.00052) or not (y_46_re <= 1.08e-47): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = 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) tmp = 0.0 if ((y_46_re <= -0.00052) || !(y_46_re <= 1.08e-47)) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 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) tmp = 0.0; if ((y_46_re <= -0.00052) || ~((y_46_re <= 1.08e-47))) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; else tmp = 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_] := If[Or[LessEqual[y$46$re, -0.00052], N[Not[LessEqual[y$46$re, 1.08e-47]], $MachinePrecision]], N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision], N[Exp[N[(y$46$im * (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.00052 \lor \neg \left(y.re \leq 1.08 \cdot 10^{-47}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{y.im \cdot \left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -5.19999999999999954e-4 or 1.08000000000000005e-47 < y.re Initial program 39.4%
exp-diff33.6%
exp-to-pow33.6%
hypot-def33.6%
*-commutative33.6%
exp-prod30.7%
fma-def30.7%
hypot-def55.6%
*-commutative55.6%
Simplified55.6%
Taylor expanded in y.im around 0 70.8%
Taylor expanded in y.im around 0 65.9%
unpow265.9%
unpow265.9%
hypot-def67.6%
Simplified67.6%
Taylor expanded in y.re around 0 69.2%
if -5.19999999999999954e-4 < y.re < 1.08000000000000005e-47Initial program 38.3%
exp-diff38.3%
exp-to-pow38.3%
hypot-def38.3%
*-commutative38.3%
exp-prod38.0%
fma-def38.0%
hypot-def79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in y.re around 0 79.7%
rec-exp79.7%
distribute-rgt-neg-in79.7%
Simplified79.7%
Taylor expanded in y.im around inf 38.3%
unpow238.3%
unpow238.3%
hypot-def79.7%
Simplified79.7%
Taylor expanded in y.im around 0 84.2%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (pow (hypot x.im x.re) y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return pow(hypot(x_46_im, x_46_re), y_46_re);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.pow(math.hypot(x_46_im, x_46_re), y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return hypot(x_46_im, x_46_re) ^ y_46_re end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = hypot(x_46_im, x_46_re) ^ y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]
\begin{array}{l}
\\
{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}
\end{array}
Initial program 38.9%
exp-diff35.8%
exp-to-pow35.8%
hypot-def35.8%
*-commutative35.8%
exp-prod34.1%
fma-def34.1%
hypot-def66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.im around 0 59.8%
Taylor expanded in y.im around 0 50.9%
unpow250.9%
unpow250.9%
hypot-def57.3%
Simplified57.3%
Taylor expanded in y.re around 0 58.1%
Final simplification58.1%
herbie shell --seed 2024017
(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)))))