
(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 23 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 (* y.im (log (hypot x.im x.re))))
(t_2 (log (hypot x.re x.im)))
(t_3 (exp (fma t_2 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.im -185000000.0)
(* t_3 (sin (pow (cbrt t_1) 3.0)))
(if (<= y.im 50000000000000.0)
(*
(sin (fma t_2 y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (pow (exp y.im) (atan2 x.im x.re))))
(if (<= y.im 1.05e+201)
(* t_3 (sin t_1))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_2 = log(hypot(x_46_re, x_46_im));
double t_3 = exp(fma(t_2, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -185000000.0) {
tmp = t_3 * sin(pow(cbrt(t_1), 3.0));
} else if (y_46_im <= 50000000000000.0) {
tmp = sin(fma(t_2, y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / pow(exp(y_46_im), atan2(x_46_im, x_46_re)));
} else if (y_46_im <= 1.05e+201) {
tmp = t_3 * sin(t_1);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = log(hypot(x_46_re, x_46_im)) t_3 = exp(fma(t_2, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_im <= -185000000.0) tmp = Float64(t_3 * sin((cbrt(t_1) ^ 3.0))); elseif (y_46_im <= 50000000000000.0) tmp = Float64(sin(fma(t_2, y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / (exp(y_46_im) ^ atan(x_46_im, x_46_re)))); elseif (y_46_im <= 1.05e+201) tmp = Float64(t_3 * sin(t_1)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(t$95$2 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -185000000.0], N[(t$95$3 * N[Sin[N[Power[N[Power[t$95$1, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 50000000000000.0], N[(N[Sin[N[(t$95$2 * 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[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.05e+201], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_3 := e^{\mathsf{fma}\left(t_2, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.im \leq -185000000:\\
\;\;\;\;t_3 \cdot \sin \left({\left(\sqrt[3]{t_1}\right)}^{3}\right)\\
\mathbf{elif}\;y.im \leq 50000000000000:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_2, y.im, t_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+201}:\\
\;\;\;\;t_3 \cdot \sin t_1\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\end{array}
\end{array}
if y.im < -1.85e8Initial program 40.9%
cancel-sign-sub-inv40.9%
fma-def40.9%
hypot-def40.9%
distribute-lft-neg-in40.9%
distribute-rgt-neg-out40.9%
fma-def40.9%
hypot-def77.9%
*-commutative77.9%
Simplified77.9%
add-cube-cbrt79.7%
pow377.6%
fma-udef77.6%
*-commutative77.6%
*-commutative77.6%
fma-def77.6%
Applied egg-rr77.6%
Taylor expanded in y.re around 0 21.2%
unpow1/339.4%
unpow239.4%
unpow239.4%
hypot-def79.1%
Simplified79.1%
if -1.85e8 < y.im < 5e13Initial program 49.7%
exp-diff49.7%
exp-to-pow49.8%
hypot-def49.8%
*-commutative49.8%
exp-prod49.8%
fma-def49.8%
hypot-def93.2%
*-commutative93.2%
Simplified93.2%
if 5e13 < y.im < 1.05e201Initial program 31.1%
cancel-sign-sub-inv31.1%
fma-def31.1%
hypot-def31.1%
distribute-lft-neg-in31.1%
distribute-rgt-neg-out31.1%
fma-def31.1%
hypot-def65.5%
*-commutative65.5%
Simplified65.5%
add-cube-cbrt71.0%
pow368.2%
fma-udef68.2%
*-commutative68.2%
*-commutative68.2%
fma-def68.2%
Applied egg-rr68.2%
Taylor expanded in y.re around 0 36.6%
pow-base-136.6%
*-lft-identity36.6%
unpow236.6%
unpow236.6%
hypot-def73.9%
Simplified73.9%
if 1.05e201 < y.im Initial program 36.4%
Taylor expanded in y.im around 0 77.5%
Final simplification85.5%
(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))))
(expm1 (log1p (sin (fma (atan2 x.im x.re) y.re (* t_0 y.im))))))))
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))) * expm1(log1p(sin(fma(atan2(x_46_im, x_46_re), y_46_re, (t_0 * y_46_im)))));
}
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)))) * expm1(log1p(sin(fma(atan(x_46_im, x_46_re), y_46_re, Float64(t_0 * y_46_im)))))) 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[(Exp[N[Log[1 + N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(t$95$0 * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]] - 1), $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 \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t_0 \cdot y.im\right)\right)\right)\right)
\end{array}
\end{array}
Initial program 43.7%
cancel-sign-sub-inv43.7%
fma-def43.7%
hypot-def43.7%
distribute-lft-neg-in43.7%
distribute-rgt-neg-out43.7%
fma-def43.7%
hypot-def82.4%
*-commutative82.4%
Simplified82.4%
add-cube-cbrt81.4%
pow381.2%
fma-udef81.2%
*-commutative81.2%
*-commutative81.2%
fma-def81.2%
Applied egg-rr81.2%
rem-cube-cbrt82.4%
expm1-log1p-u82.4%
fma-udef82.4%
rem-exp-log44.6%
+-commutative44.6%
fma-def44.6%
rem-exp-log82.4%
Applied egg-rr82.4%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.im))
(t_2 (* y.im (log (hypot x.im x.re))))
(t_3 (log (hypot x.re x.im)))
(t_4 (exp (fma t_3 y.re (* (atan2 x.im x.re) (- y.im))))))
(if (<= y.im -0.00033)
(* t_4 (sin (pow (cbrt t_2) 3.0)))
(if (<= y.im 1.5e-25)
(*
(sin (fma t_3 y.im t_0))
(/ (pow (hypot x.re x.im) y.re) (+ t_1 1.0)))
(if (<= y.im 1.05e+201)
(* t_4 (sin t_2))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_1))
(sin t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = atan2(x_46_im, x_46_re) * y_46_im;
double t_2 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_3 = log(hypot(x_46_re, x_46_im));
double t_4 = exp(fma(t_3, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
double tmp;
if (y_46_im <= -0.00033) {
tmp = t_4 * sin(pow(cbrt(t_2), 3.0));
} else if (y_46_im <= 1.5e-25) {
tmp = sin(fma(t_3, y_46_im, t_0)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_1 + 1.0));
} else if (y_46_im <= 1.05e+201) {
tmp = t_4 * sin(t_2);
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_1)) * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = Float64(atan(x_46_im, x_46_re) * y_46_im) t_2 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_3 = log(hypot(x_46_re, x_46_im)) t_4 = exp(fma(t_3, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))) tmp = 0.0 if (y_46_im <= -0.00033) tmp = Float64(t_4 * sin((cbrt(t_2) ^ 3.0))); elseif (y_46_im <= 1.5e-25) tmp = Float64(sin(fma(t_3, y_46_im, t_0)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_1 + 1.0))); elseif (y_46_im <= 1.05e+201) tmp = Float64(t_4 * sin(t_2)); else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_1)) * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Exp[N[(t$95$3 * y$46$re + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -0.00033], N[(t$95$4 * N[Sin[N[Power[N[Power[t$95$2, 1/3], $MachinePrecision], 3.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.5e-25], N[(N[Sin[N[(t$95$3 * 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[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.05e+201], N[(t$95$4 * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_2 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_3 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_4 := e^{\mathsf{fma}\left(t_3, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{if}\;y.im \leq -0.00033:\\
\;\;\;\;t_4 \cdot \sin \left({\left(\sqrt[3]{t_2}\right)}^{3}\right)\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{-25}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_3, y.im, t_0\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_1 + 1}\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+201}:\\
\;\;\;\;t_4 \cdot \sin t_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_1} \cdot \sin t_0\\
\end{array}
\end{array}
if y.im < -3.3e-4Initial program 39.1%
cancel-sign-sub-inv39.1%
fma-def39.1%
hypot-def39.1%
distribute-lft-neg-in39.1%
distribute-rgt-neg-out39.1%
fma-def39.1%
hypot-def78.8%
*-commutative78.8%
Simplified78.8%
add-cube-cbrt80.6%
pow378.6%
fma-udef78.6%
*-commutative78.6%
*-commutative78.6%
fma-def78.6%
Applied egg-rr78.6%
Taylor expanded in y.re around 0 20.3%
unpow1/337.7%
unpow237.7%
unpow237.7%
hypot-def80.0%
Simplified80.0%
if -3.3e-4 < y.im < 1.4999999999999999e-25Initial program 52.5%
exp-diff52.5%
exp-to-pow52.6%
hypot-def52.6%
*-commutative52.6%
exp-prod52.6%
fma-def52.6%
hypot-def94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in y.im around 0 94.0%
if 1.4999999999999999e-25 < y.im < 1.05e201Initial program 29.1%
cancel-sign-sub-inv29.1%
fma-def29.1%
hypot-def29.1%
distribute-lft-neg-in29.1%
distribute-rgt-neg-out29.1%
fma-def29.1%
hypot-def66.8%
*-commutative66.8%
Simplified66.8%
add-cube-cbrt71.8%
pow369.4%
fma-udef69.4%
*-commutative69.4%
*-commutative69.4%
fma-def69.4%
Applied egg-rr69.4%
Taylor expanded in y.re around 0 33.8%
pow-base-133.8%
*-lft-identity33.8%
unpow233.8%
unpow233.8%
hypot-def73.9%
Simplified73.9%
if 1.05e201 < y.im Initial program 36.4%
Taylor expanded in y.im around 0 77.5%
Final simplification85.5%
(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 43.7%
cancel-sign-sub-inv43.7%
fma-def43.7%
hypot-def43.7%
distribute-lft-neg-in43.7%
distribute-rgt-neg-out43.7%
fma-def43.7%
hypot-def82.4%
*-commutative82.4%
Simplified82.4%
Final simplification82.4%
(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 (atan2 x.im x.re) y.re (* t_0 y.im))))))
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(atan2(x_46_im, x_46_re), y_46_re, (t_0 * y_46_im)));
}
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(atan(x_46_im, x_46_re), y_46_re, Float64(t_0 * y_46_im)))) 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re + N[(t$95$0 * y$46$im), $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(\tan^{-1}_* \frac{x.im}{x.re}, y.re, t_0 \cdot y.im\right)\right)
\end{array}
\end{array}
Initial program 43.7%
cancel-sign-sub-inv43.7%
fma-def43.7%
hypot-def43.7%
distribute-lft-neg-in43.7%
distribute-rgt-neg-out43.7%
fma-def43.7%
hypot-def82.4%
*-commutative82.4%
Simplified82.4%
add-cube-cbrt81.4%
pow381.2%
fma-udef81.2%
*-commutative81.2%
*-commutative81.2%
fma-def81.2%
Applied egg-rr81.2%
rem-cube-cbrt82.4%
fma-udef82.4%
rem-exp-log44.6%
+-commutative44.6%
fma-def44.6%
rem-exp-log82.4%
Applied egg-rr82.4%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (log (hypot x.re x.im)))
(t_2
(*
(exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im))))
(sin (* y.im (log (hypot x.im x.re))))))
(t_3 (* y.re (atan2 x.im x.re))))
(if (<= y.im -0.00033)
t_2
(if (<= y.im 1.32e-25)
(*
(sin (fma t_1 y.im t_3))
(/ (pow (hypot x.re x.im) y.re) (+ t_0 1.0)))
(if (<= y.im 2.85e+202)
t_2
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_3)))))))
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 = log(hypot(x_46_re, x_46_im));
double t_2 = exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im))) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
double t_3 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -0.00033) {
tmp = t_2;
} else if (y_46_im <= 1.32e-25) {
tmp = sin(fma(t_1, y_46_im, t_3)) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (t_0 + 1.0));
} else if (y_46_im <= 2.85e+202) {
tmp = t_2;
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_3);
}
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 = log(hypot(x_46_re, x_46_im)) t_2 = Float64(exp(fma(t_1, y_46_re, 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))))) t_3 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -0.00033) tmp = t_2; elseif (y_46_im <= 1.32e-25) tmp = Float64(sin(fma(t_1, y_46_im, t_3)) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(t_0 + 1.0))); elseif (y_46_im <= 2.85e+202) tmp = t_2; else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * sin(t_3)); 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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -0.00033], t$95$2, If[LessEqual[y$46$im, 1.32e-25], N[(N[Sin[N[(t$95$1 * y$46$im + t$95$3), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.85e+202], t$95$2, N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := e^{\mathsf{fma}\left(t_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)} \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_3 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -0.00033:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq 1.32 \cdot 10^{-25}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_1, y.im, t_3\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{t_0 + 1}\\
\mathbf{elif}\;y.im \leq 2.85 \cdot 10^{+202}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot \sin t_3\\
\end{array}
\end{array}
if y.im < -3.3e-4 or 1.3199999999999999e-25 < y.im < 2.8499999999999998e202Initial program 35.3%
cancel-sign-sub-inv35.3%
fma-def35.3%
hypot-def35.3%
distribute-lft-neg-in35.3%
distribute-rgt-neg-out35.3%
fma-def35.3%
hypot-def74.3%
*-commutative74.3%
Simplified74.3%
add-cube-cbrt77.3%
pow375.1%
fma-udef75.1%
*-commutative75.1%
*-commutative75.1%
fma-def75.1%
Applied egg-rr75.1%
Taylor expanded in y.re around 0 36.2%
pow-base-136.2%
*-lft-identity36.2%
unpow236.2%
unpow236.2%
hypot-def77.0%
Simplified77.0%
if -3.3e-4 < y.im < 1.3199999999999999e-25Initial program 52.5%
exp-diff52.5%
exp-to-pow52.6%
hypot-def52.6%
*-commutative52.6%
exp-prod52.6%
fma-def52.6%
hypot-def94.0%
*-commutative94.0%
Simplified94.0%
Taylor expanded in y.im around 0 94.0%
if 2.8499999999999998e202 < y.im Initial program 36.4%
Taylor expanded in y.im around 0 77.5%
Final simplification85.2%
(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 (log (hypot x.re x.im))))
(if (<= y.re -0.00015)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (fabs t_1)))
(if (<= y.re 0.7)
(* (sin (fma t_2 y.im t_1)) (exp t_0))
(* (exp (fma t_2 y.re t_0)) (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 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 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= -0.00015) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(fabs(t_1));
} else if (y_46_re <= 0.7) {
tmp = sin(fma(t_2, y_46_im, t_1)) * exp(t_0);
} else {
tmp = exp(fma(t_2, y_46_re, t_0)) * sin((y_46_im * log(hypot(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= -0.00015) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(abs(t_1))); elseif (y_46_re <= 0.7) tmp = Float64(sin(fma(t_2, y_46_im, t_1)) * exp(t_0)); else tmp = Float64(exp(fma(t_2, y_46_re, t_0)) * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00015], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.7], N[(N[Sin[N[(t$95$2 * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(t$95$2 * y$46$re + t$95$0), $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}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq -0.00015:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\left|t_1\right|\right)\\
\mathbf{elif}\;y.re \leq 0.7:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(t_2, y.im, t_1\right)\right) \cdot e^{t_0}\\
\mathbf{else}:\\
\;\;\;\;e^{\mathsf{fma}\left(t_2, y.re, t_0\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 < -1.49999999999999987e-4Initial program 40.8%
add-sqr-sqrt18.0%
sqrt-unprod22.6%
pow222.6%
Applied egg-rr22.6%
*-commutative22.6%
unpow222.6%
rem-sqrt-square42.3%
Simplified42.3%
Taylor expanded in y.im around 0 92.3%
if -1.49999999999999987e-4 < y.re < 0.69999999999999996Initial program 42.8%
cancel-sign-sub-inv42.8%
fma-def42.8%
hypot-def42.8%
distribute-lft-neg-in42.8%
distribute-rgt-neg-out42.8%
fma-def42.8%
hypot-def82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in y.re around 0 81.8%
neg-mul-181.8%
*-commutative81.8%
distribute-rgt-neg-in81.8%
Simplified81.8%
if 0.69999999999999996 < y.re Initial program 48.4%
cancel-sign-sub-inv48.4%
fma-def48.4%
hypot-def48.4%
distribute-lft-neg-in48.4%
distribute-rgt-neg-out48.4%
fma-def48.4%
hypot-def75.0%
*-commutative75.0%
Simplified75.0%
add-cube-cbrt73.4%
pow371.9%
fma-udef71.9%
*-commutative71.9%
*-commutative71.9%
fma-def71.9%
Applied egg-rr71.9%
Taylor expanded in y.re around 0 50.0%
pow-base-150.0%
*-lft-identity50.0%
unpow250.0%
unpow250.0%
hypot-def78.1%
Simplified78.1%
Final simplification83.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(if (<= y.re -0.0116)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 0.0035)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (sin t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double tmp;
if (y_46_re <= -0.0116) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 0.0035) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_1 * sin(t_0);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = 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))) tmp = 0.0 if (y_46_re <= -0.0116) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 0.0035) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_1 * sin(t_0)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[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]}, If[LessEqual[y$46$re, -0.0116], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.0035], 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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := 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{if}\;y.re \leq -0.0116:\\
\;\;\;\;t_1 \cdot \sin \left(\left|t_0\right|\right)\\
\mathbf{elif}\;y.re \leq 0.0035:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sin t_0\\
\end{array}
\end{array}
if y.re < -0.0116Initial program 40.8%
add-sqr-sqrt18.0%
sqrt-unprod22.6%
pow222.6%
Applied egg-rr22.6%
*-commutative22.6%
unpow222.6%
rem-sqrt-square42.3%
Simplified42.3%
Taylor expanded in y.im around 0 92.3%
if -0.0116 < y.re < 0.00350000000000000007Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-def42.4%
hypot-def42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-def42.4%
hypot-def82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.re around 0 82.4%
neg-mul-182.4%
*-commutative82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
if 0.00350000000000000007 < y.re Initial program 49.2%
Taylor expanded in y.im around 0 67.7%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (or (<= y.re -1.46e-5) (not (<= y.re 0.00135)))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_re <= -1.46e-5) || !(y_46_re <= 0.00135)) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin(t_0);
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_re <= -1.46e-5) || !(y_46_re <= 0.00135)) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(t_0)); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.46e-5], N[Not[LessEqual[y$46$re, 0.00135]], $MachinePrecision]], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.46 \cdot 10^{-5} \lor \neg \left(y.re \leq 0.00135\right):\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin t_0\\
\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 e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.46000000000000008e-5 or 0.0013500000000000001 < y.re Initial program 44.9%
Taylor expanded in y.im around 0 79.3%
if -1.46000000000000008e-5 < y.re < 0.0013500000000000001Initial program 42.4%
cancel-sign-sub-inv42.4%
fma-def42.4%
hypot-def42.4%
distribute-lft-neg-in42.4%
distribute-rgt-neg-out42.4%
fma-def42.4%
hypot-def82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y.re around 0 82.4%
neg-mul-182.4%
*-commutative82.4%
distribute-rgt-neg-in82.4%
Simplified82.4%
Final simplification80.8%
(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)))
(if (<= x.re -6e-7)
(* t_2 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 2.3e-26)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(/ (* (sin (+ t_1 (* y.im (log x.re)))) (pow x.re y.re)) (exp t_0))))))
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);
double tmp;
if (x_46_re <= -6e-7) {
tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 2.3e-26) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * pow(x_46_re, y_46_re)) / exp(t_0);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = y_46re * atan2(x_46im, x_46re)
t_2 = sin(t_1)
if (x_46re <= (-6d-7)) then
tmp = t_2 * exp(((y_46re * log(-x_46re)) - t_0))
else if (x_46re <= 2.3d-26) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_2
else
tmp = (sin((t_1 + (y_46im * log(x_46re)))) * (x_46re ** y_46re)) / exp(t_0)
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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_re <= -6e-7) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 2.3e-26) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = (Math.sin((t_1 + (y_46_im * Math.log(x_46_re)))) * Math.pow(x_46_re, y_46_re)) / Math.exp(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_re <= -6e-7: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 2.3e-26: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2 else: tmp = (math.sin((t_1 + (y_46_im * math.log(x_46_re)))) * math.pow(x_46_re, y_46_re)) / math.exp(t_0) 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 = sin(t_1) tmp = 0.0 if (x_46_re <= -6e-7) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 2.3e-26) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_2); else tmp = Float64(Float64(sin(Float64(t_1 + Float64(y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_re <= -6e-7) tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 2.3e-26) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2; else tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(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[(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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -6e-7], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 2.3e-26], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\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\\
\mathbf{if}\;x.re \leq -6 \cdot 10^{-7}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 2.3 \cdot 10^{-26}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(t_1 + y.im \cdot \log x.re\right) \cdot {x.re}^{y.re}}{e^{t_0}}\\
\end{array}
\end{array}
if x.re < -5.9999999999999997e-7Initial program 38.1%
Taylor expanded in y.im around 0 61.1%
Taylor expanded in x.re around -inf 68.2%
mul-1-neg68.2%
Simplified68.2%
if -5.9999999999999997e-7 < x.re < 2.30000000000000009e-26Initial program 57.0%
Taylor expanded in y.im around 0 55.9%
if 2.30000000000000009e-26 < x.re Initial program 26.1%
exp-diff26.1%
exp-to-pow26.3%
hypot-def26.3%
*-commutative26.3%
exp-prod26.1%
fma-def26.1%
hypot-def75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x.im around 0 71.2%
Taylor expanded in x.im around 0 71.8%
Final simplification63.5%
(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)))
(if (<= x.re -1.58e-239)
(*
t_2
(exp (- (* y.re (log (- (/ (* -0.5 (pow x.im 2.0)) x.re) x.re))) t_0)))
(if (<= x.re 6.8e-23)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(/ (* (sin (+ t_1 (* y.im (log x.re)))) (pow x.re y.re)) (exp t_0))))))
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);
double tmp;
if (x_46_re <= -1.58e-239) {
tmp = t_2 * exp(((y_46_re * log((((-0.5 * pow(x_46_im, 2.0)) / x_46_re) - x_46_re))) - t_0));
} else if (x_46_re <= 6.8e-23) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * pow(x_46_re, y_46_re)) / exp(t_0);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = atan2(x_46im, x_46re) * y_46im
t_1 = y_46re * atan2(x_46im, x_46re)
t_2 = sin(t_1)
if (x_46re <= (-1.58d-239)) then
tmp = t_2 * exp(((y_46re * log(((((-0.5d0) * (x_46im ** 2.0d0)) / x_46re) - x_46re))) - t_0))
else if (x_46re <= 6.8d-23) then
tmp = exp(((y_46re * log(sqrt(((x_46re * x_46re) + (x_46im * x_46im))))) - t_0)) * t_2
else
tmp = (sin((t_1 + (y_46im * log(x_46re)))) * (x_46re ** y_46re)) / exp(t_0)
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.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_re <= -1.58e-239) {
tmp = t_2 * Math.exp(((y_46_re * Math.log((((-0.5 * Math.pow(x_46_im, 2.0)) / x_46_re) - x_46_re))) - t_0));
} else if (x_46_re <= 6.8e-23) {
tmp = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else {
tmp = (Math.sin((t_1 + (y_46_im * Math.log(x_46_re)))) * Math.pow(x_46_re, y_46_re)) / Math.exp(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_re <= -1.58e-239: tmp = t_2 * math.exp(((y_46_re * math.log((((-0.5 * math.pow(x_46_im, 2.0)) / x_46_re) - x_46_re))) - t_0)) elif x_46_re <= 6.8e-23: tmp = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2 else: tmp = (math.sin((t_1 + (y_46_im * math.log(x_46_re)))) * math.pow(x_46_re, y_46_re)) / math.exp(t_0) 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 = sin(t_1) tmp = 0.0 if (x_46_re <= -1.58e-239) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(Float64(Float64(-0.5 * (x_46_im ^ 2.0)) / x_46_re) - x_46_re))) - t_0))); elseif (x_46_re <= 6.8e-23) tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) * t_2); else tmp = Float64(Float64(sin(Float64(t_1 + Float64(y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_re <= -1.58e-239) tmp = t_2 * exp(((y_46_re * log((((-0.5 * (x_46_im ^ 2.0)) / x_46_re) - x_46_re))) - t_0)); elseif (x_46_re <= 6.8e-23) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2; else tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(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[(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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -1.58e-239], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[N[(N[(N[(-0.5 * N[Power[x$46$im, 2.0], $MachinePrecision]), $MachinePrecision] / x$46$re), $MachinePrecision] - x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 6.8e-23], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], N[(N[(N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\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\\
\mathbf{if}\;x.re \leq -1.58 \cdot 10^{-239}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(\frac{-0.5 \cdot {x.im}^{2}}{x.re} - x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 6.8 \cdot 10^{-23}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t_0} \cdot t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(t_1 + y.im \cdot \log x.re\right) \cdot {x.re}^{y.re}}{e^{t_0}}\\
\end{array}
\end{array}
if x.re < -1.5799999999999999e-239Initial program 47.6%
Taylor expanded in y.im around 0 60.3%
Taylor expanded in x.re around -inf 64.6%
+-commutative64.6%
mul-1-neg64.6%
unsub-neg64.6%
associate-*r/64.6%
Simplified64.6%
if -1.5799999999999999e-239 < x.re < 6.8000000000000001e-23Initial program 53.8%
Taylor expanded in y.im around 0 54.2%
if 6.8000000000000001e-23 < x.re Initial program 26.1%
exp-diff26.1%
exp-to-pow26.3%
hypot-def26.3%
*-commutative26.3%
exp-prod26.1%
fma-def26.1%
hypot-def75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x.im around 0 71.2%
Taylor expanded in x.im around 0 71.8%
Final simplification63.5%
(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)))
(if (<= x.re -1.6e-259)
(* t_2 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 1.26e-43)
(* t_2 (pow (hypot x.im x.re) y.re))
(/ (* (sin (+ t_1 (* y.im (log x.re)))) (pow x.re y.re)) (exp t_0))))))
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);
double tmp;
if (x_46_re <= -1.6e-259) {
tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.26e-43) {
tmp = t_2 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * pow(x_46_re, y_46_re)) / exp(t_0);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_re <= -1.6e-259) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 1.26e-43) {
tmp = t_2 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = (Math.sin((t_1 + (y_46_im * Math.log(x_46_re)))) * Math.pow(x_46_re, y_46_re)) / Math.exp(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_re <= -1.6e-259: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 1.26e-43: tmp = t_2 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = (math.sin((t_1 + (y_46_im * math.log(x_46_re)))) * math.pow(x_46_re, y_46_re)) / math.exp(t_0) 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 = sin(t_1) tmp = 0.0 if (x_46_re <= -1.6e-259) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 1.26e-43) tmp = Float64(t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(Float64(sin(Float64(t_1 + Float64(y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(t_0)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_re <= -1.6e-259) tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 1.26e-43) tmp = t_2 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = (sin((t_1 + (y_46_im * log(x_46_re)))) * (x_46_re ^ y_46_re)) / exp(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[(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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$re, -1.6e-259], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.26e-43], N[(t$95$2 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision] / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]]]]]]
\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\\
\mathbf{if}\;x.re \leq -1.6 \cdot 10^{-259}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 1.26 \cdot 10^{-43}:\\
\;\;\;\;t_2 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(t_1 + y.im \cdot \log x.re\right) \cdot {x.re}^{y.re}}{e^{t_0}}\\
\end{array}
\end{array}
if x.re < -1.59999999999999994e-259Initial program 47.2%
Taylor expanded in y.im around 0 60.5%
Taylor expanded in x.re around -inf 64.7%
mul-1-neg64.7%
Simplified64.7%
if -1.59999999999999994e-259 < x.re < 1.26e-43Initial program 54.8%
exp-diff46.4%
exp-to-pow46.4%
hypot-def46.4%
*-commutative46.4%
exp-prod46.4%
fma-def46.4%
hypot-def73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in x.im around 0 46.6%
Taylor expanded in y.im around 0 45.5%
unpow245.5%
unpow245.5%
hypot-def45.7%
Simplified45.7%
if 1.26e-43 < x.re Initial program 26.8%
exp-diff26.8%
exp-to-pow26.9%
hypot-def26.9%
*-commutative26.9%
exp-prod26.7%
fma-def26.7%
hypot-def75.9%
*-commutative75.9%
Simplified75.9%
Taylor expanded in x.im around 0 70.6%
Taylor expanded in x.im around 0 71.2%
Final simplification61.2%
(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)))
(if (<= x.im -3.9e-240)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 9.2e-27)
(* (sin (fabs t_1)) (pow (hypot x.im x.re) y.re))
(* t_2 (exp (- (* y.re (log x.im)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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);
double tmp;
if (x_46_im <= -3.9e-240) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 9.2e-27) {
tmp = sin(fabs(t_1)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double tmp;
if (x_46_im <= -3.9e-240) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 9.2e-27) {
tmp = Math.sin(Math.abs(t_1)) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_2 * Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) tmp = 0 if x_46_im <= -3.9e-240: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 9.2e-27: tmp = math.sin(math.fabs(t_1)) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_2 * math.exp(((y_46_re * math.log(x_46_im)) - t_0)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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 = sin(t_1) tmp = 0.0 if (x_46_im <= -3.9e-240) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 9.2e-27) tmp = Float64(sin(abs(t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); tmp = 0.0; if (x_46_im <= -3.9e-240) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 9.2e-27) tmp = sin(abs(t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_2 * exp(((y_46_re * log(x_46_im)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(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[Sin[t$95$1], $MachinePrecision]}, If[LessEqual[x$46$im, -3.9e-240], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$im)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 9.2e-27], N[(N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\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\\
\mathbf{if}\;x.im \leq -3.9 \cdot 10^{-240}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t_0}\\
\mathbf{elif}\;x.im \leq 9.2 \cdot 10^{-27}:\\
\;\;\;\;\sin \left(\left|t_1\right|\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot e^{y.re \cdot \log x.im - t_0}\\
\end{array}
\end{array}
if x.im < -3.90000000000000015e-240Initial program 46.0%
Taylor expanded in y.im around 0 66.1%
Taylor expanded in x.im around -inf 67.6%
mul-1-neg67.6%
Simplified67.6%
if -3.90000000000000015e-240 < x.im < 9.1999999999999998e-27Initial program 50.1%
exp-diff40.3%
exp-to-pow40.3%
hypot-def40.3%
*-commutative40.3%
exp-prod40.1%
fma-def40.1%
hypot-def67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in x.im around 0 30.7%
Taylor expanded in y.im around 0 32.2%
unpow232.2%
unpow232.2%
hypot-def34.7%
Simplified34.7%
*-commutative34.7%
add-sqr-sqrt20.9%
pow220.9%
Applied egg-rr20.9%
unpow220.9%
sqrt-unprod16.6%
pow216.6%
Applied egg-rr16.6%
*-commutative16.6%
unpow216.6%
rem-sqrt-square37.5%
Simplified37.5%
if 9.1999999999999998e-27 < x.im Initial program 29.8%
Taylor expanded in y.im around 0 48.5%
Taylor expanded in x.re around 0 53.7%
Final simplification54.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.im))
(t_1 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -3.5e-261)
(* t_1 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re 9.5e-135)
(* t_1 (pow (hypot x.im x.re) y.re))
(* t_1 (exp (- (* y.re (log x.re)) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -3.5e-261) {
tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= 9.5e-135) {
tmp = t_1 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.atan2(x_46_im, x_46_re) * y_46_im;
double t_1 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -3.5e-261) {
tmp = t_1 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= 9.5e-135) {
tmp = t_1 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_1 * Math.exp(((y_46_re * Math.log(x_46_re)) - t_0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.atan2(x_46_im, x_46_re) * y_46_im t_1 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= -3.5e-261: tmp = t_1 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= 9.5e-135: tmp = t_1 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_1 * math.exp(((y_46_re * math.log(x_46_re)) - t_0)) 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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -3.5e-261) tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= 9.5e-135) tmp = Float64(t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_1 * exp(Float64(Float64(y_46_re * log(x_46_re)) - t_0))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = atan2(x_46_im, x_46_re) * y_46_im; t_1 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= -3.5e-261) tmp = t_1 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= 9.5e-135) tmp = t_1 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_1 * exp(((y_46_re * log(x_46_re)) - t_0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -3.5e-261], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[(-x$46$re)], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9.5e-135], N[(t$95$1 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Exp[N[(N[(y$46$re * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\\
t_1 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -3.5 \cdot 10^{-261}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log \left(-x.re\right) - t_0}\\
\mathbf{elif}\;x.re \leq 9.5 \cdot 10^{-135}:\\
\;\;\;\;t_1 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot e^{y.re \cdot \log x.re - t_0}\\
\end{array}
\end{array}
if x.re < -3.4999999999999998e-261Initial program 47.2%
Taylor expanded in y.im around 0 60.5%
Taylor expanded in x.re around -inf 64.7%
mul-1-neg64.7%
Simplified64.7%
if -3.4999999999999998e-261 < x.re < 9.50000000000000007e-135Initial program 52.1%
exp-diff45.6%
exp-to-pow45.6%
hypot-def45.6%
*-commutative45.6%
exp-prod45.6%
fma-def45.6%
hypot-def78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in x.im around 0 41.4%
Taylor expanded in y.im around 0 41.4%
unpow241.4%
unpow241.4%
hypot-def43.8%
Simplified43.8%
if 9.50000000000000007e-135 < x.re Initial program 35.4%
Taylor expanded in y.im around 0 47.3%
Taylor expanded in x.re around inf 50.2%
Final simplification55.5%
(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 6.2e-136)
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (exp (- (* y.re (log x.im)) (* (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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 6.2e-136) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= 6.2e-136) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.exp(((y_46_re * Math.log(x_46_im)) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= 6.2e-136: tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.exp(((y_46_re * math.log(x_46_im)) - (math.atan2(x_46_im, x_46_re) * y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= 6.2e-136) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(x_46_im)) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= 6.2e-136) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * exp(((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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, 6.2e-136], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq 6.2 \cdot 10^{-136}:\\
\;\;\;\;t_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\end{array}
\end{array}
if x.im < 6.2e-136Initial program 43.4%
exp-diff37.0%
exp-to-pow37.1%
hypot-def37.1%
*-commutative37.1%
exp-prod37.1%
fma-def37.1%
hypot-def74.2%
*-commutative74.2%
Simplified74.2%
Taylor expanded in x.im around 0 34.5%
Taylor expanded in y.im around 0 47.5%
unpow247.5%
unpow247.5%
hypot-def48.7%
Simplified48.7%
if 6.2e-136 < x.im Initial program 44.2%
Taylor expanded in y.im around 0 45.4%
Taylor expanded in x.re around 0 45.5%
Final simplification47.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -0.00038)
(* (sin (fabs t_0)) t_1)
(if (<= y.re 6e-28)
(/ (sin (* y.im (log x.re))) (exp (* (atan2 x.im x.re) y.im)))
(* (sin t_0) t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.00038) {
tmp = sin(fabs(t_0)) * t_1;
} else if (y_46_re <= 6e-28) {
tmp = sin((y_46_im * log(x_46_re))) / exp((atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = sin(t_0) * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -0.00038) {
tmp = Math.sin(Math.abs(t_0)) * t_1;
} else if (y_46_re <= 6e-28) {
tmp = Math.sin((y_46_im * Math.log(x_46_re))) / Math.exp((Math.atan2(x_46_im, x_46_re) * y_46_im));
} else {
tmp = Math.sin(t_0) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_re * math.atan2(x_46_im, x_46_re) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -0.00038: tmp = math.sin(math.fabs(t_0)) * t_1 elif y_46_re <= 6e-28: tmp = math.sin((y_46_im * math.log(x_46_re))) / math.exp((math.atan2(x_46_im, x_46_re) * y_46_im)) else: tmp = math.sin(t_0) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -0.00038) tmp = Float64(sin(abs(t_0)) * t_1); elseif (y_46_re <= 6e-28) tmp = Float64(sin(Float64(y_46_im * log(x_46_re))) / exp(Float64(atan(x_46_im, x_46_re) * y_46_im))); else tmp = Float64(sin(t_0) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_re * atan2(x_46_im, x_46_re); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -0.00038) tmp = sin(abs(t_0)) * t_1; elseif (y_46_re <= 6e-28) tmp = sin((y_46_im * log(x_46_re))) / exp((atan2(x_46_im, x_46_re) * y_46_im)); else tmp = sin(t_0) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -0.00038], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 6e-28], N[(N[Sin[N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -0.00038:\\
\;\;\;\;\sin \left(\left|t_0\right|\right) \cdot t_1\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{-28}:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log x.re\right)}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\mathbf{else}:\\
\;\;\;\;\sin t_0 \cdot t_1\\
\end{array}
\end{array}
if y.re < -3.8000000000000002e-4Initial program 40.8%
exp-diff31.7%
exp-to-pow31.8%
hypot-def31.8%
*-commutative31.8%
exp-prod31.8%
fma-def31.8%
hypot-def77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in x.im around 0 45.4%
Taylor expanded in y.im around 0 84.9%
unpow284.9%
unpow284.9%
hypot-def84.9%
Simplified84.9%
*-commutative84.9%
add-sqr-sqrt47.0%
pow247.0%
Applied egg-rr47.0%
unpow247.0%
sqrt-unprod48.6%
pow248.6%
Applied egg-rr48.6%
*-commutative48.6%
unpow248.6%
rem-sqrt-square88.0%
Simplified88.0%
if -3.8000000000000002e-4 < y.re < 6.00000000000000005e-28Initial program 41.8%
exp-diff41.8%
exp-to-pow41.8%
hypot-def41.8%
*-commutative41.8%
exp-prod41.7%
fma-def41.7%
hypot-def81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x.im around 0 28.9%
Taylor expanded in y.re around 0 24.7%
if 6.00000000000000005e-28 < y.re Initial program 49.9%
exp-diff35.2%
exp-to-pow35.2%
hypot-def35.2%
*-commutative35.2%
exp-prod35.2%
fma-def35.2%
hypot-def57.3%
*-commutative57.3%
Simplified57.3%
Taylor expanded in x.im around 0 26.4%
Taylor expanded in y.im around 0 54.6%
unpow254.6%
unpow254.6%
hypot-def54.7%
Simplified54.7%
Final simplification49.0%
(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 43.7%
exp-diff37.4%
exp-to-pow37.5%
hypot-def37.5%
*-commutative37.5%
exp-prod37.4%
fma-def37.4%
hypot-def74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in x.im around 0 32.5%
Taylor expanded in y.im around 0 43.4%
unpow243.4%
unpow243.4%
hypot-def44.2%
Simplified44.2%
Final simplification44.2%
(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) (pow x.im y.re))))
(if (<= y.re -1.55e+31)
t_1
(if (<= y.re 3.7e+34)
(log (+ 1.0 (expm1 t_0)))
(if (or (<= y.re 9e+197) (not (<= y.re 3.5e+218)))
t_1
(* (atan2 x.im x.re) (log (exp 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) * pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.55e+31) {
tmp = t_1;
} else if (y_46_re <= 3.7e+34) {
tmp = log((1.0 + expm1(t_0)));
} else if ((y_46_re <= 9e+197) || !(y_46_re <= 3.5e+218)) {
tmp = t_1;
} else {
tmp = atan2(x_46_im, x_46_re) * log(exp(y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_1 = Math.sin(t_0) * Math.pow(x_46_im, y_46_re);
double tmp;
if (y_46_re <= -1.55e+31) {
tmp = t_1;
} else if (y_46_re <= 3.7e+34) {
tmp = Math.log((1.0 + Math.expm1(t_0)));
} else if ((y_46_re <= 9e+197) || !(y_46_re <= 3.5e+218)) {
tmp = t_1;
} else {
tmp = Math.atan2(x_46_im, x_46_re) * Math.log(Math.exp(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) * math.pow(x_46_im, y_46_re) tmp = 0 if y_46_re <= -1.55e+31: tmp = t_1 elif y_46_re <= 3.7e+34: tmp = math.log((1.0 + math.expm1(t_0))) elif (y_46_re <= 9e+197) or not (y_46_re <= 3.5e+218): tmp = t_1 else: tmp = math.atan2(x_46_im, x_46_re) * math.log(math.exp(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 = Float64(sin(t_0) * (x_46_im ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1.55e+31) tmp = t_1; elseif (y_46_re <= 3.7e+34) tmp = log(Float64(1.0 + expm1(t_0))); elseif ((y_46_re <= 9e+197) || !(y_46_re <= 3.5e+218)) tmp = t_1; else tmp = Float64(atan(x_46_im, x_46_re) * log(exp(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[(N[Sin[t$95$0], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.55e+31], t$95$1, If[LessEqual[y$46$re, 3.7e+34], N[Log[N[(1.0 + N[(Exp[t$95$0] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[y$46$re, 9e+197], N[Not[LessEqual[y$46$re, 3.5e+218]], $MachinePrecision]], t$95$1, N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Log[N[Exp[y$46$re], $MachinePrecision]], $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 \cdot {x.im}^{y.re}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 3.7 \cdot 10^{+34}:\\
\;\;\;\;\log \left(1 + \mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{elif}\;y.re \leq 9 \cdot 10^{+197} \lor \neg \left(y.re \leq 3.5 \cdot 10^{+218}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \log \left(e^{y.re}\right)\\
\end{array}
\end{array}
if y.re < -1.5500000000000001e31 or 3.70000000000000009e34 < y.re < 9.0000000000000006e197 or 3.50000000000000019e218 < y.re Initial program 44.0%
exp-diff31.2%
exp-to-pow31.2%
hypot-def31.2%
*-commutative31.2%
exp-prod31.2%
fma-def31.2%
hypot-def67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in x.im around 0 36.7%
Taylor expanded in y.im around 0 72.7%
unpow272.7%
unpow272.7%
hypot-def72.7%
Simplified72.7%
Taylor expanded in x.re around 0 63.7%
if -1.5500000000000001e31 < y.re < 3.70000000000000009e34Initial program 42.8%
exp-diff42.1%
exp-to-pow42.2%
hypot-def42.2%
*-commutative42.2%
exp-prod42.1%
fma-def42.1%
hypot-def80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x.im around 0 29.7%
Taylor expanded in y.im around 0 21.1%
unpow221.1%
unpow221.1%
hypot-def22.6%
Simplified22.6%
Taylor expanded in y.re around 0 15.1%
*-commutative15.1%
log1p-expm1-u17.8%
log1p-udef20.7%
Applied egg-rr20.7%
if 9.0000000000000006e197 < y.re < 3.50000000000000019e218Initial program 60.0%
exp-diff40.0%
exp-to-pow40.0%
hypot-def40.0%
*-commutative40.0%
exp-prod40.0%
fma-def40.0%
hypot-def40.0%
*-commutative40.0%
Simplified40.0%
Taylor expanded in x.im around 0 20.0%
Taylor expanded in y.im around 0 40.3%
unpow240.3%
unpow240.3%
hypot-def40.3%
Simplified40.3%
Taylor expanded in y.re around 0 5.1%
*-commutative5.1%
add-log-exp80.6%
*-commutative80.6%
exp-prod100.0%
Applied egg-rr100.0%
log-pow100.0%
Simplified100.0%
Final simplification40.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (* t_0 (pow x.im y.re)))
(t_2 (* t_0 (pow x.re y.re))))
(if (<= x.re -9.2e+110)
t_2
(if (<= x.re -5.2e-139)
t_1
(if (<= x.re -4.9e-255)
(* (atan2 x.im x.re) (log (exp y.re)))
(if (<= x.re 1.8e-43) t_1 t_2))))))
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 t_1 = t_0 * pow(x_46_im, y_46_re);
double t_2 = t_0 * pow(x_46_re, y_46_re);
double tmp;
if (x_46_re <= -9.2e+110) {
tmp = t_2;
} else if (x_46_re <= -5.2e-139) {
tmp = t_1;
} else if (x_46_re <= -4.9e-255) {
tmp = atan2(x_46_im, x_46_re) * log(exp(y_46_re));
} else if (x_46_re <= 1.8e-43) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = sin((y_46re * atan2(x_46im, x_46re)))
t_1 = t_0 * (x_46im ** y_46re)
t_2 = t_0 * (x_46re ** y_46re)
if (x_46re <= (-9.2d+110)) then
tmp = t_2
else if (x_46re <= (-5.2d-139)) then
tmp = t_1
else if (x_46re <= (-4.9d-255)) then
tmp = atan2(x_46im, x_46re) * log(exp(y_46re))
else if (x_46re <= 1.8d-43) then
tmp = t_1
else
tmp = t_2
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 t_1 = t_0 * Math.pow(x_46_im, y_46_re);
double t_2 = t_0 * Math.pow(x_46_re, y_46_re);
double tmp;
if (x_46_re <= -9.2e+110) {
tmp = t_2;
} else if (x_46_re <= -5.2e-139) {
tmp = t_1;
} else if (x_46_re <= -4.9e-255) {
tmp = Math.atan2(x_46_im, x_46_re) * Math.log(Math.exp(y_46_re));
} else if (x_46_re <= 1.8e-43) {
tmp = t_1;
} else {
tmp = t_2;
}
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))) t_1 = t_0 * math.pow(x_46_im, y_46_re) t_2 = t_0 * math.pow(x_46_re, y_46_re) tmp = 0 if x_46_re <= -9.2e+110: tmp = t_2 elif x_46_re <= -5.2e-139: tmp = t_1 elif x_46_re <= -4.9e-255: tmp = math.atan2(x_46_im, x_46_re) * math.log(math.exp(y_46_re)) elif x_46_re <= 1.8e-43: tmp = t_1 else: tmp = t_2 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))) t_1 = Float64(t_0 * (x_46_im ^ y_46_re)) t_2 = Float64(t_0 * (x_46_re ^ y_46_re)) tmp = 0.0 if (x_46_re <= -9.2e+110) tmp = t_2; elseif (x_46_re <= -5.2e-139) tmp = t_1; elseif (x_46_re <= -4.9e-255) tmp = Float64(atan(x_46_im, x_46_re) * log(exp(y_46_re))); elseif (x_46_re <= 1.8e-43) tmp = t_1; else tmp = t_2; 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))); t_1 = t_0 * (x_46_im ^ y_46_re); t_2 = t_0 * (x_46_re ^ y_46_re); tmp = 0.0; if (x_46_re <= -9.2e+110) tmp = t_2; elseif (x_46_re <= -5.2e-139) tmp = t_1; elseif (x_46_re <= -4.9e-255) tmp = atan2(x_46_im, x_46_re) * log(exp(y_46_re)); elseif (x_46_re <= 1.8e-43) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$1 = N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x$46$re, -9.2e+110], t$95$2, If[LessEqual[x$46$re, -5.2e-139], t$95$1, If[LessEqual[x$46$re, -4.9e-255], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Log[N[Exp[y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 1.8e-43], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := t_0 \cdot {x.im}^{y.re}\\
t_2 := t_0 \cdot {x.re}^{y.re}\\
\mathbf{if}\;x.re \leq -9.2 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x.re \leq -5.2 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x.re \leq -4.9 \cdot 10^{-255}:\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \log \left(e^{y.re}\right)\\
\mathbf{elif}\;x.re \leq 1.8 \cdot 10^{-43}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x.re < -9.2000000000000001e110 or 1.7999999999999999e-43 < x.re Initial program 22.3%
exp-diff22.3%
exp-to-pow22.4%
hypot-def22.4%
*-commutative22.4%
exp-prod22.3%
fma-def22.3%
hypot-def75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in x.im around 0 44.8%
Taylor expanded in y.im around 0 43.6%
unpow243.6%
unpow243.6%
hypot-def46.2%
Simplified46.2%
Taylor expanded in x.im around 0 41.3%
if -9.2000000000000001e110 < x.re < -5.1999999999999996e-139 or -4.89999999999999961e-255 < x.re < 1.7999999999999999e-43Initial program 62.4%
exp-diff49.9%
exp-to-pow49.9%
hypot-def49.9%
*-commutative49.9%
exp-prod49.9%
fma-def49.9%
hypot-def71.0%
*-commutative71.0%
Simplified71.0%
Taylor expanded in x.im around 0 25.8%
Taylor expanded in y.im around 0 45.4%
unpow245.4%
unpow245.4%
hypot-def46.2%
Simplified46.2%
Taylor expanded in x.re around 0 42.2%
if -5.1999999999999996e-139 < x.re < -4.89999999999999961e-255Initial program 43.5%
exp-diff43.5%
exp-to-pow43.5%
hypot-def43.5%
*-commutative43.5%
exp-prod43.5%
fma-def43.5%
hypot-def87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x.im around 0 0.0%
Taylor expanded in y.im around 0 26.5%
unpow226.5%
unpow226.5%
hypot-def15.1%
Simplified15.1%
Taylor expanded in y.re around 0 15.3%
*-commutative15.3%
add-log-exp33.4%
*-commutative33.4%
exp-prod33.4%
Applied egg-rr33.4%
log-pow33.4%
Simplified33.4%
Final simplification41.3%
(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.55e-145)
(* t_0 (/ 1.0 (pow (/ -1.0 x.im) y.re)))
(if (<= x.im 1.12e-7) (* 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.55e-145) {
tmp = t_0 * (1.0 / pow((-1.0 / x_46_im), y_46_re));
} else if (x_46_im <= 1.12e-7) {
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.55d-145)) then
tmp = t_0 * (1.0d0 / (((-1.0d0) / x_46im) ** y_46re))
else if (x_46im <= 1.12d-7) 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.55e-145) {
tmp = t_0 * (1.0 / Math.pow((-1.0 / x_46_im), y_46_re));
} else if (x_46_im <= 1.12e-7) {
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.55e-145: tmp = t_0 * (1.0 / math.pow((-1.0 / x_46_im), y_46_re)) elif x_46_im <= 1.12e-7: 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.55e-145) tmp = Float64(t_0 * Float64(1.0 / (Float64(-1.0 / x_46_im) ^ y_46_re))); elseif (x_46_im <= 1.12e-7) 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.55e-145) tmp = t_0 * (1.0 / ((-1.0 / x_46_im) ^ y_46_re)); elseif (x_46_im <= 1.12e-7) 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.55e-145], N[(t$95$0 * N[(1.0 / N[Power[N[(-1.0 / x$46$im), $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 1.12e-7], 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.55 \cdot 10^{-145}:\\
\;\;\;\;t_0 \cdot \frac{1}{{\left(\frac{-1}{x.im}\right)}^{y.re}}\\
\mathbf{elif}\;x.im \leq 1.12 \cdot 10^{-7}:\\
\;\;\;\;t_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -1.55e-145Initial program 45.2%
exp-diff41.0%
exp-to-pow41.1%
hypot-def41.1%
*-commutative41.1%
exp-prod41.1%
fma-def41.1%
hypot-def77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in x.im around 0 37.6%
Taylor expanded in y.im around 0 53.3%
unpow253.3%
unpow253.3%
hypot-def54.2%
Simplified54.2%
*-commutative54.2%
add-sqr-sqrt29.7%
pow229.7%
Applied egg-rr29.7%
Taylor expanded in x.im around -inf 52.2%
*-commutative52.2%
*-commutative52.2%
log-pow52.2%
exp-to-pow52.3%
unpow-152.3%
Simplified52.3%
if -1.55e-145 < x.im < 1.12e-7Initial program 50.0%
exp-diff39.9%
exp-to-pow39.9%
hypot-def39.9%
*-commutative39.9%
exp-prod39.7%
fma-def39.7%
hypot-def69.2%
*-commutative69.2%
Simplified69.2%
Taylor expanded in x.im around 0 28.2%
Taylor expanded in y.im around 0 35.9%
unpow235.9%
unpow235.9%
hypot-def36.9%
Simplified36.9%
Taylor expanded in x.im around 0 32.5%
if 1.12e-7 < x.im Initial program 27.4%
exp-diff25.4%
exp-to-pow25.4%
hypot-def25.4%
*-commutative25.4%
exp-prod25.4%
fma-def25.4%
hypot-def78.4%
*-commutative78.4%
Simplified78.4%
Taylor expanded in x.im around 0 32.0%
Taylor expanded in y.im around 0 40.6%
unpow240.6%
unpow240.6%
hypot-def40.8%
Simplified40.8%
Taylor expanded in x.re around 0 40.8%
Final simplification41.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 -8e-132) (not (<= y.im 9e-259)))
(log (+ 1.0 (expm1 t_0)))
t_0)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -8e-132) || !(y_46_im <= 9e-259)) {
tmp = log((1.0 + expm1(t_0)));
} else {
tmp = 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_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if ((y_46_im <= -8e-132) || !(y_46_im <= 9e-259)) {
tmp = Math.log((1.0 + Math.expm1(t_0)));
} else {
tmp = t_0;
}
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) tmp = 0 if (y_46_im <= -8e-132) or not (y_46_im <= 9e-259): tmp = math.log((1.0 + math.expm1(t_0))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if ((y_46_im <= -8e-132) || !(y_46_im <= 9e-259)) tmp = log(Float64(1.0 + expm1(t_0))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -8e-132], N[Not[LessEqual[y$46$im, 9e-259]], $MachinePrecision]], N[Log[N[(1.0 + N[(Exp[t$95$0] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -8 \cdot 10^{-132} \lor \neg \left(y.im \leq 9 \cdot 10^{-259}\right):\\
\;\;\;\;\log \left(1 + \mathsf{expm1}\left(t_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -7.9999999999999999e-132 or 8.99999999999999947e-259 < y.im Initial program 41.4%
exp-diff33.8%
exp-to-pow33.8%
hypot-def33.8%
*-commutative33.8%
exp-prod33.8%
fma-def33.8%
hypot-def70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in x.im around 0 32.7%
Taylor expanded in y.im around 0 40.9%
unpow240.9%
unpow240.9%
hypot-def39.6%
Simplified39.6%
Taylor expanded in y.re around 0 6.2%
*-commutative6.2%
log1p-expm1-u15.4%
log1p-udef23.2%
Applied egg-rr23.2%
if -7.9999999999999999e-132 < y.im < 8.99999999999999947e-259Initial program 54.1%
exp-diff54.1%
exp-to-pow54.1%
hypot-def54.1%
*-commutative54.1%
exp-prod54.1%
fma-def54.1%
hypot-def91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x.im around 0 31.7%
Taylor expanded in y.im around 0 54.8%
unpow254.8%
unpow254.8%
hypot-def65.3%
Simplified65.3%
Taylor expanded in y.re around 0 30.9%
Final simplification24.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.1e-128) (not (<= y.im 9e-259))) (* (atan2 x.im x.re) (log (exp y.re))) (* y.re (atan2 x.im x.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.1e-128) || !(y_46_im <= 9e-259)) {
tmp = atan2(x_46_im, x_46_re) * log(exp(y_46_re));
} else {
tmp = y_46_re * atan2(x_46_im, 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) :: tmp
if ((y_46im <= (-1.1d-128)) .or. (.not. (y_46im <= 9d-259))) then
tmp = atan2(x_46im, x_46re) * log(exp(y_46re))
else
tmp = y_46re * atan2(x_46im, 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 tmp;
if ((y_46_im <= -1.1e-128) || !(y_46_im <= 9e-259)) {
tmp = Math.atan2(x_46_im, x_46_re) * Math.log(Math.exp(y_46_re));
} else {
tmp = y_46_re * Math.atan2(x_46_im, x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.1e-128) or not (y_46_im <= 9e-259): tmp = math.atan2(x_46_im, x_46_re) * math.log(math.exp(y_46_re)) else: tmp = y_46_re * math.atan2(x_46_im, x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.1e-128) || !(y_46_im <= 9e-259)) tmp = Float64(atan(x_46_im, x_46_re) * log(exp(y_46_re))); else tmp = Float64(y_46_re * atan(x_46_im, x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.1e-128) || ~((y_46_im <= 9e-259))) tmp = atan2(x_46_im, x_46_re) * log(exp(y_46_re)); else tmp = y_46_re * atan2(x_46_im, x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.1e-128], N[Not[LessEqual[y$46$im, 9e-259]], $MachinePrecision]], N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Log[N[Exp[y$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{-128} \lor \neg \left(y.im \leq 9 \cdot 10^{-259}\right):\\
\;\;\;\;\tan^{-1}_* \frac{x.im}{x.re} \cdot \log \left(e^{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\end{array}
\end{array}
if y.im < -1.10000000000000005e-128 or 8.99999999999999947e-259 < y.im Initial program 42.0%
exp-diff34.3%
exp-to-pow34.3%
hypot-def34.3%
*-commutative34.3%
exp-prod34.2%
fma-def34.2%
hypot-def70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in x.im around 0 32.2%
Taylor expanded in y.im around 0 41.5%
unpow241.5%
unpow241.5%
hypot-def39.7%
Simplified39.7%
Taylor expanded in y.re around 0 5.8%
*-commutative5.8%
add-log-exp23.1%
*-commutative23.1%
exp-prod23.5%
Applied egg-rr23.5%
log-pow22.5%
Simplified22.5%
if -1.10000000000000005e-128 < y.im < 8.99999999999999947e-259Initial program 50.8%
exp-diff50.8%
exp-to-pow50.8%
hypot-def50.8%
*-commutative50.8%
exp-prod50.8%
fma-def50.8%
hypot-def89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in x.im around 0 33.8%
Taylor expanded in y.im around 0 51.5%
unpow251.5%
unpow251.5%
hypot-def63.4%
Simplified63.4%
Taylor expanded in y.re around 0 31.2%
Final simplification24.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 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) {
return y_46_re * atan2(x_46_im, x_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = y_46re * atan2(x_46im, x_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return y_46_re * Math.atan2(x_46_im, x_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return y_46_re * math.atan2(x_46_im, x_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(y_46_re * atan(x_46_im, x_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = y_46_re * atan2(x_46_im, x_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}
\end{array}
Initial program 43.7%
exp-diff37.4%
exp-to-pow37.5%
hypot-def37.5%
*-commutative37.5%
exp-prod37.4%
fma-def37.4%
hypot-def74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in x.im around 0 32.5%
Taylor expanded in y.im around 0 43.4%
unpow243.4%
unpow243.4%
hypot-def44.2%
Simplified44.2%
Taylor expanded in y.re around 0 10.6%
Final simplification10.6%
herbie shell --seed 2023322
(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)))))