Average Error: 0.0 → 0.0
Time: 18.1s
Precision: binary64
Cost: 448
\[\frac{x}{x + y}\]
\[\frac{-x}{\left(-x\right) - y}\]
\frac{x}{x + y}
\frac{-x}{\left(-x\right) - y}
(FPCore (x y) :precision binary64 (/ x (+ x y)))
(FPCore (x y) :precision binary64 (/ (- x) (- (- x) y)))
double code(double x, double y) {
	return x / (x + y);
}
double code(double x, double y) {
	return -x / (-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
Alternative 1
Accuracy0.4
Cost448
\[\frac{1}{\frac{x + y}{x}}\]
Alternative 2
Accuracy0.6
Cost1280
\[\sqrt[3]{\frac{x}{x + y}} \cdot \left(\sqrt[3]{\frac{x}{x + y}} \cdot \sqrt[3]{\frac{x}{x + y}}\right)\]
Alternative 3
Accuracy1.2
Cost768
\[\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \frac{\sqrt[3]{x}}{x + y}\]
Alternative 4
Accuracy31.6
Cost576
\[\frac{\sqrt{x}}{\frac{x + y}{\sqrt{x}}}\]

Derivation

  1. Initial program 0.0

    \[\frac{x}{x + y}\]
  2. Using strategy rm
  3. Applied pow1_binary64_93460.0

    \[\leadsto \color{blue}{{\left(\frac{x}{x + y}\right)}^{1}}\]
  4. Using strategy rm
  5. Applied pow1_binary64_93460.0

    \[\leadsto {\color{blue}{\left({\left(\frac{x}{x + y}\right)}^{1}\right)}}^{1}\]
  6. Using strategy rm
  7. Applied frac-2neg_binary64_92960.0

    \[\leadsto {\left({\color{blue}{\left(\frac{-x}{-\left(x + y\right)}\right)}}^{1}\right)}^{1}\]
  8. Simplified0.0

    \[\leadsto {\left({\left(\frac{-x}{\color{blue}{\left(-x\right) - y}}\right)}^{1}\right)}^{1}\]
  9. Final simplification0.0

    \[\leadsto \frac{-x}{\left(-x\right) - y}\]

Reproduce

herbie shell --seed 2020322 
(FPCore (x y)
  :name "AI.Clustering.Hierarchical.Internal:average from clustering-0.2.1, A"
  :precision binary64
  (/ x (+ x y)))