Hi,\n\nIn MS Excel there is a feature called Goal Seek. If you have a function\nand you need certain output from the function, you can ask goal seek to\nfind the input for that function. The search for input value is done\nbrute force style.\n\nI tried to imitate this feature in ruby when I wanted to calculate tax\nsubsidy (tax subsidy is also taxed, tax calc utilizes tax brackets, non\nreversible, etc.) Here's my function:\n\ndef subsidy_seek(net_salary, &net_if_subsidy)\nsubsidy = 0\nnet_calc = net_if_subsidy.call(subsidy)\nincrement = 65536\n\nuntil net_salary - net_calc < 10\nuntil net_if_subsidy.call(subsidy + increment) < net_salary\nincrement /= 2\nend\n\nsubsidy += increment\nnet_calc = net_if_subsidy.call(subsidy)\nend\n\nsubsidy\nend\n\nIt works, but it's a very specific function.\n\nIs there a ruby library for this kind of feature?\n\nIs there a mathematical term for goal seek? So if I want to learn more\nI can key in that term in google?\n\nAnybody know what kind of process goes behind goal seek? It seems to be\nable to handle most situations.