xoxos evolves practical dsp forever

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS
SynthEdit

Post

edit: http://xoxos.net/sincos_approximation.pdf
-----------------------------------------------------------

hi everyone :)

you owe me an award, or recognition, or something, because


tired of expensive trig calls???!

let me hug and kiss it better :)

i have called the circular osc the "ginsu dsp" for a while now.. "it oscillates, it filters.."

basically i got tired of cpu intensive functions and decided to let this puppy deal with it.

i know, i know, people say "the circular osc is elliptical, it has inherent error for use as a sine" but you know, i don't care what you say :) dsp is about getting things done.
---------------------------------------------------

here is an inexpensive method of simultaneously approximating cosine and sine for given angle w (in radians) with really, really nice accuracy for just mucking about -

wit = w / iterations;
s0 = 1; (cosine)
s1 = wit; (sine)

loop (wit - 1) times
s0 -= s1 * wit;
s1 += s0 * wit;

generate s0 one more time and average it with the result you have.


accuracy:

angle: 1 * pi / 16

iterations: 1 error cos: 6.556510925e-07 error sin: 4.068389535e-05

iterations: 2 error cos: 1.788139343e-07 error sin: 1.016631722e-05

iterations: 3 error cos: 5.960464478e-08 error sin: 4.522502422e-06

iterations: 4 error cos: 5.960464478e-08 error sin: 2.540647984e-06

iterations: 5 error cos: 5.960464478e-08 error sin: 1.631677151e-06

iterations: 6 error cos: 5.960464478e-08 error sin: 1.132488251e-06

iterations: 7 error cos: 0 error sin: 8.344650269e-07

iterations: 8 error cos: 0 error sin: 6.332993507e-07

iterations: 9 error cos: 0 error sin: 5.103647709e-07

iterations: 10 error cos: 0 error sin: 4.135072231e-07

iterations: 11 error cos: 5.960464478e-08 error sin: 3.352761269e-07

iterations: 12 error cos: 0 error sin: 2.86847353e-07

iterations: 13 error cos: 5.960464478e-08 error sin: 2.421438694e-07

iterations: 14 error cos: 5.960464478e-08 error sin: 2.12341547e-07

iterations: 15 error cos: 5.960464478e-08 error sin: 1.825392246e-07

iterations: 16 error cos: 1.192092896e-07 error sin: 1.527369022e-07



angle: 2 * pi / 16

iterations: 1 error cos: 1.019239426e-05 error sin: 0.0003252699971

iterations: 2 error cos: 2.562999725e-06 error sin: 8.112937212e-05

iterations: 3 error cos: 1.192092896e-06 error sin: 3.604590893e-05

iterations: 4 error cos: 6.556510925e-07 error sin: 2.02730298e-05

iterations: 5 error cos: 4.768371582e-07 error sin: 1.29789114e-05

iterations: 6 error cos: 3.576278687e-07 error sin: 9.015202522e-06

iterations: 7 error cos: 2.384185791e-07 error sin: 6.623566151e-06

iterations: 8 error cos: 1.788139343e-07 error sin: 5.066394806e-06

iterations: 9 error cos: 5.960464478e-08 error sin: 4.008412361e-06

iterations: 10 error cos: 5.960464478e-08 error sin: 3.255903721e-06

iterations: 11 error cos: 1.192092896e-07 error sin: 2.689659595e-06

iterations: 12 error cos: 5.960464478e-08 error sin: 2.257525921e-06

iterations: 13 error cos: 5.960464478e-08 error sin: 1.922249794e-06

iterations: 14 error cos: 0 error sin: 1.668930054e-06

iterations: 15 error cos: 5.960464478e-08 error sin: 1.445412636e-06

iterations: 16 error cos: 1.192092896e-07 error sin: 1.259148121e-06



angle: 3 * pi / 16

iterations: 1 error cos: 5.143880844e-05 error sin: 0.001096710563

iterations: 2 error cos: 1.281499863e-05 error sin: 0.0002727359533

iterations: 3 error cos: 5.662441254e-06 error sin: 0.000121101737

iterations: 4 error cos: 3.218650818e-06 error sin: 6.809830666e-05

iterations: 5 error cos: 2.026557922e-06 error sin: 4.358589649e-05

iterations: 6 error cos: 1.37090683e-06 error sin: 3.026425838e-05

iterations: 7 error cos: 1.072883606e-06 error sin: 2.224743366e-05

iterations: 8 error cos: 8.344650269e-07 error sin: 1.703202724e-05

iterations: 9 error cos: 7.152557373e-07 error sin: 1.345574856e-05

iterations: 10 error cos: 4.768371582e-07 error sin: 1.092255116e-05

iterations: 11 error cos: 4.768371582e-07 error sin: 9.000301361e-06

iterations: 12 error cos: 2.980232239e-07 error sin: 7.584691048e-06

iterations: 13 error cos: 2.980232239e-07 error sin: 6.467103958e-06

iterations: 14 error cos: 2.980232239e-07 error sin: 5.558133125e-06

iterations: 15 error cos: 1.788139343e-07 error sin: 4.87267971e-06

iterations: 16 error cos: 2.384185791e-07 error sin: 4.261732101e-06



angle: 4 * pi / 16

iterations: 1 error cos: 0.000162422657 error sin: 0.0025960356

iterations: 2 error cos: 4.035234451e-05 error sin: 0.0006429105997

iterations: 3 error cos: 1.788139343e-05 error sin: 0.0002852529287

iterations: 4 error cos: 1.007318497e-05 error sin: 0.0001603513956

iterations: 5 error cos: 6.437301636e-06 error sin: 0.0001025795937

iterations: 6 error cos: 4.470348358e-06 error sin: 7.124245167e-05

iterations: 7 error cos: 3.278255463e-06 error sin: 5.234777927e-05

iterations: 8 error cos: 2.503395081e-06 error sin: 4.006922245e-05

iterations: 9 error cos: 1.966953278e-06 error sin: 3.165006638e-05

iterations: 10 error cos: 1.668930054e-06 error sin: 2.562999725e-05

iterations: 11 error cos: 1.311302185e-06 error sin: 2.118945122e-05

iterations: 12 error cos: 1.132488251e-06 error sin: 1.780688763e-05

iterations: 13 error cos: 1.013278961e-06 error sin: 1.518428326e-05

iterations: 14 error cos: 8.344650269e-07 error sin: 1.306831837e-05

iterations: 15 error cos: 6.556510925e-07 error sin: 1.141428947e-05

iterations: 16 error cos: 5.960464478e-07 error sin: 1.002848148e-05



angle: 5 * pi / 16

iterations: 1 error cos: 0.0003960728645 error sin: 0.005061477423

iterations: 2 error cos: 9.804964066e-05 error sin: 0.001246780157

iterations: 3 error cos: 4.351139069e-05 error sin: 0.000552624464

iterations: 4 error cos: 2.443790436e-05 error sin: 0.0003105401993

iterations: 5 error cos: 1.561641693e-05 error sin: 0.000198662281

iterations: 6 error cos: 1.084804535e-05 error sin: 0.000137925148

iterations: 7 error cos: 7.9870224e-06 error sin: 0.0001012980938

iterations: 8 error cos: 6.139278412e-06 error sin: 7.754564285e-05

iterations: 9 error cos: 4.827976227e-06 error sin: 6.127357483e-05

