
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + ((4.0d0 * ((x + (y * 0.75d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.75), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))
double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 1.0d0 + ((4.0d0 * ((x + (y * 0.75d0)) - z)) / y)
end function
public static double code(double x, double y, double z) {
return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y);
}
def code(x, y, z): return 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y)
function code(x, y, z) return Float64(1.0 + Float64(Float64(4.0 * Float64(Float64(x + Float64(y * 0.75)) - z)) / y)) end
function tmp = code(x, y, z) tmp = 1.0 + ((4.0 * ((x + (y * 0.75)) - z)) / y); end
code[x_, y_, z_] := N[(1.0 + N[(N[(4.0 * N[(N[(x + N[(y * 0.75), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \frac{4 \cdot \left(\left(x + y \cdot 0.75\right) - z\right)}{y}
\end{array}
(FPCore (x y z) :precision binary64 (+ 4.0 (* 4.0 (/ (- x z) y))))
double code(double x, double y, double z) {
return 4.0 + (4.0 * ((x - z) / y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 4.0d0 + (4.0d0 * ((x - z) / y))
end function
public static double code(double x, double y, double z) {
return 4.0 + (4.0 * ((x - z) / y));
}
def code(x, y, z): return 4.0 + (4.0 * ((x - z) / y))
function code(x, y, z) return Float64(4.0 + Float64(4.0 * Float64(Float64(x - z) / y))) end
function tmp = code(x, y, z) tmp = 4.0 + (4.0 * ((x - z) / y)); end
code[x_, y_, z_] := N[(4.0 + N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
4 + 4 \cdot \frac{x - z}{y}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ 4.0 y))) (t_1 (* (/ z y) -4.0)))
(if (<= x -1.2e+52)
t_0
(if (<= x -1.36e-142)
t_1
(if (<= x -1.1e-189)
4.0
(if (<= x -4.6e-266)
t_1
(if (<= x 1.35e-220) 4.0 (if (<= x 5e-70) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = x * (4.0 / y);
double t_1 = (z / y) * -4.0;
double tmp;
if (x <= -1.2e+52) {
tmp = t_0;
} else if (x <= -1.36e-142) {
tmp = t_1;
} else if (x <= -1.1e-189) {
tmp = 4.0;
} else if (x <= -4.6e-266) {
tmp = t_1;
} else if (x <= 1.35e-220) {
tmp = 4.0;
} else if (x <= 5e-70) {
tmp = t_1;
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * (4.0d0 / y)
t_1 = (z / y) * (-4.0d0)
if (x <= (-1.2d+52)) then
tmp = t_0
else if (x <= (-1.36d-142)) then
tmp = t_1
else if (x <= (-1.1d-189)) then
tmp = 4.0d0
else if (x <= (-4.6d-266)) then
tmp = t_1
else if (x <= 1.35d-220) then
tmp = 4.0d0
else if (x <= 5d-70) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.0 / y);
double t_1 = (z / y) * -4.0;
double tmp;
if (x <= -1.2e+52) {
tmp = t_0;
} else if (x <= -1.36e-142) {
tmp = t_1;
} else if (x <= -1.1e-189) {
tmp = 4.0;
} else if (x <= -4.6e-266) {
tmp = t_1;
} else if (x <= 1.35e-220) {
tmp = 4.0;
} else if (x <= 5e-70) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.0 / y) t_1 = (z / y) * -4.0 tmp = 0 if x <= -1.2e+52: tmp = t_0 elif x <= -1.36e-142: tmp = t_1 elif x <= -1.1e-189: tmp = 4.0 elif x <= -4.6e-266: tmp = t_1 elif x <= 1.35e-220: tmp = 4.0 elif x <= 5e-70: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.0 / y)) t_1 = Float64(Float64(z / y) * -4.0) tmp = 0.0 if (x <= -1.2e+52) tmp = t_0; elseif (x <= -1.36e-142) tmp = t_1; elseif (x <= -1.1e-189) tmp = 4.0; elseif (x <= -4.6e-266) tmp = t_1; elseif (x <= 1.35e-220) tmp = 4.0; elseif (x <= 5e-70) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.0 / y); t_1 = (z / y) * -4.0; tmp = 0.0; if (x <= -1.2e+52) tmp = t_0; elseif (x <= -1.36e-142) tmp = t_1; elseif (x <= -1.1e-189) tmp = 4.0; elseif (x <= -4.6e-266) tmp = t_1; elseif (x <= 1.35e-220) tmp = 4.0; elseif (x <= 5e-70) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(4.0 / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[x, -1.2e+52], t$95$0, If[LessEqual[x, -1.36e-142], t$95$1, If[LessEqual[x, -1.1e-189], 4.0, If[LessEqual[x, -4.6e-266], t$95$1, If[LessEqual[x, 1.35e-220], 4.0, If[LessEqual[x, 5e-70], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{4}{y}\\
t_1 := \frac{z}{y} \cdot -4\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.36 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-189}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -4.6 \cdot 10^{-266}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-220}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* 4.0 x) y)) (t_1 (* (/ z y) -4.0)))
(if (<= x -1.46e+52)
t_0
(if (<= x -1.2e-142)
t_1
(if (<= x -1.9e-187)
4.0
(if (<= x -3.7e-267)
t_1
(if (<= x 2.25e-220) 4.0 (if (<= x 2.7e-70) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = (4.0 * x) / y;
double t_1 = (z / y) * -4.0;
double tmp;
if (x <= -1.46e+52) {
tmp = t_0;
} else if (x <= -1.2e-142) {
tmp = t_1;
} else if (x <= -1.9e-187) {
tmp = 4.0;
} else if (x <= -3.7e-267) {
tmp = t_1;
} else if (x <= 2.25e-220) {
tmp = 4.0;
} else if (x <= 2.7e-70) {
tmp = t_1;
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (4.0d0 * x) / y
t_1 = (z / y) * (-4.0d0)
if (x <= (-1.46d+52)) then
tmp = t_0
else if (x <= (-1.2d-142)) then
tmp = t_1
else if (x <= (-1.9d-187)) then
tmp = 4.0d0
else if (x <= (-3.7d-267)) then
tmp = t_1
else if (x <= 2.25d-220) then
tmp = 4.0d0
else if (x <= 2.7d-70) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (4.0 * x) / y;
double t_1 = (z / y) * -4.0;
double tmp;
if (x <= -1.46e+52) {
tmp = t_0;
} else if (x <= -1.2e-142) {
tmp = t_1;
} else if (x <= -1.9e-187) {
tmp = 4.0;
} else if (x <= -3.7e-267) {
tmp = t_1;
} else if (x <= 2.25e-220) {
tmp = 4.0;
} else if (x <= 2.7e-70) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (4.0 * x) / y t_1 = (z / y) * -4.0 tmp = 0 if x <= -1.46e+52: tmp = t_0 elif x <= -1.2e-142: tmp = t_1 elif x <= -1.9e-187: tmp = 4.0 elif x <= -3.7e-267: tmp = t_1 elif x <= 2.25e-220: tmp = 4.0 elif x <= 2.7e-70: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(4.0 * x) / y) t_1 = Float64(Float64(z / y) * -4.0) tmp = 0.0 if (x <= -1.46e+52) tmp = t_0; elseif (x <= -1.2e-142) tmp = t_1; elseif (x <= -1.9e-187) tmp = 4.0; elseif (x <= -3.7e-267) tmp = t_1; elseif (x <= 2.25e-220) tmp = 4.0; elseif (x <= 2.7e-70) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (4.0 * x) / y; t_1 = (z / y) * -4.0; tmp = 0.0; if (x <= -1.46e+52) tmp = t_0; elseif (x <= -1.2e-142) tmp = t_1; elseif (x <= -1.9e-187) tmp = 4.0; elseif (x <= -3.7e-267) tmp = t_1; elseif (x <= 2.25e-220) tmp = 4.0; elseif (x <= 2.7e-70) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(4.0 * x), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[x, -1.46e+52], t$95$0, If[LessEqual[x, -1.2e-142], t$95$1, If[LessEqual[x, -1.9e-187], 4.0, If[LessEqual[x, -3.7e-267], t$95$1, If[LessEqual[x, 2.25e-220], 4.0, If[LessEqual[x, 2.7e-70], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{4 \cdot x}{y}\\
t_1 := \frac{z}{y} \cdot -4\\
\mathbf{if}\;x \leq -1.46 \cdot 10^{+52}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.9 \cdot 10^{-187}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-267}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-220}:\\
\;\;\;\;4\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -7.2e+34) (not (<= z 1.06e-23))) (+ 1.0 (/ 4.0 (/ y (- x z)))) (+ 4.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e+34) || !(z <= 1.06e-23)) {
tmp = 1.0 + (4.0 / (y / (x - z)));
} else {
tmp = 4.0 + (4.0 * (x / y));
}
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 <= (-7.2d+34)) .or. (.not. (z <= 1.06d-23))) then
tmp = 1.0d0 + (4.0d0 / (y / (x - z)))
else
tmp = 4.0d0 + (4.0d0 * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -7.2e+34) || !(z <= 1.06e-23)) {
tmp = 1.0 + (4.0 / (y / (x - z)));
} else {
tmp = 4.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -7.2e+34) or not (z <= 1.06e-23): tmp = 1.0 + (4.0 / (y / (x - z))) else: tmp = 4.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -7.2e+34) || !(z <= 1.06e-23)) tmp = Float64(1.0 + Float64(4.0 / Float64(y / Float64(x - z)))); else tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -7.2e+34) || ~((z <= 1.06e-23))) tmp = 1.0 + (4.0 / (y / (x - z))); else tmp = 4.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.2e+34], N[Not[LessEqual[z, 1.06e-23]], $MachinePrecision]], N[(1.0 + N[(4.0 / N[(y / N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+34} \lor \neg \left(z \leq 1.06 \cdot 10^{-23}\right):\\
\;\;\;\;1 + \frac{4}{\frac{y}{x - z}}\\
\mathbf{else}:\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -3.45e+34) (not (<= z 1.4e+51))) (* 4.0 (/ (- x z) y)) (+ 4.0 (* 4.0 (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.45e+34) || !(z <= 1.4e+51)) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 4.0 + (4.0 * (x / y));
}
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 <= (-3.45d+34)) .or. (.not. (z <= 1.4d+51))) then
tmp = 4.0d0 * ((x - z) / y)
else
tmp = 4.0d0 + (4.0d0 * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.45e+34) || !(z <= 1.4e+51)) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 4.0 + (4.0 * (x / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.45e+34) or not (z <= 1.4e+51): tmp = 4.0 * ((x - z) / y) else: tmp = 4.0 + (4.0 * (x / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.45e+34) || !(z <= 1.4e+51)) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); else tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.45e+34) || ~((z <= 1.4e+51))) tmp = 4.0 * ((x - z) / y); else tmp = 4.0 + (4.0 * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.45e+34], N[Not[LessEqual[z, 1.4e+51]], $MachinePrecision]], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.45 \cdot 10^{+34} \lor \neg \left(z \leq 1.4 \cdot 10^{+51}\right):\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= y -1.9e+143) 4.0 (if (<= y 3.6e+198) (* 4.0 (/ (- x z) y)) 4.0)))
double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+143) {
tmp = 4.0;
} else if (y <= 3.6e+198) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 4.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 (y <= (-1.9d+143)) then
tmp = 4.0d0
else if (y <= 3.6d+198) then
tmp = 4.0d0 * ((x - z) / y)
else
tmp = 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.9e+143) {
tmp = 4.0;
} else if (y <= 3.6e+198) {
tmp = 4.0 * ((x - z) / y);
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.9e+143: tmp = 4.0 elif y <= 3.6e+198: tmp = 4.0 * ((x - z) / y) else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.9e+143) tmp = 4.0; elseif (y <= 3.6e+198) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.9e+143) tmp = 4.0; elseif (y <= 3.6e+198) tmp = 4.0 * ((x - z) / y); else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+143], 4.0, If[LessEqual[y, 3.6e+198], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 4.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+143}:\\
\;\;\;\;4\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+198}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (<= z -4.5e+34) (* 4.0 (/ (- x z) y)) (if (<= z 1.46e+54) (+ 4.0 (* 4.0 (/ x y))) (+ 4.0 (* (/ z y) -4.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+34) {
tmp = 4.0 * ((x - z) / y);
} else if (z <= 1.46e+54) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.0 + ((z / y) * -4.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 <= (-4.5d+34)) then
tmp = 4.0d0 * ((x - z) / y)
else if (z <= 1.46d+54) then
tmp = 4.0d0 + (4.0d0 * (x / y))
else
tmp = 4.0d0 + ((z / y) * (-4.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+34) {
tmp = 4.0 * ((x - z) / y);
} else if (z <= 1.46e+54) {
tmp = 4.0 + (4.0 * (x / y));
} else {
tmp = 4.0 + ((z / y) * -4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.5e+34: tmp = 4.0 * ((x - z) / y) elif z <= 1.46e+54: tmp = 4.0 + (4.0 * (x / y)) else: tmp = 4.0 + ((z / y) * -4.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.5e+34) tmp = Float64(4.0 * Float64(Float64(x - z) / y)); elseif (z <= 1.46e+54) tmp = Float64(4.0 + Float64(4.0 * Float64(x / y))); else tmp = Float64(4.0 + Float64(Float64(z / y) * -4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+34) tmp = 4.0 * ((x - z) / y); elseif (z <= 1.46e+54) tmp = 4.0 + (4.0 * (x / y)); else tmp = 4.0 + ((z / y) * -4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.5e+34], N[(4.0 * N[(N[(x - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.46e+54], N[(4.0 + N[(4.0 * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(4.0 + N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+34}:\\
\;\;\;\;4 \cdot \frac{x - z}{y}\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{+54}:\\
\;\;\;\;4 + 4 \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;4 + \frac{z}{y} \cdot -4\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= z -3.7e+34) (not (<= z 1.8e+46))) (* (/ z y) -4.0) 4.0))
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e+34) || !(z <= 1.8e+46)) {
tmp = (z / y) * -4.0;
} else {
tmp = 4.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 <= (-3.7d+34)) .or. (.not. (z <= 1.8d+46))) then
tmp = (z / y) * (-4.0d0)
else
tmp = 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.7e+34) || !(z <= 1.8e+46)) {
tmp = (z / y) * -4.0;
} else {
tmp = 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -3.7e+34) or not (z <= 1.8e+46): tmp = (z / y) * -4.0 else: tmp = 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -3.7e+34) || !(z <= 1.8e+46)) tmp = Float64(Float64(z / y) * -4.0); else tmp = 4.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.7e+34) || ~((z <= 1.8e+46))) tmp = (z / y) * -4.0; else tmp = 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e+34], N[Not[LessEqual[z, 1.8e+46]], $MachinePrecision]], N[(N[(z / y), $MachinePrecision] * -4.0), $MachinePrecision], 4.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+34} \lor \neg \left(z \leq 1.8 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{z}{y} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;4\\
\end{array}
\end{array}
(FPCore (x y z) :precision binary64 4.0)
double code(double x, double y, double z) {
return 4.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = 4.0d0
end function
public static double code(double x, double y, double z) {
return 4.0;
}
def code(x, y, z): return 4.0
function code(x, y, z) return 4.0 end
function tmp = code(x, y, z) tmp = 4.0; end
code[x_, y_, z_] := 4.0
\begin{array}{l}
\\
4
\end{array}
herbie shell --seed 2024008
(FPCore (x y z)
:name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, A"
:precision binary64
(+ 1.0 (/ (* 4.0 (- (+ x (* y 0.75)) z)) y)))