Average Error: 19.3 → 0.2
Time: 14.4s
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)}\]
\[\left(\frac{\frac{x}{x + y}}{x + y} \cdot y\right) \cdot \frac{1}{\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)}
\left(\frac{\frac{x}{x + y}}{x + y} \cdot y\right) \cdot \frac{1}{\left(x + y\right) + 1}
double f(double x, double y) {
        double r301013 = x;
        double r301014 = y;
        double r301015 = r301013 * r301014;
        double r301016 = r301013 + r301014;
        double r301017 = r301016 * r301016;
        double r301018 = 1.0;
        double r301019 = r301016 + r301018;
        double r301020 = r301017 * r301019;
        double r301021 = r301015 / r301020;
        return r301021;
}

double f(double x, double y) {
        double r301022 = x;
        double r301023 = y;
        double r301024 = r301022 + r301023;
        double r301025 = r301022 / r301024;
        double r301026 = r301025 / r301024;
        double r301027 = r301026 * r301023;
        double r301028 = 1.0;
        double r301029 = 1.0;
        double r301030 = r301024 + r301029;
        double r301031 = r301028 / r301030;
        double r301032 = r301027 * r301031;
        return r301032;
}

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.3
Target0.1
Herbie0.2
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}\]

Derivation

  1. Initial program 19.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. Using strategy rm
  3. Applied times-frac7.7

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

    \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \cdot \frac{y}{\left(x + y\right) + 1}\]
  6. Using strategy rm
  7. Applied div-inv0.2

    \[\leadsto \frac{\frac{x}{x + y}}{x + y} \cdot \color{blue}{\left(y \cdot \frac{1}{\left(x + y\right) + 1}\right)}\]
  8. Applied associate-*r*0.2

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

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

Reproduce

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