Data.Colour.SRGB:invTransferFunction from colour-2.3.3

Percentage Accurate: 100.0% → 100.0%
Time: 5.9s
Alternatives: 7
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{x + y}{y + 1} \end{array} \]
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
	return (x + y) / (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
public static double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
def code(x, y):
	return (x + y) / (y + 1.0)
function code(x, y)
	return Float64(Float64(x + y) / Float64(y + 1.0))
end
function tmp = code(x, y)
	tmp = (x + y) / (y + 1.0);
end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x + y}{y + 1}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 7 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x + y}{y + 1} \end{array} \]
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
	return (x + y) / (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
public static double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
def code(x, y):
	return (x + y) / (y + 1.0)
function code(x, y)
	return Float64(Float64(x + y) / Float64(y + 1.0))
end
function tmp = code(x, y)
	tmp = (x + y) / (y + 1.0);
end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x + y}{y + 1}
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x + y}{y + 1} \end{array} \]
(FPCore (x y) :precision binary64 (/ (+ x y) (+ y 1.0)))
double code(double x, double y) {
	return (x + y) / (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
public static double code(double x, double y) {
	return (x + y) / (y + 1.0);
}
def code(x, y):
	return (x + y) / (y + 1.0)
function code(x, y)
	return Float64(Float64(x + y) / Float64(y + 1.0))
end
function tmp = code(x, y)
	tmp = (x + y) / (y + 1.0);
end
code[x_, y_] := N[(N[(x + y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x + y}{y + 1}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{x + y}{y + 1} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 86.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3800000000 \lor \neg \left(y \leq 350\right):\\ \;\;\;\;1 + \frac{x + -1}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -3800000000.0) (not (<= y 350.0)))
   (+ 1.0 (/ (+ x -1.0) y))
   (/ x (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if ((y <= -3800000000.0) || !(y <= 350.0)) {
		tmp = 1.0 + ((x + -1.0) / y);
	} else {
		tmp = x / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-3800000000.0d0)) .or. (.not. (y <= 350.0d0))) then
        tmp = 1.0d0 + ((x + (-1.0d0)) / y)
    else
        tmp = x / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -3800000000.0) || !(y <= 350.0)) {
		tmp = 1.0 + ((x + -1.0) / y);
	} else {
		tmp = x / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -3800000000.0) or not (y <= 350.0):
		tmp = 1.0 + ((x + -1.0) / y)
	else:
		tmp = x / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -3800000000.0) || !(y <= 350.0))
		tmp = Float64(1.0 + Float64(Float64(x + -1.0) / y));
	else
		tmp = Float64(x / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -3800000000.0) || ~((y <= 350.0)))
		tmp = 1.0 + ((x + -1.0) / y);
	else
		tmp = x / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -3800000000.0], N[Not[LessEqual[y, 350.0]], $MachinePrecision]], N[(1.0 + N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3800000000 \lor \neg \left(y \leq 350\right):\\
\;\;\;\;1 + \frac{x + -1}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.8e9 or 350 < y

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 99.3%

      \[\leadsto \color{blue}{\left(1 + \frac{x}{y}\right) - \frac{1}{y}} \]
    4. Step-by-step derivation
      1. associate--l+99.3%

        \[\leadsto \color{blue}{1 + \left(\frac{x}{y} - \frac{1}{y}\right)} \]
      2. div-sub99.3%

        \[\leadsto 1 + \color{blue}{\frac{x - 1}{y}} \]
      3. sub-neg99.3%

        \[\leadsto 1 + \frac{\color{blue}{x + \left(-1\right)}}{y} \]
      4. metadata-eval99.3%

        \[\leadsto 1 + \frac{x + \color{blue}{-1}}{y} \]
    5. Simplified99.3%

      \[\leadsto \color{blue}{1 + \frac{x + -1}{y}} \]

    if -3.8e9 < y < 350

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 78.1%

      \[\leadsto \color{blue}{\frac{x}{1 + y}} \]
    4. Step-by-step derivation
      1. +-commutative78.1%

        \[\leadsto \frac{x}{\color{blue}{y + 1}} \]
    5. Simplified78.1%

      \[\leadsto \color{blue}{\frac{x}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification88.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3800000000 \lor \neg \left(y \leq 350\right):\\ \;\;\;\;1 + \frac{x + -1}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+84}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-9}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 19:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -8e+84) 1.0 (if (<= y -2.8e-9) (/ x y) (if (<= y 19.0) x 1.0))))
