Average Error: 0.0 → 0.0
Time: 5.2s
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\[y \cdot x + \left(0.918938533204673003 - \left(1 \cdot x + 0.5 \cdot y\right)\right)\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003
y \cdot x + \left(0.918938533204673003 - \left(1 \cdot x + 0.5 \cdot y\right)\right)
double f(double x, double y) {
        double r42315 = x;
        double r42316 = y;
        double r42317 = 1.0;
        double r42318 = r42316 - r42317;
        double r42319 = r42315 * r42318;
        double r42320 = 0.5;
        double r42321 = r42316 * r42320;
        double r42322 = r42319 - r42321;
        double r42323 = 0.918938533204673;
        double r42324 = r42322 + r42323;
        return r42324;
}

double f(double x, double y) {
        double r42325 = y;
        double r42326 = x;
        double r42327 = r42325 * r42326;
        double r42328 = 0.918938533204673;
        double r42329 = 1.0;
        double r42330 = r42329 * r42326;
        double r42331 = 0.5;
        double r42332 = r42331 * r42325;
        double r42333 = r42330 + r42332;
        double r42334 = r42328 - r42333;
        double r42335 = r42327 + r42334;
        return r42335;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto \left(x \cdot \color{blue}{\left(y + \left(-1\right)\right)} - y \cdot 0.5\right) + 0.918938533204673003\]
  4. Applied distribute-rgt-in0.0

    \[\leadsto \left(\color{blue}{\left(y \cdot x + \left(-1\right) \cdot x\right)} - y \cdot 0.5\right) + 0.918938533204673003\]
  5. Applied associate--l+0.0

    \[\leadsto \color{blue}{\left(y \cdot x + \left(\left(-1\right) \cdot x - y \cdot 0.5\right)\right)} + 0.918938533204673003\]
  6. Applied associate-+l+0.0

    \[\leadsto \color{blue}{y \cdot x + \left(\left(\left(-1\right) \cdot x - y \cdot 0.5\right) + 0.918938533204673003\right)}\]
  7. Simplified0.0

    \[\leadsto y \cdot x + \color{blue}{\left(0.918938533204673003 - \left(1 \cdot x + 0.5 \cdot y\right)\right)}\]
  8. Final simplification0.0

    \[\leadsto y \cdot x + \left(0.918938533204673003 - \left(1 \cdot x + 0.5 \cdot y\right)\right)\]

Reproduce

herbie shell --seed 2020042 
(FPCore (x y)
  :name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (+ (- (* x (- y 1)) (* y 0.5)) 0.918938533204673))