?

Average Error: 19.5 → 0.1
Time: 14.6s
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{y}{y + x} \cdot \frac{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
 (/ (* (/ y (+ y x)) (/ 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 ((y / (y + x)) * (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 = ((y / (y + x)) * (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 ((y / (y + x)) * (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 ((y / (y + x)) * (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(y / Float64(y + x)) * Float64(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 = ((y / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $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{y}{y + x} \cdot \frac{x}{y + x}}{x + \left(y + 1\right)}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.5
Target0.1
Herbie0.1
\[\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \]

Derivation?

  1. Initial program 19.5

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

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

    [Start]19.5

    \[ \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* [=>]16.4

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

    associate-+l+ [=>]16.4

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

    \[\leadsto \frac{\color{blue}{\frac{y}{x + y} \cdot \frac{x}{x + y}}}{x + \left(y + 1\right)} \]
  4. Final simplification0.1

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

Alternatives

Alternative 1
Error18.5
Cost1352
\[\begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+81}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{-1 - \left(y + x\right)} \cdot \frac{-y}{x}\\ \mathbf{elif}\;x \leq -4.1 \cdot 10^{-136}:\\ \;\;\;\;\frac{x}{\frac{y + \left(x + 1\right)}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
Alternative 2
Error21.9
Cost1156
\[\begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{-101}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{-1 - \left(y + x\right)} \cdot \frac{-y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
Alternative 3
Error29.7
Cost980
\[\begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-38}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.42 \cdot 10^{-129}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-182}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error29.3
Cost980
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-36}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{-129}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.14 \cdot 10^{-181}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 5
Error28.8
Cost980
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-36}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-73}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{-129}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{-183}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 6
Error24.5
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.6 \cdot 10^{-37}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 7
Error24.5
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.4 \cdot 10^{-37}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 8
Error23.9
Cost836
\[\begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-39}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
Alternative 9
Error28.1
Cost716
\[\begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{+130}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-154}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3000000:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error24.4
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 11
Error24.0
Cost708
\[\begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
Alternative 12
Error24.1
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -8.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 13
Error24.1
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{-38}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 14
Error46.6
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq -2.3:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 15
Error42.0
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-129}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 16
Error61.3
Cost192
\[\frac{1}{x} \]

Error

Reproduce?

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