?

Average Accuracy: 68.1% → 99.8%
Time: 16.8s
Precision: binary64
Cost: 1088

?

\[ \begin{array}{c}[x, y] = \mathsf{sort}([x, y])\\ \end{array} \]
\[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
\[\frac{\frac{x \cdot \frac{y}{y + x}}{y + x}}{x + \left(y + 1\right)} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
 :precision binary64
 (/ (/ (* x (/ y (+ y x))) (+ y x)) (+ x (+ y 1.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
double code(double x, double y) {
	return ((x * (y / (y + x))) / (y + x)) / (x + (y + 1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x * (y / (y + x))) / (y + x)) / (x + (y + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
public static double code(double x, double y) {
	return ((x * (y / (y + x))) / (y + x)) / (x + (y + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
def code(x, y):
	return ((x * (y / (y + x))) / (y + x)) / (x + (y + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function code(x, y)
	return Float64(Float64(Float64(x * Float64(y / Float64(y + x))) / Float64(y + x)) / Float64(x + Float64(y + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
function tmp = code(x, y)
	tmp = ((x * (y / (y + x))) / (y + x)) / (x + (y + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(N[(x * N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\frac{\frac{x \cdot \frac{y}{y + x}}{y + x}}{x + \left(y + 1\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original68.1%
Target99.8%
Herbie99.8%
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \]

Derivation?

  1. Initial program 68.1%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Simplified73.2%

    \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{x + \left(y + 1\right)}} \]
    Proof

    [Start]68.1

    \[ \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]

    associate-/r* [=>]73.2

    \[ \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]

    associate-+l+ [=>]73.2

    \[ \frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Applied egg-rr99.8%

    \[\leadsto \frac{\color{blue}{\frac{x}{x + y} \cdot \frac{y}{x + y}}}{x + \left(y + 1\right)} \]
    Proof

    [Start]73.2

    \[ \frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{x + \left(y + 1\right)} \]

    times-frac [=>]99.8

    \[ \frac{\color{blue}{\frac{x}{x + y} \cdot \frac{y}{x + y}}}{x + \left(y + 1\right)} \]
  4. Simplified99.8%

    \[\leadsto \frac{\color{blue}{\frac{\frac{y}{x + y} \cdot x}{x + y}}}{x + \left(y + 1\right)} \]
    Proof

    [Start]99.8

    \[ \frac{\frac{x}{x + y} \cdot \frac{y}{x + y}}{x + \left(y + 1\right)} \]

    *-commutative [<=]99.8

    \[ \frac{\color{blue}{\frac{y}{x + y} \cdot \frac{x}{x + y}}}{x + \left(y + 1\right)} \]

    associate-*r/ [=>]99.8

    \[ \frac{\color{blue}{\frac{\frac{y}{x + y} \cdot x}{x + y}}}{x + \left(y + 1\right)} \]
  5. Final simplification99.8%

    \[\leadsto \frac{\frac{x \cdot \frac{y}{y + x}}{y + x}}{x + \left(y + 1\right)} \]

Alternatives

Alternative 1
Accuracy99.8%
Cost1088
\[\frac{\frac{y}{y + x}}{x + \left(y + 1\right)} \cdot \frac{x}{y + x} \]
Alternative 2
Accuracy73.1%
Cost980
\[\begin{array}{l} \mathbf{if}\;y \leq -1.66 \cdot 10^{-233}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{-189}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-165}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 6.3 \cdot 10^{-131}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 3
Accuracy80.2%
Cost976
\[\begin{array}{l} t_0 := \frac{y}{x + x \cdot x}\\ \mathbf{if}\;y \leq 2.6 \cdot 10^{-130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{-47}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+138}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 4
Accuracy71.4%
Cost849
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -9.6 \cdot 10^{-179} \lor \neg \left(x \leq 6.8 \cdot 10^{-196}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 5
Accuracy64.6%
Cost848
\[\begin{array}{l} \mathbf{if}\;y \leq 1.1 \cdot 10^{-189}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-165}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-130}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
Alternative 6
Accuracy80.3%
Cost844
\[\begin{array}{l} t_0 := \frac{y}{x + x \cdot x}\\ \mathbf{if}\;y \leq 2.9 \cdot 10^{-130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-47}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 7
Accuracy80.3%
Cost844
\[\begin{array}{l} t_0 := \frac{y}{x + x \cdot x}\\ \mathbf{if}\;y \leq 2.9 \cdot 10^{-130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-63}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 1.8 \cdot 10^{-47}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
Alternative 8
Accuracy81.4%
Cost836
\[\begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
Alternative 9
Accuracy77.0%
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.06 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \]
Alternative 10
Accuracy81.4%
Cost708
\[\begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
Alternative 11
Accuracy44.0%
Cost589
\[\begin{array}{l} \mathbf{if}\;y \leq 3.15 \cdot 10^{-189} \lor \neg \left(y \leq 3.9 \cdot 10^{-165}\right) \land y \leq 2.7 \cdot 10^{-130}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 12
Accuracy81.2%
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{-47}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
Alternative 13
Accuracy4.3%
Cost192
\[\frac{1}{x} \]
Alternative 14
Accuracy26.5%
Cost192
\[\frac{x}{y} \]

Error

Reproduce?

herbie shell --seed 2023140 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

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

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))