We propose $\frac{|x-y|}{1+|y|}$, termed the ``P1 error" or ``plus-1 error", as a metric of errors. It equals half the harmonic mean of absolute error and relative error, effectively combining their advantages while mitigating their limitations. The P1 error approaches absolute error when $|y|$ is small, and approaches relative error when $|y|$ is large. An $\epsilon$ P1 error indicates that $x$ is close to $y$ at a tolerance level of $\epsilon$, in compliance with the ``isclose" definition used in popular numerical libraries.
翻译:暂无翻译