
(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 15 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 (log (hypot x.re x.im))))
(if (<= y.re 2.5e+78)
(*
(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)))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (* y.im (log (hypot x.im x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double tmp;
if (y_46_re <= 2.5e+78) {
tmp = 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))));
} 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((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 = log(hypot(x_46_re, x_46_im)) tmp = 0.0 if (y_46_re <= 2.5e+78) tmp = 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))))); 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(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[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, 2.5e+78], 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], 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[(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 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
\mathbf{if}\;y.re \leq 2.5 \cdot 10^{+78}:\\
\;\;\;\;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)\\
\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 \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < 2.49999999999999992e78Initial program 44.0%
fma-neg44.0%
hypot-def44.0%
distribute-rgt-neg-out44.0%
fma-def44.0%
hypot-def87.4%
*-commutative87.4%
Simplified87.4%
if 2.49999999999999992e78 < y.re Initial program 47.7%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def77.3%
Simplified77.3%
Final simplification85.7%
(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))))
(t_2 (* y.im (log (hypot x.im x.re)))))
(if (<= y.re -1100.0)
(* t_1 (sin (+ t_0 (fabs t_2))))
(if (<= y.re 58000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (sin 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_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 t_2 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -1100.0) {
tmp = t_1 * sin((t_0 + fabs(t_2)));
} else if (y_46_re <= 58000000.0) {
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_2);
}
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))) t_2 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if (y_46_re <= -1100.0) tmp = Float64(t_1 * sin(Float64(t_0 + abs(t_2)))); elseif (y_46_re <= 58000000.0) 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_2)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$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]}, Block[{t$95$2 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1100.0], N[(t$95$1 * N[Sin[N[(t$95$0 + N[Abs[t$95$2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 58000000.0], 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$2], $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}\\
t_2 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -1100:\\
\;\;\;\;t\_1 \cdot \sin \left(t\_0 + \left|t\_2\right|\right)\\
\mathbf{elif}\;y.re \leq 58000000:\\
\;\;\;\;\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\_2\\
\end{array}
\end{array}
if y.re < -1100Initial program 44.9%
add-sqr-sqrt23.1%
sqrt-unprod39.7%
pow239.7%
*-commutative39.7%
hypot-udef78.2%
Applied egg-rr78.2%
unpow278.2%
rem-sqrt-square92.3%
hypot-def46.2%
unpow246.2%
unpow246.2%
+-commutative46.2%
unpow246.2%
unpow246.2%
hypot-def92.3%
Simplified92.3%
if -1100 < y.re < 5.8e7Initial program 42.5%
fma-neg42.5%
hypot-def42.5%
distribute-rgt-neg-out42.5%
fma-def42.5%
hypot-def83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.re around 0 81.9%
neg-mul-181.9%
distribute-rgt-neg-in81.9%
Simplified81.9%
if 5.8e7 < y.re Initial program 48.3%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def80.0%
Simplified80.0%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1 (sin (fma (log (hypot x.re x.im)) y.im t_0)))
(t_2
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (fabs t_0)))))
(if (<= y.re -1100.0)
t_2
(if (<= y.re 2.4e+25)
(* t_1 (exp (* (atan2 x.im x.re) (- y.im))))
(if (or (<= y.re 8.2e+67) (not (<= y.re 1.45e+249)))
(* t_1 (pow (hypot x.re x.im) y.re))
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_re * atan2(x_46_im, x_46_re);
double t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0));
double t_2 = 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_0));
double tmp;
if (y_46_re <= -1100.0) {
tmp = t_2;
} else if (y_46_re <= 2.4e+25) {
tmp = t_1 * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else if ((y_46_re <= 8.2e+67) || !(y_46_re <= 1.45e+249)) {
tmp = t_1 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = t_2;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) t_2 = 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_0))) tmp = 0.0 if (y_46_re <= -1100.0) tmp = t_2; elseif (y_46_re <= 2.4e+25) tmp = Float64(t_1 * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); elseif ((y_46_re <= 8.2e+67) || !(y_46_re <= 1.45e+249)) tmp = Float64(t_1 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = t_2; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{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] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1100.0], t$95$2, If[LessEqual[y$46$re, 2.4e+25], N[(t$95$1 * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$re, 8.2e+67], N[Not[LessEqual[y$46$re, 1.45e+249]], $MachinePrecision]], N[(t$95$1 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)\\
t_2 := 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\_0\right|\right)\\
\mathbf{if}\;y.re \leq -1100:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+25}:\\
\;\;\;\;t\_1 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{+67} \lor \neg \left(y.re \leq 1.45 \cdot 10^{+249}\right):\\
\;\;\;\;t\_1 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1100 or 8.19999999999999959e67 < y.re < 1.45000000000000008e249Initial program 44.3%
Taylor expanded in y.im around 0 77.4%
*-commutative53.4%
add-sqr-sqrt24.6%
sqrt-unprod32.4%
pow232.4%
*-commutative32.4%
Applied egg-rr54.8%
unpow232.4%
rem-sqrt-square56.9%
Simplified84.4%
if -1100 < y.re < 2.39999999999999996e25Initial program 43.5%
fma-neg43.5%
hypot-def43.5%
distribute-rgt-neg-out43.5%
fma-def43.5%
hypot-def83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in y.re around 0 81.4%
neg-mul-181.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if 2.39999999999999996e25 < y.re < 8.19999999999999959e67 or 1.45000000000000008e249 < y.re Initial program 52.4%
exp-diff42.9%
exp-to-pow42.9%
hypot-def42.9%
*-commutative42.9%
exp-prod42.9%
fma-def42.9%
hypot-def76.2%
*-commutative76.2%
Simplified76.2%
Taylor expanded in y.im around 0 81.0%
Final simplification82.7%
(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 -1100.0)
(* t_1 (sin (fabs t_0)))
(if (<= y.re 33000000.0)
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_1 (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_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 <= -1100.0) {
tmp = t_1 * sin(fabs(t_0));
} else if (y_46_re <= 33000000.0) {
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((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(atan(x_46_im, x_46_re) * y_46_im))) tmp = 0.0 if (y_46_re <= -1100.0) tmp = Float64(t_1 * sin(abs(t_0))); elseif (y_46_re <= 33000000.0) 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(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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1100.0], N[(t$95$1 * N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 33000000.0], 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[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.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 -1100:\\
\;\;\;\;t\_1 \cdot \sin \left(\left|t\_0\right|\right)\\
\mathbf{elif}\;y.re \leq 33000000:\\
\;\;\;\;\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 \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\end{array}
\end{array}
if y.re < -1100Initial program 44.9%
Taylor expanded in y.im around 0 87.2%
*-commutative59.3%
add-sqr-sqrt25.8%
sqrt-unprod33.5%
pow233.5%
*-commutative33.5%
Applied egg-rr57.7%
unpow233.5%
rem-sqrt-square63.1%
Simplified91.0%
if -1100 < y.re < 3.3e7Initial program 42.5%
fma-neg42.5%
hypot-def42.5%
distribute-rgt-neg-out42.5%
fma-def42.5%
hypot-def83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.re around 0 81.9%
neg-mul-181.9%
distribute-rgt-neg-in81.9%
Simplified81.9%
if 3.3e7 < y.re Initial program 48.3%
Taylor expanded in y.re around 0 50.0%
unpow250.0%
unpow250.0%
hypot-def80.0%
Simplified80.0%
Final simplification84.3%
(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 -1100.0) (not (<= y.re 4100000000.0)))
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(*
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(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 <= -1100.0) || !(y_46_re <= 4100000000.0)) {
tmp = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * 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 <= -1100.0) || !(y_46_re <= 4100000000.0)) tmp = Float64(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) * 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, -1100.0], N[Not[LessEqual[y$46$re, 4100000000.0]], $MachinePrecision]], N[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$0), $MachinePrecision]], $MachinePrecision] * N[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 -1100 \lor \neg \left(y.re \leq 4100000000\right):\\
\;\;\;\;t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -1100 or 4.1e9 < y.re Initial program 46.4%
Taylor expanded in y.im around 0 76.1%
Taylor expanded in y.re around 0 78.3%
if -1100 < y.re < 4.1e9Initial program 42.5%
fma-neg42.5%
hypot-def42.5%
distribute-rgt-neg-out42.5%
fma-def42.5%
hypot-def83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y.re around 0 81.9%
neg-mul-181.9%
distribute-rgt-neg-in81.9%
Simplified81.9%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(sin (fma (log (hypot x.re x.im)) y.im (* y.re (atan2 x.im x.re))))))
(if (or (<= y.re -5.5e-13) (not (<= y.re 5.1e+25)))
(* t_0 (pow (hypot x.re x.im) y.re))
(* 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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, (y_46_re * atan2(x_46_im, x_46_re))));
double tmp;
if ((y_46_re <= -5.5e-13) || !(y_46_re <= 5.1e+25)) {
tmp = t_0 * pow(hypot(x_46_re, x_46_im), y_46_re);
} else {
tmp = 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 = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, Float64(y_46_re * atan(x_46_im, x_46_re)))) tmp = 0.0 if ((y_46_re <= -5.5e-13) || !(y_46_re <= 5.1e+25)) tmp = Float64(t_0 * (hypot(x_46_re, x_46_im) ^ y_46_re)); else tmp = Float64(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[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -5.5e-13], N[Not[LessEqual[y$46$re, 5.1e+25]], $MachinePrecision]], N[(t$95$0 * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 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 := \sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{-13} \lor \neg \left(y.re \leq 5.1 \cdot 10^{+25}\right):\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\end{array}
\end{array}
if y.re < -5.49999999999999979e-13 or 5.1000000000000004e25 < y.re Initial program 44.6%
exp-diff35.3%
exp-to-pow35.3%
hypot-def35.3%
*-commutative35.3%
exp-prod35.3%
fma-def35.3%
hypot-def67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in y.im around 0 78.5%
if -5.49999999999999979e-13 < y.re < 5.1000000000000004e25Initial program 44.6%
fma-neg44.6%
hypot-def44.6%
distribute-rgt-neg-out44.6%
fma-def44.6%
hypot-def83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y.re around 0 82.0%
neg-mul-182.0%
distribute-rgt-neg-in82.0%
Simplified82.0%
Final simplification80.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re)))
(t_1
(*
t_0
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))))
(t_2 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= y.re -1100.0)
t_1
(if (<= y.re -1.2e-107)
(* t_2 (sin t_0))
(if (<= y.re 39000000.0)
(* (sin (* y.im (log (hypot x.im x.re)))) t_2)
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 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1100.0) {
tmp = t_1;
} else if (y_46_re <= -1.2e-107) {
tmp = t_2 * sin(t_0);
} else if (y_46_re <= 39000000.0) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2;
} 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 = t_0 * Math.exp(((y_46_re * Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (y_46_re <= -1100.0) {
tmp = t_1;
} else if (y_46_re <= -1.2e-107) {
tmp = t_2 * Math.sin(t_0);
} else if (y_46_re <= 39000000.0) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_2;
} else {
tmp = 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 = t_0 * math.exp(((y_46_re * math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_2 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if y_46_re <= -1100.0: tmp = t_1 elif y_46_re <= -1.2e-107: tmp = t_2 * math.sin(t_0) elif y_46_re <= 39000000.0: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_2 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(t_0 * exp(Float64(Float64(y_46_re * log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im))))) - Float64(atan(x_46_im, x_46_re) * y_46_im)))) t_2 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -1100.0) tmp = t_1; elseif (y_46_re <= -1.2e-107) tmp = Float64(t_2 * sin(t_0)); elseif (y_46_re <= 39000000.0) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2); else tmp = 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 = t_0 * exp(((y_46_re * log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im))))) - (atan2(x_46_im, x_46_re) * y_46_im))); t_2 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (y_46_re <= -1100.0) tmp = t_1; elseif (y_46_re <= -1.2e-107) tmp = t_2 * sin(t_0); elseif (y_46_re <= 39000000.0) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_2; else tmp = 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[(t$95$0 * N[Exp[N[(N[(y$46$re * N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1100.0], t$95$1, If[LessEqual[y$46$re, -1.2e-107], N[(t$95$2 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 39000000.0], 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$2), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_1 := t\_0 \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;y.re \leq -1100:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.2 \cdot 10^{-107}:\\
\;\;\;\;t\_2 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 39000000:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1100 or 3.9e7 < y.re Initial program 46.4%
Taylor expanded in y.im around 0 76.1%
Taylor expanded in y.re around 0 78.3%
if -1100 < y.re < -1.19999999999999997e-107Initial program 16.7%
fma-neg16.7%
hypot-def16.7%
distribute-rgt-neg-out16.7%
fma-def16.7%
hypot-def80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in y.re around 0 75.5%
neg-mul-175.5%
distribute-rgt-neg-in75.5%
Simplified75.5%
Taylor expanded in y.im around 0 66.6%
if -1.19999999999999997e-107 < y.re < 3.9e7Initial program 49.1%
fma-neg49.1%
hypot-def49.1%
distribute-rgt-neg-out49.1%
fma-def49.1%
hypot-def84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in y.re around 0 83.6%
neg-mul-183.6%
distribute-rgt-neg-in83.6%
Simplified83.6%
Taylor expanded in y.re around 0 38.6%
unpow238.6%
unpow238.6%
hypot-def68.5%
Simplified68.5%
Final simplification73.6%
(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))
(t_3 (exp (* (atan2 x.im x.re) (- y.im)))))
(if (<= x.re -6.4)
(* t_2 (exp (- (* y.re (log (- x.re))) t_0)))
(if (<= x.re -9.2e-96)
(* (sin (* y.im (log (hypot x.im x.re)))) t_3)
(if (<= x.re -5.8e-228)
(* y.re (* (atan2 x.im x.re) t_3))
(if (<= x.re 9e-217)
(* t_1 (pow x.im y.re))
(* t_2 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (x_46_re <= -6.4) {
tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
} else if (x_46_re <= -9.2e-96) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3;
} else if (x_46_re <= -5.8e-228) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * t_3);
} else if (x_46_re <= 9e-217) {
tmp = t_1 * pow(x_46_im, y_46_re);
} else {
tmp = t_2 * 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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double t_2 = Math.sin(t_1);
double t_3 = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
double tmp;
if (x_46_re <= -6.4) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
} else if (x_46_re <= -9.2e-96) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_3;
} else if (x_46_re <= -5.8e-228) {
tmp = y_46_re * (Math.atan2(x_46_im, x_46_re) * t_3);
} else if (x_46_re <= 9e-217) {
tmp = t_1 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_2 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) t_3 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) tmp = 0 if x_46_re <= -6.4: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) elif x_46_re <= -9.2e-96: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_3 elif x_46_re <= -5.8e-228: tmp = y_46_re * (math.atan2(x_46_im, x_46_re) * t_3) elif x_46_re <= 9e-217: tmp = t_1 * math.pow(x_46_im, y_46_re) else: tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) tmp = 0.0 if (x_46_re <= -6.4) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))); elseif (x_46_re <= -9.2e-96) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3); elseif (x_46_re <= -5.8e-228) tmp = Float64(y_46_re * Float64(atan(x_46_im, x_46_re) * t_3)); elseif (x_46_re <= 9e-217) tmp = Float64(t_1 * (x_46_im ^ y_46_re)); else tmp = Float64(t_2 * 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 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); t_3 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); tmp = 0.0; if (x_46_re <= -6.4) tmp = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); elseif (x_46_re <= -9.2e-96) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_3; elseif (x_46_re <= -5.8e-228) tmp = y_46_re * (atan2(x_46_im, x_46_re) * t_3); elseif (x_46_re <= 9e-217) tmp = t_1 * (x_46_im ^ y_46_re); else tmp = t_2 * 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[(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[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -6.4], 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, -9.2e-96], 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], If[LessEqual[x$46$re, -5.8e-228], N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$re, 9e-217], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{if}\;x.re \leq -6.4:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{elif}\;x.re \leq -9.2 \cdot 10^{-96}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_3\\
\mathbf{elif}\;x.re \leq -5.8 \cdot 10^{-228}:\\
\;\;\;\;y.re \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot t\_3\right)\\
\mathbf{elif}\;x.re \leq 9 \cdot 10^{-217}:\\
\;\;\;\;t\_1 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -6.4000000000000004Initial program 33.0%
Taylor expanded in y.im around 0 69.4%
Taylor expanded in x.re around -inf 77.8%
mul-1-neg77.8%
Simplified77.8%
if -6.4000000000000004 < x.re < -9.2e-96Initial program 66.5%
fma-neg66.5%
hypot-def66.5%
distribute-rgt-neg-out66.5%
fma-def66.5%
hypot-def86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in y.re around 0 70.7%
neg-mul-170.7%
distribute-rgt-neg-in70.7%
Simplified70.7%
Taylor expanded in y.re around 0 44.9%
unpow244.9%
unpow244.9%
hypot-def65.4%
Simplified65.4%
if -9.2e-96 < x.re < -5.8000000000000002e-228Initial program 59.4%
Taylor expanded in y.im around 0 67.3%
Taylor expanded in x.re around 0 28.7%
*-commutative28.7%
Simplified28.7%
Taylor expanded in y.re around 0 65.1%
*-commutative65.1%
distribute-lft-neg-in65.1%
Simplified65.1%
if -5.8000000000000002e-228 < x.re < 8.9999999999999997e-217Initial program 36.6%
Taylor expanded in y.im around 0 66.9%
Taylor expanded in x.re around 0 39.9%
*-commutative39.9%
Simplified39.9%
Taylor expanded in y.im around 0 50.5%
Taylor expanded in y.re around 0 60.5%
if 8.9999999999999997e-217 < x.re Initial program 41.7%
Taylor expanded in y.im around 0 56.8%
Taylor expanded in x.re around inf 59.4%
Final simplification64.7%
(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))
(t_3 (* t_2 (exp (- (* y.re (log (- x.re))) t_0)))))
(if (<= x.re -6.5e-61)
t_3
(if (<= x.re -8e-192)
(*
(exp (* (atan2 x.im x.re) (- y.im)))
(sin (- t_1 (* y.im (log (/ -1.0 x.re))))))
(if (<= x.re -5.6e-229)
t_3
(if (<= x.re 5.4e-217)
(* t_1 (pow x.im y.re))
(* t_2 (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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0));
double tmp;
if (x_46_re <= -6.5e-61) {
tmp = t_3;
} else if (x_46_re <= -8e-192) {
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 (x_46_re <= -5.6e-229) {
tmp = t_3;
} else if (x_46_re <= 5.4e-217) {
tmp = t_1 * pow(x_46_im, y_46_re);
} else {
tmp = t_2 * exp(((y_46_re * log(x_46_re)) - 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) :: t_3
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)
t_3 = t_2 * exp(((y_46re * log(-x_46re)) - t_0))
if (x_46re <= (-6.5d-61)) then
tmp = t_3
else if (x_46re <= (-8d-192)) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im)) * sin((t_1 - (y_46im * log(((-1.0d0) / x_46re)))))
else if (x_46re <= (-5.6d-229)) then
tmp = t_3
else if (x_46re <= 5.4d-217) then
tmp = t_1 * (x_46im ** y_46re)
else
tmp = t_2 * exp(((y_46re * log(x_46re)) - 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 t_3 = t_2 * Math.exp(((y_46_re * Math.log(-x_46_re)) - t_0));
double tmp;
if (x_46_re <= -6.5e-61) {
tmp = t_3;
} else if (x_46_re <= -8e-192) {
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 (x_46_re <= -5.6e-229) {
tmp = t_3;
} else if (x_46_re <= 5.4e-217) {
tmp = t_1 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_2 * 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 = y_46_re * math.atan2(x_46_im, x_46_re) t_2 = math.sin(t_1) t_3 = t_2 * math.exp(((y_46_re * math.log(-x_46_re)) - t_0)) tmp = 0 if x_46_re <= -6.5e-61: tmp = t_3 elif x_46_re <= -8e-192: 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 x_46_re <= -5.6e-229: tmp = t_3 elif x_46_re <= 5.4e-217: tmp = t_1 * math.pow(x_46_im, y_46_re) else: tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_re))) - t_0))) tmp = 0.0 if (x_46_re <= -6.5e-61) tmp = t_3; elseif (x_46_re <= -8e-192) 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 (x_46_re <= -5.6e-229) tmp = t_3; elseif (x_46_re <= 5.4e-217) tmp = Float64(t_1 * (x_46_im ^ y_46_re)); else tmp = Float64(t_2 * 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 = y_46_re * atan2(x_46_im, x_46_re); t_2 = sin(t_1); t_3 = t_2 * exp(((y_46_re * log(-x_46_re)) - t_0)); tmp = 0.0; if (x_46_re <= -6.5e-61) tmp = t_3; elseif (x_46_re <= -8e-192) 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 (x_46_re <= -5.6e-229) tmp = t_3; elseif (x_46_re <= 5.4e-217) tmp = t_1 * (x_46_im ^ y_46_re); else tmp = t_2 * 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[(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[(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, -6.5e-61], t$95$3, If[LessEqual[x$46$re, -8e-192], 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[x$46$re, -5.6e-229], t$95$3, If[LessEqual[x$46$re, 5.4e-217], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 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 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
t_2 := \sin t\_1\\
t_3 := t\_2 \cdot e^{y.re \cdot \log \left(-x.re\right) - t\_0}\\
\mathbf{if}\;x.re \leq -6.5 \cdot 10^{-61}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.re \leq -8 \cdot 10^{-192}:\\
\;\;\;\;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}\;x.re \leq -5.6 \cdot 10^{-229}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x.re \leq 5.4 \cdot 10^{-217}:\\
\;\;\;\;t\_1 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log x.re - t\_0}\\
\end{array}
\end{array}
if x.re < -6.4999999999999994e-61 or -8.0000000000000008e-192 < x.re < -5.5999999999999998e-229Initial program 43.8%
Taylor expanded in y.im around 0 68.4%
Taylor expanded in x.re around -inf 74.1%
mul-1-neg74.1%
Simplified74.1%
if -6.4999999999999994e-61 < x.re < -8.0000000000000008e-192Initial program 59.4%
fma-neg59.4%
hypot-def59.4%
distribute-rgt-neg-out59.4%
fma-def59.4%
hypot-def82.9%
*-commutative82.9%
Simplified82.9%
Taylor expanded in y.re around 0 69.2%
neg-mul-169.2%
distribute-rgt-neg-in69.2%
Simplified69.2%
Taylor expanded in x.re around -inf 67.3%
+-commutative67.3%
mul-1-neg67.3%
unsub-neg67.3%
Simplified67.3%
if -5.5999999999999998e-229 < x.re < 5.40000000000000032e-217Initial program 36.6%
Taylor expanded in y.im around 0 66.9%
Taylor expanded in x.re around 0 39.9%
*-commutative39.9%
Simplified39.9%
Taylor expanded in y.im around 0 50.5%
Taylor expanded in y.re around 0 60.5%
if 5.40000000000000032e-217 < x.re Initial program 41.7%
Taylor expanded in y.im around 0 56.8%
Taylor expanded in x.re around inf 59.4%
Final simplification65.1%
(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))
(t_3 (exp (- (* y.re (log x.im)) t_0))))
(if (<= x.im -1.2e-308)
(* t_2 (exp (- (* y.re (log (- x.im))) t_0)))
(if (<= x.im 9e+188)
(* t_1 t_3)
(if (<= x.im 1.02e+259)
(*
(sin (* y.im (log (hypot x.im x.re))))
(exp (* (atan2 x.im x.re) (- y.im))))
(* t_2 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 = y_46_re * atan2(x_46_im, x_46_re);
double t_2 = sin(t_1);
double t_3 = exp(((y_46_re * log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.2e-308) {
tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0));
} else if (x_46_im <= 9e+188) {
tmp = t_1 * t_3;
} else if (x_46_im <= 1.02e+259) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * t_3;
}
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 t_3 = Math.exp(((y_46_re * Math.log(x_46_im)) - t_0));
double tmp;
if (x_46_im <= -1.2e-308) {
tmp = t_2 * Math.exp(((y_46_re * Math.log(-x_46_im)) - t_0));
} else if (x_46_im <= 9e+188) {
tmp = t_1 * t_3;
} else if (x_46_im <= 1.02e+259) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im));
} else {
tmp = t_2 * t_3;
}
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) t_3 = math.exp(((y_46_re * math.log(x_46_im)) - t_0)) tmp = 0 if x_46_im <= -1.2e-308: tmp = t_2 * math.exp(((y_46_re * math.log(-x_46_im)) - t_0)) elif x_46_im <= 9e+188: tmp = t_1 * t_3 elif x_46_im <= 1.02e+259: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) else: tmp = t_2 * 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_2 = sin(t_1) t_3 = exp(Float64(Float64(y_46_re * log(x_46_im)) - t_0)) tmp = 0.0 if (x_46_im <= -1.2e-308) tmp = Float64(t_2 * exp(Float64(Float64(y_46_re * log(Float64(-x_46_im))) - t_0))); elseif (x_46_im <= 9e+188) tmp = Float64(t_1 * t_3); elseif (x_46_im <= 1.02e+259) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im)))); else tmp = Float64(t_2 * t_3); 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); t_3 = exp(((y_46_re * log(x_46_im)) - t_0)); tmp = 0.0; if (x_46_im <= -1.2e-308) tmp = t_2 * exp(((y_46_re * log(-x_46_im)) - t_0)); elseif (x_46_im <= 9e+188) tmp = t_1 * t_3; elseif (x_46_im <= 1.02e+259) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * exp((atan2(x_46_im, x_46_re) * -y_46_im)); else tmp = t_2 * t_3; 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]}, Block[{t$95$3 = N[Exp[N[(N[(y$46$re * N[Log[x$46$im], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -1.2e-308], 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, 9e+188], N[(t$95$1 * t$95$3), $MachinePrecision], If[LessEqual[x$46$im, 1.02e+259], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$3), $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\\
t_3 := e^{y.re \cdot \log x.im - t\_0}\\
\mathbf{if}\;x.im \leq -1.2 \cdot 10^{-308}:\\
\;\;\;\;t\_2 \cdot e^{y.re \cdot \log \left(-x.im\right) - t\_0}\\
\mathbf{elif}\;x.im \leq 9 \cdot 10^{+188}:\\
\;\;\;\;t\_1 \cdot t\_3\\
\mathbf{elif}\;x.im \leq 1.02 \cdot 10^{+259}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_3\\
\end{array}
\end{array}
if x.im < -1.1999999999999998e-308Initial program 47.7%
Taylor expanded in y.im around 0 62.1%
Taylor expanded in x.im around -inf 64.6%
mul-1-neg64.6%
Simplified64.6%
if -1.1999999999999998e-308 < x.im < 9.00000000000000021e188Initial program 51.2%
Taylor expanded in y.im around 0 64.9%
Taylor expanded in x.re around 0 52.0%
*-commutative52.0%
Simplified52.0%
Taylor expanded in y.re around 0 55.0%
if 9.00000000000000021e188 < x.im < 1.02000000000000007e259Initial program 0.0%
fma-neg0.0%
hypot-def0.0%
distribute-rgt-neg-out0.0%
fma-def0.0%
hypot-def76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in y.re around 0 69.5%
neg-mul-169.5%
distribute-rgt-neg-in69.5%
Simplified69.5%
Taylor expanded in y.re around 0 0.0%
unpow20.0%
unpow20.0%
hypot-def70.2%
Simplified70.2%
if 1.02000000000000007e259 < x.im Initial program 0.0%
Taylor expanded in y.im around 0 64.3%
Taylor expanded in x.re around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification62.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (exp (* (atan2 x.im x.re) (- y.im))))
(t_1 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.5e+15)
(* (sin (fabs t_1)) (pow x.im y.re))
(if (<= y.re -3.6e-106)
(* t_0 (sin t_1))
(if (<= y.re 2e+26)
(* (sin (* y.im (log (hypot x.im x.re)))) t_0)
(* t_1 (pow x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im));
double t_1 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.5e+15) {
tmp = sin(fabs(t_1)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= -3.6e-106) {
tmp = t_0 * sin(t_1);
} else if (y_46_re <= 2e+26) {
tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_1 * pow(x_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp((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 tmp;
if (y_46_re <= -1.5e+15) {
tmp = Math.sin(Math.abs(t_1)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= -3.6e-106) {
tmp = t_0 * Math.sin(t_1);
} else if (y_46_re <= 2e+26) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_im, x_46_re)))) * t_0;
} else {
tmp = t_1 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) t_1 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -1.5e+15: tmp = math.sin(math.fabs(t_1)) * math.pow(x_46_im, y_46_re) elif y_46_re <= -3.6e-106: tmp = t_0 * math.sin(t_1) elif y_46_re <= 2e+26: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) * t_0 else: tmp = t_1 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(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)) tmp = 0.0 if (y_46_re <= -1.5e+15) tmp = Float64(sin(abs(t_1)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= -3.6e-106) tmp = Float64(t_0 * sin(t_1)); elseif (y_46_re <= 2e+26) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0); else tmp = Float64(t_1 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp((atan2(x_46_im, x_46_re) * -y_46_im)); t_1 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -1.5e+15) tmp = sin(abs(t_1)) * (x_46_im ^ y_46_re); elseif (y_46_re <= -3.6e-106) tmp = t_0 * sin(t_1); elseif (y_46_re <= 2e+26) tmp = sin((y_46_im * log(hypot(x_46_im, x_46_re)))) * t_0; else tmp = t_1 * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e+15], N[(N[Sin[N[Abs[t$95$1], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.6e-106], N[(t$95$0 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+26], 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$0), $MachinePrecision], N[(t$95$1 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)}\\
t_1 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{+15}:\\
\;\;\;\;\sin \left(\left|t\_1\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq -3.6 \cdot 10^{-106}:\\
\;\;\;\;t\_0 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+26}:\\
\;\;\;\;\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.5e15Initial program 45.9%
Taylor expanded in y.im around 0 87.9%
Taylor expanded in x.re around 0 36.6%
*-commutative36.6%
Simplified36.6%
Taylor expanded in y.im around 0 62.5%
*-commutative62.5%
add-sqr-sqrt27.2%
sqrt-unprod34.0%
pow234.0%
*-commutative34.0%
Applied egg-rr34.0%
unpow234.0%
rem-sqrt-square65.2%
Simplified65.2%
if -1.5e15 < y.re < -3.60000000000000013e-106Initial program 17.9%
fma-neg17.9%
hypot-def17.9%
distribute-rgt-neg-out17.9%
fma-def17.9%
hypot-def83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y.re around 0 72.1%
neg-mul-172.1%
distribute-rgt-neg-in72.1%
Simplified72.1%
Taylor expanded in y.im around 0 64.3%
if -3.60000000000000013e-106 < y.re < 2.0000000000000001e26Initial program 50.2%
fma-neg50.2%
hypot-def50.2%
distribute-rgt-neg-out50.2%
fma-def50.2%
hypot-def84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in y.re around 0 82.9%
neg-mul-182.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Taylor expanded in y.re around 0 38.8%
unpow238.8%
unpow238.8%
hypot-def68.1%
Simplified68.1%
if 2.0000000000000001e26 < y.re Initial program 46.6%
Taylor expanded in y.im around 0 60.4%
Taylor expanded in x.re around 0 15.8%
*-commutative15.8%
Simplified15.8%
Taylor expanded in y.im around 0 45.4%
Taylor expanded in y.re around 0 48.9%
Final simplification62.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.5e+15)
(* (sin (fabs t_0)) (pow x.im y.re))
(if (<= y.re 2.95e+41)
(* (exp (* (atan2 x.im x.re) (- y.im))) (sin t_0))
(* 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.5e+15) {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.95e+41) {
tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin(t_0);
} 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 = y_46re * atan2(x_46im, x_46re)
if (y_46re <= (-1.5d+15)) then
tmp = sin(abs(t_0)) * (x_46im ** y_46re)
else if (y_46re <= 2.95d+41) then
tmp = exp((atan2(x_46im, x_46re) * -y_46im)) * sin(t_0)
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.5e+15) {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.95e+41) {
tmp = Math.exp((Math.atan2(x_46_im, x_46_re) * -y_46_im)) * Math.sin(t_0);
} 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -1.5e+15: tmp = math.sin(math.fabs(t_0)) * math.pow(x_46_im, y_46_re) elif y_46_re <= 2.95e+41: tmp = math.exp((math.atan2(x_46_im, x_46_re) * -y_46_im)) * math.sin(t_0) 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.5e+15) tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 2.95e+41) tmp = Float64(exp(Float64(atan(x_46_im, x_46_re) * Float64(-y_46_im))) * sin(t_0)); 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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -1.5e+15) tmp = sin(abs(t_0)) * (x_46_im ^ y_46_re); elseif (y_46_re <= 2.95e+41) tmp = exp((atan2(x_46_im, x_46_re) * -y_46_im)) * sin(t_0); 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.5e+15], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.95e+41], N[(N[Exp[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * (-y$46$im)), $MachinePrecision]], $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.5 \cdot 10^{+15}:\\
\;\;\;\;\sin \left(\left|t\_0\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.95 \cdot 10^{+41}:\\
\;\;\;\;e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(-y.im\right)} \cdot \sin t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.5e15Initial program 45.9%
Taylor expanded in y.im around 0 87.9%
Taylor expanded in x.re around 0 36.6%
*-commutative36.6%
Simplified36.6%
Taylor expanded in y.im around 0 62.5%
*-commutative62.5%
add-sqr-sqrt27.2%
sqrt-unprod34.0%
pow234.0%
*-commutative34.0%
Applied egg-rr34.0%
unpow234.0%
rem-sqrt-square65.2%
Simplified65.2%
if -1.5e15 < y.re < 2.95e41Initial program 43.1%
fma-neg43.1%
hypot-def43.1%
distribute-rgt-neg-out43.1%
fma-def43.1%
hypot-def83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in y.re around 0 78.8%
neg-mul-178.8%
distribute-rgt-neg-in78.8%
Simplified78.8%
Taylor expanded in y.im around 0 57.9%
if 2.95e41 < y.re Initial program 46.3%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in x.re around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in y.im around 0 45.1%
Taylor expanded in y.re around 0 48.8%
Final simplification58.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 x.im x.re))))
(if (<= y.re -1.35e+15)
(* (sin (fabs t_0)) (pow x.im y.re))
(if (<= y.re 2.9e+37)
(* y.re (* (atan2 x.im x.re) (exp (* (atan2 x.im x.re) (- y.im)))))
(* 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 = y_46_re * atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.35e+15) {
tmp = sin(fabs(t_0)) * pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.9e+37) {
tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im)));
} 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 = y_46re * atan2(x_46im, x_46re)
if (y_46re <= (-1.35d+15)) then
tmp = sin(abs(t_0)) * (x_46im ** y_46re)
else if (y_46re <= 2.9d+37) then
tmp = y_46re * (atan2(x_46im, x_46re) * exp((atan2(x_46im, x_46re) * -y_46im)))
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 = y_46_re * Math.atan2(x_46_im, x_46_re);
double tmp;
if (y_46_re <= -1.35e+15) {
tmp = Math.sin(Math.abs(t_0)) * Math.pow(x_46_im, y_46_re);
} else if (y_46_re <= 2.9e+37) {
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)));
} 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 = y_46_re * math.atan2(x_46_im, x_46_re) tmp = 0 if y_46_re <= -1.35e+15: tmp = math.sin(math.fabs(t_0)) * math.pow(x_46_im, y_46_re) elif y_46_re <= 2.9e+37: 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))) 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 = Float64(y_46_re * atan(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -1.35e+15) tmp = Float64(sin(abs(t_0)) * (x_46_im ^ y_46_re)); elseif (y_46_re <= 2.9e+37) 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))))); 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 = y_46_re * atan2(x_46_im, x_46_re); tmp = 0.0; if (y_46_re <= -1.35e+15) tmp = sin(abs(t_0)) * (x_46_im ^ y_46_re); elseif (y_46_re <= 2.9e+37) tmp = y_46_re * (atan2(x_46_im, x_46_re) * exp((atan2(x_46_im, x_46_re) * -y_46_im))); 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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.35e+15], N[(N[Sin[N[Abs[t$95$0], $MachinePrecision]], $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.9e+37], 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], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\\
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{+15}:\\
\;\;\;\;\sin \left(\left|t\_0\right|\right) \cdot {x.im}^{y.re}\\
\mathbf{elif}\;y.re \leq 2.9 \cdot 10^{+37}:\\
\;\;\;\;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)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if y.re < -1.35e15Initial program 45.9%
Taylor expanded in y.im around 0 87.9%
Taylor expanded in x.re around 0 36.6%
*-commutative36.6%
Simplified36.6%
Taylor expanded in y.im around 0 62.5%
*-commutative62.5%
add-sqr-sqrt27.2%
sqrt-unprod34.0%
pow234.0%
*-commutative34.0%
Applied egg-rr34.0%
unpow234.0%
rem-sqrt-square65.2%
Simplified65.2%
if -1.35e15 < y.re < 2.89999999999999978e37Initial program 43.1%
Taylor expanded in y.im around 0 47.6%
Taylor expanded in x.re around 0 24.9%
*-commutative24.9%
Simplified24.9%
Taylor expanded in y.re around 0 57.9%
*-commutative57.9%
distribute-lft-neg-in57.9%
Simplified57.9%
if 2.89999999999999978e37 < y.re Initial program 46.3%
Taylor expanded in y.im around 0 59.3%
Taylor expanded in x.re around 0 13.2%
*-commutative13.2%
Simplified13.2%
Taylor expanded in y.im around 0 45.1%
Taylor expanded in y.re around 0 48.8%
Final simplification58.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.65e+15) (not (<= y.re 1.3e+38))) (* (* 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 <= -3.65e+15) || !(y_46_re <= 1.3e+38)) {
tmp = (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 <= (-3.65d+15)) .or. (.not. (y_46re <= 1.3d+38))) then
tmp = (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 <= -3.65e+15) || !(y_46_re <= 1.3e+38)) {
tmp = (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 <= -3.65e+15) or not (y_46_re <= 1.3e+38): tmp = (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 <= -3.65e+15) || !(y_46_re <= 1.3e+38)) tmp = Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (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 <= -3.65e+15) || ~((y_46_re <= 1.3e+38))) tmp = (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, -3.65e+15], N[Not[LessEqual[y$46$re, 1.3e+38]], $MachinePrecision]], N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $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 -3.65 \cdot 10^{+15} \lor \neg \left(y.re \leq 1.3 \cdot 10^{+38}\right):\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{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 < -3.65e15 or 1.3e38 < y.re Initial program 45.7%
Taylor expanded in y.im around 0 76.4%
Taylor expanded in x.re around 0 26.9%
*-commutative26.9%
Simplified26.9%
Taylor expanded in y.im around 0 55.5%
Taylor expanded in y.re around 0 57.9%
if -3.65e15 < y.re < 1.3e38Initial program 43.5%
Taylor expanded in y.im around 0 47.2%
Taylor expanded in x.re around 0 24.7%
*-commutative24.7%
Simplified24.7%
Taylor expanded in y.re around 0 57.4%
*-commutative57.4%
distribute-lft-neg-in57.4%
Simplified57.4%
Final simplification57.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (* y.re (atan2 x.im x.re)) (pow x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * atan2(x_46_im, x_46_re)) * pow(x_46_im, y_46_re);
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = (y_46re * atan2(x_46im, x_46re)) * (x_46im ** y_46re)
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (y_46_re * Math.atan2(x_46_im, x_46_re)) * Math.pow(x_46_im, y_46_re);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (y_46_re * math.atan2(x_46_im, x_46_re)) * math.pow(x_46_im, y_46_re)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(y_46_re * atan(x_46_im, x_46_re)) * (x_46_im ^ y_46_re)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (y_46_re * atan2(x_46_im, x_46_re)) * (x_46_im ^ y_46_re); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {x.im}^{y.re}
\end{array}
Initial program 44.6%
Taylor expanded in y.im around 0 61.7%
Taylor expanded in x.re around 0 25.8%
*-commutative25.8%
Simplified25.8%
Taylor expanded in y.im around 0 31.1%
Taylor expanded in y.re around 0 32.6%
Final simplification32.6%
herbie shell --seed 2024027
(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)))))