original_string: protected function getNewDirection(array $theta, float $beta, array $d): array
      {
          $grad = $this->gradient($theta);
  
          return MP::add(MP::muls($grad, -1), MP::muls($d, $beta));
      }
code: protected function getNewDirection(array $theta, float $beta, array $d): array
      {
          $grad = $this->gradient($theta);
  
          return MP::add(MP::muls($grad, -1), MP::muls($d, $beta));
      }
code_tokens: protected function getNewDirection ( array $ theta , float $ beta , array $ d ) : array { $ grad = $ this -> gradient ( $ theta ) ; return MP :: add ( MP :: muls ( $ grad , - 1 ) , MP :: muls ( $ d , $ beta ) ) ; }
docstring: Calculates the new conjugate direction
  
  d(k+1) =–∇f(x(k+1)) + β(k).d(k)
docstring_tokens: Calculates the new conjugate direction