Difference between two regression techniques

I don’t know what is going on with your particular case, but the piece of code I’ve proposed works for me, at least with a test image:

$ gmic -testimage2d  512 --* 2 -+. -70 --l -y 1,100%,1,1,1 -a[0,-1] x -r "100%,{min(h,10000)}" -solve. [-2] -k. a={[0]} b={[1]} -rm -endl

returns approximatively a=2 and b=70, which is correct.