code: public static function SLOPE($yValues, $xValues)
      {
          if (!self::checkTrendArrays($yValues, $xValues)) {
              return Functions::VALUE();
          }
          $yValueCount = count($yValues);
          $xValueCount = count($xValues);
  
          if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
              return Functions::NA();
          } elseif ($yValueCount == 1) {
              return Functions::DIV0();
          }
  
          $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
  
          return $bestFitLinear->getSlope();
      }
docs: SLOPE.
  
  Returns the slope of the linear regression line through data points in known_y's and known_x's.
  
  @param mixed[] $yValues Data Series Y
  @param mixed[] $xValues Data Series X
  
  @return float