Average Error: 0.0 → 0.1
Time: 3.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{3}\]
\frac{x - y}{x + y}
{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{3}
double code(double x, double y) {
	return ((x - y) / (x + y));
}
double code(double x, double y) {
	return pow(cbrt(((x - y) / (x + y))), 3.0);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.1
\[\frac{x}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y}\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.1

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{x - y}{x + y}} \cdot \sqrt[3]{\frac{x - y}{x + y}}\right) \cdot \sqrt[3]{\frac{x - y}{x + y}}}\]
  4. Using strategy rm
  5. Applied pow10.1

    \[\leadsto \left(\sqrt[3]{\frac{x - y}{x + y}} \cdot \sqrt[3]{\frac{x - y}{x + y}}\right) \cdot \color{blue}{{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}}\]
  6. Applied pow10.1

    \[\leadsto \left(\sqrt[3]{\frac{x - y}{x + y}} \cdot \color{blue}{{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}}\right) \cdot {\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}\]
  7. Applied pow10.1

    \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}} \cdot {\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}\right) \cdot {\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}\]
  8. Applied pow-prod-up0.1

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{\left(1 + 1\right)}} \cdot {\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{1}\]
  9. Applied pow-prod-up0.1

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

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

    \[\leadsto {\left(\sqrt[3]{\frac{x - y}{x + y}}\right)}^{3}\]

Reproduce

herbie shell --seed 2020106 
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"
  :precision binary64

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

  (/ (- x y) (+ x y)))