Average Error: 20.0 → 0.1
Time: 4.3s
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 r397624 = x;
        double r397625 = y;
        double r397626 = r397624 * r397625;
        double r397627 = r397624 + r397625;
        double r397628 = r397627 * r397627;
        double r397629 = 1.0;
        double r397630 = r397627 + r397629;
        double r397631 = r397628 * r397630;
        double r397632 = r397626 / r397631;
        return r397632;
}

double f(double x, double y) {
        double r397633 = x;
        double r397634 = y;
        double r397635 = r397633 + r397634;
        double r397636 = r397633 / r397635;
        double r397637 = 1.0;
        double r397638 = r397635 + r397637;
        double r397639 = r397634 / r397638;
        double r397640 = r397636 * r397639;
        double r397641 = r397640 / r397635;
        return r397641;
}

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.0
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 20.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. Using strategy rm
  3. Applied times-frac7.9

    \[\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 2020018 +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))))