Average Error: 0.0 → 0.0
Time: 2.6s
Precision: binary64
\[\frac{x - y}{x + y} \]
\[\begin{array}{l} t_0 := \frac{x - y}{x + y}\\ \sqrt[3]{t_0} \cdot \sqrt[3]{{t_0}^{2}} \end{array} \]
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y)))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (- x y) (+ x y)))) (* (cbrt t_0) (cbrt (pow t_0 2.0)))))
double code(double x, double y) {
	return (x - y) / (x + y);
}
double code(double x, double y) {
	double t_0 = (x - y) / (x + y);
	return cbrt(t_0) * cbrt(pow(t_0, 2.0));
}
public static double code(double x, double y) {
	return (x - y) / (x + y);
}
public static double code(double x, double y) {
	double t_0 = (x - y) / (x + y);
	return Math.cbrt(t_0) * Math.cbrt(Math.pow(t_0, 2.0));
}
function code(x, y)
	return Float64(Float64(x - y) / Float64(x + y))
end
function code(x, y)
	t_0 = Float64(Float64(x - y) / Float64(x + y))
	return Float64(cbrt(t_0) * cbrt((t_0 ^ 2.0)))
end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[t$95$0, 1/3], $MachinePrecision] * N[Power[N[Power[t$95$0, 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]]
\frac{x - y}{x + y}
\begin{array}{l}
t_0 := \frac{x - y}{x + y}\\
\sqrt[3]{t_0} \cdot \sqrt[3]{{t_0}^{2}}
\end{array}

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}{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]{\frac{x - y}{x + y}} \cdot \sqrt[3]{{\left(\frac{x - y}{x + y}\right)}^{2}}} \]
  3. Final simplification0.0

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

Reproduce

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