public function arctan($scale = null)
{
$piOverFour = DecimalConstants::pi()->div(Decimal::fromInteger(4), $scale + 2)->round($scale);
if ($this->round($scale)->isZero()) {
return DecimalConstants::zero();
}
if ($this->round($scale)->equals(DecimalConstants::one())) {
return $piOverFour;
}
if ($this->round($scale)->equals(DecimalConstants::negativeOne())) {
return DecimalConstants::negativeOne()->mul($piOverFour);
}
$scale = $scale === null ? 32 : $scale;
return self::simplePowerSerie($this, DecimalConstants::zero(), $scale + 2)->round($scale);
}