- mpc_sin_cos (x, y, op, MPC_RNDZZ, MPC_RNDZZ);
- MPFR_ADD_ONE_ULP (mpc_realref (x));
- MPFR_ADD_ONE_ULP (mpc_imagref (x));
- MPFR_ADD_ONE_ULP (mpc_realref (y));
- MPFR_ADD_ONE_ULP (mpc_imagref (y));
- MPC_ASSERT (mpfr_zero_p (mpc_realref (x)) == 0);
-
- if ( mpfr_inf_p (mpc_realref (x)) || mpfr_inf_p (mpc_imagref (x))
- || mpfr_inf_p (mpc_realref (y)) || mpfr_inf_p (mpc_imagref (y))) {
- /* If the real or imaginary part of x is infinite, it means that
- Im(op) was large, in which case the result is
- sign(tan(Re(op)))*0 + sign(Im(op))*I,
- where sign(tan(Re(op))) = sign(Re(x))*sign(Re(y)). */
- int inex_re, inex_im;
- mpfr_set_ui (mpc_realref (rop), 0, GMP_RNDN);
- if (mpfr_sgn (mpc_realref (x)) * mpfr_sgn (mpc_realref (y)) < 0)
- {
- mpfr_neg (mpc_realref (rop), mpc_realref (rop), GMP_RNDN);
- inex_re = 1;
- }
- else
- inex_re = -1; /* +0 is rounded down */
- if (mpfr_sgn (mpc_imagref (op)) > 0)
- {
- mpfr_set_ui (mpc_imagref (rop), 1, GMP_RNDN);
- inex_im = 1;
- }
- else
- {
- mpfr_set_si (mpc_imagref (rop), -1, GMP_RNDN);
- inex_im = -1;
- }
- inex = MPC_INEX(inex_re, inex_im);
- goto end;
- }
-
- exr = mpfr_get_exp (mpc_realref (x));
- eyr = mpfr_get_exp (mpc_realref (y));
- eyi = mpfr_get_exp (mpc_imagref (y));
+ mpc_sin (x, op, MPC_RNDZZ);
+ mpfr_signbit (MPC_RE (x)) ?
+ mpfr_nextbelow (MPC_RE (x)) : mpfr_nextabove (MPC_RE (x));
+ mpfr_signbit (MPC_IM (x)) ?
+ mpfr_nextbelow (MPC_IM (x)) : mpfr_nextabove (MPC_IM (x));
+ exr = mpfr_get_exp (MPC_RE (x));
+ mpc_cos (y, op, MPC_RNDZZ);
+ mpfr_signbit (MPC_RE (y)) ?
+ mpfr_nextbelow (MPC_RE (y)) : mpfr_nextabove (MPC_RE (y));
+ mpfr_signbit (MPC_IM (y)) ?
+ mpfr_nextbelow (MPC_IM (y)) : mpfr_nextabove (MPC_IM (y));
+ eyr = mpfr_get_exp (MPC_RE (y));
+ eyi = mpfr_get_exp (MPC_IM (y));