problem to generate implied volatility

Posted by Xavier.Abulker on
URL: http://quantlib.414.s1.nabble.com/problem-to-generate-implied-volatility-tp2101.html

Hello,
I have a very simple problem:

I'm using EuropeanOption class
I define a new object
EuropeanOption Europeanoptioniv(Option::Call,3890,3900,0,0.05,0.995,0.25);

I check the price with quantlib :

the price is   473.4

then I want to retreive the implied volatility with the same price:

std::cout<< " ** Implied vol is: " <<
Europeanoptioniv.impliedVolatility(473,1e-8, 1000,1.0e-8,4.0)<<std::endl;

Each time the process stops with the error:
Abnormal program termination

 and I don't think I'm in a case of  gamma that changes of sign or not
attainable volatility.

I don't see any other way of retreiving the implied vol for a european
option with dividend yield and risk free rate.

Thanks for your help
Xavier