diff --git a/misc/barycentric.toml b/misc/barycentric.toml index e69de29..9926402 100644 --- a/misc/barycentric.toml +++ b/misc/barycentric.toml @@ -0,0 +1,55 @@ +[[test_cases]] +func = "f2" +dist = "uniform" +X = [-10, -7.5, -5, -2.5, 0, 2.5, 5, 7.5, 10] +Y = [-11.108339669960661, -6.878958093651729, 5.1975968799277786, 9.0927909432625431, 0, -5.3185579371301186, 10.167124328859175, -8.514735068884323, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -14.060943782028404, -15.816759337749165, -16.636900766385637, -16.739657877337389, -16.305732894101243, -15.483032873970307, -14.391040805229295, -13.124788104993171, -11.75845067222554, -10.348590081862639, -8.9370609373581523, -7.5536048303535014, -6.2181507875676619, -4.9428415163899466, -3.7338041920486135, -2.5926839606175537, -1.5179577635127162, -0.50604552051933371, 0.44776486021958739, 1.3485627454336442, 2.2012149819650104, 3.0099062814193318, 3.7778055902394664, 4.5068448198245891, 5.1975968799277786, 5.8492405271757978, 6.4596001091653812, 7.0252488532009345, 7.541664917349152, 8.0034299900966529, 8.4044607935073343, 8.7382644133867373, 8.9982089485713173, 9.1778015400711076, 9.2709664094048637, 9.2723161040773689, 9.1774097167591841, 8.9829924133397153, 8.6872111736350761, 8.2898022171428124, 7.7922461548461598, 7.197887476681097, 6.5120155528900562, 5.7419048960967503, 4.8968129995471714, 3.9879346355724127, 3.0283120669395637, 2.0327011923675253, 1.0173942160951856, 0, -1.0008161746243909, -1.965631139912269, -2.8745978045618431, -3.7078111143227206, -4.4457020082838233, -5.0694548008001241, -5.5614428502859873, -5.9056768074922966, -6.0882591672739576, -6.0978382792437668, -5.9260544040980391, -5.5679698337887922, -5.0224745251066867, -4.2926581276283247, -3.3861387183709135, -2.3153379868867028, -1.097692045919008, 0.24421352586896577, 1.6825963711918806, 3.184530302176582, 4.7121116084535507, 6.2227523932366623, 7.6696151739330238, 9.0022035524352546, 10.167124328859175, 11.109037001100461, 11.771807161194426, 12.09988086807368, 12.039897644929018, 11.542560317989493, 10.564780482148201, 9.0721189474709433, 7.0415410892354858, 4.464507592759759, 1.3504216528879331, -2.2695457433861065, -6.3382302540677537, -10.767825573382424, -15.434788442756723, -20.174273378638128, -24.774072645620657, -28.96803643473343, -32.428947638138404, -34.76082504287297, -35.490628197662534, -34.059336638217553, -29.812375587818952, -21.98935968138522, -9.7131256926038942, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev" +X = [-10, -9.9589078550067268, -9.8768924214581953, -9.7542907183631117, -9.5916065424174766, -9.3895083977958968, -9.1488267491245385, -8.870550608923844, -8.555823473543943, -8.2059386242928702, -7.822333813066263, -7.4065853543164257, -6.9604016476381259, -6.4856161575882098, -5.9841798795864608, -5.4581533228569322, -4.9096980433535684, -4.3410677614631371, -3.7545991009847392, -3.1527019874414134, -2.5378497451792354, -1.9125689339470527, -1.2794289667205318, -0.64103155143310348, 0, 0.64103155143310348, 1.2794289667205318, 1.9125689339470527, 2.5378497451792354, 3.1527019874414134, 3.7545991009847392, 4.3410677614631371, 4.9096980433535684, 5.4581533228569322, 5.9841798795864608, 6.4856161575882098, 6.9604016476381259, 7.4065853543164257, 7.822333813066263, 8.2059386242928702, 8.555823473543943, 8.870550608923844, 9.1488267491245385, 9.3895083977958968, 9.5916065424174766, 9.7542907183631117, 9.8768924214581953, 9.9589078550067268, 10] +Y = [-11.108339669960661, -12.071503803943155, -12.690882266780462, -10.323380675768771, -6.9794754610768851, -11.034731391465881, -11.023519932003423, -7.5936079839028564, -11.083182282507123, -7.0926795645317693, -6.0246304477068679, -8.2413904489578396, -1.9125742023342971, 1.6863146697339826, 1.0365869428727004, 1.2417129745450855, 3.5797281275246505, 6.6318532596017578, 9.0763751041512655, 10.332440625249641, 10.277687326363218, 8.9884626389905369, 6.6475167026054932, 3.5309252197507079, 0, 7.820415996855034, 8.7215293228486932, 1.8757916699391045, -6.9018928185628096, -10.331206483996055, -5.604532334641785, 3.8873372563826648, 11.586483621442235, 12.217289841522942, 4.7890942832167438, -5.6867581729185556, -9.908324865529817, -7.0196117500641565, -8.3323163437053882, -3.6534006088482876, 4.6541860253477058, 4.7139727950923394, 10.274040257718466, 11.022295194171472, 6.7027680684807389, 9.2619538428281305, 10.732515855958097, 9.3844985099846528, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.56106058088457, -6.9950681183677382, -10.77582062887965, -11.946090828310018, -8.1037432069705052, -8.2569518981558798, -10.850454842515352, -10.230760866086491, -6.9998042626258228, -5.1973787230723656, -6.2349752800979813, -8.0832405704184764, -8.2046600999799646, -5.9396140507366341, -2.5550866244613373, 0.21866329457831299, 1.5250327206027318, 1.6335537569318907, 1.298675098657453, 1.047650634723531, 0.98799037814768832, 1.0698846299598692, 1.3547025421352676, 1.9952401296885709, 3.0282297447088354, 4.2683494169969862, 5.4371280431453935, 6.3873745954483374, 7.1902093283424018, 8.0061323799201318, 8.881321617445068, 9.6747375795058524, 10.183095287073714, 10.336425289741777, 10.272100548879589, 10.212643759648833, 10.257252479935428, 10.279672484157561, 10.033290904253592, 9.379878653358419, 8.4419722758102069, 7.5327566367021115, 6.9011807601608036, 6.4947676059707466, 5.9506289579077619, 4.8606841881927865, 3.1403471428696417, 1.2270134434721807, -0.068624122112342521, 0, 1.6560803022099076, 4.4160479785122585, 7.3063406551582901, 9.3454243131856097, 9.9901060725010074, 9.2847033535461229, 7.6633188297286175, 5.5859389000636972, 3.2769213429270803, 0.72659068714918027, -2.0959721011228546, -5.02456461591893, -7.6605402448776271, -9.5454385551763037, -10.394002722731658, -10.198985894570449, -9.1381479857608303, -7.38646997623702, -5.0112914481374342, -2.0396270146296909, 1.3827314338641362, 4.9120247117439494, 8.1014345709143104, 10.58920378104478, 12.201466308105437, 12.879406299973522, 12.532555396013402, 11.00947187044271, 8.2492949292537551, 4.4623670936002965, 0.14383186760294786, -4.0737606824689093, -7.5356707280338956, -9.5921617594987347, -9.8028690316803099, -8.4875189262357143, -7.0482460322284843, -7.0471149502488783, -8.2314186546345489, -7.9086153574859448, -3.8239146588802391, 2.0157024222461413, 4.8973897726965871, 4.5552465376694709, 6.519226877751269, 11.357037291333114, 10.791768606305378, 6.6689741048335295, 10.317913513039217, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev" +X = [-10, -9.9899308476637027, -9.9698026817739852, -9.9396357696877069, -9.8994604869281991, -9.8493172865996877, -9.7892566586544463, -9.7193390790536946, -9.6396349488734309, -9.5502245234165169, -9.4511978314023907, -9.342654584315777, -9.2247040760056752, -9.0974650726357169, -8.9610656930967074, -8.815643280001762, -8.6613442613939372, -8.4983240033056034, -8.32674665331802, -8.1467849752786353, -7.9586201753425367, -7.7624417195132127, -7.558447142866348, -7.346841850648746, -7.1278389114526573, -6.9016588426737681, -6.6685293884688754, -6.4286852904368259, -6.1823680512536241, -5.9298256914997092, -5.6713124999242544, -5.4070887773979511, -5.1374205748120974, -4.8625794251879026, -4.5828420702657516, -4.2984901818497308, -4.0098100781879977, -3.717092435674575, -3.4206319961628618, -3.1207272701855709, -2.8176802363799264, -2.5117960374207736, -2.203382672767771, -1.8927506885360427, -1.5802128648025643, -1.2660839006631385, -0.95068009735708167, -0.63431903977868739, -0.31731927669615856, 0, 0.31731927669615856, 0.63431903977868739, 0.95068009735708167, 1.2660839006631385, 1.5802128648025643, 1.8927506885360427, 2.203382672767771, 2.5117960374207736, 2.8176802363799264, 3.1207272701855709, 3.4206319961628618, 3.717092435674575, 4.0098100781879977, 4.2984901818497308, 4.5828420702657516, 4.8625794251879026, 5.1374205748120974, 5.4070887773979511, 5.6713124999242544, 5.9298256914997092, 6.1823680512536241, 6.4286852904368259, 6.6685293884688754, 6.9016588426737681, 7.1278389114526573, 7.346841850648746, 7.558447142866348, 7.7624417195132127, 7.9586201753425367, 8.1467849752786353, 8.32674665331802, 8.4983240033056034, 8.6613442613939372, 8.815643280001762, 8.9610656930967074, 9.0974650726357169, 9.2247040760056752, 9.342654584315777, 9.4511978314023907, 9.5502245234165169, 9.6396349488734309, 9.7193390790536946, 9.7892566586544463, 9.8493172865996877, 9.8994604869281991, 9.9396357696877069, 9.9698026817739852, 9.9899308476637027, 10] +Y = [-11.108339669960661, -11.374849536523451, -11.850710400260264, -12.389582514286172, -12.717886686797704, -12.454327200012486, -11.28108228213155, -9.3075501612111276, -7.4293089047942302, -7.1291856052055452, -9.2157199158178739, -12.187531793372048, -12.676973893816615, -9.4729097097713796, -6.7409091259031783, -8.9677759129252934, -12.208189338666841, -9.4248128645736566, -5.5307354919687245, -8.6627652969013445, -10.028033684022877, -4.3617153146750245, -5.3974168408911943, -7.8798359706814619, -1.6102888576105559, -3.3381899397175478, -3.8745244204091407, 2.2530508593284865, -2.0337026378733012, 2.9037425526383609, 3.5030130309773551, 2.3933551057986003, 8.1059554633887161, 3.5277511213071141, 10.400945460628374, 5.8529351043405401, 11.10107795557319, 8.0769427422546795, 10.934901333088142, 9.3780264413379658, 10.161268246752402, 9.4639378493462149, 8.7917370925084533, 8.3466337855157799, 6.8222029659310985, 6.1989839126742926, 4.3306150204299213, 3.2985973728203182, 1.4851636595648404, 0, 4.6768722628446991, 7.9628394213458989, 10.141175427765857, 9.1828394597223661, 7.2525671389458581, 2.7451414464599049, -1.4995456404466171, -5.8155601981999986, -9.1348274447895762, -9.3736731939580606, -10.168827940461034, -4.9878068827935034, -4.6811925429786669, 4.1582663929980995, 2.6855539927766813, 11.464837171063074, 7.2055089498430432, 11.520826935661954, 7.4515741369645911, 3.9095514297055762, 4.0440768457555342, -5.14512366976796, -3.503931503633557, -7.7076168421263106, -12.030568937138502, -7.1882159889494908, -9.9760531548859432, -10.350810585282303, -3.2819808804761736, -2.7573739596931149, -3.7614183195528803, 2.2799289485282062, 7.0570150557659649, 5.536195942218396, 4.6853893308054397, 8.4252907514773995, 12.280006444644747, 12.120184015515654, 9.2087408351576463, 6.9723325227080617, 6.9720978693327367, 8.4554689288749481, 9.9890327423740564, 10.718747860102318, 10.568632886586422, 9.8822742177412949, 9.0599319900668756, 8.3883207164793331, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.476184916332809, -7.152181398443366, -10.884034950253094, -12.367243111310568, -6.9672354524502829, -9.3544354352486195, -12.101368629816574, -6.3307027757878577, -7.4030828125915321, -10.415453933978585, -5.4619747754769936, -4.2786719500180856, -8.4331940086168779, -3.4313789687447708, -1.4697857228808155, -4.9440942268009417, -1.9192966704863919, 2.3057056702728121, -1.716883472581591, 0.18065051440357592, 5.8197366866805568, 1.4188458143086701, 2.6413123436522945, 8.4937701147818932, 4.5751808686355795, 4.8903584777839029, 10.302763993627268, 7.4146673417608712, 6.6557815341236497, 11.22704317970923, 9.5444242636126647, 7.838894796101161, 11.23793339641678, 10.664928914963041, 8.3879990958978911, 10.383655772839742, 10.601973961319532, 8.2444514845085636, 8.8193548606703663, 9.3418897052569312, 7.3284757378279036, 6.7619629467320281, 7.0692608602107689, 5.581127924907066, 4.4007860071268795, 4.1349200654339027, 3.0667285151760802, 1.8914606154937482, 0.80284544856276503, 0, 2.2001776194651835, 6.2310073238110497, 7.8844902723604841, 8.7001140894355118, 10.514953739878827, 9.9645555889986893, 7.7843069485756807, 7.2055653783137321, 4.9217959504728111, 0.34208401065869971, -1.4897636436298667, -3.2270120828770135, -7.9416321979124663, -9.2658624192400937, -8.085781252873517, -10.705333775461037, -10.599978295461282, -5.7427210724800691, -5.6543750457211811, -4.9368048454706213, 2.2125012666205043, 3.7194257864962823, 2.9521004565137928, 9.8449319004023567, 10.724567931538824, 6.6880466890124734, 11.336397010560577, 10.433251136814848, 3.2584840517517417, 5.3104841628737226, 3.3887919197382526, -4.6143398124490622, -4.2723099104535254, -4.5630990042012363, -10.880373337769834, -10.764611444431095, -6.8415672701597781, -11.007963988864633, -9.0587856685600169, -2.4927512789988502, -3.4434247372066835, -2.0112860360487584, 6.1791711435399129, 5.7710201604804343, 5.2575410065917123, 11.846506625338776, 10.843335616867465, 6.8135338627619998, 10.125794708950188, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev" +X = [-10, -9.9975077903531457, -9.9925239921703296, -9.9850498475185425, -9.9750872191113248, -9.9626385898445388, -9.9477070621775796, -9.9302963573601764, -9.9104108145049798, -9.8880553895061633, -9.8632356538043112, -9.8359577929978982, -9.8062286053017093, -9.7740554998525811, -9.7394464948628909, -9.7024102156222488, -9.6629558923478956, -9.6210933578843387, -9.5768330452528013, -9.5301859850510948, -9.4811638027045623, -9.4297787155687792, -9.376043529884732, -9.3199716375872343, -9.2615770129673764, -9.2008742091898383, -9.1378783546659367, -9.0726051492833072, -9.0050708604931633, -8.9352923192561067, -8.8632869158474988, -8.7890725955234397, -8.7126678540484339, -8.6340917330858585, -8.553363815452381, -8.4705042202375111, -8.3855335977895015, -8.2984731245688488, -8.209344497870675, -8.1181699304173069, -8.0249721448223999, -7.9297743679279866, -7.8326003250158605, -7.7334742338947386, -7.6324207988646756, -7.5294652045602344, -7.4246331096739473, -7.3179506405616319, -7.2094443847311555, -7.0991413842162704, -6.9870691288371727, -6.8732555493494624, -6.7577290104832138, -6.6405183038738899, -6.5216526408868633, -6.4011616453373316, -6.2790753461074416, -6.1554241696624622, -6.0302389324678715, -5.9035508333092476, -5.7753914455168769, -5.6457927090970186, -5.5147869227717851, -5.3824067359296239, -5.2486851404884049, -5.1136554626731434, -4.9773513547104055, -4.8398067864414684, -4.7010560368563233, -4.5611336855506327, -4.4200746041077699, -4.2779139474080898, -4.1346871448675954, -3.9904298916081847, -3.8451781395616778, -3.6989680885098421, -3.5518361770626473, -3.4038190735770004, -3.254953667018222, -3.1052770577665429, -2.9548265483709117, -2.8036396342524174, -2.6517539943596444, -2.4992074817782887, -2.3460381142973752, -2.1922840649344277, -2.0379836524219527, -1.883175331657608, -1.7278976841204359, -1.5721894082555495, -1.4160893098296694, -1.2596362922599129, -1.1028693469182466, -0.94582754341401929, -0.78855001985699633, -0.63107597310332191, -0.47344464898684087, -0.31569533253821419, -0.15786733819426564, 0, 0.15786733819426564, 0.31569533253821419, 0.47344464898684087, 0.63107597310332191, 0.78855001985699633, 0.94582754341401929, 1.1028693469182466, 1.2596362922599129, 1.4160893098296694, 1.5721894082555495, 1.7278976841204359, 1.883175331657608, 2.0379836524219527, 2.1922840649344277, 2.3460381142973752, 2.4992074817782887, 2.6517539943596444, 2.8036396342524174, 2.9548265483709117, 3.1052770577665429, 3.254953667018222, 3.4038190735770004, 3.5518361770626473, 3.6989680885098421, 3.8451781395616778, 3.9904298916081847, 4.1346871448675954, 4.2779139474080898, 4.4200746041077699, 4.5611336855506327, 4.7010560368563233, 4.8398067864414684, 4.9773513547104055, 5.1136554626731434, 5.2486851404884049, 5.3824067359296239, 5.5147869227717851, 5.6457927090970186, 5.7753914455168769, 5.9035508333092476, 6.0302389324678715, 6.1554241696624622, 6.2790753461074416, 6.4011616453373316, 6.5216526408868633, 6.6405183038738899, 6.7577290104832138, 6.8732555493494624, 6.9870691288371727, 7.0991413842162704, 7.2094443847311555, 7.3179506405616319, 7.4246331096739473, 7.5294652045602344, 7.6324207988646756, 7.7334742338947386, 7.8326003250158605, 7.9297743679279866, 8.0249721448223999, 8.1181699304173069, 8.209344497870675, 8.2984731245688488, 8.3855335977895015, 8.4705042202375111, 8.553363815452381, 8.6340917330858585, 8.7126678540484339, 8.7890725955234397, 8.8632869158474988, 8.9352923192561067, 9.0050708604931633, 9.0726051492833072, 9.1378783546659367, 9.2008742091898383, 9.2615770129673764, 9.3199716375872343, 9.376043529884732, 9.4297787155687792, 9.4811638027045623, 9.5301859850510948, 9.5768330452528013, 9.6210933578843387, 9.6629558923478956, 9.7024102156222488, 9.7394464948628909, 9.7740554998525811, 9.8062286053017093, 9.8359577929978982, 9.8632356538043112, 9.8880553895061633, 9.9104108145049798, 9.9302963573601764, 9.9477070621775796, 9.9626385898445388, 9.9750872191113248, 9.9850498475185425, 9.9925239921703296, 9.9975077903531457, 10] +Y = [-11.108339669960661, -11.175860921327545, -11.307853737340896, -11.497645546248846, -11.733867974708037, -11.999051786025694, -12.268187335789742, -12.507717655793471, -12.675622238624971, -12.723412249943789, -12.600901682209392, -12.264413147139629, -11.688471654816627, -10.879919473548897, -9.89176274583893, -8.8322002561710624, -7.8628144565928396, -7.1798335754153391, -6.9748990985370015, -7.377776019888318, -8.3926721552476635, -9.8500086170899137, -11.401874424258342, -12.585646443704889, -12.96110646313808, -12.292137260770334, -10.704986250667698, -8.7322292650597393, -7.170206141865373, -6.7517998698740756, -7.7495928392628183, -9.7204905918757733, -11.602543459075432, -12.224451203968647, -11.022667504687842, -8.5300759557114778, -6.2093768697977497, -5.5624391345579466, -7.008111668906321, -9.3783113589386542, -10.620067219780268, -9.3961474449122071, -6.3585077518586131, -3.8308386136086877, -3.8483501354679904, -6.1460379950601274, -8.1430198168246381, -7.3380915277011801, -3.9830703757598991, -1.1065226687410561, -1.3899213244830717, -4.0274098137590964, -5.3488797987985746, -3.0325225670395098, 0.87054206706672327, 2.1840079002391119, -0.10271433191956255, -2.2336135076921854, -0.46247043745037522, 3.7136820258697207, 5.3135608418435406, 2.8614391439202778, 0.79141286749492306, 3.1381235187386475, 7.3321296946861582, 7.8150933815616129, 4.6579732254130066, 3.7375460761596514, 7.450283078050594, 10.580027416134525, 8.6756350420659867, 5.6293853054918076, 7.33784146984729, 11.529081772427074, 11.438333592188877, 7.6599662966876254, 7.3313383619781265, 11.403061428628289, 12.701780675697984, 8.9326731412071356, 7.0876547162786729, 10.564670400684476, 12.649825652129788, 9.0679870318112789, 6.2347023998191082, 9.0992721828143951, 11.513337502528294, 8.0315296912476603, 4.6041302714906307, 7.0342002908008784, 9.5026523107872945, 5.9799414884261714, 2.2407430188569534, 4.4543482286713637, 6.8398992374055022, 3.1859922092000378, -0.65409398298437172, 1.5258497632673509, 3.7884242112163963, 0, -0.65396580491005295, 4.6065028197253298, 9.5188741115626721, 8.0316996424781535, 6.2582744606072221, 9.9850925599318475, 12.963507413533066, 9.4066033297815378, 5.5085967170281152, 7.0980676165008383, 8.2247077240045939, 3.168960814595118, -2.1523757142507097, -1.6678283462408935, -0.70110617058735964, -5.2852456043191854, -10.368186975333322, -9.4494895824985815, -6.7413670826446432, -8.9194885393714251, -12.573617190666443, -10.725233893091031, -5.7066028362542514, -4.7496855462317508, -6.9797555670023445, -5.3479951901466807, 0.64382981577354246, 4.1324136198113884, 2.7499443217722523, 2.3043632623347098, 6.6105869121869782, 11.154557538225983, 10.673934239594221, 7.5370539094497406, 7.610974912175714, 10.974821412277244, 12.094974793432663, 8.4412707301195951, 4.0996777873421253, 3.5648157756988843, 5.4276470914903407, 4.7766928412566593, 0.18491314838661559, -4.533970586026677, -5.5612723469627971, -3.8516581959436496, -3.5337335478479978, -6.6201418077502167, -10.760364106169623, -12.265458921456585, -10.320338180839415, -7.6062403869478, -7.1596251408518976, -9.2472639096257608, -11.388770754676462, -11.028681732222912, -7.9307386713535476, -4.1609939141723957, -2.0749266104936724, -2.3561916282723856, -3.6982668679826709, -4.0771512707038929, -2.3513966191431123, 1.0362899099204764, 4.5632529872433636, 6.7492381224490826, 7.0470804769316462, 6.0092559813339485, 4.7990585533274739, 4.4732822949431017, 5.4724545185028519, 7.523719072779669, 9.8958995222293739, 11.796024550543032, 12.696235902667725, 12.476053947879413, 11.378135726350423, 9.8497585429071438, 8.3608995775264001, 7.2669244770854252, 6.7448033459895962, 6.7975215926029576, 7.3022028852273604, 8.0737090977541697, 8.9218725909820093, 9.6906917315058109, 10.277049337651351, 10.632516850670788, 10.754332583068303, 10.671571270254399, 10.431052062760209, 10.085672046293728, 9.6862302028021608, 9.2766867204362333, 8.89219745508369, 8.5590577635983987, 8.2957339358337068, 8.1143233122190577, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.54705600784315, -7.0067415684885992, -10.730827246725448, -12.275116216909654, -7.0943271225366892, -9.4118211728247377, -11.927531732130777, -6.5137932847777735, -7.2446360333957772, -10.553364536611135, -5.3401276246944586, -4.4246508233908423, -8.2573884402887813, -3.6652143303309456, -1.1841570707410191, -5.2438650200157457, -1.6518033366918553, 2.1765237660650831, -1.8075362276120481, 0.49223075719445411, 5.3749887264004858, 1.7915687306006668, 2.5944555259543562, 8.1079545942370568, 5.2015518179859038, 4.4563829506600254, 10.155804970347098, 8.1341763301763927, 5.8919082813741999, 11.326262361670604, 10.343453855148919, 6.772591197534796, 11.50484053168684, 11.638645705369455, 7.0215707934159037, 10.668284818794571, 11.909868297850998, 6.6184491695041838, 8.8826903310079466, 11.139705115119014, 5.6022019195095321, 6.2966854408413848, 9.4050178368781316, 4.0673192403813282, 3.1274399308155933, 6.8733285239395936, 2.1542913971529577, -0.37648300737413753, 3.8487465561343472, 0, 0.34982989532537126, 7.8240633904731734, 8.7088514160079511, 6.3633864807850615, 11.572261076150326, 11.378808323215536, 5.6512904968207369, 7.6051762373480582, 6.5486551062030542, -1.341476156727045, -1.5537323552964674, -1.6936759510768605, -9.1787258510382862, -9.5274049350731256, -6.8004905047184404, -11.627296500854147, -10.844450512835312, -4.7428568661483351, -6.4046139199579157, -5.0315458514515647, 2.9270829072227638, 3.0584143764817912, 3.0724204065690397, 10.247957751582047, 10.1710792669173, 7.0186087775255523, 11.372289125176617, 10.116982322445896, 3.6549518465752677, 5.0310792556266478, 3.4562855630210074, -4.5031588410696618, -4.4903984088687811, -4.2996347915471136, -11.116626482908856, -10.572312374619553, -6.9936753504342566, -10.896002991999492, -9.1661726079702599, -2.3877368399959511, -3.5735555310081996, -1.8609470088702754, 6.0496227087650586, 5.8125448967406934, 5.3548383380271433, 11.775546931560864, 10.733011129200664, 6.7099558127565141, 10.175229661772052, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev_2" +X = [-10, -9.9785892323860351, -9.9144486137381041, -9.8078528040323045, -9.6592582628906829, -9.4693012949510566, -9.2387953251128676, -8.968727415326883, -8.6602540378443865, -8.3146961230254524, -7.9335334029123516, -7.518398074789774, -7.0710678118654752, -6.5934581510006887, -6.0876142900872064, -5.5557023301960222, -5, -4.4228869021900128, -3.8268343236508977, -3.2143946530316158, -2.5881904510252076, -1.9509032201612827, -1.3052619222005159, -0.65403129230143067, 0, 0.65403129230143067, 1.3052619222005159, 1.9509032201612827, 2.5881904510252076, 3.2143946530316158, 3.8268343236508977, 4.4228869021900128, 5, 5.5557023301960222, 6.0876142900872064, 6.5934581510006887, 7.0710678118654752, 7.518398074789774, 7.9335334029123516, 8.3146961230254524, 8.6602540378443865, 8.968727415326883, 9.2387953251128676, 9.4693012949510566, 9.6592582628906829, 9.8078528040323045, 9.9144486137381041, 9.9785892323860351, 10] +Y = [-11.108339669960661, -11.653135317102755, -12.650957212708364, -11.724784749412455, -7.7860052803520979, -8.7055167370460125, -12.832356591769076, -6.7756833364342959, -12.213109425752846, -5.5153879240664344, -9.4893368428608686, -6.4286770598700052, -0.83923327379164615, -1.4285855451800903, -1.8041949032021551, 1.0469526227701115, 5.1975968799277786, 8.7493341704046313, 11.035728537268166, 11.989554205471659, 11.66269767671793, 10.117661428736977, 7.4747255658646066, 3.9750936002597154, 0, 7.5478898799075749, 7.8581523310930924, 0.29768860091266607, -8.791074164909253, -11.936611394456155, -6.7834557936021352, 2.7074892073694679, 10.167124328859175, 11.382706913352812, 5.6721621415381328, -4.6044490417419058, -12.252066141749254, -8.9671213271592559, -4.0363336950148384, -3.9252669941447716, 7.0490674454996312, 4.7845706511863335, 12.488947230763426, 8.6857016496602971, 7.2424666924806242, 10.301688591983598, 10.370804135474245, 8.777541090426744, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.610910437784627, -6.5372457880872476, -11.33739422503911, -11.892331705355108, -6.820699410335516, -9.9534529166286409, -11.980013049193048, -7.3477674082043266, -4.8838675662842964, -8.1706729866409266, -10.798840695882103, -8.3612743785519617, -3.6880132458380414, -1.0568300792039027, -0.99552501684604431, -1.4992964842709005, -1.4367106980706754, -1.2984825372611242, -1.6001298739394844, -1.8377004180766782, -1.1473580779474459, 0.58820233997797405, 2.6238757178344861, 4.1879474137233724, 5.1975968799277786, 6.1418272078667554, 7.4219273498263856, 8.9169137622176509, 10.158468207183064, 10.830638043308101, 11.052956750476574, 11.210576790187603, 11.561562291470854, 12.019894159242498, 12.286645688616567, 12.15673037866437, 11.695303545311891, 11.141744638285778, 10.668161064598462, 10.236587842495649, 9.6772616410094487, 8.8868027819847661, 7.9356431406331825, 6.9744497694615528, 6.0382888735365822, 4.9654875610111481, 3.5581769931026521, 1.882831502196412, 0.44160204896258312, 0, 1.114415331571994, 3.668335442650989, 6.7769981005341353, 9.1892829969356174, 9.9574458343126364, 8.9294995172392094, 6.7245970414586779, 4.2187101602415337, 1.9278963749078393, -0.24963328816125038, -2.7533135953233123, -5.7911820361303299, -8.9680789924296013, -11.440219272652028, -12.485849713244174, -12.016540746570437, -10.583150377786144, -8.8578795519445518, -7.0483424960499839, -4.790217041841834, -1.6461998708677511, 2.2475853901946452, 6.0462332315691172, 8.784608676483862, 10.167124328859175, 10.739278938253137, 11.173233994034133, 11.361901116057352, 10.370672341113061, 7.4673429868817412, 3.1446657558588904, -1.1920354815098419, -4.709211559713413, -7.902795810540997, -11.240909856323195, -13.285850138601473, -11.655290011908458, -6.880650516055223, -3.5982703624321323, -4.8179571823399737, -6.0152272262179287, -0.96807345742915972, 6.1398200432229461, 6.2811939641884176, 5.1068478215123907, 11.421026067760628, 11.286727562875263, 6.2690943745153103, 10.238236887998172, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev_2" +X = [-10, -9.9948621620068787, -9.9794539275033634, -9.953791129491982, -9.9179001382324611, -9.8718178341445013, -9.8155915699106535, -9.7492791218182361, -9.6729486303902942, -9.5866785303666062, -9.4905574701066867, -9.384684220497604, -9.2691675734602176, -9.1441262301581248, -9.0096886790241913, -8.8659930637300006, -8.7131870412338935, -8.5514276300534617, -8.3808810489184066, -8.2017225459695588, -8.0141362186795666, -7.8183148246802981, -7.6144595836913444, -7.4027799707531554, -7.1834935009772758, -6.956825506034864, -6.7230089026131679, -6.482283953077884, -6.2348980185873353, -5.9811053049121596, -5.7211666012216965, -5.4553490121054867, -5.1839256831052503, -4.9071755200393789, -4.6253829024083528, -4.3388373911755812, -4.0478334312239382, -3.7526700487937413, -3.4536505442130763, -3.1510821802362069, -2.8452758663103244, -2.5365458390950739, -2.225209339563144, -1.911586287013723, -1.5959989503337922, -1.2787716168450601, -0.96023025907681763, -0.64070219980712923, -0.32051577571655174, 0, 0.32051577571655174, 0.64070219980712923, 0.96023025907681763, 1.2787716168450601, 1.5959989503337922, 1.911586287013723, 2.225209339563144, 2.5365458390950739, 2.8452758663103244, 3.1510821802362069, 3.4536505442130763, 3.7526700487937413, 4.0478334312239382, 4.3388373911755812, 4.6253829024083528, 4.9071755200393789, 5.1839256831052503, 5.4553490121054867, 5.7211666012216965, 5.9811053049121596, 6.2348980185873353, 6.482283953077884, 6.7230089026131679, 6.956825506034864, 7.1834935009772758, 7.4027799707531554, 7.6144595836913444, 7.8183148246802981, 8.0141362186795666, 8.2017225459695588, 8.3808810489184066, 8.5514276300534617, 8.7131870412338935, 8.8659930637300006, 9.0096886790241913, 9.1441262301581248, 9.2691675734602176, 9.384684220497604, 9.4905574701066867, 9.5866785303666062, 9.6729486303902942, 9.7492791218182361, 9.8155915699106535, 9.8718178341445013, 9.9179001382324611, 9.953791129491982, 9.9794539275033634, 9.9948621620068787, 10] +Y = [-11.108339669960661, -11.246445675959928, -11.632809127845345, -12.165308840760423, -12.626029420833724, -12.663821401656289, -11.890636378796792, -10.178366358832497, -8.0840326124867932, -6.9707386849489256, -8.160471296003844, -11.16883541077853, -12.96942322909213, -10.888225697415845, -7.2460198338280356, -7.6903004280640598, -11.59299773259149, -10.974187590147918, -6.1213333012024326, -7.1990984600739617, -10.612617584921849, -5.8963870177715176, -4.1386643524003514, -8.250122360558388, -3.12311739398961, -1.9912962595084982, -5.0346107914774665, 1.7451843764578487, -1.1515635174018261, 1.1431664438822872, 4.6197035727511622, 1.2881157742577813, 8.223702684940343, 3.5607286232707373, 9.6649981231664464, 6.5822768717070804, 10.054329061551135, 9.0221751202399891, 9.9415581936232802, 10.284146156816351, 9.3580073253885838, 10.237744169726804, 8.1945579181885944, 8.957227213904344, 6.4115086888864093, 6.6256545267504648, 4.0890319672121825, 3.5195594269502216, 1.4051610338771545, 0, 4.8152196479127981, 7.8273907719219368, 10.444814309934501, 8.744115501635102, 7.5468652102292431, 1.9183852792600934, -1.1756654773726404, -6.8484894137845769, -8.4959257884765426, -10.28324566255068, -8.987367620336974, -5.570413900458723, -3.1621076280042318, 3.9106037049034072, 3.7976080967794254, 11.597379872248596, 6.9695361280848797, 12.197404763648705, 5.620160143099864, 4.7392254063371981, 2.1166526830927951, -5.6813171088312738, -3.2759025985718181, -9.7843448854629576, -10.986170439681979, -7.0011152218887846, -11.142723396983594, -8.4865356482876383, -2.1870209809804071, -3.5960026286896659, -2.497651150002411, 4.4908131943663169, 7.0434533115764882, 4.7662582509521748, 5.5840740704649093, 10.113419774676205, 12.728496616982918, 11.152765713536668, 8.1172408498106245, 6.7100492695941434, 7.476011411549942, 9.1482732647095771, 10.411324281038497, 10.747327982363376, 10.315275424739592, 9.5264996339855171, 8.7488145265738081, 8.21117953489359, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.562448536244823, -7.0274585255479176, -10.755103078123181, -12.331555480886593, -7.1078532391704062, -9.3340972595824961, -12.001957431312809, -6.4829421331943631, -7.2398368145715085, -10.577794982390806, -5.2971459370633563, -4.452922764826821, -8.2470405670978281, -3.6211575526376629, -1.2997916838481265, -5.0564895116425271, -1.9063944867370687, 2.4165295627463434, -1.9311703000225388, 0.41897554073840818, 5.6765219583213552, 1.370109756978303, 2.8776827683585812, 8.20988397063857, 4.6977359484212439, 5.0494857850151974, 9.9641994150869161, 7.6449020328454873, 6.7685403618118305, 10.844624576264034, 9.8258419263129668, 7.9763452399336323, 10.791502638581975, 10.93380196076512, 8.6351988985909995, 9.8739047526990376, 10.760622791056486, 8.6687044297099929, 8.3163475568034313, 9.2673700328665547, 7.919723322982982, 6.419950198168789, 6.6830910062077504, 6.2002998623431815, 4.3936208384580338, 3.4993149223169848, 3.4784177537637424, 2.2828909172685435, 0.14282643612606684, 0, 2.8376857762300353, 5.8289916066306213, 7.5029179454240376, 9.328660426151796, 10.496012721096915, 9.3711110652326643, 8.177778428372007, 7.5162216338902117, 4.3476199334702559, 0.4343664543698451, -1.0182508570887446, -3.6427677771427664, -8.076140819719748, -8.7856400323793111, -8.3305583453104044, -10.947093912948819, -10.181554480137351, -5.8798470002362924, -5.9083828404398988, -4.582971827476133, 2.103091857029943, 3.5136867117405165, 3.259554104355309, 9.6983040592995995, 10.617267483417049, 6.9405433060179339, 11.126116599236149, 10.477119158698263, 3.3834192523380681, 5.1032736462935441, 3.5737688393161844, -4.7089091651665878, -4.2841449144108184, -4.4671085483021209, -11.023851645341646, -10.606030425649204, -6.9956250994098622, -10.865087853781562, -9.1928057529819418, -2.3616642092391343, -3.5745689030031542, -1.8893469034425365, 6.0993081524718147, 5.7564011124602219, 5.3669141302520888, 11.817732539342941, 10.743862460790853, 6.7180699528032098, 10.190634291382609, 8.021975324900445] + +[[test_cases]] +func = "f2" +dist = "chebyshev_2" +X = [-10, -9.9987412767387504, -9.9949654238318513, -9.9886733918300798, -9.9798667647188439, -9.9685477595194234, -9.954719225730846, -9.9383846446125415, -9.919548128307953, -9.8982144188093273, -9.8743888867639434, -9.8480775301220806, -9.819286972627067, -9.7880244621477873, -9.7542978688540705, -9.7181156832354169, -9.6794870139635627, -9.6384215855994207, -9.5949297361449739, -9.5490224144407389, -9.5007111774094538, -9.4500081871466849, -9.3969262078590838, -9.3414786026510672, -9.2836793301607261, -9.223542941045814, -9.1610845743206961, -9.0963199535451837, -9.0292653828662122, -8.9599377429133587, -8.8883544865492347, -8.8145336344758203, -8.7384937706978496, -8.6602540378443865, -8.5798341323497703, -8.4972542994951437, -8.4125353283118117, -8.3256985463477136, -8.2367658142983276, -8.1457595205033571, -8.052702575310586, -7.9576184053083213, -7.8605309474278747, -7.7614646429175682, -7.6604444311897804, -7.5574957435425828, -7.452644496757547, -7.3459170865753326, -7.2373403810507016, -7.1269417137886287, -7.0147488770632127, -6.9007901148211199, -6.7850941155713218, -6.6676900051629162, -6.5486073394528506, -6.4278760968653933, -6.305526670845225, -6.1815898622060521, -6.0560968713766666, -5.9290792905464046, -5.8005690957119818, -5.6705986386277073, -5.5392006386611027, -5.4064081745559758, -5.2722546761050242, -5.1367739157340636, -5, -4.8619673610046868, -4.7227107477268271, -4.5822652172741039, -4.4406661260577412, -4.2979491208917161, -4.1541501300188643, -4.0093053540661369, -3.8634512569312864, -3.7166245566032752, -3.5688622159187184, -3.4202014332566873, -3.2706796331742164, -3.1203344569848711, -2.9692037532827487, -2.817325568414297, -2.66473813690035, -2.511479871810792, -2.3575893550942723, -2.2031053278654063, -2.0480666806519068, -1.892512443604102, -1.7364817766693035, -1.580013959733499, -1.4231483827328514, -1.2659245357374927, -1.1083819990101101, -0.95056043304182664, -0.79249956856788453, -0.6342391965656451, -0.47581915823742297, -0.31727933498067652, -0.15865963834807928, 0, 0.15865963834807928, 0.31727933498067652, 0.47581915823742297, 0.6342391965656451, 0.79249956856788453, 0.95056043304182664, 1.1083819990101101, 1.2659245357374927, 1.4231483827328514, 1.580013959733499, 1.7364817766693035, 1.892512443604102, 2.0480666806519068, 2.2031053278654063, 2.3575893550942723, 2.511479871810792, 2.66473813690035, 2.817325568414297, 2.9692037532827487, 3.1203344569848711, 3.2706796331742164, 3.4202014332566873, 3.5688622159187184, 3.7166245566032752, 3.8634512569312864, 4.0093053540661369, 4.1541501300188643, 4.2979491208917161, 4.4406661260577412, 4.5822652172741039, 4.7227107477268271, 4.8619673610046868, 5, 5.1367739157340636, 5.2722546761050242, 5.4064081745559758, 5.5392006386611027, 5.6705986386277073, 5.8005690957119818, 5.9290792905464046, 6.0560968713766666, 6.1815898622060521, 6.305526670845225, 6.4278760968653933, 6.5486073394528506, 6.6676900051629162, 6.7850941155713218, 6.9007901148211199, 7.0147488770632127, 7.1269417137886287, 7.2373403810507016, 7.3459170865753326, 7.452644496757547, 7.5574957435425828, 7.6604444311897804, 7.7614646429175682, 7.8605309474278747, 7.9576184053083213, 8.052702575310586, 8.1457595205033571, 8.2367658142983276, 8.3256985463477136, 8.4125353283118117, 8.4972542994951437, 8.5798341323497703, 8.6602540378443865, 8.7384937706978496, 8.8145336344758203, 8.8883544865492347, 8.9599377429133587, 9.0292653828662122, 9.0963199535451837, 9.1610845743206961, 9.223542941045814, 9.2836793301607261, 9.3414786026510672, 9.3969262078590838, 9.4500081871466849, 9.5007111774094538, 9.5490224144407389, 9.5949297361449739, 9.6384215855994207, 9.6794870139635627, 9.7181156832354169, 9.7542978688540705, 9.7880244621477873, 9.819286972627067, 9.8480775301220806, 9.8743888867639434, 9.8982144188093273, 9.919548128307953, 9.9383846446125415, 9.954719225730846, 9.9685477595194234, 9.9798667647188439, 9.9886733918300798, 9.9949654238318513, 9.9987412767387504, 10] +Y = [-11.108339669960661, -11.142564456435025, -11.243712344467734, -11.406904786403584, -11.623050801187021, -11.877547644802365, -12.148780652787803, -12.406817627119865, -12.612884944807969, -12.720403922384561, -12.678482618344902, -12.438681480364234, -11.965448506302122, -11.249704131700872, -10.323586802017283, -9.2724912928820112, -8.2387245690490495, -7.4102623246586501, -6.9894279470694705, -7.1409849017283657, -7.9274818839550546, -9.2503023244094287, -10.823822191571426, -12.211172845843857, -12.93689688890557, -12.66168942398339, -11.363734465383157, -9.43794496918751, -7.6249424715611978, -6.737257508661316, -7.2575671707997445, -8.9988238680548544, -11.06023162664628, -12.213109425752846, -11.60445939647557, -9.3907148818648524, -6.8190624010448796, -5.5276844836056381, -6.3861322945815424, -8.6897372075229503, -10.481258095015854, -10.009503292874629, -7.2905241496415483, -4.3403543101486034, -3.5519710088462039, -5.4216669733149095, -7.8161632973454764, -7.8659829066803347, -4.9413727000990448, -1.59126491079899, -1.0011209262971215, -3.3599762329152915, -5.3432918454522792, -3.8512698617913191, 0.081699329370185, 2.2541838788787731, 0.5529746181007947, -2.0421924661541783, -1.1613524094355459, 2.9280777119236539, 5.3703348009610669, 3.4852771883117419, 0.88832793352992971, 2.4125615340326319, 6.7390692613272447, 8.0999676576671568, 5.1975968799277786, 3.5313910813946529, 6.7253773693949265, 10.407505012181413, 9.1988648753508308, 5.8456451484493093, 6.811070225176178, 11.113268285214609, 11.770201422084081, 8.0654994596581389, 7.0580207999013457, 10.947319337157553, 12.862405137537377, 9.3664817822539337, 6.9979630181009735, 10.171569755469588, 12.712377149129729, 9.4539644220308694, 6.2417538788900923, 8.7994233374322511, 11.536664867704571, 8.338811004808709, 4.6430364901250953, 6.8274442839596437, 9.5169340721585957, 6.19358148096679, 2.2742289573695217, 4.3336610575327948, 6.8520530309380993, 3.2958270226176211, -0.64013769900265064, 1.4861641197997842, 3.7920919319211047, 0, -0.64213323456543261, 4.6751420641735967, 9.5434233860854251, 7.9645351949100645, 6.2865955745846294, 10.137338271844012, 12.946241387534492, 9.1883700145268594, 5.4649637998959174, 7.2487648533033026, 8.1033862368720074, 2.7556790022818771, -2.3001777500323081, -1.5037540475968425, -0.84644808265311946, -5.8022329233512799, -10.544355713207025, -9.1429294821400481, -6.7026194545024877, -9.3619630984760061, -12.696348404278814, -10.183569879288254, -5.3009069055565359, -4.9810318839404218, -7.1031881272787189, -4.6996206179071993, 1.4151133895705168, 4.1590282775745101, 2.4536700064529555, 2.6737104713238186, 7.4887982968636177, 11.458635886331782, 10.167124328859175, 7.2127799770912856, 8.0882835828167243, 11.507288422631042, 11.72979841199694, 7.4792145215689068, 3.6426946658258913, 3.8985466618717069, 5.6351910450612144, 4.0679912249024837, -0.99973684517089339, -5.1303698054933553, -5.2818982453846602, -3.5125169488284135, -3.9773033988081341, -7.6738716434099697, -11.475674610722343, -12.041465860384855, -9.5532450974303648, -7.1984161389053563, -7.535882746297335, -9.9527578539798047, -11.602073716157039, -10.377400674773992, -6.8049227846743492, -3.3093076304513444, -1.9389297896250498, -2.7418083557694704, -3.9974675785579506, -3.7774083699722471, -1.4031682580609978, 2.2324367450086221, 5.4711584408169236, 7.0490674454996312, 6.7963160275539407, 5.555721947826284, 4.5488451580292004, 4.6721819774905089, 6.1110195279175511, 8.3831489485080644, 10.678412406094191, 12.26014005162375, 12.738633160240796, 12.141885268096079, 10.816066243724538, 9.2439375253342969, 7.8698925803379635, 6.9871139183120369, 6.701654094119661, 6.9581516325035482, 7.5986832449000794, 8.4273459799643248, 9.2621149508173113, 9.9661343272976369, 10.458947566832133, 10.712842155935885, 10.740822858778694, 10.581886005340218, 10.287460303040233, 9.9110010082461587, 9.5012552972079251, 9.0988014771312078, 8.735042190096032, 8.4327552245140332, 8.2074224185904396, 8.0687487029163686, 8.021975324900445] +xx = [-10, -9.8, -9.6, -9.4, -9.2, -9, -8.8, -8.6, -8.4, -8.2, -8, -7.8, -7.6, -7.4, -7.2, -7, -6.8, -6.6, -6.4, -6.2, -6, -5.8, -5.6, -5.4, -5.2, -5, -4.8, -4.6, -4.4, -4.2, -4, -3.8, -3.6, -3.4, -3.2, -3, -2.8, -2.6, -2.4, -2.2, -2, -1.8, -1.6, -1.4, -1.2, -1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.2, 4.4, 4.6, 4.8, 5, 5.2, 5.4, 5.6, 5.8, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +yy = [-11.108339669960661, -11.545424943502348, -7.0104725204952485, -10.734729883211264, -12.27371301387994, -7.0952064198176398, -9.4085868506979078, -11.930356991894913, -6.5173357465618653, -7.2457716966929965, -10.552658487322979, -5.3387495734263075, -4.4235596942685063, -8.2574543160029726, -3.6671307006851533, -1.1877927452553387, -5.2474973207209153, -1.6526446771724851, 2.1795172814121403, -1.8040130594528011, 0.49149334746008881, 5.3710331357519447, 1.7911321237685376, 2.5983728405120301, 8.1083323995914088, 5.1975968799277786, 4.4571085941077137, 10.159429862526761, 8.1316567136701999, 5.8898320594550057, 11.330152652176053, 10.342542119228544, 6.7695268629360021, 11.508482605508412, 11.638174183624814, 7.0184696940561027, 10.672031037210189, 11.90878419680489, 6.6160045818938003, 8.8866400009207146, 11.13732462445486, 5.6012666424472722, 6.3002174367473097, 9.4013765237454803, 4.0686223411392069, 3.1292846555598017, 6.8695581776511611, 2.1576664271680426, -0.37761691978076073, 3.8475569241607139, 0, 0.34864026335173791, 7.8229294780665502, 8.712226446023036, 6.359616134496629, 11.574105800894535, 11.380111423973415, 5.6476491836880856, 7.6087082332539831, 6.5477198291407943, -1.3438566473911986, -1.5497826853836994, -1.696120538687244, -9.1798099520843946, -9.5236587166575079, -6.8035916040782414, -11.627768022598787, -10.840808439013741, -4.745921200747129, -6.4055256558782902, -5.0276555609461159, 2.9250066853035696, 3.0558947599755983, 3.0760452987487031, 10.248683395029736, 10.167124328859175, 7.0189865828799044, 11.376206439734291, 10.116545715613766, 3.6509962559267266, 5.0303418458922825, 3.4598087311802544, -4.5001653257226045, -4.4912397493494109, -4.3032670922522832, -11.120262157423176, -10.574228744973761, -6.9937412261484479, -10.894911862877156, -9.1647945567021088, -2.3870307907077949, -3.5746911943054189, -1.8644894706543672, 6.0467974490009224, 5.8157792188675233, 5.3539590407461927, 11.776950134590578, 10.729108492714848, 6.7062248607498648, 10.176860726112854, 8.021975324900445] \ No newline at end of file diff --git a/misc/generate.py b/misc/generate.py new file mode 100755 index 0000000..d4bb6fa --- /dev/null +++ b/misc/generate.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +import argparse +from concurrent.futures import ProcessPoolExecutor +from mpmath import mp + +mp.dps = 30 + +precision = 17 +zero_threshold = mp.mpf('1e-20') + +nn = 101 + + +def uniform(n): + return [0] if n == 1 else [2 * mp.mpf(k) / (n-1) - 1 for k in range(n)] +def chebyshev(n): + return [-mp.cos((2*k - 1) * mp.pi / (2*n)) for k in range(1, n + 1)] +def chebyshev_2(n): + return [mp.sin(mp.pi / 2 * x) for x in uniform(n)] + + +def f2(x): + return -3*mp.sin(10*x) + 10*mp.sin(mp.fabs(x) + x/2) + + +test_cases = [] + +for func in [f2]: + for dist in [uniform]: + for n in [9]: + for a, b in [(-10, 10)]: + test_cases.append((func, dist, n, a, b)) + +for func in [f2]: + for dist in [chebyshev, chebyshev_2]: + for n in [49, 99, 199]: + for a, b in [(-10, 10)]: + test_cases.append((func, dist, n, a, b)) + + +def stretched(points, a, b): + if not points: + return [] + if len(points) == 1 or min(points) == max(points): + return [(a+b)/2] * len(points) + return [a + (p-min(points)) * (b-a) / (max(points)-min(points)) for p in points] + + +def format_number(number): + return '0' if abs(number) < zero_threshold else mp.nstr(number, n=precision).removesuffix('.0') + + +def format_array(array): + return '[' + ', '.join(format_number(x) for x in array) + ']' + + +def format_test_case(func, dist, X, Y, xx, yy): + return '\n'.join([ + '[[test_cases]]', + f'func = "{func.__name__}"', + f'dist = "{dist.__name__}"', + f'X = {format_array(X)}', + f'Y = {format_array(Y)}', + f'xx = {format_array(xx)}', + f'yy = {format_array(yy)}', + ]) + + +def barycentric(X, Y, xx, dist, epsilon): + n = len(X) + nn = len(xx) + + if dist == 'uniform': + c = [(-1)**k * mp.binomial(n - 1, k) for k in range(n)] + elif dist == 'chebyshev': + c = [(-1)**k * mp.sin(((2 * k + 1) * mp.pi) / (2 * n)) for k in range(n)] + elif dist == 'chebyshev_2': + c = [(-1)**k * (mp.mpf('1/2') if k == 0 or k == n - 1 else mp.mpf(1)) for k in range(n)] + else: + raise ValueError(f'Unexpected distribution type: {dist!r}') + + numer = [mp.mpf(0)] * nn + denom = [mp.mpf(0)] * nn + exact = [-1] * nn + + for k in range(n): + for i, xi in enumerate(xx): + xdiff = xi - X[k] + if mp.fabs(xdiff) < epsilon: + exact[i] = k + else: + temp = c[k] / xdiff + numer[i] += temp * Y[k] + denom[i] += temp + + yy = [Y[exact[i]] if exact[i] != -1 else numer[i] / denom[i] for i in range(nn)] + return yy + + +def generate_test_case(params): + func, dist, n, a, b = params + X = stretched(dist(n), a, b) + Y = [func(x) for x in X] + xx = stretched(uniform(nn), a, b) + yy = barycentric(X, Y, xx, dist.__name__, zero_threshold) + return format_test_case(func, dist, X, Y, xx, yy) + + +def generate_test_cases(): + with ProcessPoolExecutor() as executor: + results = list(executor.map(generate_test_case, test_cases)) + return '\n\n'.join(results) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('-o', '--output', type=str, help='Output file') + args = parser.parse_args() + output = generate_test_cases() + if not args.output: + print(output, end='') + else: + with open(args.output, 'w') as file: + file.write(output) + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/verify_data.py b/verify_data.py index 1adecca..aae40e1 100755 --- a/verify_data.py +++ b/verify_data.py @@ -12,4 +12,5 @@ def check_data(original, generator): execute_command(['diff', original, tmpfile.name]) check_data('dist/dist.toml', 'dist/generate.py') -check_data('poly/poly.toml', 'poly/generate.py') \ No newline at end of file +check_data('poly/poly.toml', 'poly/generate.py') +check_data('misc/barycentric.toml', 'misc/generate.py') \ No newline at end of file