# Reproducing rosenbrock example: can't see the candidate solution

**URL:** <https://discourse.julialang.org/t/reproducing-rosenbrock-example-cant-see-the-candidate-solution/68643>\
**Category:** Optimization (Mathematical)\
**Created:** [September 23, 2021, 7:46pm UTC](https://discourse.julialang.org/t/reproducing-rosenbrock-example-cant-see-the-candidate-solution/68643 "2021-09-23T19:46:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rio](https://avatars.discourse-cdn.com/v4/letter/r/ea666f/32.png) [@rio](https://discourse.julialang.org/u/rio)\
**Post date:** [September 23, 2021, 7:46pm UTC](https://discourse.julialang.org/t/reproducing-rosenbrock-example-cant-see-the-candidate-solution/68643/1 "2021-09-23T19:46:15Z")

</div>

Hi, when I run the rosenbrock example in  
[https://github.com/JuliaNLSolvers/Optim.jl/](https://github.com/JuliaNLSolvers/Optim.jl/)

```julia
using Optim
rosenbrock(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
result = optimize(rosenbrock, zeros(2), BFGS())

```

I get this output

```julia
julia> result = optimize(rosenbrock, zeros(2), BFGS())
 * Status: success

 * Candidate solution
    Final objective value: 5.471433e-17

 * Found with
    Algorithm: BFGS

 * Convergence measures
    |x - x'| = 3.47e-07 ≰ 0.0e+00
    |x - x'|/|x'| = 3.47e-07 ≰ 0.0e+00
    |f(x) - f(x')| = 6.59e-14 ≰ 0.0e+00
    |f(x) - f(x')|/|f(x')| = 1.20e+03 ≰ 0.0e+00
    |g(x)| = 2.33e-09 ≤ 1.0e-08

 * Work counters
    Seconds run: 0 (vs limit Inf)
    Iterations: 16
    f(x) calls: 53
    ∇f(x) calls: 53

```

Please, how can I see/access the optimized x value?  
I’m running Optim v1.4.1 on macOS 11.6

Many thanks.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 24, 2021, 4:43am UTC](https://discourse.julialang.org/t/reproducing-rosenbrock-example-cant-see-the-candidate-solution/68643/2 "2021-09-24T04:43:34Z")

</div>

See the “Obtaining results" section here:

> **[Optim.jl](https://julianlsolvers.github.io/Optim.jl/stable/#user/minimization/)**
>
> Pure Julia implementations of optimization algorithms.

(tldr you want ‘minimizer(result)’)
