Average Error: 0.4 → 0.2
Time: 6.6s
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 r2551671 = d1;
        double r2551672 = d2;
        double r2551673 = r2551671 * r2551672;
        double r2551674 = d3;
        double r2551675 = r2551671 * r2551674;
        double r2551676 = r2551673 + r2551675;
        return r2551676;
}

double f(double d1, double d2, double d3) {
        double r2551677 = d1;
        double r2551678 = d2;
        double r2551679 = r2551677 * r2551678;
        double r2551680 = /*Error: no posit support in C */;
        double r2551681 = d3;
        double r2551682 = /*Error: no posit support in C */;
        double r2551683 = /*Error: no posit support in C */;
        return r2551683;
}

Error

Bits error versus d1

Bits error versus d2

Bits error versus d3

Derivation

  1. Initial program 0.4

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

    \[\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 2019158 +o rules:numerics
(FPCore (d1 d2 d3)
  :name "FastMath dist"
  (+.p16 (*.p16 d1 d2) (*.p16 d1 d3)))