Skip to content

Commit

Permalink
perf: optimize Chi()
Browse files Browse the repository at this point in the history
  • Loading branch information
kewde committed Feb 4, 2025
1 parent 31c7924 commit 06734e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/_md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function setBigUint64(

/** Choice: a ? b : c */
export function Chi(a: number, b: number, c: number): number {
return (a & b) ^ (~a & c);
return (c ^ (a & (b ^ c)));
}

/** Majority function, true if any two inputs is true. */
Expand Down

0 comments on commit 06734e0

Please sign in to comment.