Average Error: 0.1 → 0.1
Time: 34.5s
Precision: 64
\[\left(1 - x\right) + y \cdot \sqrt{x}\]
\[\mathsf{fma}\left(\sqrt{x}, y, 1 - x\right) + \mathsf{fma}\left(x, -1, x\right)\]
\left(1 - x\right) + y \cdot \sqrt{x}
\mathsf{fma}\left(\sqrt{x}, y, 1 - x\right) + \mathsf{fma}\left(x, -1, x\right)
double f(double x, double y) {
        double r2098976 = 1.0;
        double r2098977 = x;
        double r2098978 = r2098976 - r2098977;
        double r2098979 = y;
        double r2098980 = sqrt(r2098977);
        double r2098981 = r2098979 * r2098980;
        double r2098982 = r2098978 + r2098981;
        return r2098982;
}

double f(double x, double y) {
        double r2098983 = x;
        double r2098984 = sqrt(r2098983);
        double r2098985 = y;
        double r2098986 = 1.0;
        double r2098987 = r2098986 - r2098983;
        double r2098988 = fma(r2098984, r2098985, r2098987);
        double r2098989 = -1.0;
        double r2098990 = fma(r2098983, r2098989, r2098983);
        double r2098991 = r2098988 + r2098990;
        return r2098991;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.1

    \[\left(1 - x\right) + y \cdot \sqrt{x}\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \sqrt{x}, 1\right) - x}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

    \[\leadsto \mathsf{fma}\left(y, \sqrt{x}, 1\right) - \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}\]
  5. Applied add-cube-cbrt0.9

    \[\leadsto \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)}} - \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\]
  6. Applied prod-diff0.9

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)}, \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1\right)}, -\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{x}, \sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)}\]
  7. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{x}, y, 1 - x\right)} + \mathsf{fma}\left(-\sqrt[3]{x}, \sqrt[3]{x} \cdot \sqrt[3]{x}, \sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)\right)\]
  8. Simplified0.1

    \[\leadsto \mathsf{fma}\left(\sqrt{x}, y, 1 - x\right) + \color{blue}{\mathsf{fma}\left(x, -1, x\right)}\]
  9. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(\sqrt{x}, y, 1 - x\right) + \mathsf{fma}\left(x, -1, x\right)\]

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
  (+ (- 1.0 x) (* y (sqrt x))))