-/* expm1l.c
+/* expm1q.c
*
* Exponential function, minus 1
- * 128-bit __float128 precision
+ * 128-bit long double precision
*
*
*
* SYNOPSIS:
*
- * __float128 x, y, expm1l();
+ * long double x, y, expm1q();
*
- * y = expm1l( x );
+ * y = expm1q( x );
*
*
*
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ License along with this library; if not, see
+ <http://www.gnu.org/licenses/>. */
-
-
-#include <errno.h>
#include "quadmath-imp.h"
/* exp(x) - 1 = x + 0.5 x^2 + x^3 P(x)/Q(x)
C1 = 6.93145751953125E-1Q,
C2 = 1.428606820309417232121458176568075500134E-6Q,
/* ln 2^-114 */
- minarg = -7.9018778583833765273564461846232128760607E1Q;
+ minarg = -7.9018778583833765273564461846232128760607E1Q, big = 1e4932Q;
__float128
{
/* Infinity (which must be negative infinity). */
if (((ix & 0xffff) | u.words32.w1 | u.words32.w2 | u.words32.w3) == 0)
- return -1.0Q;
+ return -1;
/* NaN. Invalid exception if signaling. */
return x + x;
}
/* Minimum value. */
if (x < minarg)
- return (4.0/HUGE_VALQ - 1.0Q);
+ return (4.0/big - 1);
/* Avoid internal underflow when result does not underflow, while
ensuring underflow (without returning a zero of the wrong sign)
exp(x) - 1 = 2^k (qx + 1) - 1
= 2^k qx + 2^k - 1. */
- px = ldexpq (1.0Q, k);
+ px = ldexpq (1, k);
x = px * qx + (px - 1.0);
return x;
}