how can I solve this overdetermined equation system with the command PseudoInverse.

left = Table[(-i)^i, {i, 1, 4}]; right1 = Table[Sum[2^(i*k)*Sin[Subscript[x, k]], {k, 1, 3}], {i, 1, 4}];
right2 =Table[Sum[2^(i*k)*Cos[Subscript[x, k]], {k, 2, 3}], {i, 1, 4}];
StringForm["left side = ``", left // MatrixForm]
StringForm["right1 side = ``", right1 // MatrixForm]
StringForm["right2 side = ``", right2 // MatrixForm]
A1 = {{2, 4, 8},{4, 16, 64},{8, 64, 512},{16, 256, 4096}};
A2 = {{4, 8},{16, 64},{64, 512},{256, 4096}};
b ={{-1},{4},{-27},{256}};
x1 = PseudoInverse[Subscript[A, 1]].b // N;
x2 = PseudoInverse[Subscript[A, 2]].b // N;
r1 = Subscript[A, 1].Subscript[x, 1] - b // MatrixForm;
r2 = Subscript[A, 2].Subscript[x, 2] - b // MatrixForm;
r1 = Flatten[{{r1[[1, 1]]},{r1[[1, 2]]},{r1[[1, 3]]},{r1[[1, 4]]}}];
r2 = Flatten[{r2[[1, 1]]},{r2[[1, 2]]},{r2[[1, 3]]},{r2[[1, 4]]}}];
g1 = Length[Subscript[r, 1]];
g2 = Length[Subscript[r, 2]];
p1 = Sqrt[Subscript[r, 1].Subscript[r, 1]/Subscript[g, 1]];
p2 = Sqrt[Subscript[r, 2].Subscript[r, 2]/Subscript[g, 2]];
Print["r1 = ", r1 // MatrixForm, "\np1 = ", p1]
Print["r2 = ", r2 // MatrixForm, "\np2 = ", p2]
Pseudoinversecannot be applied directly. The method of choice would proabably be the Gauß-Newton algorithm (or rather the Levenberg-Marquardt variant). It is employed byFindMininumif you reformulate your problem as a regression or parameter fitting problem.FindFitand friends might also be of help here. – Henrik Schumacher Apr 05 '19 at 08:34