Average Error: 0.0 → 0.0
Time: 2.9s
Precision: binary64
Cost: 448
\[\frac{x + y}{y + 1}\]
\[\frac{x + y}{y + 1}\]
\frac{x + y}{y + 1}
\frac{x + y}{y + 1}
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
double code(double x, double y) {
	return (x + y) / (y + 1.0);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error9.1
Cost1411
\[\begin{array}{l} \mathbf{if}\;y \leq -1.2346915981851615 \cdot 10^{+76}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -0.00037778364174226043:\\ \;\;\;\;\frac{x}{y + 1}\\ \mathbf{elif}\;y \leq 1.2290925707053888 \cdot 10^{-05}:\\ \;\;\;\;\left(x + y\right) - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{y + 1}\\ \end{array}\]
Alternative 2
Error16.5
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -1.1714857662411853 \cdot 10^{+69}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 2.279878240484341 \cdot 10^{+38}:\\ \;\;\;\;\frac{x}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{y + 1}\\ \end{array}\]
Alternative 3
Error16.5
Cost962
\[\begin{array}{l} \mathbf{if}\;y \leq -2.7406453774234723 \cdot 10^{+71}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 9.5249596376614 \cdot 10^{+37}:\\ \;\;\;\;\frac{x}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 4
Error16.6
Cost706
\[\begin{array}{l} \mathbf{if}\;y \leq -0.9932087216252541:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 0.023573285855887097:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 5
Error39.6
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.0

    \[\frac{x + y}{y + 1}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{x + y}{1 + y}}\]
  3. Final simplification0.0

    \[\leadsto \frac{x + y}{y + 1}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x y)
  :name "Data.Colour.SRGB:invTransferFunction from colour-2.3.3"
  :precision binary64
  (/ (+ x y) (+ y 1.0)))