Average Error: 20.0 → 0.1
Time: 9.8s
Precision: binary64
\[[x, y]=\mathsf{sort}([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}{x + \left(1 + 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\right)}
\frac{\frac{x}{x + y} \cdot \frac{y}{x + \left(1 + y\right)}}{x + y}
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
 :precision binary64
 (/ (* (/ x (+ x y)) (/ y (+ x (+ 1.0 y)))) (+ x y)))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
double code(double x, double y) {
	return ((x / (x + y)) * (y / (x + (1.0 + y)))) / (x + y);
}

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-frac_binary64_113377.8

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

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

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

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

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

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

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

Reproduce

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

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

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