BESSELY function returns the Bessel function, Yn(x), (also known as the Weber function or the Neumann function), for a specified order and value of x. The syntax of the function is: BESSELY(x,n)
(argsList *list.List)
| 2039 | // |
| 2040 | // BESSELY(x,n) |
| 2041 | func (fn *formulaFuncs) BESSELY(argsList *list.List) formulaArg { |
| 2042 | if argsList.Len() != 2 { |
| 2043 | return newErrorFormulaArg(formulaErrorVALUE, "BESSELY requires 2 numeric arguments") |
| 2044 | } |
| 2045 | x, n := argsList.Front().Value.(formulaArg).ToNumber(), argsList.Back().Value.(formulaArg).ToNumber() |
| 2046 | if x.Type != ArgNumber { |
| 2047 | return x |
| 2048 | } |
| 2049 | if n.Type != ArgNumber { |
| 2050 | return n |
| 2051 | } |
| 2052 | if x.Number <= 0 || n.Number < 0 { |
| 2053 | return newErrorFormulaArg(formulaErrorNUM, formulaErrorNUM) |
| 2054 | } |
| 2055 | var result float64 |
| 2056 | switch math.Floor(n.Number) { |
| 2057 | case 0: |
| 2058 | result = fn.besselY0(x) |
| 2059 | case 1: |
| 2060 | result = fn.besselY1(x) |
| 2061 | default: |
| 2062 | result = fn.besselY2(x, n) |
| 2063 | } |
| 2064 | return newNumberFormulaArg(result) |
| 2065 | } |
| 2066 | |
| 2067 | // besselY0 is an implementation of the formula function BESSELY. |
| 2068 | func (fn *formulaFuncs) besselY0(x formulaArg) float64 { |
nothing calls this directly
no test coverage detected