Average Error: 20.2 → 0.2
Time: 1.8m
Precision: 64
Internal precision: 128
\[\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{x}{x + y}}{x + y} \cdot \frac{1}{\frac{\left(x + y\right) + 1.0}{y}}\]

Error

Bits error versus x

Bits error versus y

Target

Original20.2
Comparison0.1
Herbie0.2
\[ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \]

Derivation

  1. Initial program 20.2

    \[\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-frac 8.3

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1.0}}\]
  4. Applied simplify 8.3

    \[\leadsto \color{blue}{\frac{x}{{\left(x + y\right)}^2}} \cdot \frac{y}{\left(x + y\right) + 1.0}\]
  5. Using strategy rm
  6. Applied square-mult 8.3

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

    \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \cdot \frac{y}{\left(x + y\right) + 1.0}\]
  8. Using strategy rm
  9. Applied clear-num 0.2

    \[\leadsto \frac{\frac{x}{x + y}}{x + y} \cdot \color{blue}{\frac{1}{\frac{\left(x + y\right) + 1.0}{y}}}\]
  10. Removed slow pow expressions

Runtime

Time bar (total: 1.8m) Debug log

Please include this information when filing a bug report:

herbie --seed '#(3037232831 4258294691 765747702 3248166414 2333810255 2848238220)'
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"

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

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