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 r2835137 = d;
        double r2835138 = 10.0;
        double r2835139 = /* ERROR: no posit support in C */;
        double r2835140 = r2835137 * r2835139;
        double r2835141 = 20.0;
        double r2835142 = /* ERROR: no posit support in C */;
        double r2835143 = r2835137 * r2835142;
        double r2835144 = r2835140 + r2835143;
        return r2835144;
}

double f(double d) {
        double r2835145 = d;
        double r2835146 = 20.0;
        double r2835147 = /* ERROR: no posit support in C */;
        double r2835148 = 10.0;
        double r2835149 = /* ERROR: no posit support in C */;
        double r2835150 = r2835147 + r2835149;
        double r2835151 = r2835145 * r2835150;
        return r2835151;
}

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