/*
 *   Latter exercise PP11 P. 148
 *
 *   L(x) = x+ 10*x/sqrt(x*x-64)
 *
 *   x initialize to 8.1 increment by 0.1 find minimum af L(x)
 *
 *
 *    +---------------------
 *    |                        10 feet
 *    |
 *    |     +---------------
 *    |     |
 *    |     |
 *    |     |
 *    |     |
 *      8feet
 */

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    double Lmin=1e50;
    double xmin=0;

    for (double x=8.1; x<12 ; x+=0.01)
    {
        double L= x+ 10*x/sqrt(x*x-64);
        if (L<Lmin) { Lmin=L; xmin=x; }
        cout << x << " " << L << "\t" << xmin << " " << Lmin << "\n";
    }

   return 0;
}

