Average Error: 0.2 → 0.2
Time: 22.9s
Precision: 64
\[\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\]
\[\mathsf{fma}\left(\frac{-1}{\sqrt{x}}, \frac{y}{3}, \frac{y}{3} \cdot \frac{1}{\sqrt{x}}\right) + \mathsf{fma}\left(1, 1 - \frac{1}{x \cdot 9}, \frac{y}{3} \cdot \frac{-1}{\sqrt{x}}\right)\]
\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}
\mathsf{fma}\left(\frac{-1}{\sqrt{x}}, \frac{y}{3}, \frac{y}{3} \cdot \frac{1}{\sqrt{x}}\right) + \mathsf{fma}\left(1, 1 - \frac{1}{x \cdot 9}, \frac{y}{3} \cdot \frac{-1}{\sqrt{x}}\right)
double f(double x, double y) {
        double r14698389 = 1.0;
        double r14698390 = x;
        double r14698391 = 9.0;
        double r14698392 = r14698390 * r14698391;
        double r14698393 = r14698389 / r14698392;
        double r14698394 = r14698389 - r14698393;
        double r14698395 = y;
        double r14698396 = 3.0;
        double r14698397 = sqrt(r14698390);
        double r14698398 = r14698396 * r14698397;
        double r14698399 = r14698395 / r14698398;
        double r14698400 = r14698394 - r14698399;
        return r14698400;
}

double f(double x, double y) {
        double r14698401 = -1.0;
        double r14698402 = x;
        double r14698403 = sqrt(r14698402);
        double r14698404 = r14698401 / r14698403;
        double r14698405 = y;
        double r14698406 = 3.0;
        double r14698407 = r14698405 / r14698406;
        double r14698408 = 1.0;
        double r14698409 = r14698408 / r14698403;
        double r14698410 = r14698407 * r14698409;
        double r14698411 = fma(r14698404, r14698407, r14698410);
        double r14698412 = 1.0;
        double r14698413 = 9.0;
        double r14698414 = r14698402 * r14698413;
        double r14698415 = r14698412 / r14698414;
        double r14698416 = r14698412 - r14698415;
        double r14698417 = r14698407 * r14698404;
        double r14698418 = fma(r14698408, r14698416, r14698417);
        double r14698419 = r14698411 + r14698418;
        return r14698419;
}

Error

Bits error versus x

Bits error versus y

Target

Original0.2
Target0.2
Herbie0.2
\[\left(1 - \frac{\frac{1}{x}}{9}\right) - \frac{y}{3 \cdot \sqrt{x}}\]

Derivation

  1. Initial program 0.2

    \[\left(1 - \frac{1}{x \cdot 9}\right) - \frac{y}{3 \cdot \sqrt{x}}\]
  2. Using strategy rm
  3. Applied associate-/r*0.2

    \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{\frac{y}{3}}{\sqrt{x}}}\]
  4. Using strategy rm
  5. Applied div-inv0.2

    \[\leadsto \left(1 - \frac{1}{x \cdot 9}\right) - \color{blue}{\frac{y}{3} \cdot \frac{1}{\sqrt{x}}}\]
  6. Applied *-un-lft-identity0.2

    \[\leadsto \color{blue}{1 \cdot \left(1 - \frac{1}{x \cdot 9}\right)} - \frac{y}{3} \cdot \frac{1}{\sqrt{x}}\]
  7. Applied prod-diff0.2

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, D"

  :herbie-target
  (- (- 1.0 (/ (/ 1.0 x) 9.0)) (/ y (* 3.0 (sqrt x))))

  (- (- 1.0 (/ 1.0 (* x 9.0))) (/ y (* 3.0 (sqrt x)))))