Average Error: 20.1 → 9.4
Time: 14.1s
Precision: 64
\[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\]
\[\frac{\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot y}{\left(x + y\right) + 1}\]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\frac{\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot y}{\left(x + y\right) + 1}
double f(double x, double y) {
        double r268678 = x;
        double r268679 = y;
        double r268680 = r268678 * r268679;
        double r268681 = r268678 + r268679;
        double r268682 = r268681 * r268681;
        double r268683 = 1.0;
        double r268684 = r268681 + r268683;
        double r268685 = r268682 * r268684;
        double r268686 = r268680 / r268685;
        return r268686;
}

double f(double x, double y) {
        double r268687 = x;
        double r268688 = r268687 * r268687;
        double r268689 = y;
        double r268690 = 2.0;
        double r268691 = r268690 * r268687;
        double r268692 = r268691 + r268689;
        double r268693 = r268689 * r268692;
        double r268694 = r268688 + r268693;
        double r268695 = r268687 / r268694;
        double r268696 = r268695 * r268689;
        double r268697 = r268687 + r268689;
        double r268698 = 1.0;
        double r268699 = r268697 + r268698;
        double r268700 = r268696 / r268699;
        return r268700;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original20.1
Target0.1
Herbie9.4
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}\]

Derivation

  1. Initial program 20.1

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\]
  2. Taylor expanded around 0 20.1

    \[\leadsto \frac{x \cdot y}{\color{blue}{\left({x}^{2} + \left({y}^{2} + 2 \cdot \left(x \cdot y\right)\right)\right)} \cdot \left(\left(x + y\right) + 1\right)}\]
  3. Simplified20.1

    \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x + y \cdot \left(2 \cdot x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)}\]
  4. Using strategy rm
  5. Applied times-frac9.4

    \[\leadsto \color{blue}{\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}}\]
  6. Using strategy rm
  7. Applied associate-*r/9.4

    \[\leadsto \color{blue}{\frac{\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot y}{\left(x + y\right) + 1}}\]
  8. Final simplification9.4

    \[\leadsto \frac{\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot y}{\left(x + y\right) + 1}\]

Reproduce

herbie shell --seed 2019304 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1))))