I need to “factorize” some non-integer product to multipliers from the set ([0, 25] with step 0.25). The number of multipliers is chosen (2 to 5). Ideally results should be slightly different each run (and not contain only 1’s with product). The result should be within 0.1 of the initial product.
For example: Factor out 12.5 to 3 multipliers = 4.75 * 3.5 * 0.75 = 12.468. Close enough. Next run it could be 14.25 * 1.75 * 0.5 = 12.468.
Right now my solution is finding pairs that give desired product but it is not exactly what i want.
Nick is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.