feat(libc): implement the hyperbolic functions #3190
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3190"
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-11T00:47:22Z.
Resubmission of #2166, which was closed because no title was shown stopping on these functions. With
alarm(#2765) merged, Porpoise (PPSA99764) now stops atasinhonmain06da1176, per @babyhuey's catalog run withsce_module/libc.prxunwrapped (comment):2eQpqTjJ5Y4isasinh.A second title: with
malloc_usable_size(#3225) merged, OpenRCT2 (PPSA99728) onmain961b25festops atcosh(m7iLTaO9RMs), and with this branch it goes on toexpm1(comment). @babyhuey also checked this branch stacked with #3191 and #3192 on Linux and Windows: Porpoise gets pastasinhtodirname.The functions here are still absent on current
main(tanh/tanhf, which main already has, are not part of this change), and no open libc PR implements them. The branch is rebased onto currentmain. Windows 11 (WinLibs GCC 15.2.0), Release:guest_mathpasses 3/3, andcheck_conventions.pyandpr_overlap.py --branchpass.What
Exports
sinh,cosh,coshf,asinh,asinhf,acosh,acoshfandatanh. Each one forwards to the C++ standard library, like the existingtanh/tanhfandsin/cos. Only the variants that titles import are added.Titles: open-source homebrew from the #1578 catalog audit imports them from
libSceLibcInternal(resolved throughlibc.prx), for example:cosh,coshf,sinh,asinh,asinhf,acosh,acoshfsinh,cosh,asinh,acosh,atanhsinh/cosh/asinhI haven't run any of these titles.
Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release,
-DBUILD_TESTING=ON:CheckHyperbolicinguest_math_tests:sinh(±0)keeps the sign,cosh(0) == 1,acosh(1) == 0,atanh(±1) == ±inf;acosh(0.5),acoshf(0.5f),atanh(2);doubleand 1e-6 forfloat;sinh,asinhandatanhof1e-300return1e-300,cosh(710.4)andsinh(-710.4)stay finite, andasinh(-1e300)/acosh(1e300)are ±691.4686750787736.sinh,coshorasinhwith the textbookexp/logformula makesguest_mathfail.cmake --build build --target libs: the patchedlibc.prxexports all 8 NIDs.tools/check_conventions.pypasses, andtools/pr_overlap.py --branchreports no overlap. The new lines sit next tosin/cos, away from #2050's_FSinh/_FCoshchange.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-11T00:47:44Z.
Progress report (
06da117→1191ed3)📈 System libraries: 85.99% (+0.03%, +8 implemented functions)
✅ 8 implemented
acosh_nid_postfixacoshf_nid_postfixasinh_nid_postfixasinhf_nid_postfixatanh_nid_postfixcosh_nid_postfixcoshf_nid_postfixsinh_nid_postfixImported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T01:08:15Z.
Fork CI for this head merged onto current
main(run 38099620418):agc_unit_shadow,agc_driver_flat_apertures(timeout) andagc_driver_image_packed16_load, which fail identically inmain's own push build (run 38098335801). This PR only touches libc, so they're unrelated.Imported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T01:36:58Z.
Checked with #3190, #3191 and #3192 stacked on
maind31b57a4(all merge cleanly), catalog builds withsce_module/libc.prxunwrapped. Linux (Ubuntu 24.04, GCC 13) and Windows 11 (WinLibs GCC 15.2), Release:guest_mathandguest_stringspass 5/5 (--repeat until-fail:5) on both, with no warnings inMath.cpporStringExtensions.cpp.Porpoise (PPSA99764) gets past
asinhon both and stops atdirname:app.elf: symbol lookup error: app.elf: undefined symbol: E4wZaG1zSFcFAIL: unresolved ELF import E4wZaG1zSFc (dirname) from libSceLibcInternal.prxImported from boykopovar/AnyPS5. Originally posted by babyhuey on 2026-10-11T03:31:46Z.
@AchrafReyani this is now the next stop for a second title. With
malloc_usable_size(#3225) merged, OpenRCT2 (PPSA99728) onmain961b25festops atcoshon Linux:app.elf: symbol lookup error: app.elf: undefined symbol: m7iLTaO9RMsWith this head (
1191ed3e) merged onto961b25fe(clean), OpenRCT2 goes on toexpm1(gqKfOiJaCOo), which your #2173 had, and Porpoise still goes on todirname.