diff options
author | Karl Berry <karl@freefriends.org> | 2008-03-28 23:18:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-03-28 23:18:40 +0000 |
commit | ccc82446897ad1e40dc84d740a0ef737cc75b277 (patch) | |
tree | ec8a29f05624af916a5f0714c0912b15bd8e204b /Master/texmf-dist/tex/latex/tablor | |
parent | 4a5db5d8d926c666fb1665962a14118ed967ebb6 (diff) |
tablor update (25mar08)
git-svn-id: svn://tug.org/texlive/trunk@7210 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tablor')
-rw-r--r-- | Master/texmf-dist/tex/latex/tablor/tablorutf8.sty | 2109 |
1 files changed, 2109 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tablor/tablorutf8.sty b/Master/texmf-dist/tex/latex/tablor/tablorutf8.sty new file mode 100644 index 00000000000..c0ab9fe1e3c --- /dev/null +++ b/Master/texmf-dist/tex/latex/tablor/tablorutf8.sty @@ -0,0 +1,2109 @@ + +\NeedsTeXFormat{LaTeX2e}[1995/12/01] +\ProvidesPackage{tablor}[24/03/2008 v2.01 la machine à créer des tableaux de signes et variations] + +% \copyleft Connan le Barbare \copyright +% avec l'efficace participation de Jean-Michel Boucart + + +%% Crée 14 environnements : +%% tableau de signes de 2 facteurs affines +% \begin{TSa} +% TSa(-2,3,-1,5,\tv); +% \end{TSa} +% %%%%%% Pour des tableaux de plus de 2 facteurs +% +% \begin{TS} +% TS([-2*x+3,x^2-1,x^2+1,x-1,x^2-2],[a,b],\tv); +% \end{TS} +% +% pour les tableaux de signes avec quotient +%\begin{TSq} +%TSq("Q",[-2*x+3,-4*x+5],[x^2-16,x-2],[a,b],\tv) +%%\end{TSq} +% un tableau de variation : +% +% \begin{TV} +% TV([0,+infinity],[0],"h","x",ln(x)-(ln(x))^2,1,\tv) +% \end{TV} +% +% tableau avec valeurs intermédiares +%\begin{TVI} +%TVI([-1,+infinity],[-1],"f","x",x2/sqrt(x+1)-1,1,2,\tv) +%\end{TVI} +%%% +% tableau de variations avec f' sans zéro formel +%\begin{TVapp} +% TVapp([0,+infinity],[0],"g","x",ln(x)-x*exp(2-x),1,\tv) +% \end{TVapp} +% +% +% tableau de variations avec f' sans zéro formel +%\begin{TVIapp} +% TVIapp([0,+infinity],[0],"g","x",ln(x)-x*exp(2-x),1,0,\tv) +% \end{TVIapp} +% +% +%%% +% et leurs pendants étoilés qui permet l'affichage intermédiaire du +% fichier metapost pour le modifier +% +% +% +% + + + + +%% extensions requises +%% Il faudra rajouter dans le préambule \usepackage{graphicx} si vous +%% ne l'avez pas de base + + +\RequirePackage{ifthen} +\RequirePackage{fancyvrb} +\RequirePackage{ifpdf} + + +% option xcas présent + + +\newboolean{xcas}\setboolean{xcas}{false} +\DeclareOption{xcas}{\setboolean{xcas}{true}} + +%% Initialisation du choix d'OS +\newboolean{windows}\setboolean{windows}{false} + + +%% on configure tablor dans un fichier extérieur pour la plateforme +%% et l'éditeur + +\IfFileExists{tablor.cfg}{\input{tablor.cfg}}%\typeout{pas de fichier tablor.cfg}} + +\ProcessOptions\relax + +%% pour ceux compilant via pdflatex + +\ifpdf +\DeclareGraphicsRule{*}{mps}{*}{} +\fi + +%% pour nettoyer les fichiers auxiliaires + +\AtEndDocument{\immediate\write18{\rem tete.* *.user XCas* Xcas* *.mpx}} + + + +%% En-tête pour le fichier metapost contenant les codes +%% de tous les tableaux produits + + \begin{VerbatimOut}{tete.mp} + input tableauVariation; + verbatimtex +%&latex + \documentclass{article} + \usepackage[upright]{fourier} + \usepackage{amsmath} + \newcommand{\Mathbold}[1]{\mbox{\boldmath$#1$\unboldmath}} + \begin{document} + etex + + \end{VerbatimOut} + +%% Nettoie les fichiers log dont le nom dépend du choix de l'utilisateur +%% Par défaut, c'est le nom du fichier tex courant (\jobname) +%% Clôt le fichier metapost contenant le récapitulatif de tous les tableaux + + +%% Définit des commandes disque selon l'OS utilisé +\ifthenelse{\boolean{windows}}% + {\newcommand{\rem}{DEL } \newcommand{\cat}{TYPE } + \newcommand{\cp}{COPY }}% + {\newcommand{\rem}{rm }\newcommand{\cat}{cat } + \newcommand{\cp}{cp }} + + + +\newcommand{\nettoyer}[1][\jobname]% +{\immediate\write18{\rem #1.Tab.log} +\immediate\write18{echo end >> #1.Tab.mp} +} + + + + +%% Donne comme prefixe aux tableaux le prefixe courant +%% Peut-être modifié par \initablor + +\newcommand{\Tableaux}{\jobname} + +%% initialise les compteurs + +\newcounter{TVn} +\newcommand{\tv}{\theTVn} + +\newcounter{TVnbis} +\newcommand{\tvbis}{\theTVnbis} + + + +%% permet de donner un prefixe aux tableaux produits (\jobname par défaut) +%% effectue quelques vérifications : + + +\newcommand{\initablor}[1][\jobname]{% +\renewcommand{\Tableaux}{#1}% Arret du nom des tableaux +\setcounter{TVn}{0}% Initialisation du compteur de tableaux. +\ifthenelse{\boolean{xcas}}% Avec l'option XCas +{\IfFileExists{\Tableaux.Tab.mp}% Si Tableaux.mp est présent... + {\immediate\write18{\rem \Tableaux.Tab.mp}}% le détruire + {}% + \immediate\write18{\cp -f tete.mp \Tableaux.Tab.mp}% Reconstituer l'entête de Tableaux.mp +} +{\IfFileExists{\Tableaux.Tab.mp}% Sans l'option XCas, si + % Tableaux.mp existe +{\immediate\write18{mpost -interaction=batchmode \Tableaux.Tab}}% l'exécuter pour reconstituer les figures +{\PackageWarning{tablor}{Pas de source metapost pour creer les tableaux.}}% sinon message d'erreur + % (mais pas d'arret car les tableaux + % peuvent être présents ) +}}% + + + +%% commande pour lancer giac selon l'OS + +\makeatletter +\newcommand{\executGiacmp}[1]{% +\ifthenelse{\boolean{windows}}% +{\immediate\write18{giac #1 }}% +{\immediate\write18{giac <#1 }}} +\makeatother + + + + +%%% +% +%%% LES SCRIPTS GIAC/XCAS +% +%%% + + + + + + + +%% +%% Code giac/Xcas pour les Tableaux de Variations +%% + + +\begin{VerbatimOut}{XcasTV.cxx} +TV(L,F,nom,nomv,f,ftt,nmr):={ +nl:=size(L); +f:=unapply(f,x); +fp:=fonction_derivee(f); +Z:=concat(L,F); +S:=resoudre(fp(x),x); + si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + kk:=(evalf(S[j])>=evalf(L[0])) and (evalf(S[j])<=evalf(L[nl-1])); + if(kk==1){Z:=append(Z,simplifier(S[j]))}; + fpour + fsi; + +Z:=sort(Z); +nz:=size(Z); + si Z[0]==Z[1] alors Z:=augment(Z[0],Z[2..nz-1]);nz:=nz-1; + fsi; +pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=augment(Z[0..u-1],Z[u+1..nz-1]);nz:=nz-1; + fsi; +fpour; +nz:=size(Z); +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; +pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+latex(Z[m])+"$ etex); +";fpour; + + k0:= evalf(limite(f(x),x=Z[0],1))> evalf(limite(f(x),x=Z[1],-1)); + kz:=evalf(limite(f(x),x=Z[nz-1],-1))> evalf(limite(f(x),x=Z[nz-2],1)); + +lsi:=" +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle "+nom+"'("+nomv+")}$ etex);"+ + if(Z[0]==-infinity){if(sign(evalf(fp(if(Z[1]==+infinity){0}else{Z[1]-10^(-5)})))==1){"plus;"}else{"moins;"}}else{if(member(Z[0],F)==0){ + if(fp(Z[0])==0){"valBarre(btex 0 etex);"}else{" "}+ + if(sign(fp(Z[0]+10^(-5)))==1){"plus;"}else{"moins;"}}else{"nonDefBarre;"+ + if(sign(fp((Z[0]+10^(-5))))==1){"plus;"}else{"moins;"} }} + +if(nz>2){ for(r:=1; r<=nz-2;r++){ ksp:=evalf(fp(Z[r]+0.01))>0; + lsp:=lsp+if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(ksp==1){"plus;"}else{"moins;"} + }; } + +lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; +"} +lm0:=limite(f(x),x=Z[0],1)==-infinity; + li:=" +newLigneVariations(btex $\\hbox{\\bf Variations de }\\atop{\\displaystyle \\Mathbold{"+nom+"}}$ etex);"+ + if(member(Z[0],F)==0){"valPos(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"} + else{"nonDefBarre;limDroite(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"}+ + if(k0==1){"1"}else{"0"}+ + ");"; + + if(nz>2){ for(r:=1; r<=nz-2;r++){ krm:=evalf(limite(f(x),x=Z[r-1],1))< evalf(limite(f(x),x=Z[r],-1)); + krp:=evalf(limite(f(x),x=Z[r],1))> evalf(limite(f(x),x=Z[r+1],-1)) ; + lmrm:=limite(f(x),x=Z[r],-1)==-infinity;lmrp:=limite(f(x),x=Z[r],1)==-infinity; + lp:=lp+if(member(Z[r],F)){ + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[r])))+"$ + etex,"+if(sign(evalf(fp(Z[r]-0.01)))==sign(fp(Z[r]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0); +"}}} + }; } + +lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; + lf:=if(member(Z[nz-1],F)==0){"valPos(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}else{"nonDefBarre;limGauche(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}+ + if(kz==1){"1);"}else{"0); +"}; + + +intro:="input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +" + + +MetaL:=if(ftt==2){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; +end +";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; +end"; +} +}else{ if(ftt==0){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +end";}}else{ +if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; +end";} +}} + + + +MetaLfc:=if(ftt==2){if(nz>2){" + +beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; + +";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; + +"; +} +}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; + +";}}else{ +if(nz>2){"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; + +";} +}} + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + +return(MetaL); + }:; + +\end{VerbatimOut} + + + + + +%% +%% +%% Quand les solutions formelles de f'(x)=0 ne sont pas calculables +%% + + + +\begin{VerbatimOut}{XcasTVapp.cxx} + + + + + + + +TVapp(L,F,nom,nomv,f,ftt,nmr):={ + + +nl:=size(L); +f:=unapply(f,x); +fp:=fonction_derivee(f); +z0:=concat(L,F);z:=sort(z0); +nz:=size(z); +if(L==[-infinity,+infinity]){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=-100..100);} +else{if(L[0]==-infinity){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=-100..L[1]);} +else{if(L[1]==+infinity){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=L[0]..100);} +else{S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=z[0]..z[nz-1])}}}; +si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + kk:=(re(S[j])==S[j]);kok:=(evalf(S[j])>=L[0]) and (evalf(S[j])<=L[1]); + if(kk==1){if(kok==1){z:=append(z,simplifier(S[j]))}}; + fpour; +fsi; + + +S:=NULL; +S:=S,z[0]; +for(j:=1;j<size(z);j++){ + if(z[j]!=undef and (abs(z[j])>1e-15 or z[j]==0)){ + S:=S,z[j]}; +} +z:=[S]; + +Z:=sort(z); +nz:=size(Z); + +S:=NULL; +S:=S,Z[0]; +for(j:=1;j<nz;j++){ + if(Z[j]!=S[size(S)-1]){ + S:=S,Z[j]}; +} +Z:=[S]; + + +nz:=size(Z); +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; +pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+latex(Z[m])+"$ etex); +";fpour; + + k0:= evalf(limite(f(x),x=Z[0],1))> evalf(limite(f(x),x=Z[1],-1)); + kz:=evalf(limite(f(x),x=Z[nz-1],-1))> evalf(limite(f(x),x=Z[nz-2],1)); + +lsi:=" +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle "+nom+"'("+nomv+")}$ etex);"+ + if(Z[0]==-infinity){if(sign(evalf(fp(if(Z[1]==+infinity){0}else{Z[1]-10^(-5)})))==1){"plus;"}else{"moins;"}}else{if(member(Z[0],F)==0){ + if(fp(Z[0])==0){"valBarre(btex 0 etex);"}else{" "}+ + if(sign(fp(Z[0]+10^(-5)))==1){"plus;"}else{"moins;"}}else{"nonDefBarre;"+ + if(sign(fp((Z[0]+10^(-5))))==1){"plus;"}else{"moins;"} }} + +if(nz>2){ for(r:=1; r<=nz-2;r++){ ksp:=evalf(fp(Z[r]+0.01))>0; + lsp:=lsp+if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(ksp==1){"plus;"}else{"moins;"} + }; } + +lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; +"} +lm0:=limite(f(x),x=Z[0],1)==-infinity; + li:=" +newLigneVariations(btex $\\hbox{\\bf Variations de }\\atop{\\displaystyle \\Mathbold{"+nom+"}}$ etex);"+ + if(member(Z[0],F)==0){"valPos(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"} + else{"nonDefBarre;limDroite(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"}+ + if(k0==1){"1"}else{"0"}+ + ");"; + + if(nz>2){ for(r:=1; r<=nz-2;r++){ krm:=evalf(limite(f(x),x=Z[r-1],1))< evalf(limite(f(x),x=Z[r],-1)); + krp:=evalf(limite(f(x),x=Z[r],1))> evalf(limite(f(x),x=Z[r+1],-1)) ; + lmrm:=limite(f(x),x=Z[r],-1)==-infinity;lmrp:=limite(f(x),x=Z[r],1)==-infinity; + lp:=lp+if(member(Z[r],F)){ + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[r])))+"$ + etex,"+if(sign(evalf(fp(Z[r]-0.01)))==sign(fp(Z[r]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0); +"}}} + }; } + +lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; + lf:=if(member(Z[nz-1],F)==0){"valPos(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}else{"nonDefBarre;limGauche(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}+ + if(kz==1){"1);"}else{"0); +"}; + + +intro:="input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +" + + +MetaL:=if(ftt==2){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; +end +";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; +end"; +} +}else{ if(ftt==0){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +end";}}else{ +if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; +end";} +}} + + + +MetaLfc:=if(ftt==2){if(nz>2){" + +beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; + +";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; + +"; +} +}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; + +";}}else{ +if(nz>2){"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; + +";} +}} + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + +return(MetaL); + }:; + + + + + + + +\end{VerbatimOut} + + + + + + + +%% +%% Code giac/Xcas pour les Tableaux de Variations avec +%% Valeurs intermédiaires +%% + + + + + +\begin{VerbatimOut}{XcasTVI.cxx} + + +TVI(L,F,nom,nomv,f,ftt,ao,nmr):={ +nl:=size(L); +f:=unapply(f,x); +fp:=fonction_derivee(f); +Z:=concat(L,F); +S:=resoudre(fp(x),x); + si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + kk:=(evalf(S[j])>=evalf(L[0])) and (evalf(S[j])<=evalf(L[nl-1])); + if(kk==1){Z:=append(Z,simplifier(S[j]))}; + fpour + fsi; + +Z:=sort(Z); +nz:=size(Z); + si Z[0]==Z[1] alors Z:=augment(Z[0],Z[2..nz-1]);nz:=nz-1; + fsi; +pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=augment(Z[0..u-1],Z[u+1..nz-1]);nz:=nz-1; + fsi; +fpour; +nz:=size(Z); +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; + + + +LI:=limite(f(x),x,Z[0],1); +LF:=limite(f(x),x,Z[nz-1],-1); +LP:=NULL; +if(nz>2){ for(r:=1; r<=nz-2;r++){LP:=LP,if(member(Z[r],F)){limite(f(x),x,Z[r],-1),limite(f(x),x,Z[r],1)}else{f(Z[r])}}}; +if(nz>2){ LL:=[LI,LP,LF]}else{LL:=[LI,LF]}; + +NL:=size(LL); +A:=NULL;aa:=1;kk:=0; + +if(NL==nz){for(k:=0;k<nz-1;k++){TestS:=(sign(evalf(LL[k]-ao))==sign(evalf(LL[k+1]-ao))) or (sign(evalf(LL[k]-ao))==0.0)or (sign(evalf(LL[k+1]-ao))==0.0); +if(TestS==0){A:=A,aa;l0:=l0+"val(btex $"+latex(Z[k])+"$ etex);"+"val(btex $\\alpha_"+aa+"$ etex);";aa:=aa+1;}else{l0:=l0+"val(btex $"+latex(Z[k])+"$ etex);"}} +l0:=l0+"val(btex $"+latex(Z[nz-1])+"$ etex);"}; + +if(NL>nz){for(k:=0;k<NL-1;k++){TestS:=(sign(evalf(LL[k]-ao))==sign(evalf(LL[k+1]-ao))) or (sign(evalf(LL[k]-ao))==0.0)or (sign(evalf(LL[k+1]-ao))==0.0); +TestL:=(abs(LL[k])==abs(LL[k+1])); +if(TestS==0){ if( TestL==1 ){l0:=l0}else{ +A:=A,aa;l0:=l0+"val(btex $"+latex(Z[kk])+"$ etex);"+"val(btex $\\alpha_"+aa+"$ etex);";aa:=aa+1;kk:=kk+1}}else{l0:=l0+"val(btex $"+latex(Z[kk])+"$ etex);";kk:=kk+1}} +l0:=l0+"val(btex $"+latex(Z[nz-1])+"$ etex); +"}; + + + +TestS:=(sign(evalf(LL[0]-ao))==sign(evalf(LL[1]-ao))) or (sign(evalf(LL[0]-ao))==0.0) or (sign(evalf(LL[1]-ao))==0.0); + k0:= evalf(limite(f(x),x=Z[0],1))> evalf(limite(f(x),x=Z[1],-1)); + kz:=evalf(limite(f(x),x=Z[nz-1],-1))> evalf(limite(f(x),x=Z[nz-2],1)); + +lsi:=" +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle "+nom+"'("+nomv+")}$ etex);"+ + if(Z[0]==-infinity){if(sign(evalf(fp(if(Z[1]==+infinity){0}else{Z[1]-10^(-5)})))==1){"plus;"}else{"moins;"}}else{if(member(Z[0],F)==0){ + if(fp(Z[0])==0){"valBarre(btex 0 etex);"}else{" "}+ + if(sign(fp((Z[0]+10^(-10))))==1){"plus;"}else{"moins;"}}else{"nonDefBarre;"+ + if(sign(fp(10^(-10)+Z[0]))==1){"plus;"}else{"moins;"} }}+if(TestS==0){"valBarre(btex$ $ etex);"+ if(sign(fp(10^(-10)+Z[0]))==1){"plus;"}else{"moins;"}}else{" "}; + + + + + +if(nz>2){rr:=1; if(nz==NL){for(r:=1; r<=NL-2;r++){ TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + ksp:=evalf(fp(Z[r]+0.01))>0; + TestL:=(abs(LL[r])==abs(LL[r+1])); + lsp:=lsp+if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(ksp==1){"plus;"}else{"moins;"}+if(TestS==0){"valBarre(btex $ $ etex);"}else{" "}+if(TestS==0){if(ksp==1){"plus;"}else{"moins;"}}else{" "}; + }} +else{for(r:=1; r<=NL-2;r++){kspp:=evalf(fp(Z[rr]+0.01))>0;TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + TestL:=(abs(LL[r])==abs(LL[r+1])); + if(TestS==0){if( TestL==1 ){lsp:=lsp}else{lsp:=lsp+if(member(Z[rr],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(kspp==1){"plus;"}else{"moins;"}+"valBarre(btex $ $ etex);"+if(kspp==1){"plus;"}else{"moins;"};rr:=rr+1;} + } else{lsp:=lsp+if(member(Z[rr],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(kspp==1){"plus;"}else{"moins;"};rr:=rr+1;} +}} + }; + + + +lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre;"} +lm0:=limite(f(x),x=Z[0],1)==-infinity; + +TestS:=(sign(evalf(LL[0]-ao))==sign(evalf(LL[1]-ao))) or (sign(evalf(LL[0]-ao))==0.0) or (sign(evalf(LL[1]-ao))==0.0); + + li:=" +newLigneVariations(btex $\\hbox{\\bf Variations de }\\atop{\\displaystyle \\Mathbold{"+nom+"}}$ etex); +"+ if(member(Z[0],F)==0){"valPos(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"} + else{"nonDefBarre;limDroite(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"}+ + if(k0==1){"1);"}else{"0);"}+if(TestS==0){"valPos(btex $ "+ao+" $ etex,0.5);"}else{" "}; + + + if(nz>2){if(nz==NL){for(r:=1; r<=nz-2;r++){TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + krm:=evalf(limite(f(x),x=Z[r-1],1))< evalf(limite(f(x),x=Z[r],-1)); + krp:=evalf(limite(f(x),x=Z[r],1))> evalf(limite(f(x),x=Z[r+1],-1)) ; + lmrm:=limite(f(x),x=Z[r],-1)==-infinity;lmrp:=limite(f(x),x=Z[r],1)==-infinity; + lp:=lp+if(member(Z[r],F)) { + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[r])))+"$ + etex,"+if(sign(evalf(fp(Z[r]-0.01)))==sign(fp(Z[r]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0);"}}}+if(TestS==0){"valPos(btex + $ "+ao+" $ etex,0.5);" + }else{" "}; +};//for +}else{rr:=1;for(r:=1; r<=NL-2;r++){TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + krm:=evalf(limite(f(x),x=Z[rr-1],1))< evalf(limite(f(x),x=Z[rr],-1)); + krp:=evalf(limite(f(x),x=Z[rr],1))> evalf(limite(f(x),x=Z[rr+1],-1)) ; + lmrm:=limite(f(x),x=Z[rr],-1)==-infinity;lmrp:=limite(f(x),x=Z[rr],1)==-infinity; TestL:=(abs(LL[r])==abs(LL[r+1])); +if(TestS==0){if( TestL==1 ){lp:=lp}else{ lp:=lp+if(member(Z[rr],F)) { + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[rr])))+"$ + etex,"+if(sign(evalf(fp(Z[rr]-0.01)))==sign(fp(Z[rr]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0);"}}}+"valPos(btex + $ "+ao+" $ etex,0.5); + ";rr:=rr+1; +}// else testL==1 +}//testS==0 +else{lp:=lp+if(member(Z[rr],F)){ + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[rr])))+"$ + etex,"+if(sign(evalf(fp(Z[rr]-0.01)))==sign(fp(Z[rr]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0); + "}}};rr:=rr+1; +}//else testS==0 +}//for nz<NL +}// else nz<NL +//if nz=NL +};//if nz>2 + + +lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; + lf:=if(member(Z[nz-1],F)==0){"valPos(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}else{"nonDefBarre;limGauche(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}+ + if(kz==1){"1);"}else{"0);"}; + + + +intro:=" +input tableauVariation; +verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +"; + + +MetaL:= if(ftt==2){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; +end";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; +end"; +} +}else{ +if(ftt==0){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +end";}}else{ +if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; +end";} +}}; + + +MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; + +";}else{ +"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; + +"; +} +}else{ +if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +";}}else{ +if(nz>2){"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; + +";} +}}; + + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + +return(MetaL); + }:; + + + +\end{VerbatimOut} + + + + + + + +%% +%% +%% Quand les solutions de f'(x)=0 ne sont pas formellement calculables +%% + + + + +\begin{VerbatimOut}{XcasTVIapp.cxx} + + +TVIapp(L,F,nom,nomv,f,ftt,ao,nmr):={ + + +nl:=size(L); +f:=unapply(f,x); +fp:=fonction_derivee(f); +z0:=concat(L,F);z:=sort(z0); +nz:=size(z); +if(L==[-infinity,+infinity]){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=-100..100);} +else{if(L[0]==-infinity){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=-100..L[1]);} +else{if(L[1]==+infinity){S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=L[0]..100);} +else{S:=seq(fsolve(fp(x),x,k/10,newton_solver),k=z[0]..z[nz-1])}}}; +si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + kk:=(re(S[j])==S[j]);kok:=(evalf(S[j])>=L[0]) and (evalf(S[j])<=L[1]); + if(kk==1){if(kok==1){z:=append(z,simplifier(S[j]))}}; + fpour; +fsi; + + +S:=NULL; +S:=S,z[0]; +for(j:=1;j<size(z);j++){ + if(z[j]!=undef and (abs(z[j])>1e-15 or z[j]==0)){ + S:=S,z[j]}; +} +z:=[S]; + + + +Z:=sort(z); +nz:=size(Z); + +S:=NULL; +S:=S,Z[0]; +for(j:=1;j<nz;j++){ + if(Z[j]!=S[size(S)-1]){ + S:=S,Z[j]}; +} +Z:=[S]; + + +nz:=size(Z); +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; + + + +LI:=limite(f(x),x,Z[0],1); +LF:=limite(f(x),x,Z[nz-1],-1); +LP:=NULL; +if(nz>2){ for(r:=1; r<=nz-2;r++){LP:=LP,if(member(Z[r],F)){limite(f(x),x,Z[r],-1),limite(f(x),x,Z[r],1)}else{f(Z[r])}}}; +if(nz>2){ LL:=[LI,LP,LF]}else{LL:=[LI,LF]}; + +NL:=size(LL); +A:=NULL;aa:=1;kk:=0; + +if(NL==nz){for(k:=0;k<nz-1;k++){TestS:=(sign(evalf(LL[k]-ao))==sign(evalf(LL[k+1]-ao))) or (sign(evalf(LL[k]-ao))==0.0)or (sign(evalf(LL[k+1]-ao))==0.0); +if(TestS==0){A:=A,aa;l0:=l0+"val(btex $"+latex(Z[k])+"$ etex);"+"val(btex $\\alpha_"+aa+"$ etex);";aa:=aa+1;}else{l0:=l0+"val(btex $"+latex(Z[k])+"$ etex);"}} +l0:=l0+"val(btex $"+latex(Z[nz-1])+"$ etex);"}; + +if(NL>nz){for(k:=0;k<NL-1;k++){TestS:=(sign(evalf(LL[k]-ao))==sign(evalf(LL[k+1]-ao))) or (sign(evalf(LL[k]-ao))==0.0)or (sign(evalf(LL[k+1]-ao))==0.0); +TestL:=(abs(LL[k])==abs(LL[k+1])); +if(TestS==0){ if( TestL==1 ){l0:=l0}else{ +A:=A,aa;l0:=l0+"val(btex $"+latex(Z[kk])+"$ etex);"+"val(btex $\\alpha_"+aa+"$ etex);";aa:=aa+1;kk:=kk+1}}else{l0:=l0+"val(btex $"+latex(Z[kk])+"$ etex);";kk:=kk+1}} +l0:=l0+"val(btex $"+latex(Z[nz-1])+"$ etex); +"}; + + + +TestS:=(sign(evalf(LL[0]-ao))==sign(evalf(LL[1]-ao))) or (sign(evalf(LL[0]-ao))==0.0) or (sign(evalf(LL[1]-ao))==0.0); + k0:= evalf(limite(f(x),x=Z[0],1))> evalf(limite(f(x),x=Z[1],-1)); + kz:=evalf(limite(f(x),x=Z[nz-1],-1))> evalf(limite(f(x),x=Z[nz-2],1)); + +lsi:=" +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle "+nom+"'("+nomv+")}$ etex);"+ + if(Z[0]==-infinity){if(sign(evalf(fp(if(Z[1]==+infinity){0}else{Z[1]-10^(-5)})))==1){"plus;"}else{"moins;"}}else{if(member(Z[0],F)==0){ + if(fp(Z[0])==0){"valBarre(btex 0 etex);"}else{" "}+ + if(sign(fp((Z[0]+10^(-10))))==1){"plus;"}else{"moins;"}}else{"nonDefBarre;"+ + if(sign(fp(10^(-10)+Z[0]))==1){"plus;"}else{"moins;"} }}+if(TestS==0){"valBarre(btex$ $ etex);"+ if(sign(fp(10^(-10)+Z[0]))==1){"plus;"}else{"moins;"}}else{" "}; + + + + + +if(nz>2){rr:=1; if(nz==NL){for(r:=1; r<=NL-2;r++){ TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + ksp:=evalf(fp(Z[r]+0.01))>0; + TestL:=(abs(LL[r])==abs(LL[r+1])); + lsp:=lsp+if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(ksp==1){"plus;"}else{"moins;"}+if(TestS==0){"valBarre(btex $ $ etex);"}else{" "}+if(TestS==0){if(ksp==1){"plus;"}else{"moins;"}}else{" "}; + }} +else{for(r:=1; r<=NL-2;r++){kspp:=evalf(fp(Z[rr]+0.01))>0;TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + TestL:=(abs(LL[r])==abs(LL[r+1])); + if(TestS==0){if( TestL==1 ){lsp:=lsp}else{lsp:=lsp+if(member(Z[rr],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(kspp==1){"plus;"}else{"moins;"}+"valBarre(btex $ $ etex);"+if(kspp==1){"plus;"}else{"moins;"};rr:=rr+1;} + } else{lsp:=lsp+if(member(Z[rr],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(kspp==1){"plus;"}else{"moins;"};rr:=rr+1;} +}} + }; + + + +lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre;"} +lm0:=limite(f(x),x=Z[0],1)==-infinity; + +TestS:=(sign(evalf(LL[0]-ao))==sign(evalf(LL[1]-ao))) or (sign(evalf(LL[0]-ao))==0.0) or (sign(evalf(LL[1]-ao))==0.0); + + li:=" +newLigneVariations(btex $\\hbox{\\bf Variations de }\\atop{\\displaystyle \\Mathbold{"+nom+"}}$ etex); +"+ if(member(Z[0],F)==0){"valPos(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"} + else{"nonDefBarre;limDroite(btex $"+if(lm0==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[0],1)))}+"$ etex,"}+ + if(k0==1){"1);"}else{"0);"}+if(TestS==0){"valPos(btex $ "+ao+" $ etex,0.5);"}else{" "}; + + + if(nz>2){if(nz==NL){for(r:=1; r<=nz-2;r++){TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + krm:=evalf(limite(f(x),x=Z[r-1],1))< evalf(limite(f(x),x=Z[r],-1)); + krp:=evalf(limite(f(x),x=Z[r],1))> evalf(limite(f(x),x=Z[r+1],-1)) ; + lmrm:=limite(f(x),x=Z[r],-1)==-infinity;lmrp:=limite(f(x),x=Z[r],1)==-infinity; + lp:=lp+if(member(Z[r],F)) { + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[r])))+"$ + etex,"+if(sign(evalf(fp(Z[r]-0.01)))==sign(fp(Z[r]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0);"}}}+if(TestS==0){"valPos(btex + $ "+ao+" $ etex,0.5);" + }else{" "}; +};//for +}else{rr:=1;for(r:=1; r<=NL-2;r++){TestS:=(sign(evalf(LL[r]-ao))==sign(evalf(LL[r+1]-ao))) or (sign(evalf(LL[r]-ao))==0.0)or (sign(evalf(LL[r+1]-ao))==0.0); + krm:=evalf(limite(f(x),x=Z[rr-1],1))< evalf(limite(f(x),x=Z[rr],-1)); + krp:=evalf(limite(f(x),x=Z[rr],1))> evalf(limite(f(x),x=Z[rr+1],-1)) ; + lmrm:=limite(f(x),x=Z[rr],-1)==-infinity;lmrp:=limite(f(x),x=Z[rr],1)==-infinity; TestL:=(abs(LL[r])==abs(LL[r+1])); +if(TestS==0){if( TestL==1 ){lp:=lp}else{ lp:=lp+if(member(Z[rr],F)) { + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[rr])))+"$ + etex,"+if(sign(evalf(fp(Z[rr]-0.01)))==sign(fp(Z[rr]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0);"}}}+"valPos(btex + $ "+ao+" $ etex,0.5); + ";rr:=rr+1; +}// else testL==1 +}//testS==0 +else{lp:=lp+if(member(Z[rr],F)){ + "limGauche(btex $"+if(lmrm==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],-1)))}+"$ etex,"+if(krm==1){"1);"}else{"0);"}+"nonDefBarre;limDroite(btex $"+if(lmrp==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[rr],1)))}+"$ etex,"+if(krp==1){"1);"}else{"0);"}} + else{"valPos(btex $"+latex(simplifier(f(Z[rr])))+"$ + etex,"+if(sign(evalf(fp(Z[rr]-0.01)))==sign(fp(Z[rr]+0.01))){"0.5);"}else{if(krp==1){"1);"}else{"0); + "}}};rr:=rr+1; +}//else testS==0 +}//for nz<NL +}// else nz<NL +//if nz=NL +};//if nz>2 + + +lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; + lf:=if(member(Z[nz-1],F)==0){"valPos(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}else{"nonDefBarre;limGauche(btex $"+if(lnz==1){"-\\infty"}else{latex(simplifier(limite(f(x),x=Z[nz-1],-1)))}+"$ etex,"}+ + if(kz==1){"1);"}else{"0);"}; + + + +intro:=" +input tableauVariation; +verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +"; + + +MetaL:= if(ftt==2){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; +end";}else{ +intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; +end"; +} +}else{ +if(ftt==0){if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +end";}}else{ +if(nz>2){intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; +end";}else{intro+"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; +end";} +}}; + + +MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+nmr+")"+ + l0+lsi+lsp+lsf+" +endTableau; + +";}else{ +"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+" +endTableau; + +"; +} +}else{ +if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ + l0+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +li+ +lf ++" +endTableau; +";}}else{ +if(nz>2){"beginTableau("+nmr+")"+ + l0+ +lsi+lsp+lsf+ +li+ +lp+ +lf ++" +endTableau; + +";}else{"beginTableau("+nmr+")"+ + l0+ +lsi+lsf+ +li+ +lf ++" +endTableau; + +";} +}}; + + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + +return(MetaL); + }:; + + + +\end{VerbatimOut} + + + + + + + + + + + + + +%% +%% Code giac/Xcas pour les Tableaux de signes de produits +%% + + + + +\begin{VerbatimOut}{XcasTabSignL.cxx} + + +TS(L,D,nmr):={ +L:=apply(f->unapply(f,x),L) +n:=size(L); +Z:=NULL; + +mini:=D[0]; maxi:=D[1]; + +pour k de 0 jusque n-1 faire + S:=resoudre(L[k](x),x); + si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + if(S[j]>mini and S[j]<maxi){Z:=Z,simplifier(S[j]);} + fpour; + fsi; +fpour; +Z:=sort(Z); +nz:=size(Z); +if(nz>2){pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=Z[0..u-1],Z[u+1..nz-1];nz:=nz-1; + fsi; +fpour;}; +nz:=size(Z); + +if(nz==0){li:="";l0:="val(btex $"+latex(D[0])+"$ etex);val(btex $"+latex(D[1])+"$ etex);"; + for(p:=0;p<=n-1;p++){li:=li+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(L[p](x))+"}}$ etex);"+ +if(mini!=-infinity and L[p](mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ +if(L[p]((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}+if(maxi!=+infinity and L[p](maxi)==0){" + valBarre(btex 0 etex);"}else{" + "} + +} + lf:=if(product(L[s]((mini+maxi)*.5),s,0,n-1)>0){"plus;"}else{"moins;"}; + +MetaL:=" input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+li+ + " + newLigneSignes(btex $\\hbox{\\bf Signe du }\\atop{{\\bf produit}}$ etex);"+ + if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+ lf+ + if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+" +endTableau; +end" +; + + +MetaLfc:=" beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+li+ + " + newLigneSignes(btex $\\hbox{\\bf Signe du }\\atop{{\\bf produit}}$ etex);"+ + if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+ lf+ + if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+" +endTableau; +" +; + +}else{ + +l0:="val(btex $"+latex(D[0])+"$ etex);";li:=" ";lr:=" "; +pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+latex(Z[m])+"$ etex); +";fpour; +l0:=l0+"val(btex $"+latex(D[1])+"$ etex);"; + + +for(p:=0;p<=n-1;p++){lp:=""; + li:=li+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(L[p](x))+"}}$ etex);"+ + if(mini!=-infinity and L[p](mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ + if(L[p](Z[0]-0.01)>0){"plus;"}else{"moins;"}; + + for(r:=0; r<=nz-2;r++){ + lp:=lp+if(simplifier(L[p](Z[r]))==0){" + valBarre(btex 0 etex);"}else{"barre; + "}+ + if(L[p]((Z[r]+Z[r+1])*.5)>0){"plus;"}else{"moins;"}}; + + li:=li+lp+ if(simplifier(L[p](Z[nz-1]))==0){"valBarre(btex 0 etex);"}else{"barre;"}+ + if(L[p](Z[nz-1]+1.0)>0){"plus;"}else{"moins; + "}+if(maxi!=+infinity and L[p](maxi)==0){" + valBarre(btex 0 etex);"}else{" + "} + }; + + +pour t de 0 jusque nz-2 faire + lr:=lr+if(product(L[s]((Z[t]+Z[t+1])*.5),s,0,n-1)>0){"plus;"}else{"moins;"}+"valBarre(btex 0 etex);" + fpour + +MetaL:=" input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+ + li + + + " + newLigneSignes(btex $\\hbox{\\bf Signe du }\\atop{{\\bf produit}}$ etex);"+ + if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+ + if(product(L[s](Z[0]-0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+"valBarre(btex 0 etex);"+ + lr+ + if(product(L[s](Z[nz-1]+0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+" +endTableau; +end" +; +MetaLfc:=" beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+ + li + + + " + newLigneSignes(btex $\\hbox{\\bf Signe du }\\atop{{\\bf produit}}$ etex);"+ + if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+ + if(product(L[s](Z[0]-0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+"valBarre(btex 0 etex);"+ + lr+ + if(product(L[s](Z[nz-1]+0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}+" +endTableau; + + "; +} +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); +return(MetaL); + }:; + +\end{VerbatimOut} + + + + +%% +%% Code giac/Xcas pour les Tableaux de signes de quotients +%% + + + +\begin{VerbatimOut}{XcasTabSignQ.cxx} +TSq(nomf,L,Fo,D,nmr):={ +L:=apply(f->unapply(f,x),L); +Fo:=apply(f->unapply(f,x),Fo); +L:=concat(L,Fo); +n:=size(L); +Z:=NULL; +m:=size(Fo); +F:=NULL;FF:=NULL; +mini:=D[0]; maxi:=D[1]; + + +pour k de 0 jusque n-1 faire + S:=resoudre(L[k](x),x); + si size(S)>0 alors pour j de 0 jusque size(S)-1 faire + if(S[j]>mini and S[j]<maxi){Z:=Z,simplifier(S[j]);} + fpour; + fsi; +fpour; + + +pour k de 0 jusque m-1 faire + SF:=resoudre(Fo[k](x),x); + si size(SF)>0 alors pour j de 0 jusque size(SF)-1 faire + FF:=FF,simplifier(SF[j]); + if(SF[j]>mini and SF[j]<maxi){F:=F,simplifier(SF[j]);} + fpour; + fsi; +fpour; + + + +Z:=sort(Z); // on classe les zéros dans l'ordre croissant +nz:=size(Z); +if(nz>2){pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=Z[0..u-1],Z[u+1..nz-1];nz:=nz-1; // pour les zéros en double + fsi; +fpour;} + + +Z:=sort(Z); +nz:=size(Z); +if(nz>2){pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=Z[0..u-1],Z[u+1..nz-1];nz:=nz-1; + fsi; +fpour;}; +nz:=size(Z); + +if(nz==0){li:="";l0:="val(btex $"+latex(D[0])+"$ etex);val(btex $"+latex(D[1])+"$ etex);"; + for(p:=0;p<=n-1;p++){li:=li+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(L[p](x))+"}}$ etex);"+ +if(mini!=-infinity and L[p](mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ +if(L[p]((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}+if(maxi!=+infinity and L[p](maxi)==0){" + valBarre(btex 0 etex);"}else{" + "} + +} + lf:=if(product(L[s]((mini+maxi)*.5),s,0,n-1)>0){"plus;"}else{"moins;"}; + +MetaL:=" input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+li+ + " + newLigneSignes(btex $\\hbox{\\bf Signe }\\atop{{\\bf de "+nomf+"(x)}}$ etex);"+ + if(member(mini,FF)==0){if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+ lf+ + if(member(maxi,FF)==0){if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+" +endTableau; +end" +; + + + + +MetaLfc:=" +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+li+ + " + newLigneSignes(btex $\\hbox{\\bf Signe }\\atop{{\\bf de "+nomf+"(x)}}$ etex);"+ + if(member(mini,FF)==0){if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+ lf+ + if(member(maxi,FF)==0){if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+" +endTableau; + +" +; + + + + +}else{ + + +l0:="val(btex $"+latex(D[0])+"$ etex);";li:=" ";lr:=" "; +pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+latex(Z[m])+"$ etex); +";fpour; +l0:=l0+"val(btex $"+latex(D[1])+"$ etex);"; + + +for(p:=0;p<=n-1;p++){lp:=""; + li:=li+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(L[p](x))+"}}$ etex);"+ + if(mini!=-infinity and L[p](mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ + if(L[p](Z[0]-0.01)>0){"plus;"}else{"moins;"}; + + for(r:=0; r<=nz-2;r++){ + lp:=lp+if(simplifier(L[p](Z[r]))==0){" + valBarre(btex 0 etex);"}else{"barre; + "}+ + if(L[p]((Z[r]+Z[r+1])*.5)>0){"plus;"}else{"moins;"}}; + + li:=li+lp+ if(simplifier(L[p](Z[nz-1]))==0){"valBarre(btex 0 etex);"}else{"barre;"}+ + if(L[p](Z[nz-1]+1.0)>0){"plus;"}else{"moins; + "}+if(maxi!=+infinity and L[p](maxi)==0){" + valBarre(btex 0 etex);"}else{" "} + + }; + + +pour t de 0 jusque nz-2 faire + lr:=lr+if(product(L[s]((Z[t]+Z[t+1])*.5),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(member(Z[t+1],FF)==0){"valBarre(btex 0 etex);"}else{ "nonDefBarre;"} + fpour + +MetaL:=" input tableauVariation; +verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+ + li + + + " + newLigneSignes(btex $\\hbox{\\bf Signe de}\\atop{{\\bf "+nomf+"(x)}}$ etex);"+ + if(member(mini,FF)==0){if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+ + if(product(L[s](Z[0]-0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(member(Z[0],FF)==0){"valBarre(btex 0 etex);"}else{ "nonDefBarre;"}+ + lr+ + if(product(L[s](Z[nz-1]+0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(member(maxi,FF)==0){if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" "}}else{"nonDefBarre;"}+" +endTableau; +end" +; + + + + +MetaLfc:=" +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+ + li + + + " + newLigneSignes(btex $\\hbox{\\bf Signe de}\\atop{{\\bf "+nomf+"(x)}}$ etex);"+ + if(member(mini,FF)==0){if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" + "}}else{"nonDefBarre;"}+ + if(product(L[s](Z[0]-0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(member(Z[0],FF)==0){"valBarre(btex 0 etex);"}else{ "nonDefBarre;"}+ + lr+ + if(product(L[s](Z[nz-1]+0.01),s,0,n-1)>0){"plus;"}else{"moins;"}+ + if(member(maxi,FF)==0){if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" + valBarre(btex 0 etex);"}else{" "}}else{"nonDefBarre;"}+" +endTableau; + +" + + +} + + + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + + + + +return(MetaL); + }:; + +\end{VerbatimOut} + + + + +%% Code giac/Xcas pour les Tableaux de signes du produit +%% de 2 facteurs affines +%% + + + + +\begin{VerbatimOut}{XcasTabSign.cxx} +TSa(a,b,c,d,nmr):={ +zA:=resoudre(a*x+b=0,x)[0]; +zB:=resoudre(c*x+d=0,x)[0]; +zmin:=min(zA,zB); +zmax:=max(zA,zB); + Meta:= " input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; + beginTableau("+nmr+") + newLigneVariables(btex $\\Mathbold{x}$ etex); + val(btex $-\\infty$ etex);val(btex $"+latex(zmin)+"$ etex); +val(btex $"+latex(zmax)+"$etex); +val(btex $+\\infty$ etex); + newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+if(a==1){"x+"}else{if(a==-1){"-x+"}else{a+"x+"}}+b+"}}$ etex);" + + if(a>0){"moins;"}else{"plus;"}+ + if(zmin==zA){"valBarre(btex 0 etex);"}else{"barre;"}+ + if(zmin==zA){si a>0 alors "plus;"; sinon "moins;";fsi} + else{si a>0 alors "moins;"; sinon "plus;"; fsi}+ + if(zmin==zA){"barre;"}else{"valBarre(btex 0 etex);"}+ + if(a>0){"plus;"}else{"moins;"} + +" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+if(c==1){"x+"}else{if(c==-1){"-x+"}else{c+"x+"}}+d+"}}$ etex);" + + if(c>0){"moins"}else{"plus"}+";"+ + if(zmin==zB){"valBarre(btex 0 etex);"}else{"barre;"}+ + if(zmin==zB){si c>0 alors "plus;"; sinon "moins;";fsi} + else{si c>0 alors "moins;"; sinon "plus;"; fsi}+ + if(zmin==zB){"barre;"}else{"valBarre(btex 0 etex);"}+ + if(c>0){"plus;"}else{"moins;"} + + +" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{("+if(a==1){"x+"}else{if(a==-1){"-x+"}else{a+"x+"}}+b+")("+if(c==1){"x+"}else{if(c==-1){"-x+"}else{c+"x+"}}+d+")}}$ etex);" + + si a*c>0 alors plus; sinon moins;fsi+";"+ + "valBarre(btex 0 etex);"+ + si a*c>0 alors moins; sinon plus;fsi+";"+ + "valBarre(btex 0 etex);"+ + si a*c>0 alors plus; sinon moins;fsi+";"+" +endTableau; +end" +; +return(Meta); + }:; +\end{VerbatimOut} + + + + + + +%% +%% Code giac/Xcas pour les Tableaux de Signes d'expression ne contenant +%% qu'un seul terme + + + + +\begin{VerbatimOut}{XcasTSc.cxx} +TSc(g,D,nmr):={ +f:=unapply(g,x); +Z:=NULL; +mini:=D[0]; maxi:=D[1];lm:=" "; +S:=resoudre(f(x),x); +if(size(S)==0){ +l0:="val(btex $"+latex(D[0])+"$ etex);val(btex $"+latex(D[1])+"$ etex);"; +li:=if(mini!=-infinity and f(mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ +if(mini!=-infinity or maxi!=+infinity){if(f((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}}else{if(f(0)>0){"plus;"}else{"moins;"}}; +lf:=if(maxi!=+infinity and f(maxi)==0){" + valBarre(btex 0 etex);"}else{" + "}; +} +else{pour j de 0 jusque size(S)-1 faire + if(S[j]>mini and S[j]<maxi){Z:=Z,simplifier(S[j])}; + fpour; + + +Z:=sort(Z); +nz:=size(Z); +if(nz>2){pour u de 1 jusque nz-2 faire + si Z[u]==Z[u+1] alors Z:=Z[0..u-1],Z[u+1..nz-1];nz:=nz-1; + fsi; +fpour;} + + +nz:=size(Z); +l0:=" ";li:=" ";lr:=" "; +if(nz==0){l0:="val(btex $"+latex(D[0])+"$ etex);val(btex $"+latex(D[1])+"$ etex);"; +li:=if(mini!=-infinity and f(mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ +if(f((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}; +lf:=if(maxi!=+infinity and f(maxi)==0){" + valBarre(btex 0 etex);"}else{" + "}; + +}else{ +l0:="val(btex $"+latex(D[0])+"$ etex);";li:=" "; +pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+latex(Z[m])+"$ etex); +"; +fpour; +l0:=l0+"val(btex $"+latex(D[1])+"$ etex);"; + +li:= if(mini!=-infinity and f(mini)==0){" + valBarre(btex 0 etex);"}else{" + "}+ +if(f(Z[0]-0.01)>0){"plus;"}else{"moins;"}+"valBarre(btex 0 etex);"; + +lm:=if(nz>=2){for(r:=0; r<=nz-2;r++){lm:=lm+if(f((Z[r]+Z[r+1])*.5)>0){"plus;"}else{"moins;"}+ + "valBarre(btex 0 etex);" + }}else{" "}; + +lf:=if(f(Z[nz-1]+1.0)>0){"plus;"}else{"moins;"}+if(maxi!=+infinity and f(maxi)==0){"valBarre(btex 0 etex);"}else{" + "}; +}}; + + +MetaL:=" input tableauVariation; + verbatimtex +%&latex + \\documentclass{article} + \\usepackage[upright]{fourier} + \\usepackage{amsmath} + \\newcommand{\\Mathbold}[1]{\\mbox{\\boldmath$#1$\\unboldmath}} + \\begin{document} + etex; +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(f(x))+"}}$ etex);"+ + li+lm+lf + +" +endTableau; +end" +; + + +MetaLfc:=" + +beginTableau("+nmr+") +newLigneVariables(btex $\\Mathbold{x}$ etex); + "+l0+" +newLigneSignes(btex $\\hbox{\\bf Signe de }\\atop{\\displaystyle \\Mathbold{"+latex(f(x))+"}}$ etex);"+ + li+lm+lf + +" +endTableau; + +" +; + + + + +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); + + + + +return(MetaL); + }:; +\end{VerbatimOut} + + + + + + + +%% +%% +%% traitement des fichiers produits par giac/xcas +%% +%% + + + + + +\newcommand{\dresse}[1]{% +\ifthenelse{\boolean{xcas}}{% Avec l'option "XCas présent" + \executGiacmp{XCas#1.giac}% reconstituer le tableau + % exporter le source mp + % puis lancer metapost pour créer + % l'image du tableau + \immediate\write18{\cat XCasmpfc.mp >> \Tableaux.Tab.mp} + \immediate\write18{mpost -interaction=batchmode -jobname=\Tableaux.Tab XCasmp#1}}% + {% sinon, si le tableau est absent, alerte. + \IfFileExists{\Tableaux.Tab.\theTVn}{}{% + \PackageError{tablor}{Tableau absent non + reconstituable.}{Pour compiler il faut, soit les fichiers de + tableaux, soit le fichier \Tableaux.Tab.mp, soit disposer de + XCas.}}} + +\begin{center} + \includegraphics{\Tableaux.Tab.\theTVn} +\end{center} +\stepcounter{TVn}} + + +%% +%% traitement des fichiers produits par giac/xcas avec possibilité +%% de modifier le fichier metapost (environnement étoilé)) +%% + + + +\newcommand{\dressetoile}[1]{% +\IfFileExists{\Tableaux.Tab.\theTVn}{% Test sur l'existence du tableau +% Si oui, inclusion du fichier source de sauvegarde mp dans Tableaux +\immediate\write18{\cat TSav-\theTVn.mp >> \Tableaux.Tab.mp}} +% Si non, lancement des opérations de fabrication +{\executGiacmp{XCas#1.giac}% +\immediate\write18{\editeur XCasmpfc.mp} + + % Modification avec l'éditeur choisi + +\immediate\write18{\cp -f XCasmpfc.mp TSav-\theTVn.mp} % Sauvegarde du + % source mp sur le disque pour une + % inclusion ultérieure dans Tableaux.mp. +\immediate\write18{\cat XCasmpfc.mp >> \Tableaux.Tab.mp}} % Inclusion du + % source dans le + % fichier + % Tableaux + +\immediate\write18{mpost -interaction=batchmode \Tableaux.Tab}% Reconstitution des tableaux + % et création du dernier. L'option + % pallie l'absence de end en fin de + % fichier + +\begin{center} + \includegraphics{\Tableaux.Tab.\theTVn} +\end{center} + +\setcounter{TVn}{\theTVnbis} % Restauration du compteur TVn +} + + + + + + + +%% +%% +%%% +%%% +%%% les "giac" qui permettent d'exécuter la commande rentrée dans le fichier tex +%%% suivis des environnements qui permettront la saisie du code giac/xcas +%%% Les versions étoilées permettent de modifier le code metapost produit initialement +%%% + + + + +\begin{VerbatimOut}{XCas.giac} +maple_mode(0); +read("XcasTabSign.cxx"); +Sortie:=fopen("XCasmp.mp"); +vect.xcas.user := read("XCas.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TSa} +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCas.user}} +{\end{VerbatimOut} + \dresse{} +} + + + + + + + + + +\begin{VerbatimOut}{XCasQ.giac} +maple_mode(0); +read("XcasTabSignQ.cxx"); +Sortie:=fopen("XCasmpQ.mp"); +vect.xcas.user := read("XCasQ.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TSq}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasQ.user}} +{\end{VerbatimOut}\dresse{Q}} + + + +\newenvironment{TSq*}[1]% +{\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasQ.user}} +{\end{VerbatimOut}\dressetoile{Q}} + + +\begin{VerbatimOut}{XCasL.giac} +maple_mode(0); +read("XcasTabSignL.cxx"); +Sortie:=fopen("XCasmpL.mp"); +vect.xcas.user := read("XCasL.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TS}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasL.user}} +{\end{VerbatimOut}\dresse{L}} + + +\newenvironment{TS*}[1] +{\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasL.user}} +{\end{VerbatimOut}\dressetoile{L}} + + +\begin{VerbatimOut}{XCasTSc.giac} +maple_mode(0); +read("XcasTSc.cxx"); +Sortie:=fopen("XCasmpTSc.mp"); +vect.xcas.user := read("XCasTSc.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + + + + +\newenvironment{TSc*}[1]% +{\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTSc.user}} +{\end{VerbatimOut}\dressetoile{TSc}} + + +\newenvironment{TSc}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTSc.user}} +{\end{VerbatimOut}\dresse{TSc}} + + +\begin{VerbatimOut}{XCasTV.giac} +maple_mode(0); +read("XcasTV.cxx"); +Sortie:=fopen("XCasmpTV.mp"); +vect.xcas.user := read("XCasTV.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TV}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTV.user}}% +{\end{VerbatimOut} +\dresse{TV}} + +\newenvironment{TV*}[1]{% +\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTV.user}}% +{\end{VerbatimOut}\dressetoile{TV}} + + + + + + + +\begin{VerbatimOut}{XCasTVapp.giac} +maple_mode(0); +read("XcasTVapp.cxx"); +Sortie:=fopen("XCasmpTVapp.mp"); +vect.xcas.user := read("XCasTVapp.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TVapp}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVapp.user}}% +{\end{VerbatimOut} +\dresse{TVapp}} + +\newenvironment{TVapp*}[1]{% +\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVapp.user}}% +{\end{VerbatimOut}\dressetoile{TVapp}} + + + + + + + + + + + +\begin{VerbatimOut}{XCasTVI.giac} +maple_mode(0); +read("XcasTVI.cxx"); +Sortie:=fopen("XCasmpTVI.mp"); +vect.xcas.user := read("XCasTVI.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TVI}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVI.user}}% +{\end{VerbatimOut}\dresse{TVI}} + + +\newenvironment{TVI*}[1]% +{\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVI.user}}% +{\end{VerbatimOut}\dressetoile{TVI}} + + + + + + +\begin{VerbatimOut}{XCasTVIapp.giac} +maple_mode(0); +read("XcasTVIapp.cxx"); +Sortie:=fopen("XCasmpTVIapp.mp"); +vect.xcas.user := read("XCasTVIapp.user"); +vxo := vect.xcas.user; +dim.vxo := dim(vxo); +nbr.line.vxo := dim.vxo; +Resultat:=cat(" "); +rslt := vxo[0]; RslT:=cat(rslt); +Resultat:=cat(Resultat,RslT); +fprint(Sortie,Unquoted,Resultat); +fclose(Sortie); +\end{VerbatimOut} + +\newenvironment{TVIapp}% +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVIapp.user}}% +{\end{VerbatimOut}\dresse{TVIapp}} + + +\newenvironment{TVIapp*}[1]% +{\setcounter{TVnbis}{\theTVn} +\setcounter{TVn}{#1} +\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\\#\~]{XCasTVIapp.user}}% +{\end{VerbatimOut}\dressetoile{TVIapp}} + + + + + + + +%% +%% Zi end -> enjoy :) |