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

  • Home
  • SEARCH
  • 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 964703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:52:23+00:00 2026-05-16T01:52:23+00:00

I have a function that takes a floating point number and returns a floating

  • 0

I have a function that takes a floating point number and returns a floating point number. It can be assumed that if you were to graph the output of this function it would be ‘n’ shaped, ie. there would be a single maximum point, and no other points on the function with a zero slope. We also know that input value that yields this maximum output will lie between two known points, perhaps 0.0 and 1.0.

I need to efficiently find the input value that yields the maximum output value to some degree of approximation, without doing an exhaustive search.

I’m looking for something similar to Newton’s Method which finds the roots of a function, but since my function is opaque I can’t get its derivative.

  • 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-16T01:52:23+00:00Added an answer on May 16, 2026 at 1:52 am

    I would like to down-thumb all the other answers so far, for various reasons, but I won’t.

    An excellent and efficient method for minimizing (or maximizing) smooth functions when derivatives are not available is parabolic interpolation. It is common to write the algorithm so it temporarily switches to the golden-section search (Brent’s minimizer) when parabolic interpolation does not progress as fast as golden-section would.

    I wrote such an algorithm in C++. Any offers?

    UPDATE: There is a C version of the Brent minimizer in GSL. The archives are here: ftp://ftp.club.cc.cmu.edu/gnu/gsl/ Note that it will be covered by some flavor of GNU “copyleft.”

    As I write this, the latest-and-greatest appears to be gsl-1.14.tar.gz. The minimizer is located in the file gsl-1.14/min/brent.c. It appears to have termination criteria similar to what I implemented. I have not studied how it decides to switch to golden section, but for the OP, that is probably moot.

    UPDATE 2: I googled up a public domain java version, translated from FORTRAN. I cannot vouch for its quality. http://www1.fpl.fs.fed.us/Fmin.java I notice that the hard-coded machine efficiency (“machine precision” in the comments) is 1/2 the value for a typical PC today. Change the value of eps to 2.22045e-16.

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

Sidebar

Ask A Question

Stats

  • Questions 534k
  • Answers 534k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The whole point of a UIWebView is to show a… May 17, 2026 at 12:46 am
  • Editorial Team
    Editorial Team added an answer EDIT (removed wrong solution). EDIT (to add this other option):… May 17, 2026 at 12:46 am
  • Editorial Team
    Editorial Team added an answer In Python, modules need to be imported before they're accessible.… May 17, 2026 at 12:46 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a function that takes a variable number of arguments in C that
I have a function that takes a ref parameter and would like to use
I have a function that takes in a Handle to an image: DoSomethingWithImage( int
I have a function that takes a string date in the format 08/24/2010 and
I have a function that takes a unsigned long* and needs to pass it
Say I have a function that takes a list and does something: (defun foo(aList)
I'm a bit confused: I have a function, that takes an Object as argument.
I have a function which takes two arrays containing the tokens/words of two texts
I have just tried out ASUnit and it wasn't a success, so I'm looking
I've been trying to optimize a numeric program of mine, and have run into

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.