iterations: 10 error cos: 3.87430191e-06 error sin: 4.96506691e-05

iterations: 11 error cos: 3.218650818e-06 error sin: 4.103779793e-05

iterations: 12 error cos: 2.74181366e-06 error sin: 3.4481287e-05

iterations: 13 error cos: 2.324581146e-06 error sin: 2.938508987e-05

iterations: 14 error cos: 1.907348633e-06 error sin: 2.533197403e-05

iterations: 15 error cos: 1.788139343e-06 error sin: 2.205371857e-05

iterations: 16 error cos: 1.549720764e-06 error sin: 1.937150955e-05



angle: 6 * pi / 16

iterations: 1 error cos: 0.0008201003075 error sin: 0.0087274611

iterations: 2 error cos: 0.0002021193504 error sin: 0.002135664225

iterations: 3 error cos: 8.95857811e-05 error sin: 0.0009454786777

iterations: 4 error cos: 5.030632019e-05 error sin: 0.0005311071873

iterations: 5 error cos: 3.218650818e-05 error sin: 0.0003396868706

iterations: 6 error cos: 2.235174179e-05 error sin: 0.0002358257771

iterations: 7 error cos: 1.639127731e-05 error sin: 0.0001732409

iterations: 8 error cos: 1.25169754e-05 error sin: 0.0001325905323

iterations: 9 error cos: 9.894371033e-06 error sin: 0.0001047849655

iterations: 10 error cos: 8.046627045e-06 error sin: 8.484721184e-05

iterations: 11 error cos: 6.675720215e-06 error sin: 7.009506226e-05

iterations: 12 error cos: 5.543231964e-06 error sin: 5.891919136e-05

iterations: 13 error cos: 4.649162292e-06 error sin: 5.01871109e-05

iterations: 14 error cos: 4.11272049e-06 error sin: 4.327297211e-05

iterations: 15 error cos: 3.635883331e-06 error sin: 3.764033318e-05

iterations: 16 error cos: 3.218650818e-06 error sin: 3.311038017e-05



angle: 7 * pi / 16

iterations: 1 error cos: 0.001516819 error sin: 0.01382374763

iterations: 2 error cos: 0.0003719329834 error sin: 0.003356218338

iterations: 3 error cos: 0.0001647472382 error sin: 0.001483738422

iterations: 4 error cos: 9.256601334e-05 error sin: 0.0008330643177

iterations: 5 error cos: 5.924701691e-05 error sin: 0.0005327165127

iterations: 6 error cos: 4.106760025e-05 error sin: 0.0003697574139

iterations: 7 error cos: 3.02195549e-05 error sin: 0.0002716183662

iterations: 8 error cos: 2.312660217e-05 error sin: 0.000207901001

iterations: 9 error cos: 1.82390213e-05 error sin: 0.000164270401

iterations: 10 error cos: 1.484155655e-05 error sin: 0.0001330077648

iterations: 11 error cos: 1.221895218e-05 error sin: 0.0001099407673

iterations: 12 error cos: 1.02519989e-05 error sin: 9.241700172e-05

iterations: 13 error cos: 8.881092072e-06 error sin: 7.86781311e-05

iterations: 14 error cos: 7.510185242e-06 error sin: 6.785988808e-05

iterations: 15 error cos: 6.496906281e-06 error sin: 5.912780762e-05

iterations: 16 error cos: 5.841255188e-06 error sin: 5.194544792e-05



angle: 8 * pi / 16

iterations: 1 error cos: 0.002582550049 error sin: 0.02057445049

iterations: 2 error cos: 0.0006294250488 error sin: 0.004949450493

iterations: 3 error cos: 0.0002784729004 error sin: 0.002184540033

iterations: 4 error cos: 0.0001564025879 error sin: 0.001225829124

iterations: 5 error cos: 0.0001000165939 error sin: 0.0007836520672

iterations: 6 error cos: 6.943941116e-05 error sin: 0.0005438923836

iterations: 7 error cos: 5.090236664e-05 error sin: 0.0003994703293

iterations: 8 error cos: 3.904104233e-05 error sin: 0.0003057718277

iterations: 9 error cos: 3.087520599e-05 error sin: 0.0002415180206

iterations: 10 error cos: 2.497434616e-05 error sin: 0.0001956224442

iterations: 11 error cos: 2.074241638e-05 error sin: 0.0001616477966

iterations: 12 error cos: 1.734495163e-05 error sin: 0.0001358687878

iterations: 13 error cos: 1.484155655e-05 error sin: 0.0001157820225

iterations: 14 error cos: 1.269578934e-05 error sin: 9.983778e-05

iterations: 15 error cos: 1.096725464e-05 error sin: 8.699297905e-05

iterations: 16 error cos: 9.715557098e-06 error sin: 7.638335228e-05



angle: 9 * pi / 16

iterations: 1 error cos: 0.004127621651 error sin: 0.02919733524

iterations: 2 error cos: 0.0009990930557 error sin: 0.00695002079

iterations: 3 error cos: 0.0004414319992 error sin: 0.003061890602

iterations: 4 error cos: 0.000247836113 error sin: 0.001717031002

iterations: 5 error cos: 0.0001584291458 error sin: 0.001097381115

iterations: 6 error cos: 0.000109910965 error sin: 0.0007615089417

iterations: 7 error cos: 8.076429367e-05 error sin: 0.0005592107773

iterations: 8 error cos: 6.186962128e-05 error sin: 0.0004280209541

iterations: 9 error cos: 4.887580872e-05 error sin: 0.0003381371498

iterations: 10 error cos: 3.951787949e-05 error sin: 0.0002738237381

iterations: 11 error cos: 3.272294998e-05 error sin: 0.0002263188362

iterations: 12 error cos: 2.747774124e-05 error sin: 0.0001901388168

iterations: 13 error cos: 2.34246254e-05 error sin: 0.0001619458199

iterations: 14 error cos: 2.020597458e-05 error sin: 0.0001397132874

iterations: 15 error cos: 1.758337021e-05 error sin: 0.00012165308

iterations: 16 error cos: 1.5437603e-05 error sin: 0.0001069903374



angle: 10 * pi / 16

iterations: 1 error cos: 0.006275594234 error sin: 0.03990274668

iterations: 2 error cos: 0.001507222652 error sin: 0.009385168552

iterations: 3 error cos: 0.000665128231 error sin: 0.004126191139

iterations: 4 error cos: 0.0003731250763 error sin: 0.002312302589

iterations: 5 error cos: 0.0002385377884 error sin: 0.001477301121

iterations: 6 error cos: 0.0001655220985 error sin: 0.001024961472

iterations: 7 error cos: 0.0001215338707 error sin: 0.0007526278496

iterations: 8 error cos: 9.310245514e-05 error sin: 0.0005759596825

iterations: 9 error cos: 7.349252701e-05 error sin: 0.0004550218582

iterations: 10 error cos: 5.960464478e-05 error sin: 0.0003685355186

iterations: 11 error cos: 4.917383194e-05 error sin: 0.0003045201302

iterations: 12 error cos: 4.130601883e-05 error sin: 0.0002558231354

iterations: 13 error cos: 3.528594971e-05 error sin: 0.0002179741859

iterations: 14 error cos: 3.039836884e-05 error sin: 0.000187933445

iterations: 15 error cos: 2.652406693e-05 error sin: 0.0001637339592

