Changes between Version 8 and Version 9 of research/trig


Ignore:
Timestamp:
Oct 17, 2011, 12:39:30 PM (9 years ago)
Author:
sam
Comment:

add a solver for Mike Acton's attempts

Legend:

Unmodified
Added
Removed
Modified
  • research/trig

    v8 v9  
    3030{{{
    3131#!latex
    32 \[\max_{x \in [0, \pi^2/4]}{\big\lvert\sin(\sqrt{y}) - \sqrt{y}Q(y)\big\rvert} = E\]
     32\[\max_{y \in [0, \pi^2/4]}{\big\lvert\sin(\sqrt{y}) - \sqrt{y}Q(y)\big\rvert} = E\]
    3333}}}
    3434
     
    3737{{{
    3838#!latex
    39 \[\max_{x \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})}{\sqrt{y}} - Q(y)\bigg\rvert}{\dfrac{1}{|\sqrt{y}|}}} = E\]
     39\[\max_{y \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})}{\sqrt{y}} - Q(y)\bigg\rvert}{\dfrac{1}{|\sqrt{y}|}}} = E\]
    4040}}}
    4141
     
    4444{{{
    4545#!latex
    46 \[\max_{x \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})}{\sqrt{y}} - 1 - yR(y)\bigg\rvert}{\dfrac{1}{|\sqrt{y}|}}} = E\]
     46\[\max_{y \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})}{\sqrt{y}} - 1 - yR(y)\bigg\rvert}{\dfrac{1}{|\sqrt{y}|}}} = E\]
    4747}}}
    4848
     
    5151{{{
    5252#!latex
    53 \[\max_{x \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})-\sqrt{y}}{y\sqrt{y}} - R(y)\bigg\rvert}{\dfrac{1}{|y\sqrt{y}|}}} = E\]
     53\[\max_{y \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})-\sqrt{y}}{y\sqrt{y}} - R(y)\bigg\rvert}{\dfrac{1}{|y\sqrt{y}|}}} = E\]
    5454}}}
    5555
     
    7070
    7171RemezSolver<6> solver;
    72 solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 15);
     72solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 40);
    7373}}}
    7474
     
    8888{{{
    8989#!cpp
    90 a0 = -1.66666666666658080941942898789420724e-1;
    91 a1 = +8.33333333326271609442503773834687308e-3;
    92 a2 = -1.98412698200591143928364634696492885e-4;
    93 a3 = +2.75573160733868922065738227278330896e-6;
    94 a4 = -2.50518513021429359590028300127165228e-8;
    95 a5 = +1.60472959182597740337401201006549498e-10;
    96 a6 = -7.36458957326227991327065122848667046e-13;
     90a0 = -1.666666666666580938362041558393413542600e-1;
     91a1 = +8.333333333262715528278347301093116699226e-3;
     92a2 = -1.984126982005911547055378498482154233331e-4;
     93a3 = +2.755731607338689059680115311170244593349e-6;
     94a4 = -2.505185130214293461336864464029272975945e-8;
     95a5 = +1.604729591825977276746033955401272849354e-10;
     96a6 = -7.364589573262279656101943192883347174447e-13;
     97
     98E = 1.098969630370672683831702893969063712485e-16;
    9799}}}
    98100
     
    110112{{{
    111113#!latex
    112 \[\max_{x \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})-\sqrt{y}}{y\sqrt{y}} - R(y)\bigg\rvert}{\bigg\lvert\dfrac{\sin(y)}{y\sqrt{y}}\bigg\rvert}} = E\]
     114\[\max_{y \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})-\sqrt{y}}{y\sqrt{y}} - R(y)\bigg\rvert}{\bigg\lvert\dfrac{\sin(y)}{y\sqrt{y}}\bigg\rvert}} = E\]
    113115}}}
    114116
     
    128130
    129131RemezSolver<6> solver;
    130 solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 15);
     132solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 40);
    131133}}}
    132134
    133135{{{
    134136#!cpp
    135 a0 = -1.666666666666666587374325845020415990185e-1;
    136 a1 = +8.333333333333133768001243698120735518527e-3;
    137 a2 = -1.984126984109960366729319073763957206143e-4;
    138 a3 = +2.755731915499171528179303925040423384803e-6;
    139 a4 = -2.505209340355388148617179634180834358690e-8;
    140 a5 = +1.605725287696319345779134635418774782711e-10;
    141 a6 = -7.535968124281960435283756562793611388136e-13;
     137a0 = -1.666666666666618655330686951220600109093e-1;
     138a1 = +8.333333333285509269011390197274270193963e-3;
     139a2 = -1.984126982504390943378441670654599796999e-4;
     140a3 = +2.755731659890484005079622148869365590255e-6;
     141a4 = -2.505188017067512158000464673183918592305e-8;
     142a5 = +1.604809231079007402834515514014751626424e-10;
     143a6 = -7.373308642081174610234470417310065337523e-13;
     144
     145E = 1.536616934979294924070319645582179175464e-16;
    142146}}}
     147
     148=== Another example ===
     149
     150Trying to reproduce [http://www.insomniacgames.com/remez-exchange-algorithm/ Mike Acton]'s experimental result:
     151
     152{{{
     153#!latex
     154\[\max_{x \in [-1, 1]}{\dfrac{\big\vert\sin(\frac\pi{2}x) - P(x)\big\vert}{|\sin(\frac\pi{2}x)|}} = E\]
     155}}}
     156
     157Using `P(x) = xQ(x²)`:
     158
     159{{{
     160#!latex
     161\[\max_{y \in [0, 1]}{\dfrac{\bigg\lvert\dfrac{\sin(\frac\pi{2}\sqrt{y})}{\sqrt{y}} - Q(y)\bigg\rvert}{\bigg\lvert\dfrac{\sin(\frac\pi{2}y)}{\sqrt{y}}\bigg\rvert}} = E\]
     162}}}
     163
     164{{{
     165#!cpp
     166static real myfun(real const &y)
     167{
     168    real x = sqrt(y);
     169    return sin(real::R_PI_2 * x) / x;
     170}
     171
     172RemezSolver<4> solver;
     173solver.Run(real::R_1 >> 400, real::R_1, myfun, myfun, 40);
     174}}}
     175
     176{{{
     177#!cpp
     178a0 = +1.570796318452974170937444182514099057668;
     179a1 = -6.459637106518004316895285560913086847441e-1;
     180a2 = +7.968967893119537554369879233657335437244e-2;
     181a3 = -4.673766402124326801818077428151491285886e-3;
     182a4 = +1.514849803879821510688050931907848092814e-4;
     183
     184E = 5.310632770140865101487747414605249755889e-9;
     185}}}