
tt=$[3*($rp)^2]
!if $tt>5
 rr=$[(randint(30)+10)/10]
!else
 rr=$[(randint(40)+10+$tt*10)/10]
!endif
rs=$[(randint(61)-30)/10]
f1=t^3 - $rr*t + a
d1=3*t^2 - $rr
f2=!rawmath t^2 + b*t + $rs
d2=2*t + b
f3=!rawmath -t^2 + b*t + $rs
d3=-2*t + b
v0=$[$tt - $rr]

choice=!randint 1,4
x   =!item $choice of $f1,$f1,$f2,$f3
derx=!item $choice of $d1,$d1,$d2,$d3
y   =!item $choice of $f2,$f3,$f1,$f1
dery=!item $choice of $d2,$d3,$d1,$d1
ori =!item $choice of   y,  y,  x,  x
rb  =!item $choice of $[$AA*($v0)-2*($rp)],\
		      $[$AA*($v0)+2*($rp)],\
		      $[$v0/($AA)-2*($rp)],\
		      $[$v0/($AA)+2*($rp)]
T=!mathsubst t=($rp) in $($ori)
T=!evalsubst b=($rb) in $T
ra  =!item $choice of $[($T-($BB))/($AA)],\
		      $[($T-($BB))/($AA)],\
		      $[$AA*($T)+($BB)],\
		      $[$AA*($T)+($BB)]
ra  =$[$ra-($rp)^3+$rr*($rp)]

var=t
f=$x, $y

