
(FPCore (x y z) :precision binary64 (/ (* 4.0 (- (- x y) (* z 0.5))) z))
double code(double x, double y, double z) {
return (4.0 * ((x - y) - (z * 0.5))) / z;
}
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 * ((x - y) - (z * 0.5d0))) / z
end function
public static double code(double x, double y, double z) {
return (4.0 * ((x - y) - (z * 0.5))) / z;
}
def code(x, y, z): return (4.0 * ((x - y) - (z * 0.5))) / z
function code(x, y, z) return Float64(Float64(4.0 * Float64(Float64(x - y) - Float64(z * 0.5))) / z) end
function tmp = code(x, y, z) tmp = (4.0 * ((x - y) - (z * 0.5))) / z; end
code[x_, y_, z_] := N[(N[(4.0 * N[(N[(x - y), $MachinePrecision] - N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (* 4.0 (- (- x y) (* z 0.5))) z))
double code(double x, double y, double z) {
return (4.0 * ((x - y) - (z * 0.5))) / z;
}
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 * ((x - y) - (z * 0.5d0))) / z
end function
public static double code(double x, double y, double z) {
return (4.0 * ((x - y) - (z * 0.5))) / z;
}
def code(x, y, z): return (4.0 * ((x - y) - (z * 0.5))) / z
function code(x, y, z) return Float64(Float64(4.0 * Float64(Float64(x - y) - Float64(z * 0.5))) / z) end
function tmp = code(x, y, z) tmp = (4.0 * ((x - y) - (z * 0.5))) / z; end
code[x_, y_, z_] := N[(N[(4.0 * N[(N[(x - y), $MachinePrecision] - N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{4 \cdot \left(\left(x - y\right) - z \cdot 0.5\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (- (* 4.0 (/ (- x y) z)) 2.0))
double code(double x, double y, double z) {
return (4.0 * ((x - y) / z)) - 2.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 * ((x - y) / z)) - 2.0d0
end function
public static double code(double x, double y, double z) {
return (4.0 * ((x - y) / z)) - 2.0;
}
def code(x, y, z): return (4.0 * ((x - y) / z)) - 2.0
function code(x, y, z) return Float64(Float64(4.0 * Float64(Float64(x - y) / z)) - 2.0) end
function tmp = code(x, y, z) tmp = (4.0 * ((x - y) / z)) - 2.0; end
code[x_, y_, z_] := N[(N[(4.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \frac{x - y}{z} - 2
\end{array}
Initial program 99.6%
associate-*l/99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -4.0 (/ y z))) (t_1 (* 4.0 (/ x z))))
(if (<= x -3.8e+69)
t_1
(if (<= x 1.5e-303)
-2.0
(if (<= x 1.15e-254)
t_0
(if (<= x 8.8e-206) -2.0 (if (<= x 2.45e+70) t_0 t_1)))))))
double code(double x, double y, double z) {
double t_0 = -4.0 * (y / z);
double t_1 = 4.0 * (x / z);
double tmp;
if (x <= -3.8e+69) {
tmp = t_1;
} else if (x <= 1.5e-303) {
tmp = -2.0;
} else if (x <= 1.15e-254) {
tmp = t_0;
} else if (x <= 8.8e-206) {
tmp = -2.0;
} else if (x <= 2.45e+70) {
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 = (-4.0d0) * (y / z)
t_1 = 4.0d0 * (x / z)
if (x <= (-3.8d+69)) then
tmp = t_1
else if (x <= 1.5d-303) then
tmp = -2.0d0
else if (x <= 1.15d-254) then
tmp = t_0
else if (x <= 8.8d-206) then
tmp = -2.0d0
else if (x <= 2.45d+70) 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 = -4.0 * (y / z);
double t_1 = 4.0 * (x / z);
double tmp;
if (x <= -3.8e+69) {
tmp = t_1;
} else if (x <= 1.5e-303) {
tmp = -2.0;
} else if (x <= 1.15e-254) {
tmp = t_0;
} else if (x <= 8.8e-206) {
tmp = -2.0;
} else if (x <= 2.45e+70) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -4.0 * (y / z) t_1 = 4.0 * (x / z) tmp = 0 if x <= -3.8e+69: tmp = t_1 elif x <= 1.5e-303: tmp = -2.0 elif x <= 1.15e-254: tmp = t_0 elif x <= 8.8e-206: tmp = -2.0 elif x <= 2.45e+70: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-4.0 * Float64(y / z)) t_1 = Float64(4.0 * Float64(x / z)) tmp = 0.0 if (x <= -3.8e+69) tmp = t_1; elseif (x <= 1.5e-303) tmp = -2.0; elseif (x <= 1.15e-254) tmp = t_0; elseif (x <= 8.8e-206) tmp = -2.0; elseif (x <= 2.45e+70) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -4.0 * (y / z); t_1 = 4.0 * (x / z); tmp = 0.0; if (x <= -3.8e+69) tmp = t_1; elseif (x <= 1.5e-303) tmp = -2.0; elseif (x <= 1.15e-254) tmp = t_0; elseif (x <= 8.8e-206) tmp = -2.0; elseif (x <= 2.45e+70) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-4.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(4.0 * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+69], t$95$1, If[LessEqual[x, 1.5e-303], -2.0, If[LessEqual[x, 1.15e-254], t$95$0, If[LessEqual[x, 8.8e-206], -2.0, If[LessEqual[x, 2.45e+70], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -4 \cdot \frac{y}{z}\\
t_1 := 4 \cdot \frac{x}{z}\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-303}:\\
\;\;\;\;-2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-254}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-206}:\\
\;\;\;\;-2\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{+70}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.80000000000000028e69 or 2.45000000000000014e70 < x Initial program 98.8%
associate-*l/99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 69.2%
if -3.80000000000000028e69 < x < 1.50000000000000014e-303 or 1.1499999999999999e-254 < x < 8.7999999999999995e-206Initial program 100.0%
associate-*l/99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 63.2%
if 1.50000000000000014e-303 < x < 1.1499999999999999e-254 or 8.7999999999999995e-206 < x < 2.45000000000000014e70Initial program 100.0%
associate-*l/99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 56.4%
Final simplification63.2%
(FPCore (x y z)
:precision binary64
(if (<= z -3.9e+149)
-2.0
(if (or (<= z -4e+127) (and (not (<= z -3.5e+110)) (<= z 1.85e+93)))
(* 4.0 (/ (- x y) z))
-2.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e+149) {
tmp = -2.0;
} else if ((z <= -4e+127) || (!(z <= -3.5e+110) && (z <= 1.85e+93))) {
tmp = 4.0 * ((x - y) / z);
} else {
tmp = -2.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.9d+149)) then
tmp = -2.0d0
else if ((z <= (-4d+127)) .or. (.not. (z <= (-3.5d+110))) .and. (z <= 1.85d+93)) then
tmp = 4.0d0 * ((x - y) / z)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.9e+149) {
tmp = -2.0;
} else if ((z <= -4e+127) || (!(z <= -3.5e+110) && (z <= 1.85e+93))) {
tmp = 4.0 * ((x - y) / z);
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.9e+149: tmp = -2.0 elif (z <= -4e+127) or (not (z <= -3.5e+110) and (z <= 1.85e+93)): tmp = 4.0 * ((x - y) / z) else: tmp = -2.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.9e+149) tmp = -2.0; elseif ((z <= -4e+127) || (!(z <= -3.5e+110) && (z <= 1.85e+93))) tmp = Float64(4.0 * Float64(Float64(x - y) / z)); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.9e+149) tmp = -2.0; elseif ((z <= -4e+127) || (~((z <= -3.5e+110)) && (z <= 1.85e+93))) tmp = 4.0 * ((x - y) / z); else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.9e+149], -2.0, If[Or[LessEqual[z, -4e+127], And[N[Not[LessEqual[z, -3.5e+110]], $MachinePrecision], LessEqual[z, 1.85e+93]]], N[(4.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{+149}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+127} \lor \neg \left(z \leq -3.5 \cdot 10^{+110}\right) \land z \leq 1.85 \cdot 10^{+93}:\\
\;\;\;\;4 \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -3.8999999999999999e149 or -3.99999999999999982e127 < z < -3.4999999999999999e110 or 1.84999999999999994e93 < z Initial program 98.8%
associate-*l/99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 79.3%
if -3.8999999999999999e149 < z < -3.99999999999999982e127 or -3.4999999999999999e110 < z < 1.84999999999999994e93Initial program 100.0%
associate-*l/99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 84.5%
Final simplification82.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -6.6e+48) (not (<= z 5e-9))) (- (* -4.0 (/ y z)) 2.0) (* 4.0 (/ (- x y) z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6e+48) || !(z <= 5e-9)) {
tmp = (-4.0 * (y / z)) - 2.0;
} else {
tmp = 4.0 * ((x - 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 <= (-6.6d+48)) .or. (.not. (z <= 5d-9))) then
tmp = ((-4.0d0) * (y / z)) - 2.0d0
else
tmp = 4.0d0 * ((x - y) / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6e+48) || !(z <= 5e-9)) {
tmp = (-4.0 * (y / z)) - 2.0;
} else {
tmp = 4.0 * ((x - y) / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -6.6e+48) or not (z <= 5e-9): tmp = (-4.0 * (y / z)) - 2.0 else: tmp = 4.0 * ((x - y) / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -6.6e+48) || !(z <= 5e-9)) tmp = Float64(Float64(-4.0 * Float64(y / z)) - 2.0); else tmp = Float64(4.0 * Float64(Float64(x - y) / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.6e+48) || ~((z <= 5e-9))) tmp = (-4.0 * (y / z)) - 2.0; else tmp = 4.0 * ((x - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -6.6e+48], N[Not[LessEqual[z, 5e-9]], $MachinePrecision]], N[(N[(-4.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision], N[(4.0 * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+48} \lor \neg \left(z \leq 5 \cdot 10^{-9}\right):\\
\;\;\;\;-4 \cdot \frac{y}{z} - 2\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \frac{x - y}{z}\\
\end{array}
\end{array}
if z < -6.60000000000000045e48 or 5.0000000000000001e-9 < z Initial program 99.2%
associate-*l/99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 100.0%
Taylor expanded in x around 0 84.9%
if -6.60000000000000045e48 < z < 5.0000000000000001e-9Initial program 100.0%
associate-*l/99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 90.3%
Final simplification87.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -7.6e+25) (not (<= y 1.06e+37))) (- (* -4.0 (/ y z)) 2.0) (- (/ (* 4.0 x) z) 2.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -7.6e+25) || !(y <= 1.06e+37)) {
tmp = (-4.0 * (y / z)) - 2.0;
} else {
tmp = ((4.0 * x) / z) - 2.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 <= (-7.6d+25)) .or. (.not. (y <= 1.06d+37))) then
tmp = ((-4.0d0) * (y / z)) - 2.0d0
else
tmp = ((4.0d0 * x) / z) - 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -7.6e+25) || !(y <= 1.06e+37)) {
tmp = (-4.0 * (y / z)) - 2.0;
} else {
tmp = ((4.0 * x) / z) - 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -7.6e+25) or not (y <= 1.06e+37): tmp = (-4.0 * (y / z)) - 2.0 else: tmp = ((4.0 * x) / z) - 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -7.6e+25) || !(y <= 1.06e+37)) tmp = Float64(Float64(-4.0 * Float64(y / z)) - 2.0); else tmp = Float64(Float64(Float64(4.0 * x) / z) - 2.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -7.6e+25) || ~((y <= 1.06e+37))) tmp = (-4.0 * (y / z)) - 2.0; else tmp = ((4.0 * x) / z) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -7.6e+25], N[Not[LessEqual[y, 1.06e+37]], $MachinePrecision]], N[(N[(-4.0 * N[(y / z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision], N[(N[(N[(4.0 * x), $MachinePrecision] / z), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.6 \cdot 10^{+25} \lor \neg \left(y \leq 1.06 \cdot 10^{+37}\right):\\
\;\;\;\;-4 \cdot \frac{y}{z} - 2\\
\mathbf{else}:\\
\;\;\;\;\frac{4 \cdot x}{z} - 2\\
\end{array}
\end{array}
if y < -7.6000000000000001e25 or 1.06e37 < y Initial program 100.0%
associate-*l/99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 100.0%
Taylor expanded in x around 0 88.2%
if -7.6000000000000001e25 < y < 1.06e37Initial program 99.3%
associate-*l/99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 100.0%
Taylor expanded in x around inf 91.0%
associate-*r/91.0%
Simplified91.0%
Final simplification89.9%
(FPCore (x y z) :precision binary64 (if (<= z -3.35e+97) -2.0 (if (<= z 1.05e+32) (* -4.0 (/ y z)) -2.0)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+97) {
tmp = -2.0;
} else if (z <= 1.05e+32) {
tmp = -4.0 * (y / z);
} else {
tmp = -2.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.35d+97)) then
tmp = -2.0d0
else if (z <= 1.05d+32) then
tmp = (-4.0d0) * (y / z)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.35e+97) {
tmp = -2.0;
} else if (z <= 1.05e+32) {
tmp = -4.0 * (y / z);
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.35e+97: tmp = -2.0 elif z <= 1.05e+32: tmp = -4.0 * (y / z) else: tmp = -2.0 return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.35e+97) tmp = -2.0; elseif (z <= 1.05e+32) tmp = Float64(-4.0 * Float64(y / z)); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.35e+97) tmp = -2.0; elseif (z <= 1.05e+32) tmp = -4.0 * (y / z); else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.35e+97], -2.0, If[LessEqual[z, 1.05e+32], N[(-4.0 * N[(y / z), $MachinePrecision]), $MachinePrecision], -2.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{+97}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+32}:\\
\;\;\;\;-4 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -3.34999999999999992e97 or 1.05e32 < z Initial program 99.1%
associate-*l/99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 69.8%
if -3.34999999999999992e97 < z < 1.05e32Initial program 100.0%
associate-*l/99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 48.0%
Final simplification57.3%
(FPCore (x y z) :precision binary64 -2.0)
double code(double x, double y, double z) {
return -2.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = -2.0d0
end function
public static double code(double x, double y, double z) {
return -2.0;
}
def code(x, y, z): return -2.0
function code(x, y, z) return -2.0 end
function tmp = code(x, y, z) tmp = -2.0; end
code[x_, y_, z_] := -2.0
\begin{array}{l}
\\
-2
\end{array}
Initial program 99.6%
associate-*l/99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 38.4%
Final simplification38.4%
(FPCore (x y z) :precision binary64 (- (* 4.0 (/ x z)) (+ 2.0 (* 4.0 (/ y z)))))
double code(double x, double y, double z) {
return (4.0 * (x / z)) - (2.0 + (4.0 * (y / z)));
}
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 * (x / z)) - (2.0d0 + (4.0d0 * (y / z)))
end function
public static double code(double x, double y, double z) {
return (4.0 * (x / z)) - (2.0 + (4.0 * (y / z)));
}
def code(x, y, z): return (4.0 * (x / z)) - (2.0 + (4.0 * (y / z)))
function code(x, y, z) return Float64(Float64(4.0 * Float64(x / z)) - Float64(2.0 + Float64(4.0 * Float64(y / z)))) end
function tmp = code(x, y, z) tmp = (4.0 * (x / z)) - (2.0 + (4.0 * (y / z))); end
code[x_, y_, z_] := N[(N[(4.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(2.0 + N[(4.0 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
4 \cdot \frac{x}{z} - \left(2 + 4 \cdot \frac{y}{z}\right)
\end{array}
herbie shell --seed 2023185
(FPCore (x y z)
:name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, B"
:precision binary64
:herbie-target
(- (* 4.0 (/ x z)) (+ 2.0 (* 4.0 (/ y z))))
(/ (* 4.0 (- (- x y) (* z 0.5))) z))