Average Error: 0.1 → 0.1
Time: 18.1s
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 r3471192 = 1.0;
        double r3471193 = x;
        double r3471194 = r3471192 - r3471193;
        double r3471195 = y;
        double r3471196 = sqrt(r3471193);
        double r3471197 = r3471195 * r3471196;
        double r3471198 = r3471194 + r3471197;
        return r3471198;
}

double f(double x, double y) {
        double r3471199 = y;
        double r3471200 = x;
        double r3471201 = sqrt(r3471200);
        double r3471202 = 1.0;
        double r3471203 = r3471202 - r3471200;
        double r3471204 = fma(r3471199, r3471201, r3471203);
        double r3471205 = -1.0;
        double r3471206 = fma(r3471200, r3471205, r3471200);
        double r3471207 = r3471204 + r3471206;
        return r3471207;
}

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 2019172 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
  (+ (- 1.0 x) (* y (sqrt x))))