I have been trying to write an algorithm step by step and draw a flowchart for machine epsilon, but I am not sure if my solution is correct.
Here is the code:
macheps = 1; %assigning value of 1 to macheps while 1 + (macheps / 2) > 1 %running a loop until macheps reaches 0 macheps = macheps / 2; %keep dividing macheps by 2 end %end loop when we reach smallest precision
And here is the algorithm I wrote:
Step 1: Start Step 2: Set ε = 1. Step 3: if 1 + (ε/2) is more than 1 go to Step 4, otherwise Step 5 Step 4: ε = ε/2 go back to Step 3 Step 5: End
And here is the flowchart I drew:
enter image description here
Please let me know if my solution is not correct or if there is anything I could do to improve it.