
(FPCore (x y) :precision binary64 (/ (* x (+ (/ x y) 1.0)) (+ x 1.0)))
double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * ((x / y) + 1.0d0)) / (x + 1.0d0)
end function
public static double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
def code(x, y): return (x * ((x / y) + 1.0)) / (x + 1.0)
function code(x, y) return Float64(Float64(x * Float64(Float64(x / y) + 1.0)) / Float64(x + 1.0)) end
function tmp = code(x, y) tmp = (x * ((x / y) + 1.0)) / (x + 1.0); end
code[x_, y_] := N[(N[(x * N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x (+ (/ x y) 1.0)) (+ x 1.0)))
double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * ((x / y) + 1.0d0)) / (x + 1.0d0)
end function
public static double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
def code(x, y): return (x * ((x / y) + 1.0)) / (x + 1.0)
function code(x, y) return Float64(Float64(x * Float64(Float64(x / y) + 1.0)) / Float64(x + 1.0)) end
function tmp = code(x, y) tmp = (x * ((x / y) + 1.0)) / (x + 1.0); end
code[x_, y_] := N[(N[(x * N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ 1.0 (/ x y))))
(if (or (<= x -2e+66) (not (<= x 28000000000.0)))
(+ t_0 (/ -1.0 y))
(/ (* x t_0) (+ x 1.0)))))
double code(double x, double y) {
double t_0 = 1.0 + (x / y);
double tmp;
if ((x <= -2e+66) || !(x <= 28000000000.0)) {
tmp = t_0 + (-1.0 / y);
} else {
tmp = (x * t_0) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (x / y)
if ((x <= (-2d+66)) .or. (.not. (x <= 28000000000.0d0))) then
tmp = t_0 + ((-1.0d0) / y)
else
tmp = (x * t_0) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (x / y);
double tmp;
if ((x <= -2e+66) || !(x <= 28000000000.0)) {
tmp = t_0 + (-1.0 / y);
} else {
tmp = (x * t_0) / (x + 1.0);
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x / y) tmp = 0 if (x <= -2e+66) or not (x <= 28000000000.0): tmp = t_0 + (-1.0 / y) else: tmp = (x * t_0) / (x + 1.0) return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x / y)) tmp = 0.0 if ((x <= -2e+66) || !(x <= 28000000000.0)) tmp = Float64(t_0 + Float64(-1.0 / y)); else tmp = Float64(Float64(x * t_0) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x / y); tmp = 0.0; if ((x <= -2e+66) || ~((x <= 28000000000.0))) tmp = t_0 + (-1.0 / y); else tmp = (x * t_0) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -2e+66], N[Not[LessEqual[x, 28000000000.0]], $MachinePrecision]], N[(t$95$0 + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{x}{y}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+66} \lor \neg \left(x \leq 28000000000\right):\\
\;\;\;\;t_0 + \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot t_0}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (+ (/ x (+ y (/ y x))) (/ 1.0 (+ 1.0 (/ 1.0 x)))))
double code(double x, double y) {
return (x / (y + (y / x))) + (1.0 / (1.0 + (1.0 / x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (y + (y / x))) + (1.0d0 / (1.0d0 + (1.0d0 / x)))
end function
public static double code(double x, double y) {
return (x / (y + (y / x))) + (1.0 / (1.0 + (1.0 / x)));
}
def code(x, y): return (x / (y + (y / x))) + (1.0 / (1.0 + (1.0 / x)))
function code(x, y) return Float64(Float64(x / Float64(y + Float64(y / x))) + Float64(1.0 / Float64(1.0 + Float64(1.0 / x)))) end
function tmp = code(x, y) tmp = (x / (y + (y / x))) + (1.0 / (1.0 + (1.0 / x))); end
code[x_, y_] := N[(N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + \frac{y}{x}} + \frac{1}{1 + \frac{1}{x}}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (/ x (+ y (/ y x))))) (if (or (<= x -9.5) (not (<= x 3.9e+39))) t_0 (+ x t_0))))
double code(double x, double y) {
double t_0 = x / (y + (y / x));
double tmp;
if ((x <= -9.5) || !(x <= 3.9e+39)) {
tmp = t_0;
} else {
tmp = x + t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = x / (y + (y / x))
if ((x <= (-9.5d0)) .or. (.not. (x <= 3.9d+39))) then
tmp = t_0
else
tmp = x + t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y + (y / x));
double tmp;
if ((x <= -9.5) || !(x <= 3.9e+39)) {
tmp = t_0;
} else {
tmp = x + t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y + (y / x)) tmp = 0 if (x <= -9.5) or not (x <= 3.9e+39): tmp = t_0 else: tmp = x + t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y + Float64(y / x))) tmp = 0.0 if ((x <= -9.5) || !(x <= 3.9e+39)) tmp = t_0; else tmp = Float64(x + t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y + (y / x)); tmp = 0.0; if ((x <= -9.5) || ~((x <= 3.9e+39))) tmp = t_0; else tmp = x + t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -9.5], N[Not[LessEqual[x, 3.9e+39]], $MachinePrecision]], t$95$0, N[(x + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + \frac{y}{x}}\\
\mathbf{if}\;x \leq -9.5 \lor \neg \left(x \leq 3.9 \cdot 10^{+39}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x + t_0\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -8000.0) (not (<= x 13500.0))) (+ (+ 1.0 (/ x y)) (/ -1.0 y)) (+ x (/ x (+ y (/ y x))))))
double code(double x, double y) {
double tmp;
if ((x <= -8000.0) || !(x <= 13500.0)) {
tmp = (1.0 + (x / y)) + (-1.0 / y);
} else {
tmp = x + (x / (y + (y / x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-8000.0d0)) .or. (.not. (x <= 13500.0d0))) then
tmp = (1.0d0 + (x / y)) + ((-1.0d0) / y)
else
tmp = x + (x / (y + (y / x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -8000.0) || !(x <= 13500.0)) {
tmp = (1.0 + (x / y)) + (-1.0 / y);
} else {
tmp = x + (x / (y + (y / x)));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -8000.0) or not (x <= 13500.0): tmp = (1.0 + (x / y)) + (-1.0 / y) else: tmp = x + (x / (y + (y / x))) return tmp
function code(x, y) tmp = 0.0 if ((x <= -8000.0) || !(x <= 13500.0)) tmp = Float64(Float64(1.0 + Float64(x / y)) + Float64(-1.0 / y)); else tmp = Float64(x + Float64(x / Float64(y + Float64(y / x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -8000.0) || ~((x <= 13500.0))) tmp = (1.0 + (x / y)) + (-1.0 / y); else tmp = x + (x / (y + (y / x))); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -8000.0], N[Not[LessEqual[x, 13500.0]], $MachinePrecision]], N[(N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8000 \lor \neg \left(x \leq 13500\right):\\
\;\;\;\;\left(1 + \frac{x}{y}\right) + \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{x}{y + \frac{y}{x}}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -1.0) (not (<= x 280.0))) (/ x y) (+ x (/ x (/ y x)))))
double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 280.0)) {
tmp = x / y;
} else {
tmp = x + (x / (y / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 280.0d0))) then
tmp = x / y
else
tmp = x + (x / (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 280.0)) {
tmp = x / y;
} else {
tmp = x + (x / (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.0) or not (x <= 280.0): tmp = x / y else: tmp = x + (x / (y / x)) return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.0) || !(x <= 280.0)) tmp = Float64(x / y); else tmp = Float64(x + Float64(x / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.0) || ~((x <= 280.0))) tmp = x / y; else tmp = x + (x / (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 280.0]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(x + N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 280\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{x}{\frac{y}{x}}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -5.7e-10) (not (<= x 1.05e-17))) (/ x (+ y (/ y x))) (+ x (/ x (/ y x)))))
double code(double x, double y) {
double tmp;
if ((x <= -5.7e-10) || !(x <= 1.05e-17)) {
tmp = x / (y + (y / x));
} else {
tmp = x + (x / (y / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-5.7d-10)) .or. (.not. (x <= 1.05d-17))) then
tmp = x / (y + (y / x))
else
tmp = x + (x / (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -5.7e-10) || !(x <= 1.05e-17)) {
tmp = x / (y + (y / x));
} else {
tmp = x + (x / (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -5.7e-10) or not (x <= 1.05e-17): tmp = x / (y + (y / x)) else: tmp = x + (x / (y / x)) return tmp
function code(x, y) tmp = 0.0 if ((x <= -5.7e-10) || !(x <= 1.05e-17)) tmp = Float64(x / Float64(y + Float64(y / x))); else tmp = Float64(x + Float64(x / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -5.7e-10) || ~((x <= 1.05e-17))) tmp = x / (y + (y / x)); else tmp = x + (x / (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -5.7e-10], N[Not[LessEqual[x, 1.05e-17]], $MachinePrecision]], N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.7 \cdot 10^{-10} \lor \neg \left(x \leq 1.05 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y + \frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{x}{\frac{y}{x}}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (/ (+ 1.0 (/ x y)) (- (/ 1.0 x) -1.0)))
double code(double x, double y) {
return (1.0 + (x / y)) / ((1.0 / x) - -1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + (x / y)) / ((1.0d0 / x) - (-1.0d0))
end function
public static double code(double x, double y) {
return (1.0 + (x / y)) / ((1.0 / x) - -1.0);
}
def code(x, y): return (1.0 + (x / y)) / ((1.0 / x) - -1.0)
function code(x, y) return Float64(Float64(1.0 + Float64(x / y)) / Float64(Float64(1.0 / x) - -1.0)) end
function tmp = code(x, y) tmp = (1.0 + (x / y)) / ((1.0 / x) - -1.0); end
code[x_, y_] := N[(N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 / x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 + \frac{x}{y}}{\frac{1}{x} - -1}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ x y) (if (<= x -2.9e-173) (* x (/ x y)) (if (<= x 1.05e-17) x (/ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = x / y;
} else if (x <= -2.9e-173) {
tmp = x * (x / y);
} else if (x <= 1.05e-17) {
tmp = x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = x / y
else if (x <= (-2.9d-173)) then
tmp = x * (x / y)
else if (x <= 1.05d-17) then
tmp = x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = x / y;
} else if (x <= -2.9e-173) {
tmp = x * (x / y);
} else if (x <= 1.05e-17) {
tmp = x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = x / y elif x <= -2.9e-173: tmp = x * (x / y) elif x <= 1.05e-17: tmp = x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(x / y); elseif (x <= -2.9e-173) tmp = Float64(x * Float64(x / y)); elseif (x <= 1.05e-17) tmp = x; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = x / y; elseif (x <= -2.9e-173) tmp = x * (x / y); elseif (x <= 1.05e-17) tmp = x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(x / y), $MachinePrecision], If[LessEqual[x, -2.9e-173], N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-17], x, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-173}:\\
\;\;\;\;x \cdot \frac{x}{y}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ x y) (if (<= x -2.9e-173) (/ x (/ y x)) (if (<= x 1.05e-17) x (/ x y)))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = x / y;
} else if (x <= -2.9e-173) {
tmp = x / (y / x);
} else if (x <= 1.05e-17) {
tmp = x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = x / y
else if (x <= (-2.9d-173)) then
tmp = x / (y / x)
else if (x <= 1.05d-17) then
tmp = x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = x / y;
} else if (x <= -2.9e-173) {
tmp = x / (y / x);
} else if (x <= 1.05e-17) {
tmp = x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = x / y elif x <= -2.9e-173: tmp = x / (y / x) elif x <= 1.05e-17: tmp = x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(x / y); elseif (x <= -2.9e-173) tmp = Float64(x / Float64(y / x)); elseif (x <= 1.05e-17) tmp = x; else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = x / y; elseif (x <= -2.9e-173) tmp = x / (y / x); elseif (x <= 1.05e-17) tmp = x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(x / y), $MachinePrecision], If[LessEqual[x, -2.9e-173], N[(x / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-17], x, N[(x / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-173}:\\
\;\;\;\;\frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -2.2e+51) (not (<= x 1.05e-17))) (/ x y) (/ x (+ x 1.0))))
double code(double x, double y) {
double tmp;
if ((x <= -2.2e+51) || !(x <= 1.05e-17)) {
tmp = x / y;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-2.2d+51)) .or. (.not. (x <= 1.05d-17))) then
tmp = x / y
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -2.2e+51) || !(x <= 1.05e-17)) {
tmp = x / y;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -2.2e+51) or not (x <= 1.05e-17): tmp = x / y else: tmp = x / (x + 1.0) return tmp
function code(x, y) tmp = 0.0 if ((x <= -2.2e+51) || !(x <= 1.05e-17)) tmp = Float64(x / y); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -2.2e+51) || ~((x <= 1.05e-17))) tmp = x / y; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -2.2e+51], N[Not[LessEqual[x, 1.05e-17]], $MachinePrecision]], N[(x / y), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+51} \lor \neg \left(x \leq 1.05 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -1.0) (not (<= x 1.05e-17))) (/ x y) x))
double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 1.05e-17)) {
tmp = x / y;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 1.05d-17))) then
tmp = x / y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 1.05e-17)) {
tmp = x / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.0) or not (x <= 1.05e-17): tmp = x / y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.05e-17)) tmp = Float64(x / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.0) || ~((x <= 1.05e-17))) tmp = x / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 1.05e-17]], $MachinePrecision]], N[(x / y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1.05 \cdot 10^{-17}\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -1.25e-9) 1.0 (if (<= x 2.1e+26) x 1.0)))
double code(double x, double y) {
double tmp;
if (x <= -1.25e-9) {
tmp = 1.0;
} else if (x <= 2.1e+26) {
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 (x <= (-1.25d-9)) then
tmp = 1.0d0
else if (x <= 2.1d+26) then
tmp = x
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.25e-9) {
tmp = 1.0;
} else if (x <= 2.1e+26) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.25e-9: tmp = 1.0 elif x <= 2.1e+26: tmp = x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.25e-9) tmp = 1.0; elseif (x <= 2.1e+26) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.25e-9) tmp = 1.0; elseif (x <= 2.1e+26) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.25e-9], 1.0, If[LessEqual[x, 2.1e+26], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\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}
(FPCore (x y) :precision binary64 (* (/ x 1.0) (/ (+ (/ x y) 1.0) (+ x 1.0))))
double code(double x, double y) {
return (x / 1.0) * (((x / y) + 1.0) / (x + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / 1.0d0) * (((x / y) + 1.0d0) / (x + 1.0d0))
end function
public static double code(double x, double y) {
return (x / 1.0) * (((x / y) + 1.0) / (x + 1.0));
}
def code(x, y): return (x / 1.0) * (((x / y) + 1.0) / (x + 1.0))
function code(x, y) return Float64(Float64(x / 1.0) * Float64(Float64(Float64(x / y) + 1.0) / Float64(x + 1.0))) end
function tmp = code(x, y) tmp = (x / 1.0) * (((x / y) + 1.0) / (x + 1.0)); end
code[x_, y_] := N[(N[(x / 1.0), $MachinePrecision] * N[(N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{1} \cdot \frac{\frac{x}{y} + 1}{x + 1}
\end{array}
herbie shell --seed 2023347
(FPCore (x y)
:name "Codec.Picture.Types:toneMapping from JuicyPixels-3.2.6.1"
:precision binary64
:herbie-target
(* (/ x 1.0) (/ (+ (/ x y) 1.0) (+ x 1.0)))
(/ (* x (+ (/ x y) 1.0)) (+ x 1.0)))