
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) z)))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * z)
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * z);
}
def code(x, y, z): return x + (((y - x) * 6.0) * z)
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * z)) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * z); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (* 6.0 z))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) * (6.0d0 * z))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * z));
}
def code(x, y, z): return x + ((y - x) * (6.0 * z))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * z))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * z)); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot z\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y z))) (t_1 (* -6.0 (* x z))))
(if (<= z -6.6e+184)
t_0
(if (<= z -4.7e+17)
t_1
(if (<= z -4.5e-111)
t_0
(if (<= z 2.6e-14)
x
(if (or (<= z 1.9e+26)
(and (not (<= z 1.7e+75))
(or (<= z 1.8e+214) (not (<= z 3e+252)))))
t_0
t_1)))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -6.6e+184) {
tmp = t_0;
} else if (z <= -4.7e+17) {
tmp = t_1;
} else if (z <= -4.5e-111) {
tmp = t_0;
} else if (z <= 2.6e-14) {
tmp = x;
} else if ((z <= 1.9e+26) || (!(z <= 1.7e+75) && ((z <= 1.8e+214) || !(z <= 3e+252)))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * z)
t_1 = (-6.0d0) * (x * z)
if (z <= (-6.6d+184)) then
tmp = t_0
else if (z <= (-4.7d+17)) then
tmp = t_1
else if (z <= (-4.5d-111)) then
tmp = t_0
else if (z <= 2.6d-14) then
tmp = x
else if ((z <= 1.9d+26) .or. (.not. (z <= 1.7d+75)) .and. (z <= 1.8d+214) .or. (.not. (z <= 3d+252))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = -6.0 * (x * z);
double tmp;
if (z <= -6.6e+184) {
tmp = t_0;
} else if (z <= -4.7e+17) {
tmp = t_1;
} else if (z <= -4.5e-111) {
tmp = t_0;
} else if (z <= 2.6e-14) {
tmp = x;
} else if ((z <= 1.9e+26) || (!(z <= 1.7e+75) && ((z <= 1.8e+214) || !(z <= 3e+252)))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) t_1 = -6.0 * (x * z) tmp = 0 if z <= -6.6e+184: tmp = t_0 elif z <= -4.7e+17: tmp = t_1 elif z <= -4.5e-111: tmp = t_0 elif z <= 2.6e-14: tmp = x elif (z <= 1.9e+26) or (not (z <= 1.7e+75) and ((z <= 1.8e+214) or not (z <= 3e+252))): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) t_1 = Float64(-6.0 * Float64(x * z)) tmp = 0.0 if (z <= -6.6e+184) tmp = t_0; elseif (z <= -4.7e+17) tmp = t_1; elseif (z <= -4.5e-111) tmp = t_0; elseif (z <= 2.6e-14) tmp = x; elseif ((z <= 1.9e+26) || (!(z <= 1.7e+75) && ((z <= 1.8e+214) || !(z <= 3e+252)))) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); t_1 = -6.0 * (x * z); tmp = 0.0; if (z <= -6.6e+184) tmp = t_0; elseif (z <= -4.7e+17) tmp = t_1; elseif (z <= -4.5e-111) tmp = t_0; elseif (z <= 2.6e-14) tmp = x; elseif ((z <= 1.9e+26) || (~((z <= 1.7e+75)) && ((z <= 1.8e+214) || ~((z <= 3e+252))))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+184], t$95$0, If[LessEqual[z, -4.7e+17], t$95$1, If[LessEqual[z, -4.5e-111], t$95$0, If[LessEqual[z, 2.6e-14], x, If[Or[LessEqual[z, 1.9e+26], And[N[Not[LessEqual[z, 1.7e+75]], $MachinePrecision], Or[LessEqual[z, 1.8e+214], N[Not[LessEqual[z, 3e+252]], $MachinePrecision]]]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
t_1 := -6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+26} \lor \neg \left(z \leq 1.7 \cdot 10^{+75}\right) \land \left(z \leq 1.8 \cdot 10^{+214} \lor \neg \left(z \leq 3 \cdot 10^{+252}\right)\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y z))) (t_1 (* x (* z -6.0))))
(if (<= z -3.1e+184)
t_0
(if (<= z -4.3e+17)
t_1
(if (<= z -2.05e-111)
t_0
(if (<= z 8.2e-15)
x
(if (<= z 1.6e+31)
t_0
(if (<= z 6.4e+73)
t_1
(if (or (<= z 1.75e+214) (not (<= z 1.45e+254)))
t_0
(* -6.0 (* x z)))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = x * (z * -6.0);
double tmp;
if (z <= -3.1e+184) {
tmp = t_0;
} else if (z <= -4.3e+17) {
tmp = t_1;
} else if (z <= -2.05e-111) {
tmp = t_0;
} else if (z <= 8.2e-15) {
tmp = x;
} else if (z <= 1.6e+31) {
tmp = t_0;
} else if (z <= 6.4e+73) {
tmp = t_1;
} else if ((z <= 1.75e+214) || !(z <= 1.45e+254)) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * z)
t_1 = x * (z * (-6.0d0))
if (z <= (-3.1d+184)) then
tmp = t_0
else if (z <= (-4.3d+17)) then
tmp = t_1
else if (z <= (-2.05d-111)) then
tmp = t_0
else if (z <= 8.2d-15) then
tmp = x
else if (z <= 1.6d+31) then
tmp = t_0
else if (z <= 6.4d+73) then
tmp = t_1
else if ((z <= 1.75d+214) .or. (.not. (z <= 1.45d+254))) then
tmp = t_0
else
tmp = (-6.0d0) * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * z);
double t_1 = x * (z * -6.0);
double tmp;
if (z <= -3.1e+184) {
tmp = t_0;
} else if (z <= -4.3e+17) {
tmp = t_1;
} else if (z <= -2.05e-111) {
tmp = t_0;
} else if (z <= 8.2e-15) {
tmp = x;
} else if (z <= 1.6e+31) {
tmp = t_0;
} else if (z <= 6.4e+73) {
tmp = t_1;
} else if ((z <= 1.75e+214) || !(z <= 1.45e+254)) {
tmp = t_0;
} else {
tmp = -6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * z) t_1 = x * (z * -6.0) tmp = 0 if z <= -3.1e+184: tmp = t_0 elif z <= -4.3e+17: tmp = t_1 elif z <= -2.05e-111: tmp = t_0 elif z <= 8.2e-15: tmp = x elif z <= 1.6e+31: tmp = t_0 elif z <= 6.4e+73: tmp = t_1 elif (z <= 1.75e+214) or not (z <= 1.45e+254): tmp = t_0 else: tmp = -6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * z)) t_1 = Float64(x * Float64(z * -6.0)) tmp = 0.0 if (z <= -3.1e+184) tmp = t_0; elseif (z <= -4.3e+17) tmp = t_1; elseif (z <= -2.05e-111) tmp = t_0; elseif (z <= 8.2e-15) tmp = x; elseif (z <= 1.6e+31) tmp = t_0; elseif (z <= 6.4e+73) tmp = t_1; elseif ((z <= 1.75e+214) || !(z <= 1.45e+254)) tmp = t_0; else tmp = Float64(-6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * z); t_1 = x * (z * -6.0); tmp = 0.0; if (z <= -3.1e+184) tmp = t_0; elseif (z <= -4.3e+17) tmp = t_1; elseif (z <= -2.05e-111) tmp = t_0; elseif (z <= 8.2e-15) tmp = x; elseif (z <= 1.6e+31) tmp = t_0; elseif (z <= 6.4e+73) tmp = t_1; elseif ((z <= 1.75e+214) || ~((z <= 1.45e+254))) tmp = t_0; else tmp = -6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+184], t$95$0, If[LessEqual[z, -4.3e+17], t$95$1, If[LessEqual[z, -2.05e-111], t$95$0, If[LessEqual[z, 8.2e-15], x, If[LessEqual[z, 1.6e+31], t$95$0, If[LessEqual[z, 6.4e+73], t$95$1, If[Or[LessEqual[z, 1.75e+214], N[Not[LessEqual[z, 1.45e+254]], $MachinePrecision]], t$95$0, N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot z\right)\\
t_1 := x \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{+17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-111}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+31}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+214} \lor \neg \left(z \leq 1.45 \cdot 10^{+254}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -2.25e-111) (not (<= z 2.5e-14))) (* 6.0 (* (- y x) z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-111) || !(z <= 2.5e-14)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-2.25d-111)) .or. (.not. (z <= 2.5d-14))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.25e-111) || !(z <= 2.5e-14)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.25e-111) or not (z <= 2.5e-14): tmp = 6.0 * ((y - x) * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.25e-111) || !(z <= 2.5e-14)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.25e-111) || ~((z <= 2.5e-14))) tmp = 6.0 * ((y - x) * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.25e-111], N[Not[LessEqual[z, 2.5e-14]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{-111} \lor \neg \left(z \leq 2.5 \cdot 10^{-14}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -1.06e-111) (not (<= z 1.5e-13))) (* 6.0 (* (- y x) z)) (+ x (* -6.0 (* x z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.06e-111) || !(z <= 1.5e-13)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (-6.0 * (x * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.06d-111)) .or. (.not. (z <= 1.5d-13))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x + ((-6.0d0) * (x * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.06e-111) || !(z <= 1.5e-13)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (-6.0 * (x * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.06e-111) or not (z <= 1.5e-13): tmp = 6.0 * ((y - x) * z) else: tmp = x + (-6.0 * (x * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.06e-111) || !(z <= 1.5e-13)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(-6.0 * Float64(x * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.06e-111) || ~((z <= 1.5e-13))) tmp = 6.0 * ((y - x) * z); else tmp = x + (-6.0 * (x * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.06e-111], N[Not[LessEqual[z, 1.5e-13]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{-111} \lor \neg \left(z \leq 1.5 \cdot 10^{-13}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + -6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -220000000.0) (not (<= z 7e-13))) (* 6.0 (* (- y x) z)) (+ x (* 6.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -220000000.0) || !(z <= 7e-13)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (6.0 * (y * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-220000000.0d0)) .or. (.not. (z <= 7d-13))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x + (6.0d0 * (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -220000000.0) || !(z <= 7e-13)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (6.0 * (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -220000000.0) or not (z <= 7e-13): tmp = 6.0 * ((y - x) * z) else: tmp = x + (6.0 * (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -220000000.0) || !(z <= 7e-13)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(6.0 * Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -220000000.0) || ~((z <= 7e-13))) tmp = 6.0 * ((y - x) * z); else tmp = x + (6.0 * (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -220000000.0], N[Not[LessEqual[z, 7e-13]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -220000000 \lor \neg \left(z \leq 7 \cdot 10^{-13}\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -220000000.0) (not (<= z 0.165))) (* 6.0 (* (- y x) z)) (+ x (* z (* y 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -220000000.0) || !(z <= 0.165)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (z * (y * 6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-220000000.0d0)) .or. (.not. (z <= 0.165d0))) then
tmp = 6.0d0 * ((y - x) * z)
else
tmp = x + (z * (y * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -220000000.0) || !(z <= 0.165)) {
tmp = 6.0 * ((y - x) * z);
} else {
tmp = x + (z * (y * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -220000000.0) or not (z <= 0.165): tmp = 6.0 * ((y - x) * z) else: tmp = x + (z * (y * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -220000000.0) || !(z <= 0.165)) tmp = Float64(6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(x + Float64(z * Float64(y * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -220000000.0) || ~((z <= 0.165))) tmp = 6.0 * ((y - x) * z); else tmp = x + (z * (y * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -220000000.0], N[Not[LessEqual[z, 0.165]], $MachinePrecision]], N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -220000000 \lor \neg \left(z \leq 0.165\right):\\
\;\;\;\;6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(y \cdot 6\right)\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -0.165) (not (<= z 1.55e-9))) (* -6.0 (* x z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.165) || !(z <= 1.55e-9)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.165d0)) .or. (.not. (z <= 1.55d-9))) then
tmp = (-6.0d0) * (x * z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.165) || !(z <= 1.55e-9)) {
tmp = -6.0 * (x * z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.165) or not (z <= 1.55e-9): tmp = -6.0 * (x * z) else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.165) || !(z <= 1.55e-9)) tmp = Float64(-6.0 * Float64(x * z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.165) || ~((z <= 1.55e-9))) tmp = -6.0 * (x * z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.165], N[Not[LessEqual[z, 1.55e-9]], $MachinePrecision]], N[(-6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.165 \lor \neg \left(z \leq 1.55 \cdot 10^{-9}\right):\\
\;\;\;\;-6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* (- y x) z))))
double code(double x, double y, double z) {
return x + (6.0 * ((y - x) * z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (6.0d0 * ((y - x) * z))
end function
public static double code(double x, double y, double z) {
return x + (6.0 * ((y - x) * z));
}
def code(x, y, z): return x + (6.0 * ((y - x) * z))
function code(x, y, z) return Float64(x + Float64(6.0 * Float64(Float64(y - x) * z))) end
function tmp = code(x, y, z) tmp = x + (6.0 * ((y - x) * z)); end
code[x_, y_, z_] := N[(x + N[(6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 6 \cdot \left(\left(y - x\right) \cdot z\right)
\end{array}
(FPCore (x y z) :precision binary64 (+ x (* z (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (z * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + (z * ((y - x) * 6.0));
}
def code(x, y, z): return x + (z * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(z * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + (z * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(z * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
(FPCore (x y z) :precision binary64 (- x (* (* 6.0 z) (- x y))))
double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - ((6.0d0 * z) * (x - y))
end function
public static double code(double x, double y, double z) {
return x - ((6.0 * z) * (x - y));
}
def code(x, y, z): return x - ((6.0 * z) * (x - y))
function code(x, y, z) return Float64(x - Float64(Float64(6.0 * z) * Float64(x - y))) end
function tmp = code(x, y, z) tmp = x - ((6.0 * z) * (x - y)); end
code[x_, y_, z_] := N[(x - N[(N[(6.0 * z), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(6 \cdot z\right) \cdot \left(x - y\right)
\end{array}
herbie shell --seed 2023350
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
:precision binary64
:herbie-target
(- x (* (* 6.0 z) (- x y)))
(+ x (* (* (- y x) 6.0) z)))