RE: Looking for TVM contributions
(06-15-2024 09:52 PM)robve Wrote: Newton takes 103 evaluations total over all tests, Secant takes 151 evaluations (though they are a bit cheaper), Hybrid takes 104 evaluations and these are cheaper than Newton.
From your C code, I am guessing this is done with IEEE double?
What is g? Why is it needed?
With lua tvm(), it finished it all with 132+12 = 144 evaluations (last 3 was duplicated tests)
24 test samples, f evaluations + final rate included (mode BEGIN → END, for first 3 cases)
Code:
rate_test = {
{40,i,900-40,-40,-1000+40 ,4, 0.04753367188571021},
{40,i,900+1000,1000,-1000-1000 ,2, -0.49999999999997724},
{40,i,900-400,-400,-1000+400 ,3, 0.8000000000098451}, -- x2
{31536000,i,0,-.01,3331667.0067 ,8, 1.1694311188017701e-07},
{525600,i,0,-.01,5282.367769 ,6, 1.902587523612461e-08},
{525600,i,0,-.01,5260.382426 ,6, 3.170979198140072e-09}, -- x2
{32,i,1-1e6,0,1e6 ,3, 3.125001611329216e-08}, -- x2
{360,i,0,-1e3,1e6 ,7, 0.004980365840090327},
{328,i,35e3,-324,0 ,5, 0.008720569148340681},
{58,i,-775,-49.56,4e3 ,6, 0.0026058787514755544},
{32,i,-6e3,0,1e4 ,6, 0.016091394922276913},
{48,i,19198,-450,0 ,6, 0.004918000645880568},
{5,i,-369494,17500,540000 ,6, 0.1200000561803591},
{348,i,243400,-1363.29,0 ,5, 0.00437501742139102},
{30,i,-3200,-717.44,60000 ,6, 0.048750016694561145},
{60,i,243400,-1363.29,-222975.98,4, 0.00437499988799056},
{24,i,0,-50.26,1281.34 ,7, 0.005209314607602606},
{6,i,-32000,0,28346.96 ,4, -0.019999978033474884},
{60,i,8000,-150.97,0 ,7, 0.004166696417110639},
{456,i,270000,-1215.333333,0 ,6, 0.0036443486419549583},
{480,i,100000,-208.333333,0 ,6, -6.652806639543341e-12},
{10,i,50,-30,400 ,7, 0.1443587132807996},
{10,i,50,-30,80 ,5, -0.36893369874177734},
{10,i,-100,10,0 ,7, 0},
}
Update: tested again, but with i=false instead of i=nil, to use big sized edge.
Again, it finished in 132+12 = 144 evaluations (last 3 was duplicated tests)
Basically the same solved rate, except for #22 and #23, with 2 sign changes. (0 or 2 roots)
Code:
#22 n=10 pv=50 pmt=-30 fv=400
small edge = -30/400 = -0.075 --> i = 0.1443587132807996
big edge = -30/-50 = 0.60 --> i = 0.5317221326838473
#23 n=10 pv=50 pmt=-30 fv=80
small edge = -30/80 = -0.375 --> i = -0.36893369874177734
big edge = -30/-50 = 0.60 --> i = 0.5846195526622099
|