Y0(3POSIX)

πŸ’– Y0 β€” the Bessel tea, but make it POSIX πŸ’–

okay bestie, so this is y0(3POSIX), straight out of the POSIX Programmer's Manual. buckle up, it's giving math, it's giving floating point, it's giving drama. πŸŽ€


✨ PROLOG ✨

real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior, iykyk), or honestly the interface may not be implemented on Linux at all. πŸ™ˆ


πŸ¦‹ NAME πŸ¦‹

y0, y1, yn β€” Bessel functions of the second kind. the second kind specifically. not the first. don't mix them up. πŸ’…


🌸 SYNOPSIS 🌸

#include <math.h>

double y0(double x);
double y1(double x);
double yn(int n, double x);

πŸ’œ DESCRIPTION πŸ’œ

so the y0(), y1(), and yn() functions shall compute Bessel functions of x of the second kind of orders 0, 1, and n, respectively. that's it, that's the job. ✨

now here's the part that matters if you wanna catch errors like the main character you are: an application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. then, on return, if errno is non-zero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred. boom. vibe check complete. πŸ”₯


πŸ’… RETURN VALUE πŸ’…

upon successful completion, these functions shall return the relevant Bessel value of x of the second kind. slay.

but okay, the edge cases:

  • If x is NaN, NaN shall be returned. 🫠
  • If the x argument to these functions is negative, -HUGE_VAL or NaN shall be returned, and a domain error may occur.
  • If x is 0.0, -HUGE_VAL shall be returned and a pole error may occur. (zero is NOT the vibe here.)
  • If the correct result would cause underflow, 0.0 shall be returned and a range error may occur.
  • If the correct result would cause overflow, -HUGE_VAL or 0.0 shall be returned and a range error may occur.

πŸ‘‘ ERRORS πŸ‘‘

these functions may fail if:

🚨 Domain Error

the value of x is negative.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [EDOM]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the invalid floating-point exception shall be raised.

🚨 Pole Error

the value of x is zero.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the divide-by-zero floating-point exception shall be raised.

🚨 Range Error

the correct result would cause overflow.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the overflow floating-point exception shall be raised.

🚨 Range Error

the value of x is too large in magnitude, or the correct result would cause underflow.

If the integer expression (math_errhandling & MATH_ERRNO) is non-zero, then errno shall be set to [ERANGE]. If the integer expression (math_errhandling & MATH_ERREXCEPT) is non-zero, then the underflow floating-point exception shall be raised.

the following sections are informative. so like, no cap, they're just here to be here. 🫢

🌈 EXAMPLES 🌈

None. not a single one. iconic of them honestly. πŸ’€


⭐ APPLICATION USAGE ⭐

on error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero. they're not besties, they don't have to match, but one of them has to show up to the function. periodt. πŸ’–


🧚 RATIONALE 🧚

None.


πŸŽ€ FUTURE DIRECTIONS πŸŽ€

None.


πŸ”₯ SEE ALSO πŸ”₯

  • feclearexcept()
  • fetestexcept()
  • isnan()
  • j0()

and also: the Base Definitions volume of POSIX.1‐2017, Section 4.20, Treatment of Error Conditions for Mathematical Functions, <math.h>


portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. to report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


okay that's the whole page bestie, mwah πŸ’‹ β€” this lil masterpiece is brought to you by IEEE/The Open Group, 2017, and yeah, that's the Y0(3POSIX) energy. go compute some Bessel functions of the second kind and be gorgeous about it. πŸŒΈβœ¨πŸ¦‹