Average Error: 0.1 → 0.1
Time: 2.0s
Precision: 64
\[\frac{x \cdot x - 3}{6}\]
\[\left(x \cdot 0.1666666666666666574148081281236954964697\right) \cdot x - 0.5\]
\frac{x \cdot x - 3}{6}
\left(x \cdot 0.1666666666666666574148081281236954964697\right) \cdot x - 0.5
double f(double x) {
        double r64239 = x;
        double r64240 = r64239 * r64239;
        double r64241 = 3.0;
        double r64242 = r64240 - r64241;
        double r64243 = 6.0;
        double r64244 = r64242 / r64243;
        return r64244;
}

double f(double x) {
        double r64245 = x;
        double r64246 = 0.16666666666666666;
        double r64247 = r64245 * r64246;
        double r64248 = r64247 * r64245;
        double r64249 = 0.5;
        double r64250 = r64248 - r64249;
        return r64250;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

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

    \[\leadsto \color{blue}{0.1666666666666666574148081281236954964697 \cdot {x}^{2} - 0.5}\]
  3. Using strategy rm
  4. Applied unpow20.2

    \[\leadsto 0.1666666666666666574148081281236954964697 \cdot \color{blue}{\left(x \cdot x\right)} - 0.5\]
  5. Applied associate-*r*0.1

    \[\leadsto \color{blue}{\left(0.1666666666666666574148081281236954964697 \cdot x\right) \cdot x} - 0.5\]
  6. Simplified0.1

    \[\leadsto \color{blue}{\left(x \cdot 0.1666666666666666574148081281236954964697\right)} \cdot x - 0.5\]
  7. Final simplification0.1

    \[\leadsto \left(x \cdot 0.1666666666666666574148081281236954964697\right) \cdot x - 0.5\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, H"
  :precision binary64
  (/ (- (* x x) 3) 6))