Skip to content

RealFunctions

Oleksandr Bretsko edited this page Dec 27, 2020 · 1 revision

RealFunctions

public protocol RealFunctions: ElementaryFunctions

Inheritance

ElementaryFunctions

Requirements

atan2(y:​x:​)

atan(y/x), with sign selected according to the quadrant of (x, y).

static func atan2(y: Self, x: Self) -> Self

See also:

  • atan()

erf(_:​)

The error function evaluated at x.

static func erf(_ x: Self) -> Self

See also:

  • erfc()

erfc(_:​)

The complimentary error function evaluated at x.

static func erfc(_ x: Self) -> Self

See also:

  • erf()

exp2(_:​)

2^x

static func exp2(_ x: Self) -> Self

See also:

  • exp()

  • expMinusOne()

  • exp10()

  • log2()

  • pow()

exp10(_:​)

10^x

static func exp10(_ x: Self) -> Self

See also:

  • exp()

  • expMinusOne()

  • exp2()

  • log10()

  • pow()

hypot(_:​_:​)

sqrt(x*x + y*y), computed in a manner that avoids spurious overflow or underflow.

static func hypot(_ x: Self, _ y: Self) -> Self

gamma(_:​)

The gamma function Γ(x).

static func gamma(_ x: Self) -> Self

See also:

  • logGamma()

  • signGamma()

log2(_:​)

The base-2 logarithm of x.

static func log2(_ x: Self) -> Self

See also:

  • exp2()

  • log()

  • log(onePlus:)

  • log10()

log10(_:​)

The base-10 logarithm of x.

static func log10(_ x: Self) -> Self

See also:

  • exp10()

  • log()

  • log(onePlus:)

  • log2()

logGamma(_:​)

!os(Windows)

The logarithm of the absolute value of the gamma function, log(|Γ(x)|).

static func logGamma(_ x: Self) -> Self

Not available on Windows targets.

See also:

  • gamma()

  • signGamma()

signGamma(_:​)

!os(Windows)

The sign of the gamma function, Γ(x).

static func signGamma(_ x: Self) -> FloatingPointSign

For x >= 0, signGamma(x) is .plus. For negative x, signGamma(x) is .plus when x is an integer, and otherwise it is .minus whenever trunc(x) is even, and .plus when trunc(x) is odd.

This function is used together with logGamma, which computes the logarithm of the absolute value of Γ(x), to recover the sign information.

Not available on Windows targets.

See also:

  • gamma()

  • logGamma()

_mulAdd(_:​_:​_:​)

a*b + c, computed either with an FMA or with separate multiply and add.

static func _mulAdd(_ a: Self, _ b: Self, _ c: Self) -> Self

Whichever is faster should be chosen by the compiler statically.

Types
Protocols
Global Typealiases
Global Variables
Global Functions
  • MACH_MSGH_BITS(_:_:)
  • MACH_MSGH_BITS_REMOTE(_:)
  • QCKMain(_:configurations:testCases:)
  • __allTests()
  • afterEach(_:)
  • afterSuite(_:)
  • allPass(_:)
  • allPass(_:_:)
  • assertClose(_:_:allowedError:file:line:)
  • assertClose(_:_:allowedError:worstError:file:line:)
  • be(_:)
  • beAKindOf(_:)
  • beAnInstanceOf(_:)
  • beCloseTo(_:within:)
  • beEmpty()
  • beFalse()
  • beFalsy()
  • beGreaterThan(_:)
  • beGreaterThanOrEqualTo(_:)
  • beIdenticalTo(_:)
  • beLessThan(_:)
  • beLessThanOrEqualTo(_:)
  • beNil()
  • beTrue()
  • beTruthy()
  • beVoid()
  • beforeEach(_:)
  • beforeSuite(_:)
  • beginWith(_:)
  • catchBadInstruction(block:)
  • catchBadInstruction(in:)
  • chain(_:_:)
  • contain(_:)
  • containElementSatisfying(_:_:)
  • context(_:flags:closure:)
  • crashIf(_:_:)
  • crashIfAnyFalse(_:_:)
  • crashIfAnyFalse(_:crashMessage:)
  • crashIfAnyFalse(_:message:)
  • crashIfAnyNotExpected(_:expected:_:)
  • crashIfAnyNotExpected(_:expected:crashMessage:)
  • crashIfAnyTrue(_:_:)
  • crashIfFalse(_:_:)
  • crashIfNegative(_:)
  • crashIfNil(_:)
  • crashIfNotEqual(_:)
  • crashIfNotEqual(_:_:)
  • crashIfNotExpected(_:expected:_:)
  • crashIfNotNil(_:)
  • describe(_:flags:closure:)
  • doubleForLoop(_:_:)
  • elementsEqual(_:)
  • elementsEqual(_:by:)
  • encode(encodable:)
  • endWith(_:)
  • equal(_:)
  • expect(_:file:line:)
  • expect(_:line:expression:)
  • fail(_:file:line:)
  • fail(_:line:)
  • fail(_:location:)
  • fcontext(_:flags:closure:)
  • fdescribe(_:flags:closure:)
  • fit(_:flags:file:line:closure:)
  • fitBehavesLike(_:flags:file:line:)
  • fitBehavesLike(_:flags:file:line:context:)
  • fitBehavesLike(_:flags:file:line:sharedExampleContext:)
  • gatherExpectations(silently:closure:)
  • gatherFailingExpectations(silently:closure:)
  • haveCount(_:)
  • isValidLength(_:)
  • it(_:flags:file:line:closure:)
  • itBehavesLike(_:flags:file:line:)
  • itBehavesLike(_:flags:file:line:context:)
  • itBehavesLike(_:flags:file:line:sharedExampleContext:)
  • match(_:)
  • matchError(_:)
  • pending(_:closure:)
  • postNotifications(_:fromNotificationCenter:)
  • prettyCollectionType(_:)
  • product(_:_:)
  • raiseException(named:reason:userInfo:closure:)
  • recordFailure(_:location:)
  • satisfyAllOf(_:)
  • satisfyAnyOf(_:)
  • sharedExamples(_:closure:)
  • stringify(_:)
  • succeed()
  • threadSingleton(_:)
  • throwAssertion()
  • throwError()
  • throwError(_:closure:)
  • throwError(closure:)
  • throwError(errorType:closure:)
  • uuid()
  • waitUntil(timeout:file:line:action:)
  • withAssertionHandler(_:file:line:closure:)
  • xcontext(_:flags:closure:)
  • xdescribe(_:flags:closure:)
  • xit(_:flags:file:line:closure:)
  • xitBehavesLike(_:flags:file:line:context:)
Operators
  • !=(lhs:rhs:)
  • !==(lhs:rhs:)
  • &&(left:right:)
  • **(lhs:rhs:)
  • <(lhs:rhs:)
  • <=(lhs:rhs:)
  • ==(lhs:rhs:)
  • ===(lhs:rhs:)
  • >(lhs:rhs:)
  • >=(lhs:rhs:)
  • ||(left:right:)
  • ~=(regex:input:)
  • ±(Float:)
  • ±(double:)
  • ±(lhs:rhs:)
  • √(double:)
  • ≈(lhs:rhs:)

Clone this wiki locally