But the Tosafot in Shabbat (18b, s.v. "demafkra") wrote that one must declare it hefker specifically before three people, and this is explicitly written in the Tosafot Yeshanim there, see there. And it seems to me regarding their reasoning: first, since by rabbinic law three are required; and furthermore, if he declares it hefker by himself—there is still a concern of suspicion for the observer, who will say that the animal of an Israelite is performing labor on Shabbat. And this is why our teacher, the Beit Yosef, was precise to say "in order to be saved from a Torah prohibition," meaning that a prohibition of marit ayin still exists, but because of this we shall not impose upon him that he lose his animal if another person should acquire it. And for this came our teacher, the Rema, [stating] that he can declare it hefker before three, so that it will be a complete hefker by rabbinic law and also the prohibition of marit ayin will not exist, for through three people it will become publicized that he declared it hefker. And nevertheless, no damage will reach him, for no other person can acquire it, because we are witnesses that he only declared it hefker so that he would not violate the prohibition of the resting of his animal. And one should not ask that if so, what kind of hefker is this, for there is a tactic for this: that he declare it hefker only for the day of Shabbat alone, for hefker for a limited time is considered hefker, as is written in Choshen Mishpat siman 273 section 8, for in the Yerushalmi, chapter 6 of Peah, they derived hefker from Shemittah, as we explained there; and on Shabbat a person is not permitted to acquire it, for the authority of the non-Jew is still upon it, and after Shabbat it returns to him, as our teacher, the Beit Yosef, wrote in his great work. (See Taz, subsection 5). And our teacher, the Rema, says that even if he did not explicitly state this—we say that this was his intention. (See Magen Avraham, subsection 11, for it is implied from his words that even when declaring hefker so that no person shall acquire it—it is effective, even though it is not a complete hefker, and as the Machatzit HaShekel wrote. And see Pri Megadim on the Taz, letter 5, and these are puzzling matters, and therefore it seems in my humble opinion that the main point is as I have written, and examine it well).
אבל התוספות בשבת (י"ח: ד"ה 'דמפקרא') כתבו דצריך להפקיר בפני ג' דווקא, ובפירוש כתוב זה בתוספות ישנים שם ע"ש. ונראה לי בטעמם, חדא כיון דמדרבנן צריך ג', ועוד דאם יפקירה בינו לבין עצמו - עדיין איכא חשדא להרואה, שיאמר שבהמת ישראל עושה מלאכה בשבת. וזהו שדקדק רבינו הב"י לומר 'כדי להנצל מאיסור דאורייתא', כלומר אבל איסור מראית העין עדיין יש, אך מפני זה לא נטיל עליו שיאבד בהמתו אם אחר יזכה בה. ולזה בא רבינו הרמ"א, דיכול להפקיר בפני ג', כדי שיהיה הפקר גמור מדרבנן וגם איסור מראית העין לא יהיה, דעל ידי ג' יתפרסם שהפקירה. ומכל מקום לא יגיע לו נזק, כי אין אחר יכול לזכות בה, מפני דאנן סהדי שלא הפקירה רק כדי שלא יעבור על איסור שביתת בהמתו. ואין לשאול דאם כן איזה הפקר הוא זה, דיש לזה עצה שיפקירנה רק על יום השבת בלבד, דהפקר לזמן - הוי הפקר, כמ"ש בחושן משפט סימן רע"ג סעיף ח', דבירושלמי פרק ו' דפיאה למדו הפקר משמיטה, כמו שבארנו שם, ובשבת אין אדם רשאי לזכות בה, שהרי עדיין רשות העכו"ם עליה, ולאחר השבת חוזרת לו, כמ"ש רבינו הב"י בספרו הגדול. (עיין ט"ז סק"ה) ורבינו הרמ"א אומר, דאפילו לא פירש כן בפירוש - אמרינן שדעתו היה כן. (עיין מג"א סקי"א, דמשמע מדבריו דגם במפקיר שלא יזכה בה אדם - מהני, אף שאינו הפקר גמור, וכמ"ש המחה"ש. ועיין פרמ"ג בט"ז אות ה' ודברים תמוהים הם, ולכן נראה לעניות דעתי העיקר כמ"ש ודו"ק).