A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/dd/d29/false__position_8cpp_source.html below:

TheAlgorithms/C++: numerical_methods/false_position.cpp Source File

Go to the documentation of this file. 44static float eq

(

float

x) {

55static float regula_falsi

(

float

x1,

float

x2,

float

y1,

float

y2) {

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.

int main()

Main function.

Functions for [False Position] (https://en.wikipedia.org/wiki/Regula_falsi) method.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4