iterations: 16 error cos: 2.330541611e-05 error sin: 0.0001438856125



angle: 11 * pi / 16

iterations: 1 error cos: 0.009163081646 error sin: 0.05289292336

iterations: 2 error cos: 0.002181708813 error sin: 0.01227402687

iterations: 3 error cos: 0.0009613037109 error sin: 0.005384087563

iterations: 4 error cos: 0.000539124012 error sin: 0.003014802933

iterations: 5 error cos: 0.0003445744514 error sin: 0.001925468445

iterations: 6 error cos: 0.0002391338348 error sin: 0.00133562088

iterations: 7 error cos: 0.0001756548882 error sin: 0.0009805560112

iterations: 8 error cos: 0.0001343488693 error sin: 0.0007504224777

iterations: 9 error cos: 0.000106215477 error sin: 0.0005927681923

iterations: 10 error cos: 8.600950241e-05 error sin: 0.0004799962044

iterations: 11 error cos: 7.110834122e-05 error sin: 0.000396668911

iterations: 12 error cos: 5.966424942e-05 error sin: 0.0003333091736

iterations: 13 error cos: 5.090236664e-05 error sin: 0.0002838969231

iterations: 14 error cos: 4.374980927e-05 error sin: 0.0002448558807

iterations: 15 error cos: 3.826618195e-05 error sin: 0.0002132058144

iterations: 16 error cos: 3.349781036e-05 error sin: 0.0001873970032



angle: 12 * pi / 16

iterations: 1 error cos: 0.01293885708 error sin: 0.06836122274

iterations: 2 error cos: 0.003051161766 error sin: 0.01562684774

iterations: 3 error cos: 0.001342177391 error sin: 0.006837785244

iterations: 4 error cos: 0.0007522702217 error sin: 0.003825545311

iterations: 5 error cos: 0.0004805922508 error sin: 0.002442359924

iterations: 6 error cos: 0.0003334879875 error sin: 0.001693725586

iterations: 7 error cos: 0.0002447962761 error sin: 0.00124335289

iterations: 8 error cos: 0.0001873373985 error sin: 0.0009514689445

iterations: 9 error cos: 0.0001480579376 error sin: 0.0007514953613

iterations: 10 error cos: 0.0001199245453 error sin: 0.0006085038185

iterations: 11 error cos: 9.900331497e-05 error sin: 0.0005029439926

iterations: 12 error cos: 8.33272934e-05 error sin: 0.0004224777222

iterations: 13 error cos: 7.086992264e-05 error sin: 0.0003599524498

iterations: 14 error cos: 6.109476089e-05 error sin: 0.0003103613853

iterations: 15 error cos: 5.322694778e-05 error sin: 0.0002702474594

iterations: 16 error cos: 4.684925079e-05 error sin: 0.0002375245094



angle: 13 * pi / 16

iterations: 1 error cos: 0.01776367426 error sin: 0.08649134636

iterations: 2 error cos: 0.004144728184 error sin: 0.01944422722

iterations: 3 error cos: 0.001820087433 error sin: 0.008485257626

iterations: 4 error cos: 0.001019477844 error sin: 0.004742920399

iterations: 5 error cos: 0.0006512403488 error sin: 0.003026664257

iterations: 6 error cos: 0.000451862812 error sin: 0.002098560333

iterations: 7 error cos: 0.0003315806389 error sin: 0.001540362835

iterations: 8 error cos: 0.0002538561821 error sin: 0.001178622246

iterations: 9 error cos: 0.000200510025 error sin: 0.0009308457375

iterations: 10 error cos: 0.000162422657 error sin: 0.0007537603378

iterations: 11 error cos: 0.0001341700554 error sin: 0.0006227493286

iterations: 12 error cos: 0.0001128315926 error sin: 0.0005232095718

iterations: 13 error cos: 9.608268738e-05 error sin: 0.0004457831383

iterations: 14 error cos: 8.279085159e-05 error sin: 0.0003842711449

iterations: 15 error cos: 7.212162018e-05 error sin: 0.0003347992897

iterations: 16 error cos: 6.330013275e-05 error sin: 0.0002942681313



angle: 14 * pi / 16

iterations: 1 error cos: 0.02380937338 error sin: 0.1074565053

iterations: 2 error cos: 0.005491197109 error sin: 0.02371627092

iterations: 3 error cos: 0.002406716347 error sin: 0.01031953096

iterations: 4 error cos: 0.001347303391 error sin: 0.005762577057

iterations: 5 error cos: 0.0008603334427 error sin: 0.003675639629

iterations: 6 error cos: 0.0005967617035 error sin: 0.00254791975

iterations: 7 error cos: 0.0004380941391 error sin: 0.001869916916

iterations: 8 error cos: 0.0003352761269 error sin: 0.001430630684

iterations: 9 error cos: 0.000264942646 error sin: 0.001129806042

iterations: 10 error cos: 0.0002144575119 error sin: 0.000914812088

iterations: 11 error cos: 0.0001771450043 error sin: 0.0007558465004

iterations: 12 error cos: 0.0001487731934 error sin: 0.0006350874901

iterations: 13 error cos: 0.0001268386841 error sin: 0.0005410313606

iterations: 14 error cos: 0.0001094341278 error sin: 0.0004664063454

iterations: 15 error cos: 9.524822235e-05 error sin: 0.0004062652588

iterations: 16 error cos: 8.374452591e-05 error sin: 0.0003569722176



angle: 15 * pi / 16

iterations: 1 error cos: 0.03125822544 error sin: 0.1314188838

iterations: 2 error cos: 0.007118344307 error sin: 0.02842205763

iterations: 3 error cos: 0.003113627434 error sin: 0.01232880354

iterations: 4 error cos: 0.001741826534 error sin: 0.006877303123

iterations: 5 error cos: 0.001111924648 error sin: 0.004384636879

iterations: 6 error cos: 0.0007711052895 error sin: 0.003038585186

iterations: 7 error cos: 0.0005660653114 error sin: 0.002229571342

iterations: 8 error cos: 0.0004332065582 error sin: 0.001705765724

iterations: 9 error cos: 0.0003421902657 error sin: 0.001346945763

iterations: 10 error cos: 0.0002770423889 error sin: 0.001090586185

iterations: 11 error cos: 0.0002289414406 error sin: 0.0009011030197

iterations: 12 error cos: 0.0001923441887 error sin: 0.000756919384

iterations: 13 error cos: 0.0001638531685 error sin: 0.0006448030472

iterations: 14 error cos: 0.0001413226128 error sin: 0.0005558729172

iterations: 15 error cos: 0.0001232028008 error sin: 0.0004842281342

iterations: 16 error cos: 0.0001082420349 error sin: 0.0004254579544



angle: 16 * pi / 16

iterations: 1 error cos: 0.04030227661 error sin: 0.1585290432

iterations: 2 error cos: 0.009052276611 error sin: 0.0335290432

iterations: 3 error cos: 0.003951132298 error sin: 0.01449614763

iterations: 4 error cos: 0.002208709717 error sin: 0.008077383041

iterations: 5 error cos: 0.001409590244 error sin: 0.0051471591

iterations: 6 error cos: 0.0009772777557 error sin: 0.003566026688

iterations: 7 error cos: 0.0007173418999 error sin: 0.002616286278

iterations: 8 error cos: 0.0005488991737 error sin: 0.002001285553

