?

Average Accuracy: 68.7% → 99.8%
Time: 17.9s
Precision: binary64
Cost: 1088

?

\[\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}{x + y}}{x + y} \cdot \frac{y}{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 (+ x y)) (+ x y)) (/ y (+ 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 / (x + y)) / (x + y)) * (y / (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 / (x + y)) / (x + y)) * (y / (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 / (x + y)) / (x + y)) * (y / (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 / (x + y)) / (x + y)) * (y / (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(x + y)) / Float64(x + y)) * Float64(y / 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 / (x + y)) / (x + y)) * (y / (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[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $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}{x + y}}{x + y} \cdot \frac{y}{x + \left(y + 1\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original68.7%
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.7%

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

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

    [Start]68.7

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

    times-frac [=>]87.9

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

    /-rgt-identity [<=]87.9

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

    associate-/l/ [=>]87.9

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

    *-lft-identity [=>]87.9

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

    associate-+l+ [=>]87.9

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

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

    [Start]87.9

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

    associate-/r* [=>]99.8

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

    div-inv [=>]99.7

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

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

    [Start]99.7

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

    associate-*r/ [=>]99.8

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

    *-rgt-identity [=>]99.8

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

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

Alternatives

Alternative 1
Accuracy62.1%
Cost1360
\[\begin{array}{l} t_0 := \frac{y}{x + \left(y + 1\right)}\\ \mathbf{if}\;x \leq -7.5 \cdot 10^{+66}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{-45}:\\ \;\;\;\;\frac{t_0}{x}\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-112}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + 1}\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-157}:\\ \;\;\;\;t_0 \cdot \frac{1}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 2
Accuracy85.7%
Cost1352
\[\begin{array}{l} t_0 := \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{if}\;x \leq -1.08 \cdot 10^{+155}:\\ \;\;\;\;t_0 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -4.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{y}{y + 1}\\ \end{array} \]
Alternative 3
Accuracy60.3%
Cost1228
\[\begin{array}{l} t_0 := \frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x + y}\\ \mathbf{if}\;x \leq -2 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{-112}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + 1}\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-157}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 4
Accuracy60.5%
Cost1228
\[\begin{array}{l} t_0 := \frac{\frac{y}{x + \left(y + 1\right)}}{x + y \cdot 2}\\ \mathbf{if}\;x \leq -1.85 \cdot 10^{-65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + 1}\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-157}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 5
Accuracy68.9%
Cost1224
\[\begin{array}{l} \mathbf{if}\;x \leq -35000:\\ \;\;\;\;\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-157}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 6
Accuracy83.5%
Cost1092
\[\begin{array}{l} t_0 := \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{if}\;x \leq -96000:\\ \;\;\;\;t_0 \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{y}{y + 1}\\ \end{array} \]
Alternative 7
Accuracy54.3%
Cost980
\[\begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{-125}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-136}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-40}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3700:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
Alternative 8
Accuracy59.6%
Cost977
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-47}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-114} \lor \neg \left(x \leq -1.6 \cdot 10^{-149}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]
Alternative 9
Accuracy60.5%
Cost977
\[\begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+172}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-114} \lor \neg \left(x \leq -1.6 \cdot 10^{-149}\right):\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]
Alternative 10
Accuracy59.5%
Cost976
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-46}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -5.3 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \end{array} \]
Alternative 11
Accuracy59.7%
Cost976
\[\begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+173}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \end{array} \]
Alternative 12
Accuracy60.8%
Cost972
\[\begin{array}{l} t_0 := \frac{\frac{y}{x + \left(y + 1\right)}}{x}\\ \mathbf{if}\;x \leq -9.5 \cdot 10^{-46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + 1}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-149}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 13
Accuracy60.6%
Cost845
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-49}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-114} \lor \neg \left(x \leq -1.6 \cdot 10^{-149}\right):\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]
Alternative 14
Accuracy53.8%
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-186}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\ \end{array} \]
Alternative 15
Accuracy60.6%
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-113}:\\ \;\;\;\;x \cdot \frac{1}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 16
Accuracy60.6%
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-114}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + 1}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 17
Accuracy53.2%
Cost716
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 9 \cdot 10^{-187}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 18
Accuracy53.8%
Cost716
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-149}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-187}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 19
Accuracy45.1%
Cost584
\[\begin{array}{l} \mathbf{if}\;y \leq 1.46 \cdot 10^{-133}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.1:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
Alternative 20
Accuracy26.4%
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq -1700000:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 21
Accuracy34.7%
Cost324
\[\begin{array}{l} \mathbf{if}\;y \leq 1.46 \cdot 10^{-133}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 22
Accuracy4.2%
Cost192
\[\frac{0.5}{y} \]
Alternative 23
Accuracy4.2%
Cost192
\[\frac{1}{x} \]

Error

Reproduce?

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