44static float eq(
float x) {
74 x3 = x1 - (x1 - x2) * (y1) / (y1 - y2);
86 std::cout <<
"Your 1st root is : " << root << std::endl;
87 }
else if (count == 2) {
88 std::cout <<
"Your 2nd root is : " << root << std::endl;
89 }
else if (count == 3) {
90 std::cout <<
"Your 3rd root is : " << root << std::endl;
92 std::cout <<
"Your " << count <<
"th root is : " << root << std::endl;
103 float a = 0, b = 0, i = 0, root = 0;
109 i = ((-1) * range + gap);
static float regula_falsi(float x1, float x2, float y1, float y2)
This function finds root of the equation in given interval i.e. (x1,x2).
static float eq(float x)
This function gives the value of f(x) for given x.
void printRoot(float root, const int16_t &count)
This function prints roots of the equation.
Functions for [False Position] (https://en.wikipedia.org/wiki/Regula_falsi) method.