double code(double x, double y) {
	double tmp;
	if (y <= -8e+84) {
		tmp = 1.0;
	} else if (y <= -2.8e-9) {
		tmp = x / y;
	} else if (y <= 19.0) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-8d+84)) then
        tmp = 1.0d0
    else if (y <= (-2.8d-9)) then
        tmp = x / y
    else if (y <= 19.0d0) then
        tmp = x
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -8e+84) {
		tmp = 1.0;
	} else if (y <= -2.8e-9) {
		tmp = x / y;
	} else if (y <= 19.0) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -8e+84:
		tmp = 1.0
	elif y <= -2.8e-9:
		tmp = x / y
	elif y <= 19.0:
		tmp = x
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -8e+84)
		tmp = 1.0;
	elseif (y <= -2.8e-9)
		tmp = Float64(x / y);
	elseif (y <= 19.0)
		tmp = x;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -8e+84)
		tmp = 1.0;
	elseif (y <= -2.8e-9)
		tmp = x / y;
	elseif (y <= 19.0)
		tmp = x;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -8e+84], 1.0, If[LessEqual[y, -2.8e-9], N[(x / y), $MachinePrecision], If[LessEqual[y, 19.0], x, 1.0]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+84}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 19:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.00000000000000046e84 or 19 < y

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 81.7%

      \[\leadsto \color{blue}{1} \]

    if -8.00000000000000046e84 < y < -2.79999999999999984e-9

    1. Initial program 99.8%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 62.7%

      \[\leadsto \color{blue}{\frac{x}{1 + y}} \]
    4. Step-by-step derivation
      1. +-commutative62.7%

        \[\leadsto \frac{x}{\color{blue}{y + 1}} \]
    5. Simplified62.7%

      \[\leadsto \color{blue}{\frac{x}{y + 1}} \]
    6. Taylor expanded in y around inf 54.0%

      \[\leadsto \color{blue}{\frac{x}{y}} \]

    if -2.79999999999999984e-9 < y < 19

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 76.9%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 74.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{+86}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 17:\\ \;\;\;\;\frac{x}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -7.4e+86) 1.0 (if (<= y 17.0) (/ x (+ y 1.0)) (/ y (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (y <= -7.4e+86) {
		tmp = 1.0;
	} else if (y <= 17.0) {
		tmp = x / (y + 1.0);
	} else {
		tmp = y / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-7.4d+86)) then
        tmp = 1.0d0
    else if (y <= 17.0d0) then
        tmp = x / (y + 1.0d0)
    else
        tmp = y / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -7.4e+86) {
		tmp = 1.0;
	} else if (y <= 17.0) {
		tmp = x / (y + 1.0);
	} else {
		tmp = y / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -7.4e+86:
		tmp = 1.0
	elif y <= 17.0:
		tmp = x / (y + 1.0)
	else:
		tmp = y / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -7.4e+86)
		tmp = 1.0;
	elseif (y <= 17.0)
		tmp = Float64(x / Float64(y + 1.0));
	else
		tmp = Float64(y / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -7.4e+86)
		tmp = 1.0;
	elseif (y <= 17.0)
		tmp = x / (y + 1.0);
	else
		tmp = y / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -7.4e+86], 1.0, If[LessEqual[y, 17.0], N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.4 \cdot 10^{+86}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 17:\\
\;\;\;\;\frac{x}{y + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.39999999999999983e86

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 82.2%

      \[\leadsto \color{blue}{1} \]

    if -7.39999999999999983e86 < y < 17

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.4%

      \[\leadsto \color{blue}{\frac{x}{1 + y}} \]
    4. Step-by-step derivation
      1. +-commutative76.4%

        \[\leadsto \frac{x}{\color{blue}{y + 1}} \]
    5. Simplified76.4%

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

    if 17 < y

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 83.4%

      \[\leadsto \color{blue}{\frac{y}{1 + y}} \]
    4. Step-by-step derivation
      1. +-commutative83.4%

        \[\leadsto \frac{y}{\color{blue}{y + 1}} \]
    5. Simplified83.4%

      \[\leadsto \color{blue}{\frac{y}{y + 1}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 74.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+83}:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 450:\\ \;\;\;\;\frac{x}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -3.4e+83) 1.0 (if (<= y 450.0) (/ x (+ y 1.0)) 1.0)))
