22 January 2019 10:06:30.072 AM BRENT_TEST FORTRAN77 version. Test BRENT. TEST_ZERO_ALL Test the Brent ZERO routine, which seeks a root of a function F(X) in an interval [A,B]. f_01(x) = sin ( x ) - x / 2 A Z B F(A) F(Z) F(B) 1.00000000 1.89549427 2.00000000 0.341471 0.00000 -0.907026E-01 f_02(x) = 2 * x - exp ( - x ) A Z B F(A) F(Z) F(B) 0.00000000 0.35173371 1.00000000 -1.00000 0.00000 1.63212 f_03(x) = x * exp ( - x ) A Z B F(A) F(Z) F(B) -1.00000000 0.00000000 0.50000000 -2.71828 0.267518E-23 0.303265 f_04(x) = exp ( x ) - 1 / ( 100 * x * x ) A Z B F(A) F(Z) F(B) 0.00010000 0.09534462 20.00000000 -999999. -0.222045E-15 0.485165E+09 f_05(x) = (x+3) * (x-1) * (x-1) A Z B F(A) F(Z) F(B) -5.00000000 -3.00000000 2.00000000 -72.0000 0.00000 5.00000 TEST_ZERO_RC_ALL Test the ZERO_RC routine, which seeks a root of a function F(X) in an interval [A,B]. f_01(x) = sin ( x ) - x / 2 STATUS X F(X) 1 1.0000000 0.34147098 2 2.0000000 -.90702573E-01 3 1.7901247 0.80981478E-01 4 1.8891205 0.52009551E-02 5 1.8955464 -.42662551E-04 6 1.8954941 0.15801279E-06 7 1.8954943 0.47618576E-11 8 1.8954943 0.0000000 0 1.8954943 0.0000000 f_02(x) = 2 * x - exp ( - x ) STATUS X F(X) 1 0.0000000 -1.0000000 2 1.0000000 1.6321206 3 0.37992181 0.75928731E-01 4 0.35311057 0.37216264E-02 5 0.35173382 0.28266510E-06 6 0.35173371 0.10261791E-11 7 0.35173371 0.0000000 0 0.35173371 0.0000000 f_03(x) = x * exp ( - x ) STATUS X F(X) 1 -1.0000000 -2.7182818 2 0.50000000 0.30326533 3 0.34944865 0.24638811 4 -.24852793 -.31864677 5 0.88696039E-01 0.81167847E-01 6 -.13397964E-01 -.13578678E-01 7 0.12337235E-02 0.12322023E-02 8 0.16429166E-04 0.16428896E-04 9 -.40352160E-09 -.40352160E-09 10 0.66295778E-14 0.66295778E-14 11 0.26751788E-23 0.26751788E-23 12 -.22204460E-15 -.22204460E-15 0 0.26751788E-23 0.26751788E-23 f_04(x) = exp ( x ) - 1 / ( 100 * x * x ) STATUS X F(X) 1 0.10000000E-03 -999999.00 2 20.000000 0.48516520E+09 3 0.41238033E-01 -4.8382625 4 0.41238232E-01 -4.8382055 5 0.58141367E-01 -1.8983488 6 10.029071 22676.188 7 0.58976018E-01 -1.8143247 8 0.76997139E-01 -.60671143 9 5.0530339 156.49615 10 0.96213965E-01 0.20745857E-01 11 0.95578592E-01 0.56365645E-02 12 0.95343746E-01 -.21064209E-04 13 0.95344620E-01 0.73912705E-07 14 0.95344617E-01 0.96544994E-12 15 0.95344617E-01 -.22204460E-15 16 0.95344617E-01 0.64392935E-14 0 0.95344617E-01 -.22204460E-15 f_05(x) = (x+3) * (x-1) * (x-1) STATUS X F(X) 1 -5.0000000 -72.000000 2 2.0000000 5.0000000 3 1.5454545 1.3523666 4 1.3800380 0.63260398 5 1.2363083 0.23656223 6 -1.8818459 9.2863099 7 -3.4409229 -8.6957923 8 -2.6869838 4.2550950 9 -2.9346952 1.0110372 10 -3.0038554 -.61805988E-01 11 -2.9998712 0.20614464E-02 12 -2.9999998 0.39685984E-05 13 -3.0000000 -.85975671E-12 14 -3.0000000 0.0000000 0 -3.0000000 0.0000000 TEST_LOCAL_MIN_ALL Test the LOCAL_MIN routine, which seeks a local minimizer of a function F(X) in an interval [A,B]. g_01(x) = ( x - 2 ) * ( x - 2 ) + 1 A X B F(A) F(X) F(B) 0.00000000 2.00000000 3.14159265 5.00000 1.00000 2.30323 g_02(x) = x * x + exp ( - x ) A X B F(A) F(X) F(B) 0.00000000 0.35173370 1.00000000 1.00000 0.827184 1.36788 g_03(x) = x^4 + 2x^2 + x + 3 A X B F(A) F(X) F(B) -2.00000000 -0.23673290 2.00000000 25.0000 2.87849 29.0000 g_04(x) = exp ( x ) + 1 / ( 100 x ) A X B F(A) F(X) F(B) 0.00010000 0.09534461 1.00000000 101.000 1.20492 2.72828 g_05(x) = exp ( x ) - 2x + 1/(100x) - 1/(1000000x^2) A X B F(A) F(X) F(B) 0.00020000 0.70320487 2.00000000 25.9998 0.628026 3.39406 g_06(x) = -x*sin(10*pi*x)-1.0 A X B F(A) F(X) F(B) 1.80000000 1.85054759 1.90000000 -1.00000 -2.85027 -1.00000 g_07(x) = max(-2(x-1),8(x-1)) + 25*(x-1)^2 A X B F(A) F(X) F(B) -1.20000000 0.99999239 2.70000000 125.400 0.152154E-04 85.8500 TEST_LOCAL_MIN_RC_ALL Test the reverse communication version of Brent LOCAL_MIN routine, which seeks a local minimizer of a function F(X) in an interval [A,B]. g_01(x) = ( x - 2 ) * ( x - 2 ) + 1 Step X F(X) 0 0.000000000000000 5.000000000000000 0 3.141592653589793 2.303233786730186 1 1.199981614864327 1.640029416555091 2 1.941611038725466 1.003409270798719 3 2.399963229728653 1.159970585134975 4 2.000000000000000 1.000000000000000 5 2.000000029802322 1.000000000000001 6 1.999999970197678 1.000000000000001 7 1.999999970197678 1.000000000000001 g_02(x) = x * x + exp ( - x ) Step X F(X) 0 0.000000000000000 1.000000000000000 0 1.000000000000000 1.367879441171442 1 0.3819660112501051 0.8284162845035989 2 0.6180339887498948 0.9209690939741497 3 0.2360679774997897 0.8454550784427712 4 0.3528496811495104 0.8271857093986708 5 0.3518917166104074 0.8271840598740323 6 0.3517320418182495 0.8271840261312916 7 0.3517337036958197 0.8271840261275244 8 0.3517337112615478 0.8271840261275243 9 0.3517337165027886 0.8271840261275244 10 0.3517337165027886 0.8271840261275244 g_03(x) = x^4 + 2x^2 + x + 3 Step X F(X) 0 -2.000000000000000 25.00000000000000 0 2.000000000000000 29.00000000000000 1 -0.4721359549995796 3.023378685249420 2 0.4721359549995792 3.967650595248578 3 -1.055728090000841 5.415643516089551 4 -0.1498138939889126 2.895578253916099 5 -0.2226817817160358 2.878951458114974 6 -0.2318072413850192 2.878549359863836 7 -0.2370561019263440 2.878493033943844 8 -0.2367455245027443 2.878492790245848 9 -0.2367325704732761 2.878492789873986 10 -0.2367329046684402 2.878492789873726 11 -0.2367329011408449 2.878492789873726 12 -0.2367328976132497 2.878492789873726 13 -0.2367327726568989 2.878492789873766 14 -0.2367328498841708 2.878492789873733 15 -0.2367328793823638 2.878492789873727 16 -0.2367328906496710 2.878492789873726 17 -0.2367328906496710 2.878492789873726 g_04(x) = exp ( x ) + 1 / ( 100 x ) Step X F(X) 0 0.1000000000000000E-03 101.0001000050002 0 1.000000000000000 2.728281828459045 1 0.3820278146489801 1.491428944564399 2 0.6180721853510198 1.871527165190991 3 0.2361443707020397 1.308704097842649 4 0.1459834439469404 1.225677948134214 5 0.9026092675509928E-01 1.205249730835979 6 0.6987608932080662E-01 1.215485764492621 7 0.1020637327872526 1.205432046585031 8 0.9568202682193082E-01 1.204921944013730 9 0.9551304332896546E-01 1.204920914847202 10 0.9535723006160622E-01 1.204920574455330 11 0.9534430133398021E-01 1.204920572533846 12 0.9534460687029817E-01 1.204920572532641 13 0.9534461723542657E-01 1.204920572532640 14 0.9534461865617216E-01 1.204920572532640 15 0.9534462007691777E-01 1.204920572532640 16 0.9534462007691777E-01 1.204920572532640 g_05(x) = exp ( x ) - 2x + 1/(100x) - 1/(1000000x^2) Step X F(X) 0 0.2000000000000000E-03 25.99980002000133 0 2.000000000000000 3.394055848930650 1 0.7640556292979601 0.6319409659880333 2 1.236144370702040 0.9781158267720461 3 0.4722887414040793 0.6802518820559130 4 0.6885274466075678 0.6282485878721349 5 0.7016460077946312 0.6280282438453870 6 0.7030662791367996 0.6280257405372534 7 0.7032084067069250 0.6280257206060759 8 0.7032048702467216 0.6280257205928642 9 0.7032048403471922 0.6280257205928630 10 0.7032048298686234 0.6280257205928630 11 0.7032048193900549 0.6280257205928637 12 0.7032048193900549 0.6280257205928637 TEST_GLOMIN_ALL Test the Brent GLOMIN routine, which seeks a global minimizer of a function F(X) in an interval [A,B], given some upper bound M for F". h_01(x) = 2 - x A X B F(A) F(X) F(B) 7.00000000 9.00000000 9.00000000 -5.00000 -7.00000 -7.00000 h_01(x) = 2 - x A X B F(A) F(X) F(B) 7.00000000 9.00000000 9.00000000 -5.00000 -7.00000 -7.00000 h_02(x) = x * x A X B F(A) F(X) F(B) -1.00000000 0.00000000 2.00000000 1.00000 0.00000 4.00000 h_02(x) = x * x A X B F(A) F(X) F(B) -1.00000000 0.00000000 2.00000000 1.00000 0.00000 4.00000 h_03(x) = x^3 + x^2 A X B F(A) F(X) F(B) -0.50000000 0.00000000 2.00000000 0.125000 0.931583E-17 12.0000 h_03(x) = x^3 + x^2 A X B F(A) F(X) F(B) -0.50000000 0.00000001 2.00000000 0.125000 0.387210E-16 12.0000 h_04(x) = ( x + sin(x) ) * exp(-x*x) A X B F(A) F(X) F(B) -10.00000000 -0.67957866 10.00000000 -0.351770E-42 -0.824239 0.351770E-42 h_05(x) = ( x - sin(x) ) * exp(-x*x) A X B F(A) F(X) F(B) -10.00000000 -1.19513664 10.00000000 -0.392246E-42 -0.634905E-01 0.392246E-42 BRENT_TEST Normal end of execution. 22 January 2019 10:06:30.073 AM