protected final function subs($a, $b)
{
$array = array();
if (count($a) != count($a)) {
throw new \Exception("Array shape mismatch");
}
foreach ($a as $index => $value) {
if (!isset($b[$index])) {
throw new \Exception("Array shape mismatch");
}
$array[$index] = $value - $b[$index];
}
return $array;
}