Computing a mathematical function in MIPS assembly
There are multiple issues:

first, try to make the program work: These two lines are contradictory

ori      $8, $0, 3         #put x into $8
ori      $8, $0, 1         #put x into $8


Perhaps the real idea is to move a function parameter to $8.

The second thing is redundant calculation:
Instead of squaring x twice, you should be able to

mul $8, $8
mflo $13
mflo $14


To catch the result in two registers.

There's no need to reserve registers for all the immediates, as one can at least add the last coefficients 16 and (-4) with

addi $x, $x, 16


Multiplications with small constants are also often better executed with a series of shifts and adds. Especially here x*4 equals x&lt;&lt;2 and x*2 == x+x, which leads to one less instruction for both operations.