
(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 14 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}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 8e+80) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 8e+80) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 8e+80) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 8e+80], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 8 \cdot 10^{+80}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y_m}, \frac{-4 - x}{y_m}\right)\right|\\
\end{array}
\end{array}
if y < 8e80Initial program 92.3%
Taylor expanded in y around 0 98.1%
+-commutative98.1%
Simplified98.1%
if 8e80 < y Initial program 96.3%
Simplified99.9%
Final simplification98.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* x (/ z y_m)))))
(if (<= x -1.9e+99)
t_0
(if (<= x -2.9e-24)
t_1
(if (<= x 5.3e-15) (fabs (/ 4.0 y_m)) (if (<= x 5.4e+163) t_1 t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((x * (z / y_m)));
double tmp;
if (x <= -1.9e+99) {
tmp = t_0;
} else if (x <= -2.9e-24) {
tmp = t_1;
} else if (x <= 5.3e-15) {
tmp = fabs((4.0 / y_m));
} else if (x <= 5.4e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y_m))
t_1 = abs((x * (z / y_m)))
if (x <= (-1.9d+99)) then
tmp = t_0
else if (x <= (-2.9d-24)) then
tmp = t_1
else if (x <= 5.3d-15) then
tmp = abs((4.0d0 / y_m))
else if (x <= 5.4d+163) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double t_1 = Math.abs((x * (z / y_m)));
double tmp;
if (x <= -1.9e+99) {
tmp = t_0;
} else if (x <= -2.9e-24) {
tmp = t_1;
} else if (x <= 5.3e-15) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 5.4e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((x * (z / y_m))) tmp = 0 if x <= -1.9e+99: tmp = t_0 elif x <= -2.9e-24: tmp = t_1 elif x <= 5.3e-15: tmp = math.fabs((4.0 / y_m)) elif x <= 5.4e+163: tmp = t_1 else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(x * Float64(z / y_m))) tmp = 0.0 if (x <= -1.9e+99) tmp = t_0; elseif (x <= -2.9e-24) tmp = t_1; elseif (x <= 5.3e-15) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 5.4e+163) tmp = t_1; else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); t_1 = abs((x * (z / y_m))); tmp = 0.0; if (x <= -1.9e+99) tmp = t_0; elseif (x <= -2.9e-24) tmp = t_1; elseif (x <= 5.3e-15) tmp = abs((4.0 / y_m)); elseif (x <= 5.4e+163) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.9e+99], t$95$0, If[LessEqual[x, -2.9e-24], t$95$1, If[LessEqual[x, 5.3e-15], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.4e+163], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y_m}\right|\\
t_1 := \left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{-15}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.9e99 or 5.39999999999999998e163 < x Initial program 82.7%
Simplified94.2%
Taylor expanded in x around inf 99.6%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
if -1.9e99 < x < -2.8999999999999999e-24 or 5.3000000000000001e-15 < x < 5.39999999999999998e163Initial program 97.0%
Simplified96.8%
Taylor expanded in x around inf 94.6%
Taylor expanded in z around inf 64.3%
if -2.8999999999999999e-24 < x < 5.3000000000000001e-15Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification75.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* z (/ x y_m)))))
(if (<= x -5.7e+100)
t_0
(if (<= x -1.06e-89)
t_1
(if (<= x 5e-14) (fabs (/ 4.0 y_m)) (if (<= x 6e+163) t_1 t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((z * (x / y_m)));
double tmp;
if (x <= -5.7e+100) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = t_1;
} else if (x <= 5e-14) {
tmp = fabs((4.0 / y_m));
} else if (x <= 6e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y_m))
t_1 = abs((z * (x / y_m)))
if (x <= (-5.7d+100)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = t_1
else if (x <= 5d-14) then
tmp = abs((4.0d0 / y_m))
else if (x <= 6d+163) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double t_1 = Math.abs((z * (x / y_m)));
double tmp;
if (x <= -5.7e+100) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = t_1;
} else if (x <= 5e-14) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 6e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((z * (x / y_m))) tmp = 0 if x <= -5.7e+100: tmp = t_0 elif x <= -1.06e-89: tmp = t_1 elif x <= 5e-14: tmp = math.fabs((4.0 / y_m)) elif x <= 6e+163: tmp = t_1 else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(z * Float64(x / y_m))) tmp = 0.0 if (x <= -5.7e+100) tmp = t_0; elseif (x <= -1.06e-89) tmp = t_1; elseif (x <= 5e-14) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 6e+163) tmp = t_1; else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); t_1 = abs((z * (x / y_m))); tmp = 0.0; if (x <= -5.7e+100) tmp = t_0; elseif (x <= -1.06e-89) tmp = t_1; elseif (x <= 5e-14) tmp = abs((4.0 / y_m)); elseif (x <= 6e+163) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -5.7e+100], t$95$0, If[LessEqual[x, -1.06e-89], t$95$1, If[LessEqual[x, 5e-14], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6e+163], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y_m}\right|\\
t_1 := \left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -5.7 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -5.69999999999999984e100 or 6.00000000000000027e163 < x Initial program 82.7%
Simplified94.2%
Taylor expanded in x around inf 99.6%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
if -5.69999999999999984e100 < x < -1.0600000000000001e-89 or 5.0000000000000002e-14 < x < 6.00000000000000027e163Initial program 97.4%
Simplified93.9%
Taylor expanded in x around inf 84.4%
Taylor expanded in z around inf 54.1%
associate-*l/62.2%
Simplified62.2%
if -1.0600000000000001e-89 < x < 5.0000000000000002e-14Initial program 96.5%
Taylor expanded in x around 0 84.0%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -8e+101)
t_0
(if (<= x -1.06e-89)
(fabs (* z (/ x y_m)))
(if (<= x 1e-11)
(fabs (/ 4.0 y_m))
(if (<= x 9.5e+163) (fabs (/ x (/ y_m z))) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -8e+101) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 1e-11) {
tmp = fabs((4.0 / y_m));
} else if (x <= 9.5e+163) {
tmp = fabs((x / (y_m / z)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-8d+101)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = abs((z * (x / y_m)))
else if (x <= 1d-11) then
tmp = abs((4.0d0 / y_m))
else if (x <= 9.5d+163) then
tmp = abs((x / (y_m / z)))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -8e+101) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 1e-11) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 9.5e+163) {
tmp = Math.abs((x / (y_m / z)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -8e+101: tmp = t_0 elif x <= -1.06e-89: tmp = math.fabs((z * (x / y_m))) elif x <= 1e-11: tmp = math.fabs((4.0 / y_m)) elif x <= 9.5e+163: tmp = math.fabs((x / (y_m / z))) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -8e+101) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 1e-11) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 9.5e+163) tmp = abs(Float64(x / Float64(y_m / z))); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -8e+101) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs((z * (x / y_m))); elseif (x <= 1e-11) tmp = abs((4.0 / y_m)); elseif (x <= 9.5e+163) tmp = abs((x / (y_m / z))); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -8e+101], t$95$0, If[LessEqual[x, -1.06e-89], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1e-11], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.5e+163], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -8 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq 10^{-11}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+163}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -7.9999999999999998e101 or 9.50000000000000053e163 < x Initial program 82.7%
Simplified94.2%
Taylor expanded in x around inf 99.6%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
if -7.9999999999999998e101 < x < -1.0600000000000001e-89Initial program 95.7%
Simplified89.8%
Taylor expanded in x around inf 75.8%
Taylor expanded in z around inf 58.9%
associate-*l/64.7%
Simplified64.7%
if -1.0600000000000001e-89 < x < 9.99999999999999939e-12Initial program 96.5%
Taylor expanded in x around 0 84.0%
if 9.99999999999999939e-12 < x < 9.50000000000000053e163Initial program 99.9%
Taylor expanded in z around inf 47.4%
associate-*r/47.4%
mul-1-neg47.4%
distribute-rgt-neg-in47.4%
associate-*r/58.5%
Simplified58.5%
add-sqr-sqrt31.1%
sqrt-unprod50.1%
distribute-frac-neg50.1%
distribute-frac-neg50.1%
sqr-neg50.1%
sqrt-unprod27.7%
add-sqr-sqrt58.5%
associate-*r/47.4%
associate-/l*58.7%
Applied egg-rr58.7%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -3.9e+102)
t_0
(if (<= x -1.06e-89)
(fabs (/ z (/ y_m x)))
(if (<= x 1.35e-12)
(fabs (/ 4.0 y_m))
(if (<= x 6.5e+163) (fabs (/ x (/ y_m z))) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -3.9e+102) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = fabs((z / (y_m / x)));
} else if (x <= 1.35e-12) {
tmp = fabs((4.0 / y_m));
} else if (x <= 6.5e+163) {
tmp = fabs((x / (y_m / z)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-3.9d+102)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = abs((z / (y_m / x)))
else if (x <= 1.35d-12) then
tmp = abs((4.0d0 / y_m))
else if (x <= 6.5d+163) then
tmp = abs((x / (y_m / z)))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -3.9e+102) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= 1.35e-12) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 6.5e+163) {
tmp = Math.abs((x / (y_m / z)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -3.9e+102: tmp = t_0 elif x <= -1.06e-89: tmp = math.fabs((z / (y_m / x))) elif x <= 1.35e-12: tmp = math.fabs((4.0 / y_m)) elif x <= 6.5e+163: tmp = math.fabs((x / (y_m / z))) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -3.9e+102) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= 1.35e-12) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 6.5e+163) tmp = abs(Float64(x / Float64(y_m / z))); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -3.9e+102) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs((z / (y_m / x))); elseif (x <= 1.35e-12) tmp = abs((4.0 / y_m)); elseif (x <= 6.5e+163) tmp = abs((x / (y_m / z))); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3.9e+102], t$95$0, If[LessEqual[x, -1.06e-89], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.35e-12], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6.5e+163], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{+102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-12}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+163}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.8999999999999998e102 or 6.4999999999999998e163 < x Initial program 82.7%
Simplified94.2%
Taylor expanded in x around inf 99.6%
Taylor expanded in z around 0 78.4%
associate-*r/78.4%
neg-mul-178.4%
Simplified78.4%
if -3.8999999999999998e102 < x < -1.0600000000000001e-89Initial program 95.7%
Taylor expanded in z around inf 58.9%
associate-*r/58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
associate-*r/58.9%
Simplified58.9%
add-sqr-sqrt32.4%
sqrt-unprod43.1%
distribute-frac-neg43.1%
distribute-frac-neg43.1%
sqr-neg43.1%
sqrt-unprod27.0%
add-sqr-sqrt58.9%
associate-*r/58.9%
*-commutative58.9%
associate-/l*64.7%
Applied egg-rr64.7%
if -1.0600000000000001e-89 < x < 1.3499999999999999e-12Initial program 96.5%
Taylor expanded in x around 0 84.0%
if 1.3499999999999999e-12 < x < 6.4999999999999998e163Initial program 99.9%
Taylor expanded in z around inf 47.4%
associate-*r/47.4%
mul-1-neg47.4%
distribute-rgt-neg-in47.4%
associate-*r/58.5%
Simplified58.5%
add-sqr-sqrt31.1%
sqrt-unprod50.1%
distribute-frac-neg50.1%
distribute-frac-neg50.1%
sqr-neg50.1%
sqrt-unprod27.7%
add-sqr-sqrt58.5%
associate-*r/47.4%
associate-/l*58.7%
Applied egg-rr58.7%
Final simplification75.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 9.5e+144) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 9.5e+144) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (z * (x / y_m))));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 9.5d+144) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (z * (x / y_m))))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 9.5e+144) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (z * (x / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 9.5e+144: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (z * (x / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 9.5e+144) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 9.5e+144) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (z * (x / y_m)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 9.5e+144], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 9.5 \cdot 10^{+144}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y_m} - z \cdot \frac{x}{y_m}\right|\\
\end{array}
\end{array}
if y < 9.50000000000000031e144Initial program 92.3%
Taylor expanded in y around 0 98.2%
+-commutative98.2%
Simplified98.2%
if 9.50000000000000031e144 < y Initial program 97.4%
Final simplification98.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 4e+81) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (* x (/ z y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 4e+81) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x * (z / y_m))));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 4d+81) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (x * (z / y_m))))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 4e+81) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x * (z / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 4e+81: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (x * (z / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 4e+81) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x * Float64(z / y_m)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 4e+81) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (x * (z / y_m)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 4e+81], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 4 \cdot 10^{+81}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y_m} - x \cdot \frac{z}{y_m}\right|\\
\end{array}
\end{array}
if y < 3.99999999999999969e81Initial program 92.3%
Taylor expanded in y around 0 98.1%
+-commutative98.1%
Simplified98.1%
if 3.99999999999999969e81 < y Initial program 96.3%
Simplified99.8%
div-inv99.8%
clear-num99.8%
*-commutative99.8%
Applied egg-rr99.8%
Final simplification98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1e+47) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ x (/ y_m z)) (/ (+ x 4.0) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1e+47) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(((x / (y_m / z)) - ((x + 4.0) / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 1d+47) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs(((x / (y_m / z)) - ((x + 4.0d0) / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1e+47) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs(((x / (y_m / z)) - ((x + 4.0) / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 1e+47: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs(((x / (y_m / z)) - ((x + 4.0) / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1e+47) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(x / Float64(y_m / z)) - Float64(Float64(x + 4.0) / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 1e+47) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs(((x / (y_m / z)) - ((x + 4.0) / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1e+47], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 10^{+47}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}} - \frac{x + 4}{y_m}\right|\\
\end{array}
\end{array}
if y < 1e47Initial program 92.1%
Taylor expanded in y around 0 98.0%
+-commutative98.0%
Simplified98.0%
if 1e47 < y Initial program 96.6%
Simplified99.8%
Final simplification98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -3.15e-24) (not (<= x 1.6e-14))) (fabs (* x (/ (+ z -1.0) y_m))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -3.15e-24) || !(x <= 1.6e-14)) {
tmp = fabs((x * ((z + -1.0) / y_m)));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-3.15d-24)) .or. (.not. (x <= 1.6d-14))) then
tmp = abs((x * ((z + (-1.0d0)) / y_m)))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -3.15e-24) || !(x <= 1.6e-14)) {
tmp = Math.abs((x * ((z + -1.0) / y_m)));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -3.15e-24) or not (x <= 1.6e-14): tmp = math.fabs((x * ((z + -1.0) / y_m))) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -3.15e-24) || !(x <= 1.6e-14)) tmp = abs(Float64(x * Float64(Float64(z + -1.0) / y_m))); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -3.15e-24) || ~((x <= 1.6e-14))) tmp = abs((x * ((z + -1.0) / y_m))); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -3.15e-24], N[Not[LessEqual[x, 1.6e-14]], $MachinePrecision]], N[Abs[N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.15 \cdot 10^{-24} \lor \neg \left(x \leq 1.6 \cdot 10^{-14}\right):\\
\;\;\;\;\left|x \cdot \frac{z + -1}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -3.1499999999999999e-24 or 1.6000000000000001e-14 < x Initial program 89.8%
Simplified95.5%
Taylor expanded in x around inf 97.1%
Taylor expanded in y around 0 97.1%
if -3.1499999999999999e-24 < x < 1.6000000000000001e-14Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification89.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.2e-24) (not (<= x 4.2e-16))) (fabs (/ x (/ y_m (- 1.0 z)))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.2e-24) || !(x <= 4.2e-16)) {
tmp = fabs((x / (y_m / (1.0 - z))));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.2d-24)) .or. (.not. (x <= 4.2d-16))) then
tmp = abs((x / (y_m / (1.0d0 - z))))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.2e-24) || !(x <= 4.2e-16)) {
tmp = Math.abs((x / (y_m / (1.0 - z))));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.2e-24) or not (x <= 4.2e-16): tmp = math.fabs((x / (y_m / (1.0 - z)))) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.2e-24) || !(x <= 4.2e-16)) tmp = abs(Float64(x / Float64(y_m / Float64(1.0 - z)))); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.2e-24) || ~((x <= 4.2e-16))) tmp = abs((x / (y_m / (1.0 - z)))); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.2e-24], N[Not[LessEqual[x, 4.2e-16]], $MachinePrecision]], N[Abs[N[(x / N[(y$95$m / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-24} \lor \neg \left(x \leq 4.2 \cdot 10^{-16}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{1 - z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -1.1999999999999999e-24 or 4.2000000000000002e-16 < x Initial program 89.8%
Taylor expanded in y around 0 94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in x around inf 91.9%
associate-/l*97.4%
Simplified97.4%
if -1.1999999999999999e-24 < x < 4.2000000000000002e-16Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification89.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -1.1e+17) (fabs (* z (/ x y_m))) (if (<= z 1.8e+33) (fabs (/ (- -4.0 x) y_m)) (fabs (/ z (/ y_m x))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.1e+17) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1.8e+33) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((z / (y_m / x)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.1d+17)) then
tmp = abs((z * (x / y_m)))
else if (z <= 1.8d+33) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((z / (y_m / x)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.1e+17) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1.8e+33) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.1e+17: tmp = math.fabs((z * (x / y_m))) elif z <= 1.8e+33: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.1e+17) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1.8e+33) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(z / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -1.1e+17) tmp = abs((z * (x / y_m))); elseif (z <= 1.8e+33) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.1e+17], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.8e+33], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+17}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+33}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if z < -1.1e17Initial program 98.2%
Simplified94.6%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around inf 73.8%
associate-*l/80.9%
Simplified80.9%
if -1.1e17 < z < 1.8000000000000001e33Initial program 95.9%
Simplified100.0%
Taylor expanded in z around 0 94.6%
+-commutative94.6%
associate-*r/94.6%
+-commutative94.6%
distribute-lft-in94.6%
metadata-eval94.6%
neg-mul-194.6%
sub-neg94.6%
Simplified94.6%
if 1.8000000000000001e33 < z Initial program 80.3%
Taylor expanded in z around inf 71.1%
associate-*r/71.1%
mul-1-neg71.1%
distribute-rgt-neg-in71.1%
associate-*r/71.3%
Simplified71.3%
add-sqr-sqrt44.0%
sqrt-unprod57.6%
distribute-frac-neg57.6%
distribute-frac-neg57.6%
sqr-neg57.6%
sqrt-unprod27.1%
add-sqr-sqrt71.3%
associate-*r/71.1%
*-commutative71.1%
associate-/l*72.5%
Applied egg-rr72.5%
Final simplification87.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((((x + 4.0) - (x * z)) / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((((x + 4.0d0) - (x * z)) / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((((x + 4.0) - (x * z)) / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((((x + 4.0) - (x * z)) / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((((x + 4.0) - (x * z)) / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|
\end{array}
Initial program 93.0%
Taylor expanded in y around 0 96.9%
+-commutative96.9%
Simplified96.9%
Final simplification96.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.5) (not (<= x 4.0))) (fabs (/ x y_m)) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.5) || !(x <= 4.0)) {
tmp = fabs((x / y_m));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.5d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y_m))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.5) || !(x <= 4.0)) {
tmp = Math.abs((x / y_m));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.5) or not (x <= 4.0): tmp = math.fabs((x / y_m)) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.5) || !(x <= 4.0)) tmp = abs(Float64(x / y_m)); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.5) || ~((x <= 4.0))) tmp = abs((x / y_m)); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.5], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -1.5 or 4 < x Initial program 89.2%
Simplified95.2%
Taylor expanded in x around inf 99.0%
Taylor expanded in z around 0 63.2%
associate-*r/63.2%
neg-mul-163.2%
Simplified63.2%
if -1.5 < x < 4Initial program 97.0%
Taylor expanded in x around 0 76.6%
Final simplification69.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y_m}\right|
\end{array}
Initial program 93.0%
Taylor expanded in x around 0 40.0%
Final simplification40.0%
herbie shell --seed 2023336
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))