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(\frac{\left(20\right)}{\left(10\right)}\right)\]
\frac{\left(d \cdot \left(10\right)\right)}{\left(d \cdot \left(20\right)\right)}
d \cdot \left(\frac{\left(20\right)}{\left(10\right)}\right)
double f(double d) {
        double r4217361 = d;
        double r4217362 = 10.0;
        double r4217363 = /* ERROR: no posit support in C */;
        double r4217364 = r4217361 * r4217363;
        double r4217365 = 20.0;
        double r4217366 = /* ERROR: no posit support in C */;
        double r4217367 = r4217361 * r4217366;
        double r4217368 = r4217364 + r4217367;
        return r4217368;
}

double f(double d) {
        double r4217369 = d;
        double r4217370 = 20.0;
        double r4217371 = /* ERROR: no posit support in C */;
        double r4217372 = 10.0;
        double r4217373 = /* ERROR: no posit support in C */;
        double r4217374 = r4217371 + r4217373;
        double r4217375 = r4217369 * r4217374;
        return r4217375;
}

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(\frac{\left(20\right)}{\left(10\right)}\right)\]

Reproduce

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