This is my code
\documentclass[12pt,a4paper]{article}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=2cm]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[%
declare function={a=1;b=-1;c=3;
f(\x)=a*\x*\x+b*\x+c;x1=-b/(2*a);}
]
\pgfmathparse{f(x1)}%
$ f\left(\dfrac{1}{2}\right)=
\pgfmathprintnumber\pgfmathresult$
\end{tikzpicture}
\end{document}
I got f\left(\dfrac{1}{2}\right) = 2.75
. How can I get the value of the f(1/2)
is 11/4 not 2.75?