math-exercises 3.0.187 → 3.0.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -1
  2. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +22 -6
  3. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -1
  4. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +16 -8
  5. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
  6. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +44 -37
  7. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.d.ts +9 -0
  8. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.d.ts.map +1 -0
  9. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.js +155 -0
  10. package/lib/exercises/math/derivation/derivativeNumber/index.d.ts +1 -0
  11. package/lib/exercises/math/derivation/derivativeNumber/index.d.ts.map +1 -1
  12. package/lib/exercises/math/derivation/derivativeNumber/index.js +1 -0
  13. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -1
  14. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +80 -29
  15. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  16. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +30 -2
  17. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
  18. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +59 -16
  19. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
  20. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +23 -9
  21. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
  22. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +2 -7
  23. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
  24. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +18 -68
  25. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
  26. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +27 -35
  27. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts +8 -0
  28. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts.map +1 -0
  29. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.js +129 -0
  30. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts +8 -0
  31. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts.map +1 -0
  32. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.js +108 -0
  33. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts +8 -0
  34. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts.map +1 -0
  35. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.js +92 -0
  36. package/lib/exercises/math/functions/affines/adjustment/index.d.ts +4 -0
  37. package/lib/exercises/math/functions/affines/adjustment/index.d.ts.map +1 -0
  38. package/lib/exercises/math/functions/affines/adjustment/index.js +3 -0
  39. package/lib/exercises/math/functions/affines/index.d.ts +2 -4
  40. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  41. package/lib/exercises/math/functions/affines/index.js +2 -4
  42. package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts +10 -0
  43. package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts.map +1 -0
  44. package/lib/exercises/math/functions/affines/situations/affineFromExercise.js +219 -0
  45. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts +10 -0
  46. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts.map +1 -0
  47. package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.js +69 -0
  48. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts +10 -0
  49. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts.map +1 -0
  50. package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.js +133 -0
  51. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts +10 -0
  52. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts.map +1 -0
  53. package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.js +229 -0
  54. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts +10 -0
  55. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts.map +1 -0
  56. package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.js +166 -0
  57. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts +9 -0
  58. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts.map +1 -0
  59. package/lib/exercises/math/functions/affines/situations/affineSituationVariation.js +78 -0
  60. package/lib/exercises/math/functions/affines/situations/index.d.ts +6 -0
  61. package/lib/exercises/math/functions/affines/situations/index.d.ts.map +1 -0
  62. package/lib/exercises/math/functions/affines/situations/index.js +5 -0
  63. package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts +1 -0
  64. package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts.map +1 -1
  65. package/lib/exercises/math/functions/sign/equationFromSignTable.js +60 -33
  66. package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts +6 -4
  67. package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts.map +1 -1
  68. package/lib/exercises/math/functions/sign/partialSignTableFromGraph.js +160 -63
  69. package/lib/exercises/math/functions/sign/readSignTable.d.ts +4 -1
  70. package/lib/exercises/math/functions/sign/readSignTable.d.ts.map +1 -1
  71. package/lib/exercises/math/functions/sign/readSignTable.js +32 -9
  72. package/lib/exercises/math/functions/sign/signTableFromGraph.d.ts +6 -4
  73. package/lib/exercises/math/functions/sign/signTableFromGraph.d.ts.map +1 -1
  74. package/lib/exercises/math/functions/sign/signTableFromGraph.js +160 -57
  75. package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.d.ts +9 -0
  76. package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.d.ts.map +1 -0
  77. package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.js +135 -0
  78. package/lib/exercises/math/percent/evolutions/index.d.ts +1 -0
  79. package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -1
  80. package/lib/exercises/math/percent/evolutions/index.js +1 -0
  81. package/lib/exercises/math/powers/equationOnePlusTPowerN.d.ts +9 -0
  82. package/lib/exercises/math/powers/equationOnePlusTPowerN.d.ts.map +1 -0
  83. package/lib/exercises/math/powers/equationOnePlusTPowerN.js +118 -0
  84. package/lib/exercises/math/powers/estimateNthRoot.d.ts +13 -0
  85. package/lib/exercises/math/powers/estimateNthRoot.d.ts.map +1 -0
  86. package/lib/exercises/math/powers/estimateNthRoot.js +126 -0
  87. package/lib/exercises/math/powers/index.d.ts +3 -0
  88. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  89. package/lib/exercises/math/powers/index.js +3 -0
  90. package/lib/exercises/math/powers/solveNthRootEquation.d.ts +9 -0
  91. package/lib/exercises/math/powers/solveNthRootEquation.d.ts.map +1 -0
  92. package/lib/exercises/math/powers/solveNthRootEquation.js +111 -0
  93. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -7
  94. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  95. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -7
  96. package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts +8 -0
  97. package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts.map +1 -0
  98. package/lib/exercises/math/probaStat/randomVariable/situations/index.js +7 -0
  99. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts +11 -0
  100. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts.map +1 -0
  101. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.js +112 -0
  102. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts +9 -0
  103. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts.map +1 -0
  104. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.js +176 -0
  105. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts +8 -0
  106. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
  107. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.js +94 -0
  108. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts +9 -0
  109. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
  110. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.js +166 -0
  111. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts +8 -0
  112. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts.map +1 -0
  113. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.js +133 -0
  114. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts +8 -0
  115. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts.map +1 -0
  116. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.js +211 -0
  117. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts +8 -0
  118. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts.map +1 -0
  119. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.js +113 -0
  120. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts +41 -0
  121. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts.map +1 -0
  122. package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.js +173 -0
  123. package/lib/exercises/math/python/list/pyListMutationMix.d.ts.map +1 -1
  124. package/lib/exercises/math/python/list/pyListMutationMix.js +11 -6
  125. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -1
  126. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +2 -2
  127. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +1 -1
  128. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +1 -1
  129. package/lib/exercises/vea/percentVEA.d.ts +6 -1
  130. package/lib/exercises/vea/percentVEA.d.ts.map +1 -1
  131. package/lib/exercises/vea/percentVEA.js +15 -1
  132. package/lib/index.d.ts +78 -33
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  135. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +5 -8
  136. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +1 -1
  137. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
  138. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +1 -3
  139. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
  140. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +8 -10
  141. package/lib/tests/questionTest.d.ts.map +1 -1
  142. package/lib/tests/questionTest.js +8 -0
  143. package/lib/tree/nodes/sets/closure.d.ts +1 -0
  144. package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
  145. package/lib/tree/nodes/sets/closure.js +12 -0
  146. package/lib/tree/utilities/nodeUtils.d.ts +2 -0
  147. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -1
  148. package/lib/tree/utilities/nodeUtils.js +40 -0
  149. package/package.json +1 -1
