The way I see it,
- the https://github.com/AlexanderMandera/arduino-wch32v003 core does explicitly not use the standard library (
-nostdlib) and thus fails for a lot of things likemalloc(),free(),sinf(), because it expects you to link or program them in. It should fail the same way if you did in the Arduino IDE. - the https://github.com/openwch/arduino_core_ch32/ core does make use the compiler’s standard library, but the floating point library is so big, that any attempt using it immediately overflows the tiny 16K flash space of the CH32V003.
→ not possible without programming your own floating point lib, or using a better one, or at least sine function, using e.g. fixed point math.
You may get some ideas for it in https://www.youtube.com/watch?v=hffgNRfL1XY or https://www.youtube.com/watch?v=xFKFoGiGlXQ or https://github.com/pulp-platform/RVfplib.
Edit: the RVfplib is actually uncompilable for -march=rv32ecxw -mabi=ilp32e (what ch32v003 uses), it relies on rv32imc instructions. The core doesn’t have that.