示例#1
0
struct Cyc_APQ_T*Cyc_reduce(struct Cyc_APQ_T*q){struct Cyc_APQ_T*_T0;struct Cyc_AP_T*_T1;struct Cyc_AP_T*_T2;int _T3;struct Cyc_APQ_T*_T4;struct Cyc_APQ_T*_T5;struct Cyc_AP_T*_T6;struct Cyc_APQ_T*_T7;struct Cyc_APQ_T*_T8;struct Cyc_AP_T*_T9;struct Cyc_APQ_T*_TA;struct Cyc_AP_T*_TB;struct Cyc_AP_T*_TC;struct Cyc_APQ_T*_TD;struct Cyc_AP_T*_TE;int _TF;struct Cyc_APQ_T*_T10;void*_T11;struct Cyc_APQ_T*_T12;struct Cyc_APQ_T*_T13;struct Cyc_AP_T*_T14;struct Cyc_AP_T*_T15;struct Cyc_APQ_T*_T16;struct Cyc_APQ_T*_T17;struct Cyc_AP_T*_T18;struct Cyc_AP_T*_T19;struct Cyc_APQ_T*_T1A;_T0=
_check_null(q);_T1=_T0->d;_T2=Cyc_AP_zero;_T3=Cyc_AP_cmp(_T1,_T2);if(_T3 >= 0)goto _TL0;_T4=q;_T5=q;_T6=_T5->d;
_T4->d=Cyc_AP_neg(_T6);_T7=q;_T8=q;_T9=_T8->n;
_T7->n=Cyc_AP_neg(_T9);goto _TL1;_TL0: _TL1: _TA=q;_TB=_TA->n;_TC=
# 18
Cyc_AP_abs(_TB);_TD=q;_TE=_TD->d;{struct Cyc_AP_T*gcd=Cyc_AP_gcd(_TC,_TE);_TF=
Cyc_AP_cmp(gcd,Cyc_AP_one);if(_TF!=0)goto _TL2;_T10=q;
return _T10;_TL2: _T11=_cycalloc(sizeof(struct Cyc_APQ_T));{
struct Cyc_APQ_T*newq=(struct Cyc_APQ_T*)_T11;_T12=newq;_T13=q;_T14=_T13->n;_T15=gcd;
_T12->n=Cyc_AP_div(_T14,_T15);_T16=newq;_T17=q;_T18=_T17->d;_T19=gcd;
_T16->d=Cyc_AP_div(_T18,_T19);_T1A=newq;
return _T1A;}}}
示例#2
0
struct Cyc_APQ_T * Cyc_APQ_neg(struct Cyc_APQ_T * q) {
    struct Cyc_APQ_T * _T0;
    struct Cyc_AP_T * _T1;
    struct Cyc_AP_T * _T2;
    struct Cyc_APQ_T * _T3;
    struct Cyc_AP_T * _T4;
    struct Cyc_APQ_T * _T5;
    _T0 = _check_null(q);
    _T1 = _T0->n;
    _T2 = Cyc_AP_neg(_T1);
    _T3 = q;
    _T4 = _T3->d;
    _T5 = Cyc_APQ_fromAP(_T2,_T4);
    return _T5;
}