Average Error: 0.2 → 0
Time: 3.8s
Precision: 64
\[\frac{\left(d \cdot \left(10\right)\right)}{\left(d \cdot \left(20\right)\right)}\]
\[d \cdot \left(20 + 10\right)\]
\frac{\left(d \cdot \left(10\right)\right)}{\left(d \cdot \left(20\right)\right)}
d \cdot \left(20 + 10\right)
double f(double d) {
        double r1373879 = d;
        double r1373880 = 10.0;
        double r1373881 = /* ERROR: no posit support in C */;
        double r1373882 = r1373879 * r1373881;
        double r1373883 = 20.0;
        double r1373884 = /* ERROR: no posit support in C */;
        double r1373885 = r1373879 * r1373884;
        double r1373886 = r1373882 + r1373885;
        return r1373886;
}

double f(double d) {
        double r1373887 = d;
        double r1373888 = 20.0;
        double r1373889 = 10.0;
        double r1373890 = r1373888 + r1373889;
        double r1373891 = r1373887 * r1373890;
        return r1373891;
}

Error

Bits error versus d

Derivation

  1. Initial program 0.2

    \[\frac{\left(d \cdot \left(10\right)\right)}{\left(d \cdot \left(20\right)\right)}\]
  2. Simplified0

    \[\leadsto \color{blue}{d \cdot \left(\frac{\left(20\right)}{\left(10\right)}\right)}\]
  3. Final simplification0

    \[\leadsto d \cdot \left(20 + 10\right)\]

Reproduce

herbie shell --seed 2019124 
(FPCore (d)
  :name "FastMath test1"
  (+.p16 (*.p16 d (real->posit16 10)) (*.p16 d (real->posit16 20))))