Average Error: 19.9 → 0.2
Time: 15.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}}{x + y} \cdot \frac{y}{x + \left(1 + y\right)}\]
\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}}{x + y} \cdot \frac{y}{x + \left(1 + y\right)}
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
 :precision binary64
 (* (/ (/ x (+ x y)) (+ x y)) (/ y (+ x (+ 1.0 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)) / (x + y)) * (y / (x + (1.0 + 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

Original19.9
Target0.1
Herbie0.2
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}\]

Derivation

  1. Initial program 19.9

    \[\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_99738.2

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

    \[\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 clear-num_binary64_99668.4

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

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

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

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

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

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

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{1}{1}} \cdot \frac{x + y}{\frac{x}{x + y}}}} \cdot \frac{y}{x + \left(y + 1\right)}\]
  14. Applied add-sqr-sqrt_binary64_99890.5

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

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

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

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

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

Reproduce

herbie shell --seed 2021098 
(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))))