
!if random(1)>0.5
 c1=!random 0.4,0.8
 c3=!random -($c1-0.1)/12,(0.9-$c1)/4
 t=$[max(0,1.8-2*$c1-8*($c3))]
 d=$[max(0,$c1+12*($c3)-0.05)]
 c2=!random -$d/4,$d/4
 c0=!random -$t,$t

 f=$c0+$c1*x+($c2)*(x^2-4)+($c3)*x^3
 point=!exec pari print(solve(x=-2,2,$f-x))
 good=$point
 !distribute item -2,2 into neg,pos
 cent=$good
!else
 c1=!random 1.2,1.8
 c3=!random (2.1-2*$c1)/8, (4-2*$c1)/8
 c2=!random -0.2,0.2
 c0=0
 f=$c0+$c1*x+($c2)*(x^2-4)+($c3)*x^3
 point=!exec pari print(solve(x=-2,2,$f-x))\
  print(solve(x=-2,2,$f+2))\
  print(solve(x=-2,2,$f-2))
 !distribute lines $point into bad,neg,pos
 good=out
 cent=$bad
!endif

!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

