Average Error: 19.8 → 8.6
Time: 15.5s
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)}\]
\[\begin{array}{l} \mathbf{if}\;x \le 1.362190345900607895364022170894389499783 \cdot 10^{154}:\\ \;\;\;\;\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\begin{array}{l}
\mathbf{if}\;x \le 1.362190345900607895364022170894389499783 \cdot 10^{154}:\\
\;\;\;\;\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}\\

\mathbf{else}:\\
\;\;\;\;0\\

\end{array}
double f(double x, double y) {
        double r295328 = x;
        double r295329 = y;
        double r295330 = r295328 * r295329;
        double r295331 = r295328 + r295329;
        double r295332 = r295331 * r295331;
        double r295333 = 1.0;
        double r295334 = r295331 + r295333;
        double r295335 = r295332 * r295334;
        double r295336 = r295330 / r295335;
        return r295336;
}

double f(double x, double y) {
        double r295337 = x;
        double r295338 = 1.362190345900608e+154;
        bool r295339 = r295337 <= r295338;
        double r295340 = r295337 * r295337;
        double r295341 = y;
        double r295342 = 2.0;
        double r295343 = r295342 * r295337;
        double r295344 = r295343 + r295341;
        double r295345 = r295341 * r295344;
        double r295346 = r295340 + r295345;
        double r295347 = r295337 / r295346;
        double r295348 = r295337 + r295341;
        double r295349 = 1.0;
        double r295350 = r295348 + r295349;
        double r295351 = r295341 / r295350;
        double r295352 = r295347 * r295351;
        double r295353 = 0.0;
        double r295354 = r295339 ? r295352 : r295353;
        return r295354;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.8
Target0.1
Herbie8.6
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < 1.362190345900608e+154

    1. Initial program 19.0

      \[\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 19.0

      \[\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. Simplified19.0

      \[\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-frac8.2

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

    if 1.362190345900608e+154 < x

    1. Initial program 26.3

      \[\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 inf 11.4

      \[\leadsto \color{blue}{0}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification8.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 1.362190345900607895364022170894389499783 \cdot 10^{154}:\\ \;\;\;\;\frac{x}{x \cdot x + y \cdot \left(2 \cdot x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]

Reproduce

herbie shell --seed 2019303 
(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))))