Average Error: 0.1 → 0.1
Time: 17.9s
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 r3519066 = 1.0;
        double r3519067 = x;
        double r3519068 = r3519066 - r3519067;
        double r3519069 = y;
        double r3519070 = sqrt(r3519067);
        double r3519071 = r3519069 * r3519070;
        double r3519072 = r3519068 + r3519071;
        return r3519072;
}

double f(double x, double y) {
        double r3519073 = y;
        double r3519074 = x;
        double r3519075 = sqrt(r3519074);
        double r3519076 = 1.0;
        double r3519077 = r3519076 - r3519074;
        double r3519078 = fma(r3519073, r3519075, r3519077);
        double r3519079 = -1.0;
        double r3519080 = fma(r3519074, r3519079, r3519074);
        double r3519081 = r3519078 + r3519080;
        return r3519081;
}

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))))