Elm Exactly

Figuredynamic-basis-elem

Figure 52, APPLY\APPLY on Floats: Elementary Functions, in Section D.4.3 Powers and Elementary Functions.

APPLY(b,NaN) = {NaN}for each b of the figureAPPLY(b,x) = {x}if x is a zero, for b∈{sin,tan,asin,atan}APPLY(b,x) = {NaN}if x∈{+∞,−∞}, for b∈{sin,cos,tan}APPLY(b,x) = {NaN}if ∣x∣>1, for b∈{asin,acos}APPLY(atan,x) = {sgn(x)⋅fl(π/2)}if x∈{+∞,−∞} \begin{array}{rcll} \APPLY(b,\dbNaN) {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{for each}\ b\ \text{of the figure}\\[1ex] \APPLY(b,x) {\ }& = {\ }& \{x\} {\quad}& \text{if}\ x\ \text{is a zero, for}\ b\in\{\kw{sin},\kw{tan},\kw{asin},\kw{atan}\}\\ \APPLY(b,x) {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x\in\{+\infty,-\infty\},\ \text{for}\ b\in\{\kw{sin},\kw{cos},\kw{tan}\}\\ \APPLY(b,x) {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ |x|>1,\ \text{for}\ b\in\{\kw{asin},\kw{acos}\}\\ \APPLY(\kw{atan},x) {\ }& = {\ }& \{\dbsgn(x)\cdot\dbfl(\dbpinum/2)\} {\quad}& \text{if}\ x\in\{+\infty,-\infty\} \end{array}
APPLY(Elm.Kernel.Basics.log,x) = {−∞}if x is a zero = {NaN}if x<0 = {+∞}if x=+∞APPLY(b,x) = {fl(f(x))}otherwise, for each b \begin{array}{rcll} \APPLY(\kw{Elm.Kernel.Basics.log},x) {\ }& = {\ }& \{-\infty\} {\quad}& \text{if}\ x\ \text{is a zero}\\ {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x<0\\ {\ }& = {\ }& \{+\infty\} {\quad}& \text{if}\ x=+\infty\\[1ex] \APPLY(b,x) {\ }& = {\ }& \{\dbfl(f(x))\} {\quad}& \text{otherwise, for each}\ b \end{array}
APPLY(atan2,y,x) = {NaN}if x or y is NaN = {y}if y is a zero, and x is +0 or x>0 = {sgn(y)⋅fl(π)}if y is a zero, and x is −0 or x<0 = {sgn(y)⋅fl(π/2)}if x is a zero = {sgn(y)⋅fl(π/2)}if y is an infinity and x is finite = {sgn(y)⋅fl(3π/4)}if y is an infinity and x=−∞ = {sgn(y)⋅fl(π/4)}if y is an infinity and x=+∞ = {sgn(y)⋅fl(π)}if x=−∞ = {sgn(y)⋅0}if x=+∞ = {fl(θ)}otherwise \begin{array}{rcll} \APPLY(\kw{atan2},y,x) {\ }& = {\ }& \{\dbNaN\} {\quad}& \text{if}\ x\ \text{or}\ y\ \text{is}\ \dbNaN\\ {\ }& = {\ }& \{y\} {\quad}& \text{if}\ y\ \text{is a zero, and}\ x\ \text{is}\ +0\ \text{or}\ x>0\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum)\} {\quad}& \text{if}\ y\ \text{is a zero, and}\ x\ \text{is}\ -0\ \text{or}\ x<0\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/2)\} {\quad}& \text{if}\ x\ \text{is a zero}\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/2)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x\ \text{is finite}\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(3\dbpinum/4)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x=-\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum/4)\} {\quad}& \text{if}\ y\ \text{is an infinity and}\ x=+\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot\dbfl(\dbpinum)\} {\quad}& \text{if}\ x=-\infty\\ {\ }& = {\ }& \{\dbsgn(y)\cdot 0\} {\quad}& \text{if}\ x=+\infty\\ {\ }& = {\ }& \{\dbfl(\theta)\} {\quad}& \text{otherwise} \end{array}
Figure 52: APPLY\APPLY on Floats: Elementary Functions
Read it in its chapter·Permanent address: /standard/figures/dynamic-basis-elem

Referred to from

Tests (0)

No test of the suite checks this figure yet.

Discussions

Discuss this figure·Search the discussions on GitHub

Discussions are on GitHub; one about this figure has [fig:dynamic-basis-elem] in its title.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.