Esempio n. 1
0
void _coshrat(PRAT* px, uint32_t radix, int32_t precision)

{
    if (!IsValidForHypFunc(*px, precision))
    {
        // Don't attempt exp of anything large or small
        throw(CALC_E_DOMAIN);
    }

    CREATETAYLOR();

    pret->pp = i32tonum(1L, radix);
    pret->pq = i32tonum(1L, radix);

    DUPRAT(thisterm, pret)

    n2 = i32tonum(0L, radix);

    do
    {
        NEXTTERM(xx, INC(n2) DIVNUM(n2) INC(n2) DIVNUM(n2), precision);
    } while (!SMALL_ENOUGH_RAT(thisterm, precision));

    DESTROYTAYLOR();
}
Esempio n. 2
0
void _asinrat( PRAT *px, int32_t precision)

{
    CREATETAYLOR();
    DUPRAT(pret,*px); 
    DUPRAT(thisterm,*px);
    DUPNUM(n2,num_one);

    do
        {
        NEXTTERM(xx,MULNUM(n2) MULNUM(n2) 
            INC(n2) DIVNUM(n2) INC(n2) DIVNUM(n2), precision);
        }
    while ( !SMALL_ENOUGH_RAT( thisterm, precision) );
    DESTROYTAYLOR();
}
Esempio n. 3
0
void _acosrat( PRAT *px, int32_t precision)

{
    CREATETAYLOR();

    createrat(thisterm); 
    thisterm->pp=longtonum( 1L, BASEX );
    thisterm->pq=longtonum( 1L, BASEX ); 

    DUPNUM(n2,num_one);

    do
        {
        NEXTTERM(xx,MULNUM(n2) MULNUM(n2) 
            INC(n2) DIVNUM(n2) INC(n2) DIVNUM(n2), precision);
        }
    while ( !SMALL_ENOUGH_RAT( thisterm, precision) );

    DESTROYTAYLOR();
}
Esempio n. 4
0
void _sinhrat(PRAT* px, int32_t precision)

{
    if (!IsValidForHypFunc(*px, precision))
    {
        // Don't attempt exp of anything large or small
        throw(CALC_E_DOMAIN);
    }

    CREATETAYLOR();

    DUPRAT(pret, *px);
    DUPRAT(thisterm, pret);

    DUPNUM(n2, num_one);

    do
    {
        NEXTTERM(xx, INC(n2) DIVNUM(n2) INC(n2) DIVNUM(n2), precision);
    } while (!SMALL_ENOUGH_RAT(thisterm, precision));

    DESTROYTAYLOR();
}