
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / 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 = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / 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 = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 1e+84) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (fma x (/ z y) (/ (- -4.0 x) y)))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 1e+84) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(fma(x, (z / y), ((-4.0 - x) / y)));
}
return tmp;
}
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 1e+84) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(fma(x, Float64(z / y), Float64(Float64(-4.0 - x) / y))); end return tmp end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 1e+84], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+84}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\end{array}
\end{array}
if y < 1.00000000000000006e84Initial program 91.7%
associate-*l/94.9%
sub-div98.9%
Applied egg-rr98.9%
if 1.00000000000000006e84 < y Initial program 90.4%
fabs-sub90.4%
associate-*l/88.8%
*-commutative88.8%
associate-*l/99.8%
*-commutative99.8%
fma-neg99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.1%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(if (<= x -1.2e-40)
(fabs (/ (+ z -1.0) (/ y x)))
(if (<= x 6.8e-13)
(fabs (/ (- -4.0 x) y))
(fabs (/ 1.0 (/ (/ y x) (+ z -1.0)))))))y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1.2e-40) {
tmp = fabs(((z + -1.0) / (y / x)));
} else if (x <= 6.8e-13) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = fabs((1.0 / ((y / x) / (z + -1.0))));
}
return tmp;
}
NOTE: y should be positive before calling this function
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.2d-40)) then
tmp = abs(((z + (-1.0d0)) / (y / x)))
else if (x <= 6.8d-13) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = abs((1.0d0 / ((y / x) / (z + (-1.0d0)))))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.2e-40) {
tmp = Math.abs(((z + -1.0) / (y / x)));
} else if (x <= 6.8e-13) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = Math.abs((1.0 / ((y / x) / (z + -1.0))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if x <= -1.2e-40: tmp = math.fabs(((z + -1.0) / (y / x))) elif x <= 6.8e-13: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = math.fabs((1.0 / ((y / x) / (z + -1.0)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (x <= -1.2e-40) tmp = abs(Float64(Float64(z + -1.0) / Float64(y / x))); elseif (x <= 6.8e-13) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = abs(Float64(1.0 / Float64(Float64(y / x) / Float64(z + -1.0)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.2e-40) tmp = abs(((z + -1.0) / (y / x))); elseif (x <= 6.8e-13) tmp = abs(((-4.0 - x) / y)); else tmp = abs((1.0 / ((y / x) / (z + -1.0)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[x, -1.2e-40], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6.8e-13], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(1.0 / N[(N[(y / x), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-40}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y}{x}}\right|\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-13}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{1}{\frac{\frac{y}{x}}{z + -1}}\right|\\
\end{array}
\end{array}
if x < -1.19999999999999996e-40Initial program 91.9%
Simplified89.1%
Taylor expanded in x around inf 85.5%
associate-/l*95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
if -1.19999999999999996e-40 < x < 6.80000000000000031e-13Initial program 92.1%
Simplified99.9%
Taylor expanded in z around 0 78.0%
associate-*r/78.0%
distribute-lft-in78.0%
metadata-eval78.0%
neg-mul-178.0%
sub-neg78.0%
Simplified78.0%
if 6.80000000000000031e-13 < x Initial program 89.7%
Simplified96.9%
Taylor expanded in x around inf 95.0%
associate-/l*97.6%
sub-neg97.6%
metadata-eval97.6%
Simplified97.6%
clear-num97.6%
inv-pow97.6%
Applied egg-rr97.6%
unpow-197.6%
Simplified97.6%
Final simplification87.7%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 5e+108) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (- (/ (+ x 4.0) y) (/ x (/ y z))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 5e+108) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs((((x + 4.0) / y) - (x / (y / z))));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 5d+108) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs((((x + 4.0d0) / y) - (x / (y / z))))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (y <= 5e+108) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs((((x + 4.0) / y) - (x / (y / z))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if y <= 5e+108: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs((((x + 4.0) / y) - (x / (y / z)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 5e+108) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(x / Float64(y / z)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 5e+108) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs((((x + 4.0) / y) - (x / (y / z)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 5e+108], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{\frac{y}{z}}\right|\\
\end{array}
\end{array}
if y < 4.99999999999999991e108Initial program 91.9%
associate-*l/95.1%
sub-div99.0%
Applied egg-rr99.0%
if 4.99999999999999991e108 < y Initial program 89.4%
associate-*l/87.1%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification99.1%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* x (/ z y)))))
(if (<= x -2e-41)
t_0
(if (<= x 8.5e-7)
(fabs (/ 4.0 y))
(if (<= x 1.3e+148) t_0 (fabs (/ x y)))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x * (z / y)));
double tmp;
if (x <= -2e-41) {
tmp = t_0;
} else if (x <= 8.5e-7) {
tmp = fabs((4.0 / y));
} else if (x <= 1.3e+148) {
tmp = t_0;
} else {
tmp = fabs((x / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 = abs((x * (z / y)))
if (x <= (-2d-41)) then
tmp = t_0
else if (x <= 8.5d-7) then
tmp = abs((4.0d0 / y))
else if (x <= 1.3d+148) then
tmp = t_0
else
tmp = abs((x / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x * (z / y)));
double tmp;
if (x <= -2e-41) {
tmp = t_0;
} else if (x <= 8.5e-7) {
tmp = Math.abs((4.0 / y));
} else if (x <= 1.3e+148) {
tmp = t_0;
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((x * (z / y))) tmp = 0 if x <= -2e-41: tmp = t_0 elif x <= 8.5e-7: tmp = math.fabs((4.0 / y)) elif x <= 1.3e+148: tmp = t_0 else: tmp = math.fabs((x / y)) return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(x * Float64(z / y))) tmp = 0.0 if (x <= -2e-41) tmp = t_0; elseif (x <= 8.5e-7) tmp = abs(Float64(4.0 / y)); elseif (x <= 1.3e+148) tmp = t_0; else tmp = abs(Float64(x / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs((x * (z / y))); tmp = 0.0; if (x <= -2e-41) tmp = t_0; elseif (x <= 8.5e-7) tmp = abs((4.0 / y)); elseif (x <= 1.3e+148) tmp = t_0; else tmp = abs((x / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2e-41], t$95$0, If[LessEqual[x, 8.5e-7], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.3e+148], t$95$0, N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{z}{y}\right|\\
\mathbf{if}\;x \leq -2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+148}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -2.00000000000000001e-41 or 8.50000000000000014e-7 < x < 1.3e148Initial program 93.6%
Simplified91.8%
Taylor expanded in z around inf 51.9%
associate-*l/58.9%
*-commutative58.9%
Simplified58.9%
if -2.00000000000000001e-41 < x < 8.50000000000000014e-7Initial program 92.2%
Taylor expanded in x around 0 77.2%
if 1.3e148 < x Initial program 81.8%
clear-num81.5%
associate-*l/87.8%
frac-sub78.4%
*-un-lft-identity78.4%
Applied egg-rr78.4%
Taylor expanded in x around inf 70.5%
associate-/l*87.8%
unpow287.8%
Simplified87.8%
Taylor expanded in z around 0 80.1%
Final simplification70.6%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y)))))
(if (<= x -4.8e-42)
t_0
(if (<= x 6e-13)
(fabs (/ 4.0 y))
(if (<= x 1.95e+149) t_0 (fabs (/ x y)))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((z * (x / y)));
double tmp;
if (x <= -4.8e-42) {
tmp = t_0;
} else if (x <= 6e-13) {
tmp = fabs((4.0 / y));
} else if (x <= 1.95e+149) {
tmp = t_0;
} else {
tmp = fabs((x / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 = abs((z * (x / y)))
if (x <= (-4.8d-42)) then
tmp = t_0
else if (x <= 6d-13) then
tmp = abs((4.0d0 / y))
else if (x <= 1.95d+149) then
tmp = t_0
else
tmp = abs((x / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double t_0 = Math.abs((z * (x / y)));
double tmp;
if (x <= -4.8e-42) {
tmp = t_0;
} else if (x <= 6e-13) {
tmp = Math.abs((4.0 / y));
} else if (x <= 1.95e+149) {
tmp = t_0;
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((z * (x / y))) tmp = 0 if x <= -4.8e-42: tmp = t_0 elif x <= 6e-13: tmp = math.fabs((4.0 / y)) elif x <= 1.95e+149: tmp = t_0 else: tmp = math.fabs((x / y)) return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(z * Float64(x / y))) tmp = 0.0 if (x <= -4.8e-42) tmp = t_0; elseif (x <= 6e-13) tmp = abs(Float64(4.0 / y)); elseif (x <= 1.95e+149) tmp = t_0; else tmp = abs(Float64(x / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs((z * (x / y))); tmp = 0.0; if (x <= -4.8e-42) tmp = t_0; elseif (x <= 6e-13) tmp = abs((4.0 / y)); elseif (x <= 1.95e+149) tmp = t_0; else tmp = abs((x / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -4.8e-42], t$95$0, If[LessEqual[x, 6e-13], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.95e+149], t$95$0, N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y}\right|\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{-42}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-13}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+149}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -4.80000000000000005e-42 or 5.99999999999999968e-13 < x < 1.95e149Initial program 93.7%
Simplified92.0%
Taylor expanded in x around inf 88.3%
associate-/l*95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in z around inf 51.9%
associate-*r/62.3%
Simplified62.3%
if -4.80000000000000005e-42 < x < 5.99999999999999968e-13Initial program 92.1%
Taylor expanded in x around 0 77.9%
if 1.95e149 < x Initial program 81.8%
clear-num81.5%
associate-*l/87.8%
frac-sub78.4%
*-un-lft-identity78.4%
Applied egg-rr78.4%
Taylor expanded in x around inf 70.5%
associate-/l*87.8%
unpow287.8%
Simplified87.8%
Taylor expanded in z around 0 80.1%
Final simplification72.1%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e-42)
(fabs (* z (/ x y)))
(if (<= x 6.5e-13)
(fabs (/ 4.0 y))
(if (<= x 6.5e+148) (fabs (/ z (/ y x))) (fabs (/ x y))))))y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-42) {
tmp = fabs((z * (x / y)));
} else if (x <= 6.5e-13) {
tmp = fabs((4.0 / y));
} else if (x <= 6.5e+148) {
tmp = fabs((z / (y / x)));
} else {
tmp = fabs((x / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-3.1d-42)) then
tmp = abs((z * (x / y)))
else if (x <= 6.5d-13) then
tmp = abs((4.0d0 / y))
else if (x <= 6.5d+148) then
tmp = abs((z / (y / x)))
else
tmp = abs((x / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e-42) {
tmp = Math.abs((z * (x / y)));
} else if (x <= 6.5e-13) {
tmp = Math.abs((4.0 / y));
} else if (x <= 6.5e+148) {
tmp = Math.abs((z / (y / x)));
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if x <= -3.1e-42: tmp = math.fabs((z * (x / y))) elif x <= 6.5e-13: tmp = math.fabs((4.0 / y)) elif x <= 6.5e+148: tmp = math.fabs((z / (y / x))) else: tmp = math.fabs((x / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (x <= -3.1e-42) tmp = abs(Float64(z * Float64(x / y))); elseif (x <= 6.5e-13) tmp = abs(Float64(4.0 / y)); elseif (x <= 6.5e+148) tmp = abs(Float64(z / Float64(y / x))); else tmp = abs(Float64(x / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.1e-42) tmp = abs((z * (x / y))); elseif (x <= 6.5e-13) tmp = abs((4.0 / y)); elseif (x <= 6.5e+148) tmp = abs((z / (y / x))); else tmp = abs((x / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[x, -3.1e-42], N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6.5e-13], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6.5e+148], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-42}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-13}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+148}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -3.1000000000000003e-42Initial program 91.9%
Simplified89.1%
Taylor expanded in x around inf 85.5%
associate-/l*95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in z around inf 46.7%
associate-*r/61.6%
Simplified61.6%
if -3.1000000000000003e-42 < x < 6.49999999999999957e-13Initial program 92.1%
Taylor expanded in x around 0 77.9%
if 6.49999999999999957e-13 < x < 6.49999999999999947e148Initial program 96.9%
Taylor expanded in z around inf 61.0%
associate-*r/61.0%
mul-1-neg61.0%
distribute-rgt-neg-out61.0%
associate-*r/63.5%
distribute-frac-neg63.5%
mul-1-neg63.5%
metadata-eval63.5%
times-frac63.5%
*-lft-identity63.5%
neg-mul-163.5%
Simplified63.5%
clear-num63.4%
un-div-inv63.7%
add-sqr-sqrt34.0%
sqrt-unprod47.2%
sqr-neg47.2%
sqrt-unprod29.5%
add-sqr-sqrt63.7%
Applied egg-rr63.7%
if 6.49999999999999947e148 < x Initial program 81.8%
clear-num81.5%
associate-*l/87.8%
frac-sub78.4%
*-un-lft-identity78.4%
Applied egg-rr78.4%
Taylor expanded in x around inf 70.5%
associate-/l*87.8%
unpow287.8%
Simplified87.8%
Taylor expanded in z around 0 80.1%
Final simplification72.2%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -6.5e-41) (not (<= x 0.6))) (fabs (* x (/ (- 1.0 z) y))) (fabs (/ (- -4.0 x) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e-41) || !(x <= 0.6)) {
tmp = fabs((x * ((1.0 - z) / y)));
} else {
tmp = fabs(((-4.0 - x) / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-6.5d-41)) .or. (.not. (x <= 0.6d0))) then
tmp = abs((x * ((1.0d0 - z) / y)))
else
tmp = abs((((-4.0d0) - x) / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e-41) || !(x <= 0.6)) {
tmp = Math.abs((x * ((1.0 - z) / y)));
} else {
tmp = Math.abs(((-4.0 - x) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -6.5e-41) or not (x <= 0.6): tmp = math.fabs((x * ((1.0 - z) / y))) else: tmp = math.fabs(((-4.0 - x) / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((x <= -6.5e-41) || !(x <= 0.6)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y))); else tmp = abs(Float64(Float64(-4.0 - x) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.5e-41) || ~((x <= 0.6))) tmp = abs((x * ((1.0 - z) / y))); else tmp = abs(((-4.0 - x) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[x, -6.5e-41], N[Not[LessEqual[x, 0.6]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-41} \lor \neg \left(x \leq 0.6\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\end{array}
\end{array}
if x < -6.5000000000000004e-41 or 0.599999999999999978 < x Initial program 90.6%
Taylor expanded in x around inf 96.7%
*-commutative96.7%
sub-neg96.7%
mul-1-neg96.7%
distribute-lft-in90.6%
associate-*r/90.8%
*-rgt-identity90.8%
mul-1-neg90.8%
distribute-rgt-neg-in90.8%
unsub-neg90.8%
*-lft-identity90.8%
associate-/l*90.7%
*-commutative90.7%
associate-/r/88.9%
div-sub97.4%
associate-/r/96.8%
Simplified96.8%
if -6.5000000000000004e-41 < x < 0.599999999999999978Initial program 92.2%
Simplified99.9%
Taylor expanded in z around 0 77.6%
associate-*r/77.6%
distribute-lft-in77.6%
metadata-eval77.6%
neg-mul-177.6%
sub-neg77.6%
Simplified77.6%
Final simplification87.4%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -3.4e-44) (not (<= x 1.05e-6))) (fabs (* x (/ (- 1.0 z) y))) (fabs (+ (/ 4.0 y) (/ x y)))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.4e-44) || !(x <= 1.05e-6)) {
tmp = fabs((x * ((1.0 - z) / y)));
} else {
tmp = fabs(((4.0 / y) + (x / y)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-3.4d-44)) .or. (.not. (x <= 1.05d-6))) then
tmp = abs((x * ((1.0d0 - z) / y)))
else
tmp = abs(((4.0d0 / y) + (x / y)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.4e-44) || !(x <= 1.05e-6)) {
tmp = Math.abs((x * ((1.0 - z) / y)));
} else {
tmp = Math.abs(((4.0 / y) + (x / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -3.4e-44) or not (x <= 1.05e-6): tmp = math.fabs((x * ((1.0 - z) / y))) else: tmp = math.fabs(((4.0 / y) + (x / y))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((x <= -3.4e-44) || !(x <= 1.05e-6)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y))); else tmp = abs(Float64(Float64(4.0 / y) + Float64(x / y))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.4e-44) || ~((x <= 1.05e-6))) tmp = abs((x * ((1.0 - z) / y))); else tmp = abs(((4.0 / y) + (x / y))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[x, -3.4e-44], N[Not[LessEqual[x, 1.05e-6]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 / y), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-44} \lor \neg \left(x \leq 1.05 \cdot 10^{-6}\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y} + \frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -3.40000000000000016e-44 or 1.0499999999999999e-6 < x Initial program 90.6%
Taylor expanded in x around inf 96.7%
*-commutative96.7%
sub-neg96.7%
mul-1-neg96.7%
distribute-lft-in90.6%
associate-*r/90.8%
*-rgt-identity90.8%
mul-1-neg90.8%
distribute-rgt-neg-in90.8%
unsub-neg90.8%
*-lft-identity90.8%
associate-/l*90.7%
*-commutative90.7%
associate-/r/88.9%
div-sub97.4%
associate-/r/96.8%
Simplified96.8%
if -3.40000000000000016e-44 < x < 1.0499999999999999e-6Initial program 92.2%
Taylor expanded in z around 0 77.7%
associate-*r/77.7%
metadata-eval77.7%
Simplified77.7%
Final simplification87.4%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -1.8e-41) (not (<= x 1.8e-12))) (fabs (/ (+ z -1.0) (/ y x))) (fabs (/ (- -4.0 x) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.8e-41) || !(x <= 1.8e-12)) {
tmp = fabs(((z + -1.0) / (y / x)));
} else {
tmp = fabs(((-4.0 - x) / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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.8d-41)) .or. (.not. (x <= 1.8d-12))) then
tmp = abs(((z + (-1.0d0)) / (y / x)))
else
tmp = abs((((-4.0d0) - x) / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.8e-41) || !(x <= 1.8e-12)) {
tmp = Math.abs(((z + -1.0) / (y / x)));
} else {
tmp = Math.abs(((-4.0 - x) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -1.8e-41) or not (x <= 1.8e-12): tmp = math.fabs(((z + -1.0) / (y / x))) else: tmp = math.fabs(((-4.0 - x) / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((x <= -1.8e-41) || !(x <= 1.8e-12)) tmp = abs(Float64(Float64(z + -1.0) / Float64(y / x))); else tmp = abs(Float64(Float64(-4.0 - x) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.8e-41) || ~((x <= 1.8e-12))) tmp = abs(((z + -1.0) / (y / x))); else tmp = abs(((-4.0 - x) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[x, -1.8e-41], N[Not[LessEqual[x, 1.8e-12]], $MachinePrecision]], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-41} \lor \neg \left(x \leq 1.8 \cdot 10^{-12}\right):\\
\;\;\;\;\left|\frac{z + -1}{\frac{y}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\end{array}
\end{array}
if x < -1.8e-41 or 1.8e-12 < x Initial program 90.7%
Simplified93.2%
Taylor expanded in x around inf 90.5%
associate-/l*96.7%
sub-neg96.7%
metadata-eval96.7%
Simplified96.7%
if -1.8e-41 < x < 1.8e-12Initial program 92.1%
Simplified99.9%
Taylor expanded in z around 0 78.0%
associate-*r/78.0%
distribute-lft-in78.0%
metadata-eval78.0%
neg-mul-178.0%
sub-neg78.0%
Simplified78.0%
Final simplification87.7%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= x -1e+151) (fabs (* x (/ (- 1.0 z) y))) (fabs (/ (- (+ x 4.0) (* x z)) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (x <= -1e+151) {
tmp = fabs((x * ((1.0 - z) / y)));
} else {
tmp = fabs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-1d+151)) then
tmp = abs((x * ((1.0d0 - z) / y)))
else
tmp = abs((((x + 4.0d0) - (x * z)) / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e+151) {
tmp = Math.abs((x * ((1.0 - z) / y)));
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if x <= -1e+151: tmp = math.fabs((x * ((1.0 - z) / y))) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (x <= -1e+151) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y))); else tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e+151) tmp = abs((x * ((1.0 - z) / y))); else tmp = abs((((x + 4.0) - (x * z)) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[x, -1e+151], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\end{array}
\end{array}
if x < -1.00000000000000002e151Initial program 92.4%
Taylor expanded in x around inf 99.8%
*-commutative99.8%
sub-neg99.8%
mul-1-neg99.8%
distribute-lft-in92.4%
associate-*r/92.5%
*-rgt-identity92.5%
mul-1-neg92.5%
distribute-rgt-neg-in92.5%
unsub-neg92.5%
*-lft-identity92.5%
associate-/l*92.5%
*-commutative92.5%
associate-/r/92.4%
div-sub99.8%
associate-/r/99.8%
Simplified99.8%
if -1.00000000000000002e151 < x Initial program 91.2%
associate-*l/96.4%
sub-div99.0%
Applied egg-rr99.0%
Final simplification99.1%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= z -3.5e+109) (not (<= z 5.4e+82))) (fabs (* x (/ z y))) (fabs (/ (- -4.0 x) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -3.5e+109) || !(z <= 5.4e+82)) {
tmp = fabs((x * (z / y)));
} else {
tmp = fabs(((-4.0 - x) / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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.5d+109)) .or. (.not. (z <= 5.4d+82))) then
tmp = abs((x * (z / y)))
else
tmp = abs((((-4.0d0) - x) / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -3.5e+109) || !(z <= 5.4e+82)) {
tmp = Math.abs((x * (z / y)));
} else {
tmp = Math.abs(((-4.0 - x) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (z <= -3.5e+109) or not (z <= 5.4e+82): tmp = math.fabs((x * (z / y))) else: tmp = math.fabs(((-4.0 - x) / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((z <= -3.5e+109) || !(z <= 5.4e+82)) tmp = abs(Float64(x * Float64(z / y))); else tmp = abs(Float64(Float64(-4.0 - x) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -3.5e+109) || ~((z <= 5.4e+82))) tmp = abs((x * (z / y))); else tmp = abs(((-4.0 - x) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[z, -3.5e+109], N[Not[LessEqual[z, 5.4e+82]], $MachinePrecision]], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+109} \lor \neg \left(z \leq 5.4 \cdot 10^{+82}\right):\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\end{array}
\end{array}
if z < -3.49999999999999983e109 or 5.3999999999999999e82 < z Initial program 83.9%
Simplified91.6%
Taylor expanded in z around inf 74.6%
associate-*l/77.8%
*-commutative77.8%
Simplified77.8%
if -3.49999999999999983e109 < z < 5.3999999999999999e82Initial program 95.6%
Simplified99.2%
Taylor expanded in z around 0 89.6%
associate-*r/89.6%
distribute-lft-in89.6%
metadata-eval89.6%
neg-mul-189.6%
sub-neg89.6%
Simplified89.6%
Final simplification85.3%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -10.2) (not (<= x 4.0))) (fabs (/ x y)) (fabs (/ 4.0 y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -10.2) || !(x <= 4.0)) {
tmp = fabs((x / y));
} else {
tmp = fabs((4.0 / y));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-10.2d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y))
else
tmp = abs((4.0d0 / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -10.2) || !(x <= 4.0)) {
tmp = Math.abs((x / y));
} else {
tmp = Math.abs((4.0 / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -10.2) or not (x <= 4.0): tmp = math.fabs((x / y)) else: tmp = math.fabs((4.0 / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((x <= -10.2) || !(x <= 4.0)) tmp = abs(Float64(x / y)); else tmp = abs(Float64(4.0 / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -10.2) || ~((x <= 4.0))) tmp = abs((x / y)); else tmp = abs((4.0 / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[x, -10.2], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.2 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\end{array}
\end{array}
if x < -10.199999999999999 or 4 < x Initial program 90.2%
clear-num90.0%
associate-*l/86.4%
frac-sub62.4%
*-un-lft-identity62.4%
Applied egg-rr62.4%
Taylor expanded in x around inf 55.3%
associate-/l*67.3%
unpow267.3%
Simplified67.3%
Taylor expanded in z around 0 59.2%
if -10.199999999999999 < x < 4Initial program 92.5%
Taylor expanded in x around 0 75.0%
Final simplification67.3%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (fabs (/ 4.0 y)))
y = abs(y);
double code(double x, double y, double z) {
return fabs((4.0 / y));
}
NOTE: y should be positive before calling this function
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((4.0d0 / y))
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
return Math.abs((4.0 / y));
}
y = abs(y) def code(x, y, z): return math.fabs((4.0 / y))
y = abs(y) function code(x, y, z) return abs(Float64(4.0 / y)) end
y = abs(y) function tmp = code(x, y, z) tmp = abs((4.0 / y)); end
NOTE: y should be positive before calling this function code[x_, y_, z_] := N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\left|\frac{4}{y}\right|
\end{array}
Initial program 91.4%
Taylor expanded in x around 0 41.1%
Final simplification41.1%
herbie shell --seed 2023200
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))