diff options
author | Karl Berry <karl@freefriends.org> | 2022-10-01 19:51:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-10-01 19:51:23 +0000 |
commit | 84f42e91c4372e6f540a79bfc57c96c2c8821c4a (patch) | |
tree | 3dd61bee90ea4b6b10aa2ff9c2e87739fe344f36 /Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | |
parent | 0a46aa26bbb1da727bb1d9b0489d37b427d2a364 (diff) |
proflycee (1oct22)
git-svn-id: svn://tug.org/texlive/trunk@64573 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty | 153 |
1 files changed, 152 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty index 7fdd37b256c..708ef7b8130 100644 --- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty +++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty @@ -3,7 +3,8 @@ % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ProfLycee}[2022/09/22 v1.2.6 - Aide pour l'utilisation de LaTeX en lycee] +\ProvidesPackage{ProfLycee}[2022/10/01 v1.2.7 - Aide pour l'utilisation de LaTeX en lycee] +% 1.2.7 Calculs de probas pour des lois classiques % 1.2.6 Ajout d'un environnement tikz pour des sudomaths personnalisés % 1.2.5 Ajout d'une commande pour des boites à moustaches, en tikz % 1.2.4 Correction de quelques bugs mineurs, et mise à jour de la doc @@ -2179,4 +2180,154 @@ \end{tikzpicture} } +%================LOISPROBAS============ OK !! +%calculs "simples" +\newcommand\calcPbinomP[3]{%npk + \xintFloatToDecimal{\xintfloateval{binomial(#1,#3)*#2^#3*(1-#2)^(#1-#3)}} +} +\newcommand\calcPbinomC[4]{%npab + \def\BorneInf{#3}\def\BorneSup{#4} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneSup{#4}} + {} + \xintFloatToDecimal{\xintfloateval{add(binomial(#1,i)*#2^i*(1-#2)^(#1-i), i=\BorneInf..\BorneSup)}} +} +\newcommand\calcPpoissP[2]{%lk + \xintFloatToDecimal{\xintfloateval{exp(-#1)*#1^#2/factorial(#2)}} +} +\newcommand\calcPpoissC[3]{%lab + \def\BorneInf{#2}\def\BorneSup{#3} + \ifthenelse{\equal{#2}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneSup{10*#1}} + {} + \xintFloatToDecimal{\xintfloateval{add(exp(-#1)*#1^i/factorial(i), i=\BorneInf..\BorneSup)}} +} +%utiles idée de https://tex.stackexchange.com/questions/355574/im-searching-for-a-table-with-cdf-of-standard-normal-distribution +\xintdeffloatvar a_1,a_2,a_3,a_4,a_5,a_6 := +0.0705230784,0.0422820123,0.0092705272,0.0001520143,0.0002765672,0.0000430638; +\xintdeffloatvar rac2inv := sqrt(2)/2 ; +\xintdeffloatfunc erfc(x) := % uniquement pour x positif +((((((a_6*x+a_5)*x+a_4)*x+a_3)*x+a_2)*x+a_1)*x+1)**-16 ; % fin de définition de erfc(x) +\xintdeffloatfunc Phi(z) := (z>=0)?{1 - 0.5 * erfc(rac2inv * z)}{0.5 * erfc(-rac2inv * z)}; + +\newcommand\calcPnormC[4]{%msab + %def des bornes de l'intervalle suivant l'absence de a ou de b... + \def\BorneInf{#3}\def\BorneSup{#4} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneInf{#4-10*#2}} + {} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneSup{#3+10*#2}} + {} + \xintFloatToDecimal{\xintfloateval{Phi((\BorneSup-#1)/#2)-Phi((\BorneInf-#1)/#2)}} +} +%calculs "simples" fiabilite +\newcommand\calcPexpoC[3]{%lab + \def\BorneInf{#2}\def\BorneSup{#3} + \ifthenelse{\equal{#2}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#3}{*}}% + {\def\BorneSup{100/#1}} + {} + \xintFloatToDecimal{\xintfloateval{exp(-#1*\BorneInf)-exp(-#1*\BorneSup)}} +} + +%calculs formatés +\NewDocumentCommand{\numPbinomP}{ s O{3} m m m }{%*=sci,2=prec,3=n,4=p,5=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(binomial(#3,#5)*#4^#5*(1-#4)^(#3-#5),#2)}}} + } +} + +\NewDocumentCommand{\numPbinomC}{ s O{3} m m m m }{%*=sci,2=prec,3=n,4=p,5=a,6=b + \def\BorneInf{#5}\def\BorneSup{#6} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#6}{*}}% + {\def\BorneSup{#3}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(binomial(#3,i)*#4^i*(1-#4)^(#3-i), i=\BorneInf..\BorneSup),#2)}}} + } +} + +\NewDocumentCommand{\numPpoissP}{ s O{3} m m }{%*=sci,2=prec,3=lbda,4=k + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3)*#3^#4/factorial(#4),#2)}}} + } +} + +\NewDocumentCommand{\numPpoissC}{ s O{3} m m m }{%*=ing,2=prec,3=lbda,4=a,5=b + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{10*#3}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(add(exp(-#3)*#3^i/factorial(i), i=\BorneInf..\BorneSup),#2)}}} + } +} + +\NewDocumentCommand{\numPnormC}{ s O{3} m m m m }{% + %*=ing,2=prec,3=mu,4=sigma,5=a,6=b + %def des bornes de l'intervalle suivant l'absence de a ou de b... + \def\BorneInf{#5}\def\BorneSup{#6} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneInf{#6-10*#4}} + {} + \ifthenelse{\equal{#6}{*}}% + {\def\BorneSup{#5+10*#4}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintfloateval{round(Phi((\BorneSup-#3)/#4)-Phi((\BorneInf-#3)/#4),#2)}}} + } +} + +\NewDocumentCommand{\numPexpoC}{ s O{3} m m m }{%*=ing,2=prec,3=lbda,4=a,5=b + \def\BorneInf{#4}\def\BorneSup{#5} + \ifthenelse{\equal{#4}{*}}% + {\def\BorneInf{0}} + {} + \ifthenelse{\equal{#5}{*}}% + {\def\BorneSup{100/#3}} + {} + \IfBooleanTF{#1}% + {% + \num[exponent-mode=scientific]{\xintFloatToDecimal{\xintfloateval{round(exp(-#3*\BorneInf)-exp(-#3*\BorneSup),#2)}}} + }% + {% + \num[minimum-decimal-digits=#2]{\xintFloatToDecimal{\xintFloatToDecimal{\xintfloateval{round(exp(-#3*\BorneInf)-exp(-#3*\BorneSup),#2)}}}} + } +} + \endinput
\ No newline at end of file |