Average Error: 0.2 → 0.2
Time: 13.7s
Precision: 64
\[\frac{x \cdot x - 3}{6}\]
\[\mathsf{fma}\left(x \cdot x, 0.1666666666666666574148081281236954964697, -0.5\right)\]
\frac{x \cdot x - 3}{6}
\mathsf{fma}\left(x \cdot x, 0.1666666666666666574148081281236954964697, -0.5\right)
double f(double x) {
        double r50183 = x;
        double r50184 = r50183 * r50183;
        double r50185 = 3.0;
        double r50186 = r50184 - r50185;
        double r50187 = 6.0;
        double r50188 = r50186 / r50187;
        return r50188;
}

double f(double x) {
        double r50189 = x;
        double r50190 = r50189 * r50189;
        double r50191 = 0.16666666666666666;
        double r50192 = 0.5;
        double r50193 = -r50192;
        double r50194 = fma(r50190, r50191, r50193);
        return r50194;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.2

    \[\frac{x \cdot x - 3}{6}\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{0.1666666666666666574148081281236954964697 \cdot {x}^{2} - 0.5}\]
  3. Simplified0.2

    \[\leadsto \color{blue}{\mathsf{fma}\left(x \cdot x, 0.1666666666666666574148081281236954964697, -0.5\right)}\]
  4. Final simplification0.2

    \[\leadsto \mathsf{fma}\left(x \cdot x, 0.1666666666666666574148081281236954964697, -0.5\right)\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
  (/ (- (* x x) 3.0) 6.0))