iterations: 9 error cos: 0.0004335045815 error sin: 0.001580238342

iterations: 10 error cos: 0.0003510117531 error sin: 0.0012794137

iterations: 11 error cos: 0.0002900958061 error sin: 0.001057088375

iterations: 12 error cos: 0.0002437829971 error sin: 0.0008879899979

iterations: 13 error cos: 0.0002076029778 error sin: 0.0007564425468

iterations: 14 error cos: 0.000178873539 error sin: 0.0006522536278

iterations: 15 error cos: 0.0001559257507 error sin: 0.0005682110786

iterations: 16 error cos: 0.000137090683 error sin: 0.0004991889

Code: Select all


#include <fstream>
#include <stdlib.h>
#include <windows.h>
#include "math.h"

#include <iostream>
using namespace std;

ofstream out;

const float pi = 3.1415926535897932384626433832795f;

#include "iomanip.h"	//	necessary for setprecision

int main()
{

out.open("circosc.txt");

for(int i = 1; i <= 16; i++) {
	float w = (float)i * .0625f;
	out << "angle: " << i << " * pi / 16" << "\r\n";
	float cosw = cos(w);
	float sinw = sin(w);
	for (int j = 1; j < 17; j++) {
		float wit = w / (float)j;
		float s0 = 1.f;
		float s1 = wit;
		for (int k = 1; k < j; k++) {s0 -= wit * s1;	s1 += wit * s0;}
		s0 = .5f * (s0 + s0 - wit * s1);
		out << setprecision(10) << "\titerations: " << j << "\terror cos: " << fabs(cosw - s0) << "\terror sin: " << fabs(sinw - s1) << "\r\n";
	}
	out << "\r\n";
}

out.close();


return 0;
}




xoxos :)
Last edited by xoxos on Sun Aug 21, 2016 10:05 pm, edited 1 time in total.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

testing outside the pi / 16 resolution, results for multiples of pi / 147 :)


and seriously, these results are *amazing* at a mere single iteration... course in 32 bit floating because it's intended for inexpensive apps..

i'd like people to remember, insight doesn't necessarily come from the most accredited source. that's why i'm here. and i *know* that this is going to be tremendously beneficial for many applications (eg. games..)

largest error ~.012, at a pitiful one iteration ;)

angle: 1 * pi / 147

iterations: 1 error cos: 0 error sin: 1.626089215e-06

iterations: 2 error cos: 5.960464478e-08 error sin: 4.060566425e-07

iterations: 3 error cos: 0 error sin: 1.806765795e-07

iterations: 4 error cos: 5.960464478e-08 error sin: 1.005828381e-07

iterations: 5 error cos: 5.960464478e-08 error sin: 6.332993507e-08

iterations: 6 error cos: 5.960464478e-08 error sin: 4.470348358e-08

iterations: 7 error cos: 0 error sin: 3.166496754e-08

iterations: 8 error cos: 0 error sin: 2.235174179e-08

iterations: 9 error cos: 5.960464478e-08 error sin: 2.048909664e-08

iterations: 10 error cos: 5.960464478e-08 error sin: 1.490116119e-08

iterations: 11 error cos: 0 error sin: 1.303851604e-08

iterations: 12 error cos: 5.960464478e-08 error sin: 1.11758709e-08

iterations: 13 error cos: 0 error sin: 9.313225746e-09

iterations: 14 error cos: 0 error sin: 7.450580597e-09

iterations: 15 error cos: 0 error sin: 5.587935448e-09

iterations: 16 error cos: 0 error sin: 5.587935448e-09



angle: 2 * pi / 147

iterations: 1 error cos: 1.788139343e-07 error sin: 1.301243901e-05

iterations: 2 error cos: 5.960464478e-08 error sin: 3.252178431e-06

iterations: 3 error cos: 5.960464478e-08 error sin: 1.441687346e-06

iterations: 4 error cos: 0 error sin: 8.121132851e-07

iterations: 5 error cos: 0 error sin: 5.215406418e-07

iterations: 6 error cos: 5.960464478e-08 error sin: 3.61353159e-07

iterations: 7 error cos: 5.960464478e-08 error sin: 2.644956112e-07

iterations: 8 error cos: 5.960464478e-08 error sin: 2.011656761e-07

iterations: 9 error cos: 0 error sin: 1.564621925e-07

iterations: 10 error cos: 5.960464478e-08 error sin: 1.303851604e-07

iterations: 11 error cos: 0 error sin: 1.043081284e-07

iterations: 12 error cos: 5.960464478e-08 error sin: 8.568167686e-08

iterations: 13 error cos: 0 error sin: 7.450580597e-08

iterations: 14 error cos: 0 error sin: 6.332993507e-08

iterations: 15 error cos: 0 error sin: 5.587935448e-08

iterations: 16 error cos: 0 error sin: 4.842877388e-08



angle: 3 * pi / 147

iterations: 1 error cos: 6.556510925e-07 error sin: 4.391372204e-05

iterations: 2 error cos: 1.192092896e-07 error sin: 1.096725464e-05

iterations: 3 error cos: 5.960464478e-08 error sin: 4.87267971e-06

iterations: 4 error cos: 5.960464478e-08 error sin: 2.74181366e-06

iterations: 5 error cos: 5.960464478e-08 error sin: 1.75088644e-06

iterations: 6 error cos: 0 error sin: 1.214444637e-06

iterations: 7 error cos: 5.960464478e-08 error sin: 8.940696716e-07

iterations: 8 error cos: 5.960464478e-08 error sin: 6.854534149e-07

iterations: 9 error cos: 0 error sin: 5.438923836e-07

iterations: 10 error cos: 0 error sin: 4.321336746e-07

iterations: 11 error cos: 0 error sin: 3.576278687e-07

iterations: 12 error cos: 5.960464478e-08 error sin: 2.980232239e-07

iterations: 13 error cos: 5.960464478e-08 error sin: 2.682209015e-07

iterations: 14 error cos: 0 error sin: 2.235174179e-07

iterations: 15 error cos: 5.960464478e-08 error sin: 1.937150955e-07

iterations: 16 error cos: 0 error sin: 1.713633537e-07



angle: 4 * pi / 147

iterations: 1 error cos: 2.205371857e-06 error sin: 0.0001040771604

iterations: 2 error cos: 5.36441803e-07 error sin: 2.598762512e-05

iterations: 3 error cos: 2.384185791e-07 error sin: 1.154094934e-05

iterations: 4 error cos: 1.192092896e-07 error sin: 6.4894557e-06

iterations: 5 error cos: 5.960464478e-08 error sin: 4.157423973e-06

iterations: 6 error cos: 1.192092896e-07 error sin: 2.883374691e-06

iterations: 7 error cos: 5.960464478e-08 error sin: 2.11596489e-06

iterations: 8 error cos: 5.960464478e-08 error sin: 1.61677599e-06

iterations: 9 error cos: 0 error sin: 1.281499863e-06

iterations: 10 error cos: 0 error sin: 1.043081284e-06

iterations: 11 error cos: 1.192092896e-07 error sin: 8.642673492e-07

iterations: 12 error cos: 0 error sin: 7.301568985e-07

iterations: 13 error cos: 5.960464478e-08 error sin: 6.034970284e-07

iterations: 14 error cos: 5.960464478e-08 error sin: 5.289912224e-07

