JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES11), 50 bytes
An alternate version taking Bigints as input.
We have to use a ternary operator because we can't add a Boolean to a Bigint. This is however an opportunity to invert the sign of the division which allows to save one byte on the multiplication by just using ~. And more importantly, we don't have to round the result of the division anymore.
(d,f,b)=>b**-~(d*--f/--b)/(b>f&b>1?-b:~b)*~(d*f%b)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES11), 50 bytes
An alternate version taking Bigints as input.
(d,f,b)=>b**-~(d*--f/--b)/(b>f&b>1?-b:~b)*~(d*f%b)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES11), 50 bytes
An alternate version taking Bigints as input.
We have to use a ternary operator because we can't add a Boolean to a Bigint. This is however an opportunity to invert the sign of the division which allows to save one byte on the multiplication by just using ~. And more importantly, we don't have to round the result of the division anymore.
(d,f,b)=>b**-~(d*--f/--b)/(b>f&b>1?-b:~b)*~(d*f%b)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES11), 50 bytes
An alternate version taking Bigints as input.
(d,f,b)=>b**-~(d*--f/--b)/(b>f&b>1?-b:~b)*~(d*f%b)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)
JavaScript (ES11), 50 bytes
An alternate version taking Bigints as input.
(d,f,b)=>b**-~(d*--f/--b)/(b>f&b>1?-b:~b)*~(d*f%b)
JavaScript (ES7), 54 bytes
A port of loopy walt's xnor-optimized answer.
(d,f,b)=>~~(b**-~(d*--f/--b)/(b+(b<=f|b<2)))*(d*f%b+1)