Skip to content

数学库有点杂糅 #3

@farteryhr

Description

@farteryhr

总体是顺便替换libc的做法了是吧【参见musl

比如,sin cos是走的土法制作小代码路线,pi reduction如此直白,sqrt来源于网红invsqrt土制,atan又是薅的分割那么多区间,条件二分超级加速,还管了fpexception的超完善版,pow也大规模,画风就不太一致【话说atan网红写法是CORDIC呀【

https://github.com/zephyrproject-rtos/zephyr/tree/main/lib/libc/minimal/source/math

https://github.com/picolibc/picolibc/blob/main/newlib/libm/math/s_atan.c

https://forums.developer.nvidia.com/t/weekend-project-fast-arctangent-computation-with-borchardts-algorithm/303546

https://personal.math.ubc.ca/~wetton/talks/archimedes22.pdf

https://www.dsprelated.com/showarticle/1052.php

供参考,为了显得更土制还可以进行相应删减【

最后,要不要还是对于wasm实际上有的sqrt稍微搞点条件编译让他用自带指令【毕竟wsam还是虚拟机的不然太慢了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions