From f379d6bd1c779e85eb6eb0a2a71a6b74e50544ad Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 19 Oct 2018 10:43:42 -0700 Subject: [PATCH] change to approximate --- ...endre_Polynomials_and_Spherical_Harmonics.jl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/7_24_2_Associated_Legendre_Polynomials_and_Spherical_Harmonics.jl b/test/7_24_2_Associated_Legendre_Polynomials_and_Spherical_Harmonics.jl index 7544365..ef1944a 100644 --- a/test/7_24_2_Associated_Legendre_Polynomials_and_Spherical_Harmonics.jl +++ b/test/7_24_2_Associated_Legendre_Polynomials_and_Spherical_Harmonics.jl @@ -6,14 +6,15 @@ let m = 2 x = 0.5 - @test sf_legendre_Plm_array(lmax, m, x) == [2.25, 5.625, 4.21875, -4.921875] - @test sf_legendre_Plm_deriv_array(lmax, m, x) == ([2.25,5.625,4.21875,-4.921875], - [-3.0,3.75,33.75,55.78125]) - @test sf_legendre_sphPlm_array(lmax, m, x) == [0.2897056515173923, 0.38324455366248106, + # these give subtly different answers on 32/64-bit. + @test sf_legendre_Plm_array(lmax, m, x) ≈ [2.25, 5.625, 4.21875, -4.921875] + @test sf_legendre_Plm_deriv_array(lmax, m, x)[1] ≈ [2.25,5.625,4.21875,-4.921875] + @test sf_legendre_Plm_deriv_array(lmax, m, x)[2] ≈ [-3.0,3.75,33.75,55.78125] + @test sf_legendre_sphPlm_array(lmax, m, x) ≈ [0.2897056515173923, 0.38324455366248106, 0.18816934037548766, -0.15888479843070935] - @test sf_legendre_sphPlm_deriv_array(lmax, m, x) == ([0.2897056515173923,0.38324455366248106, - 0.18816934037548766,-0.15888479843070935], - [-0.38627420202318974,0.2554963691083207, - 1.5053547230039015,1.8006943822147061]) + @test sf_legendre_sphPlm_deriv_array(lmax, m, x)[1] ≈ [0.2897056515173923,0.38324455366248106, + 0.18816934037548766,-0.15888479843070935] + @test sf_legendre_sphPlm_deriv_array(lmax, m, x)[2] ≈ [-0.38627420202318974,0.2554963691083207, + 1.5053547230039015,1.8006943822147061] end