iterations: 15 error cos: 0 error sin: 4.470348358e-07

iterations: 16 error cos: 5.960464478e-08 error sin: 3.87430191e-07



angle: 5 * pi / 147

iterations: 1 error cos: 5.424022675e-06 error sin: 0.0002032369375

iterations: 2 error cos: 1.37090683e-06 error sin: 5.07235527e-05

iterations: 3 error cos: 5.960464478e-07 error sin: 2.253055573e-05

iterations: 4 error cos: 3.576278687e-07 error sin: 1.26734376e-05

iterations: 5 error cos: 2.384185791e-07 error sin: 8.106231689e-06

iterations: 6 error cos: 1.788139343e-07 error sin: 5.625188351e-06

iterations: 7 error cos: 1.788139343e-07 error sin: 4.135072231e-06

iterations: 8 error cos: 1.788139343e-07 error sin: 3.166496754e-06

iterations: 9 error cos: 1.788139343e-07 error sin: 2.488493919e-06

iterations: 10 error cos: 5.960464478e-08 error sin: 2.019107342e-06

iterations: 11 error cos: 0 error sin: 1.683831215e-06

iterations: 12 error cos: 5.960464478e-08 error sin: 1.408159733e-06

iterations: 13 error cos: 1.192092896e-07 error sin: 1.199543476e-06

iterations: 14 error cos: 5.960464478e-08 error sin: 1.035630703e-06

iterations: 15 error cos: 1.192092896e-07 error sin: 9.089708328e-07

iterations: 16 error cos: 5.960464478e-08 error sin: 7.897615433e-07



angle: 6 * pi / 147

iterations: 1 error cos: 1.126527786e-05 error sin: 0.0003511160612

iterations: 2 error cos: 2.801418304e-06 error sin: 8.755922318e-05

iterations: 3 error cos: 1.25169754e-06 error sin: 3.890693188e-05

iterations: 4 error cos: 7.152557373e-07 error sin: 2.187490463e-05

iterations: 5 error cos: 3.576278687e-07 error sin: 1.400709152e-05

iterations: 6 error cos: 2.980232239e-07 error sin: 9.73045826e-06

iterations: 7 error cos: 2.384185791e-07 error sin: 7.137656212e-06

iterations: 8 error cos: 5.960464478e-08 error sin: 5.483627319e-06

iterations: 9 error cos: 1.788139343e-07 error sin: 4.321336746e-06

iterations: 10 error cos: 2.384185791e-07 error sin: 3.501772881e-06

iterations: 11 error cos: 0 error sin: 2.905726433e-06

iterations: 12 error cos: 5.960464478e-08 error sin: 2.428889275e-06

iterations: 13 error cos: 5.960464478e-08 error sin: 2.086162567e-06

iterations: 14 error cos: 1.788139343e-07 error sin: 1.773238182e-06

iterations: 15 error cos: 5.960464478e-08 error sin: 1.564621925e-06

iterations: 16 error cos: 0 error sin: 1.37090683e-06



angle: 7 * pi / 147

iterations: 1 error cos: 2.086162567e-05 error sin: 0.0005573779345

iterations: 2 error cos: 5.185604095e-06 error sin: 0.0001388639212

iterations: 3 error cos: 2.264976501e-06 error sin: 6.169080734e-05

iterations: 4 error cos: 1.25169754e-06 error sin: 3.468990326e-05

iterations: 5 error cos: 8.344650269e-07 error sin: 2.218782902e-05

iterations: 6 error cos: 5.960464478e-07 error sin: 1.540780067e-05

iterations: 7 error cos: 4.172325134e-07 error sin: 1.132488251e-05

iterations: 8 error cos: 3.576278687e-07 error sin: 8.672475815e-06

iterations: 9 error cos: 1.788139343e-07 error sin: 6.839632988e-06

iterations: 10 error cos: 2.384185791e-07 error sin: 5.543231964e-06

iterations: 11 error cos: 2.384185791e-07 error sin: 4.574656487e-06

iterations: 12 error cos: 2.384185791e-07 error sin: 3.844499588e-06

iterations: 13 error cos: 1.192092896e-07 error sin: 3.263354301e-06

iterations: 14 error cos: 5.960464478e-08 error sin: 2.816319466e-06

iterations: 15 error cos: 0 error sin: 2.458691597e-06

iterations: 16 error cos: 1.192092896e-07 error sin: 2.145767212e-06



angle: 8 * pi / 147

iterations: 1 error cos: 3.558397293e-05 error sin: 0.0008317232132

iterations: 2 error cos: 8.881092072e-06 error sin: 0.0002070218325

iterations: 3 error cos: 3.933906555e-06 error sin: 9.19252634e-05

iterations: 4 error cos: 2.205371857e-06 error sin: 5.169212818e-05

iterations: 5 error cos: 1.430511475e-06 error sin: 3.309547901e-05

iterations: 6 error cos: 1.013278961e-06 error sin: 2.29626894e-05

iterations: 7 error cos: 7.152557373e-07 error sin: 1.686811447e-05

iterations: 8 error cos: 5.960464478e-07 error sin: 1.291930676e-05

iterations: 9 error cos: 4.768371582e-07 error sin: 1.022219658e-05

iterations: 10 error cos: 4.172325134e-07 error sin: 8.270144463e-06

iterations: 11 error cos: 2.980232239e-07 error sin: 6.824731827e-06

iterations: 12 error cos: 2.980232239e-07 error sin: 5.722045898e-06

iterations: 13 error cos: 2.384185791e-07 error sin: 4.87267971e-06

iterations: 14 error cos: 2.384185791e-07 error sin: 4.217028618e-06

iterations: 15 error cos: 2.980232239e-07 error sin: 3.665685654e-06

iterations: 16 error cos: 1.192092896e-07 error sin: 3.218650818e-06



angle: 9 * pi / 147

iterations: 1 error cos: 5.698204041e-05 error sin: 0.001183778048

iterations: 2 error cos: 1.418590546e-05 error sin: 0.0002942979336

iterations: 3 error cos: 6.318092346e-06 error sin: 0.0001306533813

iterations: 4 error cos: 3.635883331e-06 error sin: 7.346272469e-05

iterations: 5 error cos: 2.205371857e-06 error sin: 4.701316357e-05

iterations: 6 error cos: 1.609325409e-06 error sin: 3.263354301e-05

iterations: 7 error cos: 1.132488251e-06 error sin: 2.399086952e-05

iterations: 8 error cos: 9.536743164e-07 error sin: 1.835823059e-05

iterations: 9 error cos: 7.152557373e-07 error sin: 1.4513731e-05

iterations: 10 error cos: 4.768371582e-07 error sin: 1.175701618e-05

iterations: 11 error cos: 6.556510925e-07 error sin: 9.715557098e-06

iterations: 12 error cos: 2.980232239e-07 error sin: 8.180737495e-06

iterations: 13 error cos: 4.172325134e-07 error sin: 6.943941116e-06

iterations: 14 error cos: 4.172325134e-07 error sin: 5.9902668e-06

iterations: 15 error cos: 4.172325134e-07 error sin: 5.200505257e-06

iterations: 16 error cos: 2.384185791e-07 error sin: 4.574656487e-06



angle: 10 * pi / 147

iterations: 1 error cos: 8.678436279e-05 error sin: 0.001623138785

iterations: 2 error cos: 2.157688141e-05 error sin: 0.0004030019045

