
(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 12 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 5e+42) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (- (/ x (/ y z)) (/ (+ x 4.0) y)))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 5e+42) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(((x / (y / z)) - ((x + 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 (y <= 5d+42) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs(((x / (y / z)) - ((x + 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 (y <= 5e+42) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((x / (y / z)) - ((x + 4.0) / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if y <= 5e+42: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((x / (y / z)) - ((x + 4.0) / y))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 5e+42) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(x / Float64(y / z)) - Float64(Float64(x + 4.0) / y))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 5e+42) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((x / (y / z)) - ((x + 4.0) / y))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 5e+42], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+42}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}} - \frac{x + 4}{y}\right|\\
\end{array}
\end{array}
if y < 5.00000000000000007e42Initial program 90.0%
associate-*l/88.7%
sub-div95.7%
Applied egg-rr95.7%
if 5.00000000000000007e42 < y Initial program 99.9%
associate-*l/93.4%
associate-/l*99.9%
Applied egg-rr99.9%
Final simplification96.6%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y) (* z (/ x y))))) (if (<= t_0 6e+305) (fabs t_0) (fabs (/ (- (+ x 4.0) (* x z)) y)))))
y = abs(y);
double code(double x, double y, double z) {
double t_0 = ((x + 4.0) / y) - (z * (x / y));
double tmp;
if (t_0 <= 6e+305) {
tmp = fabs(t_0);
} 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) :: t_0
real(8) :: tmp
t_0 = ((x + 4.0d0) / y) - (z * (x / y))
if (t_0 <= 6d+305) then
tmp = abs(t_0)
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 t_0 = ((x + 4.0) / y) - (z * (x / y));
double tmp;
if (t_0 <= 6e+305) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = ((x + 4.0) / y) - (z * (x / y)) tmp = 0 if t_0 <= 6e+305: tmp = math.fabs(t_0) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) return tmp
y = abs(y) function code(x, y, z) t_0 = Float64(Float64(Float64(x + 4.0) / y) - Float64(z * Float64(x / y))) tmp = 0.0 if (t_0 <= 6e+305) tmp = abs(t_0); 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) t_0 = ((x + 4.0) / y) - (z * (x / y)); tmp = 0.0; if (t_0 <= 6e+305) tmp = abs(t_0); 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_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 6e+305], N[Abs[t$95$0], $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}
t_0 := \frac{x + 4}{y} - z \cdot \frac{x}{y}\\
\mathbf{if}\;t_0 \leq 6 \cdot 10^{+305}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) < 5.99999999999999964e305Initial program 99.1%
if 5.99999999999999964e305 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) Initial program 51.4%
associate-*l/62.2%
sub-div100.0%
Applied egg-rr100.0%
Final simplification99.2%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))) (t_1 (fabs (* x (/ z y)))))
(if (<= x -2.5e+221)
t_0
(if (<= x -6.4e-19)
t_1
(if (<= x 1.3e-79)
(fabs (/ 4.0 y))
(if (or (<= x 7e+49) (not (<= x 5.6e+137))) t_1 t_0))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double t_1 = fabs((x * (z / y)));
double tmp;
if (x <= -2.5e+221) {
tmp = t_0;
} else if (x <= -6.4e-19) {
tmp = t_1;
} else if (x <= 1.3e-79) {
tmp = fabs((4.0 / y));
} else if ((x <= 7e+49) || !(x <= 5.6e+137)) {
tmp = t_1;
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y))
t_1 = abs((x * (z / y)))
if (x <= (-2.5d+221)) then
tmp = t_0
else if (x <= (-6.4d-19)) then
tmp = t_1
else if (x <= 1.3d-79) then
tmp = abs((4.0d0 / y))
else if ((x <= 7d+49) .or. (.not. (x <= 5.6d+137))) then
tmp = t_1
else
tmp = t_0
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 / y));
double t_1 = Math.abs((x * (z / y)));
double tmp;
if (x <= -2.5e+221) {
tmp = t_0;
} else if (x <= -6.4e-19) {
tmp = t_1;
} else if (x <= 1.3e-79) {
tmp = Math.abs((4.0 / y));
} else if ((x <= 7e+49) || !(x <= 5.6e+137)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((x / y)) t_1 = math.fabs((x * (z / y))) tmp = 0 if x <= -2.5e+221: tmp = t_0 elif x <= -6.4e-19: tmp = t_1 elif x <= 1.3e-79: tmp = math.fabs((4.0 / y)) elif (x <= 7e+49) or not (x <= 5.6e+137): tmp = t_1 else: tmp = t_0 return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(x / y)) t_1 = abs(Float64(x * Float64(z / y))) tmp = 0.0 if (x <= -2.5e+221) tmp = t_0; elseif (x <= -6.4e-19) tmp = t_1; elseif (x <= 1.3e-79) tmp = abs(Float64(4.0 / y)); elseif ((x <= 7e+49) || !(x <= 5.6e+137)) tmp = t_1; else tmp = t_0; end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs((x / y)); t_1 = abs((x * (z / y))); tmp = 0.0; if (x <= -2.5e+221) tmp = t_0; elseif (x <= -6.4e-19) tmp = t_1; elseif (x <= 1.3e-79) tmp = abs((4.0 / y)); elseif ((x <= 7e+49) || ~((x <= 5.6e+137))) tmp = t_1; else tmp = t_0; 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 / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.5e+221], t$95$0, If[LessEqual[x, -6.4e-19], t$95$1, If[LessEqual[x, 1.3e-79], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 7e+49], N[Not[LessEqual[x, 5.6e+137]], $MachinePrecision]], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|x \cdot \frac{z}{y}\right|\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+221}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-19}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-79}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+49} \lor \neg \left(x \leq 5.6 \cdot 10^{+137}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.5000000000000001e221 or 6.9999999999999995e49 < x < 5.60000000000000002e137Initial program 87.1%
fabs-neg87.1%
sub-neg87.1%
distribute-neg-in87.1%
sub-neg87.1%
distribute-neg-frac87.1%
associate-*l/80.2%
distribute-neg-frac80.2%
neg-mul-180.2%
associate-*l/80.1%
neg-mul-180.1%
associate-*l/80.1%
distribute-lft-out--90.3%
fabs-mul90.3%
fabs-sub90.3%
fabs-mul90.3%
associate-*l/90.4%
Simplified90.4%
Taylor expanded in x around inf 90.4%
associate-/l*99.6%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 76.1%
if -2.5000000000000001e221 < x < -6.39999999999999965e-19 or 1.29999999999999997e-79 < x < 6.9999999999999995e49 or 5.60000000000000002e137 < x Initial program 86.8%
Taylor expanded in z around inf 62.0%
associate-*r/62.0%
mul-1-neg62.0%
*-commutative62.0%
distribute-lft-neg-in62.0%
associate-*l/76.2%
*-commutative76.2%
Simplified76.2%
clear-num76.1%
un-div-inv76.2%
add-sqr-sqrt33.5%
sqrt-unprod64.2%
sqr-neg64.2%
sqrt-unprod42.6%
add-sqr-sqrt76.2%
Applied egg-rr76.2%
associate-/r/69.5%
Applied egg-rr69.5%
if -6.39999999999999965e-19 < x < 1.29999999999999997e-79Initial program 98.4%
Taylor expanded in x around 0 84.2%
Final simplification77.3%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))))
(if (<= x -3.25e+221)
t_0
(if (<= x -1.35e-18)
(fabs (/ x (/ y z)))
(if (<= x 9.6e-80)
(fabs (/ 4.0 y))
(if (or (<= x 1.2e+50) (not (<= x 9.8e+137)))
(fabs (* x (/ z y)))
t_0))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double tmp;
if (x <= -3.25e+221) {
tmp = t_0;
} else if (x <= -1.35e-18) {
tmp = fabs((x / (y / z)));
} else if (x <= 9.6e-80) {
tmp = fabs((4.0 / y));
} else if ((x <= 1.2e+50) || !(x <= 9.8e+137)) {
tmp = fabs((x * (z / y)));
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = abs((x / y))
if (x <= (-3.25d+221)) then
tmp = t_0
else if (x <= (-1.35d-18)) then
tmp = abs((x / (y / z)))
else if (x <= 9.6d-80) then
tmp = abs((4.0d0 / y))
else if ((x <= 1.2d+50) .or. (.not. (x <= 9.8d+137))) then
tmp = abs((x * (z / y)))
else
tmp = t_0
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 / y));
double tmp;
if (x <= -3.25e+221) {
tmp = t_0;
} else if (x <= -1.35e-18) {
tmp = Math.abs((x / (y / z)));
} else if (x <= 9.6e-80) {
tmp = Math.abs((4.0 / y));
} else if ((x <= 1.2e+50) || !(x <= 9.8e+137)) {
tmp = Math.abs((x * (z / y)));
} else {
tmp = t_0;
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((x / y)) tmp = 0 if x <= -3.25e+221: tmp = t_0 elif x <= -1.35e-18: tmp = math.fabs((x / (y / z))) elif x <= 9.6e-80: tmp = math.fabs((4.0 / y)) elif (x <= 1.2e+50) or not (x <= 9.8e+137): tmp = math.fabs((x * (z / y))) else: tmp = t_0 return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(x / y)) tmp = 0.0 if (x <= -3.25e+221) tmp = t_0; elseif (x <= -1.35e-18) tmp = abs(Float64(x / Float64(y / z))); elseif (x <= 9.6e-80) tmp = abs(Float64(4.0 / y)); elseif ((x <= 1.2e+50) || !(x <= 9.8e+137)) tmp = abs(Float64(x * Float64(z / y))); else tmp = t_0; end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs((x / y)); tmp = 0.0; if (x <= -3.25e+221) tmp = t_0; elseif (x <= -1.35e-18) tmp = abs((x / (y / z))); elseif (x <= 9.6e-80) tmp = abs((4.0 / y)); elseif ((x <= 1.2e+50) || ~((x <= 9.8e+137))) tmp = abs((x * (z / y))); else tmp = t_0; 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 / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3.25e+221], t$95$0, If[LessEqual[x, -1.35e-18], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.6e-80], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 1.2e+50], N[Not[LessEqual[x, 9.8e+137]], $MachinePrecision]], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
\mathbf{if}\;x \leq -3.25 \cdot 10^{+221}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-18}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-80}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+50} \lor \neg \left(x \leq 9.8 \cdot 10^{+137}\right):\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.2500000000000002e221 or 1.2000000000000001e50 < x < 9.80000000000000065e137Initial program 87.1%
fabs-neg87.1%
sub-neg87.1%
distribute-neg-in87.1%
sub-neg87.1%
distribute-neg-frac87.1%
associate-*l/80.2%
distribute-neg-frac80.2%
neg-mul-180.2%
associate-*l/80.1%
neg-mul-180.1%
associate-*l/80.1%
distribute-lft-out--90.3%
fabs-mul90.3%
fabs-sub90.3%
fabs-mul90.3%
associate-*l/90.4%
Simplified90.4%
Taylor expanded in x around inf 90.4%
associate-/l*99.6%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around 0 76.1%
if -3.2500000000000002e221 < x < -1.34999999999999994e-18Initial program 86.9%
Taylor expanded in z around inf 62.0%
associate-*r/62.0%
mul-1-neg62.0%
*-commutative62.0%
distribute-lft-neg-in62.0%
associate-*l/72.2%
*-commutative72.2%
Simplified72.2%
*-commutative72.2%
distribute-frac-neg72.2%
distribute-lft-neg-in72.2%
associate-/r/68.1%
distribute-neg-frac68.1%
add-sqr-sqrt68.0%
sqrt-unprod59.5%
sqr-neg59.5%
sqrt-unprod0.0%
add-sqr-sqrt68.1%
Applied egg-rr68.1%
if -1.34999999999999994e-18 < x < 9.5999999999999996e-80Initial program 98.4%
Taylor expanded in x around 0 84.2%
if 9.5999999999999996e-80 < x < 1.2000000000000001e50 or 9.80000000000000065e137 < x Initial program 86.7%
Taylor expanded in z around inf 61.9%
associate-*r/61.9%
mul-1-neg61.9%
*-commutative61.9%
distribute-lft-neg-in61.9%
associate-*l/79.7%
*-commutative79.7%
Simplified79.7%
clear-num79.6%
un-div-inv79.8%
add-sqr-sqrt0.0%
sqrt-unprod64.5%
sqr-neg64.5%
sqrt-unprod79.6%
add-sqr-sqrt79.8%
Applied egg-rr79.8%
associate-/r/70.8%
Applied egg-rr70.8%
Final simplification77.3%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ z (/ y x)))))
(if (<= x -2.15e-18)
t_0
(if (<= x 3.55e-82)
(fabs (/ 4.0 y))
(if (or (<= x 3.2e+50) (not (<= x 1.12e+138))) t_0 (fabs (/ x y)))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((z / (y / x)));
double tmp;
if (x <= -2.15e-18) {
tmp = t_0;
} else if (x <= 3.55e-82) {
tmp = fabs((4.0 / y));
} else if ((x <= 3.2e+50) || !(x <= 1.12e+138)) {
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 / (y / x)))
if (x <= (-2.15d-18)) then
tmp = t_0
else if (x <= 3.55d-82) then
tmp = abs((4.0d0 / y))
else if ((x <= 3.2d+50) .or. (.not. (x <= 1.12d+138))) 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 / (y / x)));
double tmp;
if (x <= -2.15e-18) {
tmp = t_0;
} else if (x <= 3.55e-82) {
tmp = Math.abs((4.0 / y));
} else if ((x <= 3.2e+50) || !(x <= 1.12e+138)) {
tmp = t_0;
} else {
tmp = Math.abs((x / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((z / (y / x))) tmp = 0 if x <= -2.15e-18: tmp = t_0 elif x <= 3.55e-82: tmp = math.fabs((4.0 / y)) elif (x <= 3.2e+50) or not (x <= 1.12e+138): 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(y / x))) tmp = 0.0 if (x <= -2.15e-18) tmp = t_0; elseif (x <= 3.55e-82) tmp = abs(Float64(4.0 / y)); elseif ((x <= 3.2e+50) || !(x <= 1.12e+138)) 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 / (y / x))); tmp = 0.0; if (x <= -2.15e-18) tmp = t_0; elseif (x <= 3.55e-82) tmp = abs((4.0 / y)); elseif ((x <= 3.2e+50) || ~((x <= 1.12e+138))) 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[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.15e-18], t$95$0, If[LessEqual[x, 3.55e-82], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 3.2e+50], N[Not[LessEqual[x, 1.12e+138]], $MachinePrecision]], t$95$0, N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{z}{\frac{y}{x}}\right|\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.55 \cdot 10^{-82}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+50} \lor \neg \left(x \leq 1.12 \cdot 10^{+138}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\end{array}
\end{array}
if x < -2.1500000000000001e-18 or 3.55000000000000021e-82 < x < 3.19999999999999983e50 or 1.12e138 < x Initial program 84.5%
Taylor expanded in z around inf 57.4%
associate-*r/57.4%
mul-1-neg57.4%
*-commutative57.4%
distribute-lft-neg-in57.4%
associate-*l/75.8%
*-commutative75.8%
Simplified75.8%
clear-num75.7%
un-div-inv75.8%
add-sqr-sqrt39.6%
sqrt-unprod62.5%
sqr-neg62.5%
sqrt-unprod36.0%
add-sqr-sqrt75.8%
Applied egg-rr75.8%
if -2.1500000000000001e-18 < x < 3.55000000000000021e-82Initial program 98.4%
Taylor expanded in x around 0 84.2%
if 3.19999999999999983e50 < x < 1.12e138Initial program 99.9%
fabs-neg99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
distribute-neg-frac99.9%
associate-*l/99.9%
distribute-neg-frac99.9%
neg-mul-199.9%
associate-*l/99.7%
neg-mul-199.7%
associate-*l/99.7%
distribute-lft-out--99.7%
fabs-mul99.7%
fabs-sub99.7%
fabs-mul99.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in x around inf 99.9%
associate-/l*99.6%
associate-/r/99.6%
Simplified99.6%
Taylor expanded in z around 0 73.5%
Final simplification79.5%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ (- -4.0 x) y))))
(if (<= z -8e+165)
(fabs (* x (/ z y)))
(if (<= z -6.9e+90)
t_0
(if (<= z -2300000000.0)
(fabs (/ x (/ y z)))
(if (<= z 2.5e+38) t_0 (fabs (/ z (/ y x)))))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs(((-4.0 - x) / y));
double tmp;
if (z <= -8e+165) {
tmp = fabs((x * (z / y)));
} else if (z <= -6.9e+90) {
tmp = t_0;
} else if (z <= -2300000000.0) {
tmp = fabs((x / (y / z)));
} else if (z <= 2.5e+38) {
tmp = t_0;
} else {
tmp = fabs((z / (y / x)));
}
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((((-4.0d0) - x) / y))
if (z <= (-8d+165)) then
tmp = abs((x * (z / y)))
else if (z <= (-6.9d+90)) then
tmp = t_0
else if (z <= (-2300000000.0d0)) then
tmp = abs((x / (y / z)))
else if (z <= 2.5d+38) then
tmp = t_0
else
tmp = abs((z / (y / x)))
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(((-4.0 - x) / y));
double tmp;
if (z <= -8e+165) {
tmp = Math.abs((x * (z / y)));
} else if (z <= -6.9e+90) {
tmp = t_0;
} else if (z <= -2300000000.0) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 2.5e+38) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs(((-4.0 - x) / y)) tmp = 0 if z <= -8e+165: tmp = math.fabs((x * (z / y))) elif z <= -6.9e+90: tmp = t_0 elif z <= -2300000000.0: tmp = math.fabs((x / (y / z))) elif z <= 2.5e+38: tmp = t_0 else: tmp = math.fabs((z / (y / x))) return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(Float64(-4.0 - x) / y)) tmp = 0.0 if (z <= -8e+165) tmp = abs(Float64(x * Float64(z / y))); elseif (z <= -6.9e+90) tmp = t_0; elseif (z <= -2300000000.0) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 2.5e+38) tmp = t_0; else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs(((-4.0 - x) / y)); tmp = 0.0; if (z <= -8e+165) tmp = abs((x * (z / y))); elseif (z <= -6.9e+90) tmp = t_0; elseif (z <= -2300000000.0) tmp = abs((x / (y / z))); elseif (z <= 2.5e+38) tmp = t_0; else tmp = abs((z / (y / x))); 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[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -8e+165], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -6.9e+90], t$95$0, If[LessEqual[z, -2300000000.0], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.5e+38], t$95$0, N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{-4 - x}{y}\right|\\
\mathbf{if}\;z \leq -8 \cdot 10^{+165}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;z \leq -6.9 \cdot 10^{+90}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2300000000:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -7.9999999999999992e165Initial program 92.0%
Taylor expanded in z around inf 80.6%
associate-*r/80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-lft-neg-in80.6%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
clear-num87.9%
un-div-inv88.1%
add-sqr-sqrt16.5%
sqrt-unprod72.5%
sqr-neg72.5%
sqrt-unprod71.2%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
associate-/r/92.1%
Applied egg-rr92.1%
if -7.9999999999999992e165 < z < -6.89999999999999955e90 or -2.3e9 < z < 2.49999999999999985e38Initial program 95.9%
fabs-sub95.9%
associate-*l/98.6%
*-commutative98.6%
associate-*l/98.6%
*-commutative98.6%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 95.6%
associate-*r/95.6%
distribute-lft-in95.6%
metadata-eval95.6%
neg-mul-195.6%
sub-neg95.6%
Simplified95.6%
if -6.89999999999999955e90 < z < -2.3e9Initial program 99.8%
Taylor expanded in z around inf 77.9%
associate-*r/77.9%
mul-1-neg77.9%
*-commutative77.9%
distribute-lft-neg-in77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
*-commutative77.9%
distribute-frac-neg77.9%
distribute-lft-neg-in77.9%
associate-/r/78.1%
distribute-neg-frac78.1%
add-sqr-sqrt35.5%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod42.3%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
if 2.49999999999999985e38 < z Initial program 81.2%
Taylor expanded in z around inf 70.4%
associate-*r/70.4%
mul-1-neg70.4%
*-commutative70.4%
distribute-lft-neg-in70.4%
associate-*l/83.6%
*-commutative83.6%
Simplified83.6%
clear-num83.5%
un-div-inv83.6%
add-sqr-sqrt44.7%
sqrt-unprod65.1%
sqr-neg65.1%
sqrt-unprod38.7%
add-sqr-sqrt83.6%
Applied egg-rr83.6%
Final simplification90.8%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ (- -4.0 x) y))))
(if (<= z -1.5e+166)
(fabs (* x (/ z y)))
(if (<= z -2e+90)
t_0
(if (<= z -2300000000.0)
(fabs (/ x (/ y z)))
(if (<= z 2.85e+38) t_0 (fabs (* z (/ x y)))))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs(((-4.0 - x) / y));
double tmp;
if (z <= -1.5e+166) {
tmp = fabs((x * (z / y)));
} else if (z <= -2e+90) {
tmp = t_0;
} else if (z <= -2300000000.0) {
tmp = fabs((x / (y / z)));
} else if (z <= 2.85e+38) {
tmp = t_0;
} else {
tmp = fabs((z * (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((((-4.0d0) - x) / y))
if (z <= (-1.5d+166)) then
tmp = abs((x * (z / y)))
else if (z <= (-2d+90)) then
tmp = t_0
else if (z <= (-2300000000.0d0)) then
tmp = abs((x / (y / z)))
else if (z <= 2.85d+38) then
tmp = t_0
else
tmp = abs((z * (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(((-4.0 - x) / y));
double tmp;
if (z <= -1.5e+166) {
tmp = Math.abs((x * (z / y)));
} else if (z <= -2e+90) {
tmp = t_0;
} else if (z <= -2300000000.0) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 2.85e+38) {
tmp = t_0;
} else {
tmp = Math.abs((z * (x / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs(((-4.0 - x) / y)) tmp = 0 if z <= -1.5e+166: tmp = math.fabs((x * (z / y))) elif z <= -2e+90: tmp = t_0 elif z <= -2300000000.0: tmp = math.fabs((x / (y / z))) elif z <= 2.85e+38: tmp = t_0 else: tmp = math.fabs((z * (x / y))) return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(Float64(-4.0 - x) / y)) tmp = 0.0 if (z <= -1.5e+166) tmp = abs(Float64(x * Float64(z / y))); elseif (z <= -2e+90) tmp = t_0; elseif (z <= -2300000000.0) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 2.85e+38) tmp = t_0; else tmp = abs(Float64(z * Float64(x / y))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs(((-4.0 - x) / y)); tmp = 0.0; if (z <= -1.5e+166) tmp = abs((x * (z / y))); elseif (z <= -2e+90) tmp = t_0; elseif (z <= -2300000000.0) tmp = abs((x / (y / z))); elseif (z <= 2.85e+38) tmp = t_0; else tmp = abs((z * (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[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.5e+166], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -2e+90], t$95$0, If[LessEqual[z, -2300000000.0], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.85e+38], t$95$0, N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{-4 - x}{y}\right|\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+166}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;z \leq -2 \cdot 10^{+90}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2300000000:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 2.85 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\end{array}
\end{array}
if z < -1.49999999999999999e166Initial program 92.0%
Taylor expanded in z around inf 80.6%
associate-*r/80.6%
mul-1-neg80.6%
*-commutative80.6%
distribute-lft-neg-in80.6%
associate-*l/88.0%
*-commutative88.0%
Simplified88.0%
clear-num87.9%
un-div-inv88.1%
add-sqr-sqrt16.5%
sqrt-unprod72.5%
sqr-neg72.5%
sqrt-unprod71.2%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
associate-/r/92.1%
Applied egg-rr92.1%
if -1.49999999999999999e166 < z < -1.99999999999999993e90 or -2.3e9 < z < 2.8499999999999999e38Initial program 95.9%
fabs-sub95.9%
associate-*l/98.6%
*-commutative98.6%
associate-*l/98.6%
*-commutative98.6%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 95.6%
associate-*r/95.6%
distribute-lft-in95.6%
metadata-eval95.6%
neg-mul-195.6%
sub-neg95.6%
Simplified95.6%
if -1.99999999999999993e90 < z < -2.3e9Initial program 99.8%
Taylor expanded in z around inf 77.9%
associate-*r/77.9%
mul-1-neg77.9%
*-commutative77.9%
distribute-lft-neg-in77.9%
associate-*l/77.9%
*-commutative77.9%
Simplified77.9%
*-commutative77.9%
distribute-frac-neg77.9%
distribute-lft-neg-in77.9%
associate-/r/78.1%
distribute-neg-frac78.1%
add-sqr-sqrt35.5%
sqrt-unprod52.1%
sqr-neg52.1%
sqrt-unprod42.3%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
if 2.8499999999999999e38 < z Initial program 81.2%
Taylor expanded in z around inf 70.4%
associate-*r/70.4%
mul-1-neg70.4%
*-commutative70.4%
distribute-lft-neg-in70.4%
associate-*l/83.6%
*-commutative83.6%
Simplified83.6%
Final simplification90.8%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -6.5e+64) (not (<= x 1e+125))) (fabs (/ (- 1.0 z) (/ y x))) (fabs (/ (- (+ x 4.0) (* x z)) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.5e+64) || !(x <= 1e+125)) {
tmp = fabs(((1.0 - z) / (y / x)));
} 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 <= (-6.5d+64)) .or. (.not. (x <= 1d+125))) then
tmp = abs(((1.0d0 - z) / (y / x)))
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 <= -6.5e+64) || !(x <= 1e+125)) {
tmp = Math.abs(((1.0 - z) / (y / x)));
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -6.5e+64) or not (x <= 1e+125): tmp = math.fabs(((1.0 - z) / (y / x))) 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 <= -6.5e+64) || !(x <= 1e+125)) tmp = abs(Float64(Float64(1.0 - z) / Float64(y / x))); 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 <= -6.5e+64) || ~((x <= 1e+125))) tmp = abs(((1.0 - z) / (y / x))); 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[Or[LessEqual[x, -6.5e+64], N[Not[LessEqual[x, 1e+125]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] / N[(y / x), $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 -6.5 \cdot 10^{+64} \lor \neg \left(x \leq 10^{+125}\right):\\
\;\;\;\;\left|\frac{1 - z}{\frac{y}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\end{array}
\end{array}
if x < -6.50000000000000007e64 or 9.9999999999999992e124 < x Initial program 77.7%
fabs-neg77.7%
sub-neg77.7%
distribute-neg-in77.7%
sub-neg77.7%
distribute-neg-frac77.7%
associate-*l/67.7%
distribute-neg-frac67.7%
neg-mul-167.7%
associate-*l/67.6%
neg-mul-167.6%
associate-*l/67.5%
distribute-lft-out--84.8%
fabs-mul84.8%
fabs-sub84.8%
fabs-mul84.8%
associate-*l/85.0%
Simplified85.0%
Taylor expanded in x around inf 85.0%
associate-/l*99.9%
Simplified99.9%
if -6.50000000000000007e64 < x < 9.9999999999999992e124Initial program 98.9%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
Final simplification99.9%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -76000.0) (not (<= x 6.5e-80))) (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 <= -76000.0) || !(x <= 6.5e-80)) {
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 <= (-76000.0d0)) .or. (.not. (x <= 6.5d-80))) 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 <= -76000.0) || !(x <= 6.5e-80)) {
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 <= -76000.0) or not (x <= 6.5e-80): 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 <= -76000.0) || !(x <= 6.5e-80)) 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 <= -76000.0) || ~((x <= 6.5e-80))) 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, -76000.0], N[Not[LessEqual[x, 6.5e-80]], $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 -76000 \lor \neg \left(x \leq 6.5 \cdot 10^{-80}\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\end{array}
\end{array}
if x < -76000 or 6.49999999999999984e-80 < x Initial program 86.4%
fabs-neg86.4%
sub-neg86.4%
distribute-neg-in86.4%
sub-neg86.4%
distribute-neg-frac86.4%
associate-*l/80.3%
distribute-neg-frac80.3%
neg-mul-180.3%
associate-*l/80.2%
neg-mul-180.2%
associate-*l/80.1%
distribute-lft-out--90.6%
fabs-mul90.6%
fabs-sub90.6%
fabs-mul90.6%
associate-*l/90.8%
Simplified90.8%
Taylor expanded in x around inf 88.7%
associate-/l*97.8%
associate-/r/97.0%
Simplified97.0%
if -76000 < x < 6.49999999999999984e-80Initial program 98.4%
fabs-sub98.4%
associate-*l/99.9%
*-commutative99.9%
associate-*l/93.8%
*-commutative93.8%
fma-neg93.8%
distribute-neg-frac93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
distribute-lft-in83.3%
metadata-eval83.3%
neg-mul-183.3%
sub-neg83.3%
Simplified83.3%
Final simplification90.4%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -76000.0) (not (<= x 5.9e-81))) (fabs (/ (- 1.0 z) (/ y x))) (fabs (/ (- -4.0 x) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -76000.0) || !(x <= 5.9e-81)) {
tmp = fabs(((1.0 - z) / (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 <= (-76000.0d0)) .or. (.not. (x <= 5.9d-81))) then
tmp = abs(((1.0d0 - z) / (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 <= -76000.0) || !(x <= 5.9e-81)) {
tmp = Math.abs(((1.0 - z) / (y / x)));
} else {
tmp = Math.abs(((-4.0 - x) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -76000.0) or not (x <= 5.9e-81): tmp = math.fabs(((1.0 - z) / (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 <= -76000.0) || !(x <= 5.9e-81)) tmp = abs(Float64(Float64(1.0 - z) / 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 <= -76000.0) || ~((x <= 5.9e-81))) tmp = abs(((1.0 - z) / (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, -76000.0], N[Not[LessEqual[x, 5.9e-81]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $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 -76000 \lor \neg \left(x \leq 5.9 \cdot 10^{-81}\right):\\
\;\;\;\;\left|\frac{1 - z}{\frac{y}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\end{array}
\end{array}
if x < -76000 or 5.90000000000000024e-81 < x Initial program 86.4%
fabs-neg86.4%
sub-neg86.4%
distribute-neg-in86.4%
sub-neg86.4%
distribute-neg-frac86.4%
associate-*l/80.3%
distribute-neg-frac80.3%
neg-mul-180.3%
associate-*l/80.2%
neg-mul-180.2%
associate-*l/80.1%
distribute-lft-out--90.6%
fabs-mul90.6%
fabs-sub90.6%
fabs-mul90.6%
associate-*l/90.8%
Simplified90.8%
Taylor expanded in x around inf 88.7%
associate-/l*97.8%
Simplified97.8%
if -76000 < x < 5.90000000000000024e-81Initial program 98.4%
fabs-sub98.4%
associate-*l/99.9%
*-commutative99.9%
associate-*l/93.8%
*-commutative93.8%
fma-neg93.8%
distribute-neg-frac93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around 0 83.3%
associate-*r/83.3%
distribute-lft-in83.3%
metadata-eval83.3%
neg-mul-183.3%
sub-neg83.3%
Simplified83.3%
Final simplification90.8%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -1.55) (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 <= -1.55) || !(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 <= (-1.55d0)) .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 <= -1.55) || !(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 <= -1.55) 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 <= -1.55) || !(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 <= -1.55) || ~((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, -1.55], 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 -1.55 \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 < -1.55000000000000004 or 4 < x Initial program 84.8%
fabs-neg84.8%
sub-neg84.8%
distribute-neg-in84.8%
sub-neg84.8%
distribute-neg-frac84.8%
associate-*l/78.0%
distribute-neg-frac78.0%
neg-mul-178.0%
associate-*l/77.8%
neg-mul-177.8%
associate-*l/77.8%
distribute-lft-out--89.6%
fabs-mul89.6%
fabs-sub89.6%
fabs-mul89.6%
associate-*l/89.8%
Simplified89.8%
Taylor expanded in x around inf 89.2%
associate-/l*99.3%
associate-/r/99.2%
Simplified99.2%
Taylor expanded in z around 0 60.4%
if -1.55000000000000004 < x < 4Initial program 98.6%
Taylor expanded in x around 0 76.3%
Final simplification68.9%
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 92.2%
Taylor expanded in x around 0 43.3%
Final simplification43.3%
herbie shell --seed 2023257
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))