
(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 (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 (- (* y x))))
(if (<= y -3.1e+69)
t_1
(if (<= y -8.8e-141)
(* z x)
(if (<= y 3.95e-44)
x
(if (<= y 4.2e+75)
(* z x)
(if (or (<= y 3.2e+157)
(and (not (<= y 1.35e+234)) (<= y 8.6e+293)))
t_1
(* y t))))))))
double code(double x, double y, double z, double t) {
double t_1 = -(y * x);
double tmp;
if (y <= -3.1e+69) {
tmp = t_1;
} else if (y <= -8.8e-141) {
tmp = z * x;
} else if (y <= 3.95e-44) {
tmp = x;
} else if (y <= 4.2e+75) {
tmp = z * x;
} else if ((y <= 3.2e+157) || (!(y <= 1.35e+234) && (y <= 8.6e+293))) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = -(y * x)
if (y <= (-3.1d+69)) then
tmp = t_1
else if (y <= (-8.8d-141)) then
tmp = z * x
else if (y <= 3.95d-44) then
tmp = x
else if (y <= 4.2d+75) then
tmp = z * x
else if ((y <= 3.2d+157) .or. (.not. (y <= 1.35d+234)) .and. (y <= 8.6d+293)) then
tmp = t_1
else
tmp = y * t
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 <= -3.1e+69) {
tmp = t_1;
} else if (y <= -8.8e-141) {
tmp = z * x;
} else if (y <= 3.95e-44) {
tmp = x;
} else if (y <= 4.2e+75) {
tmp = z * x;
} else if ((y <= 3.2e+157) || (!(y <= 1.35e+234) && (y <= 8.6e+293))) {
tmp = t_1;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = -(y * x) tmp = 0 if y <= -3.1e+69: tmp = t_1 elif y <= -8.8e-141: tmp = z * x elif y <= 3.95e-44: tmp = x elif y <= 4.2e+75: tmp = z * x elif (y <= 3.2e+157) or (not (y <= 1.35e+234) and (y <= 8.6e+293)): tmp = t_1 else: tmp = y * t return tmp
function code(x, y, z, t) t_1 = Float64(-Float64(y * x)) tmp = 0.0 if (y <= -3.1e+69) tmp = t_1; elseif (y <= -8.8e-141) tmp = Float64(z * x); elseif (y <= 3.95e-44) tmp = x; elseif (y <= 4.2e+75) tmp = Float64(z * x); elseif ((y <= 3.2e+157) || (!(y <= 1.35e+234) && (y <= 8.6e+293))) tmp = t_1; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -(y * x); tmp = 0.0; if (y <= -3.1e+69) tmp = t_1; elseif (y <= -8.8e-141) tmp = z * x; elseif (y <= 3.95e-44) tmp = x; elseif (y <= 4.2e+75) tmp = z * x; elseif ((y <= 3.2e+157) || (~((y <= 1.35e+234)) && (y <= 8.6e+293))) tmp = t_1; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = (-N[(y * x), $MachinePrecision])}, If[LessEqual[y, -3.1e+69], t$95$1, If[LessEqual[y, -8.8e-141], N[(z * x), $MachinePrecision], If[LessEqual[y, 3.95e-44], x, If[LessEqual[y, 4.2e+75], N[(z * x), $MachinePrecision], If[Or[LessEqual[y, 3.2e+157], And[N[Not[LessEqual[y, 1.35e+234]], $MachinePrecision], LessEqual[y, 8.6e+293]]], t$95$1, N[(y * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -y \cdot x\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.8 \cdot 10^{-141}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 3.95 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+75}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+157} \lor \neg \left(y \leq 1.35 \cdot 10^{+234}\right) \land y \leq 8.6 \cdot 10^{+293}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- x t))))
(if (<= z -0.06)
t_1
(if (<= z 6.5e-231)
(* x (- 1.0 y))
(if (<= z 64000000000.0) (* (- y z) t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x - t);
double tmp;
if (z <= -0.06) {
tmp = t_1;
} else if (z <= 6.5e-231) {
tmp = x * (1.0 - y);
} else if (z <= 64000000000.0) {
tmp = (y - 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 = z * (x - t)
if (z <= (-0.06d0)) then
tmp = t_1
else if (z <= 6.5d-231) then
tmp = x * (1.0d0 - y)
else if (z <= 64000000000.0d0) then
tmp = (y - 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 = z * (x - t);
double tmp;
if (z <= -0.06) {
tmp = t_1;
} else if (z <= 6.5e-231) {
tmp = x * (1.0 - y);
} else if (z <= 64000000000.0) {
tmp = (y - z) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x - t) tmp = 0 if z <= -0.06: tmp = t_1 elif z <= 6.5e-231: tmp = x * (1.0 - y) elif z <= 64000000000.0: tmp = (y - z) * 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 <= -0.06) tmp = t_1; elseif (z <= 6.5e-231) tmp = Float64(x * Float64(1.0 - y)); elseif (z <= 64000000000.0) tmp = Float64(Float64(y - z) * 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 <= -0.06) tmp = t_1; elseif (z <= 6.5e-231) tmp = x * (1.0 - y); elseif (z <= 64000000000.0) tmp = (y - z) * 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, -0.06], t$95$1, If[LessEqual[z, 6.5e-231], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 64000000000.0], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
\mathbf{if}\;z \leq -0.06:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-231}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\
\mathbf{elif}\;z \leq 64000000000:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.1e+57) (not (<= t 7e+72))) (* (- y z) t) (* x (- 1.0 (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.1e+57) || !(t <= 7e+72)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - (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 <= (-1.1d+57)) .or. (.not. (t <= 7d+72))) then
tmp = (y - z) * t
else
tmp = x * (1.0d0 - (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.1e+57) || !(t <= 7e+72)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.1e+57) or not (t <= 7e+72): tmp = (y - z) * t else: tmp = x * (1.0 - (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.1e+57) || !(t <= 7e+72)) tmp = Float64(Float64(y - z) * t); else tmp = Float64(x * Float64(1.0 - Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.1e+57) || ~((t <= 7e+72))) tmp = (y - z) * t; else tmp = x * (1.0 - (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.1e+57], N[Not[LessEqual[t, 7e+72]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+57} \lor \neg \left(t \leq 7 \cdot 10^{+72}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \left(y - z\right)\right)\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.0) (not (<= z 86000000000.0))) (* z (- x t)) (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.0) || !(z <= 86000000000.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.0d0)) .or. (.not. (z <= 86000000000.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.0) || !(z <= 86000000000.0)) {
tmp = z * (x - t);
} else {
tmp = x + (y * (t - x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.0) or not (z <= 86000000000.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.0) || !(z <= 86000000000.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.0) || ~((z <= 86000000000.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.0], N[Not[LessEqual[z, 86000000000.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 \lor \neg \left(z \leq 86000000000\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 (<= x -1.15e+15) (* z x) (if (<= x 1200000000.0) (* z (- t)) (if (<= x 2.4e+113) x (- (* y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.15e+15) {
tmp = z * x;
} else if (x <= 1200000000.0) {
tmp = z * -t;
} else if (x <= 2.4e+113) {
tmp = x;
} else {
tmp = -(y * 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 (x <= (-1.15d+15)) then
tmp = z * x
else if (x <= 1200000000.0d0) then
tmp = z * -t
else if (x <= 2.4d+113) then
tmp = x
else
tmp = -(y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.15e+15) {
tmp = z * x;
} else if (x <= 1200000000.0) {
tmp = z * -t;
} else if (x <= 2.4e+113) {
tmp = x;
} else {
tmp = -(y * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.15e+15: tmp = z * x elif x <= 1200000000.0: tmp = z * -t elif x <= 2.4e+113: tmp = x else: tmp = -(y * x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.15e+15) tmp = Float64(z * x); elseif (x <= 1200000000.0) tmp = Float64(z * Float64(-t)); elseif (x <= 2.4e+113) tmp = x; else tmp = Float64(-Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.15e+15) tmp = z * x; elseif (x <= 1200000000.0) tmp = z * -t; elseif (x <= 2.4e+113) tmp = x; else tmp = -(y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.15e+15], N[(z * x), $MachinePrecision], If[LessEqual[x, 1200000000.0], N[(z * (-t)), $MachinePrecision], If[LessEqual[x, 2.4e+113], x, (-N[(y * x), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1200000000:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+113}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-y \cdot x\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e+143) (* z x) (if (<= x 2600000000.0) (* (- y z) t) (if (<= x 1.4e+120) x (- (* y x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e+143) {
tmp = z * x;
} else if (x <= 2600000000.0) {
tmp = (y - z) * t;
} else if (x <= 1.4e+120) {
tmp = x;
} else {
tmp = -(y * 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 (x <= (-1.35d+143)) then
tmp = z * x
else if (x <= 2600000000.0d0) then
tmp = (y - z) * t
else if (x <= 1.4d+120) then
tmp = x
else
tmp = -(y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e+143) {
tmp = z * x;
} else if (x <= 2600000000.0) {
tmp = (y - z) * t;
} else if (x <= 1.4e+120) {
tmp = x;
} else {
tmp = -(y * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e+143: tmp = z * x elif x <= 2600000000.0: tmp = (y - z) * t elif x <= 1.4e+120: tmp = x else: tmp = -(y * x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.35e+143) tmp = Float64(z * x); elseif (x <= 2600000000.0) tmp = Float64(Float64(y - z) * t); elseif (x <= 1.4e+120) tmp = x; else tmp = Float64(-Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.35e+143) tmp = z * x; elseif (x <= 2600000000.0) tmp = (y - z) * t; elseif (x <= 1.4e+120) tmp = x; else tmp = -(y * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.35e+143], N[(z * x), $MachinePrecision], If[LessEqual[x, 2600000000.0], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[x, 1.4e+120], x, (-N[(y * x), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+143}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 2600000000:\\
\;\;\;\;\left(y - z\right) \cdot t\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+120}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;-y \cdot x\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= y -2.6e+91) (* y t) (if (<= y -7e-142) (* z x) (if (<= y 1.12e-61) x (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+91) {
tmp = y * t;
} else if (y <= -7e-142) {
tmp = z * x;
} else if (y <= 1.12e-61) {
tmp = x;
} else {
tmp = 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 (y <= (-2.6d+91)) then
tmp = y * t
else if (y <= (-7d-142)) then
tmp = z * x
else if (y <= 1.12d-61) then
tmp = x
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.6e+91) {
tmp = y * t;
} else if (y <= -7e-142) {
tmp = z * x;
} else if (y <= 1.12e-61) {
tmp = x;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.6e+91: tmp = y * t elif y <= -7e-142: tmp = z * x elif y <= 1.12e-61: tmp = x else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.6e+91) tmp = Float64(y * t); elseif (y <= -7e-142) tmp = Float64(z * x); elseif (y <= 1.12e-61) tmp = x; else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.6e+91) tmp = y * t; elseif (y <= -7e-142) tmp = z * x; elseif (y <= 1.12e-61) tmp = x; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.6e+91], N[(y * t), $MachinePrecision], If[LessEqual[y, -7e-142], N[(z * x), $MachinePrecision], If[LessEqual[y, 1.12e-61], x, N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+91}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq -7 \cdot 10^{-142}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{-61}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.5e-23) (not (<= t 1.18e-113))) (* (- y z) t) (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e-23) || !(t <= 1.18e-113)) {
tmp = (y - 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 ((t <= (-9.5d-23)) .or. (.not. (t <= 1.18d-113))) then
tmp = (y - 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 ((t <= -9.5e-23) || !(t <= 1.18e-113)) {
tmp = (y - z) * t;
} else {
tmp = x * (1.0 - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.5e-23) or not (t <= 1.18e-113): tmp = (y - z) * t else: tmp = x * (1.0 - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.5e-23) || !(t <= 1.18e-113)) tmp = Float64(Float64(y - z) * 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 ((t <= -9.5e-23) || ~((t <= 1.18e-113))) tmp = (y - z) * t; else tmp = x * (1.0 - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.5e-23], N[Not[LessEqual[t, 1.18e-113]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-23} \lor \neg \left(t \leq 1.18 \cdot 10^{-113}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\
\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 -0.94) (not (<= z 1.0))) (* z x) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -0.94) || !(z <= 1.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 <= (-0.94d0)) .or. (.not. (z <= 1.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 <= -0.94) || !(z <= 1.0)) {
tmp = z * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -0.94) or not (z <= 1.0): tmp = z * x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -0.94) || !(z <= 1.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 <= -0.94) || ~((z <= 1.0))) tmp = z * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -0.94], N[Not[LessEqual[z, 1.0]], $MachinePrecision]], N[(z * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.94 \lor \neg \left(z \leq 1\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 2023343
(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))))