About 62,600 results
Open links in new tab
  1. Sine function in C - Code Review Stack Exchange

    Also, specifically for calculating sin, cos, etc, you probably shouldn't be recalculating things like factorials each time the function is run. In Musl's implementation, they simply store the values of the factorials …

  2. constexpr Sin Function C++ 14 - Code Review Stack Exchange

    Jul 2, 2016 · I have written a constexpr sin function using c++14 and would like to know what I can do to improve it. I am trying to balance code clarity/maintainability with performance. My goal was to have …

  3. C++ templates for sin, cos, tan taylor series

    Aug 6, 2017 · I used C++ metaprogramming to build taylor series for sin, cos, and tan (not really for tan). The whole thing is on my github. Please give any feedback related (but not limited) to style, functiona...

  4. c++ - Sine function calculated via look-up table and linear ...

    Jul 14, 2021 · The sine values calculation is based on the look-up table containing the pre-computed values of the sine function covering the whole period \$\left<0, 2\pi\right>\$ with 256 values.

  5. Basic Trigonometry written in python3 - Code Review Stack Exchange

    Below is the code I wrote to perform basic Trigonometry without using the math module (except for 1 place) for the purpose of teaching myself basic trig and to improve my python. I have never taken ...

  6. c - Implementation of the trigonometric functions for real time ...

    Apr 14, 2021 · In my testing (using C++ std::sin(), which should be the same function) the Standard Library sin() is about 9 times faster than the float version of LUT sine shown in @user673679's answer.

  7. c++ - Calculating sine and cosine - Code Review Stack Exchange

    Mar 26, 2022 · Argument reduction Both sin() and cos() benefit greatly with argument reduction. Instead of many iterations, first reduce the angle to the primary range. Following applies to sin(), but similar …

  8. Generate sinusoid as Wave file - Code Review Stack Exchange

    Oct 15, 2018 · 4 This is a little program to show how a WAVe-File Generator could be written. It use a Function-Object "SinFunction" to calculate the value of any point of the amplitude in time. This object …

  9. VBA functions to calculate sun and moon positions

    May 19, 2022 · I have the following VBA code (across three modules) to make UDFs to calculate sun &amp; moon position data. The issue I'm facing is that they are very slow to run as I have over 6000 …

  10. Compute the derivative of a function - Code Review Stack Exchange

    Apr 14, 2020 · The derivative of any function f (x) at x0 can be estimated according to the following formula: Write a program that prints three columns of numbers: x, f (x) and the derivative f ' (x) for …