Average Error: 0.1 → 0.1
Time: 16.7s
Precision: 64
\[\left(1.0 - x\right) + y \cdot \sqrt{x}\]
\[\mathsf{fma}\left(y, \sqrt{x}, 1.0 - x\right) + \mathsf{fma}\left(x, -1, x\right)\]
\left(1.0 - x\right) + y \cdot \sqrt{x}
\mathsf{fma}\left(y, \sqrt{x}, 1.0 - x\right) + \mathsf{fma}\left(x, -1, x\right)
double f(double x, double y) {
        double r3275650 = 1.0;
        double r3275651 = x;
        double r3275652 = r3275650 - r3275651;
        double r3275653 = y;
        double r3275654 = sqrt(r3275651);
        double r3275655 = r3275653 * r3275654;
        double r3275656 = r3275652 + r3275655;
        return r3275656;
}

double f(double x, double y) {
        double r3275657 = y;
        double r3275658 = x;
        double r3275659 = sqrt(r3275658);
        double r3275660 = 1.0;
        double r3275661 = r3275660 - r3275658;
        double r3275662 = fma(r3275657, r3275659, r3275661);
        double r3275663 = -1.0;
        double r3275664 = fma(r3275658, r3275663, r3275658);
        double r3275665 = r3275662 + r3275664;
        return r3275665;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.1

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

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

    \[\leadsto \mathsf{fma}\left(y, \sqrt{x}, 1.0\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.0\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1.0\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1.0\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.0\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1.0\right)}, \sqrt[3]{\mathsf{fma}\left(y, \sqrt{x}, 1.0\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(y, \sqrt{x}, 1.0 - 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(y, \sqrt{x}, 1.0 - x\right) + \color{blue}{\mathsf{fma}\left(x, -1, x\right)}\]
  9. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(y, \sqrt{x}, 1.0 - 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))))