double code(double x, double y) {
	double tmp;
	if (y <= -3.4e+83) {
		tmp = 1.0;
	} else if (y <= 450.0) {
		tmp = x / (y + 1.0);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-3.4d+83)) then
        tmp = 1.0d0
    else if (y <= 450.0d0) then
        tmp = x / (y + 1.0d0)
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -3.4e+83) {
		tmp = 1.0;
	} else if (y <= 450.0) {
		tmp = x / (y + 1.0);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -3.4e+83:
		tmp = 1.0
	elif y <= 450.0:
		tmp = x / (y + 1.0)
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -3.4e+83)
		tmp = 1.0;
	elseif (y <= 450.0)
		tmp = Float64(x / Float64(y + 1.0));
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -3.4e+83)
		tmp = 1.0;
	elseif (y <= 450.0)
		tmp = x / (y + 1.0);
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -3.4e+83], 1.0, If[LessEqual[y, 450.0], N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+83}:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 450:\\
\;\;\;\;\frac{x}{y + 1}\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.3999999999999998e83 or 450 < y

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 81.7%

      \[\leadsto \color{blue}{1} \]

    if -3.3999999999999998e83 < y < 450

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.4%

      \[\leadsto \color{blue}{\frac{x}{1 + y}} \]
    4. Step-by-step derivation
      1. +-commutative76.4%

        \[\leadsto \frac{x}{\color{blue}{y + 1}} \]
    5. Simplified76.4%

      \[\leadsto \color{blue}{\frac{x}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 74.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1:\\ \;\;\;\;1\\ \mathbf{elif}\;y \leq 7.6:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y -1.0) 1.0 (if (<= y 7.6) x 1.0)))
double code(double x, double y) {
	double tmp;
	if (y <= -1.0) {
		tmp = 1.0;
	} else if (y <= 7.6) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-1.0d0)) then
        tmp = 1.0d0
    else if (y <= 7.6d0) then
        tmp = x
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -1.0) {
		tmp = 1.0;
	} else if (y <= 7.6) {
		tmp = x;
	} else {
		tmp = 1.0;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -1.0:
		tmp = 1.0
	elif y <= 7.6:
		tmp = x
	else:
		tmp = 1.0
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -1.0)
		tmp = 1.0;
	elseif (y <= 7.6)
		tmp = x;
	else
		tmp = 1.0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -1.0)
		tmp = 1.0;
	elseif (y <= 7.6)
		tmp = x;
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -1.0], 1.0, If[LessEqual[y, 7.6], x, 1.0]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;1\\

\mathbf{elif}\;y \leq 7.6:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1 or 7.5999999999999996 < y

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 75.8%

      \[\leadsto \color{blue}{1} \]

    if -1 < y < 7.5999999999999996

    1. Initial program 100.0%

      \[\frac{x + y}{y + 1} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 39.9% accurate, 7.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{x + y}{y + 1} \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf 41.2%

    \[\leadsto \color{blue}{1} \]
  4. Add Preprocessing

Reproduce

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