Average Error: 29.2 → 28.6
Time: 22.3s
Precision: 64
$\left(\sqrt{x - y} - \sqrt{x}\right) - \sqrt{-y}$
$\left(\sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}}\right) \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} - \sqrt{-y}$
\left(\sqrt{x - y} - \sqrt{x}\right) - \sqrt{-y}
\left(\sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}}\right) \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} - \sqrt{-y}
double f(double x, double y) {
double r1661604 = x;
double r1661605 = y;
double r1661606 = r1661604 - r1661605;
double r1661607 = sqrt(r1661606);
double r1661608 = sqrt(r1661604);
double r1661609 = r1661607 - r1661608;
double r1661610 = -r1661605;
double r1661611 = sqrt(r1661610);
double r1661612 = r1661609 - r1661611;
return r1661612;
}

double f(double x, double y) {
double r1661613 = y;
double r1661614 = -r1661613;
double r1661615 = x;
double r1661616 = r1661615 - r1661613;
double r1661617 = sqrt(r1661616);
double r1661618 = sqrt(r1661615);
double r1661619 = r1661617 + r1661618;
double r1661620 = r1661614 / r1661619;
double r1661621 = cbrt(r1661620);
double r1661622 = r1661621 * r1661621;
double r1661623 = r1661622 * r1661621;
double r1661624 = sqrt(r1661614);
double r1661625 = r1661623 - r1661624;
return r1661625;
}

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 29.2

$\left(\sqrt{x - y} - \sqrt{x}\right) - \sqrt{-y}$
2. Using strategy rm
3. Applied flip--29.2

$\leadsto \color{blue}{\frac{\sqrt{x - y} \cdot \sqrt{x - y} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x - y} + \sqrt{x}}} - \sqrt{-y}$
4. Simplified28.6

$\leadsto \frac{\color{blue}{\left(-y\right) + 0}}{\sqrt{x - y} + \sqrt{x}} - \sqrt{-y}$
5. Using strategy rm

$\leadsto \color{blue}{\left(\sqrt[3]{\frac{\left(-y\right) + 0}{\sqrt{x - y} + \sqrt{x}}} \cdot \sqrt[3]{\frac{\left(-y\right) + 0}{\sqrt{x - y} + \sqrt{x}}}\right) \cdot \sqrt[3]{\frac{\left(-y\right) + 0}{\sqrt{x - y} + \sqrt{x}}}} - \sqrt{-y}$
7. Simplified28.6

$\leadsto \color{blue}{\left(\sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}}\right)} \cdot \sqrt[3]{\frac{\left(-y\right) + 0}{\sqrt{x - y} + \sqrt{x}}} - \sqrt{-y}$
8. Simplified28.6

$\leadsto \left(\sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}} \cdot \sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}}\right) \cdot \color{blue}{\sqrt[3]{\frac{-y}{\sqrt{x - y} + \sqrt{x}}}} - \sqrt{-y}$
9. Final simplification28.6

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

# Reproduce

herbie shell --seed 1
(FPCore (x y)
:name "sqrt(x-y)-sqrt(x)-sqrt(-y)"
:precision binary64
(- (- (sqrt (- x y)) (sqrt x)) (sqrt (- y))))