
(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)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \left(t\_0 \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))
(*
(exp (- (* t_0 y.re) (* (atan2 x.im x.re) y.im)))
(sin (+ (* 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))) * sin(((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))) * sin(((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.sin(((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.sin(((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))) * sin(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))) * sin(((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[Sin[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 \sin \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.re (atan2 x.im x.re))) (t_1 (log (hypot x.re x.im))))
(if (or (<= y.im -140.0) (not (<= y.im 1.65e+19)))
(* (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im)))) (sin t_0))
(*
(sin (fma t_1 y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* (atan2 x.im x.re) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -140.0) || !(y_46_im <= 1.65e+19)) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(t_0);
} else {
tmp = sin(fma(t_1, y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -140.0) || !(y_46_im <= 1.65e+19)) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(t_0)); else tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); 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]}, If[Or[LessEqual[y$46$im, -140.0], N[Not[LessEqual[y$46$im, 1.65e+19]], $MachinePrecision]], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)\\
\mathbf{if}\;y.im \leq -140 \lor \neg \left(y.im \leq 1.65 \cdot 10^{+19}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if y.im < -140 or 1.65e19 < y.im Initial program 35.5%
fmm-def35.5%
hypot-define35.5%
distribute-rgt-neg-out35.5%
fma-define35.5%
hypot-define73.6%
*-commutative73.6%
Simplified73.6%
add-cube-cbrt71.5%
pow369.9%
hypot-define35.4%
*-commutative35.4%
fma-define35.4%
+-commutative35.4%
*-commutative35.4%
fma-define35.4%
*-commutative35.4%
hypot-define69.9%
Applied egg-rr69.9%
Taylor expanded in y.im around 0 78.0%
if -140 < y.im < 1.65e19Initial program 53.1%
exp-diff53.1%
exp-to-pow53.1%
hypot-define53.1%
*-commutative53.1%
exp-prod52.4%
fma-define52.4%
hypot-define89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in y.im around 0 90.4%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (fma t_0 y.im (* y.re (atan2 x.im x.re))))
(t_2 (cbrt t_1))
(t_3 (exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.re -2.3e-220)
(* t_3 (sin (* t_2 (pow (pow (cbrt t_2) 2.0) 3.0))))
(* t_3 (sin t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re)));
double t_2 = cbrt(t_1);
double t_3 = exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_re <= -2.3e-220) {
tmp = t_3 * sin((t_2 * pow(pow(cbrt(t_2), 2.0), 3.0)));
} else {
tmp = t_3 * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))) t_2 = cbrt(t_1) t_3 = exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_re <= -2.3e-220) tmp = Float64(t_3 * sin(Float64(t_2 * ((cbrt(t_2) ^ 2.0) ^ 3.0)))); else tmp = Float64(t_3 * sin(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[t$95$1, 1/3], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.3e-220], N[(t$95$3 * N[Sin[N[(t$95$2 * N[Power[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 2.0], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_2 := \sqrt[3]{t\_1}\\
t_3 := e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{-220}:\\
\;\;\;\;t\_3 \cdot \sin \left(t\_2 \cdot {\left({\left(\sqrt[3]{t\_2}\right)}^{2}\right)}^{3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \sin t\_1\\
\end{array}
\end{array}
if y.re < -2.29999999999999981e-220Initial program 42.4%
fmm-def42.4%
hypot-define42.4%
distribute-rgt-neg-out42.4%
fma-define42.4%
hypot-define85.8%
*-commutative85.8%
Simplified85.8%
add-cube-cbrt85.5%
pow386.4%
hypot-define42.1%
*-commutative42.1%
fma-define42.1%
+-commutative42.1%
*-commutative42.1%
fma-define42.1%
*-commutative42.1%
hypot-define86.4%
Applied egg-rr86.4%
Applied egg-rr90.7%
if -2.29999999999999981e-220 < y.re Initial program 46.9%
fmm-def46.9%
hypot-define46.9%
distribute-rgt-neg-out46.9%
fma-define46.9%
hypot-define80.5%
*-commutative80.5%
Simplified80.5%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im))))
(*
(exp (fma t_0 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (fma t_0 y.im (* y.re (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
return exp(fma(t_0, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(fma(t_0, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) return Float64(exp(fma(t_0, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(fma(t_0, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, N[(N[Exp[N[(t$95$0 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$0 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
e^{\mathsf{fma}\left(t\_0, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
\end{array}
Initial program 45.1%
fmm-def45.1%
hypot-define45.1%
distribute-rgt-neg-out45.1%
fma-define45.1%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
(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))))
(if (or (<= y.im -48000.0) (not (<= y.im 1.65e+19)))
(* (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im)))) (sin t_0))
(* (sin (fma t_1 y.im t_0)) (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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double tmp;
if ((y_46_im <= -48000.0) || !(y_46_im <= 1.65e+19)) {
tmp = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin(t_0);
} else {
tmp = sin(fma(t_1, y_46_im, t_0)) * pow(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) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if ((y_46_im <= -48000.0) || !(y_46_im <= 1.65e+19)) tmp = Float64(exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) * sin(t_0)); else tmp = Float64(sin(fma(t_1, y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); 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]}, If[Or[LessEqual[y$46$im, -48000.0], N[Not[LessEqual[y$46$im, 1.65e+19]], $MachinePrecision]], N[(N[Exp[N[(t$95$1 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\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)\\
\mathbf{if}\;y.im \leq -48000 \lor \neg \left(y.im \leq 1.65 \cdot 10^{+19}\right):\\
\;\;\;\;e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t\_1, y.im, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -48000 or 1.65e19 < y.im Initial program 35.8%
fmm-def35.8%
hypot-define35.8%
distribute-rgt-neg-out35.8%
fma-define35.8%
hypot-define73.3%
*-commutative73.3%
Simplified73.3%
add-cube-cbrt72.1%
pow370.5%
hypot-define35.7%
*-commutative35.7%
fma-define35.7%
+-commutative35.7%
*-commutative35.7%
fma-define35.7%
*-commutative35.7%
hypot-define70.5%
Applied egg-rr70.5%
Taylor expanded in y.im around 0 77.8%
if -48000 < y.im < 1.65e19Initial program 52.7%
fmm-def52.7%
hypot-define52.7%
distribute-rgt-neg-out52.7%
fma-define52.7%
hypot-define90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in y.im around 0 70.5%
unpow270.5%
unpow270.5%
hypot-undefine90.5%
Simplified90.5%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.im -60000.0) (not (<= y.im 2600.0)))
(*
(sin t_0)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(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 t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -60000.0) || !(y_46_im <= 2600.0)) {
tmp = sin(t_0) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -60000.0) || !(y_46_im <= 2600.0)) tmp = Float64(sin(t_0) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -60000.0], N[Not[LessEqual[y$46$im, 2600.0]], $MachinePrecision]], N[(N[Sin[t$95$0], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -60000 \lor \neg \left(y.im \leq 2600\right):\\
\;\;\;\;\sin t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -6e4 or 2600 < y.im Initial program 36.0%
Taylor expanded in y.im around 0 69.0%
if -6e4 < y.im < 2600Initial program 52.8%
fmm-def52.8%
hypot-define52.8%
distribute-rgt-neg-out52.8%
fma-define52.8%
hypot-define91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in y.im around 0 70.8%
unpow270.8%
unpow270.8%
hypot-undefine91.1%
Simplified91.1%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(*
(sin t_1)
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(t_3
(* (sin (fma (log (hypot x.re x.im)) y.im t_1)) (/ 1.0 (+ 1.0 t_0)))))
(if (<= y.re -6.2e-18)
t_2
(if (<= y.re -2.5e-95)
t_3
(if (<= y.re 1.9e-141)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 1.25e-9) t_3 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double t_3 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (1.0 / (1.0 + t_0));
double tmp;
if (y_46_re <= -6.2e-18) {
tmp = t_2;
} else if (y_46_re <= -2.5e-95) {
tmp = t_3;
} else if (y_46_re <= 1.9e-141) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 1.25e-9) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = Float64(sin(t_1) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0))) t_3 = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64(1.0 / Float64(1.0 + t_0))) tmp = 0.0 if (y_46_re <= -6.2e-18) tmp = t_2; elseif (y_46_re <= -2.5e-95) tmp = t_3; elseif (y_46_re <= 1.9e-141) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 1.25e-9) tmp = t_3; else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[t$95$1], $MachinePrecision] * 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]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -6.2e-18], t$95$2, If[LessEqual[y$46$re, -2.5e-95], t$95$3, If[LessEqual[y$46$re, 1.9e-141], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.25e-9], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
t_3 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot \frac{1}{1 + t\_0}\\
\mathbf{if}\;y.re \leq -6.2 \cdot 10^{-18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.5 \cdot 10^{-95}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-141}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{-9}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -6.20000000000000014e-18 or 1.25e-9 < y.re Initial program 45.3%
Taylor expanded in y.im around 0 81.3%
if -6.20000000000000014e-18 < y.re < -2.4999999999999999e-95 or 1.89999999999999993e-141 < y.re < 1.25e-9Initial program 39.9%
exp-diff39.9%
exp-to-pow39.9%
hypot-define39.9%
*-commutative39.9%
exp-prod39.6%
fma-define39.6%
hypot-define77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in y.im around 0 66.3%
Taylor expanded in y.re around 0 64.0%
if -2.4999999999999999e-95 < y.re < 1.89999999999999993e-141Initial program 48.3%
fmm-def48.3%
hypot-define48.3%
distribute-rgt-neg-out48.3%
fma-define48.3%
hypot-define85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in y.re around 0 41.0%
neg-mul-141.0%
distribute-lft-neg-in41.0%
*-commutative41.0%
unpow241.0%
unpow241.0%
hypot-undefine78.0%
Simplified78.0%
Final simplification76.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= y.re -0.105)
(* t_1 (pow (hypot x.im x.re) y.re))
(if (<= y.re 1.6e-141)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.im (log (hypot x.im x.re)))))
(if (<= y.re 6e-9)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ 1.0 (+ 1.0 (* (atan2 x.im x.re) y.im))))
(* t_1 (pow (sqrt (+ (pow x.im 2.0) (pow x.re 2.0))) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (y_46_re <= -0.105) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= 1.6e-141) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
} else if (y_46_re <= 6e-9) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * (1.0 / (1.0 + (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = t_1 * pow(sqrt((pow(x_46_im, 2.0) + pow(x_46_re, 2.0))), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (y_46_re <= -0.105) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= 1.6e-141) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); elseif (y_46_re <= 6e-9) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * Float64(1.0 / Float64(1.0 + Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(t_1 * (sqrt(Float64((x_46_im ^ 2.0) + (x_46_re ^ 2.0))) ^ y_46_re)); 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[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[y$46$re, -0.105], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e-141], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6e-9], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[N[Sqrt[N[(N[Power[x$46$im, 2.0], $MachinePrecision] + N[Power[x$46$re, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
\mathbf{if}\;y.re \leq -0.105:\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-141}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{-9}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot \frac{1}{1 + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {\left(\sqrt{{x.im}^{2} + {x.re}^{2}}\right)}^{y.re}\\
\end{array}
\end{array}
if y.re < -0.104999999999999996Initial program 38.3%
fmm-def38.3%
hypot-define38.3%
distribute-rgt-neg-out38.3%
fma-define38.3%
hypot-define88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in y.im around 0 78.6%
unpow278.6%
unpow278.6%
hypot-undefine80.2%
Simplified80.2%
if -0.104999999999999996 < y.re < 1.6000000000000001e-141Initial program 48.2%
fmm-def48.2%
hypot-define48.2%
distribute-rgt-neg-out48.2%
fma-define48.2%
hypot-define84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in y.re around 0 37.3%
neg-mul-137.3%
distribute-lft-neg-in37.3%
*-commutative37.3%
unpow237.3%
unpow237.3%
hypot-undefine70.9%
Simplified70.9%
if 1.6000000000000001e-141 < y.re < 5.99999999999999996e-9Initial program 32.8%
exp-diff32.8%
exp-to-pow32.8%
hypot-define32.8%
*-commutative32.8%
exp-prod32.3%
fma-define32.3%
hypot-define78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in y.im around 0 66.8%
Taylor expanded in y.re around 0 63.0%
if 5.99999999999999996e-9 < y.re Initial program 52.2%
fmm-def52.2%
hypot-define52.2%
distribute-rgt-neg-out52.2%
fma-define52.2%
hypot-define77.6%
*-commutative77.6%
Simplified77.6%
Taylor expanded in y.im around 0 74.7%
Final simplification73.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (/ -1.0 x.re)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= x.re -2.15e+89)
(*
(exp (- (* (atan2 x.im x.re) (- y.im)) (* y.re t_0)))
(sin (- t_2 (* y.im t_0))))
(if (<= x.re 2e-81)
(*
(sin t_2)
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1)))
(*
(exp (- (* y.re (log x.re)) t_1))
(sin (+ t_2 (* y.im (log x.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log((-1.0 / x_46_re));
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -2.15e+89) {
tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * sin((t_2 - (y_46_im * t_0)));
} else if (x_46_re <= 2e-81) {
tmp = sin(t_2) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = exp(((y_46_re * log(x_46_re)) - t_1)) * sin((t_2 + (y_46_im * log(x_46_re))));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = log(((-1.0d0) / x_46re))
t_1 = atan2(x_46im, x_46re) * y_46im
t_2 = y_46re * atan2(x_46im, x_46re)
if (x_46re <= (-2.15d+89)) then
tmp = exp(((atan2(x_46im, x_46re) * -y_46im) - (y_46re * t_0))) * sin((t_2 - (y_46im * t_0)))
else if (x_46re <= 2d-81) then
tmp = sin(t_2) * exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_1))
else
tmp = exp(((y_46re * log(x_46re)) - t_1)) * sin((t_2 + (y_46im * log(x_46re))))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log((-1.0 / x_46_re));
double t_1 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (x_46_re <= -2.15e+89) {
tmp = Math.exp(((Math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * Math.sin((t_2 - (y_46_im * t_0)));
} else if (x_46_re <= 2e-81) {
tmp = Math.sin(t_2) * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1));
} else {
tmp = Math.exp(((y_46_re * Math.log(x_46_re)) - t_1)) * Math.sin((t_2 + (y_46_im * Math.log(x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log((-1.0 / x_46_re)) t_1 = math.atan2(x_46_im, x_46_re) * y_46_im t_2 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if x_46_re <= -2.15e+89: tmp = math.exp(((math.atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * math.sin((t_2 - (y_46_im * t_0))) elif x_46_re <= 2e-81: tmp = math.sin(t_2) * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) else: tmp = math.exp(((y_46_re * math.log(x_46_re)) - t_1)) * math.sin((t_2 + (y_46_im * math.log(x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(Float64(-1.0 / x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (x_46_re <= -2.15e+89) tmp = Float64(exp(Float64(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) - Float64(y_46_re * t_0))) * sin(Float64(t_2 - Float64(y_46_im * t_0)))); elseif (x_46_re <= 2e-81) tmp = Float64(sin(t_2) * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1))); else tmp = Float64(exp(Float64(Float64(y_46_re * log(x_46_re)) - t_1)) * sin(Float64(t_2 + Float64(y_46_im * log(x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log((-1.0 / x_46_re)); t_1 = atan2(x_46_im, x_46_re) * y_46_im; t_2 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (x_46_re <= -2.15e+89) tmp = exp(((atan2(x_46_im, x_46_re) * -y_46_im) - (y_46_re * t_0))) * sin((t_2 - (y_46_im * t_0))); elseif (x_46_re <= 2e-81) tmp = sin(t_2) * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)); else tmp = exp(((y_46_re * log(x_46_re)) - t_1)) * sin((t_2 + (y_46_im * log(x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -2.15e+89], N[(N[Exp[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision] - N[(y$46$re * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$2 - N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2e-81], N[(N[Sin[t$95$2], $MachinePrecision] * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$2 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\frac{-1}{x.re}\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;x.re \leq -2.15 \cdot 10^{+89}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right) - y.re \cdot t\_0} \cdot \sin \left(t\_2 - y.im \cdot t\_0\right)\\
\mathbf{elif}\;x.re \leq 2 \cdot 10^{-81}:\\
\;\;\;\;\sin t\_2 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_1}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log x.re - t\_1} \cdot \sin \left(t\_2 + y.im \cdot \log x.re\right)\\
\end{array}
\end{array}
if x.re < -2.1500000000000001e89Initial program 18.6%
fmm-def18.6%
hypot-define18.6%
distribute-rgt-neg-out18.6%
fma-define18.6%
hypot-define87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x.re around -inf 82.3%
if -2.1500000000000001e89 < x.re < 1.9999999999999999e-81Initial program 59.7%
Taylor expanded in y.im around 0 69.7%
if 1.9999999999999999e-81 < x.re Initial program 44.1%
fmm-def44.1%
hypot-define44.1%
distribute-rgt-neg-out44.1%
fma-define44.1%
hypot-define78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in x.im around 0 77.7%
Final simplification75.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -0.085) (not (<= y.re 4.3e-137)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.im (log (hypot x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.085) || !(y_46_re <= 4.3e-137)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -0.085) || !(y_46_re <= 4.3e-137)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -0.085) or not (y_46_re <= 4.3e-137): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -0.085) || !(y_46_re <= 4.3e-137)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -0.085) || ~((y_46_re <= 4.3e-137))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * log(hypot(x_46_im, x_46_re)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -0.085], N[Not[LessEqual[y$46$re, 4.3e-137]], $MachinePrecision]], N[(N[Sin[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], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -0.085 \lor \neg \left(y.re \leq 4.3 \cdot 10^{-137}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -0.0850000000000000061 or 4.2999999999999998e-137 < y.re Initial program 43.7%
fmm-def43.7%
hypot-define43.7%
distribute-rgt-neg-out43.7%
fma-define43.7%
hypot-define82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in y.im around 0 68.3%
unpow268.3%
unpow268.3%
hypot-undefine72.2%
Simplified72.2%
if -0.0850000000000000061 < y.re < 4.2999999999999998e-137Initial program 47.2%
fmm-def47.2%
hypot-define47.2%
distribute-rgt-neg-out47.2%
fma-define47.2%
hypot-define83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.re around 0 36.5%
neg-mul-136.5%
distribute-lft-neg-in36.5%
*-commutative36.5%
unpow236.5%
unpow236.5%
hypot-undefine70.5%
Simplified70.5%
Final simplification71.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -2.55e-110) (not (<= y.re 1.2e-143)))
(* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (* y.im (- (log (/ -1.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 <= -2.55e-110) || !(y_46_re <= 1.2e-143)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * -log((-1.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 <= -2.55e-110) || !(y_46_re <= 1.2e-143)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((y_46_im * -Math.log((-1.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 <= -2.55e-110) or not (y_46_re <= 1.2e-143): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((y_46_im * -math.log((-1.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 <= -2.55e-110) || !(y_46_re <= 1.2e-143)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(y_46_im * Float64(-log(Float64(-1.0 / x_46_im)))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.55e-110) || ~((y_46_re <= 1.2e-143))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((y_46_im * -log((-1.0 / x_46_im)))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.55e-110], N[Not[LessEqual[y$46$re, 1.2e-143]], $MachinePrecision]], N[(N[Sin[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], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * (-N[Log[N[(-1.0 / x$46$im), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.55 \cdot 10^{-110} \lor \neg \left(y.re \leq 1.2 \cdot 10^{-143}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(y.im \cdot \left(-\log \left(\frac{-1}{x.im}\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -2.5500000000000001e-110 or 1.1999999999999999e-143 < y.re Initial program 43.9%
fmm-def43.9%
hypot-define43.9%
distribute-rgt-neg-out43.9%
fma-define43.9%
hypot-define81.9%
*-commutative81.9%
Simplified81.9%
Taylor expanded in y.im around 0 61.3%
unpow261.3%
unpow261.3%
hypot-undefine65.0%
Simplified65.0%
if -2.5500000000000001e-110 < y.re < 1.1999999999999999e-143Initial program 48.2%
fmm-def48.2%
hypot-define48.2%
distribute-rgt-neg-out48.2%
fma-define48.2%
hypot-define84.8%
*-commutative84.8%
Simplified84.8%
add-cube-cbrt86.5%
pow383.6%
hypot-define47.4%
*-commutative47.4%
fma-define47.4%
+-commutative47.4%
*-commutative47.4%
fma-define47.4%
*-commutative47.4%
hypot-define83.6%
Applied egg-rr83.6%
rem-cube-cbrt84.8%
expm1-log1p-u60.7%
expm1-undefine24.1%
Applied egg-rr24.1%
expm1-define60.7%
Simplified60.7%
Taylor expanded in x.im around -inf 23.2%
Taylor expanded in y.re around 0 34.7%
neg-mul-134.7%
distribute-lft-neg-in34.7%
mul-1-neg34.7%
distribute-lft-neg-out34.7%
Simplified34.7%
Final simplification56.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (sin t_0)))
(if (<= x.im -1.15e+35)
(* (sin (fabs t_0)) (pow x.im y.re))
(if (<= x.im 5.5e-77) (* t_1 (pow x.re y.re)) (* t_1 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = sin(t_0);
double tmp;
if (x_46_im <= -1.15e+35) {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
} else if (x_46_im <= 5.5e-77) {
tmp = t_1 * pow(x_46_re, y_46_re);
} else {
tmp = t_1 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y_46re * atan2(x_46im, x_46re)
t_1 = sin(t_0)
if (x_46im <= (-1.15d+35)) then
tmp = sin(abs(t_0)) * (x_46im ** y_46re)
else if (x_46im <= 5.5d-77) then
tmp = t_1 * (x_46re ** y_46re)
else
tmp = t_1 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0);
double tmp;
if (x_46_im <= -1.15e+35) {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_46_re);
} else if (x_46_im <= 5.5e-77) {
tmp = t_1 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_1 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.sin(t_0) tmp = 0 if x_46_im <= -1.15e+35: tmp = math.sin(math.fabs(t_0)) * math.pow(x_46_im, y_46_re) elif x_46_im <= 5.5e-77: tmp = t_1 * math.pow(x_46_re, y_46_re) else: tmp = t_1 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(t_0) tmp = 0.0 if (x_46_im <= -1.15e+35) tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); elseif (x_46_im <= 5.5e-77) tmp = Float64(t_1 * (x_46_re ^ y_46_re)); else tmp = Float64(t_1 * (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 = y_46_re * atan2(x_46_im, x_46_re); t_1 = sin(t_0); tmp = 0.0; if (x_46_im <= -1.15e+35) tmp = sin(abs(t_0)) * (x_46_im ^ y_46_re); elseif (x_46_im <= 5.5e-77) tmp = t_1 * (x_46_re ^ y_46_re); else tmp = t_1 * (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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[x$46$im, -1.15e+35], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 5.5e-77], N[(t$95$1 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0\\
\mathbf{if}\;x.im \leq -1.15 \cdot 10^{+35}:\\
\;\;\;\;\sin \left(\left|t\_0\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;x.im \leq 5.5 \cdot 10^{-77}:\\
\;\;\;\;t\_1 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -1.1499999999999999e35Initial program 13.7%
fmm-def13.7%
hypot-define13.7%
distribute-rgt-neg-out13.7%
fma-define13.7%
hypot-define75.0%
*-commutative75.0%
Simplified75.0%
Taylor expanded in y.im around 0 38.4%
unpow238.4%
unpow238.4%
hypot-undefine41.0%
Simplified41.0%
Taylor expanded in x.re around 0 29.5%
add-sqr-sqrt19.7%
fabs-sqr19.7%
add-sqr-sqrt33.4%
Applied egg-rr33.4%
if -1.1499999999999999e35 < x.im < 5.49999999999999998e-77Initial program 56.8%
fmm-def56.8%
hypot-define56.8%
distribute-rgt-neg-out56.8%
fma-define56.8%
hypot-define84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in y.im around 0 56.0%
unpow256.0%
unpow256.0%
hypot-undefine52.4%
Simplified52.4%
Taylor expanded in x.im around 0 45.9%
if 5.49999999999999998e-77 < x.im Initial program 46.2%
fmm-def46.2%
hypot-define46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 52.9%
unpow252.9%
unpow252.9%
hypot-undefine51.9%
Simplified51.9%
Taylor expanded in x.re around 0 51.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* 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 sin((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.sin((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.sin((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(sin(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 = sin((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[Sin[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}
\\
\sin \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 45.1%
fmm-def45.1%
hypot-define45.1%
distribute-rgt-neg-out45.1%
fma-define45.1%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 51.6%
unpow251.6%
unpow251.6%
hypot-undefine50.0%
Simplified50.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))) (if (<= x.im 1.25e-76) (* t_0 (pow 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 1.25e-76) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= 1.25d-76) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 1.25e-76) {
tmp = t_0 * Math.pow(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.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= 1.25e-76: tmp = t_0 * math.pow(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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= 1.25e-76) tmp = Float64(t_0 * (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 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= 1.25e-76) tmp = t_0 * (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[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, 1.25e-76], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq 1.25 \cdot 10^{-76}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < 1.2499999999999999e-76Initial program 44.6%
fmm-def44.6%
hypot-define44.6%
distribute-rgt-neg-out44.6%
fma-define44.6%
hypot-define81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y.im around 0 51.0%
unpow251.0%
unpow251.0%
hypot-undefine49.2%
Simplified49.2%
Taylor expanded in x.im around 0 39.3%
if 1.2499999999999999e-76 < x.im Initial program 46.2%
fmm-def46.2%
hypot-define46.2%
distribute-rgt-neg-out46.2%
fma-define46.2%
hypot-define85.5%
*-commutative85.5%
Simplified85.5%
Taylor expanded in y.im around 0 52.9%
unpow252.9%
unpow252.9%
hypot-undefine51.9%
Simplified51.9%
Taylor expanded in x.re around 0 51.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) (pow x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(x_46_im, 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
code = sin((y_46re * atan2(x_46im, x_46re))) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (x_46_im ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[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]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 45.1%
fmm-def45.1%
hypot-define45.1%
distribute-rgt-neg-out45.1%
fma-define45.1%
hypot-define82.7%
*-commutative82.7%
Simplified82.7%
Taylor expanded in y.im around 0 51.6%
unpow251.6%
unpow251.6%
hypot-undefine50.0%
Simplified50.0%
Taylor expanded in x.re around 0 35.6%
herbie shell --seed 2024177
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))