Average Error: 0.2 → 0
Time: 3.5s
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 r3343416 = d;
        double r3343417 = 10.0;
        double r3343418 = /* ERROR: no posit support in C */;
        double r3343419 = r3343416 * r3343418;
        double r3343420 = 20.0;
        double r3343421 = /* ERROR: no posit support in C */;
        double r3343422 = r3343416 * r3343421;
        double r3343423 = r3343419 + r3343422;
        return r3343423;
}

double f(double d) {
        double r3343424 = d;
        double r3343425 = 20.0;
        double r3343426 = /* ERROR: no posit support in C */;
        double r3343427 = 10.0;
        double r3343428 = /* ERROR: no posit support in C */;
        double r3343429 = r3343426 + r3343428;
        double r3343430 = r3343424 * r3343429;
        return r3343430;
}

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 2019168 
(FPCore (d)
  :name "FastMath test1"
  (+.p16 (*.p16 d (real->posit16 10)) (*.p16 d (real->posit16 20))))