Skip to content

Commit

Permalink
adjust test precision to appropriate value and variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
lehner committed Nov 6, 2023
1 parent 3396dd2 commit 086caac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ad/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ def scale(lam):
est = (scale(eps) - scale(-eps)) / 2 / eps
exa = fad.inner_product(ly, lx * ly)[dm]
err = abs(est - exa) / abs(exa)
g.message(f"d <.,.> / dm : {err2}")
g.message(f"d <.,.> / dm : {err}")
assert err < 1e-7


est = (scale(eps) + scale(-eps) - 2 * scale(0)) / eps**2 / 2
exa = fad.inner_product(ly, lx * ly)[dm**2]
err = abs(est - exa) / abs(exa)
g.message(f"d <.,.> / dm**2 : {err2}")
g.message(f"d <.,.> / dm**2 : {err}")
assert err < 1e-5


Expand Down

0 comments on commit 086caac

Please sign in to comment.