newlib-cygwin/newlib/libm/machine/spu/headers/tgammad2.h

302 lines
12 KiB
C
Raw Normal View History

2007-09-28 Patrick Mansfield <patmans@us.ibm.com> * libm/machine/spu/Makefile.am: Add new C files. * libm/machine/spu/Makefile.in: Regenerate. * libm/machine/spu/headers/acos.h: New file. * libm/machine/spu/headers/acosd2.h: Ditto. * libm/machine/spu/headers/acosf.h: Ditto. * libm/machine/spu/headers/acosf4.h: Ditto. * libm/machine/spu/headers/acosh.h: Ditto. * libm/machine/spu/headers/acoshd2.h: Ditto. * libm/machine/spu/headers/acoshf.h: Ditto. * libm/machine/spu/headers/acoshf4.h: Ditto. * libm/machine/spu/headers/asin.h: Ditto. * libm/machine/spu/headers/asind2.h: Ditto. * libm/machine/spu/headers/asinf.h: Ditto. * libm/machine/spu/headers/asinf4.h: Ditto. * libm/machine/spu/headers/asinh.h: Ditto. * libm/machine/spu/headers/asinhd2.h: Ditto. * libm/machine/spu/headers/asinhf.h: Ditto. * libm/machine/spu/headers/asinhf4.h: Ditto. * libm/machine/spu/headers/atan.h: Ditto. * libm/machine/spu/headers/atan2.h: Ditto. * libm/machine/spu/headers/atan2d2.h: Ditto. * libm/machine/spu/headers/atan2f.h: Ditto. * libm/machine/spu/headers/atan2f4.h: Ditto. * libm/machine/spu/headers/atand2.h: Ditto. * libm/machine/spu/headers/atanf4.h: Ditto. * libm/machine/spu/headers/atanh.h: Ditto. * libm/machine/spu/headers/atanhd2.h: Ditto. * libm/machine/spu/headers/atanhf.h: Ditto. * libm/machine/spu/headers/atanhf4.h: Ditto. * libm/machine/spu/headers/cos.h: Ditto. * libm/machine/spu/headers/cos_sin.h: Ditto. * libm/machine/spu/headers/cosd2.h: Ditto. * libm/machine/spu/headers/cosf.h: Ditto. * libm/machine/spu/headers/cosf4.h: Ditto. * libm/machine/spu/headers/cosh.h: Ditto. * libm/machine/spu/headers/coshd2.h: Ditto. * libm/machine/spu/headers/coshf.h: Ditto. * libm/machine/spu/headers/coshf4.h: Ditto. * libm/machine/spu/headers/divd2.h: Ditto. * libm/machine/spu/headers/divf4.h: Ditto. * libm/machine/spu/headers/erf.h: Ditto. * libm/machine/spu/headers/erf_utils.h: Ditto. * libm/machine/spu/headers/erfc.h: Ditto. * libm/machine/spu/headers/erfcd2.h: Ditto. * libm/machine/spu/headers/erfcf.h: Ditto. * libm/machine/spu/headers/erfcf4.h: Ditto. * libm/machine/spu/headers/erfd2.h: Ditto. * libm/machine/spu/headers/erff.h: Ditto. * libm/machine/spu/headers/erff4.h: Ditto. * libm/machine/spu/headers/exp.h: Ditto. * libm/machine/spu/headers/exp2.h: Ditto. * libm/machine/spu/headers/exp2d2.h: Ditto. * libm/machine/spu/headers/exp2f4.h: Ditto. * libm/machine/spu/headers/expd2.h: Ditto. * libm/machine/spu/headers/expf4.h: Ditto. * libm/machine/spu/headers/expm1.h: Ditto. * libm/machine/spu/headers/expm1d2.h: Ditto. * libm/machine/spu/headers/expm1f.h: Ditto. * libm/machine/spu/headers/expm1f4.h: Ditto. * libm/machine/spu/headers/floord2.h: Ditto. * libm/machine/spu/headers/floorf4.h: Ditto. * libm/machine/spu/headers/hypot.h: Ditto. * libm/machine/spu/headers/hypotd2.h: Ditto. * libm/machine/spu/headers/hypotf.h: Ditto. * libm/machine/spu/headers/hypotf4.h: Ditto. * libm/machine/spu/headers/isnan.h: Ditto. * libm/machine/spu/headers/isnand2.h: Ditto. * libm/machine/spu/headers/isnanf.h: Ditto. * libm/machine/spu/headers/isnanf4.h: Ditto. * libm/machine/spu/headers/ldexpd2.h: Ditto. * libm/machine/spu/headers/ldexpf4.h: Ditto. * libm/machine/spu/headers/lgamma.h: Ditto. * libm/machine/spu/headers/lgammad2.h: Ditto. * libm/machine/spu/headers/lgammaf.h: Ditto. * libm/machine/spu/headers/lgammaf4.h: Ditto. * libm/machine/spu/headers/log.h: Ditto. * libm/machine/spu/headers/log10.h: Ditto. * libm/machine/spu/headers/log10d2.h: Ditto. * libm/machine/spu/headers/log1p.h: Ditto. * libm/machine/spu/headers/log1pd2.h: Ditto. * libm/machine/spu/headers/log1pf.h: Ditto. * libm/machine/spu/headers/log1pf4.h: Ditto. * libm/machine/spu/headers/log2.h: Ditto. * libm/machine/spu/headers/log2d2.h: Ditto. * libm/machine/spu/headers/log2f4.h: Ditto. * libm/machine/spu/headers/logbf.h: Ditto. * libm/machine/spu/headers/logbf4.h: Ditto. * libm/machine/spu/headers/logd2.h: Ditto. * libm/machine/spu/headers/logf4.h: Ditto. * libm/machine/spu/headers/nearbyintf.h: Ditto. * libm/machine/spu/headers/nearbyintf4.h: Ditto. * libm/machine/spu/headers/nextafter.h: Ditto. * libm/machine/spu/headers/nextafterd2.h: Ditto. * libm/machine/spu/headers/nextafterf.h: Ditto. * libm/machine/spu/headers/nextafterf4.h: Ditto. * libm/machine/spu/headers/pow.h: Ditto. * libm/machine/spu/headers/powd2.h: Ditto. * libm/machine/spu/headers/powf.h: Ditto. * libm/machine/spu/headers/powf4.h: Ditto. * libm/machine/spu/headers/recipd2.h: Ditto. * libm/machine/spu/headers/recipf4.h: Ditto. * libm/machine/spu/headers/rintf.h: Ditto. * libm/machine/spu/headers/rintf4.h: Ditto. * libm/machine/spu/headers/scalbnf4.h: Ditto. * libm/machine/spu/headers/signbit.h: Ditto. * libm/machine/spu/headers/signbitd2.h: Ditto. * libm/machine/spu/headers/simdmath.h: Ditto. * libm/machine/spu/headers/sin.h: Ditto. * libm/machine/spu/headers/sincos.h: Ditto. * libm/machine/spu/headers/sincosd2.h: Ditto. * libm/machine/spu/headers/sincosf.h: Ditto. * libm/machine/spu/headers/sincosf4.h: Ditto. * libm/machine/spu/headers/sind2.h: Ditto. * libm/machine/spu/headers/sinf.h: Ditto. * libm/machine/spu/headers/sinf4.h: Ditto. * libm/machine/spu/headers/sinh.h: Ditto. * libm/machine/spu/headers/sinhd2.h: Ditto. * libm/machine/spu/headers/sinhf.h: Ditto. * libm/machine/spu/headers/sinhf4.h: Ditto. * libm/machine/spu/headers/sqrtd2.h: Ditto. * libm/machine/spu/headers/sqrtf.h: Ditto. * libm/machine/spu/headers/sqrtf4.h: Ditto. * libm/machine/spu/headers/tan.h: Ditto. * libm/machine/spu/headers/tand2.h: Ditto. * libm/machine/spu/headers/tanf.h: Ditto. * libm/machine/spu/headers/tanf4.h: Ditto. * libm/machine/spu/headers/tanh.h: Ditto. * libm/machine/spu/headers/tanhd2.h: Ditto. * libm/machine/spu/headers/tanhf.h: Ditto. * libm/machine/spu/headers/tanhf4.h: Ditto. * libm/machine/spu/headers/tgamma.h: Ditto. * libm/machine/spu/headers/tgammad2.h: Ditto. * libm/machine/spu/headers/tgammaf.h: Ditto. * libm/machine/spu/headers/tgammaf4.h: Ditto. * libm/machine/spu/headers/truncd2.h: Ditto. * libm/machine/spu/headers/truncf4.h: Ditto. * libm/machine/spu/log2.c: Ditto. * libm/machine/spu/s_asinh.c: Ditto. * libm/machine/spu/s_atan.c: Ditto. * libm/machine/spu/s_cos.c: Ditto. * libm/machine/spu/s_erf.c: Ditto. * libm/machine/spu/s_expm1.c: Ditto. * libm/machine/spu/s_isnan.c: Ditto. * libm/machine/spu/s_log1p.c: Ditto. * libm/machine/spu/s_nextafter.c: Ditto. * libm/machine/spu/s_sin.c: Ditto. * libm/machine/spu/s_tan.c: Ditto. * libm/machine/spu/s_tanh.c: Ditto. * libm/machine/spu/sf_asinh.c: Ditto. * libm/machine/spu/sf_cos.c: Ditto. * libm/machine/spu/sf_erf.c: Ditto. * libm/machine/spu/sf_expm1.c: Ditto. * libm/machine/spu/sf_log1p.c: Ditto. * libm/machine/spu/sf_logb.c: Ditto. * libm/machine/spu/sf_nearbyint.c: Ditto. * libm/machine/spu/sf_nextafter.c: Ditto. * libm/machine/spu/sf_rint.c: Ditto. * libm/machine/spu/sf_sin.c: Ditto. * libm/machine/spu/sf_tan.c: Ditto. * libm/machine/spu/sf_tanh.c: Ditto. * libm/machine/spu/w_acos.c: Ditto. * libm/machine/spu/w_acosh.c: Ditto. * libm/machine/spu/w_asin.c: Ditto. * libm/machine/spu/w_atan2.c: Ditto. * libm/machine/spu/w_atanh.c: Ditto. * libm/machine/spu/w_cosh.c: Ditto. * libm/machine/spu/w_exp.c: Ditto. * libm/machine/spu/w_exp2.c: Ditto. * libm/machine/spu/w_hypot.c: Ditto. * libm/machine/spu/w_lgamma.c: Ditto. * libm/machine/spu/w_log.c: Ditto. * libm/machine/spu/w_log10.c: Ditto. * libm/machine/spu/w_pow.c: Ditto. * libm/machine/spu/w_sincos.c: Ditto. * libm/machine/spu/w_sinh.c: Ditto. * libm/machine/spu/w_tgamma.c: Ditto. * libm/machine/spu/wf_acos.c: Ditto. * libm/machine/spu/wf_acosh.c: Ditto. * libm/machine/spu/wf_asin.c: Ditto. * libm/machine/spu/wf_atan2.c: Ditto. * libm/machine/spu/wf_atanh.c: Ditto. * libm/machine/spu/wf_cosh.c: Ditto. * libm/machine/spu/wf_hypot.c: Ditto. * libm/machine/spu/wf_lgamma.c: Ditto. * libm/machine/spu/wf_pow.c: Ditto. * libm/machine/spu/wf_sincos.c: Ditto. * libm/machine/spu/wf_sinh.c: Ditto. * libm/machine/spu/wf_sqrt.c: Ditto. * libm/machine/spu/wf_tgamma.c: Ditto.
2007-09-29 02:44:24 +08:00
/* -------------------------------------------------------------- */
/* (C)Copyright 2006,2007, */
/* International Business Machines Corporation */
/* All Rights Reserved. */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the */
/* following conditions are met: */
/* */
/* - Redistributions of source code must retain the above copyright*/
/* notice, this list of conditions and the following disclaimer. */
/* */
/* - Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* - Neither the name of IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* */
/* Redistributions in binary form must reproduce the above */
/* copyright notice, this list of conditions and the following */
/* disclaimer in the documentation and/or other materials */
/* provided with the distribution. */
/* */
/* Neither the name of IBM Corporation nor the names of its */
/* contributors may be used to endorse or promote products */
/* derived from this software without specific prior written */
/* permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* -------------------------------------------------------------- */
/* PROLOG END TAG zYx */
#ifdef __SPU__
#ifndef _TGAMMAD2_H_
#define _TGAMMAD2_H_ 1
#include <spu_intrinsics.h>
#include "simdmath.h"
#include "recipd2.h"
#include "truncd2.h"
#include "expd2.h"
#include "logd2.h"
#include "divd2.h"
#include "sind2.h"
#include "powd2.h"
/*
* FUNCTION
* vector double _tgammad2(vector double x)
*
* DESCRIPTION
* _tgammad2
*
* This is an interesting function to approximate fast
* and accurately. We take a fairly standard approach - break
* the domain into 5 separate regions:
*
* 1. [-infinity, 0) - use
* 2. [0, 1) - push x into [1,2), then adjust the
* result.
* 3. [1, 2) - use a rational approximation.
* 4. [2, 10) - pull back into [1, 2), then adjust
* the result.
* 5. [10, +infinity] - use Stirling's Approximation.
*
*
* Special Cases:
* - tgamma(+/- 0) returns +/- infinity
* - tgamma(negative integer) returns NaN
* - tgamma(-infinity) returns NaN
* - tgamma(infinity) returns infinity
*
*/
/*
* Coefficients for Stirling's Series for Gamma()
*/
/* 1/ 1 */
#define STIRLING_00 1.000000000000000000000000000000000000E0
/* 1/ 12 */
#define STIRLING_01 8.333333333333333333333333333333333333E-2
/* 1/ 288 */
#define STIRLING_02 3.472222222222222222222222222222222222E-3
/* -139/ 51840 */
#define STIRLING_03 -2.681327160493827160493827160493827160E-3
/* -571/ 2488320 */
#define STIRLING_04 -2.294720936213991769547325102880658436E-4
/* 163879/ 209018880 */
#define STIRLING_05 7.840392217200666274740348814422888497E-4
/* 5246819/ 75246796800 */
#define STIRLING_06 6.972813758365857774293988285757833083E-5
/* -534703531/ 902961561600 */
#define STIRLING_07 -5.921664373536938828648362256044011874E-4
/* -4483131259/ 86684309913600 */
#define STIRLING_08 -5.171790908260592193370578430020588228E-5
/* 432261921612371/ 514904800886784000 */
#define STIRLING_09 8.394987206720872799933575167649834452E-4
/* 6232523202521089/ 86504006548979712000 */
#define STIRLING_10 7.204895416020010559085719302250150521E-5
/* -25834629665134204969/ 13494625021640835072000 */
#define STIRLING_11 -1.914438498565477526500898858328522545E-3
/* -1579029138854919086429/ 9716130015581401251840000 */
#define STIRLING_12 -1.625162627839158168986351239802709981E-4
/* 746590869962651602203151/ 116593560186976815022080000 */
#define STIRLING_13 6.403362833808069794823638090265795830E-3
/* 1511513601028097903631961/ 2798245444487443560529920000 */
#define STIRLING_14 5.401647678926045151804675085702417355E-4
/* -8849272268392873147705987190261/ 299692087104605205332754432000000 */
#define STIRLING_15 -2.952788094569912050544065105469382445E-2
/* -142801712490607530608130701097701/ 57540880724084199423888850944000000 */
#define STIRLING_16 -2.481743600264997730915658368743464324E-3
/*
* Rational Approximation Coefficients for the
* domain [1, 2).
*/
#define TGD2_P00 -1.8211798563156931777484715e+05
#define TGD2_P01 -8.7136501560410004458390176e+04
#define TGD2_P02 -3.9304030489789496641606092e+04
#define TGD2_P03 -1.2078833505605729442322627e+04
#define TGD2_P04 -2.2149136023607729839568492e+03
#define TGD2_P05 -7.2672456596961114883015398e+02
#define TGD2_P06 -2.2126466212611862971471055e+01
#define TGD2_P07 -2.0162424149396112937893122e+01
#define TGD2_Q00 1.0000000000000000000000000
#define TGD2_Q01 -1.8212849094205905566923320e+05
#define TGD2_Q02 -1.9220660507239613798446953e+05
#define TGD2_Q03 2.9692670736656051303725690e+04
#define TGD2_Q04 3.0352658363629092491464689e+04
#define TGD2_Q05 -1.0555895821041505769244395e+04
#define TGD2_Q06 1.2786642579487202056043316e+03
#define TGD2_Q07 -5.5279768804094054246434098e+01
static __inline vector double _tgammad2(vector double x)
{
vector double signbit = spu_splats(-0.0);
vector double zerod = spu_splats(0.0);
vector double halfd = spu_splats(0.5);
vector double oned = spu_splats(1.0);
vector double ninep9d = (vec_double2)spu_splats(0x4023FFFFFFFFFFFFull);
vector double twohd = spu_splats(200.0);
vector double pi = spu_splats(SM_PI);
vector double sqrt2pi = spu_splats(2.50662827463100050241576528481);
vector double inf = (vector double)spu_splats(0x7FF0000000000000ull);
vector double nan = (vector double)spu_splats(0x7FF8000000000000ull);
vector double xabs;
vector double xscaled;
vector double xtrunc;
vector double xinv;
vector double nresult;
vector double rresult; /* Rational Approx result */
vector double sresult; /* Stirling's result */
vector double result;
vector double pr,qr;
vector unsigned long long gt0 = spu_cmpgt(x, zerod);
vector unsigned long long gt1 = spu_cmpgt(x, oned);
vector unsigned long long gt9p9 = spu_cmpgt(x, ninep9d);
vector unsigned long long gt200 = spu_cmpgt(x, twohd);
xabs = spu_andc(x, signbit);
/*
* For x in [0, 1], add 1 to x, use rational
* approximation, then use:
*
* gamma(x) = gamma(x+1)/x
*
*/
xabs = spu_sel(spu_add(xabs, oned), xabs, gt1);
xtrunc = _truncd2(xabs);
/*
* For x in [2, 10):
*/
xscaled = spu_add(oned, spu_sub(xabs, xtrunc));
/*
* For x in [1,2), use a rational approximation.
*/
pr = spu_madd(xscaled, spu_splats(TGD2_P07), spu_splats(TGD2_P06));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P05));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P04));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P03));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P02));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P01));
pr = spu_madd(pr, xscaled, spu_splats(TGD2_P00));
qr = spu_madd(xscaled, spu_splats(TGD2_Q07), spu_splats(TGD2_Q06));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q05));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q04));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q03));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q02));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q01));
qr = spu_madd(qr, xscaled, spu_splats(TGD2_Q00));
rresult = _divd2(pr, qr);
rresult = spu_sel(_divd2(rresult, x), rresult, gt1);
/*
* If x was in [2,10) and we pulled it into [1,2), we need to push
* it back out again.
*/
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [2,3) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [3,4) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [4,5) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [5,6) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [6,7) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [7,8) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [8,9) */
xscaled = spu_add(xscaled, oned);
rresult = spu_sel(rresult, spu_mul(rresult, xscaled), spu_cmpgt(x, xscaled)); /* [9,10) */
/*
* For x >= 10, we use Stirling's Approximation
*/
vector double sum;
xinv = _recipd2(xabs);
sum = spu_madd(xinv, spu_splats(STIRLING_16), spu_splats(STIRLING_15));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_14));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_13));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_12));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_11));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_10));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_09));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_08));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_07));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_06));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_05));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_04));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_03));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_02));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_01));
sum = spu_madd(sum, xinv, spu_splats(STIRLING_00));
sum = spu_mul(sum, sqrt2pi);
sum = spu_mul(sum, _powd2(x, spu_sub(x, halfd)));
sresult = spu_mul(sum, _expd2(spu_or(x, signbit)));
/*
* Choose rational approximation or Stirling's result.
*/
result = spu_sel(rresult, sresult, gt9p9);
result = spu_sel(result, inf, gt200);
/* For x < 0, use:
*
* gamma(x) = pi/(x*gamma(-x)*sin(x*pi))
* or
* gamma(x) = pi/(gamma(1 - x)*sin(x*pi))
*/
nresult = _divd2(pi, spu_mul(x, spu_mul(result, _sind2(spu_mul(x, pi)))));
result = spu_sel(nresult, result, gt0);
/*
* x = non-positive integer, return NaN.
*/
result = spu_sel(result, nan, spu_andc(spu_cmpeq(x, xtrunc), gt0));
return result;
}
#endif /* _TGAMMAD2_H_ */
#endif /* __SPU__ */