
(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 18 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.im (atan2 x.im x.re)))
(t_1 (log (hypot x.re x.im)))
(t_2 (sin (fma t_1 y.im (* y.re (atan2 x.im x.re))))))
(if (<= y.re -1e+90)
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)) t_2)
(if (<= y.re 4e+36)
(* t_2 (exp (fma t_1 y.re (* (atan2 x.im x.re) (- y.im)))))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) 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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = log(hypot(x_46_re, x_46_im));
double t_2 = sin(fma(t_1, y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -1e+90) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * t_2;
} else if (y_46_re <= 4e+36) {
tmp = t_2 * exp(fma(t_1, y_46_re, (atan2(x_46_im, x_46_re) * -y_46_im)));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - 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(y_46_im * atan(x_46_im, x_46_re)) t_1 = log(hypot(x_46_re, x_46_im)) t_2 = sin(fma(t_1, y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -1e+90) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) * t_2); elseif (y_46_re <= 4e+36) tmp = Float64(t_2 * exp(fma(t_1, y_46_re, Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); 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(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[(t$95$1 * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1e+90], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 4e+36], N[(t$95$2 * 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]), $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$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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_2 := \sin \left(\mathsf{fma}\left(t\_1, y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+90}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0} \cdot t\_2\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{+36}:\\
\;\;\;\;t\_2 \cdot e^{\mathsf{fma}\left(t\_1, y.re, \tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \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 < -9.99999999999999966e89Initial program 26.1%
exp-diff21.7%
exp-to-pow21.7%
hypot-define21.7%
*-commutative21.7%
exp-prod21.7%
fma-define21.7%
hypot-define69.6%
*-commutative69.6%
Simplified69.6%
Taylor expanded in y.im around 0 91.3%
if -9.99999999999999966e89 < y.re < 4.00000000000000017e36Initial program 40.3%
fma-neg40.3%
hypot-define40.3%
distribute-rgt-neg-out40.3%
fma-define40.3%
hypot-define82.6%
*-commutative82.6%
Simplified82.6%
if 4.00000000000000017e36 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -3.6e-6)
(* t_2 (sin t_1))
(if (<= y.re 1.6e+34)
(* (sin (fma (log (hypot x.re x.im)) y.im t_1)) (/ 1.0 (exp t_0)))
(* t_2 (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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -3.6e-6) {
tmp = t_2 * sin(t_1);
} else if (y_46_re <= 1.6e+34) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (1.0 / exp(t_0));
} else {
tmp = t_2 * 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(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) tmp = 0.0 if (y_46_re <= -3.6e-6) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_re <= 1.6e+34) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64(1.0 / exp(t_0))); else tmp = Float64(t_2 * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[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]}, If[LessEqual[y$46$re, -3.6e-6], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+34], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-6}:\\
\;\;\;\;t\_2 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+34}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot \frac{1}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \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 < -3.59999999999999984e-6Initial program 37.9%
Taylor expanded in y.im around 0 84.9%
if -3.59999999999999984e-6 < y.re < 1.5999999999999999e34Initial program 36.6%
exp-diff33.5%
exp-to-pow33.5%
hypot-define33.5%
*-commutative33.5%
exp-prod32.6%
fma-define32.6%
hypot-define75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in y.re around 0 79.2%
if 1.5999999999999999e34 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.im (log (hypot x.im x.re))))
(t_2 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1e-50)
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)) (+ t_1 (sin t_2)))
(if (<= y.re 1.6e+34)
(* (sin (fma (log (hypot x.re x.im)) y.im t_2)) (/ 1.0 (exp t_0)))
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
(sin t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_2 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1e-50) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * (t_1 + sin(t_2));
} else if (y_46_re <= 1.6e+34) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * (1.0 / exp(t_0));
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_2 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1e-50) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) * Float64(t_1 + sin(t_2))); elseif (y_46_re <= 1.6e+34) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) * Float64(1.0 / exp(t_0))); 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_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1e-50], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+34], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{-50}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0} \cdot \left(t\_1 + \sin t\_2\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+34}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right) \cdot \frac{1}{e^{t\_0}}\\
\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\_1\\
\end{array}
\end{array}
if y.re < -1.00000000000000001e-50Initial program 34.2%
exp-diff26.0%
exp-to-pow26.0%
hypot-define26.0%
*-commutative26.0%
exp-prod26.0%
fma-define26.0%
hypot-define69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in y.im around 0 83.6%
Taylor expanded in y.im around 0 34.5%
*-commutative34.5%
unpow234.5%
unpow234.5%
hypot-undefine79.5%
Simplified79.5%
Taylor expanded in y.re around 0 83.6%
if -1.00000000000000001e-50 < y.re < 1.5999999999999999e34Initial program 38.6%
exp-diff35.4%
exp-to-pow35.4%
hypot-define35.4%
*-commutative35.4%
exp-prod34.5%
fma-define34.5%
hypot-define75.5%
*-commutative75.5%
Simplified75.5%
Taylor expanded in y.re around 0 80.4%
if 1.5999999999999999e34 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))))
(if (<= y.re -4.2e-6)
(* t_2 (sin t_1))
(if (<= y.re 3.5e+36)
(* (sin (fma (log (hypot x.re x.im)) y.im t_1)) (/ 1.0 (exp t_0)))
(* t_2 (* 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 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0));
double tmp;
if (y_46_re <= -4.2e-6) {
tmp = t_2 * sin(t_1);
} else if (y_46_re <= 3.5e+36) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (1.0 / exp(t_0));
} else {
tmp = t_2 * (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(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - t_0)) tmp = 0.0 if (y_46_re <= -4.2e-6) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_re <= 3.5e+36) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * Float64(1.0 / exp(t_0))); else tmp = Float64(t_2 * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[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]}, If[LessEqual[y$46$re, -4.2e-6], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+36], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0}\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{-6}:\\
\;\;\;\;t\_2 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+36}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot \frac{1}{e^{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -4.1999999999999996e-6Initial program 37.9%
Taylor expanded in y.im around 0 84.9%
if -4.1999999999999996e-6 < y.re < 3.4999999999999998e36Initial program 36.6%
exp-diff33.5%
exp-to-pow33.5%
hypot-define33.5%
*-commutative33.5%
exp-prod32.6%
fma-define32.6%
hypot-define75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in y.re around 0 79.2%
if 3.4999999999999998e36 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Taylor expanded in y.im around 0 67.8%
unpow267.8%
unpow267.8%
hypot-undefine76.3%
Simplified76.3%
Final simplification80.0%
(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)))))
(* y.im (atan2 x.im x.re))))))
(if (<= y.re -4.8e-6)
(* t_1 (sin t_0))
(if (<= y.re 5.5e+34)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (* 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 = 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))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double tmp;
if (y_46_re <= -4.8e-6) {
tmp = t_1 * sin(t_0);
} else if (y_46_re <= 5.5e+34) {
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 * (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(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(y_46_im * atan(x_46_im, x_46_re)))) tmp = 0.0 if (y_46_re <= -4.8e-6) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_re <= 5.5e+34) 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 * 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[(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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e-6], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.5e+34], 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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $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) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{-6}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+34}:\\
\;\;\;\;\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 \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -4.7999999999999998e-6Initial program 37.9%
Taylor expanded in y.im around 0 84.9%
if -4.7999999999999998e-6 < y.re < 5.4999999999999996e34Initial program 36.6%
exp-diff33.5%
exp-to-pow33.5%
hypot-define33.5%
*-commutative33.5%
exp-prod32.6%
fma-define32.6%
hypot-define75.3%
*-commutative75.3%
Simplified75.3%
Taylor expanded in y.re around 0 79.2%
rec-exp79.2%
distribute-rgt-neg-in79.2%
Simplified79.2%
if 5.4999999999999996e34 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Taylor expanded in y.im around 0 67.8%
unpow267.8%
unpow267.8%
hypot-undefine76.3%
Simplified76.3%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (- (atan2 x.im x.re)))))
(t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.im -2.7e-7)
t_0
(if (<= y.im 290.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_1))
(pow (hypot x.im x.re) y.re))
(if (or (<= y.im 1.2e+52) (not (<= y.im 1.05e+134)))
t_0
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re))))
(sin t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_im <= -2.7e-7) {
tmp = t_0;
} else if (y_46_im <= 290.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if ((y_46_im <= 1.2e+52) || !(y_46_im <= 1.05e+134)) {
tmp = t_0;
} else {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))) * sin(t_1);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -2.7e-7) tmp = t_0; elseif (y_46_im <= 290.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_1)) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif ((y_46_im <= 1.2e+52) || !(y_46_im <= 1.05e+134)) tmp = t_0; else tmp = Float64(exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(t_1)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.7e-7], t$95$0, If[LessEqual[y$46$im, 290.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$1), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, 1.2e+52], N[Not[LessEqual[y$46$im, 1.05e+134]], $MachinePrecision]], t$95$0, N[(N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -2.7 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 290:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_1\right)\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{+52} \lor \neg \left(y.im \leq 1.05 \cdot 10^{+134}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin t\_1\\
\end{array}
\end{array}
if y.im < -2.70000000000000009e-7 or 290 < y.im < 1.2e52 or 1.05e134 < y.im Initial program 37.3%
exp-diff29.0%
exp-to-pow29.0%
hypot-define29.0%
*-commutative29.0%
exp-prod27.6%
fma-define27.6%
hypot-define58.1%
*-commutative58.1%
Simplified58.1%
Taylor expanded in y.re around 0 63.1%
rec-exp63.1%
distribute-rgt-neg-in63.1%
mul-1-neg63.1%
exp-prod64.1%
mul-1-neg64.1%
Simplified64.1%
add-cbrt-cube18.5%
pow318.5%
Applied egg-rr18.5%
Taylor expanded in y.im around inf 32.6%
unpow232.6%
unpow232.6%
hypot-undefine67.5%
Simplified67.5%
if -2.70000000000000009e-7 < y.im < 290Initial program 40.1%
exp-diff40.1%
exp-to-pow40.1%
hypot-define40.1%
*-commutative40.1%
exp-prod40.1%
fma-define40.1%
hypot-define89.9%
*-commutative89.9%
Simplified89.9%
Taylor expanded in y.im around 0 61.2%
unpow261.2%
unpow261.2%
hypot-undefine88.7%
Simplified88.7%
if 1.2e52 < y.im < 1.05e134Initial program 38.2%
Taylor expanded in y.im around 0 68.5%
Final simplification76.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (log (hypot x.im x.re))))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* y.im (atan2 x.im x.re)))))
(t_3 (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.re -9.2e-60)
(* t_2 (sin t_1))
(if (<= y.re -9e-120)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (- t_1 (* y.im (log (/ -1.0 x.re))))))
(if (<= y.re -1.3e-156)
(* t_3 (sin (+ t_1 (* y.im (log x.re)))))
(if (<= y.re 1.6e+34) (* (sin t_0) t_3) (* t_2 t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * log(hypot(x_46_im, x_46_re));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re))));
double t_3 = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -9.2e-60) {
tmp = t_2 * sin(t_1);
} else if (y_46_re <= -9e-120) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re)))));
} else if (y_46_re <= -1.3e-156) {
tmp = t_3 * sin((t_1 + (y_46_im * log(x_46_re))));
} else if (y_46_re <= 1.6e+34) {
tmp = sin(t_0) * t_3;
} else {
tmp = t_2 * t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.log(Math.hypot(x_46_im, x_46_re));
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * Math.atan2(x_46_im, x_46_re))));
double t_3 = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -9.2e-60) {
tmp = t_2 * Math.sin(t_1);
} else if (y_46_re <= -9e-120) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((t_1 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else if (y_46_re <= -1.3e-156) {
tmp = t_3 * Math.sin((t_1 + (y_46_im * Math.log(x_46_re))));
} else if (y_46_re <= 1.6e+34) {
tmp = Math.sin(t_0) * t_3;
} else {
tmp = t_2 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.log(math.hypot(x_46_im, x_46_re)) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * math.atan2(x_46_im, x_46_re)))) t_3 = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -9.2e-60: tmp = t_2 * math.sin(t_1) elif y_46_re <= -9e-120: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((t_1 - (y_46_im * math.log((-1.0 / x_46_re))))) elif y_46_re <= -1.3e-156: tmp = t_3 * math.sin((t_1 + (y_46_im * math.log(x_46_re)))) elif y_46_re <= 1.6e+34: tmp = math.sin(t_0) * t_3 else: tmp = t_2 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(y_46_im * atan(x_46_im, x_46_re)))) t_3 = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -9.2e-60) tmp = Float64(t_2 * sin(t_1)); elseif (y_46_re <= -9e-120) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(t_1 - Float64(y_46_im * log(Float64(-1.0 / x_46_re)))))); elseif (y_46_re <= -1.3e-156) tmp = Float64(t_3 * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); elseif (y_46_re <= 1.6e+34) tmp = Float64(sin(t_0) * t_3); else tmp = Float64(t_2 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * log(hypot(x_46_im, x_46_re)); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (y_46_im * atan2(x_46_im, x_46_re)))); t_3 = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -9.2e-60) tmp = t_2 * sin(t_1); elseif (y_46_re <= -9e-120) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re))))); elseif (y_46_re <= -1.3e-156) tmp = t_3 * sin((t_1 + (y_46_im * log(x_46_re)))); elseif (y_46_re <= 1.6e+34) tmp = sin(t_0) * t_3; else tmp = t_2 * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]}, If[LessEqual[y$46$re, -9.2e-60], N[(t$95$2 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -9e-120], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.3e-156], N[(t$95$3 * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.6e+34], N[(N[Sin[t$95$0], $MachinePrecision] * t$95$3), $MachinePrecision], N[(t$95$2 * t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
t_3 := {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{-60}:\\
\;\;\;\;t\_2 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq -9 \cdot 10^{-120}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(t\_1 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq -1.3 \cdot 10^{-156}:\\
\;\;\;\;t\_3 \cdot \sin \left(t\_1 + y.im \cdot \log x.re\right)\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+34}:\\
\;\;\;\;\sin t\_0 \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -9.2000000000000005e-60Initial program 34.2%
Taylor expanded in y.im around 0 78.0%
if -9.2000000000000005e-60 < y.re < -9e-120Initial program 40.0%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod40.0%
fma-define40.0%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in y.re around 0 70.0%
rec-exp70.0%
distribute-rgt-neg-in70.0%
mul-1-neg70.0%
exp-prod70.0%
mul-1-neg70.0%
Simplified70.0%
Taylor expanded in x.re around -inf 80.0%
+-commutative80.0%
mul-1-neg80.0%
unsub-neg80.0%
Simplified80.0%
Taylor expanded in y.im around inf 80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
Simplified80.0%
if -9e-120 < y.re < -1.3e-156Initial program 22.2%
exp-diff22.2%
exp-to-pow22.2%
hypot-define22.2%
*-commutative22.2%
exp-prod22.2%
fma-define22.2%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.re around 0 66.7%
rec-exp66.7%
distribute-rgt-neg-in66.7%
mul-1-neg66.7%
exp-prod66.7%
mul-1-neg66.7%
Simplified66.7%
Taylor expanded in x.im around 0 55.7%
if -1.3e-156 < y.re < 1.5999999999999999e34Initial program 40.1%
exp-diff36.2%
exp-to-pow36.2%
hypot-define36.2%
*-commutative36.2%
exp-prod35.0%
fma-define35.0%
hypot-define77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in y.re around 0 83.0%
rec-exp83.0%
distribute-rgt-neg-in83.0%
mul-1-neg83.0%
exp-prod81.9%
mul-1-neg81.9%
Simplified81.9%
add-cbrt-cube37.3%
pow338.3%
Applied egg-rr38.3%
Taylor expanded in y.im around inf 32.4%
unpow232.4%
unpow232.4%
hypot-undefine71.3%
Simplified71.3%
if 1.5999999999999999e34 < y.re Initial program 44.1%
Taylor expanded in y.re around 0 44.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
hypot-undefine44.1%
unpow244.1%
unpow244.1%
+-commutative44.1%
unpow244.1%
unpow244.1%
hypot-undefine83.1%
Simplified83.1%
Taylor expanded in y.im around 0 67.8%
unpow267.8%
unpow267.8%
hypot-undefine76.3%
Simplified76.3%
Final simplification74.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.im (atan2 x.im x.re)))
(t_1 (* y.re (atan2 x.im x.re)))
(t_2 (sin t_1))
(t_3 (pow (exp y.im) (- (atan2 x.im x.re)))))
(if (<= y.re -1.16e-59)
(*
(exp (- (* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im))))) t_0))
t_2)
(if (<= y.re -5.5e-119)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (- t_1 (* y.im (log (/ -1.0 x.re))))))
(if (<= y.re -1.3e-156)
(* t_3 (sin (+ t_1 (* y.im (log x.re)))))
(if (<= y.re 3.2e+48)
(* (sin (* y.im (log (hypot x.im x.re)))) t_3)
(* (/ (pow (hypot x.re x.im) y.re) (+ 1.0 t_0)) t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * atan2(x_46_im, x_46_re);
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1.16e-59) {
tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2;
} else if (y_46_re <= -5.5e-119) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re)))));
} else if (y_46_re <= -1.3e-156) {
tmp = t_3 * sin((t_1 + (y_46_im * log(x_46_re))));
} else if (y_46_re <= 3.2e+48) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3;
} else {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * t_2;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_im * Math.atan2(x_46_im, x_46_re);
double t_1 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1.16e-59) {
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 if (y_46_re <= -5.5e-119) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin((t_1 - (y_46_im * Math.log((-1.0 / x_46_re)))));
} else if (y_46_re <= -1.3e-156) {
tmp = t_3 * Math.sin((t_1 + (y_46_im * Math.log(x_46_re))));
} else if (y_46_re <= 3.2e+48) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_3;
} else {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = y_46_im * math.atan2(x_46_im, x_46_re) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) t_3 = math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) tmp = 0 if y_46_re <= -1.16e-59: 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 elif y_46_re <= -5.5e-119: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin((t_1 - (y_46_im * math.log((-1.0 / x_46_re))))) elif y_46_re <= -1.3e-156: tmp = t_3 * math.sin((t_1 + (y_46_im * math.log(x_46_re)))) elif y_46_re <= 3.2e+48: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_3 else: tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + t_0)) * t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_im * atan(x_46_im, x_46_re)) t_1 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.16e-59) 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); elseif (y_46_re <= -5.5e-119) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(Float64(t_1 - Float64(y_46_im * log(Float64(-1.0 / x_46_re)))))); elseif (y_46_re <= -1.3e-156) tmp = Float64(t_3 * sin(Float64(t_1 + Float64(y_46_im * log(x_46_re))))); elseif (y_46_re <= 3.2e+48) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3); else tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + t_0)) * t_2); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = y_46_im * atan2(x_46_im, x_46_re); t_1 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); t_3 = exp(y_46_im) ^ -atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -1.16e-59) tmp = exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - t_0)) * t_2; elseif (y_46_re <= -5.5e-119) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin((t_1 - (y_46_im * log((-1.0 / x_46_re))))); elseif (y_46_re <= -1.3e-156) tmp = t_3 * sin((t_1 + (y_46_im * log(x_46_re)))); elseif (y_46_re <= 3.2e+48) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3; else tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + t_0)) * 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[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[t$95$1], $MachinePrecision]}, Block[{t$95$3 = N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]}, If[LessEqual[y$46$re, -1.16e-59], 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], If[LessEqual[y$46$re, -5.5e-119], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(t$95$1 - N[(y$46$im * N[Log[N[(-1.0 / x$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.3e-156], N[(t$95$3 * N[Sin[N[(t$95$1 + N[(y$46$im * N[Log[x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.2e+48], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\mathbf{if}\;y.re \leq -1.16 \cdot 10^{-59}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - t\_0} \cdot t\_2\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-119}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin \left(t\_1 - y.im \cdot \log \left(\frac{-1}{x.re}\right)\right)\\
\mathbf{elif}\;y.re \leq -1.3 \cdot 10^{-156}:\\
\;\;\;\;t\_3 \cdot \sin \left(t\_1 + y.im \cdot \log x.re\right)\\
\mathbf{elif}\;y.re \leq 3.2 \cdot 10^{+48}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + t\_0} \cdot t\_2\\
\end{array}
\end{array}
if y.re < -1.16e-59Initial program 34.2%
Taylor expanded in y.im around 0 78.0%
if -1.16e-59 < y.re < -5.49999999999999959e-119Initial program 40.0%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod40.0%
fma-define40.0%
hypot-define70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in y.re around 0 70.0%
rec-exp70.0%
distribute-rgt-neg-in70.0%
mul-1-neg70.0%
exp-prod70.0%
mul-1-neg70.0%
Simplified70.0%
Taylor expanded in x.re around -inf 80.0%
+-commutative80.0%
mul-1-neg80.0%
unsub-neg80.0%
Simplified80.0%
Taylor expanded in y.im around inf 80.0%
neg-mul-180.0%
distribute-rgt-neg-in80.0%
Simplified80.0%
if -5.49999999999999959e-119 < y.re < -1.3e-156Initial program 22.2%
exp-diff22.2%
exp-to-pow22.2%
hypot-define22.2%
*-commutative22.2%
exp-prod22.2%
fma-define22.2%
hypot-define66.7%
*-commutative66.7%
Simplified66.7%
Taylor expanded in y.re around 0 66.7%
rec-exp66.7%
distribute-rgt-neg-in66.7%
mul-1-neg66.7%
exp-prod66.7%
mul-1-neg66.7%
Simplified66.7%
Taylor expanded in x.im around 0 55.7%
if -1.3e-156 < y.re < 3.2000000000000001e48Initial program 39.5%
exp-diff35.7%
exp-to-pow35.7%
hypot-define35.7%
*-commutative35.7%
exp-prod33.7%
fma-define33.7%
hypot-define76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in y.re around 0 81.8%
rec-exp81.8%
distribute-rgt-neg-in81.8%
mul-1-neg81.8%
exp-prod80.7%
mul-1-neg80.7%
Simplified80.7%
add-cbrt-cube35.9%
pow336.8%
Applied egg-rr36.8%
Taylor expanded in y.im around inf 31.2%
unpow231.2%
unpow231.2%
hypot-undefine70.5%
Simplified70.5%
if 3.2000000000000001e48 < y.re Initial program 45.5%
exp-diff40.0%
exp-to-pow40.0%
hypot-define40.0%
*-commutative40.0%
exp-prod38.2%
fma-define38.2%
hypot-define60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in y.im around 0 70.9%
Taylor expanded in y.im around 0 65.5%
Final simplification71.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -8.8e-12) (not (<= y.re 4e+48)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re))))
(sin (* y.re (atan2 x.im x.re))))
(*
(sin (* y.im (log (hypot x.im x.re))))
(pow (exp y.im) (- (atan2 x.im x.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8.8e-12) || !(y_46_re <= 4e+48)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_re * atan2(x_46_im, x_46_re)));
} else {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8.8e-12) || !(y_46_re <= 4e+48)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)))) * Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -8.8e-12) or not (y_46_re <= 4e+48): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re)))) * math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) else: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -8.8e-12) || !(y_46_re <= 4e+48)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))) * sin(Float64(y_46_re * atan(x_46_im, x_46_re)))); else tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -8.8e-12) || ~((y_46_re <= 4e+48))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * sin((y_46_re * atan2(x_46_im, x_46_re))); else tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -8.8e-12], N[Not[LessEqual[y$46$re, 4e+48]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.8 \cdot 10^{-12} \lor \neg \left(y.re \leq 4 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -8.79999999999999966e-12 or 4.00000000000000018e48 < y.re Initial program 40.6%
exp-diff33.3%
exp-to-pow33.3%
hypot-define33.3%
*-commutative33.3%
exp-prod32.5%
fma-define32.5%
hypot-define65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in y.im around 0 78.1%
Taylor expanded in y.im around 0 74.9%
if -8.79999999999999966e-12 < y.re < 4.00000000000000018e48Initial program 36.8%
exp-diff33.7%
exp-to-pow33.7%
hypot-define33.7%
*-commutative33.7%
exp-prod32.1%
fma-define32.1%
hypot-define74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y.re around 0 79.3%
rec-exp79.2%
distribute-rgt-neg-in79.2%
mul-1-neg79.2%
exp-prod78.4%
mul-1-neg78.4%
Simplified78.4%
add-cbrt-cube34.8%
pow335.5%
Applied egg-rr35.5%
Taylor expanded in y.im around inf 28.7%
unpow228.7%
unpow228.7%
hypot-undefine65.0%
Simplified65.0%
Final simplification69.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -2.9e-13) (not (<= y.re 7.5e+50)))
(*
(/ (pow (hypot x.re x.im) y.re) (+ 1.0 (* y.im (atan2 x.im x.re))))
t_0)
(* t_0 (pow (exp y.im) (- (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -2.9e-13) || !(y_46_re <= 7.5e+50)) {
tmp = (pow(hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_0 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -2.9e-13) || !(y_46_re <= 7.5e+50)) {
tmp = (Math.pow(Math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_0 * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_re <= -2.9e-13) or not (y_46_re <= 7.5e+50): tmp = (math.pow(math.hypot(x_46_re, x_46_im), y_46_re) / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re)))) * t_0 else: tmp = t_0 * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -2.9e-13) || !(y_46_re <= 7.5e+50)) tmp = Float64(Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))) * t_0); else tmp = Float64(t_0 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_re <= -2.9e-13) || ~((y_46_re <= 7.5e+50))) tmp = ((hypot(x_46_re, x_46_im) ^ y_46_re) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)))) * t_0; else tmp = t_0 * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -2.9e-13], N[Not[LessEqual[y$46$re, 7.5e+50]], $MachinePrecision]], N[(N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $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}\;y.re \leq -2.9 \cdot 10^{-13} \lor \neg \left(y.re \leq 7.5 \cdot 10^{+50}\right):\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -2.8999999999999998e-13 or 7.4999999999999999e50 < y.re Initial program 40.6%
exp-diff33.3%
exp-to-pow33.3%
hypot-define33.3%
*-commutative33.3%
exp-prod32.5%
fma-define32.5%
hypot-define65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in y.im around 0 78.1%
Taylor expanded in y.im around 0 74.9%
if -2.8999999999999998e-13 < y.re < 7.4999999999999999e50Initial program 36.8%
exp-diff33.7%
exp-to-pow33.7%
hypot-define33.7%
*-commutative33.7%
exp-prod32.1%
fma-define32.1%
hypot-define74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y.re around 0 79.3%
rec-exp79.2%
distribute-rgt-neg-in79.2%
mul-1-neg79.2%
exp-prod78.4%
mul-1-neg78.4%
Simplified78.4%
Taylor expanded in y.im around 0 48.3%
Final simplification61.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -1.45e-11) (not (<= y.re 3.1e+38)))
(* t_0 (pow (hypot x.im x.re) y.re))
(* t_0 (pow (exp y.im) (- (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1.45e-11) || !(y_46_re <= 3.1e+38)) {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * pow(exp(y_46_im), -atan2(x_46_im, x_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -1.45e-11) || !(y_46_re <= 3.1e+38)) {
tmp = t_0 * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = t_0 * Math.pow(Math.exp(y_46_im), -Math.atan2(x_46_im, x_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_re <= -1.45e-11) or not (y_46_re <= 3.1e+38): tmp = t_0 * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = t_0 * math.pow(math.exp(y_46_im), -math.atan2(x_46_im, x_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -1.45e-11) || !(y_46_re <= 3.1e+38)) tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (exp(y_46_im) ^ Float64(-atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if ((y_46_re <= -1.45e-11) || ~((y_46_re <= 3.1e+38))) tmp = t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = t_0 * (exp(y_46_im) ^ -atan2(x_46_im, x_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -1.45e-11], N[Not[LessEqual[y$46$re, 3.1e+38]], $MachinePrecision]], 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[Power[N[Exp[y$46$im], $MachinePrecision], (-N[ArcTan[x$46$im / x$46$re], $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}\;y.re \leq -1.45 \cdot 10^{-11} \lor \neg \left(y.re \leq 3.1 \cdot 10^{+38}\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(e^{y.im}\right)}^{\left(-\tan^{-1}_* \frac{x.im}{x.re}\right)}\\
\end{array}
\end{array}
if y.re < -1.45e-11 or 3.10000000000000018e38 < y.re Initial program 40.1%
Taylor expanded in y.im around 0 73.3%
Taylor expanded in y.im around 0 71.0%
unpow271.0%
unpow271.0%
hypot-undefine71.7%
Simplified71.7%
if -1.45e-11 < y.re < 3.10000000000000018e38Initial program 37.1%
exp-diff34.0%
exp-to-pow34.0%
hypot-define34.0%
*-commutative34.0%
exp-prod33.1%
fma-define33.1%
hypot-define75.6%
*-commutative75.6%
Simplified75.6%
Taylor expanded in y.re around 0 80.1%
rec-exp80.1%
distribute-rgt-neg-in80.1%
mul-1-neg80.1%
exp-prod79.3%
mul-1-neg79.3%
Simplified79.3%
Taylor expanded in y.im around 0 47.5%
Final simplification59.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.45e-11) (not (<= y.re 5e+39))) (* (sin (* y.re (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re)) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e-11) || !(y_46_re <= 5e+39)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e-11) || !(y_46_re <= 5e+39)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.45e-11) or not (y_46_re <= 5e+39): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.45e-11) || !(y_46_re <= 5e+39)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.45e-11) || ~((y_46_re <= 5e+39))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.45e-11], N[Not[LessEqual[y$46$re, 5e+39]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{-11} \lor \neg \left(y.re \leq 5 \cdot 10^{+39}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.45e-11 or 5.00000000000000015e39 < y.re Initial program 40.1%
Taylor expanded in y.im around 0 73.3%
Taylor expanded in y.im around 0 71.0%
unpow271.0%
unpow271.0%
hypot-undefine71.7%
Simplified71.7%
if -1.45e-11 < y.re < 5.00000000000000015e39Initial program 37.1%
Taylor expanded in y.im around 0 34.9%
Taylor expanded in y.re around 0 45.9%
Final simplification58.7%
(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 -200000000.0)
t_1
(if (<= y.re 3.35e-199)
(cbrt (pow t_0 3.0))
(if (<= y.re 1.1e-125)
t_0
(if (<= y.re 1.7e-46) (log (+ 1.0 (expm1 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 = sin(t_0) * pow(-x_46_im, y_46_re);
double tmp;
if (y_46_re <= -200000000.0) {
tmp = t_1;
} else if (y_46_re <= 3.35e-199) {
tmp = cbrt(pow(t_0, 3.0));
} else if (y_46_re <= 1.1e-125) {
tmp = t_0;
} else if (y_46_re <= 1.7e-46) {
tmp = log((1.0 + expm1(t_0)));
} else {
tmp = 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.sin(t_0) * Math.pow(-x_46_im, y_46_re);
double tmp;
if (y_46_re <= -200000000.0) {
tmp = t_1;
} else if (y_46_re <= 3.35e-199) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else if (y_46_re <= 1.1e-125) {
tmp = t_0;
} else if (y_46_re <= 1.7e-46) {
tmp = Math.log((1.0 + Math.expm1(t_0)));
} else {
tmp = 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 = Float64(sin(t_0) * (Float64(-x_46_im) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -200000000.0) tmp = t_1; elseif (y_46_re <= 3.35e-199) tmp = cbrt((t_0 ^ 3.0)); elseif (y_46_re <= 1.1e-125) tmp = t_0; elseif (y_46_re <= 1.7e-46) tmp = log(Float64(1.0 + expm1(t_0))); else tmp = t_1; 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, -200000000.0], t$95$1, If[LessEqual[y$46$re, 3.35e-199], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], If[LessEqual[y$46$re, 1.1e-125], t$95$0, If[LessEqual[y$46$re, 1.7e-46], N[Log[N[(1.0 + N[(Exp[t$95$0] - 1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -200000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 3.35 \cdot 10^{-199}:\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\mathbf{elif}\;y.re \leq 1.1 \cdot 10^{-125}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{-46}:\\
\;\;\;\;\log \left(1 + \mathsf{expm1}\left(t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2e8 or 1.69999999999999998e-46 < y.re Initial program 39.4%
Taylor expanded in y.im around 0 70.5%
Taylor expanded in x.im around -inf 36.1%
mul-1-neg36.1%
Simplified36.1%
Taylor expanded in y.im around 0 54.0%
if -2e8 < y.re < 3.3499999999999999e-199Initial program 33.8%
Taylor expanded in y.im around 0 29.5%
Taylor expanded in y.re around 0 40.6%
Taylor expanded in y.im around 0 15.6%
*-commutative15.6%
add-cbrt-cube28.6%
pow328.6%
*-commutative28.6%
Applied egg-rr28.6%
if 3.3499999999999999e-199 < y.re < 1.09999999999999997e-125Initial program 37.3%
Taylor expanded in y.im around 0 44.8%
Taylor expanded in y.re around 0 63.6%
Taylor expanded in y.im around 0 39.3%
if 1.09999999999999997e-125 < y.re < 1.69999999999999998e-46Initial program 68.5%
Taylor expanded in y.im around 0 46.1%
Taylor expanded in y.re around 0 55.9%
Taylor expanded in y.im around 0 12.1%
*-commutative12.1%
log1p-expm1-u12.1%
log1p-undefine38.4%
*-commutative38.4%
Applied egg-rr38.4%
Final simplification43.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.32e+45) (not (<= y.re 1.2e+36))) (* (sin (* y.re (atan2 x.im x.re))) (pow (- x.im) y.re)) (* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.32e+45) || !(y_46_re <= 1.2e+36)) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * pow(-x_46_im, y_46_re);
} else {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.32d+45)) .or. (.not. (y_46re <= 1.2d+36))) then
tmp = sin((y_46re * atan2(x_46im, x_46re))) * (-x_46im ** y_46re)
else
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.32e+45) || !(y_46_re <= 1.2e+36)) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(-x_46_im, y_46_re);
} else {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.32e+45) or not (y_46_re <= 1.2e+36): tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(-x_46_im, y_46_re) else: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.32e+45) || !(y_46_re <= 1.2e+36)) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * (Float64(-x_46_im) ^ y_46_re)); else tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.32e+45) || ~((y_46_re <= 1.2e+36))) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * (-x_46_im ^ y_46_re); else tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.32e+45], N[Not[LessEqual[y$46$re, 1.2e+36]], $MachinePrecision]], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.32 \cdot 10^{+45} \lor \neg \left(y.re \leq 1.2 \cdot 10^{+36}\right):\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.32000000000000005e45 or 1.19999999999999996e36 < y.re Initial program 39.3%
Taylor expanded in y.im around 0 73.5%
Taylor expanded in x.im around -inf 33.4%
mul-1-neg33.4%
Simplified33.4%
Taylor expanded in y.im around 0 60.2%
if -1.32000000000000005e45 < y.re < 1.19999999999999996e36Initial program 38.0%
Taylor expanded in y.im around 0 37.4%
Taylor expanded in y.re around 0 45.4%
Final simplification52.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (expm1 (* y.re (atan2 x.im x.re)))))
(if (or (<= y.im -2e-133) (not (<= y.im 9.2e-13)))
(log (+ 1.0 t_0))
(log1p t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = expm1((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2e-133) || !(y_46_im <= 9.2e-13)) {
tmp = log((1.0 + t_0));
} else {
tmp = log1p(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.expm1((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_im <= -2e-133) || !(y_46_im <= 9.2e-13)) {
tmp = Math.log((1.0 + t_0));
} else {
tmp = Math.log1p(t_0);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.expm1((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if (y_46_im <= -2e-133) or not (y_46_im <= 9.2e-13): tmp = math.log((1.0 + t_0)) else: tmp = math.log1p(t_0) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = expm1(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_im <= -2e-133) || !(y_46_im <= 9.2e-13)) tmp = log(Float64(1.0 + t_0)); else tmp = log1p(t_0); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2e-133], N[Not[LessEqual[y$46$im, 9.2e-13]], $MachinePrecision]], N[Log[N[(1.0 + t$95$0), $MachinePrecision]], $MachinePrecision], N[Log[1 + t$95$0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{-133} \lor \neg \left(y.im \leq 9.2 \cdot 10^{-13}\right):\\
\;\;\;\;\log \left(1 + t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(t\_0\right)\\
\end{array}
\end{array}
if y.im < -2.0000000000000001e-133 or 9.19999999999999917e-13 < y.im Initial program 35.3%
Taylor expanded in y.im around 0 58.8%
Taylor expanded in y.re around 0 47.4%
Taylor expanded in y.im around 0 4.0%
*-commutative4.0%
log1p-expm1-u13.9%
log1p-undefine29.7%
*-commutative29.7%
Applied egg-rr29.7%
if -2.0000000000000001e-133 < y.im < 9.19999999999999917e-13Initial program 45.0%
Taylor expanded in y.im around 0 44.7%
Taylor expanded in y.re around 0 25.3%
Taylor expanded in y.im around 0 25.3%
log1p-expm1-u34.8%
Applied egg-rr34.8%
Final simplification31.5%
(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 -5.4e-143) (not (<= y.im 1.95e+82)))
(cbrt (pow t_0 3.0))
(log1p (expm1 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 <= -5.4e-143) || !(y_46_im <= 1.95e+82)) {
tmp = cbrt(pow(t_0, 3.0));
} else {
tmp = log1p(expm1(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 <= -5.4e-143) || !(y_46_im <= 1.95e+82)) {
tmp = Math.cbrt(Math.pow(t_0, 3.0));
} else {
tmp = Math.log1p(Math.expm1(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 <= -5.4e-143) || !(y_46_im <= 1.95e+82)) tmp = cbrt((t_0 ^ 3.0)); else tmp = log1p(expm1(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, -5.4e-143], N[Not[LessEqual[y$46$im, 1.95e+82]], $MachinePrecision]], N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision], N[Log[1 + N[(Exp[t$95$0] - 1), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{-143} \lor \neg \left(y.im \leq 1.95 \cdot 10^{+82}\right):\\
\;\;\;\;\sqrt[3]{{t\_0}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(t\_0\right)\right)\\
\end{array}
\end{array}
if y.im < -5.40000000000000019e-143 or 1.94999999999999988e82 < y.im Initial program 35.4%
Taylor expanded in y.im around 0 60.6%
Taylor expanded in y.re around 0 48.8%
Taylor expanded in y.im around 0 4.3%
*-commutative4.3%
add-cbrt-cube26.2%
pow326.2%
*-commutative26.2%
Applied egg-rr26.2%
if -5.40000000000000019e-143 < y.im < 1.94999999999999988e82Initial program 42.4%
Taylor expanded in y.im around 0 46.1%
Taylor expanded in y.re around 0 29.3%
Taylor expanded in y.im around 0 19.6%
log1p-expm1-u30.6%
Applied egg-rr30.6%
Final simplification28.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (log1p (expm1 (* 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 log1p(expm1((y_46_re * atan2(x_46_im, x_46_re))));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.log1p(Math.expm1((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 math.log1p(math.expm1((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 log1p(expm1(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_] := N[Log[1 + N[(Exp[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(\mathsf{expm1}\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)
\end{array}
Initial program 38.6%
Taylor expanded in y.im around 0 53.9%
Taylor expanded in y.re around 0 39.8%
Taylor expanded in y.im around 0 11.3%
log1p-expm1-u21.1%
Applied egg-rr21.1%
Final simplification21.1%
(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 38.6%
Taylor expanded in y.im around 0 53.9%
Taylor expanded in y.re around 0 39.8%
Taylor expanded in y.im around 0 11.3%
Final simplification11.3%
herbie shell --seed 2024080
(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)))))