I am solving an equilibrium of an economic model for prices p > 0. I need to do this robustly for “wacky” parameter values when I am fitting the model to the data in an outer loop.

I have coded up a market clearing residual function `market_residuals(model, p)`

.

I found that I can do this by, roughly,

```
NLsolve.nlsolve(x0; autodiff = :forward, iterations = 200,
method = :newton, ftol = residual_tol) do x
p = exp.(x)
market_residuals(model, p)
end
```

The problem is that the Newton solver can very easily lead to arguments which are invalid when transformed, as

```
julia> exp(750)
Inf
julia> exp(-750)
0.0
```

Scaling `x`

does not help as the Newton method is scale invariant.

Is there a “gentler” transformation from \Bbb{R} to \Bbb{R}_+ that one could recommend?