
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * (y - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x * (y - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1.0), $MachinePrecision]), $MachinePrecision] - N[(y * 0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y - 1\right) - y \cdot 0.5\right) + 0.918938533204673
\end{array}
(FPCore (x y) :precision binary64 (- (+ (* y (+ x -0.5)) 0.918938533204673) x))
double code(double x, double y) {
return ((y * (x + -0.5)) + 0.918938533204673) - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y * (x + (-0.5d0))) + 0.918938533204673d0) - x
end function
public static double code(double x, double y) {
return ((y * (x + -0.5)) + 0.918938533204673) - x;
}
def code(x, y): return ((y * (x + -0.5)) + 0.918938533204673) - x
function code(x, y) return Float64(Float64(Float64(y * Float64(x + -0.5)) + 0.918938533204673) - x) end
function tmp = code(x, y) tmp = ((y * (x + -0.5)) + 0.918938533204673) - x; end
code[x_, y_] := N[(N[(N[(y * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] + 0.918938533204673), $MachinePrecision] - x), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot \left(x + -0.5\right) + 0.918938533204673\right) - x
\end{array}
(FPCore (x y)
:precision binary64
(if (<= x -3.6)
(- (+ 0.918938533204673 (* y x)) x)
(if (<= x 4100000.0)
(+ (* y x) (- 0.918938533204673 (* y 0.5)))
(* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -3.6) {
tmp = (0.918938533204673 + (y * x)) - x;
} else if (x <= 4100000.0) {
tmp = (y * x) + (0.918938533204673 - (y * 0.5));
} 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 (x <= (-3.6d0)) then
tmp = (0.918938533204673d0 + (y * x)) - x
else if (x <= 4100000.0d0) then
tmp = (y * x) + (0.918938533204673d0 - (y * 0.5d0))
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -3.6) {
tmp = (0.918938533204673 + (y * x)) - x;
} else if (x <= 4100000.0) {
tmp = (y * x) + (0.918938533204673 - (y * 0.5));
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -3.6: tmp = (0.918938533204673 + (y * x)) - x elif x <= 4100000.0: tmp = (y * x) + (0.918938533204673 - (y * 0.5)) else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -3.6) tmp = Float64(Float64(0.918938533204673 + Float64(y * x)) - x); elseif (x <= 4100000.0) tmp = Float64(Float64(y * x) + Float64(0.918938533204673 - Float64(y * 0.5))); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -3.6) tmp = (0.918938533204673 + (y * x)) - x; elseif (x <= 4100000.0) tmp = (y * x) + (0.918938533204673 - (y * 0.5)); else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -3.6], N[(N[(0.918938533204673 + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 4100000.0], N[(N[(y * x), $MachinePrecision] + N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6:\\
\;\;\;\;\left(0.918938533204673 + y \cdot x\right) - x\\
\mathbf{elif}\;x \leq 4100000:\\
\;\;\;\;y \cdot x + \left(0.918938533204673 - y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (+ y -1.0))))
(if (<= x -950000000.0)
t_0
(if (<= x -8.5e-42)
(- 0.918938533204673 x)
(if (<= x 0.5) (* y -0.5) t_0)))))
double code(double x, double y) {
double t_0 = x * (y + -1.0);
double tmp;
if (x <= -950000000.0) {
tmp = t_0;
} else if (x <= -8.5e-42) {
tmp = 0.918938533204673 - x;
} else if (x <= 0.5) {
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 = x * (y + (-1.0d0))
if (x <= (-950000000.0d0)) then
tmp = t_0
else if (x <= (-8.5d-42)) then
tmp = 0.918938533204673d0 - x
else if (x <= 0.5d0) 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 = x * (y + -1.0);
double tmp;
if (x <= -950000000.0) {
tmp = t_0;
} else if (x <= -8.5e-42) {
tmp = 0.918938533204673 - x;
} else if (x <= 0.5) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y + -1.0) tmp = 0 if x <= -950000000.0: tmp = t_0 elif x <= -8.5e-42: tmp = 0.918938533204673 - x elif x <= 0.5: tmp = y * -0.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y + -1.0)) tmp = 0.0 if (x <= -950000000.0) tmp = t_0; elseif (x <= -8.5e-42) tmp = Float64(0.918938533204673 - x); elseif (x <= 0.5) tmp = Float64(y * -0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y + -1.0); tmp = 0.0; if (x <= -950000000.0) tmp = t_0; elseif (x <= -8.5e-42) tmp = 0.918938533204673 - x; elseif (x <= 0.5) tmp = y * -0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -950000000.0], t$95$0, If[LessEqual[x, -8.5e-42], N[(0.918938533204673 - x), $MachinePrecision], If[LessEqual[x, 0.5], N[(y * -0.5), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + -1\right)\\
\mathbf{if}\;x \leq -950000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-42}:\\
\;\;\;\;0.918938533204673 - x\\
\mathbf{elif}\;x \leq 0.5:\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= y -7800000.0) (+ (* y x) (* y -0.5)) (if (<= y 280000.0) (- (+ 0.918938533204673 (* y x)) x) (* y (- x 0.5)))))
double code(double x, double y) {
double tmp;
if (y <= -7800000.0) {
tmp = (y * x) + (y * -0.5);
} else if (y <= 280000.0) {
tmp = (0.918938533204673 + (y * x)) - x;
} else {
tmp = y * (x - 0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-7800000.0d0)) then
tmp = (y * x) + (y * (-0.5d0))
else if (y <= 280000.0d0) then
tmp = (0.918938533204673d0 + (y * x)) - x
else
tmp = y * (x - 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -7800000.0) {
tmp = (y * x) + (y * -0.5);
} else if (y <= 280000.0) {
tmp = (0.918938533204673 + (y * x)) - x;
} else {
tmp = y * (x - 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7800000.0: tmp = (y * x) + (y * -0.5) elif y <= 280000.0: tmp = (0.918938533204673 + (y * x)) - x else: tmp = y * (x - 0.5) return tmp
function code(x, y) tmp = 0.0 if (y <= -7800000.0) tmp = Float64(Float64(y * x) + Float64(y * -0.5)); elseif (y <= 280000.0) tmp = Float64(Float64(0.918938533204673 + Float64(y * x)) - x); else tmp = Float64(y * Float64(x - 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7800000.0) tmp = (y * x) + (y * -0.5); elseif (y <= 280000.0) tmp = (0.918938533204673 + (y * x)) - x; else tmp = y * (x - 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7800000.0], N[(N[(y * x), $MachinePrecision] + N[(y * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 280000.0], N[(N[(0.918938533204673 + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7800000:\\
\;\;\;\;y \cdot x + y \cdot -0.5\\
\mathbf{elif}\;y \leq 280000:\\
\;\;\;\;\left(0.918938533204673 + y \cdot x\right) - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -0.5) (- (+ 0.918938533204673 (* y x)) x) (if (<= x 235.0) (- (- 0.918938533204673 (* y 0.5)) x) (* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.5) {
tmp = (0.918938533204673 + (y * x)) - x;
} else if (x <= 235.0) {
tmp = (0.918938533204673 - (y * 0.5)) - x;
} 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 (x <= (-0.5d0)) then
tmp = (0.918938533204673d0 + (y * x)) - x
else if (x <= 235.0d0) then
tmp = (0.918938533204673d0 - (y * 0.5d0)) - x
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.5) {
tmp = (0.918938533204673 + (y * x)) - x;
} else if (x <= 235.0) {
tmp = (0.918938533204673 - (y * 0.5)) - x;
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.5: tmp = (0.918938533204673 + (y * x)) - x elif x <= 235.0: tmp = (0.918938533204673 - (y * 0.5)) - x else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.5) tmp = Float64(Float64(0.918938533204673 + Float64(y * x)) - x); elseif (x <= 235.0) tmp = Float64(Float64(0.918938533204673 - Float64(y * 0.5)) - x); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.5) tmp = (0.918938533204673 + (y * x)) - x; elseif (x <= 235.0) tmp = (0.918938533204673 - (y * 0.5)) - x; else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.5], N[(N[(0.918938533204673 + N[(y * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 235.0], N[(N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.5:\\
\;\;\;\;\left(0.918938533204673 + y \cdot x\right) - x\\
\mathbf{elif}\;x \leq 235:\\
\;\;\;\;\left(0.918938533204673 - y \cdot 0.5\right) - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= y -1.4) (not (<= y 1.1))) (* y (- x 0.5)) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -1.4) || !(y <= 1.1)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.4d0)) .or. (.not. (y <= 1.1d0))) then
tmp = y * (x - 0.5d0)
else
tmp = 0.918938533204673d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.4) || !(y <= 1.1)) {
tmp = y * (x - 0.5);
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.4) or not (y <= 1.1): tmp = y * (x - 0.5) else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.4) || !(y <= 1.1)) tmp = Float64(y * Float64(x - 0.5)); else tmp = Float64(0.918938533204673 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.4) || ~((y <= 1.1))) tmp = y * (x - 0.5); else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.4], N[Not[LessEqual[y, 1.1]], $MachinePrecision]], N[(y * N[(x - 0.5), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \lor \neg \left(y \leq 1.1\right):\\
\;\;\;\;y \cdot \left(x - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= x -0.58) (not (<= x 0.8))) (* x (+ y -1.0)) (- 0.918938533204673 (* y 0.5))))
double code(double x, double y) {
double tmp;
if ((x <= -0.58) || !(x <= 0.8)) {
tmp = x * (y + -1.0);
} else {
tmp = 0.918938533204673 - (y * 0.5);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-0.58d0)) .or. (.not. (x <= 0.8d0))) then
tmp = x * (y + (-1.0d0))
else
tmp = 0.918938533204673d0 - (y * 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -0.58) || !(x <= 0.8)) {
tmp = x * (y + -1.0);
} else {
tmp = 0.918938533204673 - (y * 0.5);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -0.58) or not (x <= 0.8): tmp = x * (y + -1.0) else: tmp = 0.918938533204673 - (y * 0.5) return tmp
function code(x, y) tmp = 0.0 if ((x <= -0.58) || !(x <= 0.8)) tmp = Float64(x * Float64(y + -1.0)); else tmp = Float64(0.918938533204673 - Float64(y * 0.5)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -0.58) || ~((x <= 0.8))) tmp = x * (y + -1.0); else tmp = 0.918938533204673 - (y * 0.5); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -0.58], N[Not[LessEqual[x, 0.8]], $MachinePrecision]], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.58 \lor \neg \left(x \leq 0.8\right):\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x -0.7) (- (* y x) x) (if (<= x 0.5) (- 0.918938533204673 (* y 0.5)) (* x (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -0.7) {
tmp = (y * x) - x;
} else if (x <= 0.5) {
tmp = 0.918938533204673 - (y * 0.5);
} 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 (x <= (-0.7d0)) then
tmp = (y * x) - x
else if (x <= 0.5d0) then
tmp = 0.918938533204673d0 - (y * 0.5d0)
else
tmp = x * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -0.7) {
tmp = (y * x) - x;
} else if (x <= 0.5) {
tmp = 0.918938533204673 - (y * 0.5);
} else {
tmp = x * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -0.7: tmp = (y * x) - x elif x <= 0.5: tmp = 0.918938533204673 - (y * 0.5) else: tmp = x * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -0.7) tmp = Float64(Float64(y * x) - x); elseif (x <= 0.5) tmp = Float64(0.918938533204673 - Float64(y * 0.5)); else tmp = Float64(x * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -0.7) tmp = (y * x) - x; elseif (x <= 0.5) tmp = 0.918938533204673 - (y * 0.5); else tmp = x * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -0.7], N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[x, 0.5], N[(0.918938533204673 - N[(y * 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.7:\\
\;\;\;\;y \cdot x - x\\
\mathbf{elif}\;x \leq 0.5:\\
\;\;\;\;0.918938533204673 - y \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + -1\right)\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= y -3.0) (not (<= y 1.7))) (* y -0.5) (- x)))
double code(double x, double y) {
double tmp;
if ((y <= -3.0) || !(y <= 1.7)) {
tmp = y * -0.5;
} 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 ((y <= (-3.0d0)) .or. (.not. (y <= 1.7d0))) then
tmp = y * (-0.5d0)
else
tmp = -x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.0) || !(y <= 1.7)) {
tmp = y * -0.5;
} else {
tmp = -x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.0) or not (y <= 1.7): tmp = y * -0.5 else: tmp = -x return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.0) || !(y <= 1.7)) tmp = Float64(y * -0.5); else tmp = Float64(-x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.0) || ~((y <= 1.7))) tmp = y * -0.5; else tmp = -x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.0], N[Not[LessEqual[y, 1.7]], $MachinePrecision]], N[(y * -0.5), $MachinePrecision], (-x)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \lor \neg \left(y \leq 1.7\right):\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;-x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= y -19.0) (not (<= y 1.85))) (* y -0.5) (- 0.918938533204673 x)))
double code(double x, double y) {
double tmp;
if ((y <= -19.0) || !(y <= 1.85)) {
tmp = y * -0.5;
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-19.0d0)) .or. (.not. (y <= 1.85d0))) then
tmp = y * (-0.5d0)
else
tmp = 0.918938533204673d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -19.0) || !(y <= 1.85)) {
tmp = y * -0.5;
} else {
tmp = 0.918938533204673 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -19.0) or not (y <= 1.85): tmp = y * -0.5 else: tmp = 0.918938533204673 - x return tmp
function code(x, y) tmp = 0.0 if ((y <= -19.0) || !(y <= 1.85)) tmp = Float64(y * -0.5); else tmp = Float64(0.918938533204673 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -19.0) || ~((y <= 1.85))) tmp = y * -0.5; else tmp = 0.918938533204673 - x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -19.0], N[Not[LessEqual[y, 1.85]], $MachinePrecision]], N[(y * -0.5), $MachinePrecision], N[(0.918938533204673 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -19 \lor \neg \left(y \leq 1.85\right):\\
\;\;\;\;y \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;0.918938533204673 - x\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (- x))
double code(double x, double y) {
return -x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = -x
end function
public static double code(double x, double y) {
return -x;
}
def code(x, y): return -x
function code(x, y) return Float64(-x) end
function tmp = code(x, y) tmp = -x; end
code[x_, y_] := (-x)
\begin{array}{l}
\\
-x
\end{array}
herbie shell --seed 2024008
(FPCore (x y)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (* x (- y 1.0)) (* y 0.5)) 0.918938533204673))