Average Error: 20.1 → 0.1
Time: 4.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{x}{x + y} \cdot \frac{\frac{y}{x + 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{x}{x + y} \cdot \frac{\frac{y}{x + y}}{\left(x + y\right) + 1}
double f(double x, double y) {
        double r392498 = x;
        double r392499 = y;
        double r392500 = r392498 * r392499;
        double r392501 = r392498 + r392499;
        double r392502 = r392501 * r392501;
        double r392503 = 1.0;
        double r392504 = r392501 + r392503;
        double r392505 = r392502 * r392504;
        double r392506 = r392500 / r392505;
        return r392506;
}

double f(double x, double y) {
        double r392507 = x;
        double r392508 = y;
        double r392509 = r392507 + r392508;
        double r392510 = r392507 / r392509;
        double r392511 = r392508 / r392509;
        double r392512 = 1.0;
        double r392513 = r392509 + r392512;
        double r392514 = r392511 / r392513;
        double r392515 = r392510 * r392514;
        return r392515;
}

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
Herbie0.1
\[\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. 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 *-un-lft-identity7.9

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}\]
  6. Applied times-frac0.2

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{\left(x + y\right) + 1}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity0.1

    \[\leadsto \frac{\frac{\frac{x}{x + y} \cdot y}{x + y}}{\color{blue}{1 \cdot \left(\left(x + y\right) + 1\right)}}\]
  14. Applied *-un-lft-identity0.1

    \[\leadsto \frac{\frac{\frac{x}{x + y} \cdot y}{\color{blue}{1 \cdot \left(x + y\right)}}}{1 \cdot \left(\left(x + y\right) + 1\right)}\]
  15. Applied times-frac0.1

    \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{1} \cdot \frac{y}{x + y}}}{1 \cdot \left(\left(x + y\right) + 1\right)}\]
  16. Applied times-frac0.1

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

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

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

Reproduce

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