/*************************************************************************************************************************************/
/* */
/* C A L C U L D E ' P I ' A V E C U N E F O R M U L E D E R A M A N U J A N : */
/* */
/* */
/* Author of '$xrp/Ramanujan.01$K' : */
/* */
/* Jean-Francois COLONNA (LACTAMME, 20200824145657). */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* I N T E R F A C E ' listG ' : */
/* */
/* */
/* :Debut_listG: */
/* :Fin_listG: */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* D I R E C T I V E S S P E C I F I Q U E S D E C O M P I L A T I O N : */
/* */
/*************************************************************************************************************************************/
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* F I C H I E R S D ' I N C L U D E S : */
/* */
/*************************************************************************************************************************************/
#include INCLUDES_BASE
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* P A R A M E T R E S : */
/* */
/*************************************************************************************************************************************/
#define PREMIERE_ITERATION \
ZERO
#define DERNIERE_ITERATION \
DEUX
/* Les iterations sont numerotes a partir de 0... */
#include xcg/ARIT.01.I"
#include xci/valeurs.01.I"
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* M A C R O S U T I L E S : */
/* */
/*************************************************************************************************************************************/
#include xci/valeurs.02.I"
#define PARAMETRE_1 \
DIVI(MUL2(FDEUX,RACX(FDEUX)),PARE(FLOT(9801)))
#define PARAMETRE_2 \
PARE(FLOT(26390))
#define PARAMETRE_3 \
PARE(FLOT(1103))
#define PARAMETRE_4 \
PARE(FLOT(396))
/*===================================================================================================================================*/
/*************************************************************************************************************************************/
/* */
/* C A L C U L D E ' P I ' A V E C U N E F O R M U L E D E R A M A N U J A N : */
/* */
/*************************************************************************************************************************************/
BCommande(nombre_d_arguments,arguments)
/*-----------------------------------------------------------------------------------------------------------------------------------*/
Bblock
DEFV(Int,INIT(derniere_iteration,DERNIERE_ITERATION));
/* Les iterations sont numerotes a partir de 0... */
#include xci/valeurs.03.I"
/*..............................................................................................................................*/
GET_ARGUMENTS_(nombre_d_arguments
,BLOC(GET_ARGUMENT_I("iterations=""i=",derniere_iteration);
PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_1;
PROCESS_ARGUMENTS_DE_PARAMETRAGE_DE_LA_GENERATION_DE_SUITE_DE_VALEURS_2;
)
);
begin_nouveau_block
Bblock
DEFV(Float,INIT(cumul,FZERO));
DEFV(Int,INIT(indice_k,UNDEF));
DEFV(Float,INIT(pi,FLOT__UNDEF));
DoIn(indice_k,PREMIERE_ITERATION,derniere_iteration,I)
Bblock
INCR(cumul
,DIVI(MUL2(FACT(GRO4(indice_k))
,AXPB(PARAMETRE_2,indice_k,PARAMETRE_3)
)
,MUL2(PUIX(FACT(indice_k),QUATRE)
,PUIX(PARAMETRE_4,GRO4(indice_k))
)
)
);
Eblock
EDoI
EGAL(pi,INVE(MUL2(PARAMETRE_1,cumul)));
EDITION_DE_LA_VALEUR_DE_L_OPERATEUR(pi);
/* Edition de la valeur de 'pi'... */
Eblock
end_nouveau_block
RETU_Commande;
Eblock
ECommande
Copyright © Jean-François COLONNA, 2020-2024.
Copyright © CMAP (Centre de Mathématiques APpliquées) UMR CNRS 7641 / École polytechnique, Institut Polytechnique de Paris, 2020-2024.