Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6658725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:56:49+00:00 2026-05-26T01:56:49+00:00

i am trying to find such p,that for given function f(p),we have equality p=f(p);

  • 0

i am trying to find such p,that for given function f(p),we have equality

p=f(p);
here is code

#include <iostream>
#include<math.h>
using namespace std;
float fixed(float x){
    return (float)(pow(x,3)-4*pow(x,2)-10);
}

int main(){
    float p=0.0;
    float p0=1.5;
    float tol=(float).001;
    int N=25;
    int i=1;
    while(i<N){
        p=(float)fixed(p0);
        if((p-p0)<tol){
          cout<<p<<endl;
          break;
        }
        i=i+1;
        p0=p;
        if(i>N){
          cout<<"solution not found ";
          break;
        }
    }
    return 0;
}

i have tried different initial point,also different tolerance,but result is very nonsense -16 or -15.something,so what is wrong?is code correct?please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:56:50+00:00Added an answer on May 26, 2026 at 1:56 am

    I think you simply don’t have a situation in which the iterative algorithm is applicable. See here for some conditions. Your function doesn’t have an attractive fixed point near 1.5, and the algorithm diverges.

    But why the numerics: Your function is f(x) = x^3 - 4x - 10, so solving f(x) = x amounts to finding the zeros of f(x) - x, and there is only one real zero near 5.35. Howevever, f'(x) at that point is very large, so even there the iterative algorithm isn’t usable.

    A numeric root-finding algorithm may be a more appropriate approach.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to find an example that has css rollover using sprites & sliding door
A problem I'm trying to solve: given that you have two distinct strings composed
I'm trying to find a good way to print leading 0 , such as
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
Trying to find the sqlserver adapter for rails on windows. I have tried getting
Im trying to find out a good JavaScript library that can create a nice
I want to find a combinatorial formula that given a certain number of integers,
Trying to find out if a provided Type is of a given generic type
I'm trying to validate that the fields given to sphinx are valid, but I'm
I am trying to extract numbers from a typical scoreboard that you would find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.