Average Error: 0.0 → 0.0
Time: 35.5s
Precision: binary64
Cost: 1024
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\frac{-x}{\left(x + y\right) + -2} - \frac{y}{2 - \left(x + y\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\frac{-x}{\left(x + y\right) + -2} - \frac{y}{2 - \left(x + y\right)}
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
(FPCore (x y)
 :precision binary64
 (- (/ (- x) (+ (+ x y) -2.0)) (/ y (- 2.0 (+ x y)))))
double code(double x, double y) {
	return (x - y) / (2.0 - (x + y));
}
double code(double x, double y) {
	return (-x / ((x + y) + -2.0)) - (y / (2.0 - (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

Original0.0
Target0.0
Herbie0.0
\[\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\]
Alternative 1
Accuracy0.7
Cost1408
\[\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{2 - \left(x + y\right)}{\sqrt[3]{x}}} - \frac{y}{2 - \left(x + y\right)}\]
Alternative 2
Accuracy0.8
Cost1920
\[\frac{\frac{x}{\sqrt[3]{2 - \left(x + y\right)} \cdot \sqrt[3]{2 - \left(x + y\right)}}}{\sqrt[3]{2 - \left(x + y\right)}} - \frac{y}{2 - \left(x + y\right)}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{2 - \left(x + y\right)}\]
  2. Using strategy rm
  3. Applied div-sub_binary64_198610.0

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

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

    \[\leadsto \frac{-x}{\color{blue}{\left(x + y\right) + -2}} - \frac{y}{2 - \left(x + y\right)}\]
  7. Final simplification0.0

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

Reproduce

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

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

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