Has acyl-CoA thioesterase activity towards medium and long-chain (C14 to C18) fatty acyl-CoA substrates, and probably plays a role in mitochondrial fatty acid metabolism. H2O + hexadecanoyl-CoA = CoA + H(+) + hexadecanoate H2O + octanoyl-CoA = CoA + H(+) + octanoate decanoyl-CoA + H2O = CoA + decanoate + H(+) dodecanoyl-CoA + H2O = CoA + dodecanoate + H(+) H2O + tetradecanoyl-CoA = CoA + H(+) + tetradecanoate (9Z)-octadecenoyl-CoA + H2O = (9Z)-octadecenoate + CoA + H(+) (5Z,8Z,11Z,14Z)-eicosatetraenoyl-CoA + H2O = (5Z,8Z,11Z,14Z)-eicosatetraenoate + CoA + H(+) Released from the mitochondria into the cytosol in response to apoptotic stimuli. Belongs to the THEM4/THEM5 thioesterase family.