Average Error: 19.7 → 0.1
Time: 5.2s
Precision: binary64
\[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
\[\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right) \cdot \frac{y}{x + \left(y + 1\right)}}{x + y} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
(FPCore (x y)
 :precision binary64
 (/ (* (log1p (expm1 (/ x (+ x y)))) (/ y (+ x (+ y 1.0)))) (+ 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 (log1p(expm1((x / (x + y)))) * (y / (x + (y + 1.0)))) / (x + y);
}
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 (Math.log1p(Math.expm1((x / (x + y)))) * (y / (x + (y + 1.0)))) / (x + y);
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
def code(x, y):
	return (math.log1p(math.expm1((x / (x + y)))) * (y / (x + (y + 1.0)))) / (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(log1p(expm1(Float64(x / Float64(x + y)))) * Float64(y / Float64(x + Float64(y + 1.0)))) / Float64(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[Log[1 + N[(Exp[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $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{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right) \cdot \frac{y}{x + \left(y + 1\right)}}{x + y}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original19.7
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.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. Applied times-frac_binary647.7

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
  3. Applied *-un-lft-identity_binary647.7

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
  4. Applied times-frac_binary640.2

    \[\leadsto \color{blue}{\left(\frac{1}{x + y} \cdot \frac{x}{x + y}\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
  5. Applied associate-*l*_binary640.2

    \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \left(\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) + 1}\right)} \]
  6. Applied associate-*l/_binary640.1

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

    \[\leadsto \frac{\color{blue}{\frac{x}{x + y} \cdot \frac{y}{x + \left(y + 1\right)}}}{x + y} \]
  8. Applied log1p-expm1-u_binary640.1

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

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

Reproduce

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