• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Brent's method for computing extrema
14-03-2016, 08:12 PM
Post: #1
 cdeaglejr Junior Member Posts: 39 Joined: Mar 2016 Reputation: 0
Brent's method for computing extrema
This HP Prime program demonstrates how to interact with a function called minima which computes a single minimum of a user-defined function. The user provides an initial and final value for a search interval along with a convergence criterion.

Here is the output for this program. For this example the user-defined function is simply y = cos(x) and the search interval was 0 to 2 pi. To find the maximum value of a function, remember that a maximum is simply a minimum with a negative attitude! So for this example, changing the user-defined function to y = -cos(x) will find a maximum if one exists in the search interval.

brent's minima method

y = cos(x)

minima = 3.14159265359

error = 0

The error displayed here is pi minus the value computed by the minima function.

Attached File(s)