'Why does this recursive method not work the same as while-true loop?

I'm working on my first endeavor into genetic algorithms and came across a weird bug when trying to implment pool selection. My original method used a recursive call to loop until a perameter was met, but this broke my evolution. When I switched it to a while loop everything worked suddenly. Then, I tried taking my old recursive method (acceptRejectBad1) and flipped the if statement to match the while loop, suddenly it worked but still took significantly more generations to reach the goal than the while loop method. Using a while loop might make more sense here anyway but I would like to understand why the recursive methods break down. Can anyone explain to me why these three methods behave so differently?

//recursive call method one
Guess acceptRejectBad1(double maxFit) {
  Guess parent = this.guesses[ThreadLocalRandom.current().nextInt(this.guesses.length)];
  if (parent.fitness <= ThreadLocalRandom.current().nextDouble(maxFit)) {
    return this.acceptRejectBad(maxFit);
  } else {
    return parent;
  }
}

//recursive call method two
Guess acceptRejectBad2(double maxFit) {
  Guess parent = this.guesses[ThreadLocalRandom.current().nextInt(this.guesses.length)];
  if (parent.fitness > ThreadLocalRandom.current().nextDouble(maxFit)) {
    return parent;
  } else {
    return this.acceptRejectBad(maxFit);
  }
}

//while-true loop method
Guess acceptReject(double maxFit) {
  while (true) {
    Guess parent = this.guesses[ThreadLocalRandom.current().nextInt(this.guesses.length)];
    if (parent.fitness > ThreadLocalRandom.current().nextDouble(maxFit)) {
      return parent;
    }
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source