Average Error: 19.6 → 0.1
Time: 15.7s
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 + y} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}\]
\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 + y} \cdot \frac{y}{\left(x + y\right) + 1}}{x + y}
double f(double x, double y) {
        double r256037 = x;
        double r256038 = y;
        double r256039 = r256037 * r256038;
        double r256040 = r256037 + r256038;
        double r256041 = r256040 * r256040;
        double r256042 = 1.0;
        double r256043 = r256040 + r256042;
        double r256044 = r256041 * r256043;
        double r256045 = r256039 / r256044;
        return r256045;
}

double f(double x, double y) {
        double r256046 = x;
        double r256047 = y;
        double r256048 = r256046 + r256047;
        double r256049 = r256046 / r256048;
        double r256050 = 1.0;
        double r256051 = r256048 + r256050;
        double r256052 = r256047 / r256051;
        double r256053 = r256049 * r256052;
        double r256054 = r256053 / r256048;
        return r256054;
}

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

Derivation

  1. Initial program 19.6

    \[\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 associate-*l/0.1

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

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

Reproduce

herbie shell --seed 2019325 +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))))