Average Error: 0.3 → 0.2
Time: 7.3s
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 r1619218 = d1;
        double r1619219 = d2;
        double r1619220 = r1619218 * r1619219;
        double r1619221 = d3;
        double r1619222 = r1619218 * r1619221;
        double r1619223 = r1619220 + r1619222;
        return r1619223;
}

double f(double d1, double d2, double d3) {
        double r1619224 = d1;
        double r1619225 = d2;
        double r1619226 = r1619224 * r1619225;
        double r1619227 = /*Error: no posit support in C */;
        double r1619228 = d3;
        double r1619229 = /*Error: no posit support in C */;
        double r1619230 = /*Error: no posit support in C */;
        return r1619230;
}

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 2019155 
(FPCore (d1 d2 d3)
  :name "FastMath dist"
  (+.p16 (*.p16 d1 d2) (*.p16 d1 d3)))