#pragma TASS input 
double tol;
#pragma TASS output 
double phi;

void main() {
  double i; 
  double j=1.0; 
  double k=1.0;
  double err=tol; 
  double tmp; 
  double p=0.0;
  
  l: while (err>=tol) {
    i=j; j=k; k=i+j; tmp = k/j;
    if (tmp>=p) err=tmp-p; else err=p-tmp;
    p = tmp;
  }
  phi=p;
}
