
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t - x) * (y - z));
}
def code(x, y, z, t): return x + ((t - x) * (y - z))
function code(x, y, z, t) return Float64(x + Float64(Float64(t - x) * Float64(y - z))) end
function tmp = code(x, y, z, t) tmp = x + ((t - x) * (y - z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t - x\right) \cdot \left(y - z\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1.75e+33)
t_1
(if (<= z -1.05e-109)
(- x (* x y))
(if (<= z 1.32e+54) (- x (* t (- z y))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.75e+33) {
tmp = t_1;
} else if (z <= -1.05e-109) {
tmp = x - (x * y);
} else if (z <= 1.32e+54) {
tmp = x - (t * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-1.75d+33)) then
tmp = t_1
else if (z <= (-1.05d-109)) then
tmp = x - (x * y)
else if (z <= 1.32d+54) then
tmp = x - (t * (z - y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.75e+33) {
tmp = t_1;
} else if (z <= -1.05e-109) {
tmp = x - (x * y);
} else if (z <= 1.32e+54) {
tmp = x - (t * (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.75e+33: tmp = t_1 elif z <= -1.05e-109: tmp = x - (x * y) elif z <= 1.32e+54: tmp = x - (t * (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1.75e+33) tmp = t_1; elseif (z <= -1.05e-109) tmp = Float64(x - Float64(x * y)); elseif (z <= 1.32e+54) tmp = Float64(x - Float64(t * Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -1.75e+33) tmp = t_1; elseif (z <= -1.05e-109) tmp = x - (x * y); elseif (z <= 1.32e+54) tmp = x - (t * (z - y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+33], t$95$1, If[LessEqual[z, -1.05e-109], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.32e+54], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-109}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+54}:\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -1.85e+33)
t_1
(if (<= z -1.92e-109)
(- x (* x y))
(if (<= z 5.5e-67) (+ x (* y t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.85e+33) {
tmp = t_1;
} else if (z <= -1.92e-109) {
tmp = x - (x * y);
} else if (z <= 5.5e-67) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x - t)
if (z <= (-1.85d+33)) then
tmp = t_1
else if (z <= (-1.92d-109)) then
tmp = x - (x * y)
else if (z <= 5.5d-67) then
tmp = x + (y * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -1.85e+33) {
tmp = t_1;
} else if (z <= -1.92e-109) {
tmp = x - (x * y);
} else if (z <= 5.5e-67) {
tmp = x + (y * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -1.85e+33: tmp = t_1 elif z <= -1.92e-109: tmp = x - (x * y) elif z <= 5.5e-67: tmp = x + (y * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -1.85e+33) tmp = t_1; elseif (z <= -1.92e-109) tmp = Float64(x - Float64(x * y)); elseif (z <= 5.5e-67) tmp = Float64(x + Float64(y * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -1.85e+33) tmp = t_1; elseif (z <= -1.92e-109) tmp = x - (x * y); elseif (z <= 5.5e-67) tmp = x + (y * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+33], t$95$1, If[LessEqual[z, -1.92e-109], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-67], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.92 \cdot 10^{-109}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-67}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -9.4e+27) (not (<= x 0.012))) (- x (* x (- y z))) (- x (* t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.4e+27) || !(x <= 0.012)) {
tmp = x - (x * (y - z));
} else {
tmp = x - (t * (z - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-9.4d+27)) .or. (.not. (x <= 0.012d0))) then
tmp = x - (x * (y - z))
else
tmp = x - (t * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -9.4e+27) || !(x <= 0.012)) {
tmp = x - (x * (y - z));
} else {
tmp = x - (t * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -9.4e+27) or not (x <= 0.012): tmp = x - (x * (y - z)) else: tmp = x - (t * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -9.4e+27) || !(x <= 0.012)) tmp = Float64(x - Float64(x * Float64(y - z))); else tmp = Float64(x - Float64(t * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -9.4e+27) || ~((x <= 0.012))) tmp = x - (x * (y - z)); else tmp = x - (t * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -9.4e+27], N[Not[LessEqual[x, 0.012]], $MachinePrecision]], N[(x - N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.4 \cdot 10^{+27} \lor \neg \left(x \leq 0.012\right):\\
\;\;\;\;x - x \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \left(z - y\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.3e+33) (not (<= z 15200.0))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.3e+33) || !(z <= 15200.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.3d+33)) .or. (.not. (z <= 15200.0d0))) then
tmp = z * (x - t)
else
tmp = x + (y * (t - x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.3e+33) || !(z <= 15200.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.3e+33) or not (z <= 15200.0): tmp = z * (x - t) else: tmp = x + (y * (t - x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.3e+33) || !(z <= 15200.0)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * Float64(t - x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.3e+33) || ~((z <= 15200.0))) tmp = z * (x - t); else tmp = x + (y * (t - x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.3e+33], N[Not[LessEqual[z, 15200.0]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+33} \lor \neg \left(z \leq 15200\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= y -6.5e+31) (not (<= y 17500000000000.0))) (+ x (* y (- t x))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.5e+31) || !(y <= 17500000000000.0)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-6.5d+31)) .or. (.not. (y <= 17500000000000.0d0))) then
tmp = x + (y * (t - x))
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.5e+31) || !(y <= 17500000000000.0)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -6.5e+31) or not (y <= 17500000000000.0): tmp = x + (y * (t - x)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.5e+31) || !(y <= 17500000000000.0)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -6.5e+31) || ~((y <= 17500000000000.0))) tmp = x + (y * (t - x)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.5e+31], N[Not[LessEqual[y, 17500000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+31} \lor \neg \left(y \leq 17500000000000\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.5e-74) (not (<= x 5.4e-90))) (* x (+ z 1.0)) (* t (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-74) || !(x <= 5.4e-90)) {
tmp = x * (z + 1.0);
} else {
tmp = t * -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-7.5d-74)) .or. (.not. (x <= 5.4d-90))) then
tmp = x * (z + 1.0d0)
else
tmp = t * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.5e-74) || !(x <= 5.4e-90)) {
tmp = x * (z + 1.0);
} else {
tmp = t * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.5e-74) or not (x <= 5.4e-90): tmp = x * (z + 1.0) else: tmp = t * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.5e-74) || !(x <= 5.4e-90)) tmp = Float64(x * Float64(z + 1.0)); else tmp = Float64(t * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.5e-74) || ~((x <= 5.4e-90))) tmp = x * (z + 1.0); else tmp = t * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.5e-74], N[Not[LessEqual[x, 5.4e-90]], $MachinePrecision]], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], N[(t * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-74} \lor \neg \left(x \leq 5.4 \cdot 10^{-90}\right):\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-z\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.1e-22) (not (<= z 1.5e-67))) (* z (- x t)) (* x (+ z 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-22) || !(z <= 1.5e-67)) {
tmp = z * (x - t);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.1d-22)) .or. (.not. (z <= 1.5d-67))) then
tmp = z * (x - t)
else
tmp = x * (z + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.1e-22) || !(z <= 1.5e-67)) {
tmp = z * (x - t);
} else {
tmp = x * (z + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.1e-22) or not (z <= 1.5e-67): tmp = z * (x - t) else: tmp = x * (z + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.1e-22) || !(z <= 1.5e-67)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x * Float64(z + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.1e-22) || ~((z <= 1.5e-67))) tmp = z * (x - t); else tmp = x * (z + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.1e-22], N[Not[LessEqual[z, 1.5e-67]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-22} \lor \neg \left(z \leq 1.5 \cdot 10^{-67}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.25e-29) (not (<= z 3e-67))) (* z (- x t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e-29) || !(z <= 3e-67)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-2.25d-29)) .or. (.not. (z <= 3d-67))) then
tmp = z * (x - t)
else
tmp = x + (y * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e-29) || !(z <= 3e-67)) {
tmp = z * (x - t);
} else {
tmp = x + (y * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.25e-29) or not (z <= 3e-67): tmp = z * (x - t) else: tmp = x + (y * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.25e-29) || !(z <= 3e-67)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x + Float64(y * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.25e-29) || ~((z <= 3e-67))) tmp = z * (x - t); else tmp = x + (y * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e-29], N[Not[LessEqual[z, 3e-67]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-29} \lor \neg \left(z \leq 3 \cdot 10^{-67}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.6e-22) (not (<= z 5.5e-67))) (* t (- z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-22) || !(z <= 5.5e-67)) {
tmp = t * -z;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.6d-22)) .or. (.not. (z <= 5.5d-67))) then
tmp = t * -z
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-22) || !(z <= 5.5e-67)) {
tmp = t * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.6e-22) or not (z <= 5.5e-67): tmp = t * -z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.6e-22) || !(z <= 5.5e-67)) tmp = Float64(t * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.6e-22) || ~((z <= 5.5e-67))) tmp = t * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.6e-22], N[Not[LessEqual[z, 5.5e-67]], $MachinePrecision]], N[(t * (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-22} \lor \neg \left(z \leq 5.5 \cdot 10^{-67}\right):\\
\;\;\;\;t \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024006
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))