Average Error: 0.1 → 0.1
Time: 18.6s
Precision: 64
\[\left(1 - x\right) + y \cdot \sqrt{x}\]
\[\mathsf{fma}\left(y, \sqrt{x}, 1 - x\right) + \mathsf{fma}\left(x, -1, x\right)\]
\left(1 - x\right) + y \cdot \sqrt{x}
\mathsf{fma}\left(y, \sqrt{x}, 1 - x\right) + \mathsf{fma}\left(x, -1, x\right)
double f(double x, double y) {
        double r2527832 = 1.0;
        double r2527833 = x;
        double r2527834 = r2527832 - r2527833;
        double r2527835 = y;
        double r2527836 = sqrt(r2527833);
        double r2527837 = r2527835 * r2527836;
        double r2527838 = r2527834 + r2527837;
        return r2527838;
}

double f(double x, double y) {
        double r2527839 = y;
        double r2527840 = x;
        double r2527841 = sqrt(r2527840);
        double r2527842 = 1.0;
        double r2527843 = r2527842 - r2527840;
        double r2527844 = fma(r2527839, r2527841, r2527843);
        double r2527845 = -1.0;
        double r2527846 = fma(r2527840, r2527845, r2527840);
        double r2527847 = r2527844 + r2527846;
        return r2527847;
}

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

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

Reproduce

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