# How to get forward and backward error using LinearAlgebra package

**URL:** <https://discourse.julialang.org/t/how-to-get-forward-and-backward-error-using-linearalgebra-package/83327>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 25, 2022, 6:40am UTC](https://discourse.julialang.org/t/how-to-get-forward-and-backward-error-using-linearalgebra-package/83327 "2022-06-25T06:40:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemraj4545](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hemraj4545/32/19396_2.png) [@hemraj4545](https://discourse.julialang.org/u/hemraj4545)\
**Post date:** [June 25, 2022, 6:40am UTC](https://discourse.julialang.org/t/how-to-get-forward-and-backward-error-using-linearalgebra-package/83327/1 "2022-06-25T06:40:44Z")

</div>

I am using LU Factorization to solve equations, but I want forward and backward error, relative forward and backward error. I thought of using `LinearAlgebra` for this, and found `LinearAlgebra.LAPACK.trrfs!()` function can be used. But couldnt figure how to work with this function. Any thoughts on this? I am new to Julia, so couldn’t figure out. Thank you very much for your time.

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 25, 2022, 1:20pm UTC](https://discourse.julialang.org/t/how-to-get-forward-and-backward-error-using-linearalgebra-package/83327/2 "2022-06-25T13:20:44Z")

</div>

> [@hemraj4545](#):
>
> I am using LU Factorization to solve equations, but I want forward and backward error

What error are you trying to compute? The floating-point roundoff error? You can compute some upper bounds on this using theoretical formulas, I guess, but the constant factors in error analysis for LU factorization are famously pessimistic. The condition number of the matrix gives you an upper bound on the ratio of forward and backward errors.

(Can you give an example from any other language or library of the type of result you are hoping for?)