iterations: 3 error cos: 9.596347809e-06 error sin: 0.0001788884401

iterations: 4 error cos: 5.36441803e-06 error sin: 0.0001005828381

iterations: 5 error cos: 3.457069397e-06 error sin: 6.43581152e-05

iterations: 6 error cos: 2.384185791e-06 error sin: 4.468858242e-05

iterations: 7 error cos: 1.728534698e-06 error sin: 3.282725811e-05

iterations: 8 error cos: 1.430511475e-06 error sin: 2.512335777e-05

iterations: 9 error cos: 1.013278961e-06 error sin: 1.986324787e-05

iterations: 10 error cos: 8.940696716e-07 error sin: 1.609325409e-05

iterations: 11 error cos: 6.556510925e-07 error sin: 1.330673695e-05

iterations: 12 error cos: 5.36441803e-07 error sin: 1.116096973e-05

iterations: 13 error cos: 5.36441803e-07 error sin: 9.521842003e-06

iterations: 14 error cos: 4.768371582e-07 error sin: 8.210539818e-06

iterations: 15 error cos: 3.576278687e-07 error sin: 7.137656212e-06

iterations: 16 error cos: 3.576278687e-07 error sin: 6.273388863e-06



angle: 11 * pi / 147

iterations: 1 error cos: 0.000127017498 error sin: 0.002159357071

iterations: 2 error cos: 3.153085709e-05 error sin: 0.0005353540182

iterations: 3 error cos: 1.400709152e-05 error sin: 0.0002375692129

iterations: 4 error cos: 7.86781311e-06 error sin: 0.0001335591078

iterations: 5 error cos: 4.947185516e-06 error sin: 8.547306061e-05

iterations: 6 error cos: 3.397464752e-06 error sin: 5.935132504e-05

iterations: 7 error cos: 2.503395081e-06 error sin: 4.360079765e-05

iterations: 8 error cos: 1.966953278e-06 error sin: 3.34084034e-05

iterations: 9 error cos: 1.490116119e-06 error sin: 2.637505531e-05

iterations: 10 error cos: 1.25169754e-06 error sin: 2.135336399e-05

iterations: 11 error cos: 1.013278961e-06 error sin: 1.765787601e-05

iterations: 12 error cos: 8.940696716e-07 error sin: 1.482665539e-05

iterations: 13 error cos: 6.556510925e-07 error sin: 1.265108585e-05

iterations: 14 error cos: 5.36441803e-07 error sin: 1.089274883e-05

iterations: 15 error cos: 5.36441803e-07 error sin: 9.49203968e-06

iterations: 16 error cos: 5.960464478e-07 error sin: 8.344650269e-06



angle: 12 * pi / 147

iterations: 1 error cos: 0.0001798272133 error sin: 0.002801954746

iterations: 2 error cos: 4.464387894e-05 error sin: 0.0006935596466

iterations: 3 error cos: 1.978874207e-05 error sin: 0.0003076791763

iterations: 4 error cos: 1.120567322e-05 error sin: 0.0001729428768

iterations: 5 error cos: 7.152557373e-06 error sin: 0.000110656023

iterations: 6 error cos: 4.947185516e-06 error sin: 7.683038712e-05

iterations: 7 error cos: 3.576278687e-06 error sin: 5.647540092e-05

iterations: 8 error cos: 2.801418304e-06 error sin: 4.318356514e-05

iterations: 9 error cos: 2.145767212e-06 error sin: 3.412365913e-05

iterations: 10 error cos: 1.788139343e-06 error sin: 2.762675285e-05

iterations: 11 error cos: 1.490116119e-06 error sin: 2.285838127e-05

iterations: 12 error cos: 1.25169754e-06 error sin: 1.919269562e-05

iterations: 13 error cos: 1.013278961e-06 error sin: 1.639127731e-05

iterations: 14 error cos: 1.013278961e-06 error sin: 1.406669617e-05

iterations: 15 error cos: 8.344650269e-07 error sin: 1.227855682e-05

iterations: 16 error cos: 5.960464478e-07 error sin: 1.081824303e-05



angle: 13 * pi / 147

iterations: 1 error cos: 0.0002475976944 error sin: 0.003560423851

iterations: 2 error cos: 6.139278412e-05 error sin: 0.0008797943592

iterations: 3 error cos: 2.723932266e-05 error sin: 0.000390201807

iterations: 4 error cos: 1.531839371e-05 error sin: 0.0002193152905

iterations: 5 error cos: 9.775161743e-06 error sin: 0.0001403391361

iterations: 6 error cos: 6.794929504e-06 error sin: 9.745359421e-05

iterations: 7 error cos: 5.066394806e-06 error sin: 7.155537605e-05

iterations: 8 error cos: 3.814697266e-06 error sin: 5.480647087e-05

iterations: 9 error cos: 3.039836884e-06 error sin: 4.330277443e-05

iterations: 10 error cos: 2.503395081e-06 error sin: 3.507733345e-05

iterations: 11 error cos: 1.966953278e-06 error sin: 2.896785736e-05

iterations: 12 error cos: 1.668930054e-06 error sin: 2.440810204e-05

iterations: 13 error cos: 1.311302185e-06 error sin: 2.07722187e-05

iterations: 14 error cos: 1.25169754e-06 error sin: 1.788139343e-05

iterations: 15 error cos: 1.192092896e-06 error sin: 1.558661461e-05

iterations: 16 error cos: 1.013278961e-06 error sin: 1.37090683e-05



angle: 14 * pi / 147

iterations: 1 error cos: 0.0003328919411 error sin: 0.004444122314

iterations: 2 error cos: 8.243322372e-05 error sin: 0.001096069813

iterations: 3 error cos: 3.659725189e-05 error sin: 0.0004859268665

iterations: 4 error cos: 2.05039978e-05 error sin: 0.00027307868

iterations: 5 error cos: 1.311302185e-05 error sin: 0.0001747012138

iterations: 6 error cos: 9.119510651e-06 error sin: 0.0001213252544

iterations: 7 error cos: 6.675720215e-06 error sin: 8.910894394e-05

iterations: 8 error cos: 5.125999451e-06 error sin: 6.821751595e-05

iterations: 9 error cos: 4.053115845e-06 error sin: 5.388259888e-05

iterations: 10 error cos: 3.337860107e-06 error sin: 4.363059998e-05

iterations: 11 error cos: 2.62260437e-06 error sin: 3.609061241e-05

iterations: 12 error cos: 2.264976501e-06 error sin: 3.033876419e-05

iterations: 13 error cos: 1.847743988e-06 error sin: 2.580881119e-05

iterations: 14 error cos: 1.668930054e-06 error sin: 2.226233482e-05

iterations: 15 error cos: 1.490116119e-06 error sin: 1.940131187e-05

iterations: 16 error cos: 1.311302185e-06 error sin: 1.704692841e-05



angle: 15 * pi / 147

iterations: 1 error cos: 0.0004385113716 error sin: 0.00546246767

iterations: 2 error cos: 0.0001084804535 error sin: 0.001344501972

iterations: 3 error cos: 4.810094833e-05 error sin: 0.0005958676338

iterations: 4 error cos: 2.712011337e-05 error sin: 0.000334829092

iterations: 5 error cos: 1.728534698e-05 error sin: 0.0002141594887

