you can make sign an Int or a fr.Fr and refactor the function to make it much simpler (remove the inner case statement)
this huge comment block is not really necessary, just say that its taylor series and people can look that up if they want details
why are there two spaces now? the comment made by me was an example for you to follow and use one space like i always do
replacing the inner case statement with something like
// if sign is a fr.Fr
sin_sum(
x,
k - 1,
add(sum, mul(sign, div(int_pow(x, 2 * k + 1), int(fact(2 * k + 1))))),
…
this expression deserves a comment with the math formula (its not very readable due to the use of functions instead of math operators)
i would call the second argument digit_diff, the two extra characters wont kill you and its much more readable (dig_diff actually confused me for like a minute)
this function should just be called int_pow, not fr_int_pow, since its inside of the fr module already
preferably only use global constants when necessary. this constant is only used in one place (next function), you can just define it inside of the function and not pollute the global namespace
theres some uncanny valley vibes about the ordering of the lines and this line being here rather than after the current line 69 (nice)