
(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 100.0%
associate-*l/99.7%
/-rgt-identity99.7%
metadata-eval99.7%
metadata-eval99.7%
/-rgt-identity99.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 (* (/ y z) -4.0)))
(if (<= y -2.25e-9)
t_0
(if (<= y 1.75e-255)
-2.0
(if (<= y 6e-217) (* 4.0 (/ x z)) (if (<= y 1.2e+19) -2.0 t_0))))))
double code(double x, double y, double z) {
double t_0 = (y / z) * -4.0;
double tmp;
if (y <= -2.25e-9) {
tmp = t_0;
} else if (y <= 1.75e-255) {
tmp = -2.0;
} else if (y <= 6e-217) {
tmp = 4.0 * (x / z);
} else if (y <= 1.2e+19) {
tmp = -2.0;
} 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) :: tmp
t_0 = (y / z) * (-4.0d0)
if (y <= (-2.25d-9)) then
tmp = t_0
else if (y <= 1.75d-255) then
tmp = -2.0d0
else if (y <= 6d-217) then
tmp = 4.0d0 * (x / z)
else if (y <= 1.2d+19) then
tmp = -2.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y / z) * -4.0;
double tmp;
if (y <= -2.25e-9) {
tmp = t_0;
} else if (y <= 1.75e-255) {
tmp = -2.0;
} else if (y <= 6e-217) {
tmp = 4.0 * (x / z);
} else if (y <= 1.2e+19) {
tmp = -2.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y / z) * -4.0 tmp = 0 if y <= -2.25e-9: tmp = t_0 elif y <= 1.75e-255: tmp = -2.0 elif y <= 6e-217: tmp = 4.0 * (x / z) elif y <= 1.2e+19: tmp = -2.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y / z) * -4.0) tmp = 0.0 if (y <= -2.25e-9) tmp = t_0; elseif (y <= 1.75e-255) tmp = -2.0; elseif (y <= 6e-217) tmp = Float64(4.0 * Float64(x / z)); elseif (y <= 1.2e+19) tmp = -2.0; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y / z) * -4.0; tmp = 0.0; if (y <= -2.25e-9) tmp = t_0; elseif (y <= 1.75e-255) tmp = -2.0; elseif (y <= 6e-217) tmp = 4.0 * (x / z); elseif (y <= 1.2e+19) tmp = -2.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / z), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[y, -2.25e-9], t$95$0, If[LessEqual[y, 1.75e-255], -2.0, If[LessEqual[y, 6e-217], N[(4.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+19], -2.0, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{z} \cdot -4\\
\mathbf{if}\;y \leq -2.25 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{-255}:\\
\;\;\;\;-2\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-217}:\\
\;\;\;\;4 \cdot \frac{x}{z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+19}:\\
\;\;\;\;-2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.24999999999999988e-9 or 1.2e19 < y Initial program 100.0%
associate-*l/99.6%
/-rgt-identity99.6%
metadata-eval99.6%
metadata-eval99.6%
/-rgt-identity99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 69.6%
if -2.24999999999999988e-9 < y < 1.74999999999999989e-255 or 6.00000000000000009e-217 < y < 1.2e19Initial program 100.0%
associate-*l/99.8%
/-rgt-identity99.8%
metadata-eval99.8%
metadata-eval99.8%
/-rgt-identity99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 54.9%
if 1.74999999999999989e-255 < y < 6.00000000000000009e-217Initial program 99.8%
associate-*l/99.5%
/-rgt-identity99.5%
metadata-eval99.5%
metadata-eval99.5%
/-rgt-identity99.5%
sub-neg99.5%
distribute-rgt-neg-in99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 80.8%
Final simplification63.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.25e+151) (not (<= x 3.1e+155))) (* 4.0 (/ x z)) (* 4.0 (- -0.5 (/ y z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e+151) || !(x <= 3.1e+155)) {
tmp = 4.0 * (x / z);
} else {
tmp = 4.0 * (-0.5 - (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 ((x <= (-1.25d+151)) .or. (.not. (x <= 3.1d+155))) then
tmp = 4.0d0 * (x / z)
else
tmp = 4.0d0 * ((-0.5d0) - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e+151) || !(x <= 3.1e+155)) {
tmp = 4.0 * (x / z);
} else {
tmp = 4.0 * (-0.5 - (y / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.25e+151) or not (x <= 3.1e+155): tmp = 4.0 * (x / z) else: tmp = 4.0 * (-0.5 - (y / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.25e+151) || !(x <= 3.1e+155)) tmp = Float64(4.0 * Float64(x / z)); else tmp = Float64(4.0 * Float64(-0.5 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.25e+151) || ~((x <= 3.1e+155))) tmp = 4.0 * (x / z); else tmp = 4.0 * (-0.5 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.25e+151], N[Not[LessEqual[x, 3.1e+155]], $MachinePrecision]], N[(4.0 * N[(x / z), $MachinePrecision]), $MachinePrecision], N[(4.0 * N[(-0.5 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+151} \lor \neg \left(x \leq 3.1 \cdot 10^{+155}\right):\\
\;\;\;\;4 \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \left(-0.5 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if x < -1.2500000000000001e151 or 3.09999999999999989e155 < x Initial program 100.0%
associate-*l/99.7%
/-rgt-identity99.7%
metadata-eval99.7%
metadata-eval99.7%
/-rgt-identity99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 82.5%
if -1.2500000000000001e151 < x < 3.09999999999999989e155Initial program 100.0%
associate-*l/99.7%
/-rgt-identity99.7%
metadata-eval99.7%
metadata-eval99.7%
/-rgt-identity99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 84.0%
div-sub84.0%
associate-/l*84.0%
*-inverses84.0%
metadata-eval84.0%
Simplified84.0%
Final simplification83.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -9.5e+46) (not (<= z 4e-73))) (* 4.0 (- -0.5 (/ y z))) (* (- x y) (/ 4.0 z))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -9.5e+46) || !(z <= 4e-73)) {
tmp = 4.0 * (-0.5 - (y / z));
} else {
tmp = (x - y) * (4.0 / 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 <= (-9.5d+46)) .or. (.not. (z <= 4d-73))) then
tmp = 4.0d0 * ((-0.5d0) - (y / z))
else
tmp = (x - y) * (4.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -9.5e+46) || !(z <= 4e-73)) {
tmp = 4.0 * (-0.5 - (y / z));
} else {
tmp = (x - y) * (4.0 / z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -9.5e+46) or not (z <= 4e-73): tmp = 4.0 * (-0.5 - (y / z)) else: tmp = (x - y) * (4.0 / z) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -9.5e+46) || !(z <= 4e-73)) tmp = Float64(4.0 * Float64(-0.5 - Float64(y / z))); else tmp = Float64(Float64(x - y) * Float64(4.0 / z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -9.5e+46) || ~((z <= 4e-73))) tmp = 4.0 * (-0.5 - (y / z)); else tmp = (x - y) * (4.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -9.5e+46], N[Not[LessEqual[z, 4e-73]], $MachinePrecision]], N[(4.0 * N[(-0.5 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(4.0 / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+46} \lor \neg \left(z \leq 4 \cdot 10^{-73}\right):\\
\;\;\;\;4 \cdot \left(-0.5 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{4}{z}\\
\end{array}
\end{array}
if z < -9.5000000000000008e46 or 3.99999999999999999e-73 < z Initial program 100.0%
associate-*l/99.6%
/-rgt-identity99.6%
metadata-eval99.6%
metadata-eval99.6%
/-rgt-identity99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 85.8%
div-sub85.8%
associate-/l*85.8%
*-inverses85.8%
metadata-eval85.8%
Simplified85.8%
if -9.5000000000000008e46 < z < 3.99999999999999999e-73Initial program 100.0%
associate-*l/99.8%
/-rgt-identity99.8%
metadata-eval99.8%
metadata-eval99.8%
/-rgt-identity99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 95.1%
associate-*r/95.1%
associate-*l/95.0%
*-commutative95.0%
Simplified95.0%
Final simplification90.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.9e-5) (not (<= y 8.9e+18))) (* 4.0 (- -0.5 (/ y z))) (- (* 4.0 (/ x z)) 2.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.9e-5) || !(y <= 8.9e+18)) {
tmp = 4.0 * (-0.5 - (y / z));
} 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 <= (-2.9d-5)) .or. (.not. (y <= 8.9d+18))) then
tmp = 4.0d0 * ((-0.5d0) - (y / z))
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 <= -2.9e-5) || !(y <= 8.9e+18)) {
tmp = 4.0 * (-0.5 - (y / z));
} else {
tmp = (4.0 * (x / z)) - 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.9e-5) or not (y <= 8.9e+18): tmp = 4.0 * (-0.5 - (y / z)) else: tmp = (4.0 * (x / z)) - 2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.9e-5) || !(y <= 8.9e+18)) tmp = Float64(4.0 * Float64(-0.5 - Float64(y / z))); else tmp = Float64(Float64(4.0 * Float64(x / z)) - 2.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.9e-5) || ~((y <= 8.9e+18))) tmp = 4.0 * (-0.5 - (y / z)); else tmp = (4.0 * (x / z)) - 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.9e-5], N[Not[LessEqual[y, 8.9e+18]], $MachinePrecision]], N[(4.0 * N[(-0.5 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(4.0 * N[(x / z), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.9 \cdot 10^{-5} \lor \neg \left(y \leq 8.9 \cdot 10^{+18}\right):\\
\;\;\;\;4 \cdot \left(-0.5 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;4 \cdot \frac{x}{z} - 2\\
\end{array}
\end{array}
if y < -2.9e-5 or 8.9e18 < y Initial program 100.0%
associate-*l/99.7%
/-rgt-identity99.7%
metadata-eval99.7%
metadata-eval99.7%
/-rgt-identity99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 87.6%
div-sub87.6%
associate-/l*87.6%
*-inverses87.6%
metadata-eval87.6%
Simplified87.6%
if -2.9e-5 < y < 8.9e18Initial program 100.0%
associate-*l/99.8%
/-rgt-identity99.8%
metadata-eval99.8%
metadata-eval99.8%
/-rgt-identity99.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 inf 95.0%
Final simplification91.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.26e-11) (not (<= y 2.3e+19))) (* (/ y z) -4.0) -2.0))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.26e-11) || !(y <= 2.3e+19)) {
tmp = (y / z) * -4.0;
} 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 ((y <= (-1.26d-11)) .or. (.not. (y <= 2.3d+19))) then
tmp = (y / z) * (-4.0d0)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.26e-11) || !(y <= 2.3e+19)) {
tmp = (y / z) * -4.0;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.26e-11) or not (y <= 2.3e+19): tmp = (y / z) * -4.0 else: tmp = -2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.26e-11) || !(y <= 2.3e+19)) tmp = Float64(Float64(y / z) * -4.0); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.26e-11) || ~((y <= 2.3e+19))) tmp = (y / z) * -4.0; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.26e-11], N[Not[LessEqual[y, 2.3e+19]], $MachinePrecision]], N[(N[(y / z), $MachinePrecision] * -4.0), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{-11} \lor \neg \left(y \leq 2.3 \cdot 10^{+19}\right):\\
\;\;\;\;\frac{y}{z} \cdot -4\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if y < -1.26e-11 or 2.3e19 < y Initial program 100.0%
associate-*l/99.6%
/-rgt-identity99.6%
metadata-eval99.6%
metadata-eval99.6%
/-rgt-identity99.6%
sub-neg99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 69.6%
if -1.26e-11 < y < 2.3e19Initial program 100.0%
associate-*l/99.8%
/-rgt-identity99.8%
metadata-eval99.8%
metadata-eval99.8%
/-rgt-identity99.8%
sub-neg99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 52.4%
Final simplification61.0%
(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 100.0%
associate-*l/99.7%
/-rgt-identity99.7%
metadata-eval99.7%
metadata-eval99.7%
/-rgt-identity99.7%
sub-neg99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 35.6%
Final simplification35.6%
(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 2024031
(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))