7 questions
| Step 1 | Input A |
| Step 2 | Input B , where \(\mathrm { B } > \mathrm { A }\) |
| Step 3 | Let \(\mathrm { R } = \mathrm { A } + \left( \frac { \sqrt { 5 } - 1 } { 2 } \right) \times ( \mathrm { B } - \mathrm { A } )\) |
| Step 4 | Let \(\mathrm { L } = \mathrm { A } + \mathrm { B } - \mathrm { R }\) |
| Step 5 | Find \(f ( \mathrm {~L} )\) and \(f ( \mathrm { R } )\) |
| Step 6 | If \(\mathrm { f } ( \mathrm { L } ) \leqslant \mathrm { f } ( \mathrm { R } )\) then let \(\mathrm { B } = \mathrm { R }\) and go to Step 8 |
| Step 7 | If \(\mathrm { f } ( \mathrm { L } ) > \mathrm { f } ( \mathrm { R } )\) then let \(\mathrm { A } = \mathrm { L }\) and go to Step 8 |
| Step 8 | If \(\mathrm { B } - \mathrm { A } < 0.1\) then go to step 10 |
| Step 9 | Go to step 3 |
| Step 10 | Print \(\frac { ( \mathrm { A } + \mathrm { B } ) } { 2 }\) and stop |