Average Error: 0.1 → 0.1
Time: 12.9s
Precision: 64
$\frac{x + y}{x - y} - 3 \cdot x$
$\sqrt[3]{{\left(\frac{x + y}{x - y}\right)}^{3}} - 3 \cdot x$
\frac{x + y}{x - y} - 3 \cdot x
\sqrt[3]{{\left(\frac{x + y}{x - y}\right)}^{3}} - 3 \cdot x
double f(double x, double y) {
double r3476647 = x;
double r3476648 = y;
double r3476649 = r3476647 + r3476648;
double r3476650 = r3476647 - r3476648;
double r3476651 = r3476649 / r3476650;
double r3476652 = 3.0;
double r3476653 = r3476652 * r3476647;
double r3476654 = r3476651 - r3476653;
return r3476654;
}


double f(double x, double y) {
double r3476655 = x;
double r3476656 = y;
double r3476657 = r3476655 + r3476656;
double r3476658 = r3476655 - r3476656;
double r3476659 = r3476657 / r3476658;
double r3476660 = 3.0;
double r3476661 = pow(r3476659, r3476660);
double r3476662 = cbrt(r3476661);
double r3476663 = 3.0;
double r3476664 = r3476663 * r3476655;
double r3476665 = r3476662 - r3476664;
return r3476665;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 0.1

$\frac{x + y}{x - y} - 3 \cdot x$
2. Using strategy rm

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

$\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + y\right)}}}{\sqrt[3]{\left(\left(x - y\right) \cdot \left(x - y\right)\right) \cdot \left(x - y\right)}} - 3 \cdot x$
5. Applied cbrt-undiv42.4

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

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

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

# Reproduce

herbie shell --seed 1
(FPCore (x y)
:name "(x+y)/(x-y) - 3*x"
:precision binary64
(- (/ (+ x y) (- x y)) (* 3 x)))