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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

    \[\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-rr0.1

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

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

Alternatives

Alternative 1
Error13.3
Cost1232
\[\begin{array}{l} t_0 := \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\ t_1 := \frac{x}{y \cdot \left(1 + y\right)}\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{-43}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{-104}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-80}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-29}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error6.2
Cost1224
\[\begin{array}{l} t_0 := \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\ \mathbf{if}\;x \leq -3.5 \cdot 10^{-11}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 13200000000:\\ \;\;\;\;\frac{\frac{y}{1 + y} \cdot \frac{x}{x + y}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error23.2
Cost1176
\[\begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ t_1 := \frac{x}{y} + \left(-x\right)\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -4.7 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 1.38 \cdot 10^{-154}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error23.3
Cost1112
\[\begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;y \leq -1:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-91}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error17.0
Cost1104
\[\begin{array}{l} t_0 := \frac{\frac{y}{1 + x}}{x + y}\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{+128}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + y}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{y \cdot \left(1 + y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error0.1
Cost1088
\[\frac{\frac{x}{x + y}}{\left(x + y\right) + 1} \cdot \frac{y}{x + y} \]
Alternative 7
Error17.5
Cost976
\[\begin{array}{l} t_0 := \frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{+128}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{+89}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + y}\\ \mathbf{elif}\;x \leq -2.2 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{y \cdot \left(1 + y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error30.3
Cost848
\[\begin{array}{l} t_0 := \frac{x}{x \cdot x}\\ \mathbf{if}\;x \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -7.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-105}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+147}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error22.0
Cost716
\[\begin{array}{l} t_0 := \frac{x}{x \cdot x}\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{+143}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{+83}:\\ \;\;\;\;\frac{x}{y \cdot \left(1 + y\right)}\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+147}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 10
Error16.9
Cost712
\[\begin{array}{l} t_0 := \frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{if}\;x \leq -4.1 \cdot 10^{-22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{y \cdot \left(1 + y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 11
Error36.8
Cost456
\[\begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-104}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]
Alternative 12
Error61.5
Cost192
\[\frac{-1}{y} \]
Alternative 13
Error61.3
Cost192
\[\frac{1}{x} \]
Alternative 14
Error61.3
Cost192
\[\frac{1}{y} \]
Alternative 15
Error47.2
Cost192
\[\frac{x}{y} \]

Error

Reproduce

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