/*************************************************************************************************************************************/
/*                                                                                                                                   */
/*        T E S T   D E   L ' A R I T H M E T I Q U E   F O L K L O R I Q U E   D A N S   C  :                                       */
/*                                                                                                                                   */
/*                                                                                                                                   */
/*        Author of '$xtc/HORNER_4_01.folklorique.01$c' :                                                                            */
/*                                                                                                                                   */
/*                    Jean-Francois COLONNA (LACTAMME, 20221130124900).                                                              */
/*                                                                                                                                   */
/*************************************************************************************************************************************/

#include  "INCLUDES.01.I"

                                        /* Ce qui suit vient de 'v $ximcf/outils$FON' apres pre-processing puis une passe de         */
                                        /* simplification du parenthesage grace a 'v $xcp/listes.02$K' en lui communiquant, par      */
                                        /* exemple, la definition de 'PsR_folklorique' mise sur une seule ligne...                   */

#define   PsR_folklorique(R1,I1,R2,I2)                                                                                                  \
     ((((((((sR_a1111*R1)+sR_a1110)*I1)+((sR_a1101*R1)+sR_a1100))*R2)+((((sR_a1011*R1)+sR_a1010)*I1)+((sR_a1001*R1)+sR_a1000)))*I2)     \
     + ((((((sR_a0111*R1)+sR_a0110)*I1)+((sR_a0101*R1)+sR_a0100))*R2)+((((sR_a0011*R1)+sR_a0010)*I1)+((sR_a0001*R1)+sR_a0000)))         \
      )

#define   PsI_folklorique(R1,I1,R2,I2)                                                                                                  \
     ((((((((sI_a1111*R1)+sI_a1110)*I1)+((sI_a1101*R1)+sI_a1100))*R2)+((((sI_a1011*R1)+sI_a1010)*I1)+((sI_a1001*R1)+sI_a1000)))*I2)     \
     + ((((((sI_a0111*R1)+sI_a0110)*I1)+((sI_a0101*R1)+sI_a0100))*R2)+((((sI_a0011*R1)+sI_a0010)*I1)+((sI_a0001*R1)+sI_a0000)))         \
      )

#define   PpR_folklorique(R1,I1,R2,I2)                                                                                                  \
     ((((((((pR_a1111*R1)+pR_a1110)*I1)+((pR_a1101*R1)+pR_a1100))*R2)+((((pR_a1011*R1)+pR_a1010)*I1)+((pR_a1001*R1)+pR_a1000)))*I2)     \
     + ((((((pR_a0111*R1)+pR_a0110)*I1)+((pR_a0101*R1)+pR_a0100))*R2)+((((pR_a0011*R1)+pR_a0010)*I1)+((pR_a0001*R1)+pR_a0000)))         \
      )

#define   PpI_folklorique(R1,I1,R2,I2)                                                                                                  \
     ((((((((pI_a1111*R1)+pI_a1110)*I1)+((pI_a1101*R1)+pI_a1100))*R2)+((((pI_a1011*R1)+pI_a1010)*I1)+((pI_a1001*R1)+pI_a1000)))*I2)     \
     + ((((((pI_a0111*R1)+pI_a0110)*I1)+((pI_a0101*R1)+pI_a0100))*R2)+((((pI_a0011*R1)+pI_a0010)*I1)+((pI_a0001*R1)+pI_a0000)))         \
      )

double    sR_a1111=0;
double    sR_a1110=0;
double    sR_a1101=0;
double    sR_a1100=0;
double    sR_a1011=0;
double    sR_a1010=0;
double    sR_a1001=0;
double    sR_a1000=0;
double    sR_a0111=0;
double    sR_a0110=0;
double    sR_a0101=0;
double    sR_a0100=+1;
double    sR_a0011=0;
double    sR_a0010=0;
double    sR_a0001=+1;
double    sR_a0000=0;

double    sR_folklorique(double R1,double I1,double R2,double I2)
          {
          return(PsR_folklorique(R1,I1,R2,I2));
          }

double    sI_a1111=0;
double    sI_a1110=0;
double    sI_a1101=0;
double    sI_a1100=0;
double    sI_a1011=0;
double    sI_a1010=0;
double    sI_a1001=0;
double    sI_a1000=+1;
double    sI_a0111=0;
double    sI_a0110=0;
double    sI_a0101=0;
double    sI_a0100=0;
double    sI_a0011=0;
double    sI_a0010=+1;
double    sI_a0001=0;
double    sI_a0000=0;

double    sI_folklorique(double R1,double I1,double R2,double I2)
          {
          return(PsI_folklorique(R1,I1,R2,I2));
          }

double    pR_a1111=0;
double    pR_a1110=0;
double    pR_a1101=0;
double    pR_a1100=0;
double    pR_a1011=0;
double    pR_a1010=-1;
double    pR_a1001=0;
double    pR_a1000=0;
double    pR_a0111=0;
double    pR_a0110=0;
double    pR_a0101=+1;
double    pR_a0100=0;
double    pR_a0011=0;
double    pR_a0010=0;
double    pR_a0001=0;
double    pR_a0000=0;

double    pR_folklorique(double R1,double I1,double R2,double I2)
          {
          return(PpR_folklorique(R1,I1,R2,I2));
          }

double    pI_a1111=0;
double    pI_a1110=0;
double    pI_a1101=0;
double    pI_a1100=0;
double    pI_a1011=0;
double    pI_a1010=0;
double    pI_a1001=+1;
double    pI_a1000=0;
double    pI_a0111=0;
double    pI_a0110=+1;
double    pI_a0101=0;
double    pI_a0100=0;
double    pI_a0011=0;
double    pI_a0010=0;
double    pI_a0001=0;
double    pI_a0000=0;

double    pI_folklorique(double R1,double I1,double R2,double I2)
          {
          return(PpI_folklorique(R1,I1,R2,I2));
          }

main()
          {
          double    R1=20;
          double    I1=30;
          double    R2=4;
          double    I2=5;

          printf("sR(%+f,%+f,%+f,%+f)=%+f\n",R1,I1,R2,I2,sR_folklorique(R1,I1,R2,I2));
                                        /* Est egal a +24...                                                                         */
          printf("sI(%+f,%+f,%+f,%+f)=%+f\n",R1,I1,R2,I2,sI_folklorique(R1,I1,R2,I2));
                                        /* Est egal a +35...                                                                         */
          printf("pR(%+f,%+f,%+f,%+f)=%+f\n",R1,I1,R2,I2,pR_folklorique(R1,I1,R2,I2));
                                        /* Est egal a -70...                                                                         */
          printf("pI(%+f,%+f,%+f,%+f)=%+f\n",R1,I1,R2,I2,pI_folklorique(R1,I1,R2,I2));
                                        /* Est egal a +220...                                                                        */
          }



Copyright © Jean-François COLONNA, 2022-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2022-2024.