@@ -173,7 +173,9 @@ const getPropositions = (n, { answer, ...identifiers }) => {
173
173
  addValidProp(propositions, answer);
174
174
  propWhile(propositions, n, () => {
175
175
  const identifierWrong = createRandomIdentifiers(typeF);
176
- tryToAddWrongProp(propositions, getAnswer(identifierWrong));
176
+ if (isIdentifiersQCPassed(identifierWrong)) {
177
+ tryToAddWrongProp(propositions, getAnswer(identifierWrong));
178
+ }
177
179
  });
178
180
  return shuffle(propositions);
179
181
  };
@@ -279,10 +281,36 @@ const createRandomIdentifiers = (typeF) => {
279
281
  };
280
282
  return identifiers;
281
283
  };
284
+ const isIdentifiersQCPassed = (identifiers) => {
285
+ const isExploding = (identifiers) => {
286
+ try {
287
+ getCorrection(identifiers);
288
+ return false;
289
+ }
290
+ catch (_) {
291
+ return true;
292
+ }
293
+ };
294
+ return !isExploding(identifiers);
295
+ };
282
296
  const getProblemMaximizeProfitFindProductionQuestion = (optsIn) => {
283
297
  const arrayedOptions = optsIn ?? arrayedOptsDefault;
284
298
  const typeF = random(arrayedOptions.typeF);
285
- const identifiers = createRandomIdentifiers(typeF);
299
+ let identifiers;
300
+ let counter = -1;
301
+ let isValid = false;
302
+ while (!isValid && counter < 100) {
303
+ counter++;
304
+ const identifiersCandidate = createRandomIdentifiers(typeF);
305
+ isValid = isIdentifiersQCPassed(identifiersCandidate);
306
+ if (isValid) {
307
+ identifiers = identifiersCandidate;
308
+ }
309
+ }
310
+ if (!isValid) {
311
+ const identifiersDefault = createRandomIdentifiers("polynôme (degré $2$)");
312
+ identifiers = identifiersDefault;
313
+ }
286
314
  return getQuestionFromIdentifiers(identifiers);
287
315
  };
