
(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 13 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 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* y (- x))))
(if (<= y -2.95e+18)
t_2
(if (<= y -1.18e-85)
(* z x)
(if (<= y -8.5e-188)
t_1
(if (<= y -6.5e-265)
x
(if (<= y 1.3e-139)
t_1
(if (<= y 1.45e-44) x (if (<= y 2.2e+40) t_1 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double tmp;
if (y <= -2.95e+18) {
tmp = t_2;
} else if (y <= -1.18e-85) {
tmp = z * x;
} else if (y <= -8.5e-188) {
tmp = t_1;
} else if (y <= -6.5e-265) {
tmp = x;
} else if (y <= 1.3e-139) {
tmp = t_1;
} else if (y <= 1.45e-44) {
tmp = x;
} else if (y <= 2.2e+40) {
tmp = t_1;
} else {
tmp = t_2;
}
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 * -t
t_2 = y * -x
if (y <= (-2.95d+18)) then
tmp = t_2
else if (y <= (-1.18d-85)) then
tmp = z * x
else if (y <= (-8.5d-188)) then
tmp = t_1
else if (y <= (-6.5d-265)) then
tmp = x
else if (y <= 1.3d-139) then
tmp = t_1
else if (y <= 1.45d-44) then
tmp = x
else if (y <= 2.2d+40) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double tmp;
if (y <= -2.95e+18) {
tmp = t_2;
} else if (y <= -1.18e-85) {
tmp = z * x;
} else if (y <= -8.5e-188) {
tmp = t_1;
} else if (y <= -6.5e-265) {
tmp = x;
} else if (y <= 1.3e-139) {
tmp = t_1;
} else if (y <= 1.45e-44) {
tmp = x;
} else if (y <= 2.2e+40) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = y * -x tmp = 0 if y <= -2.95e+18: tmp = t_2 elif y <= -1.18e-85: tmp = z * x elif y <= -8.5e-188: tmp = t_1 elif y <= -6.5e-265: tmp = x elif y <= 1.3e-139: tmp = t_1 elif y <= 1.45e-44: tmp = x elif y <= 2.2e+40: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -2.95e+18) tmp = t_2; elseif (y <= -1.18e-85) tmp = Float64(z * x); elseif (y <= -8.5e-188) tmp = t_1; elseif (y <= -6.5e-265) tmp = x; elseif (y <= 1.3e-139) tmp = t_1; elseif (y <= 1.45e-44) tmp = x; elseif (y <= 2.2e+40) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = y * -x; tmp = 0.0; if (y <= -2.95e+18) tmp = t_2; elseif (y <= -1.18e-85) tmp = z * x; elseif (y <= -8.5e-188) tmp = t_1; elseif (y <= -6.5e-265) tmp = x; elseif (y <= 1.3e-139) tmp = t_1; elseif (y <= 1.45e-44) tmp = x; elseif (y <= 2.2e+40) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -2.95e+18], t$95$2, If[LessEqual[y, -1.18e-85], N[(z * x), $MachinePrecision], If[LessEqual[y, -8.5e-188], t$95$1, If[LessEqual[y, -6.5e-265], x, If[LessEqual[y, 1.3e-139], t$95$1, If[LessEqual[y, 1.45e-44], x, If[LessEqual[y, 2.2e+40], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -2.95 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{-85}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-188}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-265}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* y (- t x))) (t_3 (* x (+ z 1.0))))
(if (<= y -90000000000000.0)
t_2
(if (<= y -6.8e-85)
t_3
(if (<= y -4.8e-177)
t_1
(if (<= y 5.2e-43) t_3 (if (<= y 1.65e+38) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * (t - x);
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -90000000000000.0) {
tmp = t_2;
} else if (y <= -6.8e-85) {
tmp = t_3;
} else if (y <= -4.8e-177) {
tmp = t_1;
} else if (y <= 5.2e-43) {
tmp = t_3;
} else if (y <= 1.65e+38) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = z * -t
t_2 = y * (t - x)
t_3 = x * (z + 1.0d0)
if (y <= (-90000000000000.0d0)) then
tmp = t_2
else if (y <= (-6.8d-85)) then
tmp = t_3
else if (y <= (-4.8d-177)) then
tmp = t_1
else if (y <= 5.2d-43) then
tmp = t_3
else if (y <= 1.65d+38) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * (t - x);
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -90000000000000.0) {
tmp = t_2;
} else if (y <= -6.8e-85) {
tmp = t_3;
} else if (y <= -4.8e-177) {
tmp = t_1;
} else if (y <= 5.2e-43) {
tmp = t_3;
} else if (y <= 1.65e+38) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = y * (t - x) t_3 = x * (z + 1.0) tmp = 0 if y <= -90000000000000.0: tmp = t_2 elif y <= -6.8e-85: tmp = t_3 elif y <= -4.8e-177: tmp = t_1 elif y <= 5.2e-43: tmp = t_3 elif y <= 1.65e+38: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -90000000000000.0) tmp = t_2; elseif (y <= -6.8e-85) tmp = t_3; elseif (y <= -4.8e-177) tmp = t_1; elseif (y <= 5.2e-43) tmp = t_3; elseif (y <= 1.65e+38) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = y * (t - x); t_3 = x * (z + 1.0); tmp = 0.0; if (y <= -90000000000000.0) tmp = t_2; elseif (y <= -6.8e-85) tmp = t_3; elseif (y <= -4.8e-177) tmp = t_1; elseif (y <= 5.2e-43) tmp = t_3; elseif (y <= 1.65e+38) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -90000000000000.0], t$95$2, If[LessEqual[y, -6.8e-85], t$95$3, If[LessEqual[y, -4.8e-177], t$95$1, If[LessEqual[y, 5.2e-43], t$95$3, If[LessEqual[y, 1.65e+38], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -90000000000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-85}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -4.8 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-43}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= y -6.6e+18)
t_1
(if (<= y -2.65e-188)
(* z x)
(if (<= y 3.1e-176)
x
(if (<= y 3.3e-136) (* z x) (if (<= y 9.2e-9) x t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (y <= -6.6e+18) {
tmp = t_1;
} else if (y <= -2.65e-188) {
tmp = z * x;
} else if (y <= 3.1e-176) {
tmp = x;
} else if (y <= 3.3e-136) {
tmp = z * x;
} else if (y <= 9.2e-9) {
tmp = x;
} 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 = y * -x
if (y <= (-6.6d+18)) then
tmp = t_1
else if (y <= (-2.65d-188)) then
tmp = z * x
else if (y <= 3.1d-176) then
tmp = x
else if (y <= 3.3d-136) then
tmp = z * x
else if (y <= 9.2d-9) then
tmp = x
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 = y * -x;
double tmp;
if (y <= -6.6e+18) {
tmp = t_1;
} else if (y <= -2.65e-188) {
tmp = z * x;
} else if (y <= 3.1e-176) {
tmp = x;
} else if (y <= 3.3e-136) {
tmp = z * x;
} else if (y <= 9.2e-9) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if y <= -6.6e+18: tmp = t_1 elif y <= -2.65e-188: tmp = z * x elif y <= 3.1e-176: tmp = x elif y <= 3.3e-136: tmp = z * x elif y <= 9.2e-9: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (y <= -6.6e+18) tmp = t_1; elseif (y <= -2.65e-188) tmp = Float64(z * x); elseif (y <= 3.1e-176) tmp = x; elseif (y <= 3.3e-136) tmp = Float64(z * x); elseif (y <= 9.2e-9) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; tmp = 0.0; if (y <= -6.6e+18) tmp = t_1; elseif (y <= -2.65e-188) tmp = z * x; elseif (y <= 3.1e-176) tmp = x; elseif (y <= 3.3e-136) tmp = z * x; elseif (y <= 9.2e-9) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -6.6e+18], t$95$1, If[LessEqual[y, -2.65e-188], N[(z * x), $MachinePrecision], If[LessEqual[y, 3.1e-176], x, If[LessEqual[y, 3.3e-136], N[(z * x), $MachinePrecision], If[LessEqual[y, 9.2e-9], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;y \leq -6.6 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-188}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{-176}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-136}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-9}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* y (- x))) (t_3 (* x (+ z 1.0))))
(if (<= y -4.6e+17)
t_2
(if (<= y -5.5e-86)
t_3
(if (<= y -3.8e-177)
t_1
(if (<= y 7e-44) t_3 (if (<= y 3.4e+41) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -4.6e+17) {
tmp = t_2;
} else if (y <= -5.5e-86) {
tmp = t_3;
} else if (y <= -3.8e-177) {
tmp = t_1;
} else if (y <= 7e-44) {
tmp = t_3;
} else if (y <= 3.4e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = z * -t
t_2 = y * -x
t_3 = x * (z + 1.0d0)
if (y <= (-4.6d+17)) then
tmp = t_2
else if (y <= (-5.5d-86)) then
tmp = t_3
else if (y <= (-3.8d-177)) then
tmp = t_1
else if (y <= 7d-44) then
tmp = t_3
else if (y <= 3.4d+41) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * -x;
double t_3 = x * (z + 1.0);
double tmp;
if (y <= -4.6e+17) {
tmp = t_2;
} else if (y <= -5.5e-86) {
tmp = t_3;
} else if (y <= -3.8e-177) {
tmp = t_1;
} else if (y <= 7e-44) {
tmp = t_3;
} else if (y <= 3.4e+41) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = y * -x t_3 = x * (z + 1.0) tmp = 0 if y <= -4.6e+17: tmp = t_2 elif y <= -5.5e-86: tmp = t_3 elif y <= -3.8e-177: tmp = t_1 elif y <= 7e-44: tmp = t_3 elif y <= 3.4e+41: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(y * Float64(-x)) t_3 = Float64(x * Float64(z + 1.0)) tmp = 0.0 if (y <= -4.6e+17) tmp = t_2; elseif (y <= -5.5e-86) tmp = t_3; elseif (y <= -3.8e-177) tmp = t_1; elseif (y <= 7e-44) tmp = t_3; elseif (y <= 3.4e+41) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = y * -x; t_3 = x * (z + 1.0); tmp = 0.0; if (y <= -4.6e+17) tmp = t_2; elseif (y <= -5.5e-86) tmp = t_3; elseif (y <= -3.8e-177) tmp = t_1; elseif (y <= 7e-44) tmp = t_3; elseif (y <= 3.4e+41) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+17], t$95$2, If[LessEqual[y, -5.5e-86], t$95$3, If[LessEqual[y, -3.8e-177], t$95$1, If[LessEqual[y, 7e-44], t$95$3, If[LessEqual[y, 3.4e+41], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := y \cdot \left(-x\right)\\
t_3 := x \cdot \left(z + 1\right)\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{+17}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{-86}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-44}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -15000000000000.0)
t_1
(if (<= y -1.35e-84)
(* x (+ z 1.0))
(if (<= y 4.4e+38) (- x (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -15000000000000.0) {
tmp = t_1;
} else if (y <= -1.35e-84) {
tmp = x * (z + 1.0);
} else if (y <= 4.4e+38) {
tmp = x - (z * 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 = y * (t - x)
if (y <= (-15000000000000.0d0)) then
tmp = t_1
else if (y <= (-1.35d-84)) then
tmp = x * (z + 1.0d0)
else if (y <= 4.4d+38) then
tmp = x - (z * 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 = y * (t - x);
double tmp;
if (y <= -15000000000000.0) {
tmp = t_1;
} else if (y <= -1.35e-84) {
tmp = x * (z + 1.0);
} else if (y <= 4.4e+38) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -15000000000000.0: tmp = t_1 elif y <= -1.35e-84: tmp = x * (z + 1.0) elif y <= 4.4e+38: tmp = x - (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -15000000000000.0) tmp = t_1; elseif (y <= -1.35e-84) tmp = Float64(x * Float64(z + 1.0)); elseif (y <= 4.4e+38) tmp = Float64(x - Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -15000000000000.0) tmp = t_1; elseif (y <= -1.35e-84) tmp = x * (z + 1.0); elseif (y <= 4.4e+38) tmp = x - (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -15000000000000.0], t$95$1, If[LessEqual[y, -1.35e-84], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+38], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -15000000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.35 \cdot 10^{-84}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+38}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))))
(if (<= y -3.8e+68)
t_1
(if (<= y -6.4e-85)
(* x (+ (- z y) 1.0))
(if (<= y 1.65e+38) (- x (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double tmp;
if (y <= -3.8e+68) {
tmp = t_1;
} else if (y <= -6.4e-85) {
tmp = x * ((z - y) + 1.0);
} else if (y <= 1.65e+38) {
tmp = x - (z * 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 = y * (t - x)
if (y <= (-3.8d+68)) then
tmp = t_1
else if (y <= (-6.4d-85)) then
tmp = x * ((z - y) + 1.0d0)
else if (y <= 1.65d+38) then
tmp = x - (z * 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 = y * (t - x);
double tmp;
if (y <= -3.8e+68) {
tmp = t_1;
} else if (y <= -6.4e-85) {
tmp = x * ((z - y) + 1.0);
} else if (y <= 1.65e+38) {
tmp = x - (z * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) tmp = 0 if y <= -3.8e+68: tmp = t_1 elif y <= -6.4e-85: tmp = x * ((z - y) + 1.0) elif y <= 1.65e+38: tmp = x - (z * t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) tmp = 0.0 if (y <= -3.8e+68) tmp = t_1; elseif (y <= -6.4e-85) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); elseif (y <= 1.65e+38) tmp = Float64(x - Float64(z * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); tmp = 0.0; if (y <= -3.8e+68) tmp = t_1; elseif (y <= -6.4e-85) tmp = x * ((z - y) + 1.0); elseif (y <= 1.65e+38) tmp = x - (z * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e+68], t$95$1, If[LessEqual[y, -6.4e-85], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e+38], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{+68}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -6.4 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{+38}:\\
\;\;\;\;x - z \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= x -7.8e+59) (not (<= x 7e+17))) (* x (+ (- z y) 1.0)) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+59) || !(x <= 7e+17)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * 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 ((x <= (-7.8d+59)) .or. (.not. (x <= 7d+17))) then
tmp = x * ((z - y) + 1.0d0)
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -7.8e+59) || !(x <= 7e+17)) {
tmp = x * ((z - y) + 1.0);
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -7.8e+59) or not (x <= 7e+17): tmp = x * ((z - y) + 1.0) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -7.8e+59) || !(x <= 7e+17)) tmp = Float64(x * Float64(Float64(z - y) + 1.0)); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -7.8e+59) || ~((x <= 7e+17))) tmp = x * ((z - y) + 1.0); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -7.8e+59], N[Not[LessEqual[x, 7e+17]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+59} \lor \neg \left(x \leq 7 \cdot 10^{+17}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.2e+14) (not (<= y 4e+49))) (* y (- t x)) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.2e+14) || !(y <= 4e+49)) {
tmp = 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 <= (-2.2d+14)) .or. (.not. (y <= 4d+49))) then
tmp = 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 <= -2.2e+14) || !(y <= 4e+49)) {
tmp = y * (t - x);
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.2e+14) or not (y <= 4e+49): tmp = y * (t - x) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.2e+14) || !(y <= 4e+49)) tmp = 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 <= -2.2e+14) || ~((y <= 4e+49))) tmp = y * (t - x); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.2e+14], N[Not[LessEqual[y, 4e+49]], $MachinePrecision]], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+14} \lor \neg \left(y \leq 4 \cdot 10^{+49}\right):\\
\;\;\;\;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 (<= z -1.2e+72) (not (<= z 2e+95))) (* z (- t)) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+72) || !(z <= 2e+95)) {
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 <= (-1.2d+72)) .or. (.not. (z <= 2d+95))) 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 <= -1.2e+72) || !(z <= 2e+95)) {
tmp = z * -t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.2e+72) or not (z <= 2e+95): tmp = z * -t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.2e+72) || !(z <= 2e+95)) 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 <= -1.2e+72) || ~((z <= 2e+95))) tmp = z * -t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.2e+72], N[Not[LessEqual[z, 2e+95]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+72} \lor \neg \left(z \leq 2 \cdot 10^{+95}\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 (+ 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 (if (or (<= z -25500.0) (not (<= z 14.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -25500.0) || !(z <= 14.0)) {
tmp = z * x;
} 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 <= (-25500.0d0)) .or. (.not. (z <= 14.0d0))) then
tmp = z * x
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 <= -25500.0) || !(z <= 14.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -25500.0) or not (z <= 14.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -25500.0) || !(z <= 14.0)) tmp = Float64(z * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -25500.0) || ~((z <= 14.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -25500.0], N[Not[LessEqual[z, 14.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -25500 \lor \neg \left(z \leq 14\right):\\
\;\;\;\;z \cdot x\\
\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 2023350
(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))))