Average Error: 0.3 → 0.2
Time: 6.1s
Precision: 64
\[\frac{\left(d1 \cdot d2\right)}{\left(d1 \cdot d3\right)}\]
\[\left(\mathsf{qma}\left(\left(\left(d1 \cdot d2\right)\right), d1, d3\right)\right)\]
\frac{\left(d1 \cdot d2\right)}{\left(d1 \cdot d3\right)}
\left(\mathsf{qma}\left(\left(\left(d1 \cdot d2\right)\right), d1, d3\right)\right)
double f(double d1, double d2, double d3) {
        double r3753659 = d1;
        double r3753660 = d2;
        double r3753661 = r3753659 * r3753660;
        double r3753662 = d3;
        double r3753663 = r3753659 * r3753662;
        double r3753664 = r3753661 + r3753663;
        return r3753664;
}

double f(double d1, double d2, double d3) {
        double r3753665 = d1;
        double r3753666 = d2;
        double r3753667 = r3753665 * r3753666;
        double r3753668 = /*Error: no posit support in C */;
        double r3753669 = d3;
        double r3753670 = /*Error: no posit support in C */;
        double r3753671 = /*Error: no posit support in C */;
        return r3753671;
}

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Derivation

  1. Initial program 0.3

    \[\frac{\left(d1 \cdot d2\right)}{\left(d1 \cdot d3\right)}\]
  2. Using strategy rm
  3. Applied introduce-quire0.3

    \[\leadsto \frac{\color{blue}{\left(\left(\left(d1 \cdot d2\right)\right)\right)}}{\left(d1 \cdot d3\right)}\]
  4. Applied insert-quire-fdp-add0.2

    \[\leadsto \color{blue}{\left(\mathsf{qma}\left(\left(\left(d1 \cdot d2\right)\right), d1, d3\right)\right)}\]
  5. Final simplification0.2

    \[\leadsto \left(\mathsf{qma}\left(\left(\left(d1 \cdot d2\right)\right), d1, d3\right)\right)\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (d1 d2 d3)
  :name "FastMath dist"
  (+.p16 (*.p16 d1 d2) (*.p16 d1 d3)))