{% set version = '0.3' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-precisesums
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/PreciseSums_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/PreciseSums/PreciseSums_{{ version }}.tar.gz
  sha256: 9099b6264a105e35b2567be5c4d78adc4cb0c87582a7f7cdd32685d692ba800b

build:
  merge_build_host: True  # [win]
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

test:
  commands:
    - $R -e "library('PreciseSums')"           # [not win]
    - "\"%R%\" -e \"library('PreciseSums')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=PreciseSums
  license: GPL-2
  summary: Most of the time floating point arithmetic does approximately the right thing.  When
    adding sums or having products of numbers that greatly differ in magnitude, the
    floating point arithmetic may be incorrect.  This package implements the Kahan (1965)
    sum <doi:10.1145/363707.363723>, Neumaier (1974) sum <doi:10.1002/zamm.19740540106>,
    pairwise-sum (adapted from 'NumPy', See Castaldo (2008) <doi:10.1137/070679946>
    for a discussion of accuracy), and arbitrary precision sum (adapted from the fsum
    in 'Python' ; Shewchuk (1997) <http://www.cs.berkeley.edu/~jrs/papers/robustr.pdf>).  In
    addition, products are changed to long double precision for accuracy, or changed
    into a log-sum for accuracy.
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - conda-forge/r

# Package: PreciseSums
# Title: Accurate Floating Point Sums and Products
# Version: 0.3
# Authors@R: c(person("Matthew","Fidler", role = c("aut","cre","cph"), email = "matthew.fidler@gmail.com"), person("Raymond","Hettinger",role=c("cph","aut")), person("Jonathan", "Shewchuk",role=c("cph","aut")), person("Julian", "Taylor",role=c("cph","aut")), person("Nathaniel", "Smith",role=c("cph","aut")), person("NumPy Team", role="cph"), person("Python Team", role="cph") )
# Description: Most of the time floating point arithmetic does approximately the right thing.  When adding sums or having products of numbers that greatly differ in magnitude, the floating point arithmetic may be incorrect.  This package implements the Kahan (1965) sum <doi:10.1145/363707.363723>, Neumaier (1974) sum <doi:10.1002/zamm.19740540106>, pairwise-sum (adapted from 'NumPy', See Castaldo (2008) <doi:10.1137/070679946> for a discussion of accuracy), and arbitrary precision sum (adapted from the fsum in 'Python' ; Shewchuk (1997) <http://www.cs.berkeley.edu/~jrs/papers/robustr.pdf>).  In addition, products are changed to long double precision for accuracy, or changed into a log-sum for accuracy.
# Depends: R (>= 3.2)
# License: GPL (>= 2)
# Encoding: UTF-8
# LazyData: true
# RoxygenNote: 6.0.1
# Suggests: testthat
# NeedsCompilation: yes
# Packaged: 2018-04-12 16:16:37 UTC; FIDLEMA3
# Author: Matthew Fidler [aut, cre, cph], Raymond Hettinger [cph, aut], Jonathan Shewchuk [cph, aut], Julian Taylor [cph, aut], Nathaniel Smith [cph, aut], NumPy Team [cph], Python Team [cph]
# Maintainer: Matthew Fidler <matthew.fidler@gmail.com>
# Repository: CRAN
# Date/Publication: 2018-04-12 17:03:06 UTC
