Questions tagged [polynomial-math]

Polynomial Math is a subset of mathematics dealing with mathematical expressions constructed from variables and constants using only the operations of addition, subtraction, multiplication, and non-negative integer exponents. Any polynomial math question should be programming related.

630 questions
-2
votes
3 answers

Coding a loop of polynomial with a given X to find f(x) in Java

So I have trouble coding a loop of a polynomial with a given x to find f(x) in java. To put it simply, for example, I have an array of f(x) = C[0]*x^n + C[1]*x^(n-1).......C[n]n, how would I code a loop to find f(x) with the user's input of…
user3312298
  • 31
  • 1
  • 2
  • 5
-2
votes
4 answers

recursive segmentation fault

So I wrote a header that uses recursion to compute several mathematical functions. Including the cosine function and exponential function( e^x). Now the cosine functions works just fine but e^x produces a segmentation fault even though both use the…
Mr X
  • 336
  • 1
  • 6
  • 22
-2
votes
1 answer

Computing cubic polynomial

I need a procedure that returns the value of a cubic polynomial, ie : f(x) = x3 + ax2 + bx + c I should be able to do this with a procedure that takes three arguments and Newton-Raphson's method but I am at a loss on how. (define f (cubic a b c)…
-2
votes
1 answer

Calculating polynomal function

Considering a sequence of integers, how can I find the polynomial function that models it? (i.e generates the first item for x=1, second items for x=2, etc) For example, let us consider this sequence: 1, 683, 44287, 838861. How do I find that the…
user2705335
  • 357
  • 1
  • 3
  • 8
-2
votes
1 answer

Polynomial in Lisp

People, help me with this lisp function. There is a list with polynomial coefficients. This function needs to calculate value of polynomial. Pol (x list) for example (Pol 2 '(3 5 2)) => 17
-3
votes
2 answers

best complexity to evaluate coefficients of polynomial

I want to find out coefficients of the n degree polynomial with roots 0,1,2...n-1. Can anybody suggest a good algorithm? I tried using FFT but didn't work fast enough
-3
votes
1 answer

How to get an approximate equation for reverse look up

Is there any method or way to get the approximate equation(x = g(y)) for doing a reverse lookup from Y to X. The following is the simple y = f(x) and its plot. import numpy as np import matplotlib.pyplot as plt formula = "2*x**6 + x**5 -3*x**4 +…
-3
votes
1 answer

Optimal solution to find the coefficients from an unknown polynomial function

Suppose I have a polynomial f(x) where all the coefficients a(i) are integers in the form of a function f, implement a function find_polynomial that takes f and returns the coefficients a(i) as a list of the form: [a(0),a[1]....a[n]] (n<=15) where…
-3
votes
1 answer

is it possible to write a program that can find zeros of a certain function?

In Gauss-legendre integration we need to find zeros of the legendre function but i can't find a way to write code that enable me to do that? I understand there are list of "xi"s out there by which this function equals to zero but can we write…
-3
votes
2 answers

I need some help on polynomials

How would I create a polynomial function using an array? Basically I want to display the polynomial (ex. x^2 + 3x + 5). Then, I want to show what the highest polynomial degree is. For example, x^2 + 3x + 5 = 2 (highest degree).
-4
votes
1 answer

Problem with creating a new constructor in Java

I am trying to create a new constructor for the Monomial, but I keep getting the error "return type is missing for coefficient" Why is that so because constructors in java has no return type so why is the compiler is asking for a return…
-4
votes
3 answers

Mathematical mind boggler, very confusing possible new mathematical breakthrough

I'm not trying to make a joke here but I am very confused I been trying to figure this out for like 6 hours straight now got about 20 notepads opened up here, 15 calculators and I cant crunch it I'm always getting too much excess in the end. Lets…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
-4
votes
6 answers

unrecognized symbol variable (JAVA)

I have a class that finds the roots of a polynomial. In the Main function, it is telling me that the variable radicand does not exist. The function rootradicand() works fine, I have tested it with other values. public double handleRadicand(double…
Gabe Spound
  • 568
  • 5
  • 28
-5
votes
2 answers

Rational Class Built Off of Polynomial Class: An Analysis of Class Dependency and Operator Overloading

I have a Polynomial and Rational class which manipulates polynomial and rational functions as vectors. I've defined non-member operators for *, /, +, and -, but I don't think I'm getting how to use them correctly (see code…
-7
votes
3 answers

How can I get the roots of a polynomial?

I have a polynomial,for example 3x4- 5x + 4. Assume that I have an array A = { 3, 0, 0, -5, 4 } with the polynomial's coefficients. How can I use the array A to find the roots of the polynomial? Is there any function or library to download to do…
Konstantinos_S
  • 65
  • 2
  • 10
1 2 3
41
42