0
Help needed to make this code work for non algebraic expressions. Such as sin(x), ln(x)
This a code for finding real root of an expression using Newton-Rapson method. But this code works for pure algebraic expressions only. I want this code working for non algebraic expressions also. Thanks in advance https://code.sololearn.com/cSbepgoiJiRh/?ref=app
3 odpowiedzi
+ 3
Oh ok ! You can "simply" do a string parse ! You can separate each members using the polish notation (you can find algorithm to translate normal to polish notation on Google) then you just have to add the parsing part for supported functions
0
As I am not really good in maths (and am French, so understanding them in another language is hard one), can you details what you really expect ? (Examples of in/out) please ^^
0
Hey Baptiste E. Prunier ,
Here are a few examples:
I/P: x^2 - ln(x) - 12
O/P: x = 3.6460
I/P: x * sin(x) + cos(x)
O/P: x = 2.7984
I/P: log(x) - cos(x)
O/P: x = 1.4184
I hope you can help.
Thanks ☺☺