to bail out vs to back out In a CS context, I have often come across the expression to back out meaning to say that a function is returned from before performing its actual task, as in this imaginary code comment:

double divide(double dividend, double divisor) {
  if (divisor == 0) {
    return 0; //divisor is zero =&gt; back out early
  }
  return (dividend / divisor);
}


Now I recently came across the expression to bail out in just the very same context. I know that to bail somebody out generally means to provide funds to get someone out of a difficult financial situation, so I was wondering if the writer confused to back out and to bail out or if to bail out really has this meaning, too.

Has any one ever heard or read a native speaker of English say or write to bail out of a function? Or, if you're a native speaker, would you say to bail out is also correct here?
I understand "to bail out" as to give up permanently; "to back out" is to give up some track, possibly to try something else.