
(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 10 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 (- (/ (- y x) z) -0.5)))
double code(double x, double y, double z) {
return -4.0 * (((y - x) / z) - -0.5);
}
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) * (((y - x) / z) - (-0.5d0))
end function
public static double code(double x, double y, double z) {
return -4.0 * (((y - x) / z) - -0.5);
}
def code(x, y, z): return -4.0 * (((y - x) / z) - -0.5)
function code(x, y, z) return Float64(-4.0 * Float64(Float64(Float64(y - x) / z) - -0.5)) end
function tmp = code(x, y, z) tmp = -4.0 * (((y - x) / z) - -0.5); end
code[x_, y_, z_] := N[(-4.0 * N[(N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision] - -0.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
-4 \cdot \left(\frac{y - x}{z} - -0.5\right)
\end{array}
Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* -4.0 y) z)) (t_1 (/ (* x 4.0) z)))
(if (<= z -2.65e+110)
-2.0
(if (<= z -2.8e+89)
t_1
(if (<= z -1e-134)
t_0
(if (<= z -5.6e-249) t_1 (if (<= z 1.45e-64) t_0 -2.0)))))))
double code(double x, double y, double z) {
double t_0 = (-4.0 * y) / z;
double t_1 = (x * 4.0) / z;
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -2.8e+89) {
tmp = t_1;
} else if (z <= -1e-134) {
tmp = t_0;
} else if (z <= -5.6e-249) {
tmp = t_1;
} else if (z <= 1.45e-64) {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((-4.0d0) * y) / z
t_1 = (x * 4.0d0) / z
if (z <= (-2.65d+110)) then
tmp = -2.0d0
else if (z <= (-2.8d+89)) then
tmp = t_1
else if (z <= (-1d-134)) then
tmp = t_0
else if (z <= (-5.6d-249)) then
tmp = t_1
else if (z <= 1.45d-64) then
tmp = t_0
else
tmp = -2.0d0
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 = (x * 4.0) / z;
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -2.8e+89) {
tmp = t_1;
} else if (z <= -1e-134) {
tmp = t_0;
} else if (z <= -5.6e-249) {
tmp = t_1;
} else if (z <= 1.45e-64) {
tmp = t_0;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): t_0 = (-4.0 * y) / z t_1 = (x * 4.0) / z tmp = 0 if z <= -2.65e+110: tmp = -2.0 elif z <= -2.8e+89: tmp = t_1 elif z <= -1e-134: tmp = t_0 elif z <= -5.6e-249: tmp = t_1 elif z <= 1.45e-64: tmp = t_0 else: tmp = -2.0 return tmp
function code(x, y, z) t_0 = Float64(Float64(-4.0 * y) / z) t_1 = Float64(Float64(x * 4.0) / z) tmp = 0.0 if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -2.8e+89) tmp = t_1; elseif (z <= -1e-134) tmp = t_0; elseif (z <= -5.6e-249) tmp = t_1; elseif (z <= 1.45e-64) tmp = t_0; else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (-4.0 * y) / z; t_1 = (x * 4.0) / z; tmp = 0.0; if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -2.8e+89) tmp = t_1; elseif (z <= -1e-134) tmp = t_0; elseif (z <= -5.6e-249) tmp = t_1; elseif (z <= 1.45e-64) tmp = t_0; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(-4.0 * y), $MachinePrecision] / z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * 4.0), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2.65e+110], -2.0, If[LessEqual[z, -2.8e+89], t$95$1, If[LessEqual[z, -1e-134], t$95$0, If[LessEqual[z, -5.6e-249], t$95$1, If[LessEqual[z, 1.45e-64], t$95$0, -2.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-4 \cdot y}{z}\\
t_1 := \frac{x \cdot 4}{z}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+110}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-249}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-64}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -2.6499999999999999e110 or 1.4499999999999999e-64 < z Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.5%
if -2.6499999999999999e110 < z < -2.7999999999999998e89 or -1.00000000000000004e-134 < z < -5.5999999999999998e-249Initial program 100.0%
Taylor expanded in x around inf 68.0%
*-commutative68.0%
Simplified68.0%
if -2.7999999999999998e89 < z < -1.00000000000000004e-134 or -5.5999999999999998e-249 < z < 1.4499999999999999e-64Initial program 100.0%
Taylor expanded in y around inf 57.4%
*-commutative57.4%
Simplified57.4%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (/ (* x 4.0) z)))
(if (<= z -2.65e+110)
-2.0
(if (<= z -9.2e+84)
t_0
(if (<= z -1.35e-142)
(* y (/ -4.0 z))
(if (<= z -1.4e-249)
t_0
(if (<= z 6.6e-62) (/ -4.0 (/ z y)) -2.0)))))))
double code(double x, double y, double z) {
double t_0 = (x * 4.0) / z;
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -9.2e+84) {
tmp = t_0;
} else if (z <= -1.35e-142) {
tmp = y * (-4.0 / z);
} else if (z <= -1.4e-249) {
tmp = t_0;
} else if (z <= 6.6e-62) {
tmp = -4.0 / (z / y);
} 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) :: t_0
real(8) :: tmp
t_0 = (x * 4.0d0) / z
if (z <= (-2.65d+110)) then
tmp = -2.0d0
else if (z <= (-9.2d+84)) then
tmp = t_0
else if (z <= (-1.35d-142)) then
tmp = y * ((-4.0d0) / z)
else if (z <= (-1.4d-249)) then
tmp = t_0
else if (z <= 6.6d-62) then
tmp = (-4.0d0) / (z / y)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x * 4.0) / z;
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -9.2e+84) {
tmp = t_0;
} else if (z <= -1.35e-142) {
tmp = y * (-4.0 / z);
} else if (z <= -1.4e-249) {
tmp = t_0;
} else if (z <= 6.6e-62) {
tmp = -4.0 / (z / y);
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): t_0 = (x * 4.0) / z tmp = 0 if z <= -2.65e+110: tmp = -2.0 elif z <= -9.2e+84: tmp = t_0 elif z <= -1.35e-142: tmp = y * (-4.0 / z) elif z <= -1.4e-249: tmp = t_0 elif z <= 6.6e-62: tmp = -4.0 / (z / y) else: tmp = -2.0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x * 4.0) / z) tmp = 0.0 if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -9.2e+84) tmp = t_0; elseif (z <= -1.35e-142) tmp = Float64(y * Float64(-4.0 / z)); elseif (z <= -1.4e-249) tmp = t_0; elseif (z <= 6.6e-62) tmp = Float64(-4.0 / Float64(z / y)); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * 4.0) / z; tmp = 0.0; if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -9.2e+84) tmp = t_0; elseif (z <= -1.35e-142) tmp = y * (-4.0 / z); elseif (z <= -1.4e-249) tmp = t_0; elseif (z <= 6.6e-62) tmp = -4.0 / (z / y); else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 4.0), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -2.65e+110], -2.0, If[LessEqual[z, -9.2e+84], t$95$0, If[LessEqual[z, -1.35e-142], N[(y * N[(-4.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4e-249], t$95$0, If[LessEqual[z, 6.6e-62], N[(-4.0 / N[(z / y), $MachinePrecision]), $MachinePrecision], -2.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot 4}{z}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+110}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{+84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-142}:\\
\;\;\;\;y \cdot \frac{-4}{z}\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-249}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-4}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -2.6499999999999999e110 or 6.60000000000000009e-62 < z Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.5%
if -2.6499999999999999e110 < z < -9.1999999999999996e84 or -1.3499999999999999e-142 < z < -1.4e-249Initial program 100.0%
Taylor expanded in x around inf 68.0%
*-commutative68.0%
Simplified68.0%
if -9.1999999999999996e84 < z < -1.3499999999999999e-142Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 50.6%
associate-*r/50.6%
*-commutative50.6%
associate-/l*50.5%
Simplified50.5%
if -1.4e-249 < z < 6.60000000000000009e-62Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 62.8%
associate-*r/62.8%
*-commutative62.8%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in y around 0 62.8%
associate-*r/62.8%
associate-*l/62.7%
associate-/r/62.8%
Simplified62.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (/ 4.0 z))))
(if (<= z -2.65e+110)
-2.0
(if (<= z -1.25e+77)
t_0
(if (<= z -1.2e-141)
(* y (/ -4.0 z))
(if (<= z -2.4e-248)
t_0
(if (<= z 6.5e-62) (/ -4.0 (/ z y)) -2.0)))))))
double code(double x, double y, double z) {
double t_0 = x * (4.0 / z);
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -1.25e+77) {
tmp = t_0;
} else if (z <= -1.2e-141) {
tmp = y * (-4.0 / z);
} else if (z <= -2.4e-248) {
tmp = t_0;
} else if (z <= 6.5e-62) {
tmp = -4.0 / (z / y);
} 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) :: t_0
real(8) :: tmp
t_0 = x * (4.0d0 / z)
if (z <= (-2.65d+110)) then
tmp = -2.0d0
else if (z <= (-1.25d+77)) then
tmp = t_0
else if (z <= (-1.2d-141)) then
tmp = y * ((-4.0d0) / z)
else if (z <= (-2.4d-248)) then
tmp = t_0
else if (z <= 6.5d-62) then
tmp = (-4.0d0) / (z / y)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (4.0 / z);
double tmp;
if (z <= -2.65e+110) {
tmp = -2.0;
} else if (z <= -1.25e+77) {
tmp = t_0;
} else if (z <= -1.2e-141) {
tmp = y * (-4.0 / z);
} else if (z <= -2.4e-248) {
tmp = t_0;
} else if (z <= 6.5e-62) {
tmp = -4.0 / (z / y);
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (4.0 / z) tmp = 0 if z <= -2.65e+110: tmp = -2.0 elif z <= -1.25e+77: tmp = t_0 elif z <= -1.2e-141: tmp = y * (-4.0 / z) elif z <= -2.4e-248: tmp = t_0 elif z <= 6.5e-62: tmp = -4.0 / (z / y) else: tmp = -2.0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(4.0 / z)) tmp = 0.0 if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -1.25e+77) tmp = t_0; elseif (z <= -1.2e-141) tmp = Float64(y * Float64(-4.0 / z)); elseif (z <= -2.4e-248) tmp = t_0; elseif (z <= 6.5e-62) tmp = Float64(-4.0 / Float64(z / y)); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (4.0 / z); tmp = 0.0; if (z <= -2.65e+110) tmp = -2.0; elseif (z <= -1.25e+77) tmp = t_0; elseif (z <= -1.2e-141) tmp = y * (-4.0 / z); elseif (z <= -2.4e-248) tmp = t_0; elseif (z <= 6.5e-62) tmp = -4.0 / (z / y); else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(4.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e+110], -2.0, If[LessEqual[z, -1.25e+77], t$95$0, If[LessEqual[z, -1.2e-141], N[(y * N[(-4.0 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.4e-248], t$95$0, If[LessEqual[z, 6.5e-62], N[(-4.0 / N[(z / y), $MachinePrecision]), $MachinePrecision], -2.0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{4}{z}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+110}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-141}:\\
\;\;\;\;y \cdot \frac{-4}{z}\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-248}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-4}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -2.6499999999999999e110 or 6.50000000000000026e-62 < z Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.5%
if -2.6499999999999999e110 < z < -1.25000000000000001e77 or -1.2e-141 < z < -2.40000000000000003e-248Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 68.0%
associate-*r/68.0%
*-commutative68.0%
associate-*r/67.9%
Simplified67.9%
if -1.25000000000000001e77 < z < -1.2e-141Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 50.6%
associate-*r/50.6%
*-commutative50.6%
associate-/l*50.5%
Simplified50.5%
if -2.40000000000000003e-248 < z < 6.50000000000000026e-62Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 62.8%
associate-*r/62.8%
*-commutative62.8%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in y around 0 62.8%
associate-*r/62.8%
associate-*l/62.7%
associate-/r/62.8%
Simplified62.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (/ -4.0 z))) (t_1 (* x (/ 4.0 z))))
(if (<= z -3e+110)
-2.0
(if (<= z -3.2e+74)
t_1
(if (<= z -5e-131)
t_0
(if (<= z -4.8e-249) t_1 (if (<= z 5.9e-62) t_0 -2.0)))))))
double code(double x, double y, double z) {
double t_0 = y * (-4.0 / z);
double t_1 = x * (4.0 / z);
double tmp;
if (z <= -3e+110) {
tmp = -2.0;
} else if (z <= -3.2e+74) {
tmp = t_1;
} else if (z <= -5e-131) {
tmp = t_0;
} else if (z <= -4.8e-249) {
tmp = t_1;
} else if (z <= 5.9e-62) {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * ((-4.0d0) / z)
t_1 = x * (4.0d0 / z)
if (z <= (-3d+110)) then
tmp = -2.0d0
else if (z <= (-3.2d+74)) then
tmp = t_1
else if (z <= (-5d-131)) then
tmp = t_0
else if (z <= (-4.8d-249)) then
tmp = t_1
else if (z <= 5.9d-62) then
tmp = t_0
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (-4.0 / z);
double t_1 = x * (4.0 / z);
double tmp;
if (z <= -3e+110) {
tmp = -2.0;
} else if (z <= -3.2e+74) {
tmp = t_1;
} else if (z <= -5e-131) {
tmp = t_0;
} else if (z <= -4.8e-249) {
tmp = t_1;
} else if (z <= 5.9e-62) {
tmp = t_0;
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (-4.0 / z) t_1 = x * (4.0 / z) tmp = 0 if z <= -3e+110: tmp = -2.0 elif z <= -3.2e+74: tmp = t_1 elif z <= -5e-131: tmp = t_0 elif z <= -4.8e-249: tmp = t_1 elif z <= 5.9e-62: tmp = t_0 else: tmp = -2.0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-4.0 / z)) t_1 = Float64(x * Float64(4.0 / z)) tmp = 0.0 if (z <= -3e+110) tmp = -2.0; elseif (z <= -3.2e+74) tmp = t_1; elseif (z <= -5e-131) tmp = t_0; elseif (z <= -4.8e-249) tmp = t_1; elseif (z <= 5.9e-62) tmp = t_0; else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (-4.0 / z); t_1 = x * (4.0 / z); tmp = 0.0; if (z <= -3e+110) tmp = -2.0; elseif (z <= -3.2e+74) tmp = t_1; elseif (z <= -5e-131) tmp = t_0; elseif (z <= -4.8e-249) tmp = t_1; elseif (z <= 5.9e-62) tmp = t_0; else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(-4.0 / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(4.0 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3e+110], -2.0, If[LessEqual[z, -3.2e+74], t$95$1, If[LessEqual[z, -5e-131], t$95$0, If[LessEqual[z, -4.8e-249], t$95$1, If[LessEqual[z, 5.9e-62], t$95$0, -2.0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \frac{-4}{z}\\
t_1 := x \cdot \frac{4}{z}\\
\mathbf{if}\;z \leq -3 \cdot 10^{+110}:\\
\;\;\;\;-2\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-131}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-249}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.9 \cdot 10^{-62}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if z < -3.00000000000000007e110 or 5.9000000000000004e-62 < z Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 69.5%
if -3.00000000000000007e110 < z < -3.19999999999999995e74 or -5.0000000000000004e-131 < z < -4.80000000000000026e-249Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 68.0%
associate-*r/68.0%
*-commutative68.0%
associate-*r/67.9%
Simplified67.9%
if -3.19999999999999995e74 < z < -5.0000000000000004e-131 or -4.80000000000000026e-249 < z < 5.9000000000000004e-62Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 57.4%
associate-*r/57.4%
*-commutative57.4%
associate-/l*57.3%
Simplified57.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.9e+84) (not (<= x 3.35e+125))) (/ (* -4.0 (- y x)) z) (+ (* y (/ -4.0 z)) -2.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.9e+84) || !(x <= 3.35e+125)) {
tmp = (-4.0 * (y - x)) / z;
} else {
tmp = (y * (-4.0 / 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 ((x <= (-2.9d+84)) .or. (.not. (x <= 3.35d+125))) then
tmp = ((-4.0d0) * (y - x)) / z
else
tmp = (y * ((-4.0d0) / z)) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.9e+84) || !(x <= 3.35e+125)) {
tmp = (-4.0 * (y - x)) / z;
} else {
tmp = (y * (-4.0 / z)) + -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.9e+84) or not (x <= 3.35e+125): tmp = (-4.0 * (y - x)) / z else: tmp = (y * (-4.0 / z)) + -2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.9e+84) || !(x <= 3.35e+125)) tmp = Float64(Float64(-4.0 * Float64(y - x)) / z); else tmp = Float64(Float64(y * Float64(-4.0 / z)) + -2.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.9e+84) || ~((x <= 3.35e+125))) tmp = (-4.0 * (y - x)) / z; else tmp = (y * (-4.0 / z)) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.9e+84], N[Not[LessEqual[x, 3.35e+125]], $MachinePrecision]], N[(N[(-4.0 * N[(y - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(y * N[(-4.0 / z), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+84} \lor \neg \left(x \leq 3.35 \cdot 10^{+125}\right):\\
\;\;\;\;\frac{-4 \cdot \left(y - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-4}{z} + -2\\
\end{array}
\end{array}
if x < -2.89999999999999989e84 or 3.3500000000000002e125 < x Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 88.8%
*-commutative88.8%
associate-*l/88.8%
Simplified88.8%
if -2.89999999999999989e84 < x < 3.3500000000000002e125Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
distribute-lft-in91.0%
associate-*r/91.0%
*-commutative91.0%
associate-/l*90.9%
metadata-eval90.9%
Simplified90.9%
Final simplification90.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.1e+86) (not (<= x 1.95e+131))) (* -4.0 (- 0.5 (/ x z))) (+ (* y (/ -4.0 z)) -2.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.1e+86) || !(x <= 1.95e+131)) {
tmp = -4.0 * (0.5 - (x / z));
} else {
tmp = (y * (-4.0 / 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 ((x <= (-2.1d+86)) .or. (.not. (x <= 1.95d+131))) then
tmp = (-4.0d0) * (0.5d0 - (x / z))
else
tmp = (y * ((-4.0d0) / z)) + (-2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.1e+86) || !(x <= 1.95e+131)) {
tmp = -4.0 * (0.5 - (x / z));
} else {
tmp = (y * (-4.0 / z)) + -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.1e+86) or not (x <= 1.95e+131): tmp = -4.0 * (0.5 - (x / z)) else: tmp = (y * (-4.0 / z)) + -2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.1e+86) || !(x <= 1.95e+131)) tmp = Float64(-4.0 * Float64(0.5 - Float64(x / z))); else tmp = Float64(Float64(y * Float64(-4.0 / z)) + -2.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.1e+86) || ~((x <= 1.95e+131))) tmp = -4.0 * (0.5 - (x / z)); else tmp = (y * (-4.0 / z)) + -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.1e+86], N[Not[LessEqual[x, 1.95e+131]], $MachinePrecision]], N[(-4.0 * N[(0.5 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(-4.0 / z), $MachinePrecision]), $MachinePrecision] + -2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+86} \lor \neg \left(x \leq 1.95 \cdot 10^{+131}\right):\\
\;\;\;\;-4 \cdot \left(0.5 - \frac{x}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-4}{z} + -2\\
\end{array}
\end{array}
if x < -2.0999999999999999e86 or 1.95e131 < x Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 84.4%
*-commutative84.4%
Simplified84.4%
if -2.0999999999999999e86 < x < 1.95e131Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 90.5%
+-commutative90.5%
distribute-lft-in90.5%
associate-*r/90.5%
*-commutative90.5%
associate-/l*90.5%
metadata-eval90.5%
Simplified90.5%
Final simplification88.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.5e+186) (not (<= y 1.95e+99))) (/ (* -4.0 y) z) (* -4.0 (- 0.5 (/ x z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.5e+186) || !(y <= 1.95e+99)) {
tmp = (-4.0 * y) / z;
} else {
tmp = -4.0 * (0.5 - (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 ((y <= (-3.5d+186)) .or. (.not. (y <= 1.95d+99))) then
tmp = ((-4.0d0) * y) / z
else
tmp = (-4.0d0) * (0.5d0 - (x / z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.5e+186) || !(y <= 1.95e+99)) {
tmp = (-4.0 * y) / z;
} else {
tmp = -4.0 * (0.5 - (x / z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.5e+186) or not (y <= 1.95e+99): tmp = (-4.0 * y) / z else: tmp = -4.0 * (0.5 - (x / z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.5e+186) || !(y <= 1.95e+99)) tmp = Float64(Float64(-4.0 * y) / z); else tmp = Float64(-4.0 * Float64(0.5 - Float64(x / z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.5e+186) || ~((y <= 1.95e+99))) tmp = (-4.0 * y) / z; else tmp = -4.0 * (0.5 - (x / z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.5e+186], N[Not[LessEqual[y, 1.95e+99]], $MachinePrecision]], N[(N[(-4.0 * y), $MachinePrecision] / z), $MachinePrecision], N[(-4.0 * N[(0.5 - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+186} \lor \neg \left(y \leq 1.95 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{-4 \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(0.5 - \frac{x}{z}\right)\\
\end{array}
\end{array}
if y < -3.49999999999999987e186 or 1.94999999999999997e99 < y Initial program 100.0%
Taylor expanded in y around inf 78.4%
*-commutative78.4%
Simplified78.4%
if -3.49999999999999987e186 < y < 1.94999999999999997e99Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 80.0%
*-commutative80.0%
Simplified80.0%
Final simplification79.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -8.8e+82) (not (<= x 0.21))) (* x (/ 4.0 z)) -2.0))
double code(double x, double y, double z) {
double tmp;
if ((x <= -8.8e+82) || !(x <= 0.21)) {
tmp = x * (4.0 / 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 ((x <= (-8.8d+82)) .or. (.not. (x <= 0.21d0))) then
tmp = x * (4.0d0 / z)
else
tmp = -2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -8.8e+82) || !(x <= 0.21)) {
tmp = x * (4.0 / z);
} else {
tmp = -2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -8.8e+82) or not (x <= 0.21): tmp = x * (4.0 / z) else: tmp = -2.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -8.8e+82) || !(x <= 0.21)) tmp = Float64(x * Float64(4.0 / z)); else tmp = -2.0; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -8.8e+82) || ~((x <= 0.21))) tmp = x * (4.0 / z); else tmp = -2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -8.8e+82], N[Not[LessEqual[x, 0.21]], $MachinePrecision]], N[(x * N[(4.0 / z), $MachinePrecision]), $MachinePrecision], -2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+82} \lor \neg \left(x \leq 0.21\right):\\
\;\;\;\;x \cdot \frac{4}{z}\\
\mathbf{else}:\\
\;\;\;\;-2\\
\end{array}
\end{array}
if x < -8.8000000000000005e82 or 0.209999999999999992 < x Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 65.0%
associate-*r/65.0%
*-commutative65.0%
associate-*r/64.9%
Simplified64.9%
if -8.8000000000000005e82 < x < 0.209999999999999992Initial program 100.0%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 52.9%
Final simplification57.9%
(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%
remove-double-neg100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
div-sub100.0%
distribute-frac-neg2100.0%
distribute-frac-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-out100.0%
remove-double-neg100.0%
sub-neg100.0%
*-commutative100.0%
neg-mul-1100.0%
times-frac100.0%
metadata-eval100.0%
*-inverses100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 37.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 2024137
(FPCore (x y z)
:name "Data.Array.Repa.Algorithms.ColorRamp:rampColorHotToCold from repa-algorithms-3.4.0.1, B"
:precision binary64
:alt
(! :herbie-platform default (- (* 4 (/ x z)) (+ 2 (* 4 (/ y z)))))
(/ (* 4.0 (- (- x y) (* z 0.5))) z))