Interpolates for a specific x value and returns P(x).
@access		public
@param		double		$x				Value to interpolate for
@return		double
@todo		Var x is not needed? Why getValue( 2 ) ?
500177
public function interpolate( $x )
	{
		$sum	= 0;
		$values	= array_values( $this->data );
		$expressions	= $this->getExpressions();
		for( $i=0; $i<count( $expressions ); $i++ )
		{
			$expression	= $expressions[$i];
			$formula	= new Alg_Math_Formula( $expression, array( "x" ) );
			$value	= $formula->getValue( 2 );
			$sum	+= $values[$i] * $value;
		}
		return $sum;
	}
610353
public static function POWER($x = 0, $y = 2)
    {
        $x    = PHPExcel_Calculation_Functions::flattenSingleValue($x);
        $y    = PHPExcel_Calculation_Functions::flattenSingleValue($y);

        // Validate parameters
        if ($x == 0.0 && $y == 0.0) {
            return PHPExcel_Calculation_Functions::NaN();
        } elseif ($x == 0.0 && $y < 0.0) {
            return PHPExcel_Calculation_Functions::DIV0();
        }

        // Return
        $result = pow($x, $y);
        return (!is_nan($result) && !is_infinite($result)) ? $result : PHPExcel_Calculation_Functions::NaN();
    }
1255340
@Override
    public double hedge(double x) {
        return Op.isLE(x, 0.5)
                ? 2.0 * x * x
                : 1.0 - 2.0 * (1.0 - x) * (1.0 - x);
    }
963857
public function getValue( $x )
	{
		$y = 0;
		for( $i = $this->getRank() - 1; $i >= 0; $i-- )
			$y	= $this->coefficients[$i] + $y * $x;
		return $y;
	}
563760
public function setX($x)
    {
        $parser = new Parser($x);

        try {
            $x = (float) $parser->parse();
        } catch (RangeException $e) {
            throw new InvalidValueException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (UnexpectedValueException $e) {
            throw new InvalidValueException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }

        if ($x < -180 || $x > 180) {
            throw new InvalidValueException(sprintf('Invalid longitude value "%s", must be in range -180 to 180.', $x));
        }

        $this->x = $x;

        return $this;
    }
450682
public double linearInterpolateY( double xValue ) {

        double first = xList[0];
        double last = xList[xList.length - 1];

        // check out of range
        if (first <= last) {
            if (xValue < xList[0] || xValue > xList[xList.length - 1]) {
                return Double.NaN;
            }
            isInverse = false;
        } else {
            // inverse proportional
            if (xValue > xList[0] || xValue < xList[xList.length - 1]) {
                return Double.NaN;
            }
            isInverse = true;
        }

        for( int i = 0; i < xList.length; i++ ) {
            double x2 = xList[i];
            // if equal to a number in the array
            if (NumericsUtilities.dEq(x2, xValue)) {
                return yList[i];
            }// else interpolate
            else if ((!isInverse && x2 > xValue) || (isInverse && x2 < xValue)) {
                double x1 = xList[i - 1];
                double y1 = yList[i - 1];
                double y2 = yList[i];

                double y = (y2 - y1) * (xValue - x1) / (x2 - x1) + y1;
                return y;
            }
        }
        return Double.NaN;
    }
440049
static public double myRound(double x) {
    return (Math.signum(x) * Math.round(Math.abs(x)));
  }
50980
@Pure
	public DoubleProperty x2Property() {
		if (this.p2.x == null) {
			this.p2.x = new SimpleDoubleProperty(this, MathFXAttributeNames.X2);
		}
		return this.p2.x;
	}
947777
private function modNn(int $x) : int
    {
        while ($x >= $this->blockSize) {
            $x -= $this->blockSize;
            $x = ($x >> $this->symbolSize) + ($x & $this->blockSize);
        }

        return $x;
    }
798319
public static function adjust_lat($x)
    {
        $x = (abs($x) < M_PI_2)
            ? $x
            : ($x - (static::sign($x) * M_PI) );

        return $x;
    }
549536
protected function interpolate($x, $y, $nw, $ne, $sw, $se)
    {
        list($r0, $g0, $b0) = $this->getRGB($nw);
        list($r1, $g1, $b1) = $this->getRGB($ne);
        list($r2, $g2, $b2) = $this->getRGB($sw);
        list($r3, $g3, $b3) = $this->getRGB($se);

        $cx = 1.0 - $x;
        $cy = 1.0 - $y;

        $m0 = $cx * $r0 + $x * $r1;
        $m1 = $cx * $r2 + $x * $r3;
        $r  = (int) ($cy * $m0 + $y * $m1);

        $m0 = $cx * $g0 + $x * $g1;
        $m1 = $cx * $g2 + $x * $g3;
        $g  = (int) ($cy * $m0 + $y * $m1);

        $m0 = $cx * $b0 + $x * $b1;
        $m1 = $cx * $b2 + $x * $b3;
        $b  = (int) ($cy * $m0 + $y * $m1);

        return ($r << 16) | ($g << 8) | $b;
    }
151338
public function getValueOfYForX($xValue)
    {
        $retVal = $this->getIntersect();
        $slope = $this->getSlope();
        foreach ($slope as $key => $value) {
            if ($value != 0.0) {
                $retVal += $value * pow($xValue, $key + 1);
            }
        }
        return $retVal;
    }
1150198
function bitwise_or($x)
    {
        switch (MATH_BIGINTEGER_MODE) {
            case self::MODE_GMP:
                $temp = new static();
                $temp->value = gmp_or($this->value, $x->value);

                return $this->_normalize($temp);
            case self::MODE_BCMATH:
                $left = $this->toBytes();
                $right = $x->toBytes();

                $length = max(strlen($left), strlen($right));

                $left = str_pad($left, $length, chr(0), STR_PAD_LEFT);
                $right = str_pad($right, $length, chr(0), STR_PAD_LEFT);

                return $this->_normalize(new static($left | $right, 256));
        }

        $length = max(count($this->value), count($x->value));
        $result = $this->copy();
        $result->value = array_pad($result->value, $length, 0);
        $x->value = array_pad($x->value, $length, 0);

        for ($i = 0; $i < $length; ++$i) {
            $result->value[$i]|= $x->value[$i];
        }

        return $this->_normalize($result);
    }
1094609
public static double sigmoid(double x) {
    if (x<0) {
      double num = Math.exp(x);
      return num / (1.0 + num);
    }
    else {
      double den = 1.0 + Math.exp(-x);
      return 1.0 / den;
    }
  }
266309
public static int raise_2( int x ) {
		int y;
		y = eval_table( exp_2_table, x & IBXM.FP_MASK ) << IBXM.FP_SHIFT;
		return y >> IBXM.FP_SHIFT - ( x >> IBXM.FP_SHIFT );
	}
72586
function _square($x = false)
    {
        return count($x) < 2 * MATH_BIGINTEGER_KARATSUBA_CUTOFF ?
            $this->_trim($this->_baseSquare($x)) :
            $this->_trim($this->_karatsubaSquare($x));
    }
107594
public final function setX(float $x): self {
        $this->coordinates[self::X] = $this->gf
                ->getPrecisionModel()
                ->makePrecise($x);
        return $this;
    }