From ee04826f2a1926c73ffd7432e78fc88228a4356b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 19 May 2008 00:11:25 +0000 Subject: tablor update (18may08) git-svn-id: svn://tug.org/texlive/trunk@8218 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/tablor/auto/tablor.el | 36 ++ Master/texmf-dist/doc/latex/tablor/tablor.html | 654 +++++++++++----------- 2 files changed, 367 insertions(+), 323 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/tablor/auto/tablor.el (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/latex/tablor/auto/tablor.el b/Master/texmf-dist/doc/latex/tablor/auto/tablor.el new file mode 100644 index 00000000000..470756ad0ad --- /dev/null +++ b/Master/texmf-dist/doc/latex/tablor/auto/tablor.el @@ -0,0 +1,36 @@ +(TeX-add-style-hook "tablor" + (lambda () + (LaTeX-add-environments + "TSa" + "TSq" + "TS" + "TSc" + "TV" + "TVZ" + "TVapp" + "TVI" + "TVIapp") + (TeX-add-symbols + '("initablor" ["argument"] 0) + '("nettoyer" ["argument"] 0) + '("dressetoile" 1) + '("dresse" 1) + '("executGiacmp" 1) + "rem" + "cat" + "cp" + "Tableaux" + "tv" + "tvbis") + (TeX-run-style-hooks + "ifpdf" + "fancyvrb" + "ifthen" + "amsmath" + "fourier" + "upright" + "latex2e" + "art10" + "article" + "filecontents"))) + diff --git a/Master/texmf-dist/doc/latex/tablor/tablor.html b/Master/texmf-dist/doc/latex/tablor/tablor.html index 4ab2e40bfe3..43dc9a2dec2 100644 --- a/Master/texmf-dist/doc/latex/tablor/tablor.html +++ b/Master/texmf-dist/doc/latex/tablor/tablor.html @@ -89,11 +89,19 @@ \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{tablor}[16/05/2008 v2.06 la machine à créer des tableaux de signes et variations] -% \copyleft Connan le Barbare \copyright -% avec l'efficace participation de Jean-Michel Boucart + +% \copyleft Connan le Barbare (aka Guillaume Connan) \copyright +% This work may be distributed and/or mofified under the conditions +% or the LaTeX Project Public Licence, either v1.3 or (at your option) +% any later version. The latest version is in +% http://www.latex-project.org/lppl/ +% This work consists of the files tablor.sty, tablor.cfg, tablor.tex, +% tablor.pdf and tablor.html + + %%%%% % % enteteMP.cfg : configuration de l'entête MetaPOST @@ -198,9 +206,9 @@ etex %% ne l'avez pas de base -\RequirePackage{ifthen} -\RequirePackage{fancyvrb} -\RequirePackage{ifpdf} +\RequirePackage{ifthen} +\RequirePackage{fancyvrb} +\RequirePackage{ifpdf} @@ -220,26 +228,26 @@ etex % option xcas présent -\newboolean{xcas}\setboolean{xcas}{false} -\DeclareOption{xcas}{\setboolean{xcas}{true}} +\newboolean{xcas}\setboolean{xcas}{false} +\DeclareOption{xcas}{\setboolean{xcas}{true}} -%% on configure tablor dans un fichier extérieur pour la plateforme +%% 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}} +\IfFileExists{tablor.cfg}{\input{tablor.cfg}}%\typeout{pas de fichier tablor.cfg}} \ProcessOptions\relax -%% pour ceux compilant via pdflatex +%% pour ceux compilant via pdflatex \ifpdf -\DeclareGraphicsRule{*}{mps}{*}{} +\DeclareGraphicsRule{*}{mps}{*}{} \fi %% pour nettoyer les fichiers auxiliaires -\AtEndDocument{\immediate\write18{\rem tete.* *.user XCas* Xcas* *.mpx}} +\AtEndDocument{\immediate\write18{\rem tete.* *.user XCas* Xcas* *.mpx}} @@ -247,9 +255,9 @@ etex %% Pour clore les fichiers metapost -\begin{VerbatimOut}{queue.mp} +\begin{VerbatimOut}{queue.mp} -end +end \end{VerbatimOut} @@ -263,7 +271,7 @@ etex \newcommand{\nettoyer}[1][\jobname]% {\immediate\write18{\rem #1.Tab.log} -\immediate\write18{echo end >> #1.Tab.mp} +\immediate\write18{echo end >> #1.Tab.mp} } @@ -295,7 +303,7 @@ etex {\IfFileExists{\Tableaux.Tab.mp}% Si Tableaux.mp est présent... {\immediate\write18{\rem \Tableaux.Tab.mp}}% le détruire {}% - \immediate\write18{\cp -f enteteMP.cfg \Tableaux.Tab.mp}% Reconstituer l'entête de Tableaux.mp + \immediate\write18{\cp -f enteteMP.cfg \Tableaux.Tab.mp}% Reconstituer l'entête de Tableaux.mp } {\IfFileExists{\Tableaux.Tab.mp}% Sans l'option XCas, si % Tableaux.mp existe @@ -307,11 +315,11 @@ etex -%% commande pour lancer giac selon l'OS +%% commande pour lancer giac selon l'OS \makeatletter \newcommand{\executGiacmp}[1]{% -\ifthenelse{\boolean{windows}}% +\ifthenelse{\boolean{windows}}% {\immediate\write18{giac #1 }}% {\immediate\write18{giac <#1 }}} \makeatother @@ -321,7 +329,7 @@ etex %%% % -%%% LES SCRIPTS GIAC/XCAS +%%% LES SCRIPTS GIAC/XCAS % %%% @@ -343,8 +351,8 @@ 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; + fpour + fsi; Z:=sort(Z); nz:=size(Z); @@ -356,16 +364,16 @@ pour u de 1 jusque nz-2 faire 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); +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);"+ +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(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;"} }} @@ -374,13 +382,13 @@ if(nz>2){ for(r:=1; r<=nz-2;r++){ ksp:=evalf(fp(Z[r]+0.01))>0; if(ksp==1){"plus;"}else{"moins;"} }; } -lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; +lsf:=if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; "} lm0:=limite(f(x),x=Z[0],1)==-infinity; li:=" -newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+nom+"}}$ etex);"+ +newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+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,"}+ + 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"}+ ");"; @@ -396,9 +404,9 @@ lm0:=limite(f(x),x=Z[0],1)==-infinity; "}}} }; } -lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; +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); + if(kz==1){"1);"}else{"0); "}; @@ -406,42 +414,42 @@ MetaLfc:=if(ftt==2){if(nz>2){" beginTableau("+nmr+")"+ l0+lsi+lsp+lsf+" -endTableau; +endTableau; ";}else{ intro+"beginTableau("+nmr+")"+ l0+ lsi+lsf+" -endTableau; +endTableau; "; } }else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ l0+ li+ -lp+ +lp+ lf +" -endTableau; +endTableau; -";}else{"beginTableau("+nmr+")"+ +";}else{"beginTableau("+nmr+")"+ l0+ li+ lf +" -endTableau; +endTableau; ";}}else{ if(nz>2){"beginTableau("+nmr+")"+ l0+ lsi+lsp+lsf+ li+ -lp+ +lp+ lf +" endTableau; -";}else{"beginTableau("+nmr+")"+ +";}else{"beginTableau("+nmr+")"+ l0+ lsi+lsf+ li+ @@ -454,7 +462,7 @@ lf sortie:=fopen("XCasmpfc.mp"); -fprint(sortie,Unquoted,MetaLfc); +fprint(sortie,Unquoted,MetaLfc); fclose(sortie); @@ -469,12 +477,12 @@ fclose(sortie); %% par exemple, pour sqrt(x^2-1) : TVZ([-infinity,100],[],[[-1,1]],"f","x",sqrt(x^2-1),1,1) %% -\begin{VerbatimOut}{XcasTVZ.cxx} +\begin{VerbatimOut}{XcasTVZ.cxx} TVZ(L,F,FF,nom,nomv,f,ftt,nmr):={ nl:=size(L); -nf:=size(FF); +nf:=size(FF); Ff:=NULL;IMIN:=NULL;IMAX:=NULL; for(k:=0;k<nf;k++){ if(FF[k][0]>L[0]){Imin[k]:=FF[k][0];LL:=L}else{Imin[k]:=L[0];LL:=[L[1]]}; @@ -483,11 +491,11 @@ if(FF[k][1]<L[1]){Imax[k]:=FF[k][1];LL:=L}else{Imax[k]:=L[1];LL:=[L[0]]}; IMIN:=IMIN,Imin[k]; IMAX:=IMAX,Imax[k]; } - FF:=[Ff]; + FF:=[Ff]; IMIN:=[IMIN]; IMAX:=[IMAX]; f:=unapply(f,x); -fp:=fonction_derivee(f); +fp:=fonction_derivee(f); Z:=concat(LL,F); for(k:=0;k<nf;k++){ @@ -498,29 +506,29 @@ S:=resoudre(fp(x),x); si size(S)>0 alors pour j de 0 jusque size(S)-1 faire for(k:=0;k<nf;k++){ kk:=(evalf(S[j])>=evalf(L[0])) and (evalf(S[j])<=evalf(L[nl-1])); - kK:=(evalf(S[j])<evalf(Imin[k])) or (evalf(S[j])>evalf(Imax[k])); + kK:=(evalf(S[j])<evalf(Imin[k])) or (evalf(S[j])>evalf(Imax[k])); Kk:=(kk) and kK; if(Kk==1){Z:=append(Z,simplifier(S[j]))}; } fpour - fsi; + fsi; Z:=sort(Z); nz:=size(Z); - si Z[0]==Z[1] alors Z:=augment(Z[0],Z[2..nz-1]);nz:=nz-1; + 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); +nz:=size(Z); for(j:=0;j<nf;j++){ for(k:=1;k<nz;k++){ - if ((Z[k]>Imin[j])and(Z[k]<Imax[j])){Z:=augment(Z[0..k-1],Z[k+1..nz-1]);nz:=nz-1; + if ((Z[k]>Imin[j])and(Z[k]<Imax[j])){Z:=augment(Z[0..k-1],Z[k+1..nz-1]);nz:=nz-1; } } } @@ -528,12 +536,12 @@ 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; +";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:=" +lsi:=" newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle "+nom+"'("+nomv+")}$ etex);"+ if(member(Z[0],IMIN)!=0){"debutNonDef;"}else{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{" "}+ @@ -543,22 +551,22 @@ if(member(Z[0],IMIN)!=0){"debutNonDef;"}else{if(Z[0]==-infinity){if(sign(evalf(f if(nz>2){ for(r:=1; r<=nz-2;r++){ ksp:=evalf(fp(Z[r]+0.01))>0; - lsp:=lsp+if(member(Z[r],IMIN)!=0){"debutNonDef;"}else{ + lsp:=lsp+if(member(Z[r],IMIN)!=0){"debutNonDef;"}else{ if(member(Z[r],IMAX)!=0){"finNonDef;"+ - if(ksp==1){"plus;"}else{"moins;"}}else{ - if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ + if(ksp==1){"plus;"}else{"moins;"}}else{ + if(member(Z[r],F)==0){"valBarre(btex 0 etex);"}else{"nonDefBarre;"}+ if(ksp==1){"plus;"}else{"moins;"} }}}}; -lsf:=if(member(Z[0],IMAX)!=0){"finNonDef;"}else{if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; +lsf:=if(member(Z[0],IMAX)!=0){"finNonDef;"}else{if(member(Z[nz-1],F)==0){""}else{"nomDefBarre; "}} -lm0:=limite(f(x),x=Z[0],1)==-infinity; +lm0:=limite(f(x),x=Z[0],1)==-infinity; li:=" -newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+nom+"}}$ etex);"+ +newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+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"}+ @@ -568,79 +576,79 @@ 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; + lmrm:=limite(f(x),x=Z[r],-1)==-infinity;lmrp:=limite(f(x),x=Z[r],1)==-infinity; lp:=lp+if(member(Z[r],IMIN)!=0){"limGauche(btex $"+if(lmrm==1){ "-\\infty"}else{ latex(simplifier(limite(f(x),x=Z[r],-1)))} +"$ etex,"+if(krm==1){ "1);"}else{"0);"} - +"debutNonDef;" - }//fsi Zr=Imin + +"debutNonDef;" + }//fsi Zr=Imin else{ if (member(Z[r],IMAX)!=0) {"finNonDef;limDroite(btex $"+if(lmrp==1){ "-\\infty"}else{latex(simplifier(limite(f(x),x=Z[r],1)))} +"$ etex,"+if(krp==1){ - "1);"}else{"0);"} + "1);"}else{"0);"} } else { 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){ + +"$ 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);"} + "1);"}else{"0);"} }//fsi (member Zr F) 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);"}//felse(krp) - }//felse(valpos) + "1);"}else{"0);"}//felse(krp) + }//felse(valpos) }//felse(member Zr F) } //felse(Zr=Imax) }//felse(Zr=Imin) };//ffor - }//fsi nz + }//fsi nz -lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; +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); + if(kz==1){"1);"}else{"0); "}; MetaLfc:=if(ftt==2){if(nz>2){" -beginTableau("+nmr+")"+ +beginTableau("+nmr+")"+ l0+lsi+lsp+lsf+" -endTableau; +endTableau; ";}else{ -intro+"beginTableau("+nmr+")"+ +intro+"beginTableau("+nmr+")"+ l0+ -lsi+lsf+" -endTableau; +lsi+lsf+" +endTableau; "; } -}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ +}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ l0+ li+ -lp+ +lp+ lf +" -endTableau; +endTableau; -";}else{"beginTableau("+nmr+")"+ +";}else{"beginTableau("+nmr+")"+ l0+ li+ -lf +lf +" -endTableau; +endTableau; ";}}else{ if(nz>2){"beginTableau("+nmr+")"+ @@ -648,9 +656,9 @@ if(nz>2){"beginTableau("+nmr+")"+ lsi+lsp+lsf+ li+ lp+ -lf +lf +" -endTableau; +endTableau; ";}else{"beginTableau("+nmr+")"+ l0+ @@ -658,7 +666,7 @@ lsi+lsf+ li+ lf +" -endTableau; +endTableau; ";} }} @@ -682,7 +690,7 @@ fclose(sortie); -\begin{VerbatimOut}{XcasTVapp.cxx} +\begin{VerbatimOut}{XcasTVapp.cxx} @@ -699,14 +707,14 @@ 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[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; +fsi; S:=NULL; @@ -731,16 +739,16 @@ 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); +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);"+ +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(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;"} }} @@ -756,7 +764,7 @@ lm0:=limite(f(x),x=Z[0],1)==-infinity; newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+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(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)); @@ -771,7 +779,7 @@ newLigneVariations(btex $\\hbox{ Variations de }\ 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); + if(kz==1){"1);"}else{"0); "}; @@ -780,32 +788,32 @@ lnz:=limite(f(x),x=Z[nz-1],-1)==-infinity; MetaLfc:=if(ftt==2){if(nz>2){" -beginTableau("+nmr+")"+ +beginTableau("+nmr+")"+ l0+lsi+lsp+lsf+" endTableau; ";}else{ intro+"beginTableau("+nmr+")"+ l0+ -lsi+lsf+" +lsi+lsf+" endTableau; "; } -}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ +}else{ if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ l0+ li+ lp+ lf +" -endTableau; +endTableau; ";}else{"beginTableau("+nmr+")"+ l0+ li+ lf +" -endTableau; +endTableau; ";}}else{ if(nz>2){"beginTableau("+nmr+")"+ @@ -862,8 +870,8 @@ fclose(sortie); \begin{VerbatimOut}{XcasTVI.cxx} -TVI(L,F,nom,nomv,f,ftt,ao,nmr):={ -nl:=size(L); +TVI(L,F,nom,nomv,f,ftt,ao,nmr):={ +nl:=size(L); f:=unapply(f,x); fp:=fonction_derivee(f); Z:=concat(L,F); @@ -879,11 +887,11 @@ 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; + 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:=" "; +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; @@ -903,22 +911,22 @@ 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}} +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); +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);"+ +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(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(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{" "}; @@ -927,30 +935,30 @@ lsi:=" 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;"}+ + 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); +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;} + 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;} + 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; +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); +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{ Variations de }\\atop{\\displaystyle {"+nom+"}}$ etex); +newLigneVariations(btex $\\hbox{ Variations de }\\atop{\\displaystyle {"+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(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); @@ -966,12 +974,12 @@ newLigneVariations(btex $\\hbox{ Variations de }\ };//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)) ; + 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 + 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 @@ -979,7 +987,7 @@ if(TestS==0){if( TestL==1 ){lp:=lp}else{ lp:=lp+if(member(Z[rr],F)) { 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); + 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 @@ -990,20 +998,20 @@ else{lp:=lp+if(member(Z[rr],F)){ 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);"}; + if(kz==1){"1);"}else{"0);"}; MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+nmr+")"+ l0+lsi+lsp+lsf+" -endTableau; +endTableau; ";}else{ "beginTableau("+nmr+")"+ l0+ lsi+lsf+" -endTableau; +endTableau; "; } @@ -1011,12 +1019,12 @@ lsi+lsf+" if(ftt==0){if(nz>2){"beginTableau("+nmr+")"+ l0+ li+ -lp+ +lp+ lf +" endTableau; -";}else{"beginTableau("+nmr+")"+ +";}else{"beginTableau("+nmr+")"+ l0+ li+ lf @@ -1028,7 +1036,7 @@ if(nz>2){"beginTableau("+nmr+")"+ lsi+lsp+lsf+ li+ lp+ -lf +lf +" endTableau; @@ -1073,7 +1081,7 @@ fclose(sortie); \begin{VerbatimOut}{XcasTVIapp.cxx} -TVIapp(L,F,nom,nomv,f,ftt,ao,nmr):={ +TVIapp(L,F,nom,nomv,f,ftt,ao,nmr):={ nl:=size(L); @@ -1083,10 +1091,10 @@ 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{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]); + 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; @@ -1115,7 +1123,7 @@ Z:=[S]; nz:=size(Z); -l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; +l0:=" newLigneVariables(btex $"+nomv+"$ etex);";lp:=" "; lf:=" ";lsp:=" "; @@ -1126,116 +1134,116 @@ if(nz>2){ for(r:=1; r<=nz-2;r++){LP:=LP,if(member(Z[r],F)){limite(f(x),x,Z if(nz>2){ LL:=[LI,LP,LF]}else{LL:=[LI,LF]}; NL:=size(LL); -A:=NULL;aa:=1;kk:=0; +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);"}; +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); +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)); + kz:=evalf(limite(f(x),x=Z[nz-1],-1))> evalf(limite(f(x),x=Z[nz-2],1)); -lsi:=" +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(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(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); +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;"}+ + 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); +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;} + 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; +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); +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{ Variations de}\\atop{\\displaystyle {"+nom+"}}$ etex); +newLigneVariations(btex $\\hbox{ Variations de}\\atop{\\displaystyle {"+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{" "}; + 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); + 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; + 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);"}} + "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{" "}; + 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)) ; + 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);"}} + "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 + 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; + ";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{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; + "}}};rr:=rr+1; }//else testS==0 -}//for nz<NL -}// else nz<NL +}//for nz<NL +}// else nz<NL //if nz=NL -};//if nz>2 +};//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);"}; +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);"}; -MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+nmr+")"+ +MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+nmr+")"+ l0+lsi+lsp+lsf+" -endTableau; +endTableau; ";}else{ "beginTableau("+nmr+")"+ l0+ -lsi+lsf+" -endTableau; +lsi+lsf+" +endTableau; "; } @@ -1243,34 +1251,34 @@ MetaLfc:= if(ftt==2){if(nz>2){"beginTableau("+lp+ +lp+ lf +" -endTableau; +endTableau; -";}else{"beginTableau("+nmr+")"+ +";}else{"beginTableau("+nmr+")"+ l0+ li+ -lf +lf +" -endTableau; +endTableau; ";}}else{ if(nz>2){"beginTableau("+nmr+")"+ l0+ lsi+lsp+lsf+ li+ lp+ -lf +lf +" -endTableau; +endTableau; ";}else{"beginTableau("+nmr+")"+ l0+ -lsi+lsf+ +lsi+lsf+ li+ lf +" -endTableau; +endTableau; ";} }}; @@ -1278,8 +1286,8 @@ lf sortie:=fopen("XCasmpfc.mp"); -fprint(sortie,Unquoted,MetaLfc); -fclose(sortie); +fprint(sortie,Unquoted,MetaLfc); +fclose(sortie); }:; @@ -1307,13 +1315,13 @@ sortie:=fopen("XCasmpfc.mp"); -\begin{VerbatimOut}{XcasTabSignL.cxx} +\begin{VerbatimOut}{XcasTabSignL.cxx} TS(L,D,nmr):={ L:=apply(f->unapply(f,x),L) n:=size(L); -Z:=NULL; +Z:=NULL; mini:=D[0]; maxi:=D[1]; @@ -1323,57 +1331,57 @@ pour k de 0 jusque n-1 faire if(S[j]>mini and S[j]<maxi){Z:=Z,simplifier(S[j]);} fpour; fsi; -fpour; +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); +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{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ if(mini!=-infinity and L[p](mini)==0){" - valBarre(btex 0 etex);"}else{" + 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{" +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;"}; -MetaLfc:=" beginTableau("+nmr+") -newLigneVariables(btex $ {x}$ etex); +MetaLfc:=" beginTableau("+nmr+") +newLigneVariables(btex $ {x}$ etex); "+l0+li+ " - newLigneSignes(btex $\\hbox{ Signe du }\\atop{{\\displaystyle produit}}$ etex);"+ + newLigneSignes(btex $\\hbox{ Signe du }\\atop{{\\displaystyle 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{" + valBarre(btex 0 etex);"}else{" "}+" -endTableau; +endTableau; " ; -}else{ +}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);"; +l0:=l0+"val(btex $"+latex(D[1])+"$ etex);"; for(p:=0;p<=n-1;p++){lp:=""; li:=li+" -newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ if(mini!=-infinity and L[p](mini)==0){" - valBarre(btex 0 etex);"}else{" + valBarre(btex 0 etex);"}else{" "}+ if(L[p](Z[0]-0.01)>0){"plus;"}else{"moins;"}; @@ -1383,27 +1391,27 @@ newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\d "}+ 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;"}+ + 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{" + 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 + fpour -MetaLfc:=" beginTableau("+nmr+") +MetaLfc:=" beginTableau("+nmr+") newLigneVariables(btex $ {x}$ etex); "+l0+ li + " - newLigneSignes(btex $\\hbox{ Signe du }\\atop{{\\displaystyle \\rm produit}}$ etex);"+ + newLigneSignes(btex $\\hbox{ Signe du }\\atop{{\\displaystyle \\rm produit}}$ etex);"+ if(mini!=-infinity and product(L[s](mini),s,0,n-1)==0){" - valBarre(btex 0 etex);"}else{" + 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+ @@ -1411,7 +1419,7 @@ newLigneVariables(btex $ {x}$ etex); if(maxi!=+infinity and product(L[s](maxi),s,0,n-1)==0){" valBarre(btex 0 etex);"}else{" "}+" -endTableau; +endTableau; "; } @@ -1433,7 +1441,7 @@ fclose(sortie); \begin{VerbatimOut}{XcasTabSignQ.cxx} -TSq(nomf,L,Fo,D,nmr):={ +TSq(nomf,L,Fo,D,nmr):={ L:=apply(f->unapply(f,x),L); Fo:=apply(f->unapply(f,x),Fo); L:=concat(L,Fo); @@ -1448,9 +1456,9 @@ 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; + fpour; fsi; -fpour; +fpour; pour k de 0 jusque m-1 faire @@ -1460,34 +1468,34 @@ pour k de 0 jusque m-1 faire if(SF[j]>mini and SF[j]<maxi){F:=F,simplifier(SF[j]);} fpour; fsi; -fpour; +fpour; Z:=sort(Z); // on classe les zéros dans l'ordre croissant -nz:=size(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; // pour les zéros en double fsi; -fpour;} +fpour;} Z:=sort(Z); -nz:=size(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); +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{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ if(mini!=-infinity and L[p](mini)==0){" - valBarre(btex 0 etex);"}else{" + 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{" +if(L[p]((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}+if(maxi!=+infinity and L[p](maxi)==0){" + valBarre(btex 0 etex);"}else{" "} } @@ -1498,17 +1506,17 @@ if(L[p]((mini+maxi)*0.5>0)){"plus;"}else{"moins;"}+if(maxi!=+infinity and L[p MetaLfc:=" beginTableau("+nmr+") -newLigneVariables(btex $ {x}$ etex); +newLigneVariables(btex $ {x}$ etex); "+l0+li+ " newLigneSignes(btex $\\hbox{ Signe }\\atop{{\\displaystyle 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+ + "}}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{" + valBarre(btex 0 etex);"}else{" "}}else{"nonDefBarre;"}+" -endTableau; +endTableau; " ; @@ -1525,11 +1533,11 @@ pour m de 0 jusque nz-1 faire l0:=l0+"val(btex $"+ l0:=l0+"val(btex $"+latex(D[1])+"$ etex);"; -for(p:=0;p<=n-1;p++){lp:=""; +for(p:=0;p<=n-1;p++){lp:=""; li:=li+" newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(L[p](x))+"}}$ etex);"+ if(mini!=-infinity and L[p](mini)==0){" - valBarre(btex 0 etex);"}else{" + valBarre(btex 0 etex);"}else{" "}+ if(L[p](Z[0]-0.01)>0){"plus;"}else{"moins;"}; @@ -1542,37 +1550,37 @@ newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\d 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{" "} + 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 + if(member(Z[t+1],FF)==0){"valBarre(btex 0 etex);"}else{ "nonDefBarre;"} + fpour MetaLfc:=" -beginTableau("+nmr+") -newLigneVariables(btex $ {x}$ etex); +beginTableau("+nmr+") +newLigneVariables(btex $ {x}$ etex); "+l0+ li + " - newLigneSignes(btex $\\hbox{ Signe de}\\atop{{\\displaystyle "+nomf+"(x)}}$ etex);"+ + newLigneSignes(btex $\\hbox{ Signe de}\\atop{{\\displaystyle "+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;"}+ + "}}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(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; +endTableau; " @@ -1583,7 +1591,7 @@ MetaLfc:=" sortie:=fopen("XCasmpfc.mp"); -fprint(sortie,Unquoted,MetaLfc); +fprint(sortie,Unquoted,MetaLfc); fclose(sortie); @@ -1604,50 +1612,50 @@ fclose(sortie); -\begin{VerbatimOut}{XcasTabSigna.cxx} +\begin{VerbatimOut}{XcasTabSigna.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:= " - beginTableau("+nmr+") +zmax:=max(zA,zB); + Meta:= " + beginTableau("+nmr+") newLigneVariables(btex $ {x}$ etex); val(btex $-\\infty$ etex);val(btex $"+latex(zmin)+"$ etex); val(btex $"+latex(zmax)+"$etex); -val(btex $+\\infty$ etex); - newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+if(a==1){"x+"}else{if(a==-1){"-x+"}else{a+"x+"}}+b+"}}$ etex);" +val(btex $+\\infty$ etex); + newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+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} + 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(zmin==zA){"barre;"}else{"valBarre(btex 0 etex);"}+ if(a>0){"plus;"}else{"moins;"} +" -newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+if(c==1){"x+"}else{if(c==-1){"-x+"}else{c+"x+"}}+d+"}}$ etex);" +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+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} + 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(zmin==zB){"barre;"}else{"valBarre(btex 0 etex);"}+ if(c>0){"plus;"}else{"moins;"} +" -newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {("+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);"+ +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {("+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; +endTableau; " ; -sortie:=fopen("XCasmpfc.mp"); -fprint(sortie,Unquoted,Meta); -fclose(sortie); +sortie:=fopen("XCasmpfc.mp"); +fprint(sortie,Unquoted,Meta); +fclose(sortie); }:; @@ -1666,7 +1674,7 @@ sortie:=fopen("XCasmpfc.mp"); \begin{VerbatimOut}{XcasTSc.cxx} -TSc(g,D,nmr):={ +TSc(g,D,nmr):={ f:=unapply(g,x); Z:=NULL; mini:=D[0]; maxi:=D[1];lm:=" "; @@ -1674,69 +1682,69 @@ 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{" + 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{" +lf:=if(maxi!=+infinity and f(maxi)==0){" + valBarre(btex 0 etex);"}else{" "}; } -else{pour j de 0 jusque size(S)-1 faire +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); +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;} +fpour;} -nz:=size(Z); +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{" + 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{" + 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);"; +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);"; +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{" "}; +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{" +lf:=if(f(Z[nz-1]+1.0)>0){"plus;"}else{"moins;"}+if(maxi!=+infinity and f(maxi)==0){"valBarre(btex 0 etex);"}else{" "}; }}; -MetaLfc:=" +MetaLfc:=" beginTableau("+nmr+") -newLigneVariables(btex $\\displaystyle {x}$ etex); +newLigneVariables(btex $\\displaystyle {x}$ etex); "+l0+" -newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(f(x))+"}}$ etex);"+ +newLigneSignes(btex $\\hbox{ Signe de }\\atop{\\displaystyle {"+latex(f(x))+"}}$ etex);"+ li+lm+lf +" -endTableau; +endTableau; " ; @@ -1746,7 +1754,7 @@ newLigneVariables(btex fclose(sortie); +fclose(sortie); @@ -1761,7 +1769,7 @@ fprint(sortie,Unquoted,MetaLfc); %% %% -%% traitement des fichiers produits par giac/xcas +%% traitement des fichiers produits par giac/xcas %% %% @@ -1772,26 +1780,26 @@ fprint(sortie,Unquoted,MetaLfc); \newcommand{\dresse}[1]{% \ifthenelse{\boolean{xcas}}{% Avec l'option "XCas présent" \executGiacmp{XCas#1.giac}% reconstituer le tableau - % exporter le source mp + % exporter le source mp % puis lancer metapost pour créer % l'image du tableau \immediate\write18{\cat XCasmpfc.mp >> \Tableaux.Tab.mp} - \immediate\write18{\cat enteteMP.cfg >> \Tableaux.Tab#1.mp} + \immediate\write18{\cat enteteMP.cfg >> \Tableaux.Tab#1.mp} \immediate\write18{\cat XCasmpfc.mp >> \Tableaux.Tab#1.mp} - \immediate\write18{\cat queue.mp >> \Tableaux.Tab#1.mp} - \immediate\write18{mpost -interaction=batchmode -jobname=\Tableaux.Tab \Tableaux.Tab#1} - \immediate\write18{\rem \Tableaux.Tab#1.mp} }% + \immediate\write18{\cat queue.mp >> \Tableaux.Tab#1.mp} + \immediate\write18{mpost -interaction=batchmode -jobname=\Tableaux.Tab \Tableaux.Tab#1} + \immediate\write18{\rem \Tableaux.Tab#1.mp} }% {% 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.}}} + XCas.}}} \begin{center} - \includegraphics{\Tableaux.Tab.\theTVn} + \includegraphics{\Tableaux.Tab.\theTVn} \end{center} -\stepcounter{TVn}} +\stepcounter{TVn}} %% @@ -1804,16 +1812,16 @@ fprint(sortie,Unquoted,MetaLfc); \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}} +\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} +\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. + % inclusion ultérieure dans Tableaux.mp. \immediate\write18{\cat XCasmpfc.mp >> \Tableaux.Tab.mp}} % Inclusion du % source dans le % fichier @@ -1825,10 +1833,10 @@ fprint(sortie,Unquoted,MetaLfc); % fichier \begin{center} - \includegraphics{\Tableaux.Tab.\theTVn} + \includegraphics{\Tableaux.Tab.\theTVn} \end{center} -\setcounter{TVn}{\theTVnbis} % Restauration du compteur TVn +\setcounter{TVn}{\theTVnbis} % Restauration du compteur TVn } @@ -1849,14 +1857,14 @@ fprint(sortie,Unquoted,MetaLfc); -\begin{VerbatimOut}{XCasa.giac} +\begin{VerbatimOut}{XCasa.giac} maple_mode(0); -read("XcasTabSigna.cxx"); -read("XCasa.user"); +read("XcasTabSigna.cxx"); +read("XCasa.user"); \end{VerbatimOut} -\newenvironment{TSa} -{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasa.user}} +\newenvironment{TSa} +{\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasa.user}} {\end{VerbatimOut} \dresse{a} } @@ -1870,18 +1878,18 @@ read("XcasTabSigna.cxx"); \begin{VerbatimOut}{XCasQ.giac} -maple_mode(0); +maple_mode(0); read("XcasTabSignQ.cxx"); -read("XCasQ.user"); +read("XCasQ.user"); \end{VerbatimOut} -\newenvironment{TSq}% +\newenvironment{TSq}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasQ.user}} {\end{VerbatimOut}\dresse{Q}} -\newenvironment{TSq*}[1]% +\newenvironment{TSq*}[1]% {\setcounter{TVnbis}{\theTVn} \setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasQ.user}} @@ -1889,9 +1897,9 @@ read("XcasTabSignQ.cxx"); \begin{VerbatimOut}{XCasL.giac} -maple_mode(0); +maple_mode(0); read("XcasTabSignL.cxx"); -read("XCasL.user"); +read("XCasL.user"); \end{VerbatimOut} \newenvironment{TS}% @@ -1899,7 +1907,7 @@ read("XcasTabSignL.cxx"); {\end{VerbatimOut}\dresse{L}} -\newenvironment{TS*}[1] +\newenvironment{TS*}[1] {\setcounter{TVnbis}{\theTVn} \setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasL.user}} @@ -1909,7 +1917,7 @@ read("XcasTabSignL.cxx"); \begin{VerbatimOut}{XCasTSc.giac} maple_mode(0); read("XcasTSc.cxx"); -read("XCasTSc.user"); +read("XCasTSc.user"); \end{VerbatimOut} @@ -1917,23 +1925,23 @@ read("XcasTSc.cxx"); \newenvironment{TSc*}[1]% {\setcounter{TVnbis}{\theTVn} -\setcounter{TVn}{#1} +\setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTSc.user}} -{\end{VerbatimOut}\dressetoile{TSc}} +{\end{VerbatimOut}\dressetoile{TSc}} \newenvironment{TSc}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTSc.user}} -{\end{VerbatimOut}\dresse{TSc}} +{\end{VerbatimOut}\dresse{TSc}} \begin{VerbatimOut}{XCasTV.giac} maple_mode(0); read("XcasTV.cxx"); -read("XCasTV.user"); +read("XCasTV.user"); \end{VerbatimOut} -\newenvironment{TV}% +\newenvironment{TV}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTV.user}}% {\end{VerbatimOut} \dresse{TV}} @@ -1942,7 +1950,7 @@ read("XcasTV.cxx"); \setcounter{TVnbis}{\theTVn} \setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTV.user}}% -{\end{VerbatimOut}\dressetoile{TV}} +{\end{VerbatimOut}\dressetoile{TV}} @@ -1957,19 +1965,19 @@ read("XcasTV.cxx"); \begin{VerbatimOut}{XCasTVZ.giac} maple_mode(0); read("XcasTVZ.cxx"); -read("XCasTVZ.user"); +read("XCasTVZ.user"); \end{VerbatimOut} -\newenvironment{TVZ}% +\newenvironment{TVZ}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVZ.user}}% {\end{VerbatimOut} \dresse{TVZ}} -\newenvironment{TVZ*}[1]{% +\newenvironment{TVZ*}[1]{% \setcounter{TVnbis}{\theTVn} \setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVZ.user}}% -{\end{VerbatimOut}\dressetoile{TVZ}} +{\end{VerbatimOut}\dressetoile{TVZ}} @@ -1983,19 +1991,19 @@ read("XcasTVZ.cxx"); \begin{VerbatimOut}{XCasTVapp.giac} maple_mode(0); read("XcasTVapp.cxx"); -read("XCasTVapp.user"); +read("XCasTVapp.user"); \end{VerbatimOut} \newenvironment{TVapp}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVapp.user}}% {\end{VerbatimOut} -\dresse{TVapp}} +\dresse{TVapp}} \newenvironment{TVapp*}[1]{% \setcounter{TVnbis}{\theTVn} -\setcounter{TVn}{#1} +\setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVapp.user}}% -{\end{VerbatimOut}\dressetoile{TVapp}} +{\end{VerbatimOut}\dressetoile{TVapp}} @@ -2008,21 +2016,21 @@ read("XcasTVapp.cxx"); \begin{VerbatimOut}{XCasTVI.giac} -maple_mode(0); +maple_mode(0); read("XcasTVI.cxx"); -read("XCasTVI.user"); +read("XCasTVI.user"); \end{VerbatimOut} -\newenvironment{TVI}% +\newenvironment{TVI}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVI.user}}% -{\end{VerbatimOut}\dresse{TVI}} +{\end{VerbatimOut}\dresse{TVI}} \newenvironment{TVI*}[1]% {\setcounter{TVnbis}{\theTVn} -\setcounter{TVn}{#1} +\setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVI.user}}% -{\end{VerbatimOut}\dressetoile{TVI}} +{\end{VerbatimOut}\dressetoile{TVI}} @@ -2032,10 +2040,10 @@ read("XcasTVI.cxx"); \begin{VerbatimOut}{XCasTVIapp.giac} maple_mode(0); read("XcasTVIapp.cxx"); -read("XCasTVIapp.user"); +read("XCasTVIapp.user"); \end{VerbatimOut} -\newenvironment{TVIapp}% +\newenvironment{TVIapp}% {\VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVIapp.user}}% {\end{VerbatimOut}\dresse{TVIapp}} @@ -2044,7 +2052,7 @@ read("XcasTVIapp.cxx"); {\setcounter{TVnbis}{\theTVn} \setcounter{TVn}{#1} \VerbatimEnvironment\begin{VerbatimOut}[commandchars=\\??]{XCasTVIapp.user}}% -{\end{VerbatimOut}\dressetoile{TVIapp}} +{\end{VerbatimOut}\dressetoile{TVIapp}} @@ -2053,7 +2061,7 @@ read("XcasTVIapp.cxx"); %% -%% Zi end -> enjoy :) +%% Zi end -> enjoy :) -- cgit v1.2.3