Average Error: 32.4 → 0
Time: 2.8s
Precision: 64
\[10000 \cdot \left(a - \left(a - {10}^{\left(-20\right)}\right)\right)\]
\[\frac{1}{10000000000000000}\]
10000 \cdot \left(a - \left(a - {10}^{\left(-20\right)}\right)\right)
\frac{1}{10000000000000000}
double f(double a) {
        double r24399875 = 10000.0;
        double r24399876 = a;
        double r24399877 = 10.0;
        double r24399878 = 20.0;
        double r24399879 = -r24399878;
        double r24399880 = pow(r24399877, r24399879);
        double r24399881 = r24399876 - r24399880;
        double r24399882 = r24399876 - r24399881;
        double r24399883 = r24399875 * r24399882;
        return r24399883;
}

double f(double __attribute__((unused)) a) {
        double r24399884 = 1e-16;
        return r24399884;
}

Error

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.4

    \[10000 \cdot \left(a - \left(a - {10}^{\left(-20\right)}\right)\right)\]
  2. Simplified0

    \[\leadsto \color{blue}{\frac{1}{10000000000000000}}\]
  3. Final simplification0

    \[\leadsto \frac{1}{10000000000000000}\]

Reproduce

herbie shell --seed 1 
(FPCore (a)
  :name "10000*(a-(a-pow(10,-20)))"
  (* 10000 (- a (- a (pow 10 (- 20))))))