288
316
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -1 +1 @@
1
- {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAwOF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"problemMovementOnLineFindSpeedAtPoint.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA0E7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,oBAAoB,EAAE,eAAe,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA0RF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAoCF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -101,7 +101,8 @@ const getAnswerStuff = (identifiers) => {
101
101
  }
102
102
  })();
103
103
  const nodeDerivative = getPrettyDerivativeNode(nodeF);
104
- const nodeValueDerivative = nodeBySubstitutingVar(nodeDerivative, nodeAbscissa, "x".toTree()).simplify();
104
+ const nodeValueDerivativeRaw = nodeBySubstitutingVar(nodeDerivative, nodeAbscissa, "x".toTree());
105
+ const nodeValueDerivative = nodeValueDerivativeRaw.simplify();
105
106
  return { nodeAbscissa, nodeDerivative, nodeValueDerivative };
106
107
  };
107
108
  const getAnswerNode = (identifiers) => {
@@ -111,19 +112,33 @@ const getAnswer = (identifiers) => {
111
112
  return round(getAnswerNode(identifiers).evaluate(), 2).frenchify();
112
113
  };
113
114
  const getHint = (identifiers) => {
114
- const { typeF } = identifiers;
115
- switch (typeF) {
116
- case "polynôme (degré $1$)":
117
- return `Soient $a$ et $b$ deux réels. La dérivée de $t \\mapsto at+b$ est $t \\mapsto a$.`;
118
- case "$\\frac{k}{t}$":
119
- return `Soit $n$ un entier. La dérivée de $t \\mapsto \\frac{k}{t}$ est $t \\mapsto -\\frac{k}{t^2}$.`;
120
- case "$\\frac{at+b}{ct+d}$":
121
- return `Soient $a$, $b$, $c$ et $d$ quatre réels. La dérivée de $t \\mapsto \\frac{at+b}{ct+d}$ est $t \\mapsto \\frac{a(ct+d)-(at+b)c}{(ct+d)^2}$.`;
122
- case "$k\\sqrt{t}$":
123
- return `La dérivée de $t \\mapsto k\\sqrt{t}$ est $t \\mapsto \\frac{k}{2\\sqrt{t}}$.`;
124
- default:
125
- throw new Error("Unsupported typeF: " + typeF);
126
- }
115
+ const { nodeIdsValueFunction, nodeIdsF } = identifiers;
116
+ const [nodeValueFunction, nodeF] = [nodeIdsValueFunction, nodeIdsF].map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
117
+ return `Premièrement, il faut déterminer à quel instant $t_{cible}$ correspond $x=${nodeValueFunction.toTex()}$.
118
+ Il faut donc résoudre :
119
+
120
+ $$
121
+ x(t_{cible}) = ${nodeBySubstitutingVar(nodeF, "t_{cible}".toTree(), "x".toTree()).toTex()} = ${nodeValueFunction.toTex()}
122
+ $$
123
+
124
+ Ensuite, il ne reste plus qu'à calculer la vitesse instantanée au temps $t_{cible}$,
125
+ c'est-à-dire $x'(t_{cible})$.
126
+
127
+ Rappel : ${(() => {
128
+ const { typeF } = identifiers;
129
+ switch (typeF) {
130
+ case "polynôme (degré $1$)":
131
+ return `Soient $a$ et $b$ deux réels. La dérivée de $t \\mapsto at+b$ est $t \\mapsto a$.`;
132
+ case "$\\frac{k}{t}$":
133
+ return `Soit $n$ un entier. La dérivée de $t \\mapsto \\frac{k}{t}$ est $t \\mapsto -\\frac{k}{t^2}$.`;
134
+ case "$\\frac{at+b}{ct+d}$":
135
+ return `Soient $a$, $b$, $c$ et $d$ quatre réels. La dérivée de $t \\mapsto \\frac{at+b}{ct+d}$ est $t \\mapsto \\frac{a(ct+d)-(at+b)c}{(ct+d)^2}$.`;
136
+ case "$k\\sqrt{t}$":
137
+ return `La dérivée de $t \\mapsto k\\sqrt{t}$ est $t \\mapsto \\frac{k}{2\\sqrt{t}}$.`;
138
+ default:
139
+ throw new Error("Unsupported typeF: " + typeF);
140
+ }
141
+ })()}`;
127
142
  };
128
143
  const getCorrection = (identifiers) => {
129
144
  const { nodeIdsValueFunction, nodeIdsF } = identifiers;
@@ -179,7 +194,9 @@ const getPropositions = (n, { answer, ...identifiers }) => {
179
194
  addValidProp(propositions, answer);
180
195
  propWhile(propositions, n, () => {
181
196
  const identifierWrong = createRandomIdentifiers(typeF);
182
- tryToAddWrongProp(propositions, getAnswer(identifierWrong));
197
+ if (isIdentifiersQCPassed(identifierWrong)) {
198
+ tryToAddWrongProp(propositions, getAnswer(identifierWrong));
199
+ }
183
200
  });
184
201
  return shuffle(propositions);
185
202
  };
@@ -217,10 +234,36 @@ const createRandomIdentifiers = (typeF) => {
217
234
  };
218
235
  return identifiers;
219
236
  };
237
+ const isIdentifiersQCPassed = (identifiers) => {
238
+ const isExploding = (identifiers) => {
239
+ try {
240
+ getAnswer(identifiers);
241
+ return false;
242
+ }
243
+ catch (_) {
244
+ return true;
245
+ }
246
+ };
247
+ return !isExploding(identifiers);
248
+ };
220
249
  const getProblemMovementOnLineFindSpeedAtPointQuestion = (optsIn) => {
221
250
  const arrayedOptions = optsIn ?? arrayedOptsDefault;
222
251
  const typeF = random(arrayedOptions.typeF);
223
- const identifiers = createRandomIdentifiers(typeF);
252
+ let identifiers;
253
+ let counter = -1;
254
+ let isValid = false;
255
+ while (!isValid && counter < 100) {
256
+ counter++;
257
+ const identifiersCandidate = createRandomIdentifiers(typeF);
258
+ isValid = isIdentifiersQCPassed(identifiersCandidate);
259
+ if (isValid) {
260
+ identifiers = identifiersCandidate;
261
+ }
262
+ }
263
+ if (!isValid) {
264
+ const identifiersDefault = createRandomIdentifiers("polynôme (degré $1$)");
265
+ identifiers = identifiersDefault;
266
+ }
224
267
  return getQuestionFromIdentifiers(identifiers);
225
268
  };
226
269
  const getQuestionFromIdentifiers = (identifiers) => {
@@ -1 +1 @@
1
- {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAsWF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -200,10 +200,15 @@ const getPropositions = (n, { answer, ...identifiers }) => {
200
200
  {
201
201
  const nodeX = "x".toTree();
202
202
  const nodeTWrong = add(multiply(nodeValueDerivative, nodeX), nodeValueImage);
203
- const texWrong = `y = ${nodeTWrong
204
- .simplify({ towardsDistribute: true, forbidFactorize: true })
205
- .toTex()}`;
206
- tryToAddWrongProp(propositionsMandatory, texWrong);
203
+ try {
204
+ const texWrong = `y = ${nodeTWrong
205
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
206
+ .toTex()}`;
207
+ tryToAddWrongProp(propositionsMandatory, texWrong);
208
+ }
209
+ catch (_) {
210
+ (() => { })();
211
+ }
207
212
  }
208
213
  //filler
209
214
  const propositionsFiller = [];
@@ -222,10 +227,15 @@ const getPropositions = (n, { answer, ...identifiers }) => {
222
227
  ].forEach(([nodeXAskedWrong, nodeValueImageWrong, nodeValueDerivativeWrong]) => {
223
228
  const nodeX = "x".toTree();
224
229
  const nodeTWrong = add(multiply(nodeValueDerivativeWrong, substract(nodeX, nodeXAskedWrong)), nodeValueImageWrong);
225
- const texWrong = `y = ${nodeTWrong
226
- .simplify({ towardsDistribute: true, forbidFactorize: true })
227
- .toTex()}`;
228
- tryToAddWrongProp(propositionsFiller, texWrong);
230
+ try {
231
+ const texWrong = `y = ${nodeTWrong
232
+ .simplify({ towardsDistribute: true, forbidFactorize: true })
233
+ .toTex()}`;
234
+ tryToAddWrongProp(propositionsFiller, texWrong);
235
+ }
236
+ catch (_) {
237
+ (() => { })();
238
+ }
229
239
  });
230
240
  }
231
241
  propWhile(propositionsFiller, n, () => {
@@ -288,7 +298,11 @@ const isIdentifiersQCPassed = (identifiers) => {
288
298
  }
289
299
  return isExploding;
290
300
  };
291
- return !isExploding(identifiers);
301
+ const isVEAOk = (identifiers) => {
302
+ const answer = getAnswer(identifiers);
303
+ return isAnswerValid(answer, { answer, ...identifiers });
304
+ };
305
+ return !isExploding(identifiers) && isVEAOk(identifiers);
292
306
  };
293
307
  const getTangentEquationFromFunctionExpressionQuestion = (optsIn) => {
294
308
  const arrayedOptions = optsIn ?? arrayedOptsDefault;
@@ -1 +1 @@
1
- {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
1
+ {"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
@@ -371,13 +371,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
371
371
  };
372
372
  };
373
373
  const arrayedOptsDefault = {
374
- typeF: [
375
- "polynôme (degré $2$)",
376
- "polynôme (degré $3$)",
377
- "$\\frac{ax^2+bx+c}{dx+m}$",
378
- "$\\frac{dx+m}{ax^2+bx+c}$",
379
- ],
380
- typeRoots: ["entières", "rationnelles"],
374
+ typeF: ["polynôme (degré $2$)", "polynôme (degré $3$)"],
375
+ typeRoots: ["entières"],
381
376
  };
382
377
  const options = [
383
378
  {
@@ -1 +1 @@
1
- {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwUF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
1
+ {"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAkS7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAiSF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
@@ -14,7 +14,11 @@ import { SetVEA } from "../../../../exercises/vea/setVEA.js";
14
14
  import { dividersOf } from "../../../../math/utils/arithmetic/dividersOf.js";
15
15
  import { probaFlip } from "../../../../utils/alea/probaFlip.js";
16
16
  import { nodeBySubstitutingVar } from "../../../../math/utils/functions/functionComposition.js";
17
+ import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
17
18
  import { NodeUtils } from "../../../../tree/utilities/nodeUtils.js";
19
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
20
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
21
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
18
22
  const tryToSimplify = (node, simplifyOptions) => {
19
23
  try {
20
24
  return node.simplify(simplifyOptions);
@@ -399,7 +403,16 @@ const isIdentifiersQCPassed = (identifiers) => {
399
403
  return false;
400
404
  }
401
405
  };
402
- return isSolutionPrettyAndNotExploding(identifiers);
406
+ const isVEAOk = (identifiers) => {
407
+ try {
408
+ const answer = getAnswer(identifiers);
409
+ return isAnswerValid(answer, { answer, ...identifiers });
410
+ }
411
+ catch (_) {
412
+ return false;
413
+ }
414
+ };
415
+ return isSolutionPrettyAndNotExploding(identifiers) && isVEAOk(identifiers);
403
416
  };
404
417
  const getFindExtremaFromFunctionExpressionQuestion = (optsIn) => {
405
418
  const arrayedOptions = optsIn ?? arrayedOptsDefault;
@@ -418,67 +431,9 @@ const getFindExtremaFromFunctionExpressionQuestion = (optsIn) => {
418
431
  }
419
432
  if (!isValid) {
420
433
  // console.log("will use identifiersDefault");
434
+ const nodeF = frac(add(multiply(30, new VariableNode("x")), 10), add(add(multiply(6, power(new VariableNode("x"), 2)), multiply(3, new VariableNode("x"))), 1));
421
435
  const identifiersDefault = {
422
- nodeIdsF: {
423
- id: 3,
424
- leftChild: {
425
- id: 0,
426
- leftChild: {
427
- id: 2,
428
- leftChild: {
429
- id: 7,
430
- value: 30,
431
- },
432
- rightChild: {
433
- id: 10,
434
- name: "x",
435
- },
436
- },
437
- rightChild: {
438
- id: 7,
439
- value: 10,
440
- },
441
- },
442
- rightChild: {
443
- id: 0,
444
- leftChild: {
445
- id: 0,
446
- leftChild: {
447
- id: 2,
448
- leftChild: {
449
- id: 7,
450
- value: 6,
451
- },
452
- rightChild: {
453
- id: 5,
454
- leftChild: {
455
- id: 10,
456
- name: "x",
457
- },
458
- rightChild: {
459
- id: 7,
460
- value: 2,
461
- },
462
- },
463
- },
464
- rightChild: {
465
- id: 2,
466
- leftChild: {
467
- id: 7,
468
- value: 3,
469
- },
470
- rightChild: {
471
- id: 10,
472
- name: "x",
473
- },
474
- },
475
- },
476
- rightChild: {
477
- id: 7,
478
- value: 1,
479
- },
480
- },
481
- },
436
+ nodeIdsF: nodeF.toIdentifiers(),
482
437
  typeF: "$\\frac{dx+m}{ax^2+bx+c}$",
483
438
  typeRoots: "entières",
484
439
  };
@@ -498,13 +453,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
498
453
  };
499
454
  };
500
455
  const arrayedOptsDefault = {
501
- typeF: [
502
- "polynôme (degré $2$)",
503
- "polynôme (degré $3$)",
504
- "$\\frac{ax^2+bx+c}{dx+m}$",
505
- "$\\frac{dx+m}{ax^2+bx+c}$",
506
- ],
507
- typeRoots: ["entières", "rationnelles"],
456
+ typeF: ["polynôme (degré $2$)", "polynôme (degré $3$)"],
457
+ typeRoots: ["entières"],
508
458
  };
509
459
  const options = [
510
460
  {
@@ -1 +1 @@
1
- {"version":3,"file":"signVarTableQuotientFExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableQuotientFExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAsIrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAubF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiBF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBnE,CAAC"}
1
+ {"version":3,"file":"signVarTableQuotientFExp.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableQuotientFExp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AA6HrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAqbF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiBF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmBnE,CAAC"}
@@ -10,29 +10,27 @@ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
10
10
  import { InequationSolutionNode } from "../../../../tree/nodes/inequations/inequationSolutionNode.js";
11
11
  import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
12
12
  import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
13
- import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
14
13
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
15
14
  import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
16
15
  import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
17
16
  import { isUnionIntervalNode, UnionIntervalNode, } from "../../../../tree/nodes/sets/unionIntervalNode.js";
17
+ import { NodeSimplifier } from "../../../../tree/utilities/nodeSimplifier.js";
18
18
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
19
19
  import { zip } from "../../../../utils/arrays/arrayZip.js";
20
20
  import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
21
21
  import { alignTex } from "../../../../utils/latex/alignTex.js";
22
- const _simplifyMore = (node) => {
23
- if (isMultiplyNode(node)) {
24
- const nodeLeft = node.leftChild;
25
- const nodeRight = node.rightChild;
22
+ const tryToSimplify = (node) => {
23
+ try {
24
+ return NodeSimplifier.simplifyByVibrating(node, 5, true);
25
+ }
26
+ catch (_) {
26
27
  try {
27
- return multiply(nodeLeft.simplify({ forbidFactorize: true, towardsDistribute: true }), nodeRight.simplify({ forbidFactorize: true, towardsDistribute: true }));
28
+ return NodeSimplifier.simplifyByVibrating(node, 5, false);
28
29
  }
29
30
  catch (_) {
30
31
  return node;
31
32
  }
32
33
  }
33
- else {
34
- return node;
35
- }
36
34
  };
37
35
  const getInstructionNode = (a, b, c, isFOverExp) => {
38
36
  const nodeF = getNodeF(a, b, c);
@@ -42,10 +40,10 @@ const getInstructionNode = (a, b, c, isFOverExp) => {
42
40
  };
43
41
  const getNodeF = (a, b, c) => {
44
42
  if (a !== undefined) {
45
- return TrinomConstructor.fromCoeffs([c, b, a]).toTree().simplify();
43
+ return tryToSimplify(TrinomConstructor.fromCoeffs([c, b, a]).toTree());
46
44
  }
47
45
  else if (b !== undefined) {
48
- return AffineConstructor.fromCoeffs([c, b]).toTree().simplify();
46
+ return tryToSimplify(AffineConstructor.fromCoeffs([c, b]).toTree());
49
47
  }
50
48
  else {
51
49
  return c.toTree();
@@ -67,7 +65,7 @@ const getRootNodesOfDerivative = (a, b, c) => {
67
65
  }
68
66
  else {
69
67
  const [c, b] = coeffs;
70
- return [frac(opposite(c), b).simplify()];
68
+ return [tryToSimplify(frac(opposite(c), b))];
71
69
  }
72
70
  };
73
71
  const getTrinomInequationSolutionNode = (coeffs, ineqType) => {
@@ -144,11 +142,9 @@ const getAnswerTable = (identifiers) => {
144
142
  x: rootNodeMinus1.evaluate(),
145
143
  });
146
144
  const [strSignHPrimeRootMinus1, strSignHPrimeRootPlus1] = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
147
- const nodeHRoot = nodeH
148
- .toDetailedEvaluation({
145
+ const nodeHRoot = tryToSimplify(nodeH.toDetailedEvaluation({
149
146
  x: rootNode,
150
- })
151
- .simplify();
147
+ }));
152
148
  return [
153
149
  ["$x$", "-\\infty", "\\ ", rootNode.toTex(), "\\ ", "+\\infty"],
154
150
  //sign
@@ -181,11 +177,9 @@ const getAnswerTable = (identifiers) => {
181
177
  x: root1Minus1.evaluate(),
182
178
  });
183
179
  const [strSignHPrimeRoot1Minus1, strSignHPrimeRootAvg, strSignHPrimeRoot2Plus1,] = hPrimeRoot1Minus1 > 0 ? ["+", "-", "+"] : ["-", "+", "-"];
184
- const [nodeHRoot1, nodeHRoot2] = [rootNode1, rootNode2].map((nodeX) => nodeH
185
- .toDetailedEvaluation({
180
+ const [nodeHRoot1, nodeHRoot2] = [rootNode1, rootNode2].map((nodeX) => tryToSimplify(nodeH.toDetailedEvaluation({
186
181
  x: nodeX,
187
- })
188
- .simplify());
182
+ })));
189
183
  return [
190
184
  [
191
185
  "$x$",
@@ -301,32 +295,30 @@ const getCorrection = (identifiers) => {
301
295
  const signs = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
302
296
  const signWords = signs.map((strSign) => strSign === "+" ? "positive" : "négative");
303
297
  const words = signs.map((strSign) => strSign === "+" ? "croissante" : "décroissante");
304
- const image = nodeH
305
- .toDetailedEvaluation({
298
+ const image = tryToSimplify(nodeH.toDetailedEvaluation({
306
299
  x: rootNode,
307
- })
308
- .simplify();
300
+ }));
309
301
  return `On calcule $h'$ :
310
302
 
311
303
  $$
312
- h'(x) = ${nodeHPrime.simplify().toTex()}
304
+ h'(x) = ${tryToSimplify(nodeHPrime).toTex()}
313
305
  $$
314
306
 
315
307
  On détermine ensuite le signe de $h'(x)$ :
316
308
 
317
309
  ${alignTex([
318
310
  ["", "h'(x) \\geq 0"],
319
- ["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
311
+ ["\\iff", tryToSimplify(nodeHPrime).toTex() + "\\geq 0"],
320
312
  [
321
313
  "\\iff",
322
314
  (() => {
323
315
  if (isFOverExp) {
324
- return frac(nodeHPrime, exp(opposite("x".toTree()))).simplify();
316
+ return tryToSimplify(frac(nodeHPrime, exp(opposite("x".toTree()))));
325
317
  }
326
318
  else {
327
- const nodeWithoutExp = frac(nodeHPrime, exp("x".toTree())).simplify();
319
+ const nodeWithoutExp = tryToSimplify(frac(nodeHPrime, exp("x".toTree())));
328
320
  if (isFractionNode(nodeWithoutExp)) {
329
- return nodeWithoutExp.leftChild.simplify({ towardsDistribute: true });
321
+ return tryToSimplify(nodeWithoutExp.leftChild);
330
322
  }
331
323
  else {
332
324
  return nodeWithoutExp;
@@ -344,7 +336,7 @@ On en conclut que $h$ est ${words[0]} sur $]-\\infty; ${rootTex}]$, puis ${words
344
336
  Pour compléter le tableau, il ne reste plus qu'à calculer l'image par $h$ de $${rootTex}$ :
345
337
 
346
338
  $$
347
- h\\left(${rootTex}\\right) = ${image.toTex()} = ${image.simplify().toTex()}
339
+ h\\left(${rootTex}\\right) = ${image.toTex()} = ${tryToSimplify(image).toTex()}
348
340
  $$`;
349
341
  }
350
342
  else {
@@ -361,24 +353,24 @@ $$`;
361
353
  return `On calcule $h'$ :
362
354
 
363
355
  $$
364
- h'(x) = ${nodeHPrime.simplify().toTex()}
356
+ h'(x) = ${tryToSimplify(nodeHPrime).toTex()}
365
357
  $$
366
358
 
367
359
  On détermine ensuite le signe de $h'(x)$ :
368
360
 
369
361
  ${alignTex([
370
362
  ["", "h'(x) \\geq 0"],
371
- ["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
363
+ ["\\iff", tryToSimplify(nodeHPrime).toTex() + "\\geq 0"],
372
364
  [
373
365
  "\\iff",
374
366
  (() => {
375
367
  if (isFOverExp) {
376
- return frac(nodeHPrime, exp(opposite("x".toTree()))).simplify();
368
+ return tryToSimplify(frac(nodeHPrime, exp(opposite("x".toTree()))));
377
369
  }
378
370
  else {
379
- const nodeWithoutExp = frac(nodeHPrime, exp("x".toTree())).simplify();
371
+ const nodeWithoutExp = tryToSimplify(frac(nodeHPrime, exp("x".toTree())));
380
372
  if (isFractionNode(nodeWithoutExp)) {
381
- return nodeWithoutExp.leftChild.simplify({ towardsDistribute: true });
373
+ return tryToSimplify(nodeWithoutExp.leftChild);
382
374
  }
383
375
  else {
384
376
  return nodeWithoutExp;
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ xValues: number[];
4
+ yValues: number[];
5
+ };
6
+ export declare const affineAdjustmentExercise: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=affineAdjustment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"affineAdjustment.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/adjustment/affineAdjustment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AA8KF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}