mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 20:37:05 +02:00
Fix 180 favor issue, reworked favor and reputation mathjax
This commit is contained in:
@@ -2,8 +2,15 @@
|
||||
// These formulas were derived on wolfram alpha.
|
||||
|
||||
// Wolfram Alpha: sum from 0 to n of 500*1.02^n
|
||||
// 500 * ((pow(51, f+1)) / pow(50,f) - 50)
|
||||
// Then we use https://herbie.uwplse.org/demo/ to simplify it and prevent
|
||||
// Infinity issues.
|
||||
export function favorToRep(f: number): number {
|
||||
return 500 * ((Math.pow(51, f+1)) / Math.pow(50,f) - 50);
|
||||
function fma(a: number, b: number, c: number): number {
|
||||
return a * b + c;
|
||||
}
|
||||
const ex = fma(f, (Math.log(51.0) - Math.log(50.0)), Math.log(51.0));
|
||||
return fma(500.0, Math.exp(ex), -25000.0);
|
||||
}
|
||||
|
||||
// Wolfram Alpha: 500 (50^(-n) 51^(n + 1) - 50) solve for n
|
||||
|
||||
Reference in New Issue
Block a user