def undo_linear_rescale_with_extrapolation(x: float, vmin: float,
                                           vmax: float) -> float:
  """Computes the input of linear_rescale_with_extrapolation given output."""
  if vmax <= vmin:
    raise ValueError('Interval must be such that vmax > vmin.')
  return vmin + x * (vmax - vmin)