Average Error: 0.2 → 0
Time: 3.6s
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 r2921517 = d;
        double r2921518 = 10.0;
        double r2921519 = /* ERROR: no posit support in C */;
        double r2921520 = r2921517 * r2921519;
        double r2921521 = 20.0;
        double r2921522 = /* ERROR: no posit support in C */;
        double r2921523 = r2921517 * r2921522;
        double r2921524 = r2921520 + r2921523;
        return r2921524;
}

double f(double d) {
        double r2921525 = d;
        double r2921526 = 20.0;
        double r2921527 = /* ERROR: no posit support in C */;
        double r2921528 = 10.0;
        double r2921529 = /* ERROR: no posit support in C */;
        double r2921530 = r2921527 + r2921529;
        double r2921531 = r2921525 * r2921530;
        return r2921531;
}

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