arrayfire / arrayfire/arrayfire

[BUG] approx1 and approx2 produce suspect values in last bin

Open
#3,239 1 comment 0 reactions 1 assignee Claimed by @syurkevi View on GitHub
bug
Dominant language
C++
Stars
4.9k
Forks
555
Avg merge
1h 24m
Merged PRs (30d)
1

Description

approx1 and approx2 cubic spline interpolation methods produce suspect values in the last bin at the boundary.

Description
===========
* Used official installers
* Occurs on all backends
* Partial workaround is just using higher resolution so that boundary regions are small
* Bug is reliably reproducible
* Expected output to match scipy's RectBivariateSpline method, which wraps fitpack
* No error output

Example interpolating on cos(x) with comparison to scipy:
image

Reproducible Code and/or Steps
------------------------------
* Any use of approx1 or approx2 with cubic spline interpolation type

System Information
------------------
Tested with AF version 3.7.2 on Mac & 3.8.1 on Ubuntu 20.04, both via the Rust bindings.

Info from Mac for convenience:
```
Available backends: [OPENCL, CPU]
Active backend: CPU
Number of available devices: 1
Device number: 0
Device info: ("Intel", "CPU", "AppleClang 10.0.0.10001044", "0.0")
```

Checklist
---------

- [x] Using the latest available ArrayFire release
- [x] GPU drivers are up to date

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.