🟣
ourple
Pinned Loading
-
solve_poly.c
solve_poly.c 1#include <stdio.h>// Usage: find k (<=n) roots of polynomial f such that deg f=n; Input: n c_0 c_1 ... c_n | c_i: double
2#include <math.h>// Output: roots:k x:x_1 f:f(x_1) x:x_2 f:f(x_2) ... x:x_k f:f(x_k) | x, f: double | roots are ordered
3#include <float.h>// non-descenging. Note that roots can be repeated due to divisibility of f by (x-root)^k where k > 1!
4#define P(o)if(B o T){for(u i=2048;i;--i){d m=(b+t)/2;*((d*[]){&b,&t})[0 o a(n,c,m)]=m;}return b;}// (c) afeistel 2020~5
5typedef double d;typedef unsigned short u;d a(u n,d*c,d x){d r=0;for(u i=n;i;--i)r=(r+c[i])*x;return r+c[0];}d s(u n,d*c
-
-
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.