Average Error: 19.4 → 0.1
Time: 9.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.0\right)}\]
\[\frac{\frac{\frac{y}{x + y} \cdot x}{x + \left(1.0 + y\right)}}{x + y}\]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1.0\right)}
\frac{\frac{\frac{y}{x + y} \cdot x}{x + \left(1.0 + y\right)}}{x + y}
double f(double x, double y) {
        double r8931123 = x;
        double r8931124 = y;
        double r8931125 = r8931123 * r8931124;
        double r8931126 = r8931123 + r8931124;
        double r8931127 = r8931126 * r8931126;
        double r8931128 = 1.0;
        double r8931129 = r8931126 + r8931128;
        double r8931130 = r8931127 * r8931129;
        double r8931131 = r8931125 / r8931130;
        return r8931131;
}

double f(double x, double y) {
        double r8931132 = y;
        double r8931133 = x;
        double r8931134 = r8931133 + r8931132;
        double r8931135 = r8931132 / r8931134;
        double r8931136 = r8931135 * r8931133;
        double r8931137 = 1.0;
        double r8931138 = r8931137 + r8931132;
        double r8931139 = r8931133 + r8931138;
        double r8931140 = r8931136 / r8931139;
        double r8931141 = r8931140 / r8931134;
        return r8931141;
}

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.4
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.4

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1.0\right)}\]
  2. Using strategy rm
  3. Applied times-frac7.8

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1.0}}\]
  4. Using strategy rm
  5. Applied *-un-lft-identity7.8

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1.0}\]
  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.0}\]
  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.0}\right)}\]
  8. Using strategy rm
  9. Applied div-inv0.2

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

    \[\leadsto \frac{1}{x + y} \cdot \color{blue}{\left(\left(\frac{x}{x + y} \cdot y\right) \cdot \frac{1}{\left(x + y\right) + 1.0}\right)}\]
  11. Using strategy rm
  12. Applied associate-*l/15.4

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

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

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

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

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

Reproduce

herbie shell --seed 2019156 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"

  :herbie-target
  (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))