DKenefake / OptimalPoly

Generates MinMax polynomial approximations of functions. Stable implementation of the Remez Algorithm using multi-precision arithmetic. Also does C/C++ code generation!
BSD 3-Clause "New" or "Revised" License
24 stars 0 forks source link

ZeroDivisionError for mp.sign funtion #2

Open devharsh opened 2 years ago

devharsh commented 2 years ago
[/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