1. 06 May, 2018 3 commits
    • Justus Sagemüller's avatar
      Stable area hyperbolic sine for `Double` and `Float`. · 3ea33411
      Justus Sagemüller authored
      This function was unstable, in particular for negative arguments.
      
      https://ghc.haskell.org/trac/ghc/ticket/14927
      
      The reason is that the formula `log (x + sqrt (1 + x*x))` is dominated
      by the numerical error of the `sqrt` function when x is strongly negative
      (and thus the summands in the `log` mostly cancel). However, the area
      hyperbolic sine is an odd function, thus the negative side can as well
      be calculated by flipping over the positive side, which avoids this instability.
      
      Furthermore, for _very_ big arguments, the `x*x` subexpression overflows. However,
      long before that happens, the square root is anyways completely dominated
      by that term, so we can neglect the `1 +` and get
      
          sqrt (1 + x*x) ≈ sqrt (x*x) = x
      
      and therefore
      
          asinh x ≈ log (x + x) = log (2*x) = log 2 + log x
      
      which does not overflow for any normal-finite positive argument, but
      perfectly matches the exact formula within the floating-point accuracy.
      3ea33411
    • Justus Sagemüller's avatar
      Add hyperbolic functions to test of Float-inverses · d814dd38
      Justus Sagemüller authored
      The area hyperbolic sine is currently broken,
      see https://ghc.haskell.org/trac/ghc/ticket/14927.
      d814dd38
    • Justus Sagemüller's avatar
      Add test for invertability of `Floating` methods. · be580b42
      Justus Sagemüller authored
      These functions have inverses only on part of the real line, but
      there they should be reliably inverted – that's basically the whole
      point of the functions like `asin`, `atan` etc..
      be580b42
  2. 05 May, 2018 10 commits
  3. 04 May, 2018 2 commits
    • Simon Peyton Jones's avatar
      Simplify callSiteInline a little · 33de71fa
      Simon Peyton Jones authored
      This patch has virtually no effect on anything (according to a
      nofib run).  But it simplifies the definition of interesting_call
      by being a bit less gung-ho about inlining nested function
      bindings.  See Note [Nested functions]
      
      -----------------------------------------------------------------------
              Program           Size    Allocs   Runtime   Elapsed  TotalMem
      -----------------------------------------------------------------------
                 anna          +0.2%     -0.0%     0.163     0.163      0.0%
         binary-trees          +0.1%     +0.0%     -4.5%     -4.5%      0.0%
            cacheprof          -0.1%     +0.1%     -4.7%     -4.8%     +2.7%
                fasta          +0.2%      0.0%     +2.6%     +3.0%      0.0%
                fluid          -0.0%     -0.6%     0.011     0.011      0.0%
               gamteb          -0.1%     -0.0%     0.069     0.070      0.0%
                  hpg          +0.1%     +0.0%     +0.7%     +0.7%      0.0%
                infer          +0.3%     +0.2%     0.097     0.098      0.0%
               lambda          -0.1%     -0.0%     +2.0%     +2.0%      0.0%
               n-body          +0.1%     -0.1%     -0.1%     -0.1%      0.0%
               simple          -0.2%     -0.2%     +0.6%     +0.6%      0.0%
        spectral-norm          +0.1%     -0.0%     -0.1%     -0.1%      0.0%
                  tak          -0.0%     -0.1%     0.024     0.024      0.0%
      --------------------------------------------------------------------------------
                  Min          -0.4%     -0.6%     -5.3%     -5.3%      0.0%
                  Max          +0.3%     +0.2%     +3.3%     +3.3%    +15.0%
       Geometric Mean          -0.0%     -0.0%     -0.3%     -0.3%     +0.2%
      33de71fa
    • niteria's avatar
      Normalize T14999 test output some more · 56974323
      niteria authored
      @osa1 reported that the output on his machine has extra newlines:
      https://phabricator.haskell.org/D4606#129092. This collapses consecutive
      newlines.
      56974323
  4. 03 May, 2018 15 commits
  5. 02 May, 2018 3 commits
  6. 01 May, 2018 7 commits