feat(libc): implement log1p, log1pf and expm1 #2173
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2173"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T10:39:08Z.
What
Exports
log1p,log1pfandexpm1. Each one forwards to the C++ standard library, likelogandexp. Only the variants that titles import are added.Titles: open-source homebrew from the #1578 catalog audit imports them from
libSceLibcInternal(resolved throughlibc.prx):log1p: PPSA68091 Ruffle, PPSA99169 RetroArchlog1pf: PPSA68091 Ruffleexpm1: PPSA99169 RetroArch, PPSA99764 PorpoiseI haven't run any of these titles.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:guest_math_tests, next tolog10f:log1p(-0)andexpm1(-0)are-0);log1p(-1) == -inf,log1p(inf) == inf,expm1(-inf) == expm1(-1000) == -1;log1p(-2),log1pf(-2);log1p(1e-300),log1pf(1e-30f)andexpm1(1e-300)return their argument, andlog1p(1e-10)/expm1(1e-10)are within 1e-25 of the exact values.log(1 + x)andexp(x) - 1give 0 or lose most digits there.log(1 + x)orexp(x) - 1makesguest_mathfail.cmake --build build --target libs: the patchedlibc.prxexports all 3 NIDs.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap. This branch also merges cleanly with my #2158, #2166 and #2167.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T10:39:31Z.
Progress report (
51f69aa→f5dc794)📈 System libraries: 84.71% (+0.02%, +3 implemented functions)
✅ 3 implemented
expm1_nid_postfixlog1p_nid_postfixlog1pf_nid_postfixImported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-09T11:24:39Z.
Full Linux and Windows builds and tests for this head (
f5dc794c), using the project's Build workflow. I can't start the upstream manual run, so I ran the samebuild.ymlin my fork through a mirror PR. Like the upstream run, the jobs check out the PR head merged into currentmain(d70b8998):ctest: 516/516 passedctest: 507/507 passedRun: https://github.com/AchrafReyani/AnyPS5/actions/runs/37920413262
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T20:09:34Z.
Same as #2167, for
log1p,log1pfandexpm1.Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T03:43:48Z.
Resubmitted as #3259: per @babyhuey's run on #3190, OpenRCT2 stops at
expm1once #3190 lands.Pull request closed