Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\[\left(\left(y \cdot x + \left(-1\right) \cdot x\right) - y \cdot 0.5\right) + 0.918938533204673003\]
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673003
\left(\left(y \cdot x + \left(-1\right) \cdot x\right) - y \cdot 0.5\right) + 0.918938533204673003
double f(double x, double y) {
        double r55899 = x;
        double r55900 = y;
        double r55901 = 1.0;
        double r55902 = r55900 - r55901;
        double r55903 = r55899 * r55902;
        double r55904 = 0.5;
        double r55905 = r55900 * r55904;
        double r55906 = r55903 - r55905;
        double r55907 = 0.918938533204673;
        double r55908 = r55906 + r55907;
        return r55908;
}

double f(double x, double y) {
        double r55909 = y;
        double r55910 = x;
        double r55911 = r55909 * r55910;
        double r55912 = 1.0;
        double r55913 = -r55912;
        double r55914 = r55913 * r55910;
        double r55915 = r55911 + r55914;
        double r55916 = 0.5;
        double r55917 = r55909 * r55916;
        double r55918 = r55915 - r55917;
        double r55919 = 0.918938533204673;
        double r55920 = r55918 + r55919;
        return r55920;
}

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-lft-in0.0

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

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

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

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

Reproduce

herbie shell --seed 2020046 +o rules:numerics
(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))