HISE Logo Forum
    • Categories
    • Register
    • Login

    JUCE's Fast Math Approximations Needed

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 344 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • FortuneF
      Fortune
      last edited by Fortune

      Even we only use a basic TanH function for the Waveshaping (generally lots of functions are used simultaneously), it is very cpu hungry since the cpu need to check and calculate for the each sample.

      Because of that JUCE has dsp::FastMathApproximations for much more faster calculations than the standart math functions.

      @Christoph-Hart Can you please enable them in the API, so we can use them in SNEX with cpu efficiency?

      Link Preview Image
      JUCE: dsp::FastMathApproximations Struct Reference

      favicon

      (docs.juce.com)

      Christoph HartC 1 Reply Last reply Reply Quote 1
      • Christoph HartC
        Christoph Hart @Fortune
        last edited by

        Sure why not? You can use them now with Math.fasttanh(input) et al (the autocomplete also provides you the valid input range).

        Not sure if they are super useful though, the tanh range is rather limited so for distortion effects you will need to use the proper function.

        FortuneF 1 Reply Last reply Reply Quote 2
        • FortuneF
          Fortune @Christoph Hart
          last edited by Fortune

          @Christoph-Hart Thank you so much man, I'll try and use them ASAP.

          I have really complex equations that use the trigonometric math functions like tanh, cosh, cos, atan... several times as a combination on each equation. So I think the total performance should be improved now. Thank you!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          23

          Online

          1.7k

          Users

          11.8k

          Topics

          102.4k

          Posts