
(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 11 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 (<= x -2e+82)
t_0
(if (<= x 1.2e+15) (/ (* x t_0) (+ x 1.0)) (+ (/ x (+ y (/ y x))) 1.0)))))
double code(double x, double y) {
double t_0 = 1.0 + (x / y);
double tmp;
if (x <= -2e+82) {
tmp = t_0;
} else if (x <= 1.2e+15) {
tmp = (x * t_0) / (x + 1.0);
} else {
tmp = (x / (y + (y / 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+82)) then
tmp = t_0
else if (x <= 1.2d+15) then
tmp = (x * t_0) / (x + 1.0d0)
else
tmp = (x / (y + (y / 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+82) {
tmp = t_0;
} else if (x <= 1.2e+15) {
tmp = (x * t_0) / (x + 1.0);
} else {
tmp = (x / (y + (y / x))) + 1.0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x / y) tmp = 0 if x <= -2e+82: tmp = t_0 elif x <= 1.2e+15: tmp = (x * t_0) / (x + 1.0) else: tmp = (x / (y + (y / x))) + 1.0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x / y)) tmp = 0.0 if (x <= -2e+82) tmp = t_0; elseif (x <= 1.2e+15) tmp = Float64(Float64(x * t_0) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(y + Float64(y / 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+82) tmp = t_0; elseif (x <= 1.2e+15) tmp = (x * t_0) / (x + 1.0); else tmp = (x / (y + (y / x))) + 1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e+82], t$95$0, If[LessEqual[x, 1.2e+15], N[(N[(x * t$95$0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{x}{y}\\
\mathbf{if}\;x \leq -2 \cdot 10^{+82}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x \cdot t_0}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + \frac{y}{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 (if (or (<= x -4.9e-12) (not (<= x 1.3e-11))) (+ (/ x (+ y (/ y x))) 1.0) (* x (+ 1.0 (/ x y)))))
double code(double x, double y) {
double tmp;
if ((x <= -4.9e-12) || !(x <= 1.3e-11)) {
tmp = (x / (y + (y / x))) + 1.0;
} else {
tmp = x * (1.0 + (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 <= (-4.9d-12)) .or. (.not. (x <= 1.3d-11))) then
tmp = (x / (y + (y / x))) + 1.0d0
else
tmp = x * (1.0d0 + (x / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -4.9e-12) || !(x <= 1.3e-11)) {
tmp = (x / (y + (y / x))) + 1.0;
} else {
tmp = x * (1.0 + (x / y));
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -4.9e-12) or not (x <= 1.3e-11): tmp = (x / (y + (y / x))) + 1.0 else: tmp = x * (1.0 + (x / y)) return tmp
function code(x, y) tmp = 0.0 if ((x <= -4.9e-12) || !(x <= 1.3e-11)) tmp = Float64(Float64(x / Float64(y + Float64(y / x))) + 1.0); else tmp = Float64(x * Float64(1.0 + Float64(x / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -4.9e-12) || ~((x <= 1.3e-11))) tmp = (x / (y + (y / x))) + 1.0; else tmp = x * (1.0 + (x / y)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -4.9e-12], N[Not[LessEqual[x, 1.3e-11]], $MachinePrecision]], N[(N[(x / N[(y + N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(x * N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{-12} \lor \neg \left(x \leq 1.3 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{x}{y + \frac{y}{x}} + 1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + \frac{x}{y}\right)\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (/ x (+ y (/ y x))))) (if (or (<= x -3200.0) (not (<= x 0.145))) (+ t_0 1.0) (+ x t_0))))
double code(double x, double y) {
double t_0 = x / (y + (y / x));
double tmp;
if ((x <= -3200.0) || !(x <= 0.145)) {
tmp = t_0 + 1.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 <= (-3200.0d0)) .or. (.not. (x <= 0.145d0))) then
tmp = t_0 + 1.0d0
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 <= -3200.0) || !(x <= 0.145)) {
tmp = t_0 + 1.0;
} else {
tmp = x + t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y + (y / x)) tmp = 0 if (x <= -3200.0) or not (x <= 0.145): tmp = t_0 + 1.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 <= -3200.0) || !(x <= 0.145)) tmp = Float64(t_0 + 1.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 <= -3200.0) || ~((x <= 0.145))) tmp = t_0 + 1.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, -3200.0], N[Not[LessEqual[x, 0.145]], $MachinePrecision]], N[(t$95$0 + 1.0), $MachinePrecision], N[(x + t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y + \frac{y}{x}}\\
\mathbf{if}\;x \leq -3200 \lor \neg \left(x \leq 0.145\right):\\
\;\;\;\;t_0 + 1\\
\mathbf{else}:\\
\;\;\;\;x + t_0\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -2.4e+46) (/ x y) (if (<= x -9e+22) 1.0 (if (or (<= x -1.0) (not (<= x 0.145))) (/ x y) x))))
double code(double x, double y) {
double tmp;
if (x <= -2.4e+46) {
tmp = x / y;
} else if (x <= -9e+22) {
tmp = 1.0;
} else if ((x <= -1.0) || !(x <= 0.145)) {
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 <= (-2.4d+46)) then
tmp = x / y
else if (x <= (-9d+22)) then
tmp = 1.0d0
else if ((x <= (-1.0d0)) .or. (.not. (x <= 0.145d0))) 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 <= -2.4e+46) {
tmp = x / y;
} else if (x <= -9e+22) {
tmp = 1.0;
} else if ((x <= -1.0) || !(x <= 0.145)) {
tmp = x / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -2.4e+46: tmp = x / y elif x <= -9e+22: tmp = 1.0 elif (x <= -1.0) or not (x <= 0.145): tmp = x / y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (x <= -2.4e+46) tmp = Float64(x / y); elseif (x <= -9e+22) tmp = 1.0; elseif ((x <= -1.0) || !(x <= 0.145)) tmp = Float64(x / y); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -2.4e+46) tmp = x / y; elseif (x <= -9e+22) tmp = 1.0; elseif ((x <= -1.0) || ~((x <= 0.145))) tmp = x / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -2.4e+46], N[(x / y), $MachinePrecision], If[LessEqual[x, -9e+22], 1.0, If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 0.145]], $MachinePrecision]], N[(x / y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+46}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;x \leq -9 \cdot 10^{+22}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -1 \lor \neg \left(x \leq 0.145\right):\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (/ x y)))) (if (or (<= x -1.0) (not (<= x 1.0))) t_0 (* x t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (x / y);
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
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 = 1.0d0 + (x / y)
if ((x <= (-1.0d0)) .or. (.not. (x <= 1.0d0))) 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 = 1.0 + (x / y);
double tmp;
if ((x <= -1.0) || !(x <= 1.0)) {
tmp = t_0;
} else {
tmp = x * t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (x / y) tmp = 0 if (x <= -1.0) or not (x <= 1.0): tmp = t_0 else: tmp = x * t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(x / y)) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.0)) tmp = t_0; else tmp = Float64(x * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (x / y); tmp = 0.0; if ((x <= -1.0) || ~((x <= 1.0))) tmp = t_0; else tmp = x * t_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, -1.0], N[Not[LessEqual[x, 1.0]], $MachinePrecision]], t$95$0, N[(x * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \frac{x}{y}\\
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot t_0\\
\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 (or (<= x -1.0) (not (<= x 1.3e-11))) (+ 1.0 (/ x y)) x))
double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 1.3e-11)) {
tmp = 1.0 + (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.3d-11))) then
tmp = 1.0d0 + (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.3e-11)) {
tmp = 1.0 + (x / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.0) or not (x <= 1.3e-11): tmp = 1.0 + (x / y) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.0) || !(x <= 1.3e-11)) tmp = Float64(1.0 + 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.3e-11))) tmp = 1.0 + (x / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 1.3e-11]], $MachinePrecision]], N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 1.3 \cdot 10^{-11}\right):\\
\;\;\;\;1 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -330.0) (not (<= x 12000000000000.0))) (+ 1.0 (/ x y)) (/ x (+ x 1.0))))
double code(double x, double y) {
double tmp;
if ((x <= -330.0) || !(x <= 12000000000000.0)) {
tmp = 1.0 + (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 <= (-330.0d0)) .or. (.not. (x <= 12000000000000.0d0))) then
tmp = 1.0d0 + (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 <= -330.0) || !(x <= 12000000000000.0)) {
tmp = 1.0 + (x / y);
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -330.0) or not (x <= 12000000000000.0): tmp = 1.0 + (x / y) else: tmp = x / (x + 1.0) return tmp
function code(x, y) tmp = 0.0 if ((x <= -330.0) || !(x <= 12000000000000.0)) tmp = Float64(1.0 + 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 <= -330.0) || ~((x <= 12000000000000.0))) tmp = 1.0 + (x / y); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -330.0], N[Not[LessEqual[x, 12000000000000.0]], $MachinePrecision]], N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -330 \lor \neg \left(x \leq 12000000000000\right):\\
\;\;\;\;1 + \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -1.0) 1.0 (if (<= x 4.5) x 1.0)))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = 1.0;
} else if (x <= 4.5) {
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.0d0)) then
tmp = 1.0d0
else if (x <= 4.5d0) 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.0) {
tmp = 1.0;
} else if (x <= 4.5) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = 1.0 elif x <= 4.5: tmp = x else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = 1.0; elseif (x <= 4.5) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = 1.0; elseif (x <= 4.5) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], 1.0, If[LessEqual[x, 4.5], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.5:\\
\;\;\;\;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 2023343
(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)))