
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y) :precision binary64 (/ (- x y) (- 2.0 (+ x y))))
double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (2.0d0 - (x + y))
end function
public static double code(double x, double y) {
return (x - y) / (2.0 - (x + y));
}
def code(x, y): return (x - y) / (2.0 - (x + y))
function code(x, y) return Float64(Float64(x - y) / Float64(2.0 - Float64(x + y))) end
function tmp = code(x, y) tmp = (x - y) / (2.0 - (x + y)); end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{2 - \left(x + y\right)}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))))
(if (<= y -5.7e-13)
t_0
(if (<= y -3.8e-231)
-1.0
(if (<= y -2.4e-288)
(* x 0.5)
(if (<= y 2.7e-147) -1.0 (if (<= y 7.2) (* y -0.5) t_0)))))))
double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= -3.8e-231) {
tmp = -1.0;
} else if (y <= -2.4e-288) {
tmp = x * 0.5;
} else if (y <= 2.7e-147) {
tmp = -1.0;
} else if (y <= 7.2) {
tmp = y * -0.5;
} else {
tmp = 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 (y <= (-5.7d-13)) then
tmp = t_0
else if (y <= (-3.8d-231)) then
tmp = -1.0d0
else if (y <= (-2.4d-288)) then
tmp = x * 0.5d0
else if (y <= 2.7d-147) then
tmp = -1.0d0
else if (y <= 7.2d0) then
tmp = y * (-0.5d0)
else
tmp = 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 (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= -3.8e-231) {
tmp = -1.0;
} else if (y <= -2.4e-288) {
tmp = x * 0.5;
} else if (y <= 2.7e-147) {
tmp = -1.0;
} else if (y <= 7.2) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x / y) tmp = 0 if y <= -5.7e-13: tmp = t_0 elif y <= -3.8e-231: tmp = -1.0 elif y <= -2.4e-288: tmp = x * 0.5 elif y <= 2.7e-147: tmp = -1.0 elif y <= 7.2: tmp = y * -0.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -5.7e-13) tmp = t_0; elseif (y <= -3.8e-231) tmp = -1.0; elseif (y <= -2.4e-288) tmp = Float64(x * 0.5); elseif (y <= 2.7e-147) tmp = -1.0; elseif (y <= 7.2) tmp = Float64(y * -0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x / y); tmp = 0.0; if (y <= -5.7e-13) tmp = t_0; elseif (y <= -3.8e-231) tmp = -1.0; elseif (y <= -2.4e-288) tmp = x * 0.5; elseif (y <= 2.7e-147) tmp = -1.0; elseif (y <= 7.2) tmp = y * -0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.7e-13], t$95$0, If[LessEqual[y, -3.8e-231], -1.0, If[LessEqual[y, -2.4e-288], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 2.7e-147], -1.0, If[LessEqual[y, 7.2], N[(y * -0.5), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{-13}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-231}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-147}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 7.2:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))))
(if (<= y -5.7e-13)
t_0
(if (<= y -2.1e-230)
(+ (/ y x) -1.0)
(if (<= y -1.28e-288)
(* x 0.5)
(if (<= y 2.7e-147) -1.0 (if (<= y 2.4) (* y -0.5) t_0)))))))
double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double tmp;
if (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= -2.1e-230) {
tmp = (y / x) + -1.0;
} else if (y <= -1.28e-288) {
tmp = x * 0.5;
} else if (y <= 2.7e-147) {
tmp = -1.0;
} else if (y <= 2.4) {
tmp = y * -0.5;
} else {
tmp = 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 (y <= (-5.7d-13)) then
tmp = t_0
else if (y <= (-2.1d-230)) then
tmp = (y / x) + (-1.0d0)
else if (y <= (-1.28d-288)) then
tmp = x * 0.5d0
else if (y <= 2.7d-147) then
tmp = -1.0d0
else if (y <= 2.4d0) then
tmp = y * (-0.5d0)
else
tmp = 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 (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= -2.1e-230) {
tmp = (y / x) + -1.0;
} else if (y <= -1.28e-288) {
tmp = x * 0.5;
} else if (y <= 2.7e-147) {
tmp = -1.0;
} else if (y <= 2.4) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x / y) tmp = 0 if y <= -5.7e-13: tmp = t_0 elif y <= -2.1e-230: tmp = (y / x) + -1.0 elif y <= -1.28e-288: tmp = x * 0.5 elif y <= 2.7e-147: tmp = -1.0 elif y <= 2.4: tmp = y * -0.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x / y)) tmp = 0.0 if (y <= -5.7e-13) tmp = t_0; elseif (y <= -2.1e-230) tmp = Float64(Float64(y / x) + -1.0); elseif (y <= -1.28e-288) tmp = Float64(x * 0.5); elseif (y <= 2.7e-147) tmp = -1.0; elseif (y <= 2.4) tmp = Float64(y * -0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x / y); tmp = 0.0; if (y <= -5.7e-13) tmp = t_0; elseif (y <= -2.1e-230) tmp = (y / x) + -1.0; elseif (y <= -1.28e-288) tmp = x * 0.5; elseif (y <= 2.7e-147) tmp = -1.0; elseif (y <= 2.4) tmp = y * -0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.7e-13], t$95$0, If[LessEqual[y, -2.1e-230], N[(N[(y / x), $MachinePrecision] + -1.0), $MachinePrecision], If[LessEqual[y, -1.28e-288], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 2.7e-147], -1.0, If[LessEqual[y, 2.4], N[(y * -0.5), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{-13}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-230}:\\
\;\;\;\;\frac{y}{x} + -1\\
\mathbf{elif}\;y \leq -1.28 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-147}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2.4:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ x y))) (t_1 (/ x (- 2.0 x))))
(if (<= y -5.7e-13)
t_0
(if (<= y 2.7e-147)
t_1
(if (<= y 3.65e-121)
(* y -0.5)
(if (<= y 4.8e-92) t_1 (if (<= y 2.85) (* y -0.5) t_0)))))))
double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x / (2.0 - x);
double tmp;
if (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= 2.7e-147) {
tmp = t_1;
} else if (y <= 3.65e-121) {
tmp = y * -0.5;
} else if (y <= 4.8e-92) {
tmp = t_1;
} else if (y <= 2.85) {
tmp = y * -0.5;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_0 = 1.0d0 - (x / y)
t_1 = x / (2.0d0 - x)
if (y <= (-5.7d-13)) then
tmp = t_0
else if (y <= 2.7d-147) then
tmp = t_1
else if (y <= 3.65d-121) then
tmp = y * (-0.5d0)
else if (y <= 4.8d-92) then
tmp = t_1
else if (y <= 2.85d0) then
tmp = y * (-0.5d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x / y);
double t_1 = x / (2.0 - x);
double tmp;
if (y <= -5.7e-13) {
tmp = t_0;
} else if (y <= 2.7e-147) {
tmp = t_1;
} else if (y <= 3.65e-121) {
tmp = y * -0.5;
} else if (y <= 4.8e-92) {
tmp = t_1;
} else if (y <= 2.85) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x / y) t_1 = x / (2.0 - x) tmp = 0 if y <= -5.7e-13: tmp = t_0 elif y <= 2.7e-147: tmp = t_1 elif y <= 3.65e-121: tmp = y * -0.5 elif y <= 4.8e-92: tmp = t_1 elif y <= 2.85: tmp = y * -0.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x / y)) t_1 = Float64(x / Float64(2.0 - x)) tmp = 0.0 if (y <= -5.7e-13) tmp = t_0; elseif (y <= 2.7e-147) tmp = t_1; elseif (y <= 3.65e-121) tmp = Float64(y * -0.5); elseif (y <= 4.8e-92) tmp = t_1; elseif (y <= 2.85) tmp = Float64(y * -0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x / y); t_1 = x / (2.0 - x); tmp = 0.0; if (y <= -5.7e-13) tmp = t_0; elseif (y <= 2.7e-147) tmp = t_1; elseif (y <= 3.65e-121) tmp = y * -0.5; elseif (y <= 4.8e-92) tmp = t_1; elseif (y <= 2.85) tmp = y * -0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.7e-13], t$95$0, If[LessEqual[y, 2.7e-147], t$95$1, If[LessEqual[y, 3.65e-121], N[(y * -0.5), $MachinePrecision], If[LessEqual[y, 4.8e-92], t$95$1, If[LessEqual[y, 2.85], N[(y * -0.5), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{x}{y}\\
t_1 := \frac{x}{2 - x}\\
\mathbf{if}\;y \leq -5.7 \cdot 10^{-13}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-147}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.65 \cdot 10^{-121}:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.85:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= x -6.6e+16)
-1.0
(if (<= x 9.6e-102)
1.0
(if (<= x 8.2e-23)
(* x 0.5)
(if (<= x 460000.0)
1.0
(if (<= x 1.1e+96) -1.0 (if (<= x 1.35e+118) 1.0 -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= -6.6e+16) {
tmp = -1.0;
} else if (x <= 9.6e-102) {
tmp = 1.0;
} else if (x <= 8.2e-23) {
tmp = x * 0.5;
} else if (x <= 460000.0) {
tmp = 1.0;
} else if (x <= 1.1e+96) {
tmp = -1.0;
} else if (x <= 1.35e+118) {
tmp = 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 (x <= (-6.6d+16)) then
tmp = -1.0d0
else if (x <= 9.6d-102) then
tmp = 1.0d0
else if (x <= 8.2d-23) then
tmp = x * 0.5d0
else if (x <= 460000.0d0) then
tmp = 1.0d0
else if (x <= 1.1d+96) then
tmp = -1.0d0
else if (x <= 1.35d+118) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.6e+16) {
tmp = -1.0;
} else if (x <= 9.6e-102) {
tmp = 1.0;
} else if (x <= 8.2e-23) {
tmp = x * 0.5;
} else if (x <= 460000.0) {
tmp = 1.0;
} else if (x <= 1.1e+96) {
tmp = -1.0;
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.6e+16: tmp = -1.0 elif x <= 9.6e-102: tmp = 1.0 elif x <= 8.2e-23: tmp = x * 0.5 elif x <= 460000.0: tmp = 1.0 elif x <= 1.1e+96: tmp = -1.0 elif x <= 1.35e+118: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -6.6e+16) tmp = -1.0; elseif (x <= 9.6e-102) tmp = 1.0; elseif (x <= 8.2e-23) tmp = Float64(x * 0.5); elseif (x <= 460000.0) tmp = 1.0; elseif (x <= 1.1e+96) tmp = -1.0; elseif (x <= 1.35e+118) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.6e+16) tmp = -1.0; elseif (x <= 9.6e-102) tmp = 1.0; elseif (x <= 8.2e-23) tmp = x * 0.5; elseif (x <= 460000.0) tmp = 1.0; elseif (x <= 1.1e+96) tmp = -1.0; elseif (x <= 1.35e+118) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.6e+16], -1.0, If[LessEqual[x, 9.6e-102], 1.0, If[LessEqual[x, 8.2e-23], N[(x * 0.5), $MachinePrecision], If[LessEqual[x, 460000.0], 1.0, If[LessEqual[x, 1.1e+96], -1.0, If[LessEqual[x, 1.35e+118], 1.0, -1.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{+16}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-102}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-23}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;x \leq 460000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+96}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+118}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= y -5.7e-13)
1.0
(if (<= y -1.4e-231)
-1.0
(if (<= y -2e-288)
(* x 0.5)
(if (<= y 4.5e-148) -1.0 (if (<= y 4.8) (* y -0.5) 1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -5.7e-13) {
tmp = 1.0;
} else if (y <= -1.4e-231) {
tmp = -1.0;
} else if (y <= -2e-288) {
tmp = x * 0.5;
} else if (y <= 4.5e-148) {
tmp = -1.0;
} else if (y <= 4.8) {
tmp = y * -0.5;
} 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 <= (-5.7d-13)) then
tmp = 1.0d0
else if (y <= (-1.4d-231)) then
tmp = -1.0d0
else if (y <= (-2d-288)) then
tmp = x * 0.5d0
else if (y <= 4.5d-148) then
tmp = -1.0d0
else if (y <= 4.8d0) then
tmp = y * (-0.5d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.7e-13) {
tmp = 1.0;
} else if (y <= -1.4e-231) {
tmp = -1.0;
} else if (y <= -2e-288) {
tmp = x * 0.5;
} else if (y <= 4.5e-148) {
tmp = -1.0;
} else if (y <= 4.8) {
tmp = y * -0.5;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.7e-13: tmp = 1.0 elif y <= -1.4e-231: tmp = -1.0 elif y <= -2e-288: tmp = x * 0.5 elif y <= 4.5e-148: tmp = -1.0 elif y <= 4.8: tmp = y * -0.5 else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if (y <= -5.7e-13) tmp = 1.0; elseif (y <= -1.4e-231) tmp = -1.0; elseif (y <= -2e-288) tmp = Float64(x * 0.5); elseif (y <= 4.5e-148) tmp = -1.0; elseif (y <= 4.8) tmp = Float64(y * -0.5); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.7e-13) tmp = 1.0; elseif (y <= -1.4e-231) tmp = -1.0; elseif (y <= -2e-288) tmp = x * 0.5; elseif (y <= 4.5e-148) tmp = -1.0; elseif (y <= 4.8) tmp = y * -0.5; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.7e-13], 1.0, If[LessEqual[y, -1.4e-231], -1.0, If[LessEqual[y, -2e-288], N[(x * 0.5), $MachinePrecision], If[LessEqual[y, 4.5e-148], -1.0, If[LessEqual[y, 4.8], N[(y * -0.5), $MachinePrecision], 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.7 \cdot 10^{-13}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-231}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2 \cdot 10^{-288}:\\
\;\;\;\;x \cdot 0.5\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-148}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 4.8:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (/ y x) -1.0)))
(if (<= x -320000000000.0)
t_0
(if (<= x 2900.0)
(/ y (+ y -2.0))
(if (<= x 8.8e+95) (/ x (- 2.0 x)) (if (<= x 1.35e+118) 1.0 t_0))))))
double code(double x, double y) {
double t_0 = (y / x) + -1.0;
double tmp;
if (x <= -320000000000.0) {
tmp = t_0;
} else if (x <= 2900.0) {
tmp = y / (y + -2.0);
} else if (x <= 8.8e+95) {
tmp = x / (2.0 - x);
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = 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 = (y / x) + (-1.0d0)
if (x <= (-320000000000.0d0)) then
tmp = t_0
else if (x <= 2900.0d0) then
tmp = y / (y + (-2.0d0))
else if (x <= 8.8d+95) then
tmp = x / (2.0d0 - x)
else if (x <= 1.35d+118) then
tmp = 1.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y / x) + -1.0;
double tmp;
if (x <= -320000000000.0) {
tmp = t_0;
} else if (x <= 2900.0) {
tmp = y / (y + -2.0);
} else if (x <= 8.8e+95) {
tmp = x / (2.0 - x);
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (y / x) + -1.0 tmp = 0 if x <= -320000000000.0: tmp = t_0 elif x <= 2900.0: tmp = y / (y + -2.0) elif x <= 8.8e+95: tmp = x / (2.0 - x) elif x <= 1.35e+118: tmp = 1.0 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(y / x) + -1.0) tmp = 0.0 if (x <= -320000000000.0) tmp = t_0; elseif (x <= 2900.0) tmp = Float64(y / Float64(y + -2.0)); elseif (x <= 8.8e+95) tmp = Float64(x / Float64(2.0 - x)); elseif (x <= 1.35e+118) tmp = 1.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (y / x) + -1.0; tmp = 0.0; if (x <= -320000000000.0) tmp = t_0; elseif (x <= 2900.0) tmp = y / (y + -2.0); elseif (x <= 8.8e+95) tmp = x / (2.0 - x); elseif (x <= 1.35e+118) tmp = 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] + -1.0), $MachinePrecision]}, If[LessEqual[x, -320000000000.0], t$95$0, If[LessEqual[x, 2900.0], N[(y / N[(y + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.8e+95], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+118], 1.0, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x} + -1\\
\mathbf{if}\;x \leq -320000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2900:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{+95}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+118}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= x -3.4e+15)
(/ (- x y) (- x))
(if (<= x 13.2)
(/ y (+ y -2.0))
(if (<= x 1.15e+96)
(/ x (- 2.0 x))
(if (<= x 1.35e+118) 1.0 (+ (/ y x) -1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -3.4e+15) {
tmp = (x - y) / -x;
} else if (x <= 13.2) {
tmp = y / (y + -2.0);
} else if (x <= 1.15e+96) {
tmp = x / (2.0 - x);
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = (y / 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 <= (-3.4d+15)) then
tmp = (x - y) / -x
else if (x <= 13.2d0) then
tmp = y / (y + (-2.0d0))
else if (x <= 1.15d+96) then
tmp = x / (2.0d0 - x)
else if (x <= 1.35d+118) then
tmp = 1.0d0
else
tmp = (y / x) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.4e+15) {
tmp = (x - y) / -x;
} else if (x <= 13.2) {
tmp = y / (y + -2.0);
} else if (x <= 1.15e+96) {
tmp = x / (2.0 - x);
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = (y / x) + -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.4e+15: tmp = (x - y) / -x elif x <= 13.2: tmp = y / (y + -2.0) elif x <= 1.15e+96: tmp = x / (2.0 - x) elif x <= 1.35e+118: tmp = 1.0 else: tmp = (y / x) + -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -3.4e+15) tmp = Float64(Float64(x - y) / Float64(-x)); elseif (x <= 13.2) tmp = Float64(y / Float64(y + -2.0)); elseif (x <= 1.15e+96) tmp = Float64(x / Float64(2.0 - x)); elseif (x <= 1.35e+118) tmp = 1.0; else tmp = Float64(Float64(y / x) + -1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.4e+15) tmp = (x - y) / -x; elseif (x <= 13.2) tmp = y / (y + -2.0); elseif (x <= 1.15e+96) tmp = x / (2.0 - x); elseif (x <= 1.35e+118) tmp = 1.0; else tmp = (y / x) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.4e+15], N[(N[(x - y), $MachinePrecision] / (-x)), $MachinePrecision], If[LessEqual[x, 13.2], N[(y / N[(y + -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e+96], N[(x / N[(2.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+118], 1.0, N[(N[(y / x), $MachinePrecision] + -1.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{x - y}{-x}\\
\mathbf{elif}\;x \leq 13.2:\\
\;\;\;\;\frac{y}{y + -2}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+96}:\\
\;\;\;\;\frac{x}{2 - x}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+118}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x} + -1\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= x -410000000000.0)
-1.0
(if (<= x 460000.0)
1.0
(if (<= x 1.15e+96) -1.0 (if (<= x 1.35e+118) 1.0 -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -410000000000.0) {
tmp = -1.0;
} else if (x <= 460000.0) {
tmp = 1.0;
} else if (x <= 1.15e+96) {
tmp = -1.0;
} else if (x <= 1.35e+118) {
tmp = 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 (x <= (-410000000000.0d0)) then
tmp = -1.0d0
else if (x <= 460000.0d0) then
tmp = 1.0d0
else if (x <= 1.15d+96) then
tmp = -1.0d0
else if (x <= 1.35d+118) then
tmp = 1.0d0
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -410000000000.0) {
tmp = -1.0;
} else if (x <= 460000.0) {
tmp = 1.0;
} else if (x <= 1.15e+96) {
tmp = -1.0;
} else if (x <= 1.35e+118) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -410000000000.0: tmp = -1.0 elif x <= 460000.0: tmp = 1.0 elif x <= 1.15e+96: tmp = -1.0 elif x <= 1.35e+118: tmp = 1.0 else: tmp = -1.0 return tmp
function code(x, y) tmp = 0.0 if (x <= -410000000000.0) tmp = -1.0; elseif (x <= 460000.0) tmp = 1.0; elseif (x <= 1.15e+96) tmp = -1.0; elseif (x <= 1.35e+118) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -410000000000.0) tmp = -1.0; elseif (x <= 460000.0) tmp = 1.0; elseif (x <= 1.15e+96) tmp = -1.0; elseif (x <= 1.35e+118) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -410000000000.0], -1.0, If[LessEqual[x, 460000.0], 1.0, If[LessEqual[x, 1.15e+96], -1.0, If[LessEqual[x, 1.35e+118], 1.0, -1.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -410000000000:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 460000:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+96}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+118}:\\
\;\;\;\;1\\
\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 (let* ((t_0 (- 2.0 (+ x y)))) (- (/ x t_0) (/ y t_0))))
double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = 2.0d0 - (x + y)
code = (x / t_0) - (y / t_0)
end function
public static double code(double x, double y) {
double t_0 = 2.0 - (x + y);
return (x / t_0) - (y / t_0);
}
def code(x, y): t_0 = 2.0 - (x + y) return (x / t_0) - (y / t_0)
function code(x, y) t_0 = Float64(2.0 - Float64(x + y)) return Float64(Float64(x / t_0) - Float64(y / t_0)) end
function tmp = code(x, y) t_0 = 2.0 - (x + y); tmp = (x / t_0) - (y / t_0); end
code[x_, y_] := Block[{t$95$0 = N[(2.0 - N[(x + y), $MachinePrecision]), $MachinePrecision]}, N[(N[(x / t$95$0), $MachinePrecision] - N[(y / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 - \left(x + y\right)\\
\frac{x}{t_0} - \frac{y}{t_0}
\end{array}
\end{array}
herbie shell --seed 2023343
(FPCore (x y)
:name "Data.Colour.RGB:hslsv from colour-2.3.3, C"
:precision binary64
:herbie-target
(- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))
(/ (- x y) (- 2.0 (+ x y))))