Average Error: 0.0 → 0.0
Time: 4.0s
Precision: binary64
Cost: 13312
\[\frac{x - y}{x + y} \]
\[\sqrt[3]{{\left(\frac{x - y}{x + y}\right)}^{3}} \]
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y)))
(FPCore (x y) :precision binary64 (cbrt (pow (/ (- x y) (+ x y)) 3.0)))
double code(double x, double y) {
	return (x - y) / (x + y);
}
double code(double x, double y) {
	return cbrt(pow(((x - y) / (x + y)), 3.0));
}
public static double code(double x, double y) {
	return (x - y) / (x + y);
}
public static double code(double x, double y) {
	return Math.cbrt(Math.pow(((x - y) / (x + y)), 3.0));
}
function code(x, y)
	return Float64(Float64(x - y) / Float64(x + y))
end
function code(x, y)
	return cbrt((Float64(Float64(x - y) / Float64(x + y)) ^ 3.0))
end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[Power[N[Power[N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]
\frac{x - y}{x + y}
\sqrt[3]{{\left(\frac{x - y}{x + y}\right)}^{3}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y} \]
  2. Applied egg-rr0.0

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

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

Alternatives

Alternative 1
Error17.2
Cost1240
\[\begin{array}{l} t_0 := 1 + -2 \cdot \frac{y}{x}\\ \mathbf{if}\;y \leq -3.563243647930472 \cdot 10^{+93}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -1.0376794548657044 \cdot 10^{+81}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -261.55216085306904:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -4.1810103471523726 \cdot 10^{-88}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -5.11892908021761 \cdot 10^{-119}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 2.7938966266030838 \cdot 10^{+91}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 2
Error16.9
Cost1240
\[\begin{array}{l} t_0 := 2 \cdot \frac{x}{y} + -1\\ t_1 := 1 + -2 \cdot \frac{y}{x}\\ \mathbf{if}\;y \leq -3.563243647930472 \cdot 10^{+93}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -1.0376794548657044 \cdot 10^{+81}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -261.55216085306904:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -4.1810103471523726 \cdot 10^{-88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.11892908021761 \cdot 10^{-119}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.7938966266030838 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error18.0
Cost856
\[\begin{array}{l} \mathbf{if}\;y \leq -3.563243647930472 \cdot 10^{+93}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -1.0376794548657044 \cdot 10^{+81}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -2.28443306424693 \cdot 10^{-53}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq -4.1810103471523726 \cdot 10^{-88}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -5.11892908021761 \cdot 10^{-119}:\\ \;\;\;\;-1\\ \mathbf{elif}\;y \leq 4.52455093276619 \cdot 10^{+75}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 4
Error0.0
Cost448
\[\frac{x - y}{x + y} \]
Alternative 5
Error33.1
Cost64
\[-1 \]

Error

Reproduce

herbie shell --seed 2022325 
(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)))