
(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 1.35e-83) (fabs (/ 1.0 (/ y_m (+ x (- 4.0 (* x z)))))) (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 <= 1.35e-83) {
tmp = fabs((1.0 / (y_m / (x + (4.0 - (x * z))))));
} 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 <= 1.35e-83) tmp = abs(Float64(1.0 / Float64(y_m / Float64(x + Float64(4.0 - Float64(x * z)))))); 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, 1.35e-83], N[Abs[N[(1.0 / N[(y$95$m / N[(x + N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 1.35 \cdot 10^{-83}:\\
\;\;\;\;\left|\frac{1}{\frac{y_m}{x + \left(4 - x \cdot z\right)}}\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 < 1.34999999999999996e-83Initial program 89.5%
associate-*l/93.2%
sub-div98.8%
clear-num98.7%
associate--l+98.7%
Applied egg-rr98.7%
if 1.34999999999999996e-83 < y Initial program 97.9%
Simplified99.9%
Final simplification99.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))))
(if (<= t_0 5e-67)
(fabs (/ (- (+ x 4.0) (* x z)) y_m))
(if (<= t_0 5e+294) t_0 (fabs (/ (+ z -1.0) (/ y_m x)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((((x + 4.0) / y_m) - (z * (x / y_m))));
double tmp;
if (t_0 <= 5e-67) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else if (t_0 <= 5e+294) {
tmp = t_0;
} else {
tmp = fabs(((z + -1.0) / (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) :: t_0
real(8) :: tmp
t_0 = abs((((x + 4.0d0) / y_m) - (z * (x / y_m))))
if (t_0 <= 5d-67) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else if (t_0 <= 5d+294) then
tmp = t_0
else
tmp = abs(((z + (-1.0d0)) / (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 t_0 = Math.abs((((x + 4.0) / y_m) - (z * (x / y_m))));
double tmp;
if (t_0 <= 5e-67) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else if (t_0 <= 5e+294) {
tmp = t_0;
} else {
tmp = Math.abs(((z + -1.0) / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((((x + 4.0) / y_m) - (z * (x / y_m)))) tmp = 0 if t_0 <= 5e-67: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) elif t_0 <= 5e+294: tmp = t_0 else: tmp = math.fabs(((z + -1.0) / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m)))) tmp = 0.0 if (t_0 <= 5e-67) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); elseif (t_0 <= 5e+294) tmp = t_0; else tmp = abs(Float64(Float64(z + -1.0) / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((((x + 4.0) / y_m) - (z * (x / y_m)))); tmp = 0.0; if (t_0 <= 5e-67) tmp = abs((((x + 4.0) - (x * z)) / y_m)); elseif (t_0 <= 5e+294) tmp = t_0; else tmp = abs(((z + -1.0) / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 5e-67], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+294], t$95$0, N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x + 4}{y_m} - z \cdot \frac{x}{y_m}\right|\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-67}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+294}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 4.9999999999999999e-67Initial program 89.8%
Taylor expanded in y around 0 100.0%
if 4.9999999999999999e-67 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) < 4.9999999999999999e294Initial program 99.9%
if 4.9999999999999999e294 < (fabs.f64 (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z))) Initial program 76.8%
Simplified87.6%
Taylor expanded in x around inf 98.4%
Taylor expanded in y around 0 98.4%
sub-neg98.4%
metadata-eval98.4%
*-commutative98.4%
associate-/l*100.0%
Simplified100.0%
Final simplification99.9%
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 -1.1e+107)
t_0
(if (<= x -2.6e-70)
t_1
(if (<= x 2.3e-111)
(fabs (/ 4.0 y_m))
(if (<= x 3.3e+31)
(fabs (* x (/ z y_m)))
(if (or (<= x 7.4e+73) (and (not (<= x 2.9e+149)) (<= x 4.1e+232)))
t_0
t_1)))))))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 <= -1.1e+107) {
tmp = t_0;
} else if (x <= -2.6e-70) {
tmp = t_1;
} else if (x <= 2.3e-111) {
tmp = fabs((4.0 / y_m));
} else if (x <= 3.3e+31) {
tmp = fabs((x * (z / y_m)));
} else if ((x <= 7.4e+73) || (!(x <= 2.9e+149) && (x <= 4.1e+232))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= (-1.1d+107)) then
tmp = t_0
else if (x <= (-2.6d-70)) then
tmp = t_1
else if (x <= 2.3d-111) then
tmp = abs((4.0d0 / y_m))
else if (x <= 3.3d+31) then
tmp = abs((x * (z / y_m)))
else if ((x <= 7.4d+73) .or. (.not. (x <= 2.9d+149)) .and. (x <= 4.1d+232)) then
tmp = t_0
else
tmp = t_1
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 <= -1.1e+107) {
tmp = t_0;
} else if (x <= -2.6e-70) {
tmp = t_1;
} else if (x <= 2.3e-111) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 3.3e+31) {
tmp = Math.abs((x * (z / y_m)));
} else if ((x <= 7.4e+73) || (!(x <= 2.9e+149) && (x <= 4.1e+232))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= -1.1e+107: tmp = t_0 elif x <= -2.6e-70: tmp = t_1 elif x <= 2.3e-111: tmp = math.fabs((4.0 / y_m)) elif x <= 3.3e+31: tmp = math.fabs((x * (z / y_m))) elif (x <= 7.4e+73) or (not (x <= 2.9e+149) and (x <= 4.1e+232)): tmp = t_0 else: tmp = t_1 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 <= -1.1e+107) tmp = t_0; elseif (x <= -2.6e-70) tmp = t_1; elseif (x <= 2.3e-111) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 3.3e+31) tmp = abs(Float64(x * Float64(z / y_m))); elseif ((x <= 7.4e+73) || (!(x <= 2.9e+149) && (x <= 4.1e+232))) tmp = t_0; else tmp = t_1; 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 <= -1.1e+107) tmp = t_0; elseif (x <= -2.6e-70) tmp = t_1; elseif (x <= 2.3e-111) tmp = abs((4.0 / y_m)); elseif (x <= 3.3e+31) tmp = abs((x * (z / y_m))); elseif ((x <= 7.4e+73) || (~((x <= 2.9e+149)) && (x <= 4.1e+232))) tmp = t_0; else tmp = t_1; 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, -1.1e+107], t$95$0, If[LessEqual[x, -2.6e-70], t$95$1, If[LessEqual[x, 2.3e-111], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.3e+31], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 7.4e+73], And[N[Not[LessEqual[x, 2.9e+149]], $MachinePrecision], LessEqual[x, 4.1e+232]]], t$95$0, t$95$1]]]]]]]
\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 -1.1 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-111}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+31}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+73} \lor \neg \left(x \leq 2.9 \cdot 10^{+149}\right) \land x \leq 4.1 \cdot 10^{+232}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.1e107 or 3.29999999999999992e31 < x < 7.39999999999999947e73 or 2.9000000000000002e149 < x < 4.10000000000000002e232Initial program 88.6%
associate-*l/87.7%
sub-div94.0%
clear-num93.8%
associate--l+93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around inf 74.4%
if -1.1e107 < x < -2.60000000000000002e-70 or 7.39999999999999947e73 < x < 2.9000000000000002e149 or 4.10000000000000002e232 < x Initial program 91.8%
Simplified91.7%
Taylor expanded in x around inf 90.6%
Taylor expanded in z around inf 62.4%
*-commutative62.4%
associate-*r/77.3%
Simplified77.3%
if -2.60000000000000002e-70 < x < 2.3e-111Initial program 95.2%
Taylor expanded in x around 0 84.7%
if 2.3e-111 < x < 3.29999999999999992e31Initial program 96.5%
Simplified96.9%
Taylor expanded in x around inf 59.7%
Taylor expanded in z around inf 57.8%
associate-*r/54.8%
Simplified54.8%
Final simplification76.6%
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 -8.5e+107)
t_0
(if (<= x -4.2e-71)
t_1
(if (<= x 9.6e-110)
(fabs (/ 4.0 y_m))
(if (<= x 7.9e+31)
(fabs (/ x (/ y_m z)))
(if (or (<= x 6.5e+73) (and (not (<= x 9.5e+148)) (<= x 1.85e+232)))
t_0
t_1)))))))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 <= -8.5e+107) {
tmp = t_0;
} else if (x <= -4.2e-71) {
tmp = t_1;
} else if (x <= 9.6e-110) {
tmp = fabs((4.0 / y_m));
} else if (x <= 7.9e+31) {
tmp = fabs((x / (y_m / z)));
} else if ((x <= 6.5e+73) || (!(x <= 9.5e+148) && (x <= 1.85e+232))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= (-8.5d+107)) then
tmp = t_0
else if (x <= (-4.2d-71)) then
tmp = t_1
else if (x <= 9.6d-110) then
tmp = abs((4.0d0 / y_m))
else if (x <= 7.9d+31) then
tmp = abs((x / (y_m / z)))
else if ((x <= 6.5d+73) .or. (.not. (x <= 9.5d+148)) .and. (x <= 1.85d+232)) then
tmp = t_0
else
tmp = t_1
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 <= -8.5e+107) {
tmp = t_0;
} else if (x <= -4.2e-71) {
tmp = t_1;
} else if (x <= 9.6e-110) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 7.9e+31) {
tmp = Math.abs((x / (y_m / z)));
} else if ((x <= 6.5e+73) || (!(x <= 9.5e+148) && (x <= 1.85e+232))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= -8.5e+107: tmp = t_0 elif x <= -4.2e-71: tmp = t_1 elif x <= 9.6e-110: tmp = math.fabs((4.0 / y_m)) elif x <= 7.9e+31: tmp = math.fabs((x / (y_m / z))) elif (x <= 6.5e+73) or (not (x <= 9.5e+148) and (x <= 1.85e+232)): tmp = t_0 else: tmp = t_1 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 <= -8.5e+107) tmp = t_0; elseif (x <= -4.2e-71) tmp = t_1; elseif (x <= 9.6e-110) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 7.9e+31) tmp = abs(Float64(x / Float64(y_m / z))); elseif ((x <= 6.5e+73) || (!(x <= 9.5e+148) && (x <= 1.85e+232))) tmp = t_0; else tmp = t_1; 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 <= -8.5e+107) tmp = t_0; elseif (x <= -4.2e-71) tmp = t_1; elseif (x <= 9.6e-110) tmp = abs((4.0 / y_m)); elseif (x <= 7.9e+31) tmp = abs((x / (y_m / z))); elseif ((x <= 6.5e+73) || (~((x <= 9.5e+148)) && (x <= 1.85e+232))) tmp = t_0; else tmp = t_1; 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, -8.5e+107], t$95$0, If[LessEqual[x, -4.2e-71], t$95$1, If[LessEqual[x, 9.6e-110], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 7.9e+31], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 6.5e+73], And[N[Not[LessEqual[x, 9.5e+148]], $MachinePrecision], LessEqual[x, 1.85e+232]]], t$95$0, t$95$1]]]]]]]
\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 -8.5 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.2 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-110}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 7.9 \cdot 10^{+31}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+73} \lor \neg \left(x \leq 9.5 \cdot 10^{+148}\right) \land x \leq 1.85 \cdot 10^{+232}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.4999999999999999e107 or 7.9000000000000003e31 < x < 6.5000000000000001e73 or 9.5000000000000002e148 < x < 1.84999999999999986e232Initial program 88.6%
associate-*l/87.7%
sub-div94.0%
clear-num93.8%
associate--l+93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around inf 74.4%
if -8.4999999999999999e107 < x < -4.2000000000000002e-71 or 6.5000000000000001e73 < x < 9.5000000000000002e148 or 1.84999999999999986e232 < x Initial program 91.8%
Simplified91.7%
Taylor expanded in x around inf 90.6%
Taylor expanded in z around inf 62.4%
*-commutative62.4%
associate-*r/77.3%
Simplified77.3%
if -4.2000000000000002e-71 < x < 9.60000000000000026e-110Initial program 95.2%
Taylor expanded in x around 0 84.7%
if 9.60000000000000026e-110 < x < 7.9000000000000003e31Initial program 96.5%
Taylor expanded in z around inf 57.8%
mul-1-neg57.8%
associate-*l/54.5%
distribute-rgt-neg-out54.5%
Simplified54.5%
add-sqr-sqrt25.3%
sqrt-unprod25.7%
sqr-neg25.7%
sqrt-unprod28.9%
add-sqr-sqrt54.5%
associate-/r/54.9%
Applied egg-rr54.9%
Final simplification76.6%
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 -3.6e+107)
t_0
(if (<= x -2.25e-70)
t_1
(if (<= x 9.2e-110)
(fabs (/ 4.0 y_m))
(if (<= x 2.1e+35)
(fabs (/ (* x z) y_m))
(if (or (<= x 3.4e+73) (and (not (<= x 2.6e+147)) (<= x 9.5e+231)))
t_0
t_1)))))))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 <= -3.6e+107) {
tmp = t_0;
} else if (x <= -2.25e-70) {
tmp = t_1;
} else if (x <= 9.2e-110) {
tmp = fabs((4.0 / y_m));
} else if (x <= 2.1e+35) {
tmp = fabs(((x * z) / y_m));
} else if ((x <= 3.4e+73) || (!(x <= 2.6e+147) && (x <= 9.5e+231))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= (-3.6d+107)) then
tmp = t_0
else if (x <= (-2.25d-70)) then
tmp = t_1
else if (x <= 9.2d-110) then
tmp = abs((4.0d0 / y_m))
else if (x <= 2.1d+35) then
tmp = abs(((x * z) / y_m))
else if ((x <= 3.4d+73) .or. (.not. (x <= 2.6d+147)) .and. (x <= 9.5d+231)) then
tmp = t_0
else
tmp = t_1
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 <= -3.6e+107) {
tmp = t_0;
} else if (x <= -2.25e-70) {
tmp = t_1;
} else if (x <= 9.2e-110) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 2.1e+35) {
tmp = Math.abs(((x * z) / y_m));
} else if ((x <= 3.4e+73) || (!(x <= 2.6e+147) && (x <= 9.5e+231))) {
tmp = t_0;
} else {
tmp = t_1;
}
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 <= -3.6e+107: tmp = t_0 elif x <= -2.25e-70: tmp = t_1 elif x <= 9.2e-110: tmp = math.fabs((4.0 / y_m)) elif x <= 2.1e+35: tmp = math.fabs(((x * z) / y_m)) elif (x <= 3.4e+73) or (not (x <= 2.6e+147) and (x <= 9.5e+231)): tmp = t_0 else: tmp = t_1 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 <= -3.6e+107) tmp = t_0; elseif (x <= -2.25e-70) tmp = t_1; elseif (x <= 9.2e-110) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 2.1e+35) tmp = abs(Float64(Float64(x * z) / y_m)); elseif ((x <= 3.4e+73) || (!(x <= 2.6e+147) && (x <= 9.5e+231))) tmp = t_0; else tmp = t_1; 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 <= -3.6e+107) tmp = t_0; elseif (x <= -2.25e-70) tmp = t_1; elseif (x <= 9.2e-110) tmp = abs((4.0 / y_m)); elseif (x <= 2.1e+35) tmp = abs(((x * z) / y_m)); elseif ((x <= 3.4e+73) || (~((x <= 2.6e+147)) && (x <= 9.5e+231))) tmp = t_0; else tmp = t_1; 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, -3.6e+107], t$95$0, If[LessEqual[x, -2.25e-70], t$95$1, If[LessEqual[x, 9.2e-110], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.1e+35], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 3.4e+73], And[N[Not[LessEqual[x, 2.6e+147]], $MachinePrecision], LessEqual[x, 9.5e+231]]], t$95$0, t$95$1]]]]]]]
\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 -3.6 \cdot 10^{+107}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.25 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-110}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+35}:\\
\;\;\;\;\left|\frac{x \cdot z}{y_m}\right|\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+73} \lor \neg \left(x \leq 2.6 \cdot 10^{+147}\right) \land x \leq 9.5 \cdot 10^{+231}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -3.5999999999999998e107 or 2.0999999999999999e35 < x < 3.4000000000000002e73 or 2.5999999999999999e147 < x < 9.5000000000000002e231Initial program 88.6%
associate-*l/87.7%
sub-div94.0%
clear-num93.8%
associate--l+93.8%
Applied egg-rr93.8%
Taylor expanded in z around 0 74.2%
Taylor expanded in x around inf 74.4%
if -3.5999999999999998e107 < x < -2.25000000000000011e-70 or 3.4000000000000002e73 < x < 2.5999999999999999e147 or 9.5000000000000002e231 < x Initial program 91.8%
Simplified91.7%
Taylor expanded in x around inf 90.6%
Taylor expanded in z around inf 62.4%
*-commutative62.4%
associate-*r/77.3%
Simplified77.3%
if -2.25000000000000011e-70 < x < 9.2000000000000006e-110Initial program 95.2%
Taylor expanded in x around 0 84.7%
if 9.2000000000000006e-110 < x < 2.0999999999999999e35Initial program 96.5%
Simplified96.9%
Taylor expanded in x around inf 59.7%
Taylor expanded in z around inf 57.8%
Final simplification76.9%
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.8e+110)
t_0
(if (<= x -1.1e-76)
t_1
(if (<= x 9.2e-110)
(fabs (/ 4.0 y_m))
(if (or (<= x 8.4e+34) (and (not (<= x 5.2e+73)) (<= x 1.95e+145)))
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.8e+110) {
tmp = t_0;
} else if (x <= -1.1e-76) {
tmp = t_1;
} else if (x <= 9.2e-110) {
tmp = fabs((4.0 / y_m));
} else if ((x <= 8.4e+34) || (!(x <= 5.2e+73) && (x <= 1.95e+145))) {
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.8d+110)) then
tmp = t_0
else if (x <= (-1.1d-76)) then
tmp = t_1
else if (x <= 9.2d-110) then
tmp = abs((4.0d0 / y_m))
else if ((x <= 8.4d+34) .or. (.not. (x <= 5.2d+73)) .and. (x <= 1.95d+145)) 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.8e+110) {
tmp = t_0;
} else if (x <= -1.1e-76) {
tmp = t_1;
} else if (x <= 9.2e-110) {
tmp = Math.abs((4.0 / y_m));
} else if ((x <= 8.4e+34) || (!(x <= 5.2e+73) && (x <= 1.95e+145))) {
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.8e+110: tmp = t_0 elif x <= -1.1e-76: tmp = t_1 elif x <= 9.2e-110: tmp = math.fabs((4.0 / y_m)) elif (x <= 8.4e+34) or (not (x <= 5.2e+73) and (x <= 1.95e+145)): 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.8e+110) tmp = t_0; elseif (x <= -1.1e-76) tmp = t_1; elseif (x <= 9.2e-110) tmp = abs(Float64(4.0 / y_m)); elseif ((x <= 8.4e+34) || (!(x <= 5.2e+73) && (x <= 1.95e+145))) 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.8e+110) tmp = t_0; elseif (x <= -1.1e-76) tmp = t_1; elseif (x <= 9.2e-110) tmp = abs((4.0 / y_m)); elseif ((x <= 8.4e+34) || (~((x <= 5.2e+73)) && (x <= 1.95e+145))) 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.8e+110], t$95$0, If[LessEqual[x, -1.1e-76], t$95$1, If[LessEqual[x, 9.2e-110], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 8.4e+34], And[N[Not[LessEqual[x, 5.2e+73]], $MachinePrecision], LessEqual[x, 1.95e+145]]], 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.8 \cdot 10^{+110}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-110}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 8.4 \cdot 10^{+34} \lor \neg \left(x \leq 5.2 \cdot 10^{+73}\right) \land x \leq 1.95 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.7999999999999998e110 or 8.4000000000000007e34 < x < 5.2000000000000001e73 or 1.9499999999999999e145 < x Initial program 88.6%
associate-*l/83.6%
sub-div90.4%
clear-num90.2%
associate--l+90.2%
Applied egg-rr90.2%
Taylor expanded in z around 0 72.6%
Taylor expanded in x around inf 72.7%
if -1.7999999999999998e110 < x < -1.1e-76 or 9.2000000000000006e-110 < x < 8.4000000000000007e34 or 5.2000000000000001e73 < x < 1.9499999999999999e145Initial program 94.2%
Simplified94.3%
Taylor expanded in x around inf 76.4%
Taylor expanded in z around inf 64.9%
associate-*r/64.9%
Simplified64.9%
if -1.1e-76 < x < 9.2000000000000006e-110Initial program 95.2%
Taylor expanded in x around 0 84.7%
Final simplification75.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -8.8e+210)
(fabs (* x (+ (/ z y_m) (/ -1.0 y_m))))
(if (<= x 6.2e+125)
(fabs (/ (- (+ x 4.0) (* x z)) y_m))
(fabs (/ (+ z -1.0) (/ y_m x))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.8e+210) {
tmp = fabs((x * ((z / y_m) + (-1.0 / y_m))));
} else if (x <= 6.2e+125) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(((z + -1.0) / (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 (x <= (-8.8d+210)) then
tmp = abs((x * ((z / y_m) + ((-1.0d0) / y_m))))
else if (x <= 6.2d+125) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs(((z + (-1.0d0)) / (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 (x <= -8.8e+210) {
tmp = Math.abs((x * ((z / y_m) + (-1.0 / y_m))));
} else if (x <= 6.2e+125) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs(((z + -1.0) / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -8.8e+210: tmp = math.fabs((x * ((z / y_m) + (-1.0 / y_m)))) elif x <= 6.2e+125: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs(((z + -1.0) / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -8.8e+210) tmp = abs(Float64(x * Float64(Float64(z / y_m) + Float64(-1.0 / y_m)))); elseif (x <= 6.2e+125) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(z + -1.0) / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -8.8e+210) tmp = abs((x * ((z / y_m) + (-1.0 / y_m)))); elseif (x <= 6.2e+125) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs(((z + -1.0) / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -8.8e+210], N[Abs[N[(x * N[(N[(z / y$95$m), $MachinePrecision] + N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6.2e+125], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+210}:\\
\;\;\;\;\left|x \cdot \left(\frac{z}{y_m} + \frac{-1}{y_m}\right)\right|\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+125}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if x < -8.79999999999999948e210Initial program 89.3%
Simplified94.7%
Taylor expanded in x around inf 99.9%
if -8.79999999999999948e210 < x < 6.2e125Initial program 94.1%
Taylor expanded in y around 0 99.9%
if 6.2e125 < x Initial program 86.4%
Simplified94.4%
Taylor expanded in x around inf 99.6%
Taylor expanded in y around 0 87.4%
sub-neg87.4%
metadata-eval87.4%
*-commutative87.4%
associate-/l*99.8%
Simplified99.8%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 5e-75) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-75) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
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 <= 5d-75) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (x / (y_m / z))))
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 <= 5e-75) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 5e-75: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 5e-75) 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(y_m / z)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 5e-75) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 5e-75], 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[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 5 \cdot 10^{-75}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y_m} - \frac{x}{\frac{y_m}{z}}\right|\\
\end{array}
\end{array}
if y < 4.99999999999999979e-75Initial program 89.6%
Taylor expanded in y around 0 98.8%
if 4.99999999999999979e-75 < y Initial program 97.9%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 8e-75) (fabs (/ 1.0 (/ y_m (+ x (- 4.0 (* x z)))))) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 8e-75) {
tmp = fabs((1.0 / (y_m / (x + (4.0 - (x * z))))));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
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 <= 8d-75) then
tmp = abs((1.0d0 / (y_m / (x + (4.0d0 - (x * z))))))
else
tmp = abs((((x + 4.0d0) / y_m) - (x / (y_m / z))))
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 <= 8e-75) {
tmp = Math.abs((1.0 / (y_m / (x + (4.0 - (x * z))))));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 8e-75: tmp = math.fabs((1.0 / (y_m / (x + (4.0 - (x * z)))))) else: tmp = math.fabs((((x + 4.0) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 8e-75) tmp = abs(Float64(1.0 / Float64(y_m / Float64(x + Float64(4.0 - Float64(x * z)))))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x / Float64(y_m / z)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 8e-75) tmp = abs((1.0 / (y_m / (x + (4.0 - (x * z)))))); else tmp = abs((((x + 4.0) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 8e-75], N[Abs[N[(1.0 / N[(y$95$m / N[(x + N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 8 \cdot 10^{-75}:\\
\;\;\;\;\left|\frac{1}{\frac{y_m}{x + \left(4 - x \cdot z\right)}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y_m} - \frac{x}{\frac{y_m}{z}}\right|\\
\end{array}
\end{array}
if y < 7.9999999999999997e-75Initial program 89.6%
associate-*l/93.3%
sub-div98.8%
clear-num98.7%
associate--l+98.7%
Applied egg-rr98.7%
if 7.9999999999999997e-75 < y Initial program 97.9%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -6.5e-72) (not (<= x 9.6e-110))) (fabs (/ (+ z -1.0) (/ y_m x))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -6.5e-72) || !(x <= 9.6e-110)) {
tmp = fabs(((z + -1.0) / (y_m / x)));
} else {
tmp = fabs(((-4.0 - 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 ((x <= (-6.5d-72)) .or. (.not. (x <= 9.6d-110))) then
tmp = abs(((z + (-1.0d0)) / (y_m / x)))
else
tmp = abs((((-4.0d0) - 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 ((x <= -6.5e-72) || !(x <= 9.6e-110)) {
tmp = Math.abs(((z + -1.0) / (y_m / x)));
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -6.5e-72) or not (x <= 9.6e-110): tmp = math.fabs(((z + -1.0) / (y_m / x))) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -6.5e-72) || !(x <= 9.6e-110)) tmp = abs(Float64(Float64(z + -1.0) / Float64(y_m / x))); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -6.5e-72) || ~((x <= 9.6e-110))) tmp = abs(((z + -1.0) / (y_m / x))); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -6.5e-72], N[Not[LessEqual[x, 9.6e-110]], $MachinePrecision]], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-72} \lor \neg \left(x \leq 9.6 \cdot 10^{-110}\right):\\
\;\;\;\;\left|\frac{z + -1}{\frac{y_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\end{array}
\end{array}
if x < -6.4999999999999997e-72 or 9.60000000000000026e-110 < x Initial program 91.1%
Simplified95.5%
Taylor expanded in x around inf 89.3%
Taylor expanded in y around 0 84.1%
sub-neg84.1%
metadata-eval84.1%
*-commutative84.1%
associate-/l*89.3%
Simplified89.3%
if -6.4999999999999997e-72 < x < 9.60000000000000026e-110Initial program 95.2%
Simplified93.2%
Taylor expanded in z around 0 84.7%
associate-*r/84.7%
distribute-lft-in84.7%
metadata-eval84.7%
neg-mul-184.7%
sub-neg84.7%
Simplified84.7%
Final simplification87.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1.1e-76)
(fabs (* x (+ (/ z y_m) (/ -1.0 y_m))))
(if (<= x 9.6e-110)
(fabs (/ (- -4.0 x) y_m))
(fabs (/ (+ z -1.0) (/ y_m x))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.1e-76) {
tmp = fabs((x * ((z / y_m) + (-1.0 / y_m))));
} else if (x <= 9.6e-110) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs(((z + -1.0) / (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 (x <= (-1.1d-76)) then
tmp = abs((x * ((z / y_m) + ((-1.0d0) / y_m))))
else if (x <= 9.6d-110) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs(((z + (-1.0d0)) / (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 (x <= -1.1e-76) {
tmp = Math.abs((x * ((z / y_m) + (-1.0 / y_m))));
} else if (x <= 9.6e-110) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs(((z + -1.0) / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.1e-76: tmp = math.fabs((x * ((z / y_m) + (-1.0 / y_m)))) elif x <= 9.6e-110: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs(((z + -1.0) / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.1e-76) tmp = abs(Float64(x * Float64(Float64(z / y_m) + Float64(-1.0 / y_m)))); elseif (x <= 9.6e-110) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(Float64(z + -1.0) / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -1.1e-76) tmp = abs((x * ((z / y_m) + (-1.0 / y_m)))); elseif (x <= 9.6e-110) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs(((z + -1.0) / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.1e-76], N[Abs[N[(x * N[(N[(z / y$95$m), $MachinePrecision] + N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.6e-110], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-76}:\\
\;\;\;\;\left|x \cdot \left(\frac{z}{y_m} + \frac{-1}{y_m}\right)\right|\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-110}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if x < -1.1e-76Initial program 90.7%
Simplified95.3%
Taylor expanded in x around inf 92.9%
if -1.1e-76 < x < 9.60000000000000026e-110Initial program 95.2%
Simplified93.2%
Taylor expanded in z around 0 84.7%
associate-*r/84.7%
distribute-lft-in84.7%
metadata-eval84.7%
neg-mul-184.7%
sub-neg84.7%
Simplified84.7%
if 9.60000000000000026e-110 < x Initial program 91.3%
Simplified95.7%
Taylor expanded in x around inf 86.8%
Taylor expanded in y around 0 82.9%
sub-neg82.9%
metadata-eval82.9%
*-commutative82.9%
associate-/l*86.8%
Simplified86.8%
Final simplification87.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -1.06e+52) (fabs (* x (/ z y_m))) (if (<= z 3e+111) (fabs (/ (- -4.0 x) y_m)) (fabs (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.06e+52) {
tmp = fabs((x * (z / y_m)));
} else if (z <= 3e+111) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x / (y_m / z)));
}
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.06d+52)) then
tmp = abs((x * (z / y_m)))
else if (z <= 3d+111) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x / (y_m / z)))
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.06e+52) {
tmp = Math.abs((x * (z / y_m)));
} else if (z <= 3e+111) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x / (y_m / z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.06e+52: tmp = math.fabs((x * (z / y_m))) elif z <= 3e+111: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x / (y_m / z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.06e+52) tmp = abs(Float64(x * Float64(z / y_m))); elseif (z <= 3e+111) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -1.06e+52) tmp = abs((x * (z / y_m))); elseif (z <= 3e+111) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x / (y_m / z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.06e+52], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3e+111], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.06 \cdot 10^{+52}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+111}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\end{array}
\end{array}
if z < -1.0599999999999999e52Initial program 93.1%
Simplified93.1%
Taylor expanded in x around inf 75.5%
Taylor expanded in z around inf 73.8%
associate-*r/75.5%
Simplified75.5%
if -1.0599999999999999e52 < z < 3e111Initial program 95.0%
Simplified98.7%
Taylor expanded in z around 0 91.1%
associate-*r/91.1%
distribute-lft-in91.1%
metadata-eval91.1%
neg-mul-191.1%
sub-neg91.1%
Simplified91.1%
if 3e111 < z Initial program 82.9%
Taylor expanded in z around inf 73.1%
mul-1-neg73.1%
associate-*l/82.0%
distribute-rgt-neg-out82.0%
Simplified82.0%
add-sqr-sqrt0.0%
sqrt-unprod58.0%
sqr-neg58.0%
sqrt-unprod81.7%
add-sqr-sqrt82.0%
associate-/r/84.0%
Applied egg-rr84.0%
Final simplification86.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.55) (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.55) || !(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.55d0)) .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.55) || !(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.55) 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.55) || !(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.55) || ~((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.55], 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.55 \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.55000000000000004 or 4 < x Initial program 89.5%
associate-*l/85.2%
sub-div92.4%
clear-num92.3%
associate--l+92.3%
Applied egg-rr92.3%
Taylor expanded in z around 0 62.3%
Taylor expanded in x around inf 61.3%
if -1.55000000000000004 < x < 4Initial program 95.6%
Taylor expanded in x around 0 72.5%
Final simplification67.0%
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 92.6%
Taylor expanded in x around 0 39.7%
Final simplification39.7%
herbie shell --seed 2023335
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))