iterations: 6 error cos: 1.19805336e-05 error sin: 0.0001487135887

iterations: 7 error cos: 8.821487427e-06 error sin: 0.0001092851162

iterations: 8 error cos: 6.675720215e-06 error sin: 8.365511894e-05

iterations: 9 error cos: 5.304813385e-06 error sin: 6.610155106e-05

iterations: 10 error cos: 4.291534424e-06 error sin: 5.346536636e-05

iterations: 11 error cos: 3.635883331e-06 error sin: 4.422664642e-05

iterations: 12 error cos: 3.159046173e-06 error sin: 3.716349602e-05

iterations: 13 error cos: 2.503395081e-06 error sin: 3.16798687e-05

iterations: 14 error cos: 2.086162567e-06 error sin: 2.732872963e-05

iterations: 15 error cos: 1.907348633e-06 error sin: 2.381205559e-05

iterations: 16 error cos: 1.668930054e-06 error sin: 2.089142799e-05



angle: 16 * pi / 147

iterations: 1 error cos: 0.0005674362183 error sin: 0.006624698639

iterations: 2 error cos: 0.0001401901245 error sin: 0.001627027988

iterations: 3 error cos: 6.21676445e-05 error sin: 0.0007207691669

iterations: 4 error cos: 3.492832184e-05 error sin: 0.0004049539566

iterations: 5 error cos: 2.241134644e-05 error sin: 0.0002590715885

iterations: 6 error cos: 1.549720764e-05 error sin: 0.0001798272133

iterations: 7 error cos: 1.132488251e-05 error sin: 0.0001321136951

iterations: 8 error cos: 8.702278137e-06 error sin: 0.0001011192799

iterations: 9 error cos: 6.914138794e-06 error sin: 7.990002632e-05

iterations: 10 error cos: 5.602836609e-06 error sin: 6.473064423e-05

iterations: 11 error cos: 4.649162292e-06 error sin: 5.346536636e-05

iterations: 12 error cos: 3.87430191e-06 error sin: 4.494190216e-05

iterations: 13 error cos: 3.218650818e-06 error sin: 3.829598427e-05

iterations: 14 error cos: 2.861022949e-06 error sin: 3.299117088e-05

iterations: 15 error cos: 2.503395081e-06 error sin: 2.872943878e-05

iterations: 16 error cos: 2.145767212e-06 error sin: 2.527236938e-05



angle: 17 * pi / 147

iterations: 1 error cos: 0.0007227659225 error sin: 0.007940113544

iterations: 2 error cos: 0.0001782774925 error sin: 0.001945585012

iterations: 3 error cos: 7.903575897e-05 error sin: 0.0008615553379

iterations: 4 error cos: 4.4465065e-05 error sin: 0.0004839897156

iterations: 5 error cos: 2.843141556e-05 error sin: 0.0003096163273

iterations: 6 error cos: 1.972913742e-05 error sin: 0.0002149045467

iterations: 7 error cos: 1.448392868e-05 error sin: 0.0001578330994

iterations: 8 error cos: 1.108646393e-05 error sin: 0.0001208782196

iterations: 9 error cos: 8.702278137e-06 error sin: 9.548664093e-05

iterations: 10 error cos: 6.973743439e-06 error sin: 7.736682892e-05

iterations: 11 error cos: 5.841255188e-06 error sin: 6.392598152e-05

iterations: 12 error cos: 4.887580872e-06 error sin: 5.370378494e-05

iterations: 13 error cos: 4.11272049e-06 error sin: 4.577636719e-05

iterations: 14 error cos: 3.695487976e-06 error sin: 3.93986702e-05

iterations: 15 error cos: 3.159046173e-06 error sin: 3.433227539e-05

iterations: 16 error cos: 2.861022949e-06 error sin: 3.018975258e-05



angle: 18 * pi / 147

iterations: 1 error cos: 0.0009080171585 error sin: 0.009417802095

iterations: 2 error cos: 0.0002236366272 error sin: 0.002301990986

iterations: 3 error cos: 9.912252426e-05 error sin: 0.001018881798

iterations: 4 error cos: 5.573034286e-05 error sin: 0.0005722939968

iterations: 5 error cos: 3.564357758e-05 error sin: 0.0003660321236

iterations: 6 error cos: 2.479553223e-05 error sin: 0.0002540647984

iterations: 7 error cos: 1.817941666e-05 error sin: 0.0001866221428

iterations: 8 error cos: 1.400709152e-05 error sin: 0.0001428723335

iterations: 9 error cos: 1.096725464e-05 error sin: 0.0001128613949

iterations: 10 error cos: 8.881092072e-06 error sin: 9.146332741e-05

iterations: 11 error cos: 7.331371307e-06 error sin: 7.557868958e-05

iterations: 12 error cos: 6.258487701e-06 error sin: 6.344914436e-05

iterations: 13 error cos: 5.304813385e-06 error sin: 5.406141281e-05

iterations: 14 error cos: 4.589557648e-06 error sin: 4.667043686e-05

iterations: 15 error cos: 3.933906555e-06 error sin: 4.059076309e-05

iterations: 16 error cos: 3.457069397e-06 error sin: 3.56733799e-05



angle: 19 * pi / 147

iterations: 1 error cos: 0.001126587391 error sin: 0.0110669136

iterations: 2 error cos: 0.0002770423889 error sin: 0.002698004246

iterations: 3 error cos: 0.0001227259636 error sin: 0.001193642616

iterations: 4 error cos: 6.902217865e-05 error sin: 0.0006703734398

iterations: 5 error cos: 4.410743713e-05 error sin: 0.0004287362099

iterations: 6 error cos: 3.057718277e-05 error sin: 0.0002976059914

iterations: 7 error cos: 2.247095108e-05 error sin: 0.000218629837

iterations: 8 error cos: 1.722574234e-05 error sin: 0.0001673102379

iterations: 9 error cos: 1.358985901e-05 error sin: 0.0001322031021

iterations: 10 error cos: 1.102685928e-05 error sin: 0.0001070797443

iterations: 11 error cos: 9.179115295e-06 error sin: 8.851289749e-05

iterations: 12 error cos: 7.629394531e-06 error sin: 7.435679436e-05

iterations: 13 error cos: 6.437301636e-06 error sin: 6.338953972e-05

iterations: 14 error cos: 5.662441254e-06 error sin: 5.465745926e-05

iterations: 15 error cos: 4.887580872e-06 error sin: 4.756450653e-05

iterations: 16 error cos: 4.291534424e-06 error sin: 4.184246063e-05



angle: 20 * pi / 147

iterations: 1 error cos: 0.001382291317 error sin: 0.01289638877

iterations: 2 error cos: 0.0003392696381 error sin: 0.003135293722

iterations: 3 error cos: 0.0001503229141 error sin: 0.001386404037

iterations: 4 error cos: 8.445978165e-05 error sin: 0.0007784664631

iterations: 5 error cos: 5.400180817e-05 error sin: 0.0004977881908

iterations: 6 error cos: 3.749132156e-05 error sin: 0.0003455579281

iterations: 7 error cos: 2.747774124e-05 error sin: 0.0002537965775

iterations: 8 error cos: 2.110004425e-05 error sin: 0.0001942813396

iterations: 9 error cos: 1.668930054e-05 error sin: 0.0001534819603

iterations: 10 error cos: 1.353025436e-05 error sin: 0.0001243054867

