
(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 22 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.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 (* (atan2 x.im x.re) y.re)))
(if (<= y.re -1.1e-75)
(* t_1 (fma (* (cos t_2) t_0) y.im (sin t_2)))
(if (<= y.re 31000.0)
(/
(sin (fma (log (hypot x.re x.im)) y.im t_2))
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.re x.im) y.re)))
(if (<= y.re 6.4e+93)
(*
(pow (hypot x.im x.re) y.re)
(sin (pow (/ (pow y.im -1.0) t_0) -1.0)))
(* t_1 (sin (pow (pow (fma y.im t_0 t_2) -1.0) -1.0))))))))
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 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_re <= -1.1e-75) {
tmp = t_1 * fma((cos(t_2) * t_0), y_46_im, sin(t_2));
} else if (y_46_re <= 31000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else if (y_46_re <= 6.4e+93) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(pow((pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = t_1 * sin(pow(pow(fma(y_46_im, t_0, t_2), -1.0), -1.0));
}
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(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_re <= -1.1e-75) tmp = Float64(t_1 * fma(Float64(cos(t_2) * t_0), y_46_im, sin(t_2))); elseif (y_46_re <= 31000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re))); elseif (y_46_re <= 6.4e+93) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); else tmp = Float64(t_1 * sin(((fma(y_46_im, t_0, t_2) ^ -1.0) ^ -1.0))); 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.1e-75], N[(t$95$1 * N[(N[(N[Cos[t$95$2], $MachinePrecision] * t$95$0), $MachinePrecision] * y$46$im + N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 31000.0], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.4e+93], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + t$95$2), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $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 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{-75}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(\cos t\_2 \cdot t\_0, y.im, \sin t\_2\right)\\
\mathbf{elif}\;y.re \leq 31000:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right)}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{+93}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_0, t\_2\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -1.10000000000000003e-75Initial program 47.2%
Taylor expanded in y.im around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites83.2%
if -1.10000000000000003e-75 < y.re < 31000Initial program 43.6%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites53.4%
Applied rewrites83.2%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites83.2%
if 31000 < y.re < 6.4000000000000003e93Initial program 22.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6416.8
Applied rewrites16.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6416.8
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6455.8
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6455.8
lift-/.f64N/A
inv-powN/A
lower-pow.f6455.8
Applied rewrites55.8%
Taylor expanded in y.re around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.6
Applied rewrites83.6%
if 6.4000000000000003e93 < y.re Initial program 47.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites73.9%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re))
(t_1 (* y.im (log (hypot x.im x.re)))))
(if (or (<= y.re -2.1e-7) (not (<= y.re 230000000.0)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(fma (sin t_0) (cos t_1) (* (cos t_0) (sin t_1))))
(/
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.re 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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_1 = y_46_im * log(hypot(x_46_im, x_46_re));
double tmp;
if ((y_46_re <= -2.1e-7) || !(y_46_re <= 230000000.0)) {
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))) * fma(sin(t_0), cos(t_1), (cos(t_0) * sin(t_1)));
} else {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, 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(atan(x_46_im, x_46_re) * y_46_re) t_1 = Float64(y_46_im * log(hypot(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -2.1e-7) || !(y_46_re <= 230000000.0)) 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))) * fma(sin(t_0), cos(t_1), Float64(cos(t_0) * sin(t_1)))); else tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$re, -2.1e-7], N[Not[LessEqual[y$46$re, 230000000.0]], $MachinePrecision]], 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[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision] + N[(N[Cos[t$95$0], $MachinePrecision] * N[Sin[t$95$1], $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[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_1 := y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-7} \lor \neg \left(y.re \leq 230000000\right):\\
\;\;\;\;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 \mathsf{fma}\left(\sin t\_0, \cos t\_1, \cos t\_0 \cdot \sin t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\end{array}
\end{array}
if y.re < -2.1e-7 or 2.3e8 < y.re Initial program 43.6%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites77.5%
if -2.1e-7 < y.re < 2.3e8Initial program 44.6%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.7%
Applied rewrites84.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites84.3%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.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 (log (hypot x.im x.re))))
(if (<= y.re -2.1e-7)
(* t_1 (sin t_0))
(if (<= y.re 31000.0)
(/
(sin (fma (log (hypot x.re x.im)) y.im t_0))
(/ (pow (exp y.im) (atan2 x.im x.re)) (pow (hypot x.re x.im) y.re)))
(if (<= y.re 6.4e+93)
(*
(pow (hypot x.im x.re) y.re)
(sin (pow (/ (pow y.im -1.0) t_2) -1.0)))
(* t_1 (sin (pow (pow (fma y.im t_2 t_0) -1.0) -1.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_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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_re <= -2.1e-7) {
tmp = t_1 * sin(t_0);
} else if (y_46_re <= 31000.0) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) / (pow(exp(y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else if (y_46_re <= 6.4e+93) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(pow((pow(y_46_im, -1.0) / t_2), -1.0));
} else {
tmp = t_1 * sin(pow(pow(fma(y_46_im, t_2, t_0), -1.0), -1.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_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 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_re <= -2.1e-7) tmp = Float64(t_1 * sin(t_0)); elseif (y_46_re <= 31000.0) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_0)) / Float64((exp(y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re))); elseif (y_46_re <= 6.4e+93) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin((Float64((y_46_im ^ -1.0) / t_2) ^ -1.0))); else tmp = Float64(t_1 * sin(((fma(y_46_im, t_2, t_0) ^ -1.0) ^ -1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-7], N[(t$95$1 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 31000.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[(N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.4e+93], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$2), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$2 + t$95$0), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-7}:\\
\;\;\;\;t\_1 \cdot \sin t\_0\\
\mathbf{elif}\;y.re \leq 31000:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_0\right)\right)}{\frac{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{+93}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_2}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_2, t\_0\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -2.1e-7Initial program 44.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.1
Applied rewrites82.1%
if -2.1e-7 < y.re < 31000Initial program 45.7%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.5%
Applied rewrites83.9%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites83.9%
if 31000 < y.re < 6.4000000000000003e93Initial program 22.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6416.8
Applied rewrites16.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6416.8
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6455.8
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6455.8
lift-/.f64N/A
inv-powN/A
lower-pow.f6455.8
Applied rewrites55.8%
Taylor expanded in y.re around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.6
Applied rewrites83.6%
if 6.4000000000000003e93 < y.re Initial program 47.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites73.9%
Final simplification82.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re)))
(t_1 (* (atan2 x.im x.re) y.re))
(t_2 (fma y.im t_0 t_1))
(t_3
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im))))
(t_4 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -2.1e-7)
(* t_3 (sin t_1))
(if (<= y.re 31000.0)
(* (/ t_4 (pow (exp y.im) (atan2 x.im x.re))) (sin t_2))
(if (<= y.re 6.4e+93)
(* t_4 (sin (pow (/ (pow y.im -1.0) t_0) -1.0)))
(* t_3 (sin (pow (pow t_2 -1.0) -1.0))))))))
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 = atan2(x_46_im, x_46_re) * y_46_re;
double t_2 = fma(y_46_im, t_0, t_1);
double t_3 = 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_4 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -2.1e-7) {
tmp = t_3 * sin(t_1);
} else if (y_46_re <= 31000.0) {
tmp = (t_4 / pow(exp(y_46_im), atan2(x_46_im, x_46_re))) * sin(t_2);
} else if (y_46_re <= 6.4e+93) {
tmp = t_4 * sin(pow((pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = t_3 * sin(pow(pow(t_2, -1.0), -1.0));
}
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 = Float64(atan(x_46_im, x_46_re) * y_46_re) t_2 = fma(y_46_im, t_0, t_1) t_3 = 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_4 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -2.1e-7) tmp = Float64(t_3 * sin(t_1)); elseif (y_46_re <= 31000.0) tmp = Float64(Float64(t_4 / (exp(y_46_im) ^ atan(x_46_im, x_46_re))) * sin(t_2)); elseif (y_46_re <= 6.4e+93) tmp = Float64(t_4 * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); else tmp = Float64(t_3 * sin(((t_2 ^ -1.0) ^ -1.0))); 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$im * t$95$0 + t$95$1), $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -2.1e-7], N[(t$95$3 * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 31000.0], N[(N[(t$95$4 / N[Power[N[Exp[y$46$im], $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.4e+93], N[(t$95$4 * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$3 * N[Sin[N[Power[N[Power[t$95$2, -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
t_2 := \mathsf{fma}\left(y.im, t\_0, t\_1\right)\\
t_3 := 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_4 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{-7}:\\
\;\;\;\;t\_3 \cdot \sin t\_1\\
\mathbf{elif}\;y.re \leq 31000:\\
\;\;\;\;\frac{t\_4}{{\left(e^{y.im}\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sin t\_2\\
\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{+93}:\\
\;\;\;\;t\_4 \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 \cdot \sin \left({\left({t\_2}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -2.1e-7Initial program 44.4%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6482.1
Applied rewrites82.1%
if -2.1e-7 < y.re < 31000Initial program 45.7%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.5%
Applied rewrites83.9%
if 31000 < y.re < 6.4000000000000003e93Initial program 22.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6416.8
Applied rewrites16.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6416.8
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6455.8
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6455.8
lift-/.f64N/A
inv-powN/A
lower-pow.f6455.8
Applied rewrites55.8%
Taylor expanded in y.re around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6483.6
Applied rewrites83.6%
if 6.4000000000000003e93 < y.re Initial program 47.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites73.9%
Final simplification81.9%
(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 (log (hypot x.im x.re)))
(t_2 (* (atan2 x.im x.re) y.re)))
(if (<= y.im -55.0)
(* t_0 (sin (pow (pow (fma y.im t_1 t_2) -1.0) -1.0)))
(if (<= y.im 9e-6)
(/
(sin (fma (log (hypot x.re x.im)) y.im t_2))
(/ (pow (+ 1.0 y.im) (atan2 x.im x.re)) (pow (hypot x.re x.im) y.re)))
(* t_0 (sin (* (fma (atan2 x.im x.re) (/ y.re y.im) t_1) y.im)))))))
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 = log(hypot(x_46_im, x_46_re));
double t_2 = atan2(x_46_im, x_46_re) * y_46_re;
double tmp;
if (y_46_im <= -55.0) {
tmp = t_0 * sin(pow(pow(fma(y_46_im, t_1, t_2), -1.0), -1.0));
} else if (y_46_im <= 9e-6) {
tmp = sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) / (pow((1.0 + y_46_im), atan2(x_46_im, x_46_re)) / pow(hypot(x_46_re, x_46_im), y_46_re));
} else {
tmp = t_0 * sin((fma(atan2(x_46_im, x_46_re), (y_46_re / y_46_im), t_1) * y_46_im));
}
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 = log(hypot(x_46_im, x_46_re)) t_2 = Float64(atan(x_46_im, x_46_re) * y_46_re) tmp = 0.0 if (y_46_im <= -55.0) tmp = Float64(t_0 * sin(((fma(y_46_im, t_1, t_2) ^ -1.0) ^ -1.0))); elseif (y_46_im <= 9e-6) tmp = Float64(sin(fma(log(hypot(x_46_re, x_46_im)), y_46_im, t_2)) / Float64((Float64(1.0 + y_46_im) ^ atan(x_46_im, x_46_re)) / (hypot(x_46_re, x_46_im) ^ y_46_re))); else tmp = Float64(t_0 * sin(Float64(fma(atan(x_46_im, x_46_re), Float64(y_46_re / y_46_im), t_1) * 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[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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -55.0], N[(t$95$0 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$1 + t$95$2), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9e-6], N[(N[Sin[N[(N[Log[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision]], $MachinePrecision] * y$46$im + t$95$2), $MachinePrecision]], $MachinePrecision] / N[(N[Power[N[(1.0 + y$46$im), $MachinePrecision], N[ArcTan[x$46$im / x$46$re], $MachinePrecision]], $MachinePrecision] / N[Power[N[Sqrt[x$46$re ^ 2 + x$46$im ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Sin[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -55:\\
\;\;\;\;t\_0 \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_1, t\_2\right)\right)}^{-1}\right)}^{-1}\right)\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sin \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, t\_2\right)\right)}{\frac{{\left(1 + y.im\right)}^{\tan^{-1}_* \frac{x.im}{x.re}}}{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, \frac{y.re}{y.im}, t\_1\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -55Initial program 50.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites68.4%
if -55 < y.im < 9.00000000000000023e-6Initial program 43.5%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites69.1%
Applied rewrites90.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites90.6%
Taylor expanded in y.im around 0
lower-+.f6490.6
Applied rewrites90.6%
if 9.00000000000000023e-6 < y.im Initial program 39.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* y.re (atan2 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 (log (hypot x.im x.re))))
(if (<= y.im -4.7e-8)
(*
t_1
(sin (pow (pow (fma y.im t_2 (* (atan2 x.im x.re) y.re)) -1.0) -1.0)))
(if (<= y.im 8.5e-7)
(* (pow (hypot x.im x.re) y.re) (fma y.im (* (cos t_0) t_2) (sin t_0)))
(* t_1 (sin (* (fma (atan2 x.im x.re) (/ y.re y.im) t_2) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re * atan2(x_46_im, x_46_re);
double t_1 = 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 = log(hypot(x_46_im, x_46_re));
double tmp;
if (y_46_im <= -4.7e-8) {
tmp = t_1 * sin(pow(pow(fma(y_46_im, t_2, (atan2(x_46_im, x_46_re) * y_46_re)), -1.0), -1.0));
} else if (y_46_im <= 8.5e-7) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * fma(y_46_im, (cos(t_0) * t_2), sin(t_0));
} else {
tmp = t_1 * sin((fma(atan2(x_46_im, x_46_re), (y_46_re / y_46_im), t_2) * y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re * atan(x_46_im, x_46_re)) t_1 = 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 = log(hypot(x_46_im, x_46_re)) tmp = 0.0 if (y_46_im <= -4.7e-8) tmp = Float64(t_1 * sin(((fma(y_46_im, t_2, Float64(atan(x_46_im, x_46_re) * y_46_re)) ^ -1.0) ^ -1.0))); elseif (y_46_im <= 8.5e-7) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * fma(y_46_im, Float64(cos(t_0) * t_2), sin(t_0))); else tmp = Float64(t_1 * sin(Float64(fma(atan(x_46_im, x_46_re), Float64(y_46_re / y_46_im), t_2) * y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -4.7e-8], N[(t$95$1 * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$2 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.5e-7], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[(y$46$im * N[(N[Cos[t$95$0], $MachinePrecision] * t$95$2), $MachinePrecision] + N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + t$95$2), $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}\\
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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -4.7 \cdot 10^{-8}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_2, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{-1}\right)}^{-1}\right)\\
\mathbf{elif}\;y.im \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \mathsf{fma}\left(y.im, \cos t\_0 \cdot t\_2, \sin t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, \frac{y.re}{y.im}, t\_2\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -4.6999999999999997e-8Initial program 50.4%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites68.5%
if -4.6999999999999997e-8 < y.im < 8.50000000000000014e-7Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.2
Applied rewrites43.2%
Taylor expanded in y.im around 0
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f6489.8
Applied rewrites89.8%
if 8.50000000000000014e-7 < y.im Initial program 39.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
Final simplification77.0%
(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 (log (hypot x.im x.re)))
(t_2
(sin
(pow (pow (fma y.im t_1 (* (atan2 x.im x.re) y.re)) -1.0) -1.0))))
(if (<= y.im -5.5e+16)
(* t_0 t_2)
(if (<= y.im 8.5e-7)
(* (pow (hypot x.im x.re) y.re) t_2)
(* t_0 (sin (* (fma (atan2 x.im x.re) (/ y.re y.im) t_1) y.im)))))))
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 = log(hypot(x_46_im, x_46_re));
double t_2 = sin(pow(pow(fma(y_46_im, t_1, (atan2(x_46_im, x_46_re) * y_46_re)), -1.0), -1.0));
double tmp;
if (y_46_im <= -5.5e+16) {
tmp = t_0 * t_2;
} else if (y_46_im <= 8.5e-7) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * t_2;
} else {
tmp = t_0 * sin((fma(atan2(x_46_im, x_46_re), (y_46_re / y_46_im), t_1) * y_46_im));
}
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 = log(hypot(x_46_im, x_46_re)) t_2 = sin(((fma(y_46_im, t_1, Float64(atan(x_46_im, x_46_re) * y_46_re)) ^ -1.0) ^ -1.0)) tmp = 0.0 if (y_46_im <= -5.5e+16) tmp = Float64(t_0 * t_2); elseif (y_46_im <= 8.5e-7) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * t_2); else tmp = Float64(t_0 * sin(Float64(fma(atan(x_46_im, x_46_re), Float64(y_46_re / y_46_im), t_1) * 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[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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[Power[N[Power[N[(y$46$im * t$95$1 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -5.5e+16], N[(t$95$0 * t$95$2), $MachinePrecision], If[LessEqual[y$46$im, 8.5e-7], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * t$95$2), $MachinePrecision], N[(t$95$0 * N[Sin[N[(N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + t$95$1), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $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 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_2 := \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_1, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{-1}\right)}^{-1}\right)\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+16}:\\
\;\;\;\;t\_0 \cdot t\_2\\
\mathbf{elif}\;y.im \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sin \left(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, \frac{y.re}{y.im}, t\_1\right) \cdot y.im\right)\\
\end{array}
\end{array}
if y.im < -5.5e16Initial program 50.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
lower-/.f64N/A
Applied rewrites69.4%
if -5.5e16 < y.im < 8.50000000000000014e-7Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.2
Applied rewrites43.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6443.2
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6489.3
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6488.4
lift-/.f64N/A
inv-powN/A
lower-pow.f6488.4
Applied rewrites88.4%
if 8.50000000000000014e-7 < y.im Initial program 39.4%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.4
Applied rewrites61.4%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))))
(if (or (<= y.im -5.5e+16) (not (<= y.im 8.5e-7)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin (* (fma (atan2 x.im x.re) (/ y.re y.im) t_0) y.im)))
(*
(pow (hypot x.im x.re) y.re)
(sin (pow (pow (fma y.im t_0 (* (atan2 x.im x.re) y.re)) -1.0) -1.0))))))
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 tmp;
if ((y_46_im <= -5.5e+16) || !(y_46_im <= 8.5e-7)) {
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((fma(atan2(x_46_im, x_46_re), (y_46_re / y_46_im), t_0) * y_46_im));
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(pow(pow(fma(y_46_im, t_0, (atan2(x_46_im, x_46_re) * y_46_re)), -1.0), -1.0));
}
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)) tmp = 0.0 if ((y_46_im <= -5.5e+16) || !(y_46_im <= 8.5e-7)) 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(fma(atan(x_46_im, x_46_re), Float64(y_46_re / y_46_im), t_0) * y_46_im))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(((fma(y_46_im, t_0, Float64(atan(x_46_im, x_46_re) * y_46_re)) ^ -1.0) ^ -1.0))); 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]}, If[Or[LessEqual[y$46$im, -5.5e+16], N[Not[LessEqual[y$46$im, 8.5e-7]], $MachinePrecision]], 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[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * t$95$0 + N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+16} \lor \neg \left(y.im \leq 8.5 \cdot 10^{-7}\right):\\
\;\;\;\;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(\mathsf{fma}\left(\tan^{-1}_* \frac{x.im}{x.re}, \frac{y.re}{y.im}, t\_0\right) \cdot y.im\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, t\_0, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.im < -5.5e16 or 8.50000000000000014e-7 < y.im Initial program 44.9%
Taylor expanded in y.im around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-atan2.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6464.5
Applied rewrites64.5%
if -5.5e16 < y.im < 8.50000000000000014e-7Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.2
Applied rewrites43.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6443.2
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6489.3
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6488.4
lift-/.f64N/A
inv-powN/A
lower-pow.f6488.4
Applied rewrites88.4%
Final simplification75.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (atan2 x.im x.re) y.re)))
(if (or (<= y.im -5.5e+16) (not (<= y.im 9e-6)))
(*
(exp
(-
(* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re)
(* (atan2 x.im x.re) y.im)))
(sin t_0))
(*
(pow (hypot x.im x.re) y.re)
(sin (pow (pow (fma y.im (log (hypot x.im x.re)) t_0) -1.0) -1.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_re;
double tmp;
if ((y_46_im <= -5.5e+16) || !(y_46_im <= 9e-6)) {
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(t_0);
} else {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(pow(pow(fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0), -1.0), -1.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_re) tmp = 0.0 if ((y_46_im <= -5.5e+16) || !(y_46_im <= 9e-6)) 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(t_0)); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(((fma(y_46_im, log(hypot(x_46_im, x_46_re)), t_0) ^ -1.0) ^ -1.0))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] * y$46$re), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -5.5e+16], N[Not[LessEqual[y$46$im, 9e-6]], $MachinePrecision]], 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[t$95$0], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[Power[N[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision], -1.0], $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+16} \lor \neg \left(y.im \leq 9 \cdot 10^{-6}\right):\\
\;\;\;\;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 t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left({\left({\left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right), t\_0\right)\right)}^{-1}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.im < -5.5e16 or 9.00000000000000023e-6 < y.im Initial program 44.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.4
Applied rewrites64.4%
if -5.5e16 < y.im < 9.00000000000000023e-6Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.2
Applied rewrites43.2%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6443.2
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6489.3
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6488.4
lift-/.f64N/A
inv-powN/A
lower-pow.f6488.4
Applied rewrites88.4%
Final simplification75.8%
(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)))
(sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -1.3e-73)
t_1
(if (<= y.re 1.2e-17)
(* (exp (* (- y.im) (atan2 x.im x.re))) (sin (* y.im t_0)))
(if (<= y.re 8.5e+95)
(*
(pow (hypot x.im x.re) y.re)
(sin (pow (/ (pow y.im -1.0) t_0) -1.0)))
t_1)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = log(hypot(x_46_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))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.3e-73) {
tmp = t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * t_0));
} else if (y_46_re <= 8.5e+95) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin(pow((pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.log(Math.hypot(x_46_im, x_46_re));
double t_1 = 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));
double tmp;
if (y_46_re <= -1.3e-73) {
tmp = t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * t_0));
} else if (y_46_re <= 8.5e+95) {
tmp = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re) * Math.sin(Math.pow((Math.pow(y_46_im, -1.0) / t_0), -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = 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)) tmp = 0 if y_46_re <= -1.3e-73: tmp = t_1 elif y_46_re <= 1.2e-17: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * t_0)) elif y_46_re <= 8.5e+95: tmp = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) * math.sin(math.pow((math.pow(y_46_im, -1.0) / t_0), -1.0)) else: tmp = t_1 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 = 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))) tmp = 0.0 if (y_46_re <= -1.3e-73) tmp = t_1; elseif (y_46_re <= 1.2e-17) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * t_0))); elseif (y_46_re <= 8.5e+95) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); 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 = log(hypot(x_46_im, x_46_re)); 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))) * sin((atan2(x_46_im, x_46_re) * y_46_re)); tmp = 0.0; if (y_46_re <= -1.3e-73) tmp = t_1; elseif (y_46_re <= 1.2e-17) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * t_0)); elseif (y_46_re <= 8.5e+95) tmp = (hypot(x_46_im, x_46_re) ^ y_46_re) * sin((((y_46_im ^ -1.0) / t_0) ^ -1.0)); 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[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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, -1.3e-73], t$95$1, If[LessEqual[y$46$re, 1.2e-17], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.5e+95], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{elif}\;y.re \leq 8.5 \cdot 10^{+95}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.3e-73 or 8.5000000000000002e95 < y.re Initial program 47.7%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.1
Applied rewrites78.1%
if -1.3e-73 < y.re < 1.19999999999999993e-17Initial program 44.3%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites54.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6473.0
Applied rewrites73.0%
if 1.19999999999999993e-17 < y.re < 8.5000000000000002e95Initial program 21.7%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6417.5
Applied rewrites17.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6417.5
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6459.1
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6459.1
lift-/.f64N/A
inv-powN/A
lower-pow.f6459.1
Applied rewrites59.1%
Taylor expanded in y.re around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6467.1
Applied rewrites67.1%
Final simplification75.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (log (hypot x.im x.re))) (t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.65e-8)
(* (sin (* y.re (atan2 x.im x.re))) t_1)
(if (<= y.re 1.2e-17)
(* (exp (* (- y.im) (atan2 x.im x.re))) (sin (* y.im t_0)))
(* t_1 (sin (pow (/ (pow y.im -1.0) t_0) -1.0)))))))
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 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.65e-8) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * t_0));
} else {
tmp = t_1 * sin(pow((pow(y_46_im, -1.0) / t_0), -1.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.log(Math.hypot(x_46_im, x_46_re));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.65e-8) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * Math.sin((y_46_im * t_0));
} else {
tmp = t_1 * Math.sin(Math.pow((Math.pow(y_46_im, -1.0) / t_0), -1.0));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.log(math.hypot(x_46_im, x_46_re)) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.65e-8: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * t_1 elif y_46_re <= 1.2e-17: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * math.sin((y_46_im * t_0)) else: tmp = t_1 * math.sin(math.pow((math.pow(y_46_im, -1.0) / t_0), -1.0)) 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 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.65e-8) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_1); elseif (y_46_re <= 1.2e-17) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * t_0))); else tmp = Float64(t_1 * sin((Float64((y_46_im ^ -1.0) / t_0) ^ -1.0))); end return tmp end
function tmp_2 = 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 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.65e-8) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_1; elseif (y_46_re <= 1.2e-17) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * t_0)); else tmp = t_1 * sin((((y_46_im ^ -1.0) / t_0) ^ -1.0)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.65e-8], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-17], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[Sin[N[Power[N[(N[Power[y$46$im, -1.0], $MachinePrecision] / t$95$0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{-8}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \sin \left({\left(\frac{{y.im}^{-1}}{t\_0}\right)}^{-1}\right)\\
\end{array}
\end{array}
if y.re < -1.64999999999999989e-8Initial program 44.4%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites83.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.0
Applied rewrites78.0%
if -1.64999999999999989e-8 < y.re < 1.19999999999999993e-17Initial program 46.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.1
Applied rewrites70.1%
if 1.19999999999999993e-17 < y.re Initial program 39.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.4
Applied rewrites33.4%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6433.4
lift-sqrt.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-hypot.f6463.3
/-rgt-identityN/A
clear-numN/A
lift-/.f64N/A
lower-/.f6464.7
lift-/.f64N/A
inv-powN/A
lower-pow.f6464.7
Applied rewrites64.7%
Taylor expanded in y.re around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.5
Applied rewrites61.5%
Final simplification70.4%
(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)))
(sin (* (atan2 x.im x.re) y.re)))))
(if (<= y.re -1.3e-73)
t_1
(if (<= y.re 7.2e-126)
(* (exp (* (- y.im) (atan2 x.im x.re))) (sin (* y.im t_0)))
(if (<= y.re 4.8e+95)
(*
(pow (hypot x.im x.re) y.re)
(sin (* y.im (fma y.re (/ (atan2 x.im x.re) y.im) 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 = 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))) * sin((atan2(x_46_im, x_46_re) * y_46_re));
double tmp;
if (y_46_re <= -1.3e-73) {
tmp = t_1;
} else if (y_46_re <= 7.2e-126) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * sin((y_46_im * t_0));
} else if (y_46_re <= 4.8e+95) {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_im * fma(y_46_re, (atan2(x_46_im, x_46_re) / y_46_im), t_0)));
} else {
tmp = t_1;
}
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 = 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))) tmp = 0.0 if (y_46_re <= -1.3e-73) tmp = t_1; elseif (y_46_re <= 7.2e-126) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * sin(Float64(y_46_im * t_0))); elseif (y_46_re <= 4.8e+95) tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_im * fma(y_46_re, Float64(atan(x_46_im, x_46_re) / y_46_im), t_0)))); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = 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, -1.3e-73], t$95$1, If[LessEqual[y$46$re, 7.2e-126], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y$46$im * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 4.8e+95], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$im * N[(y$46$re * N[(N[ArcTan[x$46$im / x$46$re], $MachinePrecision] / y$46$im), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{-126}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \sin \left(y.im \cdot t\_0\right)\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+95}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.im \cdot \mathsf{fma}\left(y.re, \frac{\tan^{-1}_* \frac{x.im}{x.re}}{y.im}, t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.3e-73 or 4.8000000000000001e95 < y.re Initial program 47.7%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6478.1
Applied rewrites78.1%
if -1.3e-73 < y.re < 7.1999999999999999e-126Initial program 47.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites60.9%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6482.7
Applied rewrites82.7%
if 7.1999999999999999e-126 < y.re < 4.8000000000000001e95Initial program 27.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6419.3
Applied rewrites19.3%
Taylor expanded in y.im around inf
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-atan2.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6456.8
Applied rewrites56.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -5.5e+16) (not (<= y.im 9e-6)))
(*
(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)))
(*
(pow (hypot x.im x.re) y.re)
(sin
(* y.re (fma y.im (/ (log (hypot x.im x.re)) y.re) (atan2 x.im x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.5e+16) || !(y_46_im <= 9e-6)) {
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 {
tmp = pow(hypot(x_46_im, x_46_re), y_46_re) * sin((y_46_re * fma(y_46_im, (log(hypot(x_46_im, x_46_re)) / y_46_re), atan2(x_46_im, x_46_re))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -5.5e+16) || !(y_46_im <= 9e-6)) 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))); else tmp = Float64((hypot(x_46_im, x_46_re) ^ y_46_re) * sin(Float64(y_46_re * fma(y_46_im, Float64(log(hypot(x_46_im, x_46_re)) / y_46_re), atan(x_46_im, x_46_re))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -5.5e+16], N[Not[LessEqual[y$46$im, 9e-6]], $MachinePrecision]], 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], N[(N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision] * N[Sin[N[(y$46$re * N[(y$46$im * N[(N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision] / y$46$re), $MachinePrecision] + N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+16} \lor \neg \left(y.im \leq 9 \cdot 10^{-6}\right):\\
\;\;\;\;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{else}:\\
\;\;\;\;{\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re} \cdot \sin \left(y.re \cdot \mathsf{fma}\left(y.im, \frac{\log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)}{y.re}, \tan^{-1}_* \frac{x.im}{x.re}\right)\right)\\
\end{array}
\end{array}
if y.im < -5.5e16 or 9.00000000000000023e-6 < y.im Initial program 44.9%
Taylor expanded in y.im around 0
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-atan2.f6464.4
Applied rewrites64.4%
if -5.5e16 < y.im < 9.00000000000000023e-6Initial program 43.2%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.2
Applied rewrites43.2%
Taylor expanded in y.re around inf
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f64N/A
lower-atan2.f6487.5
Applied rewrites87.5%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.im -1.7e+43)
(* t_0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(if (or (<= y.im -7.4e-165) (not (<= y.im 6e-247)))
(* t_1 (sin (* y.im (log (hypot 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_im <= -1.7e+43) {
tmp = t_0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else if ((y_46_im <= -7.4e-165) || !(y_46_im <= 6e-247)) {
tmp = t_1 * sin((y_46_im * log(hypot(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 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_im <= -1.7e+43) tmp = Float64(t_0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); elseif ((y_46_im <= -7.4e-165) || !(y_46_im <= 6e-247)) tmp = Float64(t_1 * sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re))))); else tmp = Float64(t_0 * t_1); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$im, -1.7e+43], N[(t$95$0 * 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]), $MachinePrecision], If[Or[LessEqual[y$46$im, -7.4e-165], N[Not[LessEqual[y$46$im, 6e-247]], $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], N[(t$95$0 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+43}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{elif}\;y.im \leq -7.4 \cdot 10^{-165} \lor \neg \left(y.im \leq 6 \cdot 10^{-247}\right):\\
\;\;\;\;t\_1 \cdot \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_1\\
\end{array}
\end{array}
if y.im < -1.70000000000000006e43Initial program 49.2%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6424.4
Applied rewrites24.4%
Taylor expanded in x.im around 0
Applied rewrites34.2%
if -1.70000000000000006e43 < y.im < -7.40000000000000003e-165 or 5.9999999999999995e-247 < y.im Initial program 40.6%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.8
Applied rewrites33.8%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6461.5
Applied rewrites61.5%
if -7.40000000000000003e-165 < y.im < 5.9999999999999995e-247Initial program 49.8%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites74.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6479.7
Applied rewrites79.7%
Final simplification57.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.im (log (hypot x.im x.re)))))
(t_1 (pow (hypot x.im x.re) y.re)))
(if (<= y.re -1.65e-8)
(* (sin (* y.re (atan2 x.im x.re))) t_1)
(if (<= y.re 1.2e-17)
(* (exp (* (- y.im) (atan2 x.im x.re))) t_0)
(* t_1 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_im * log(hypot(x_46_im, x_46_re))));
double t_1 = pow(hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.65e-8) {
tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1 * 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_im * Math.log(Math.hypot(x_46_im, x_46_re))));
double t_1 = Math.pow(Math.hypot(x_46_im, x_46_re), y_46_re);
double tmp;
if (y_46_re <= -1.65e-8) {
tmp = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * t_1;
} else if (y_46_re <= 1.2e-17) {
tmp = Math.exp((-y_46_im * Math.atan2(x_46_im, x_46_re))) * t_0;
} else {
tmp = t_1 * t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_im * math.log(math.hypot(x_46_im, x_46_re)))) t_1 = math.pow(math.hypot(x_46_im, x_46_re), y_46_re) tmp = 0 if y_46_re <= -1.65e-8: tmp = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * t_1 elif y_46_re <= 1.2e-17: tmp = math.exp((-y_46_im * math.atan2(x_46_im, x_46_re))) * t_0 else: tmp = t_1 * t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_im * log(hypot(x_46_im, x_46_re)))) t_1 = hypot(x_46_im, x_46_re) ^ y_46_re tmp = 0.0 if (y_46_re <= -1.65e-8) tmp = Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * t_1); elseif (y_46_re <= 1.2e-17) tmp = Float64(exp(Float64(Float64(-y_46_im) * atan(x_46_im, x_46_re))) * t_0); else tmp = Float64(t_1 * 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_im * log(hypot(x_46_im, x_46_re)))); t_1 = hypot(x_46_im, x_46_re) ^ y_46_re; tmp = 0.0; if (y_46_re <= -1.65e-8) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * t_1; elseif (y_46_re <= 1.2e-17) tmp = exp((-y_46_im * atan2(x_46_im, x_46_re))) * t_0; else tmp = t_1 * 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[(y$46$im * N[Log[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]}, If[LessEqual[y$46$re, -1.65e-8], N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-17], N[(N[Exp[N[((-y$46$im) * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)\\
t_1 := {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{-8}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot t\_1\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;e^{\left(-y.im\right) \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_0\\
\end{array}
\end{array}
if y.re < -1.64999999999999989e-8Initial program 44.4%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites83.4%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6478.0
Applied rewrites78.0%
if -1.64999999999999989e-8 < y.re < 1.19999999999999993e-17Initial program 46.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites59.0%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-exp.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-atan2.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6470.1
Applied rewrites70.1%
if 1.19999999999999993e-17 < y.re Initial program 39.1%
Taylor expanded in y.im around 0
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6433.4
Applied rewrites33.4%
Taylor expanded in y.re around 0
lower-*.f64N/A
lower-log.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6458.7
Applied rewrites58.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= y.im -1.1e+78)
(* t_0 (pow (fma 0.5 (/ (* x.im x.im) x.re) x.re) y.re))
(* t_0 (pow (hypot x.im x.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (y_46_im <= -1.1e+78) {
tmp = t_0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
} else {
tmp = t_0 * pow(hypot(x_46_im, x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (y_46_im <= -1.1e+78) tmp = Float64(t_0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (hypot(x_46_im, x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y$46$im, -1.1e+78], N[(t$95$0 * 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]), $MachinePrecision], N[(t$95$0 * N[Power[N[Sqrt[x$46$im ^ 2 + x$46$re ^ 2], $MachinePrecision], y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{+78}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{hypot}\left(x.im, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if y.im < -1.10000000000000007e78Initial program 51.8%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites75.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6423.7
Applied rewrites23.7%
Taylor expanded in x.im around 0
Applied rewrites34.8%
if -1.10000000000000007e78 < y.im Initial program 41.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites66.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6452.2
Applied rewrites52.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.re -0.009)
(* t_0 (pow (- x.re) y.re))
(* t_0 (pow (fma 0.5 (/ (* x.im x.im) x.re) 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= -0.009) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * pow(fma(0.5, ((x_46_im * x_46_im) / x_46_re), x_46_re), y_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= -0.009) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (fma(0.5, Float64(Float64(x_46_im * x_46_im) / x_46_re), x_46_re) ^ y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, -0.009], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 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]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq -0.009:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\left(\mathsf{fma}\left(0.5, \frac{x.im \cdot x.im}{x.re}, x.re\right)\right)}^{y.re}\\
\end{array}
\end{array}
if x.re < -0.00899999999999999932Initial program 25.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites52.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6443.1
Applied rewrites43.1%
Taylor expanded in x.re around -inf
Applied rewrites43.1%
if -0.00899999999999999932 < x.re Initial program 49.0%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites72.2%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.8
Applied rewrites46.8%
Taylor expanded in x.im around 0
Applied rewrites43.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -3.5e-7)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 25000000000000.0)
(* t_0 (pow (- x.re) y.re))
(* t_0 (pow x.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -3.5e-7) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 25000000000000.0) {
tmp = t_0 * pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-3.5d-7)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 25000000000000.0d0) then
tmp = t_0 * (-x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -3.5e-7) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 25000000000000.0) {
tmp = t_0 * Math.pow(-x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -3.5e-7: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 25000000000000.0: tmp = t_0 * math.pow(-x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -3.5e-7) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 25000000000000.0) tmp = Float64(t_0 * (Float64(-x_46_re) ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -3.5e-7) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 25000000000000.0) tmp = t_0 * (-x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -3.5e-7], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 25000000000000.0], N[(t$95$0 * N[Power[(-x$46$re), y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 25000000000000:\\
\;\;\;\;t\_0 \cdot {\left(-x.re\right)}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -3.49999999999999984e-7Initial program 40.8%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.8
Applied rewrites46.8%
Taylor expanded in x.im around -inf
Applied rewrites46.8%
if -3.49999999999999984e-7 < x.im < 2.5e13Initial program 51.1%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites72.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.5
Applied rewrites45.5%
Taylor expanded in x.re around -inf
Applied rewrites40.6%
if 2.5e13 < x.im Initial program 30.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites62.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.3
Applied rewrites46.3%
Taylor expanded in x.re around 0
Applied rewrites46.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (or (<= y.re -0.0007) (not (<= y.re 230000000.0)))
(* t_0 (pow x.im y.re))
(* t_0 1.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)));
double tmp;
if ((y_46_re <= -0.0007) || !(y_46_re <= 230000000.0)) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 1.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((y_46re * atan2(x_46im, x_46re)))
if ((y_46re <= (-0.0007d0)) .or. (.not. (y_46re <= 230000000.0d0))) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * 1.0d0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if ((y_46_re <= -0.0007) || !(y_46_re <= 230000000.0)) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * 1.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))) tmp = 0 if (y_46_re <= -0.0007) or not (y_46_re <= 230000000.0): tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * 1.0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if ((y_46_re <= -0.0007) || !(y_46_re <= 230000000.0)) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * 1.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))); tmp = 0.0; if ((y_46_re <= -0.0007) || ~((y_46_re <= 230000000.0))) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * 1.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[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[y$46$re, -0.0007], N[Not[LessEqual[y$46$re, 230000000.0]], $MachinePrecision]], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;y.re \leq -0.0007 \lor \neg \left(y.re \leq 230000000\right):\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot 1\\
\end{array}
\end{array}
if y.re < -6.99999999999999993e-4 or 2.3e8 < y.re Initial program 43.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites78.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6469.1
Applied rewrites69.1%
Taylor expanded in x.re around 0
Applied rewrites55.0%
if -6.99999999999999993e-4 < y.re < 2.3e8Initial program 44.3%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites57.3%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6421.4
Applied rewrites21.4%
Taylor expanded in y.re around 0
Applied rewrites18.2%
Final simplification37.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (sin (* y.re (atan2 x.im x.re)))))
(if (<= x.im -3.5e-7)
(* t_0 (pow (- x.im) y.re))
(if (<= x.im 4.4e-29) (* t_0 (pow x.re y.re)) (* t_0 (pow x.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -3.5e-7) {
tmp = t_0 * pow(-x_46_im, y_46_re);
} else if (x_46_im <= 4.4e-29) {
tmp = t_0 * pow(x_46_re, y_46_re);
} else {
tmp = t_0 * pow(x_46_im, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46im <= (-3.5d-7)) then
tmp = t_0 * (-x_46im ** y_46re)
else if (x_46im <= 4.4d-29) then
tmp = t_0 * (x_46re ** y_46re)
else
tmp = t_0 * (x_46im ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_im <= -3.5e-7) {
tmp = t_0 * Math.pow(-x_46_im, y_46_re);
} else if (x_46_im <= 4.4e-29) {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_im <= -3.5e-7: tmp = t_0 * math.pow(-x_46_im, y_46_re) elif x_46_im <= 4.4e-29: tmp = t_0 * math.pow(x_46_re, y_46_re) else: tmp = t_0 * math.pow(x_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_im <= -3.5e-7) tmp = Float64(t_0 * (Float64(-x_46_im) ^ y_46_re)); elseif (x_46_im <= 4.4e-29) tmp = Float64(t_0 * (x_46_re ^ y_46_re)); else tmp = Float64(t_0 * (x_46_im ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_im <= -3.5e-7) tmp = t_0 * (-x_46_im ^ y_46_re); elseif (x_46_im <= 4.4e-29) tmp = t_0 * (x_46_re ^ y_46_re); else tmp = t_0 * (x_46_im ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$im, -3.5e-7], N[(t$95$0 * N[Power[(-x$46$im), y$46$re], $MachinePrecision]), $MachinePrecision], If[LessEqual[x$46$im, 4.4e-29], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.im \leq -3.5 \cdot 10^{-7}:\\
\;\;\;\;t\_0 \cdot {\left(-x.im\right)}^{y.re}\\
\mathbf{elif}\;x.im \leq 4.4 \cdot 10^{-29}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\end{array}
\end{array}
if x.im < -3.49999999999999984e-7Initial program 40.8%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.8
Applied rewrites46.8%
Taylor expanded in x.im around -inf
Applied rewrites46.8%
if -3.49999999999999984e-7 < x.im < 4.39999999999999981e-29Initial program 50.0%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites71.9%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.5
Applied rewrites45.5%
Taylor expanded in x.im around 0
Applied rewrites39.1%
if 4.39999999999999981e-29 < x.im Initial program 35.9%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites64.5%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.2
Applied rewrites46.2%
Taylor expanded in x.re around 0
Applied rewrites44.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (sin (* y.re (atan2 x.im x.re))))) (if (<= x.re 1.55e-50) (* t_0 (pow x.im y.re)) (* t_0 (pow 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 = sin((y_46_re * atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 1.55e-50) {
tmp = t_0 * pow(x_46_im, y_46_re);
} else {
tmp = t_0 * pow(x_46_re, y_46_re);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = sin((y_46re * atan2(x_46im, x_46re)))
if (x_46re <= 1.55d-50) then
tmp = t_0 * (x_46im ** y_46re)
else
tmp = t_0 * (x_46re ** y_46re)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re)));
double tmp;
if (x_46_re <= 1.55e-50) {
tmp = t_0 * Math.pow(x_46_im, y_46_re);
} else {
tmp = t_0 * Math.pow(x_46_re, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) tmp = 0 if x_46_re <= 1.55e-50: tmp = t_0 * math.pow(x_46_im, y_46_re) else: tmp = t_0 * math.pow(x_46_re, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin(Float64(y_46_re * atan(x_46_im, x_46_re))) tmp = 0.0 if (x_46_re <= 1.55e-50) tmp = Float64(t_0 * (x_46_im ^ y_46_re)); else tmp = Float64(t_0 * (x_46_re ^ y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = sin((y_46_re * atan2(x_46_im, x_46_re))); tmp = 0.0; if (x_46_re <= 1.55e-50) tmp = t_0 * (x_46_im ^ y_46_re); else tmp = t_0 * (x_46_re ^ y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x$46$re, 1.55e-50], N[(t$95$0 * N[Power[x$46$im, y$46$re], $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[x$46$re, y$46$re], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{if}\;x.re \leq 1.55 \cdot 10^{-50}:\\
\;\;\;\;t\_0 \cdot {x.im}^{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {x.re}^{y.re}\\
\end{array}
\end{array}
if x.re < 1.5500000000000001e-50Initial program 46.6%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites68.1%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6445.8
Applied rewrites45.8%
Taylor expanded in x.re around 0
Applied rewrites36.2%
if 1.5500000000000001e-50 < x.re Initial program 38.1%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites67.7%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.4
Applied rewrites46.4%
Taylor expanded in x.im around 0
Applied rewrites46.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (* (sin (* y.re (atan2 x.im x.re))) 1.0))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return sin((y_46_re * atan2(x_46_im, x_46_re))) * 1.0;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = sin((y_46re * atan2(x_46im, x_46re))) * 1.0d0
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return Math.sin((y_46_re * Math.atan2(x_46_im, x_46_re))) * 1.0;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return math.sin((y_46_re * math.atan2(x_46_im, x_46_re))) * 1.0
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(sin(Float64(y_46_re * atan(x_46_im, x_46_re))) * 1.0) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = sin((y_46_re * atan2(x_46_im, x_46_re))) * 1.0; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Sin[N[(y$46$re * N[ArcTan[x$46$im / x$46$re], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]
\begin{array}{l}
\\
\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 1
\end{array}
Initial program 44.1%
lift-sin.f64N/A
lift-+.f64N/A
+-commutativeN/A
sin-sumN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites68.0%
Taylor expanded in y.im around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-atan2.f64N/A
lower-pow.f64N/A
unpow2N/A
unpow2N/A
lower-hypot.f6446.0
Applied rewrites46.0%
Taylor expanded in y.re around 0
Applied rewrites11.8%
herbie shell --seed 2024326
(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)))))