gcc/libstdc++-v3/libmath/csinhf.c
Benjamin Kosnik 5ce249543c Makefile.am: Remove OPTIMIZE_CXXFLAGS, WARN_CXXFLAGS, CONFIG_CXXFLAGS from here, and move to...
2000-10-06  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	* src/Makefile.am: Remove OPTIMIZE_CXXFLAGS, WARN_CXXFLAGS,
	CONFIG_CXXFLAGS from here, and move to...
	* src/Makefile.in: Regenerate.
	* Makefile.am: ... here. Clean.
	(OPTIMIZE_CXXFLAGS): Move up Makefile hierarchy to here.
	(WARN_CXXFLAGS): Same.
	(CONFIG_CXXFLAGS): Same.
	* Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Use top-level OPTIMIZE_CXXFLAGS,
	WARN_CXXFLAGS, CONFIG_CXXFLAGS as part of local AM_CXXFLAGS.
	* libsupc++/Makefile.in: Regenerate.

	Change math to libmath.
	* math: Move to libmath, delete.
	* libmath: New directory.
	* libmath/*: Populate.
	* src/Makefile.am (LIBMATH_INCLUDES): Change to libmath.
	(libstdc___la_LIBADD): Same.
	* src/Makefile.in: Regenerate.
	* configure.in: Add AC_OUTPUT for libmath/Makefile.
	* configure: Regenerate.
	* Makefile.am (SUBDIRS): Add libmath.
	* Makefile.in: Regenerate.
	* README (file): Change name.

From-SVN: r36766
2000-10-07 01:01:45 +00:00

90 lines
2.0 KiB
C

/* Complex sine hyperbole function for float.
Copyright (C) 1997,1998 Free Software Foundation, Inc.
This file is part of the libstdc++ version 3 distribution.
This software is a copyrighted work licensed under the terms of the
Cygnus libstdc++ license. Please consult the file LICENSE.STD for
details. */
#include <math.h>
#include "mathconf.h"
__complex__ float
csinhf (__complex__ float x)
{
__complex__ float retval;
int negate = signbit (__real__ x);
__real__ x = fabsf (__real__ x);
if (FINITEF_P (__real__ x))
{
/* Real part is finite. */
if (FINITEF_P (__imag__ x))
{
/* Imaginary part is finite. */
float sinh_val = sinhf (__real__ x);
float cosh_val = coshf (__real__ x);
float sinix = sin (__imag__ x);
float cosix = cos (__imag__ x);
__real__ retval = sinh_val * cosix;
__imag__ retval = cosh_val * sinix;
if (negate)
__real__ retval = -__real__ retval;
}
else
{
if (__real__ x == 0.0)
{
/* Real part is 0.0. */
__real__ retval = copysignf (0.0, negate ? -1.0 : 1.0);
__imag__ retval = NAN + NAN;
}
else
{
__real__ retval = NAN;
__imag__ retval = NAN;
}
}
}
else if (INFINITEF_P (__real__ x))
{
/* Real part is infinite. */
if (__imag__ x == 0.0)
{
/* Imaginary part is 0.0. */
__real__ retval = negate ? -HUGE_VALF : HUGE_VALF;
__imag__ retval = __imag__ x;
}
else if (FINITEF_P (__imag__ x))
{
/* Imaginary part is finite. */
float sinix = sinf (__imag__ x);
float cosix = cosf (__imag__ x);
__real__ retval = copysignf (HUGE_VALF, cosix);
__imag__ retval = copysignf (HUGE_VALF, sinix);
if (negate)
__real__ retval = -__real__ retval;
}
else
{
/* The addition raises the invalid exception. */
__real__ retval = HUGE_VALF;
__imag__ retval = NAN + NAN;
}
}
else
{
__real__ retval = NAN;
__imag__ retval = __imag__ x == 0.0 ? __imag__ x : NAN;
}
return retval;
}