GithubHelp home page GithubHelp logo

dkenefake / optimalpoly Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 0.0 561 KB

Generates MinMax polynomial approximations of functions. Stable implementation of the Remez Algorithm using multi-precision arithmetic. Also does C/C++ code generation!

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
approximation polynomial python remez

optimalpoly's Introduction

Hi there ๐Ÿ‘‹

I am Dustin Kenefake, a 5th year phd student in the Pistikopoulos Group, where I focus mainly on algorithms and software for optimization. Code that my group has made can be found here. Find out more about my research and myself on my website. My hobby projects center around generating random numbers, optimization, and ray tracing.

Current Open Source Projects

  • PPOPT - A Scalable multiparametric programming solver written in Python
  • SmallPRNG - A header only extensible PRNG library/framework written in C++ (Tested with Testu01)
  • SmolPrng - A high performance extendable PRNG crate written in Rust
  • SimpleDenseGurobi - A helper package for using the Gurobi Solver, written in Python
  • Durandal - A convex NLP solver via successive LP technique, written in Python
  • FasterFVA - A FVA tool based on a novel algorithm, written in Python
  • Etymrs - A Etymological analysis tool for text passages, written in Rust

Not So Current Projects

  • OptimalPoly - A numerically stable optimal approximation of functions, written in Python

Fun Stats Badges

optimalpoly's People

Contributors

dkenefake avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

optimalpoly's Issues

Bug in the Code

By setting the first and last points in the extremum array to the start and end of the bound, the minimax polynomial will only be produced in cases where the maximum error in this region is the start and end of the bound:

image

In cases like the one below, the minimax polynomial will not be generated.

image

ZeroDivisionError for mp.sign funtion

[/usr/local/lib/python3.7/dist-packages/mpmath/matrices/linalg.py](https://localhost:8080/#) in lu_solve(ctx, A, b, **kwargs)
    224             else:
    225                 # LU factorization
--> 226                 A, p = ctx.LU_decomp(A)
    227                 b = ctx.L_solve(A, b, p)
    228                 x = ctx.U_solve(A, b)

[/usr/local/lib/python3.7/dist-packages/mpmath/matrices/linalg.py](https://localhost:8080/#) in LU_decomp(ctx, A, overwrite, use_cache)
    142             ctx.swap_row(A, j, p[j])
    143             if ctx.absmin(A[j,j]) <= tol:
--> 144                 raise ZeroDivisionError('matrix is numerically singular')
    145             # calculate elimination factors and add rows
    146             for i in xrange(j + 1, n):

ZeroDivisionError: matrix is numerically singular

Rational approximations

Thanks for this, was about to start writing my own remez implementation but yours is very clean!

Have you thought about extending it to rational approximations?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.