DROUNDUP_LWORK(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ’– DROUNDUP_LWORK(3) β€” Library Functions Manual

Okay bestie, welcome to the Library Functions Manual page for DROUNDUP_LWORK(3). This is the one that deals with the lowkey cursed float-rounding situation, and we’re gonna get through it together. 🫢


🌸 NAME

The name on this page is this exact file path, character-for-character:

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/INSTALL/droundup_lwork.f

✨ SYNOPSIS

Under Functions/Subroutines, bestie:

Functions/Subroutines
    double precision function DROUNDUP_LWORK (lwork)
        DROUNDUP_LWORK

πŸ¦‹ Function/Subroutine Documentation

Here’s the actual signature, no cap:

double precision function DROUNDUP_LWORK (integer lwork)
    DROUNDUP_LWORK

πŸŽ€ Purpose

DROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float. It guarantees that the value is rounded up instead of down by multiplying LWORK by 1+eps when it is necessary, where eps is the relative machine precision. Iykyk, float behavior can be messy. 😭

E.g., the example is giving β€œfloating point betrayal”:

float( 9007199254740993            ) == 9007199254740992
float( 9007199254740993 ) * (1.+eps) == 9007199254740994

The return contract is:

\return DROUNDUP_LWORK
\verbatim
        DROUNDUP_LWORK >= LWORK.
        DROUNDUP_LWORK is guaranteed to have zero decimal part.

So: DROUNDUP_LWORK >= LWORK, and DROUNDUP_LWORK is guaranteed to have zero decimal part. Periodt. πŸ’…

πŸ“ Parameters

  • LWORK β€” Workspace size.

πŸ‘‘ Author

Weslley Pereira, University of Colorado Denver, USA.

🌈 Further Details

This routine was inspired in the method magma_zmake_lwork from MAGMA.

The \see link is:

https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp

Definition at line 58 of file droundup_lwork.f.


πŸ‘‘ Author

Generated automatically by Doxygen for LAPACK from the source code.


Cute sign-off time, bestie: this page is from LAPACK, Version 3.12.0, with the footer path /home/abui...dup_lwork.f(3). The footer doesn’t show a separate date line, so I’m not gonna invent one β€” no technical cap. πŸ’–βœ¨

πŸ“¦ where this page comes from