@@ -185,6 +185,16 @@ public void infinityOrdering() throws SolverException, InterruptedException {
185
185
BooleanFormula order3 = fpmgr .greaterThan (posInf , negInf );
186
186
187
187
assertThatFormula (bmgr .and (order1 , order2 , order3 )).isTautological ();
188
+
189
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .max (posInf , zero ), posInf )).isTautological ();
190
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .max (posInf , negInf ), posInf ))
191
+ .isTautological ();
192
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .max (negInf , zero ), zero )).isTautological ();
193
+
194
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .min (posInf , zero ), zero )).isTautological ();
195
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .min (posInf , negInf ), negInf ))
196
+ .isTautological ();
197
+ assertThatFormula (fpmgr .equalWithFPSemantics (fpmgr .min (negInf , zero ), negInf )).isTautological ();
188
198
}
189
199
190
200
@ Test
@@ -198,6 +208,24 @@ public void infinityVariableOrdering() throws SolverException, InterruptedExcept
198
208
assertThatFormula (bmgr .or (varIsNan , bmgr .and (order1 , order2 ))).isTautological ();
199
209
}
200
210
211
+ @ Test
212
+ public void sqrt () throws SolverException , InterruptedException {
213
+ for (double d : new double [] {0.25 , 1 , 2 , 4 , 9 , 15 , 1234 , 1000000 }) {
214
+ assertThatFormula (
215
+ fpmgr .equalWithFPSemantics (
216
+ fpmgr .sqrt (fpmgr .makeNumber (d * d , doublePrecType )),
217
+ fpmgr .makeNumber (d , doublePrecType )))
218
+ .isTautological ();
219
+ assertThatFormula (
220
+ fpmgr .equalWithFPSemantics (
221
+ fpmgr .sqrt (fpmgr .makeNumber (d , doublePrecType )),
222
+ fpmgr .makeNumber (Math .sqrt (d ), doublePrecType )))
223
+ .isTautological ();
224
+ assertThatFormula (fpmgr .isNaN (fpmgr .sqrt (fpmgr .makeNumber (-d , doublePrecType ))))
225
+ .isTautological ();
226
+ }
227
+ }
228
+
201
229
@ Test
202
230
public void specialValueFunctions () throws SolverException , InterruptedException {
203
231
assertThatFormula (fpmgr .isInfinity (posInf )).isTautological ();
0 commit comments