
(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 12 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
(if (or (<= t -1650000.0)
(not (or (<= t 6.5e+33) (and (not (<= t 4.8e+83)) (<= t 3.5e+126)))))
(+ x (* t (- y z)))
(- x (* x (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1650000.0) || !((t <= 6.5e+33) || (!(t <= 4.8e+83) && (t <= 3.5e+126)))) {
tmp = x + (t * (y - z));
} else {
tmp = x - (x * (y - 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 ((t <= (-1650000.0d0)) .or. (.not. (t <= 6.5d+33) .or. (.not. (t <= 4.8d+83)) .and. (t <= 3.5d+126))) then
tmp = x + (t * (y - z))
else
tmp = x - (x * (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1650000.0) || !((t <= 6.5e+33) || (!(t <= 4.8e+83) && (t <= 3.5e+126)))) {
tmp = x + (t * (y - z));
} else {
tmp = x - (x * (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1650000.0) or not ((t <= 6.5e+33) or (not (t <= 4.8e+83) and (t <= 3.5e+126))): tmp = x + (t * (y - z)) else: tmp = x - (x * (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1650000.0) || !((t <= 6.5e+33) || (!(t <= 4.8e+83) && (t <= 3.5e+126)))) tmp = Float64(x + Float64(t * Float64(y - z))); else tmp = Float64(x - Float64(x * Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1650000.0) || ~(((t <= 6.5e+33) || (~((t <= 4.8e+83)) && (t <= 3.5e+126))))) tmp = x + (t * (y - z)); else tmp = x - (x * (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1650000.0], N[Not[Or[LessEqual[t, 6.5e+33], And[N[Not[LessEqual[t, 4.8e+83]], $MachinePrecision], LessEqual[t, 3.5e+126]]]], $MachinePrecision]], N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1650000 \lor \neg \left(t \leq 6.5 \cdot 10^{+33} \lor \neg \left(t \leq 4.8 \cdot 10^{+83}\right) \land t \leq 3.5 \cdot 10^{+126}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y - z\right)\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))) (t_2 (* z (- t))))
(if (<= y -1.5e+166)
t_1
(if (<= y -3.5e+132)
t_2
(if (<= y -1.0)
t_1
(if (<= y 1.66e-251) x (if (<= y 1.6e+61) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double t_2 = z * -t;
double tmp;
if (y <= -1.5e+166) {
tmp = t_1;
} else if (y <= -3.5e+132) {
tmp = t_2;
} else if (y <= -1.0) {
tmp = t_1;
} else if (y <= 1.66e-251) {
tmp = x;
} else if (y <= 1.6e+61) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * -y
t_2 = z * -t
if (y <= (-1.5d+166)) then
tmp = t_1
else if (y <= (-3.5d+132)) then
tmp = t_2
else if (y <= (-1.0d0)) then
tmp = t_1
else if (y <= 1.66d-251) then
tmp = x
else if (y <= 1.6d+61) then
tmp = t_2
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 = x * -y;
double t_2 = z * -t;
double tmp;
if (y <= -1.5e+166) {
tmp = t_1;
} else if (y <= -3.5e+132) {
tmp = t_2;
} else if (y <= -1.0) {
tmp = t_1;
} else if (y <= 1.66e-251) {
tmp = x;
} else if (y <= 1.6e+61) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y t_2 = z * -t tmp = 0 if y <= -1.5e+166: tmp = t_1 elif y <= -3.5e+132: tmp = t_2 elif y <= -1.0: tmp = t_1 elif y <= 1.66e-251: tmp = x elif y <= 1.6e+61: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) t_2 = Float64(z * Float64(-t)) tmp = 0.0 if (y <= -1.5e+166) tmp = t_1; elseif (y <= -3.5e+132) tmp = t_2; elseif (y <= -1.0) tmp = t_1; elseif (y <= 1.66e-251) tmp = x; elseif (y <= 1.6e+61) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; t_2 = z * -t; tmp = 0.0; if (y <= -1.5e+166) tmp = t_1; elseif (y <= -3.5e+132) tmp = t_2; elseif (y <= -1.0) tmp = t_1; elseif (y <= 1.66e-251) tmp = x; elseif (y <= 1.6e+61) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.5e+166], t$95$1, If[LessEqual[y, -3.5e+132], t$95$2, If[LessEqual[y, -1.0], t$95$1, If[LessEqual[y, 1.66e-251], x, If[LessEqual[y, 1.6e+61], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
t_2 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+166}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{+132}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.66 \cdot 10^{-251}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+61}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))) (t_2 (* x (- 1.0 y))))
(if (<= z -4.4e+134)
t_1
(if (<= z -2.7e-164)
t_2
(if (<= z -1.85e-271)
(+ x (* y t))
(if (<= z 80000000000.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double t_2 = x * (1.0 - y);
double tmp;
if (z <= -4.4e+134) {
tmp = t_1;
} else if (z <= -2.7e-164) {
tmp = t_2;
} else if (z <= -1.85e-271) {
tmp = x + (y * t);
} else if (z <= 80000000000.0) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = z * (x - t)
t_2 = x * (1.0d0 - y)
if (z <= (-4.4d+134)) then
tmp = t_1
else if (z <= (-2.7d-164)) then
tmp = t_2
else if (z <= (-1.85d-271)) then
tmp = x + (y * t)
else if (z <= 80000000000.0d0) then
tmp = t_2
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 t_2 = x * (1.0 - y);
double tmp;
if (z <= -4.4e+134) {
tmp = t_1;
} else if (z <= -2.7e-164) {
tmp = t_2;
} else if (z <= -1.85e-271) {
tmp = x + (y * t);
} else if (z <= 80000000000.0) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) t_2 = x * (1.0 - y) tmp = 0 if z <= -4.4e+134: tmp = t_1 elif z <= -2.7e-164: tmp = t_2 elif z <= -1.85e-271: tmp = x + (y * t) elif z <= 80000000000.0: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) t_2 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -4.4e+134) tmp = t_1; elseif (z <= -2.7e-164) tmp = t_2; elseif (z <= -1.85e-271) tmp = Float64(x + Float64(y * t)); elseif (z <= 80000000000.0) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); t_2 = x * (1.0 - y); tmp = 0.0; if (z <= -4.4e+134) tmp = t_1; elseif (z <= -2.7e-164) tmp = t_2; elseif (z <= -1.85e-271) tmp = x + (y * t); elseif (z <= 80000000000.0) tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.4e+134], t$95$1, If[LessEqual[z, -2.7e-164], t$95$2, If[LessEqual[z, -1.85e-271], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 80000000000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-164}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-271}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 80000000000:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -4.4e+134)
t_1
(if (<= z -2.4e-161)
(- x (* x y))
(if (<= z -4.3e-271)
(+ x (* y t))
(if (<= z 86000000000000.0) (* x (- 1.0 y)) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -4.4e+134) {
tmp = t_1;
} else if (z <= -2.4e-161) {
tmp = x - (x * y);
} else if (z <= -4.3e-271) {
tmp = x + (y * t);
} else if (z <= 86000000000000.0) {
tmp = x * (1.0 - 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 <= (-4.4d+134)) then
tmp = t_1
else if (z <= (-2.4d-161)) then
tmp = x - (x * y)
else if (z <= (-4.3d-271)) then
tmp = x + (y * t)
else if (z <= 86000000000000.0d0) then
tmp = x * (1.0d0 - 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 <= -4.4e+134) {
tmp = t_1;
} else if (z <= -2.4e-161) {
tmp = x - (x * y);
} else if (z <= -4.3e-271) {
tmp = x + (y * t);
} else if (z <= 86000000000000.0) {
tmp = x * (1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -4.4e+134: tmp = t_1 elif z <= -2.4e-161: tmp = x - (x * y) elif z <= -4.3e-271: tmp = x + (y * t) elif z <= 86000000000000.0: tmp = x * (1.0 - 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 <= -4.4e+134) tmp = t_1; elseif (z <= -2.4e-161) tmp = Float64(x - Float64(x * y)); elseif (z <= -4.3e-271) tmp = Float64(x + Float64(y * t)); elseif (z <= 86000000000000.0) tmp = Float64(x * Float64(1.0 - 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 <= -4.4e+134) tmp = t_1; elseif (z <= -2.4e-161) tmp = x - (x * y); elseif (z <= -4.3e-271) tmp = x + (y * t); elseif (z <= 86000000000000.0) tmp = x * (1.0 - 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, -4.4e+134], t$95$1, If[LessEqual[z, -2.4e-161], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.3e-271], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 86000000000000.0], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-161}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-271}:\\
\;\;\;\;x + y \cdot t\\
\mathbf{elif}\;z \leq 86000000000000:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.4e+134) (not (<= z 2.05e+34))) (* z (- x t)) (- x (* y (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+134) || !(z <= 2.05e+34)) {
tmp = z * (x - t);
} else {
tmp = x - (y * (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 ((z <= (-4.4d+134)) .or. (.not. (z <= 2.05d+34))) then
tmp = z * (x - t)
else
tmp = x - (y * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+134) || !(z <= 2.05e+34)) {
tmp = z * (x - t);
} else {
tmp = x - (y * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.4e+134) or not (z <= 2.05e+34): tmp = z * (x - t) else: tmp = x - (y * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.4e+134) || !(z <= 2.05e+34)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x - Float64(y * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.4e+134) || ~((z <= 2.05e+34))) tmp = z * (x - t); else tmp = x - (y * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.4e+134], N[Not[LessEqual[z, 2.05e+34]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134} \lor \neg \left(z \leq 2.05 \cdot 10^{+34}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= x -1.75e+111) (+ x (* x z)) (if (<= x 1.8e-46) (+ x (* (- y z) t)) (- x (* x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.75e+111) {
tmp = x + (x * z);
} else if (x <= 1.8e-46) {
tmp = x + ((y - z) * t);
} else {
tmp = x - (x * 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 <= (-1.75d+111)) then
tmp = x + (x * z)
else if (x <= 1.8d-46) then
tmp = x + ((y - z) * t)
else
tmp = x - (x * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.75e+111) {
tmp = x + (x * z);
} else if (x <= 1.8e-46) {
tmp = x + ((y - z) * t);
} else {
tmp = x - (x * y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.75e+111: tmp = x + (x * z) elif x <= 1.8e-46: tmp = x + ((y - z) * t) else: tmp = x - (x * y) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.75e+111) tmp = Float64(x + Float64(x * z)); elseif (x <= 1.8e-46) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x - Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.75e+111) tmp = x + (x * z); elseif (x <= 1.8e-46) tmp = x + ((y - z) * t); else tmp = x - (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.75e+111], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-46], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.75 \cdot 10^{+111}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-46}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot y\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -4.4e+134)
t_1
(if (<= z 1.02e+34) (- x (* y (- x t))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -4.4e+134) {
tmp = t_1;
} else if (z <= 1.02e+34) {
tmp = x - (y * (x - t));
} else {
tmp = x + 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 <= (-4.4d+134)) then
tmp = t_1
else if (z <= 1.02d+34) then
tmp = x - (y * (x - t))
else
tmp = x + 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 <= -4.4e+134) {
tmp = t_1;
} else if (z <= 1.02e+34) {
tmp = x - (y * (x - t));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -4.4e+134: tmp = t_1 elif z <= 1.02e+34: tmp = x - (y * (x - t)) else: tmp = x + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x - t)) tmp = 0.0 if (z <= -4.4e+134) tmp = t_1; elseif (z <= 1.02e+34) tmp = Float64(x - Float64(y * Float64(x - t))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x - t); tmp = 0.0; if (z <= -4.4e+134) tmp = t_1; elseif (z <= 1.02e+34) tmp = x - (y * (x - t)); else tmp = x + 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, -4.4e+134], t$95$1, If[LessEqual[z, 1.02e+34], N[(x - N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+34}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -5e+134) (not (<= z 8e+19))) (* z (- t)) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e+134) || !(z <= 8e+19)) {
tmp = z * -t;
} else {
tmp = x * (1.0 - 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 ((z <= (-5d+134)) .or. (.not. (z <= 8d+19))) then
tmp = z * -t
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5e+134) || !(z <= 8e+19)) {
tmp = z * -t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5e+134) or not (z <= 8e+19): tmp = z * -t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5e+134) || !(z <= 8e+19)) tmp = Float64(z * Float64(-t)); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5e+134) || ~((z <= 8e+19))) tmp = z * -t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5e+134], N[Not[LessEqual[z, 8e+19]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+134} \lor \neg \left(z \leq 8 \cdot 10^{+19}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -4.4e+134) (not (<= z 1550000000000.0))) (* z (- x t)) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+134) || !(z <= 1550000000000.0)) {
tmp = z * (x - t);
} else {
tmp = x * (1.0 - 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 ((z <= (-4.4d+134)) .or. (.not. (z <= 1550000000000.0d0))) then
tmp = z * (x - t)
else
tmp = x * (1.0d0 - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -4.4e+134) || !(z <= 1550000000000.0)) {
tmp = z * (x - t);
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -4.4e+134) or not (z <= 1550000000000.0): tmp = z * (x - t) else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -4.4e+134) || !(z <= 1550000000000.0)) tmp = Float64(z * Float64(x - t)); else tmp = Float64(x * Float64(1.0 - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -4.4e+134) || ~((z <= 1550000000000.0))) tmp = z * (x - t); else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.4e+134], N[Not[LessEqual[z, 1550000000000.0]], $MachinePrecision]], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+134} \lor \neg \left(z \leq 1550000000000\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.36e-24) (not (<= z 3.1e-97))) (* z (- t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.36e-24) || !(z <= 3.1e-97)) {
tmp = z * -t;
} 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.36d-24)) .or. (.not. (z <= 3.1d-97))) then
tmp = z * -t
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.36e-24) || !(z <= 3.1e-97)) {
tmp = z * -t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.36e-24) or not (z <= 3.1e-97): tmp = z * -t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.36e-24) || !(z <= 3.1e-97)) tmp = Float64(z * Float64(-t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.36e-24) || ~((z <= 3.1e-97))) tmp = z * -t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.36e-24], N[Not[LessEqual[z, 3.1e-97]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{-24} \lor \neg \left(z \leq 3.1 \cdot 10^{-97}\right):\\
\;\;\;\;z \cdot \left(-t\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 2024008
(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))))