?

Average Accuracy: 69.7% → 99.8%
Time: 14.6s
Precision: binary64
Cost: 1088.00

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original69.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 69.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. Simplified74.5%

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

    [Start]69.7

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

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

    associate-+l+ [=>]74.5

    \[ \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 \color{blue}{\frac{\frac{x}{x + y}}{1} \cdot \frac{\frac{y}{x + y}}{y + \left(x + 1\right)}} \]
  4. Final simplification99.8%

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

Alternatives

Alternative 1
Accuracy95.3%
Cost1352.00
\[\begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-203}:\\ \;\;\;\;\frac{\frac{y}{x + y \cdot 2}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+139}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \frac{y + \left(x + 1\right)}{\frac{y}{x + y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + y}\\ \end{array} \]
Alternative 2
Accuracy83.3%
Cost1229.00
\[\begin{array}{l} t_0 := x + \left(y + 1\right)\\ \mathbf{if}\;y \leq 9.5 \cdot 10^{-81} \lor \neg \left(y \leq 1.35 \cdot 10^{-40}\right) \land y \leq 1.16 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{y}{x + y \cdot 2}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t_0}\\ \end{array} \]
Alternative 3
Accuracy99.8%
Cost1088.00
\[\frac{\frac{x}{x + y} \cdot \frac{y}{x + y}}{x + \left(y + 1\right)} \]
Alternative 4
Accuracy99.8%
Cost1088.00
\[\frac{\frac{x \cdot \frac{y}{x + y}}{x + y}}{x + \left(y + 1\right)} \]
Alternative 5
Accuracy81.4%
Cost976.00
\[\begin{array}{l} t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\ t_1 := \frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{if}\;y \leq 7.6 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.52 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-30}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+16}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 6
Accuracy83.0%
Cost973.00
\[\begin{array}{l} \mathbf{if}\;y \leq 9.5 \cdot 10^{-81} \lor \neg \left(y \leq 1.22 \cdot 10^{-40}\right) \land y \leq 4.2 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
Alternative 7
Accuracy78.6%
Cost844.00
\[\begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-141}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 1.06 \cdot 10^{+32}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 8
Accuracy77.3%
Cost844.00
\[\begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{-106}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-84}:\\ \;\;\;\;\frac{x}{x \cdot \frac{x}{y}}\\ \mathbf{elif}\;y \leq 10^{+18}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 9
Accuracy77.4%
Cost844.00
\[\begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{-106}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{-83}:\\ \;\;\;\;\frac{x}{\frac{x}{\frac{y}{x}}}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 10
Accuracy81.4%
Cost844.00
\[\begin{array}{l} t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{if}\;y \leq 7.4 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-40}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-30}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 11
Accuracy82.7%
Cost844.00
\[\begin{array}{l} t_0 := \frac{\frac{y}{x + 1}}{x}\\ \mathbf{if}\;y \leq 8 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-40}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-30}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
Alternative 12
Accuracy68.9%
Cost716.00
\[\begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{-106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-206}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-31}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
Alternative 13
Accuracy70.9%
Cost716.00
\[\begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -1.45 \cdot 10^{-106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-208}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-31}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
Alternative 14
Accuracy60.0%
Cost452.00
\[\begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-30}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
Alternative 15
Accuracy27.8%
Cost324.00
\[\begin{array}{l} \mathbf{if}\;y \leq 1.28 \cdot 10^{+51}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y}\\ \end{array} \]
Alternative 16
Accuracy4.3%
Cost192.00
\[\frac{1}{x} \]

Error

Reproduce?

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