Average Error: 19.4 → 0.1
Time: 11.1s
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{\frac{y}{y + x}}{y + \left(x + 1\right)}}{1 + \frac{y}{x}} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
 :precision binary64
 (/ (/ (/ y (+ y x)) (+ y (+ x 1.0))) (+ 1.0 (/ y x))))
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)) / (y + (x + 1.0))) / (1.0 + (y / x));
}
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)) / (y + (x + 1.0d0))) / (1.0d0 + (y / x))
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)) / (y + (x + 1.0))) / (1.0 + (y / x));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
def code(x, y):
	return ((y / (y + x)) / (y + (x + 1.0))) / (1.0 + (y / x))
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(y + Float64(x + 1.0))) / Float64(1.0 + Float64(y / x)))
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)) / (y + (x + 1.0))) / (1.0 + (y / x));
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[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(y / x), $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{\frac{y}{y + x}}{y + \left(x + 1\right)}}{1 + \frac{y}{x}}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.4
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.4

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Applied egg-rr4.0

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

    \[\leadsto \color{blue}{\frac{\frac{\frac{y}{y + x}}{y + \left(1 + x\right)}}{\frac{y + x}{x}}} \]
  4. Taylor expanded in y around 0 0.1

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

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

Alternatives

Alternative 1
Error24.7
Cost976
\[\begin{array}{l} t_0 := \frac{y}{x + x \cdot x}\\ \mathbf{if}\;x \leq -2.1080825829203308 \cdot 10^{+160}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -3.611628364567811 \cdot 10^{-56}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.8319207263493204 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -3.8715047369174 \cdot 10^{-94}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 2
Error23.5
Cost968
\[\begin{array}{l} \mathbf{if}\;x \leq -2.1080825829203308 \cdot 10^{+160}:\\ \;\;\;\;\left(1 + y \cdot \frac{-3}{x}\right) \cdot \frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.674319430833147 \cdot 10^{-202}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 3
Error24.6
Cost964
\[\begin{array}{l} \mathbf{if}\;x \leq -3.611628364567811 \cdot 10^{-56}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;x \leq -1.8319207263493204 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -3.8715047369174 \cdot 10^{-94}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 4
Error24.6
Cost844
\[\begin{array}{l} \mathbf{if}\;x \leq -3.611628364567811 \cdot 10^{-56}:\\ \;\;\;\;\frac{\frac{y}{y + \left(x + 1\right)}}{x}\\ \mathbf{elif}\;x \leq -1.8319207263493204 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -3.8715047369174 \cdot 10^{-94}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 5
Error29.4
Cost716
\[\begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.983169468521767 \cdot 10^{-174}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.0610106048959159 \cdot 10^{-126}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error28.8
Cost716
\[\begin{array}{l} \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.983169468521767 \cdot 10^{-174}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq 1.0610106048959159 \cdot 10^{-126}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 7
Error24.2
Cost580
\[\begin{array}{l} \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 8
Error36.7
Cost452
\[\begin{array}{l} \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 9
Error36.3
Cost452
\[\begin{array}{l} \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 10
Error46.9
Cost324
\[\begin{array}{l} \mathbf{if}\;x \leq -40555178.4585701:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
Alternative 11
Error47.5
Cost192
\[\frac{x}{y} \]

Error

Reproduce

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