$Z subject to the following qualifications.
The parties hire appraisers, disclose their expert reports prior to trial (possibly taking their depositions as well) and the judge decides who is most convincing as a question of fact. Book value can be offered as evidence but is low quality evidence. The non-expert testimony of the parties can also usually be considered.
As of the time of the divorce is correct, but what exactly that means varies and varies from state to state. Some jurisdictions value assets for divorce purposes at fair market value as of the date of the property division hearing, others do so as of the date of the filing of the divorce petition. I haven't done the research to determine which rule (or perhaps some other rule) applies in New Jersey, but the answer to this question could be determined without too much work.
Book value and purchase price may be relevant to determining fair market value at the time of divorce, however, to the extent that it helps to quantify the likely tax liability associated with an asset if it is sold at fair market value immediately upon the divorce which influences the fair market value to the spouse receiving it.
There is a split of authority over the extent to which it is proper for divorce courts to consider tax implications of assets in a property division otherwise based upon the fair market value of the assets.