[poincare] Fix approximation test

Change-Id: I0951e01acf7266e33d05f40de3119b73c656b9a2
This commit is contained in:
Hugo Saint-Vignes
2020-10-06 10:43:19 +02:00
committed by Émilie Feral
parent d224778330
commit a326a1f9ff

View File

@@ -191,9 +191,12 @@ QUIZ_CASE(poincare_approximation_division) {
assert_expression_approximates_to<double>("[[1,2][3,4]]/[[3,4][6,9]]", "[[-1,6.6666666666667ᴇ-1][1,0]]");
assert_expression_approximates_to<double>("3/[[3,4][5,6]]", "[[-9,6][7.5,-4.5]]");
assert_expression_approximates_to<double>("(3+4𝐢)/[[1,𝐢][3,4]]", "[[4×𝐢,1][-3×𝐢,𝐢]]");
// TODO: get rid of the neglectable real or imaginary parts
assert_expression_approximates_to<double>("(3+4𝐢)/[[3,4][1,𝐢]]", "[[1+5.5511151231258ᴇ-17×𝐢,-2.2204460492503ᴇ-16+4×𝐢][𝐢,-3×𝐢]]");
// [[1,4×𝐢][𝐢,-3×𝐢]] is expected
// assert_expression_approximates_to<double>("(3+4𝐢)/[[3,4][1,𝐢]]", "[[1,4×𝐢][𝐢,-3×𝐢]]");
/* TODO: this tests fails because of neglectable real or imaginary parts.
* It currently approximates to
* [[1+5.5511151231258ᴇ-17×𝐢,-2.2204460492503ᴇ-16+4×𝐢][𝐢,-3×𝐢]] or
* [[1-1.1102230246252ᴇ-16×𝐢,2.2204460492503ᴇ-16+4×𝐢]
* [-1.1102230246252ᴇ-16+𝐢,-2.2204460492503ᴇ-16-3×𝐢]] on Linux */
assert_expression_approximates_to<float>("1ᴇ20/(1ᴇ20+1ᴇ20𝐢)", "0.5-0.5×𝐢");
assert_expression_approximates_to<double>("1ᴇ155/(1ᴇ155+1ᴇ155𝐢)", "0.5-0.5×𝐢");