iterations: 11 error cos: 1.114606857e-05 error sin: 0.0001027882099

iterations: 12 error cos: 9.417533875e-06 error sin: 8.627772331e-05

iterations: 13 error cos: 8.106231689e-06 error sin: 7.352232933e-05

iterations: 14 error cos: 6.854534149e-06 error sin: 6.338953972e-05

iterations: 15 error cos: 6.079673767e-06 error sin: 5.525350571e-05

iterations: 16 error cos: 5.424022675e-06 error sin: 4.851818085e-05
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

results for 0 to pi at 997 equal intervals :)
largest error at 1 iterations: 3.14159

largest error at 2 iterations: 0.734192

largest error at 3 iterations: 0.19259

largest error at 4 iterations: 0.0943981

largest error at 5 iterations: 0.0569751

largest error at 6 iterations: 0.0383709

largest error at 7 iterations: 0.0276846

largest error at 8 iterations: 0.0209513

largest error at 9 iterations: 0.0164238

largest error at 10 iterations: 0.0132287

largest error at 11 iterations: 0.0108878

largest error at 12 iterations: 0.00912

largest error at 13 iterations: 0.00775195

largest error at 14 iterations: 0.0066711

largest error at 15 iterations: 0.00580238

largest error at 16 iterations: 0.00509321



and 0 to half pi at 997 equal intervals :p :)
largest error at 1 iterations: 0.570796

largest error at 2 iterations: 0.0863233

largest error at 3 iterations: 0.0359604

largest error at 4 iterations: 0.0197986

largest error at 5 iterations: 0.0125484

largest error at 6 iterations: 0.00866878

largest error at 7 iterations: 0.00634885

largest error at 8 iterations: 0.0048511

largest error at 9 iterations: 0.00382769

largest error at 10 iterations: 0.00309741

largest error at 11 iterations: 0.00255775

largest error at 12 iterations: 0.00214815

largest error at 13 iterations: 0.0018295

largest error at 14 iterations: 0.00157702

largest error at 15 iterations: 0.00137329

largest error at 16 iterations: 0.00120676
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

So did SynthEdit go 64 bit yet?

Post

average error for halfpi / 997

average error at 1 iterations: cos: 0.0479706 sin: 0.149065

average error at 2 iterations: cos: 0.00982466 sin: 0.0277034

average error at 3 iterations: cos: 0.00423763 sin: 0.0118079

average error at 4 iterations: cos: 0.00235966 sin: 0.00654944

average error at 5 iterations: cos: 0.00150321 sin: 0.00416494

average error at 6 iterations: cos: 0.00104129 sin: 0.00288237

average error at 7 iterations: cos: 0.000763884 sin: 0.00211329

average error at 8 iterations: cos: 0.00058428 sin: 0.00161582

average error at 9 iterations: cos: 0.000461346 sin: 0.00127553

average error at 10 iterations: cos: 0.000373513 sin: 0.0010325

average error at 11 iterations: cos: 0.000308582 sin: 0.000852893

average error at 12 iterations: cos: 0.000259223 sin: 0.000716403

average error at 13 iterations: cos: 0.000220833 sin: 0.000610252

average error at 14 iterations: cos: 0.000190381 sin: 0.000526069

average error at 15 iterations: cos: 0.000165821 sin: 0.000458181

average error at 16 iterations: cos: 0.000145729 sin: 0.000402638
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

hm, does that make trance?
JamWide - a cross-platform Ninjam client for DAWs

Post

Suloo wrote:hm, does that make trance?

Everything else, but...

Trance is a genre that has always eluded oxo, hence his ire :P

Post

Oxo ?

I always thought it was a palindrome for Sox Ox

Post

using this method quite satisfactorily to perform bin rotation (phase for fourier transforms). "i suppose the imprecision may daunt those of you who sell distinguished products" though i figure you can shave whole digit %s off your implementation without any discernment of quality changing.

Code: Select all

				float sc = 1.f - w * w;	float ss = w + w * sc;	//	two iterations
				sc -= w * ss;	ss += w * sc;
				sc -= w * ss;	ss += w * sc;
				sc -= .5f * w * ss;	//	average with next iteration
				register float t = sc * real[i] - ss * imag[i];
				imag[i] = ss * real[i] + sc * imag[i];	real[i] = t;
enjoy! :)

Image
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

Thanks xoxos. Is this different/similar, better/worse than a state variable quadrature oscillator as described here? http://www.earlevel.com/main/2003/03/02 ... le-filter/
For low frequencies, we can reduce the calculation of the f coefficient equation to

Here’s an example in C to show how easy this oscillator is to use; first initialize the oscillator amplitude, amp, to whatever amplitude you want (normally 1.0 for ±1.0 peak-to-peak output):

// initialize oscillator
sinZ = 0.0;
cosZ = amp;

Then, for every new sample, compute the sine and cosine components and use them as needed:

// iterate oscillator
sinZ = sinZ + f * cosZ;
cosZ = cosZ – f * sinZ;
Nigel notes that the above becomes assymetrical at high frequencies. Is your version better-behaved at high freqs?

Post

xoxos wrote:Image
Only she can tell

Post

Numanoid wrote:Only she can tell
"Point your finger at the doll and show us where he had an ellipsis."
Reaper user? Get my free JSFX plug-ins, also available via ReaPack extension.

Post

Don't go there :scared:

Image

Post

JCJR wrote:Is your version better-behaved at high freqs?
qualities of behaviour are not always clearly communicable har anyway i've been calling it "circular osc" tho i've seen it bear a fair number of titles eg. "fastsine". quadrature would be a better name but people seem to know what i mean, i'm not sure where i picked it up. "handy thing you can do things with" i use it in graphics, and cheap audio generator implementations where it's important to create "an event" without utmost precision :)

i believe it's generally stable to 1 (consider simple case of rotating (1,0)). you'll understand my uncritical laxness, for some reason i seem to remember some form of this better under pi/4, maybe not. since 4 iterations is working satisfactorily _imo_ for bins, that makes it useful for nonrecurring transformations.

i remember some presentations about the ellipse error. i've used it (or similar mass-spring) for audio countless times and i don't remember it as aliasing much at 44.1k...

as i'm casual i don't fancy analysing eg. how floating point affects it and so forth, it's securely in the "good enough" selection of methods. there's obviously a relatively linear trend in iterations and an improvement with smaller angles.

aah yes. and from my nescient perspective i wonder if the "ellipse" is because people aren't taking the cosine between samples? i'd say i've seen maybe 15-20 mentions of this method and perhaps i remember maybe one of them doing so, if that. doesn't matter.
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post

pertinent information from above in pdf:

fast simultaneous approximation of sine and cosine
http://xoxos.net/sincos_approximation.pdf


again, imo this is amazing..
average error at 2 iterations: cos: 0.000748374 sin: 0.00464497

that's 997 tests to pi/4, worse cases = larger angles, and we're getting this degree of fidelity from *4 multiplies* and producing *both* transcendentals.

sin + cos for 8 multiplies to pi/4 (+ or - angles, so actually a range of pi/2 centered on 0)....
average error at 4 iterations: cos: 0.00018508 sin: 0.00114373


laugh! :)
you come and go, you come and go. amitabha neither a follower nor a leader be tagore "where roads are made i lose my way" where there is certainty, consideration is absent.

Post Reply

Return to “DSP and Plugin Development”