Average Error: 0.2 → 0
Time: 4.0s
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 r3514400 = d;
        double r3514401 = 10.0;
        double r3514402 = /* ERROR: no posit support in C */;
        double r3514403 = r3514400 * r3514402;
        double r3514404 = 20.0;
        double r3514405 = /* ERROR: no posit support in C */;
        double r3514406 = r3514400 * r3514405;
        double r3514407 = r3514403 + r3514406;
        return r3514407;
}

double f(double d) {
        double r3514408 = d;
        double r3514409 = 20.0;
        double r3514410 = /* ERROR: no posit support in C */;
        double r3514411 = 10.0;
        double r3514412 = /* ERROR: no posit support in C */;
        double r3514413 = r3514410 + r3514412;
        double r3514414 = r3514408 * r3514413;
        return r3514414;
}

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