[PATCH] Minor cleanups in s_sin.c

Ondřej Bílka neleai@seznam.cz
Mon Dec 16 11:33:00 GMT 2013


On Mon, Dec 16, 2013 at 03:21:34PM +0530, Siddhesh Poyarekar wrote:
> Hi,
> 
> I've done some minor code cleanups (and some refactoring, which I'll
> post soon) in s_sin.c.
> 
>      - Remove redundant mynumber union definitions
>      - Clean up a clumsy ternary operator
>      - Rename TAYLOR_SINCOS to TAYLOR_SIN since we're only expanding the
>        sin Taylor series in it.
> 
> Tested on x86_64 to verify that there are no regressions.  OK to
> commit?
>
looks ok,

> -  cor =
> -    (cor >
> -     0) ? 1.0005 * cor + ABS (orig) * 3.1e-30 : 1.0005 * cor -
> -    ABS (orig) * 3.1e-30;
> +  if (cor > 0)
> +    cor = 1.0005 * cor + ABS (orig) * 3.1e-30;
> +  else
> +    cor = 1.0005 * cor - ABS (orig) * 3.1e-30;
> +
If sgn function is present you could simplify this to

cor =  1.0005 * cor + SGN (cor) * ABS (orig) * 3.1e-30;



More information about the Libc-alpha mailing list