
cc=!random -0.4,0.4
!if random(1)>0.5
 c1=!random -0.6,0.4
 c2=!random -0.1,0.1
 c3=!random -($c1*2.4+0.6)/14,-($c1*2.4-0.6)/14
 f=!rawmath $cc+$c1(x-$cc)+$c2(x-$cc)^2+$c3(x-$cc)^3
 good=$cc
 cent=$cc
!else
 c0=!random 0.5,0.9
 c1=!random 1.5,5
 c2=!random -0.1,0.1
 c3=!random 0.2,0.7
 v=!random -0.2,0.2
 f=!rawmath $cc-$c0*atan($c1*(x-$cc)/$c0)+$c2(x-$cc)^2+$c3(x-$cc)+$v
 point=!exec pari print(solve(x=-2,2,$f-x))
 good=osci
 bad=$point
 cent=$bad
!endif

!distribute item -2,2 into neg,pos
!if $cent-$neg>2*$ecart
 u=!random $neg+$ecart,$cent-$ecart
!else
 u=$[0.5*($neg)+0.5*($cent)]
!endif

!if $pos-$cent>2*$ecart
 w=!random $cent+$ecart,$pos-$ecart
!else
 w=$[0.5*($pos)+0.5*($cent)]
!endif

!if random(1)>0.5
 u1=$u
 out=minus
!else
 u1=$w
 out=plus
!endif


