%!TEX pdflatex

\documentclass[a4paper,french,11pt]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{xintexpr}

\xintdeffloatfunc MinMax(a,x,b) = (x > b)?{b}{(x < a)?{a}{x}};
\xintdeffloatfunc Impots(x) = MinMax(0,x,11497)*0 + (MinMax(11497,x,29315)-11497)*11/100+(MinMax(29315,x,83823)-29315)*30/100 + (MinMax(83824,x,180294)-83824)*41/100 + (max(x,180294)-180294)*45/100 ;

\NewDocumentCommand\CalculsImpotsRevenus{ O{0} m m m }{%
	%#1=primes
	%#2=revenus imposables
	%#3=parts adultes
	%#4=nb enfants
	\xdef\NbPartsSsEnfants{#3}%
	\xintifboolexpr{#4 == 0}{\xdef\NbParts{(#3)}}{}%
	\xintifboolexpr{#4 == 1}{\xdef\NbParts{(#3+0.5)}}{}%
	\xintifboolexpr{#4 == 2}{\xdef\NbParts{(#3+1)}}{}%
	\xintifboolexpr{#4 > 3}{\xdef\NbParts{(#3+(#4)-1)}}{}%
	%calculs
	\xdef\QFtmp{\xintfloateval{((#2)+(#1))/(\NbParts)}}%
	\xdef\ImpotsBruttmp{\xintfloateval{(\NbParts)*Impots(\QFtmp)}}%
	\xdef\QFSsEnfantstmp{\xintfloateval{((#2)+(#1))/(#3)}}%
	\xdef\ImpotsBrutSsEnfantstmp{\xintfloateval{(#3)*Impots(\QFSsEnfantstmp)}}%
	%calcul de l'avantage fiscal
	\xdef\Avantagetmp{\xintfloateval{\ImpotsBrutSsEnfantstmp-\ImpotsBruttmp}}%
	\xdef\EcartAvantagetm{\xintfloateval{\Avantagetmp-(#4)*1791}}
	\xintifboolexpr{\EcartAvantagetm > 0 }%
		{%
			\xdef\ImpotsRevenus{\xintfloateval{\ImpotsBruttmp+\EcartAvantagetm}}%
		}%
		{%
			\xdef\ImpotsRevenus{\xintfloateval{\ImpotsBruttmp+0}}%
		}%
	%résultats
	\ImpotsBruttmp~\&\ \ImpotsBrutSsEnfantstmp~\&\ \ImpotsRevenus\relax
}

\begin{document}

\CalculsImpotsRevenus{60000}{2}{0}

\CalculsImpotsRevenus[1500]{12*2150+12*2270}{2}{2}

\CalculsImpotsRevenus[6300]{12*3000+12*3300}{2}{2}

\end{document}