
(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 (log (hypot x.re x.im)))
(t_1 (sin (fma t_0 y.im (* (- y.re) (atan2 x.im x.re)))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (* (log (hypot x.im x.re)) y.im))
(t_4 (sin t_3)))
(if (<= y.re -4.8e+20)
(* t_2 (fma (* (cos t_3) (atan2 x.im x.re)) y.re t_4))
(if (<= y.re 1.95e-5)
(*
(pow
(/
t_1
(*
(sin (fma t_0 y.im (* (atan2 x.im x.re) y.re)))
(pow (hypot x.re x.im) y.re)))
-1.0)
(pow (/ (pow (exp y.im) (atan2 x.im x.re)) t_1) -1.0))
(* t_2 t_4)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = sin(fma(t_0, y_46_im, (-y_46_re * atan2(x_46_im, x_46_re))));
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re)) * y_46_im;
double t_4 = sin(t_3);
double tmp;
if (y_46_re <= -4.8e+20) {
tmp = t_2 * fma((cos(t_3) * atan2(x_46_im, x_46_re)), y_46_re, t_4);
} else if (y_46_re <= 1.95e-5) {
tmp = pow((t_1 / (sin(fma(t_0, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re))) * pow(hypot(x_46_re, x_46_im), y_46_re))), -1.0) * pow((pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / t_1), -1.0);
} else {
tmp = t_2 * t_4;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = sin(fma(t_0, y_46_im, Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re)))) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) t_4 = sin(t_3) tmp = 0.0 if (y_46_re <= -4.8e+20) tmp = Float64(t_2 * fma(Float64(cos(t_3) * atan(x_46_im, x_46_re)), y_46_re, t_4)); elseif (y_46_re <= 1.95e-5) tmp = Float64((Float64(t_1 / Float64(sin(fma(t_0, y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re))) ^ -1.0) * (Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / t_1) ^ -1.0)); else tmp = Float64(t_2 * t_4); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(t$95$0 * y$46$im + N[((-y$46$re) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e+20], N[(t$95$2 * N[(N[(N[Cos[t$95$3], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-5], N[(N[Power[N[(t$95$1 / N[(N[Sin[N[(t$95$0 * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$4), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(t\_0, y.im, \left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\\
t_4 := \sin t\_3\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{+20}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\cos t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_4\right)\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-5}:\\
\;\;\;\;{\left(\frac{t\_1}{\sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}\right)}^{-1} \cdot {\left(\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{t\_1}\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_4\\
\end{array}
\end{array}
if y.re < -4.8e20Initial program 31.0%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.9%
if -4.8e20 < y.re < 1.95e-5Initial program 34.1%
Applied rewrites74.0%
Applied rewrites82.3%
if 1.95e-5 < y.re Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (sin (fma (- (atan2 x.im x.re)) y.re (* y.im t_0))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (* t_0 y.im))
(t_4 (sin t_3)))
(if (<= y.re -4.8e+20)
(* t_2 (fma (* (cos t_3) (atan2 x.im x.re)) y.re t_4))
(if (<= y.re 1.95e-5)
(/
(*
(pow (hypot x.im x.re) y.re)
(* (sin (fma y.im t_0 (* y.re (atan2 x.im x.re)))) t_1))
(* (pow (exp y.im) (atan2 x.im x.re)) t_1))
(* t_2 t_4)))))
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_im, x_46_re));
double t_1 = sin(fma(-atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0)));
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = t_0 * y_46_im;
double t_4 = sin(t_3);
double tmp;
if (y_46_re <= -4.8e+20) {
tmp = t_2 * fma((cos(t_3) * atan2(x_46_im, x_46_re)), y_46_re, t_4);
} else if (y_46_re <= 1.95e-5) {
tmp = (pow(hypot(x_46_im, x_46_re), y_46_re) * (sin(fma(y_46_im, t_0, (y_46_re * atan2(x_46_im, x_46_re)))) * t_1)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) * t_1);
} else {
tmp = t_2 * t_4;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = sin(fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, Float64(y_46_im * t_0))) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(t_0 * y_46_im) t_4 = sin(t_3) tmp = 0.0 if (y_46_re <= -4.8e+20) tmp = Float64(t_2 * fma(Float64(cos(t_3) * atan(x_46_im, x_46_re)), y_46_re, t_4)); elseif (y_46_re <= 1.95e-5) tmp = Float64(Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * Float64(sin(fma(y_46_im, t_0, Float64(y_46_re * atan(x_46_im, x_46_re)))) * t_1)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) * t_1)); else tmp = Float64(t_2 * t_4); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e+20], N[(t$95$2 * N[(N[(N[Cos[t$95$3], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-5], N[(N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(N[Sin[N[(y$46$im * t$95$0 + N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$4), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := t\_0 \cdot y.im\\
t_4 := \sin t\_3\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{+20}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\cos t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_4\right)\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-5}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \left(\sin \left(\mathsf{fma}\left(y.im, t\_0, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \cdot t\_1\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_4\\
\end{array}
\end{array}
if y.re < -4.8e20Initial program 31.0%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.9%
if -4.8e20 < y.re < 1.95e-5Initial program 34.1%
Applied rewrites74.0%
if 1.95e-5 < y.re Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.re x.im)))
(t_1 (sin (fma t_0 y.im (* (- y.re) (atan2 x.im x.re)))))
(t_2
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_3 (* (log (hypot x.im x.re)) y.im))
(t_4 (sin t_3)))
(if (<= y.re -4.8e+20)
(* t_2 (fma (* (cos t_3) (atan2 x.im x.re)) y.re t_4))
(if (<= y.re 1.95e-5)
(*
(* t_1 (sin (fma t_0 y.im (* (atan2 x.im x.re) y.re))))
(/
(pow (hypot x.re x.im) y.re)
(* (pow (exp y.im) (atan2 x.im x.re)) t_1)))
(* t_2 t_4)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_re, x_46_im));
double t_1 = sin(fma(t_0, y_46_im, (-y_46_re * atan2(x_46_im, x_46_re))));
double t_2 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_3 = log(hypot(x_46_im, x_46_re)) * y_46_im;
double t_4 = sin(t_3);
double tmp;
if (y_46_re <= -4.8e+20) {
tmp = t_2 * fma((cos(t_3) * atan2(x_46_im, x_46_re)), y_46_re, t_4);
} else if (y_46_re <= 1.95e-5) {
tmp = (t_1 * sin(fma(t_0, y_46_im, (atan2(x_46_im, x_46_re) * y_46_re)))) * (pow(hypot(x_46_re, x_46_im), y_46_re) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) * t_1));
} else {
tmp = t_2 * t_4;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_re, x_46_im)) t_1 = sin(fma(t_0, y_46_im, Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re)))) t_2 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_3 = Float64(log(hypot(x_46_im, x_46_re)) * y_46_im) t_4 = sin(t_3) tmp = 0.0 if (y_46_re <= -4.8e+20) tmp = Float64(t_2 * fma(Float64(cos(t_3) * atan(x_46_im, x_46_re)), y_46_re, t_4)); elseif (y_46_re <= 1.95e-5) tmp = Float64(Float64(t_1 * sin(fma(t_0, y_46_im, Float64(atan(x_46_im, x_46_re) * y_46_re)))) * Float64((hypot(x_46_re, x_46_im) ^ y_46_re) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) * t_1))); else tmp = Float64(t_2 * t_4); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(t$95$0 * y$46$im + N[((-y$46$re) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]}, Block[{t$95$4 = N[Sin[t$95$3], $MachinePrecision]}, If[LessEqual[y$46$re, -4.8e+20], N[(t$95$2 * N[(N[(N[Cos[t$95$3], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + t$95$4), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-5], N[(N[(t$95$1 * N[Sin[N[(t$95$0 * y$46$im + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * t$95$4), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\\
t_1 := \sin \left(\mathsf{fma}\left(t\_0, y.im, \left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
t_2 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_3 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\\
t_4 := \sin t\_3\\
\mathbf{if}\;y.re \leq -4.8 \cdot 10^{+20}:\\
\;\;\;\;t\_2 \cdot \mathsf{fma}\left(\cos t\_3 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_4\right)\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-5}:\\
\;\;\;\;\left(t\_1 \cdot \sin \left(\mathsf{fma}\left(t\_0, y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right) \cdot \frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2 \cdot t\_4\\
\end{array}
\end{array}
if y.re < -4.8e20Initial program 31.0%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites82.9%
if -4.8e20 < y.re < 1.95e-5Initial program 34.1%
Applied rewrites74.0%
Applied rewrites74.0%
if 1.95e-5 < y.re Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_2 (* t_0 y.im))
(t_3 (sin t_2)))
(if (<= y.re -2500000000000.0)
(* t_1 (fma (* (cos t_2) (atan2 x.im x.re)) y.re t_3))
(if (<= y.re -1.5e-113)
(/
(*
(sin (* y.re (atan2 x.im x.re)))
(* (sin (* (- y.re) (atan2 x.im x.re))) (pow (hypot x.re x.im) y.re)))
(*
(pow (exp y.im) (atan2 x.im x.re))
(sin (fma (- (atan2 x.im x.re)) y.re (* y.im t_0)))))
(if (<= y.re 1.9e-5)
(* t_3 (exp (* (- y.im) (atan2 x.im x.re))))
(* t_1 t_3))))))
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_im, x_46_re));
double t_1 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_2 = t_0 * y_46_im;
double t_3 = sin(t_2);
double tmp;
if (y_46_re <= -2500000000000.0) {
tmp = t_1 * fma((cos(t_2) * atan2(x_46_im, x_46_re)), y_46_re, t_3);
} else if (y_46_re <= -1.5e-113) {
tmp = (sin((y_46_re * atan2(x_46_im, x_46_re))) * (sin((-y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_re, x_46_im), y_46_re))) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) * sin(fma(-atan2(x_46_im, x_46_re), y_46_re, (y_46_im * t_0))));
} else if (y_46_re <= 1.9e-5) {
tmp = t_3 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_1 * t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = log(hypot(x_46_im, x_46_re)) t_1 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_2 = Float64(t_0 * y_46_im) t_3 = sin(t_2) tmp = 0.0 if (y_46_re <= -2500000000000.0) tmp = Float64(t_1 * fma(Float64(cos(t_2) * atan(x_46_im, x_46_re)), y_46_re, t_3)); elseif (y_46_re <= -1.5e-113) tmp = Float64(Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * (hypot(x_46_re, x_46_im) ^ y_46_re))) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) * sin(fma(Float64(-atan(x_46_im, x_46_re)), y_46_re, Float64(y_46_im * t_0))))); elseif (y_46_re <= 1.9e-5) tmp = Float64(t_3 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(t_1 * t_3); 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$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * y$46$im), $MachinePrecision]}, Block[{t$95$3 = N[Sin[t$95$2], $MachinePrecision]}, If[LessEqual[y$46$re, -2500000000000.0], N[(t$95$1 * N[(N[(N[Cos[t$95$2], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision] * y$46$re + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.5e-113], N[(N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $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$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] * N[Sin[N[((-N[ArcTan[x$46$im / x$46$re], $MachinePrecision]) * y$46$re + N[(y$46$im * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.9e-5], N[(t$95$3 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$3), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_2 := t\_0 \cdot y.im\\
t_3 := \sin t\_2\\
\mathbf{if}\;y.re \leq -2500000000000:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\cos t\_2 \cdot \tan^{-1}_* \frac{x.im}{x.re}, y.re, t\_3\right)\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \left(\sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right)}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(\mathsf{fma}\left(-\tan^{-1}_* \frac{x.im}{x.re}, y.re, y.im \cdot t\_0\right)\right)}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;t\_3 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_3\\
\end{array}
\end{array}
if y.re < -2.5e12Initial program 32.2%
Taylor expanded in y.re around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites83.2%
if -2.5e12 < y.re < -1.5e-113Initial program 29.9%
Applied rewrites77.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f6481.9
Applied rewrites81.9%
if -1.5e-113 < y.re < 1.9000000000000001e-5Initial program 34.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6471.0
Applied rewrites71.0%
if 1.9000000000000001e-5 < y.re Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
Final simplification75.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_1 (sin (* (log (hypot x.im x.re)) y.im))))
(if (<= y.re -1e+78)
(* (sin (* (- y.re) (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(if (<= y.re -5.5e-73)
(* t_0 (sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 1.9e-5)
(* t_1 (exp (* (- y.im) (atan2 x.im x.re))))
(* 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 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -1e+78) {
tmp = sin((-y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
} else if (y_46_re <= -5.5e-73) {
tmp = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.9e-5) {
tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im)));
double t_1 = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im));
double tmp;
if (y_46_re <= -1e+78) {
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 if (y_46_re <= -5.5e-73) {
tmp = t_0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 1.9e-5) {
tmp = t_1 * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0 * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) t_1 = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0 if y_46_re <= -1e+78: 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) elif y_46_re <= -5.5e-73: tmp = t_0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 1.9e-5: tmp = t_1 * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) t_1 = sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) tmp = 0.0 if (y_46_re <= -1e+78) tmp = Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); elseif (y_46_re <= -5.5e-73) tmp = Float64(t_0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 1.9e-5) tmp = Float64(t_1 * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = Float64(t_0 * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))); t_1 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)); tmp = 0.0; if (y_46_re <= -1e+78) tmp = sin((-y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); elseif (y_46_re <= -5.5e-73) tmp = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 1.9e-5) tmp = t_1 * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = t_0 * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1e+78], 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], If[LessEqual[y$46$re, -5.5e-73], N[(t$95$0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.9e-5], N[(t$95$1 * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
t_1 := \sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right)\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+78}:\\
\;\;\;\;\sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-73}:\\
\;\;\;\;t\_0 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;t\_1 \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.re < -1.00000000000000001e78Initial program 27.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6475.1
Applied rewrites75.1%
Taylor expanded in y.re around 0
Applied rewrites10.7%
Applied rewrites9.0%
Taylor expanded in y.re around -inf
Applied rewrites91.8%
if -1.00000000000000001e78 < y.re < -5.50000000000000006e-73Initial program 40.3%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.6
Applied rewrites78.6%
if -5.50000000000000006e-73 < y.re < 1.9000000000000001e-5Initial program 32.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6468.6
Applied rewrites68.6%
if 1.9000000000000001e-5 < y.re Initial program 37.5%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.5
Applied rewrites73.5%
Final simplification74.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (- y.re) (atan2 x.im x.re)))
(pow (hypot x.im x.re) y.re))))
(if (<= y.re -1e+78)
t_0
(if (<= y.re -5.5e-73)
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 650000.0)
(*
(sin (* (log (hypot x.im x.re)) y.im))
(exp (* (- y.im) (atan2 x.im 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 = sin((-y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1e+78) {
tmp = t_0;
} else if (y_46_re <= -5.5e-73) {
tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 650000.0) {
tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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);
double tmp;
if (y_46_re <= -1e+78) {
tmp = t_0;
} else if (y_46_re <= -5.5e-73) {
tmp = Math.exp(((Math.log(Math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (Math.atan2(x_46_im, x_46_re) * y_46_im))) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 650000.0) {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
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))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1e+78: tmp = t_0 elif y_46_re <= -5.5e-73: tmp = math.exp(((math.log(math.sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (math.atan2(x_46_im, x_46_re) * y_46_im))) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 650000.0: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1e+78) tmp = t_0; elseif (y_46_re <= -5.5e-73) tmp = Float64(exp(Float64(Float64(log(sqrt(Float64(Float64(x_46_re * x_46_re) + Float64(x_46_im * x_46_im)))) * y_46_re) - Float64(atan(x_46_im, x_46_re) * y_46_im))) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 650000.0) tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); else tmp = t_0; 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))) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1e+78) tmp = t_0; elseif (y_46_re <= -5.5e-73) tmp = exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * sin((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 650000.0) tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp((-y_46_im * atan2(x_46_im, x_46_re))); else tmp = 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[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]}, If[LessEqual[y$46$re, -1e+78], t$95$0, If[LessEqual[y$46$re, -5.5e-73], N[(N[Exp[N[(N[(N[Log[N[Sqrt[N[(N[(x$46$re * x$46$re), $MachinePrecision] + N[(x$46$im * x$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * y$46$re), $MachinePrecision] - N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 650000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-73}:\\
\;\;\;\;e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 650000:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.00000000000000001e78 or 6.5e5 < y.re Initial program 32.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6456.3
Applied rewrites56.3%
Taylor expanded in y.re around 0
Applied rewrites5.2%
Applied rewrites4.1%
Taylor expanded in y.re around -inf
Applied rewrites71.6%
if -1.00000000000000001e78 < y.re < -5.50000000000000006e-73Initial program 40.3%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.6
Applied rewrites78.6%
if -5.50000000000000006e-73 < y.re < 6.5e5Initial program 33.8%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6468.5
Applied rewrites68.5%
Final simplification71.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.7e+22) (not (<= y.re 650000.0)))
(* (sin (* (- y.re) (atan2 x.im x.re))) (pow (hypot x.im x.re) y.re))
(*
(sin (* (log (hypot x.im x.re)) y.im))
(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 <= -1.7e+22) || !(y_46_re <= 650000.0)) {
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 = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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 <= -1.7e+22) || !(y_46_re <= 650000.0)) {
tmp = Math.sin((-y_46_re * Math.atan2(x_46_im, x_46_re))) * Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
} else {
tmp = Math.sin((Math.log(Math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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 <= -1.7e+22) or not (y_46_re <= 650000.0): tmp = math.sin((-y_46_re * math.atan2(x_46_im, x_46_re))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) else: tmp = math.sin((math.log(math.hypot(x_46_im, x_46_re)) * y_46_im)) * 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 <= -1.7e+22) || !(y_46_re <= 650000.0)) tmp = Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)); else tmp = Float64(sin(Float64(log(hypot(x_46_im, x_46_re)) * y_46_im)) * exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.7e+22) || ~((y_46_re <= 650000.0))) tmp = sin((-y_46_re * atan2(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re); else tmp = sin((log(hypot(x_46_im, x_46_re)) * y_46_im)) * 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, -1.7e+22], N[Not[LessEqual[y$46$re, 650000.0]], $MachinePrecision]], N[(N[Sin[N[((-y$46$re) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{+22} \lor \neg \left(y.re \leq 650000\right):\\
\;\;\;\;\sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;\sin \left(\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) \cdot y.im\right) \cdot e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\end{array}
\end{array}
if y.re < -1.7e22 or 6.5e5 < y.re Initial program 32.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6458.2
Applied rewrites58.2%
Taylor expanded in y.re around 0
Applied rewrites8.9%
Applied rewrites8.7%
Taylor expanded in y.re around -inf
Applied rewrites70.8%
if -1.7e22 < y.re < 6.5e5Initial program 35.6%
Taylor expanded in y.re around 0
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-exp.f64N/A
neg-mul-1N/A
associate-*r*N/A
lower-*.f64N/A
neg-mul-1N/A
lower-neg.f64N/A
lower-atan2.f6465.1
Applied rewrites65.1%
Final simplification67.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(sin (* (- y.re) (atan2 x.im x.re)))
(pow (hypot x.im x.re) y.re))))
(if (<= y.re -1e+26)
t_0
(if (<= y.re -1e-174)
(* (pow (* x.im x.im) (* y.re 0.5)) (sin (* (atan2 x.im x.re) y.re)))
(if (<= y.re 0.013)
(/
(sin (* y.im (log (hypot x.re x.im))))
(+ 1.0 (* y.im (atan2 x.im 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 = sin((-y_46_re * atan2(x_46_im, x_46_re))) * pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1e+26) {
tmp = t_0;
} else if (y_46_re <= -1e-174) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 0.013) {
tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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);
double tmp;
if (y_46_re <= -1e+26) {
tmp = t_0;
} else if (y_46_re <= -1e-174) {
tmp = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else if (y_46_re <= 0.013) {
tmp = Math.sin((y_46_im * Math.log(Math.hypot(x_46_re, x_46_im)))) / (1.0 + (y_46_im * Math.atan2(x_46_im, x_46_re)));
} else {
tmp = t_0;
}
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))) * math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1e+26: tmp = t_0 elif y_46_re <= -1e-174: tmp = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) elif y_46_re <= 0.013: tmp = math.sin((y_46_im * math.log(math.hypot(x_46_re, x_46_im)))) / (1.0 + (y_46_im * math.atan2(x_46_im, x_46_re))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * (hypot(x_46_im, x_46_re) ^ y_46_re)) tmp = 0.0 if (y_46_re <= -1e+26) tmp = t_0; elseif (y_46_re <= -1e-174) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); elseif (y_46_re <= 0.013) tmp = Float64(sin(Float64(y_46_im * log(hypot(x_46_re, x_46_im)))) / Float64(1.0 + Float64(y_46_im * atan(x_46_im, x_46_re)))); else tmp = t_0; 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))) * (hypot(x_46_im, x_46_re) ^ y_46_re); tmp = 0.0; if (y_46_re <= -1e+26) tmp = t_0; elseif (y_46_re <= -1e-174) tmp = ((x_46_im * x_46_im) ^ (y_46_re * 0.5)) * sin((atan2(x_46_im, x_46_re) * y_46_re)); elseif (y_46_re <= 0.013) tmp = sin((y_46_im * log(hypot(x_46_re, x_46_im)))) / (1.0 + (y_46_im * atan2(x_46_im, x_46_re))); else tmp = 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[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]}, If[LessEqual[y$46$re, -1e+26], t$95$0, If[LessEqual[y$46$re, -1e-174], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.013], N[(N[Sin[N[(y$46$im * N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(y$46$im * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1 \cdot 10^{+26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1 \cdot 10^{-174}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{elif}\;y.re \leq 0.013:\\
\;\;\;\;\frac{\sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)\right)}{1 + y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.00000000000000005e26 or 0.0129999999999999994 < y.re Initial program 34.5%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6457.9
Applied rewrites57.9%
Taylor expanded in y.re around 0
Applied rewrites9.0%
Applied rewrites8.0%
Taylor expanded in y.re around -inf
Applied rewrites70.9%
if -1.00000000000000005e26 < y.re < -1e-174Initial program 30.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6441.7
Applied rewrites41.7%
Taylor expanded in x.re around 0
Applied rewrites21.5%
Applied rewrites46.1%
if -1e-174 < y.re < 0.0129999999999999994Initial program 35.7%
Applied rewrites73.1%
Taylor expanded in y.re around 0
lower-/.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
+-commutativeN/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-atan2.f6470.0
Applied rewrites70.0%
Taylor expanded in y.im around 0
Applied rewrites42.6%
Final simplification56.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (pow (hypot x.im x.re) y.re))
(t_1 (* t_0 (sin (* (atan2 x.im x.re) y.re))))
(t_2 (* (sin (* (- y.re) (atan2 x.im x.re))) t_0)))
(if (<= y.re -2e+77)
t_2
(if (<= y.re -8.5e-91)
t_1
(if (<= y.re 3.8e-124)
(* 1.0 (sin (pow (pow (* y.re (atan2 x.im x.re)) 4.0) 0.25)))
(if (<= y.re 1.95e-5) t_1 t_2))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = pow(hypot(x_46_im, x_46_re), y_46_re);
double t_1 = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = sin((-y_46_re * atan2(x_46_im, x_46_re))) * t_0;
double tmp;
if (y_46_re <= -2e+77) {
tmp = t_2;
} else if (y_46_re <= -8.5e-91) {
tmp = t_1;
} else if (y_46_re <= 3.8e-124) {
tmp = 1.0 * sin(pow(pow((y_46_re * atan2(x_46_im, x_46_re)), 4.0), 0.25));
} else if (y_46_re <= 1.95e-5) {
tmp = t_1;
} else {
tmp = 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 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double t_1 = t_0 * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double t_2 = Math.sin((-y_46_re * Math.atan2(x_46_im, x_46_re))) * t_0;
double tmp;
if (y_46_re <= -2e+77) {
tmp = t_2;
} else if (y_46_re <= -8.5e-91) {
tmp = t_1;
} else if (y_46_re <= 3.8e-124) {
tmp = 1.0 * Math.sin(Math.pow(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 4.0), 0.25));
} else if (y_46_re <= 1.95e-5) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) t_1 = t_0 * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) t_2 = math.sin((-y_46_re * math.atan2(x_46_im, x_46_re))) * t_0 tmp = 0 if y_46_re <= -2e+77: tmp = t_2 elif y_46_re <= -8.5e-91: tmp = t_1 elif y_46_re <= 3.8e-124: tmp = 1.0 * math.sin(math.pow(math.pow((y_46_re * math.atan2(x_46_im, x_46_re)), 4.0), 0.25)) elif y_46_re <= 1.95e-5: tmp = t_1 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re t_1 = Float64(t_0 * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))) t_2 = Float64(sin(Float64(Float64(-y_46_re) * atan(x_46_im, x_46_re))) * t_0) tmp = 0.0 if (y_46_re <= -2e+77) tmp = t_2; elseif (y_46_re <= -8.5e-91) tmp = t_1; elseif (y_46_re <= 3.8e-124) tmp = Float64(1.0 * sin(((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 4.0) ^ 0.25))); elseif (y_46_re <= 1.95e-5) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = hypot(x_46_im, x_46_re) ^ y_46_re; t_1 = t_0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); t_2 = sin((-y_46_re * atan2(x_46_im, x_46_re))) * t_0; tmp = 0.0; if (y_46_re <= -2e+77) tmp = t_2; elseif (y_46_re <= -8.5e-91) tmp = t_1; elseif (y_46_re <= 3.8e-124) tmp = 1.0 * sin((((y_46_re * atan2(x_46_im, x_46_re)) ^ 4.0) ^ 0.25)); elseif (y_46_re <= 1.95e-5) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[((-y$46$re) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[y$46$re, -2e+77], t$95$2, If[LessEqual[y$46$re, -8.5e-91], t$95$1, If[LessEqual[y$46$re, 3.8e-124], N[(1.0 * N[Sin[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 4.0], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-5], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
t_1 := t\_0 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
t_2 := \sin \left(\left(-y.re\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_0\\
\mathbf{if}\;y.re \leq -2 \cdot 10^{+77}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -8.5 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{-124}:\\
\;\;\;\;1 \cdot \sin \left({\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\right)\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -1.99999999999999997e77 or 1.95e-5 < y.re Initial program 34.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6455.2
Applied rewrites55.2%
Taylor expanded in y.re around 0
Applied rewrites5.2%
Applied rewrites4.0%
Taylor expanded in y.re around -inf
Applied rewrites70.2%
if -1.99999999999999997e77 < y.re < -8.49999999999999985e-91 or 3.80000000000000012e-124 < y.re < 1.95e-5Initial program 38.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6450.6
Applied rewrites50.6%
if -8.49999999999999985e-91 < y.re < 3.80000000000000012e-124Initial program 31.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6413.3
Applied rewrites13.3%
Taylor expanded in y.re around 0
Applied rewrites13.3%
Applied rewrites18.7%
Applied rewrites25.3%
Final simplification49.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8.5e-91) (not (<= y.re 3.8e-124))) (* (pow (hypot x.im x.re) y.re) (sin (* (atan2 x.im x.re) y.re))) (* 1.0 (sin (pow (pow (* y.re (atan2 x.im x.re)) 4.0) 0.25)))))
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.5e-91) || !(y_46_re <= 3.8e-124)) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * sin(pow(pow((y_46_re * atan2(x_46_im, x_46_re)), 4.0), 0.25));
}
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.5e-91) || !(y_46_re <= 3.8e-124)) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
} else {
tmp = 1.0 * Math.sin(Math.pow(Math.pow((y_46_re * Math.atan2(x_46_im, x_46_re)), 4.0), 0.25));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -8.5e-91) or not (y_46_re <= 3.8e-124): tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) else: tmp = 1.0 * math.sin(math.pow(math.pow((y_46_re * math.atan2(x_46_im, x_46_re)), 4.0), 0.25)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -8.5e-91) || !(y_46_re <= 3.8e-124)) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(atan(x_46_im, x_46_re) * y_46_re))); else tmp = Float64(1.0 * sin(((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 4.0) ^ 0.25))); 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.5e-91) || ~((y_46_re <= 3.8e-124))) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((atan2(x_46_im, x_46_re) * y_46_re)); else tmp = 1.0 * sin((((y_46_re * atan2(x_46_im, x_46_re)) ^ 4.0) ^ 0.25)); 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.5e-91], N[Not[LessEqual[y$46$re, 3.8e-124]], $MachinePrecision]], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Sin[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 4.0], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.5 \cdot 10^{-91} \lor \neg \left(y.re \leq 3.8 \cdot 10^{-124}\right):\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \sin \left({\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\right)\\
\end{array}
\end{array}
if y.re < -8.49999999999999985e-91 or 3.80000000000000012e-124 < y.re Initial program 35.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.3
Applied rewrites53.3%
if -8.49999999999999985e-91 < y.re < 3.80000000000000012e-124Initial program 31.4%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6413.3
Applied rewrites13.3%
Taylor expanded in y.re around 0
Applied rewrites13.3%
Applied rewrites18.7%
Applied rewrites25.3%
Final simplification43.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -2.5e-32)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.re 2e-21)
(* 1.0 (sin (pow (pow (* y.re (atan2 x.im x.re)) 4.0) 0.25)))
(* (pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -2.5e-32) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else if (y_46_re <= 2e-21) {
tmp = 1.0 * sin(pow(pow((y_46_re * atan2(x_46_im, x_46_re)), 4.0), 0.25));
} else {
tmp = pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -2.5e-32) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= 2e-21) tmp = Float64(1.0 * sin(((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 4.0) ^ 0.25))); else tmp = Float64((fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_46_re) * t_0); 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.5e-32], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2e-21], N[(1.0 * N[Sin[N[Power[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 4.0], $MachinePrecision], 0.25], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-21}:\\
\;\;\;\;1 \cdot \sin \left({\left({\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{4}\right)}^{0.25}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -2.5e-32Initial program 32.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6469.5
Applied rewrites69.5%
Taylor expanded in x.im around 0
Applied rewrites69.6%
if -2.5e-32 < y.re < 1.99999999999999982e-21Initial program 34.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6419.9
Applied rewrites19.9%
Taylor expanded in y.re around 0
Applied rewrites19.9%
Applied rewrites19.8%
Applied rewrites24.5%
if 1.99999999999999982e-21 < y.re Initial program 36.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6444.4
Applied rewrites44.4%
Taylor expanded in x.re around 0
Applied rewrites41.4%
Final simplification41.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -1.16e-28)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.re -5.6e-228)
(* (pow (* x.im x.im) (* y.re 0.5)) t_0)
(if (<= y.re 7.8e-156)
(* 1.0 (sin (sqrt (pow (* y.re (atan2 x.im x.re)) 2.0))))
(if (<= y.re 2e+37)
(* 1.0 (sin (* (pow (sqrt y.re) 2.0) (atan2 x.im x.re))))
(* (pow (fma 0.5 (/ (* x.re x.re) x.im) x.im) y.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.16e-28) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else if (y_46_re <= -5.6e-228) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else if (y_46_re <= 7.8e-156) {
tmp = 1.0 * sin(sqrt(pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0)));
} else if (y_46_re <= 2e+37) {
tmp = 1.0 * sin((pow(sqrt(y_46_re), 2.0) * atan2(x_46_im, x_46_re)));
} else {
tmp = pow(fma(0.5, ((x_46_re * x_46_re) / x_46_im), x_46_im), y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -1.16e-28) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= -5.6e-228) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_0); elseif (y_46_re <= 7.8e-156) tmp = Float64(1.0 * sin(sqrt((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0)))); elseif (y_46_re <= 2e+37) tmp = Float64(1.0 * sin(Float64((sqrt(y_46_re) ^ 2.0) * atan(x_46_im, x_46_re)))); else tmp = Float64((fma(0.5, Float64(Float64(x_46_re * x_46_re) / x_46_im), x_46_im) ^ y_46_re) * t_0); 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.16e-28], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -5.6e-228], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 7.8e-156], N[(1.0 * N[Sin[N[Sqrt[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2e+37], N[(1.0 * N[Sin[N[(N[Power[N[Sqrt[y$46$re], $MachinePrecision], 2.0], $MachinePrecision] * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(0.5 * N[(N[(x$46$re * x$46$re), $MachinePrecision] / x$46$im), $MachinePrecision] + x$46$im), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.16 \cdot 10^{-28}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -5.6 \cdot 10^{-228}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-156}:\\
\;\;\;\;1 \cdot \sin \left(\sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\right)\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{+37}:\\
\;\;\;\;1 \cdot \sin \left({\left(\sqrt{y.re}\right)}^{2} \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.re \cdot x.re}{x.im}, x.im\right)\right)}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.1600000000000001e-28Initial program 32.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.5
Applied rewrites70.5%
Taylor expanded in x.im around 0
Applied rewrites69.2%
if -1.1600000000000001e-28 < y.re < -5.6000000000000005e-228Initial program 30.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6424.0
Applied rewrites24.0%
Taylor expanded in x.re around 0
Applied rewrites9.6%
Applied rewrites36.5%
if -5.6000000000000005e-228 < y.re < 7.8000000000000002e-156Initial program 34.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6412.3
Applied rewrites12.3%
Taylor expanded in y.re around 0
Applied rewrites12.3%
Applied rewrites24.3%
Applied rewrites24.3%
if 7.8000000000000002e-156 < y.re < 1.99999999999999991e37Initial program 34.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6423.9
Applied rewrites23.9%
Taylor expanded in y.re around 0
Applied rewrites22.4%
Applied rewrites12.5%
Applied rewrites22.4%
if 1.99999999999999991e37 < y.re Initial program 37.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6452.9
Applied rewrites52.9%
Taylor expanded in x.re around 0
Applied rewrites51.1%
Final simplification43.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= y.re -1.16e-28)
(* (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re) t_0)
(if (<= y.re -5.6e-228)
(* (pow (* x.im x.im) (* y.re 0.5)) t_0)
(if (<= y.re 7.8e-156)
(* 1.0 (sin (sqrt (pow (* y.re (atan2 x.im x.re)) 2.0))))
(if (<= y.re 6.2e+58)
(*
1.0
(*
y.re
(fma
-0.16666666666666666
(* (* y.re y.re) (pow (atan2 x.im x.re) 3.0))
(atan2 x.im x.re))))
(* (pow x.re y.re) t_0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.16e-28) {
tmp = pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re) * t_0;
} else if (y_46_re <= -5.6e-228) {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
} else if (y_46_re <= 7.8e-156) {
tmp = 1.0 * sin(sqrt(pow((y_46_re * atan2(x_46_im, x_46_re)), 2.0)));
} else if (y_46_re <= 6.2e+58) {
tmp = 1.0 * (y_46_re * fma(-0.16666666666666666, ((y_46_re * y_46_re) * pow(atan2(x_46_im, x_46_re), 3.0)), atan2(x_46_im, x_46_re)));
} else {
tmp = pow(x_46_re, y_46_re) * t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (y_46_re <= -1.16e-28) tmp = Float64((fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re) * t_0); elseif (y_46_re <= -5.6e-228) tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_0); elseif (y_46_re <= 7.8e-156) tmp = Float64(1.0 * sin(sqrt((Float64(y_46_re * atan(x_46_im, x_46_re)) ^ 2.0)))); elseif (y_46_re <= 6.2e+58) tmp = Float64(1.0 * Float64(y_46_re * fma(-0.16666666666666666, Float64(Float64(y_46_re * y_46_re) * (atan(x_46_im, x_46_re) ^ 3.0)), atan(x_46_im, x_46_re)))); else tmp = Float64((x_46_re ^ y_46_re) * t_0); 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[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -1.16e-28], N[(N[Power[N[(0.5 * N[(N[(x$46$im * x$46$im), $MachinePrecision] / x$46$re), $MachinePrecision] + x$46$re), $MachinePrecision], y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -5.6e-228], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 7.8e-156], N[(1.0 * N[Sin[N[Sqrt[N[Power[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+58], N[(1.0 * N[(y$46$re * N[(-0.16666666666666666 * N[(N[(y$46$re * y$46$re), $MachinePrecision] * N[Power[N[ArcTan[x$46$im / x$46$re], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.16 \cdot 10^{-28}:\\
\;\;\;\;{\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;y.re \leq -5.6 \cdot 10^{-228}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-156}:\\
\;\;\;\;1 \cdot \sin \left(\sqrt{{\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{2}}\right)\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+58}:\\
\;\;\;\;1 \cdot \left(y.re \cdot \mathsf{fma}\left(-0.16666666666666666, \left(y.re \cdot y.re\right) \cdot {\tan^{-1}_* \frac{x.im}{x.re}}^{3}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.1600000000000001e-28Initial program 32.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6470.5
Applied rewrites70.5%
Taylor expanded in x.im around 0
Applied rewrites69.2%
if -1.1600000000000001e-28 < y.re < -5.6000000000000005e-228Initial program 30.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6424.0
Applied rewrites24.0%
Taylor expanded in x.re around 0
Applied rewrites9.6%
Applied rewrites36.5%
if -5.6000000000000005e-228 < y.re < 7.8000000000000002e-156Initial program 34.8%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6412.3
Applied rewrites12.3%
Taylor expanded in y.re around 0
Applied rewrites12.3%
Applied rewrites24.3%
Applied rewrites24.3%
if 7.8000000000000002e-156 < y.re < 6.1999999999999998e58Initial program 35.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6425.1
Applied rewrites25.1%
Taylor expanded in y.re around 0
Applied rewrites21.5%
Taylor expanded in y.re around 0
Applied rewrites21.6%
if 6.1999999999999998e58 < y.re Initial program 37.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6453.1
Applied rewrites53.1%
Taylor expanded in x.im around 0
Applied rewrites49.4%
Final simplification42.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= x.im -5.8e-43)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 1.0)
(* (pow x.re y.re) t_0)
(* (pow (* x.im x.im) (* y.re 0.5)) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-43) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow((x_46_im * x_46_im), (y_46_re * 0.5)) * 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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-5.8d-43)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 1.0d0) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = ((x_46im * x_46im) ** (y_46re * 0.5d0)) * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-43) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -5.8e-43: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 1.0: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow((x_46_im * x_46_im), (y_46_re * 0.5)) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -5.8e-43) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 1.0) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((Float64(x_46_im * x_46_im) ^ Float64(y_46_re * 0.5)) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -5.8e-43) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 1.0) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = ((x_46_im * x_46_im) ^ (y_46_re * 0.5)) * 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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -5.8e-43], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 1.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[N[(x$46$im * x$46$im), $MachinePrecision], N[(y$46$re * 0.5), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -5.8 \cdot 10^{-43}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 1:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(x.im \cdot x.im\right)}^{\left(y.re \cdot 0.5\right)} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -5.8000000000000003e-43Initial program 27.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.2
Applied rewrites40.2%
Taylor expanded in x.im around -inf
Applied rewrites39.6%
if -5.8000000000000003e-43 < x.im < 1Initial program 42.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.7
Applied rewrites43.7%
Taylor expanded in x.im around 0
Applied rewrites37.8%
if 1 < x.im Initial program 28.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.3
Applied rewrites31.3%
Taylor expanded in x.re around 0
Applied rewrites31.3%
Applied rewrites33.8%
Final simplification37.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (or (<= x.re -1.9e-31) (not (<= x.re 2.3e-25)))
(* (pow x.re y.re) t_0)
(* (pow x.im y.re) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((x_46_re <= -1.9e-31) || !(x_46_re <= 2.3e-25)) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if ((x_46re <= (-1.9d-31)) .or. (.not. (x_46re <= 2.3d-25))) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((x_46_re <= -1.9e-31) || !(x_46_re <= 2.3e-25)) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (x_46_re <= -1.9e-31) or not (x_46_re <= 2.3e-25): tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((x_46_re <= -1.9e-31) || !(x_46_re <= 2.3e-25)) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((x_46_re <= -1.9e-31) || ~((x_46_re <= 2.3e-25))) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[x$46$re, -1.9e-31], N[Not[LessEqual[x$46$re, 2.3e-25]], $MachinePrecision]], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.re \leq -1.9 \cdot 10^{-31} \lor \neg \left(x.re \leq 2.3 \cdot 10^{-25}\right):\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.re < -1.9e-31 or 2.2999999999999999e-25 < x.re Initial program 25.7%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6438.7
Applied rewrites38.7%
Taylor expanded in x.im around 0
Applied rewrites32.8%
if -1.9e-31 < x.re < 2.2999999999999999e-25Initial program 44.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.7
Applied rewrites40.7%
Taylor expanded in x.re around 0
Applied rewrites34.2%
Final simplification33.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (or (<= y.re -0.6) (not (<= y.re 2.3e+31)))
(* (pow x.im y.re) t_0)
(* 1.0 t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -0.6) || !(y_46_re <= 2.3e+31)) {
tmp = pow(x_46_im, y_46_re) * t_0;
} else {
tmp = 1.0 * 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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if ((y_46re <= (-0.6d0)) .or. (.not. (y_46re <= 2.3d+31))) then
tmp = (x_46im ** y_46re) * t_0
else
tmp = 1.0d0 * 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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if ((y_46_re <= -0.6) || !(y_46_re <= 2.3e+31)) {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
} else {
tmp = 1.0 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if (y_46_re <= -0.6) or not (y_46_re <= 2.3e+31): tmp = math.pow(x_46_im, y_46_re) * t_0 else: tmp = 1.0 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if ((y_46_re <= -0.6) || !(y_46_re <= 2.3e+31)) tmp = Float64((x_46_im ^ y_46_re) * t_0); else tmp = Float64(1.0 * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if ((y_46_re <= -0.6) || ~((y_46_re <= 2.3e+31))) tmp = (x_46_im ^ y_46_re) * t_0; else tmp = 1.0 * 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[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.6], N[Not[LessEqual[y$46$re, 2.3e+31]], $MachinePrecision]], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(1.0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -0.6 \lor \neg \left(y.re \leq 2.3 \cdot 10^{+31}\right):\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -0.599999999999999978 or 2.3e31 < y.re Initial program 33.9%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6462.8
Applied rewrites62.8%
Taylor expanded in x.re around 0
Applied rewrites44.0%
if -0.599999999999999978 < y.re < 2.3e31Initial program 34.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6420.7
Applied rewrites20.7%
Taylor expanded in y.re around 0
Applied rewrites18.9%
Final simplification30.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* (atan2 x.im x.re) y.re))))
(if (<= x.im -5.8e-43)
(* (pow (- x.im) y.re) t_0)
(if (<= x.im 1.0) (* (pow x.re y.re) t_0) (* (pow x.im y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-43) {
tmp = pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = pow(x_46_re, y_46_re) * t_0;
} else {
tmp = pow(x_46_im, y_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) :: tmp
t_0 = sin((atan2(x_46im, x_46re) * y_46re))
if (x_46im <= (-5.8d-43)) then
tmp = (-x_46im ** y_46re) * t_0
else if (x_46im <= 1.0d0) then
tmp = (x_46re ** y_46re) * t_0
else
tmp = (x_46im ** y_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.sin((Math.atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (x_46_im <= -5.8e-43) {
tmp = Math.pow(-x_46_im, y_46_re) * t_0;
} else if (x_46_im <= 1.0) {
tmp = Math.pow(x_46_re, y_46_re) * t_0;
} else {
tmp = Math.pow(x_46_im, y_46_re) * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((math.atan2(x_46_im, x_46_re) * y_46_re)) tmp = 0 if x_46_im <= -5.8e-43: tmp = math.pow(-x_46_im, y_46_re) * t_0 elif x_46_im <= 1.0: tmp = math.pow(x_46_re, y_46_re) * t_0 else: tmp = math.pow(x_46_im, y_46_re) * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(atan(x_46_im, x_46_re) * y_46_re)) tmp = 0.0 if (x_46_im <= -5.8e-43) tmp = Float64((Float64(-x_46_im) ^ y_46_re) * t_0); elseif (x_46_im <= 1.0) tmp = Float64((x_46_re ^ y_46_re) * t_0); else tmp = Float64((x_46_im ^ y_46_re) * t_0); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (x_46_im <= -5.8e-43) tmp = (-x_46_im ^ y_46_re) * t_0; elseif (x_46_im <= 1.0) tmp = (x_46_re ^ y_46_re) * t_0; else tmp = (x_46_im ^ y_46_re) * t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -5.8e-43], N[(N[Power[(-x$46$im), y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[x$46$im, 1.0], N[(N[Power[x$46$re, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Power[x$46$im, y$46$re], $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;x.im \leq -5.8 \cdot 10^{-43}:\\
\;\;\;\;{\left(-x.im\right)}^{y.re} \cdot t\_0\\
\mathbf{elif}\;x.im \leq 1:\\
\;\;\;\;{x.re}^{y.re} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;{x.im}^{y.re} \cdot t\_0\\
\end{array}
\end{array}
if x.im < -5.8000000000000003e-43Initial program 27.0%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6440.2
Applied rewrites40.2%
Taylor expanded in x.im around -inf
Applied rewrites39.6%
if -5.8000000000000003e-43 < x.im < 1Initial program 42.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6443.7
Applied rewrites43.7%
Taylor expanded in x.im around 0
Applied rewrites37.8%
if 1 < x.im Initial program 28.6%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6431.3
Applied rewrites31.3%
Taylor expanded in x.re around 0
Applied rewrites31.3%
Final simplification36.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* 1.0 (sin (* (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) {
return 1.0 * sin((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
code = 1.0d0 * sin((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) {
return 1.0 * Math.sin((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): return 1.0 * math.sin((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) return Float64(1.0 * sin(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) tmp = 1.0 * sin((atan2(x_46_im, x_46_re) * y_46_re)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(1.0 * N[Sin[N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)
\end{array}
Initial program 34.3%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6439.6
Applied rewrites39.6%
Taylor expanded in y.re around 0
Applied rewrites14.6%
Final simplification14.6%
herbie shell --seed 2024315
(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)))))