This commit is contained in:
Ozzie Gooen 2022-04-27 15:21:27 -04:00
parent dfa404f0d0
commit b2189777d5

View File

@ -163,13 +163,17 @@ module AlgebraicCombination = {
*/
let getLogarithmInputError = (t1: t, t2: t, ~toPointSetFn: toPointSetFn): option<error> => {
let firstOperandIsGreaterThanZero =
toFloatOperation(t1, ~toPointSetFn, ~distToFloatOperation=#Cdf(MagicNumbers.Epsilon.ten)) |> E.R.fmap(r =>
r > 0.
)
toFloatOperation(
t1,
~toPointSetFn,
~distToFloatOperation=#Cdf(MagicNumbers.Epsilon.ten),
) |> E.R.fmap(r => r > 0.)
let secondOperandIsGreaterThanZero =
toFloatOperation(t2, ~toPointSetFn, ~distToFloatOperation=#Cdf(MagicNumbers.Epsilon.ten)) |> E.R.fmap(r =>
r > 0.
)
toFloatOperation(
t2,
~toPointSetFn,
~distToFloatOperation=#Cdf(MagicNumbers.Epsilon.ten),
) |> E.R.fmap(r => r > 0.)
let items = E.A.R.firstErrorOrOpen([
firstOperandIsGreaterThanZero,
secondOperandIsGreaterThanZero,
@ -253,7 +257,8 @@ module AlgebraicCombination = {
#AsSymbolic
| #NoSolution =>
if Operation.Convolution.canDoAlgebraicOperation(arithmeticOperation) {
expectedConvolutionCost(t1) * expectedConvolutionCost(t2) > MagicNumbers.OpCost.monteCarloCost
expectedConvolutionCost(t1) * expectedConvolutionCost(t2) >
MagicNumbers.OpCost.monteCarloCost
? #AsMonteCarlo
: #AsConvolution
} else {