Update maths algorithm

Job ID: 33121520

Budget: $30 – $250 USD

Hi,
I need help updating a maths algorithim and writing it using latex.
I will be updating something like this, if you understand this algorithm and know how to write this in latex, then this job is suitable for you.
My plan is to add four lines to this algorithm, which I will explain.
If you are familiar with writing in latex, it will probably take you less than an hour