From f055ff24974a8fe8418bb90384e22f2adeb77e32 Mon Sep 17 00:00:00 2001 From: Connor Date: Thu, 10 Aug 2017 12:15:39 -0700 Subject: [PATCH 1/4] --- desmos.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 desmos.md diff --git a/desmos.md b/desmos.md new file mode 100644 index 0000000..c528721 --- /dev/null +++ b/desmos.md @@ -0,0 +1,117 @@ +## stuff i've plotted in desmos + +in some order idk + +### [circumcircle](https://www.desmos.com/calculator/zaf29i2xrk) + +drag around the three points to see how their circumcircle is affected. +sorry, i never finished simplifying the math here. + +### [parabola arc length](https://www.desmos.com/calculator/hrokhmphrf) + +not closed form, sorry. drag the points around like it's a jumprope. + +### ["diode"](https://www.desmos.com/calculator/vappug98ky) + +i didn't name this function; i have no idea if or how it relates to a diode. +the red line (the line of interest) is actually just the 12th order smoothstep. + +btw, you can find smoothstep coefficients for any order +by the triangular table of this integer sequence: +[OEIS A091811](http://oeis.org/A091811) + +[punching it into wolfram][smoothie] (try changing n) + +[smoothie]: (https://www.wolframalpha.com/input/?i=ReplaceAll%5BBinomial%5Bn+%2B+k+-+2,+k+-+1%5D+Binomial%5B2+n+-+1,+n+-+k%5D,+%7Bk+-%3E+Range%5B1,n%5D%7D%5D+where+n+%3D+12) + +### [smoothstep alternatives](https://www.desmos.com/calculator/ibigyiumzb) + +refer to shadertoy: + +* [Inverse Smoothstep](https://www.shadertoy.com/view/MsSBRh) +* [gain()](https://www.shadertoy.com/view/ldBfR1) +* [Alt smoothstep](https://www.shadertoy.com/view/lsBfz1) + +### [tanh approximation](https://www.desmos.com/calculator/k3jzkhmoid) + +approximating tanh by taking its continued fraction form and (externally) optimizing the constants. +probably not useful. + +### [TanhTest lolremez approx](https://www.desmos.com/calculator/carcltkgem) + +a polynomial approximation of a scaled tanh function +made with [the excellent lolremez](https://github.com/samhocevar/lolremez). + +### [e^(-2/x) approximations](https://www.desmos.com/calculator/q8jtxgnmlh) + +i forget where i read about this but basically you can compute +`e^(-2/x)` using `(x-1)/(x+1)` when x is large. + +the black line shows the absolute error. + +### [compressor gain](https://www.desmos.com/calculator/rizrdxsrbg) + +trying to design a cheap-to-compute gain curve for a dynamic range compressor. +this thing uses just one division. +iirc it didn't wind up being all that useful. + +both axes are in power decibels. note that it acts as a gate under -70 dB. + +### [compressor approx stuff](https://www.desmos.com/calculator/5wbup88lev) + +trying to compute abs(x) by polynomials, or something. weird stuff. + +### [doom turnspeeds](https://www.desmos.com/calculator/zfscpmsdbk) + +i used this to help design turnspeed smoothing in [my zdoom patch.](https://eaguru.guru/t/zdoom_smoothstep.patch) + +*note to self: i think i have a more recent version of that patch lying around somewhere.* + +### [Biweight Funtimes](https://www.desmos.com/calculator/mlnqmf6ogp) + +messing around with a variations of Tukey's Biweight? +i think the only reason i kept this around was 'cause it's fun to watch animated. + +### [sincmod](https://www.desmos.com/calculator/lqgl4o0naz) + +something something windowing functions i dunno. + +### [SGDR](https://www.desmos.com/calculator/hlgqmyswy2) + +simple case of a [SGDR](https://arxiv.org/abs/1608.03983) curve. +i just kept this around 'cause the logarithmic plot complements +the linear plot in a kinda cool way. + +### [sqr/abs generalization](https://www.desmos.com/calculator/fagjg9vuz7) + +self-explanitory. + +### [SELU](https://www.desmos.com/calculator/bqu264oprw) + +[it's SELU!](https://arxiv.org/abs/1706.02515) + +### [GELU](https://www.desmos.com/calculator/ydzgtccsld) + +[GELU activation](https://arxiv.org/abs/1606.08415) +alongside an approximation i lifted off reddit or someplace. + +### [erf cdf approximations](https://www.desmos.com/calculator/22r29cude2) + +approximate gaussian stuff, with inversions and integrals. + +### [squish](https://www.desmos.com/calculator/1qdx4ovpb6) + +possibly useful functions for squishing values. +mostly based on sigmoidal functions. + +### [sin LUT approx 2](https://www.desmos.com/calculator/zdbgkxadns) + +approximating a quadrant of sin(x) with a polynomial and a LUT. + +### [circle calculus](https://www.desmos.com/calculator/yd5hyagaoj) + +some fun curves relating to unit circles. + +### [archimedes spiral](https://www.desmos.com/calculator/63vi3wnqug) + +it's just Archimedes' Spiral, plus some related functions. \ No newline at end of file From cebd8b94aacc0493c3cc172a94f6982abdff1062 Mon Sep 17 00:00:00 2001 From: Connor Date: Thu, 10 Aug 2017 12:16:18 -0700 Subject: [PATCH 2/4] --- desmos.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmos.md b/desmos.md index c528721..9bbf23a 100644 --- a/desmos.md +++ b/desmos.md @@ -22,7 +22,7 @@ by the triangular table of this integer sequence: [punching it into wolfram][smoothie] (try changing n) -[smoothie]: (https://www.wolframalpha.com/input/?i=ReplaceAll%5BBinomial%5Bn+%2B+k+-+2,+k+-+1%5D+Binomial%5B2+n+-+1,+n+-+k%5D,+%7Bk+-%3E+Range%5B1,n%5D%7D%5D+where+n+%3D+12) +[smoothie]: https://www.wolframalpha.com/input/?i=ReplaceAll%5BBinomial%5Bn+%2B+k+-+2,+k+-+1%5D+Binomial%5B2+n+-+1,+n+-+k%5D,+%7Bk+-%3E+Range%5B1,n%5D%7D%5D+where+n+%3D+12 ### [smoothstep alternatives](https://www.desmos.com/calculator/ibigyiumzb) From a8cc797d0fbb28d830851d8419adf11ba607cc36 Mon Sep 17 00:00:00 2001 From: Connor Date: Thu, 10 Aug 2017 12:17:25 -0700 Subject: [PATCH 3/4] --- desmos.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desmos.md b/desmos.md index 9bbf23a..60fa154 100644 --- a/desmos.md +++ b/desmos.md @@ -44,8 +44,8 @@ made with [the excellent lolremez](https://github.com/samhocevar/lolremez). ### [e^(-2/x) approximations](https://www.desmos.com/calculator/q8jtxgnmlh) -i forget where i read about this but basically you can compute -`e^(-2/x)` using `(x-1)/(x+1)` when x is large. +i forget where i read about this but basically you can +approximate `e^(-2/x)` by `(x-1)/(x+1)` when x is large. the black line shows the absolute error. From 401732d4bea72f1b1d2a6a5694f1c1428519ee9f Mon Sep 17 00:00:00 2001 From: Connor Date: Thu, 10 Aug 2017 12:18:11 -0700 Subject: [PATCH 4/4] --- desmos.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmos.md b/desmos.md index 60fa154..d81a3e8 100644 --- a/desmos.md +++ b/desmos.md @@ -63,7 +63,7 @@ trying to compute abs(x) by polynomials, or something. weird stuff. ### [doom turnspeeds](https://www.desmos.com/calculator/zfscpmsdbk) -i used this to help design turnspeed smoothing in [my zdoom patch.](https://eaguru.guru/t/zdoom_smoothstep.patch) +i used this to help design turnspeed smoothing in [my zdoom patch.](https://eaguru.guru/t/zdoom_smoothstep.diff) *note to self: i think i have a more recent version of that patch lying around somewhere.*