Average Error: 0.0 → 0.0
Time: 2.7s
Precision: binary64
\[\frac{x + y}{y + 1} \]
\[\frac{y + x}{y + 1} \]
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
(FPCore (x y) :precision binary64 (/ (+ y x) (+ y 1.0)))
double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
double code(double x, double y) {
	return (y + x) / (y + 1.0);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x + y) / (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)
end function
public static double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
public static double code(double x, double y) {
	return (y + x) / (y + 1.0);
}
def code(x, y):
	return (x + y) / (y + 1.0)
def code(x, y):
	return (y + x) / (y + 1.0)
function code(x, y)
	return Float64(Float64(x + y) / Float64(y + 1.0))
end
function code(x, y)
	return Float64(Float64(y + x) / Float64(y + 1.0))
end
function tmp = code(x, y)
	tmp = (x + y) / (y + 1.0);
end
function tmp = code(x, y)
	tmp = (y + x) / (y + 1.0);
end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(N[(y + x), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\frac{x + y}{y + 1}
\frac{y + x}{y + 1}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x + y}{y + 1} \]
  2. Applied div-inv_binary640.1

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

    \[\leadsto \left(x + y\right) \cdot \frac{1}{\color{blue}{\frac{y \cdot y - 1 \cdot 1}{y - 1}}} \]
  4. Applied associate-/r/_binary6415.5

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

    \[\leadsto \color{blue}{\left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) \cdot \left(y - 1\right)} \]
  6. Applied add-cube-cbrt_binary6415.5

    \[\leadsto \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) \cdot \left(y - \color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}\right) \]
  7. Applied add-cube-cbrt_binary6415.7

    \[\leadsto \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) \cdot \left(\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}} - \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}\right) \]
  8. Applied prod-diff_binary6415.7

    \[\leadsto \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{y} \cdot \sqrt[3]{y}, \sqrt[3]{y}, -\sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) + \mathsf{fma}\left(-\sqrt[3]{1}, \sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right)\right)} \]
  9. Applied distribute-rgt-in_binary6415.7

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt[3]{y} \cdot \sqrt[3]{y}, \sqrt[3]{y}, -\sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) + \mathsf{fma}\left(-\sqrt[3]{1}, \sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right)} \]
  10. Simplified0.0

    \[\leadsto \color{blue}{\frac{y + x}{y + 1}} + \mathsf{fma}\left(-\sqrt[3]{1}, \sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1} \cdot \left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right)\right) \cdot \left(\left(x + y\right) \cdot \frac{1}{y \cdot y - 1 \cdot 1}\right) \]
  11. Simplified0.0

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

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

Reproduce

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