
(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 11 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.5e-70) (fabs (/ (- (+ 4.0 x) (* 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 <= 1.5e-70) {
tmp = fabs((((4.0 + x) - (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 <= 1.5e-70) tmp = abs(Float64(Float64(Float64(4.0 + x) - 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, 1.5e-70], N[Abs[N[(N[(N[(4.0 + x), $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 1.5 \cdot 10^{-70}:\\
\;\;\;\;\left|\frac{\left(4 + x\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 < 1.5000000000000001e-70Initial program 91.5%
Taylor expanded in y around 0 96.1%
if 1.5000000000000001e-70 < y Initial program 98.7%
Simplified99.8%
Final simplification97.3%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -1.7e+207)
t_0
(if (<= x -3.9e+129)
t_1
(if (<= x -3.2e+72)
t_0
(if (<= x -2.95e+16)
t_1
(if (or (<= x -6e-123) (not (<= x 5.1e-124)))
t_0
(fabs (/ 4.0 y_m)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -1.7e+207) {
tmp = t_0;
} else if (x <= -3.9e+129) {
tmp = t_1;
} else if (x <= -3.2e+72) {
tmp = t_0;
} else if (x <= -2.95e+16) {
tmp = t_1;
} else if ((x <= -6e-123) || !(x <= 5.1e-124)) {
tmp = t_0;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-1.7d+207)) then
tmp = t_0
else if (x <= (-3.9d+129)) then
tmp = t_1
else if (x <= (-3.2d+72)) then
tmp = t_0
else if (x <= (-2.95d+16)) then
tmp = t_1
else if ((x <= (-6d-123)) .or. (.not. (x <= 5.1d-124))) then
tmp = t_0
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 t_0 = Math.abs((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.7e+207) {
tmp = t_0;
} else if (x <= -3.9e+129) {
tmp = t_1;
} else if (x <= -3.2e+72) {
tmp = t_0;
} else if (x <= -2.95e+16) {
tmp = t_1;
} else if ((x <= -6e-123) || !(x <= 5.1e-124)) {
tmp = t_0;
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -1.7e+207: tmp = t_0 elif x <= -3.9e+129: tmp = t_1 elif x <= -3.2e+72: tmp = t_0 elif x <= -2.95e+16: tmp = t_1 elif (x <= -6e-123) or not (x <= 5.1e-124): tmp = t_0 else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.7e+207) tmp = t_0; elseif (x <= -3.9e+129) tmp = t_1; elseif (x <= -3.2e+72) tmp = t_0; elseif (x <= -2.95e+16) tmp = t_1; elseif ((x <= -6e-123) || !(x <= 5.1e-124)) tmp = t_0; else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.7e+207) tmp = t_0; elseif (x <= -3.9e+129) tmp = t_1; elseif (x <= -3.2e+72) tmp = t_0; elseif (x <= -2.95e+16) tmp = t_1; elseif ((x <= -6e-123) || ~((x <= 5.1e-124))) tmp = t_0; else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.7e+207], t$95$0, If[LessEqual[x, -3.9e+129], t$95$1, If[LessEqual[x, -3.2e+72], t$95$0, If[LessEqual[x, -2.95e+16], t$95$1, If[Or[LessEqual[x, -6e-123], N[Not[LessEqual[x, 5.1e-124]], $MachinePrecision]], t$95$0, N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y_m}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.95 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-123} \lor \neg \left(x \leq 5.1 \cdot 10^{-124}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -1.6999999999999999e207 or -3.8999999999999997e129 < x < -3.2000000000000001e72 or -2.95e16 < x < -5.99999999999999968e-123 or 5.1000000000000001e-124 < x Initial program 92.7%
Taylor expanded in z around inf 61.7%
mul-1-neg61.7%
associate-*l/66.6%
distribute-rgt-neg-out66.6%
Simplified66.6%
add-sqr-sqrt30.9%
sqrt-unprod49.7%
sqr-neg49.7%
sqrt-unprod35.6%
add-sqr-sqrt66.6%
expm1-log1p-u36.5%
expm1-udef28.1%
associate-*l/25.3%
Applied egg-rr25.3%
expm1-def34.2%
expm1-log1p61.7%
associate-*l/66.6%
Simplified66.6%
if -1.6999999999999999e207 < x < -3.8999999999999997e129 or -3.2000000000000001e72 < x < -2.95e16Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -5.99999999999999968e-123 < x < 5.1000000000000001e-124Initial program 97.6%
Taylor expanded in x around 0 90.3%
Final simplification75.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -1.2e+207)
t_0
(if (<= x -5.1e+129)
t_1
(if (<= x -1.55e+73)
t_0
(if (<= x -6.5e+15)
t_1
(if (<= x -3.8e-72)
(fabs (* x (/ z y_m)))
(if (<= x 4.6e-124) (fabs (/ 4.0 y_m)) t_0))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -1.2e+207) {
tmp = t_0;
} else if (x <= -5.1e+129) {
tmp = t_1;
} else if (x <= -1.55e+73) {
tmp = t_0;
} else if (x <= -6.5e+15) {
tmp = t_1;
} else if (x <= -3.8e-72) {
tmp = fabs((x * (z / y_m)));
} else if (x <= 4.6e-124) {
tmp = fabs((4.0 / y_m));
} 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((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-1.2d+207)) then
tmp = t_0
else if (x <= (-5.1d+129)) then
tmp = t_1
else if (x <= (-1.55d+73)) then
tmp = t_0
else if (x <= (-6.5d+15)) then
tmp = t_1
else if (x <= (-3.8d-72)) then
tmp = abs((x * (z / y_m)))
else if (x <= 4.6d-124) then
tmp = abs((4.0d0 / y_m))
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((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.2e+207) {
tmp = t_0;
} else if (x <= -5.1e+129) {
tmp = t_1;
} else if (x <= -1.55e+73) {
tmp = t_0;
} else if (x <= -6.5e+15) {
tmp = t_1;
} else if (x <= -3.8e-72) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= 4.6e-124) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -1.2e+207: tmp = t_0 elif x <= -5.1e+129: tmp = t_1 elif x <= -1.55e+73: tmp = t_0 elif x <= -6.5e+15: tmp = t_1 elif x <= -3.8e-72: tmp = math.fabs((x * (z / y_m))) elif x <= 4.6e-124: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.2e+207) tmp = t_0; elseif (x <= -5.1e+129) tmp = t_1; elseif (x <= -1.55e+73) tmp = t_0; elseif (x <= -6.5e+15) tmp = t_1; elseif (x <= -3.8e-72) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= 4.6e-124) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.2e+207) tmp = t_0; elseif (x <= -5.1e+129) tmp = t_1; elseif (x <= -1.55e+73) tmp = t_0; elseif (x <= -6.5e+15) tmp = t_1; elseif (x <= -3.8e-72) tmp = abs((x * (z / y_m))); elseif (x <= 4.6e-124) tmp = abs((4.0 / y_m)); 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[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.2e+207], t$95$0, If[LessEqual[x, -5.1e+129], t$95$1, If[LessEqual[x, -1.55e+73], t$95$0, If[LessEqual[x, -6.5e+15], t$95$1, If[LessEqual[x, -3.8e-72], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.6e-124], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y_m}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5.1 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-72}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.2e207 or -5.09999999999999996e129 < x < -1.55e73 or 4.60000000000000024e-124 < x Initial program 91.6%
Taylor expanded in z around inf 61.0%
mul-1-neg61.0%
associate-*l/67.9%
distribute-rgt-neg-out67.9%
Simplified67.9%
add-sqr-sqrt32.7%
sqrt-unprod52.9%
sqr-neg52.9%
sqrt-unprod35.1%
add-sqr-sqrt67.9%
expm1-log1p-u36.9%
expm1-udef29.1%
associate-*l/25.5%
Applied egg-rr25.5%
expm1-def33.3%
expm1-log1p61.0%
associate-*l/67.9%
Simplified67.9%
if -1.2e207 < x < -5.09999999999999996e129 or -1.55e73 < x < -6.5e15Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -6.5e15 < x < -3.80000000000000002e-72Initial program 95.0%
Taylor expanded in z around inf 68.6%
mul-1-neg68.6%
associate-*l/64.0%
distribute-rgt-neg-out64.0%
Simplified64.0%
add-sqr-sqrt21.1%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod42.6%
add-sqr-sqrt64.0%
associate-*l/68.6%
associate-/l*68.6%
Applied egg-rr68.6%
clear-num68.6%
associate-/r/68.8%
clear-num68.8%
Applied egg-rr68.8%
if -3.80000000000000002e-72 < x < 4.60000000000000024e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -2e+207)
(fabs (/ x (/ y_m z)))
(if (<= x -3.3e+129)
t_1
(if (<= x -5e+72)
t_0
(if (<= x -6600000000000.0)
t_1
(if (<= x -1e-72)
(fabs (* x (/ z y_m)))
(if (<= x 5.1e-124) (fabs (/ 4.0 y_m)) t_0))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -2e+207) {
tmp = fabs((x / (y_m / z)));
} else if (x <= -3.3e+129) {
tmp = t_1;
} else if (x <= -5e+72) {
tmp = t_0;
} else if (x <= -6600000000000.0) {
tmp = t_1;
} else if (x <= -1e-72) {
tmp = fabs((x * (z / y_m)));
} else if (x <= 5.1e-124) {
tmp = fabs((4.0 / y_m));
} 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((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-2d+207)) then
tmp = abs((x / (y_m / z)))
else if (x <= (-3.3d+129)) then
tmp = t_1
else if (x <= (-5d+72)) then
tmp = t_0
else if (x <= (-6600000000000.0d0)) then
tmp = t_1
else if (x <= (-1d-72)) then
tmp = abs((x * (z / y_m)))
else if (x <= 5.1d-124) then
tmp = abs((4.0d0 / y_m))
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((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -2e+207) {
tmp = Math.abs((x / (y_m / z)));
} else if (x <= -3.3e+129) {
tmp = t_1;
} else if (x <= -5e+72) {
tmp = t_0;
} else if (x <= -6600000000000.0) {
tmp = t_1;
} else if (x <= -1e-72) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= 5.1e-124) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -2e+207: tmp = math.fabs((x / (y_m / z))) elif x <= -3.3e+129: tmp = t_1 elif x <= -5e+72: tmp = t_0 elif x <= -6600000000000.0: tmp = t_1 elif x <= -1e-72: tmp = math.fabs((x * (z / y_m))) elif x <= 5.1e-124: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -2e+207) tmp = abs(Float64(x / Float64(y_m / z))); elseif (x <= -3.3e+129) tmp = t_1; elseif (x <= -5e+72) tmp = t_0; elseif (x <= -6600000000000.0) tmp = t_1; elseif (x <= -1e-72) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= 5.1e-124) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -2e+207) tmp = abs((x / (y_m / z))); elseif (x <= -3.3e+129) tmp = t_1; elseif (x <= -5e+72) tmp = t_0; elseif (x <= -6600000000000.0) tmp = t_1; elseif (x <= -1e-72) tmp = abs((x * (z / y_m))); elseif (x <= 5.1e-124) tmp = abs((4.0 / y_m)); 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[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2e+207], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -3.3e+129], t$95$1, If[LessEqual[x, -5e+72], t$95$0, If[LessEqual[x, -6600000000000.0], t$95$1, If[LessEqual[x, -1e-72], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.1e-124], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y_m}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -2 \cdot 10^{+207}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6600000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1 \cdot 10^{-72}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.0000000000000001e207Initial program 87.8%
Taylor expanded in z around inf 62.2%
mul-1-neg62.2%
associate-*l/77.3%
distribute-rgt-neg-out77.3%
Simplified77.3%
add-sqr-sqrt36.8%
sqrt-unprod69.8%
sqr-neg69.8%
sqrt-unprod40.5%
add-sqr-sqrt77.3%
associate-*l/62.2%
associate-/l*77.4%
Applied egg-rr77.4%
if -2.0000000000000001e207 < x < -3.2999999999999999e129 or -4.99999999999999992e72 < x < -6.6e12Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -3.2999999999999999e129 < x < -4.99999999999999992e72 or 5.1000000000000001e-124 < x Initial program 92.6%
Taylor expanded in z around inf 60.7%
mul-1-neg60.7%
associate-*l/65.5%
distribute-rgt-neg-out65.5%
Simplified65.5%
add-sqr-sqrt31.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod33.8%
add-sqr-sqrt65.5%
expm1-log1p-u36.2%
expm1-udef26.5%
associate-*l/22.9%
Applied egg-rr22.9%
expm1-def32.6%
expm1-log1p60.7%
associate-*l/65.5%
Simplified65.5%
if -6.6e12 < x < -9.9999999999999997e-73Initial program 95.0%
Taylor expanded in z around inf 68.6%
mul-1-neg68.6%
associate-*l/64.0%
distribute-rgt-neg-out64.0%
Simplified64.0%
add-sqr-sqrt21.1%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod42.6%
add-sqr-sqrt64.0%
associate-*l/68.6%
associate-/l*68.6%
Applied egg-rr68.6%
clear-num68.6%
associate-/r/68.8%
clear-num68.8%
Applied egg-rr68.8%
if -9.9999999999999997e-73 < x < 5.1000000000000001e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ z (/ y_m x)))) (t_1 (fabs (/ x y_m))))
(if (<= x -1.05e+207)
t_0
(if (<= x -5.2e+129)
t_1
(if (<= x -2.6e+72)
(fabs (* z (/ x y_m)))
(if (<= x -7.2e+15)
t_1
(if (<= x -8e-73)
(fabs (* x (/ z y_m)))
(if (<= x 4.8e-124) (fabs (/ 4.0 y_m)) t_0))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z / (y_m / x)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -1.05e+207) {
tmp = t_0;
} else if (x <= -5.2e+129) {
tmp = t_1;
} else if (x <= -2.6e+72) {
tmp = fabs((z * (x / y_m)));
} else if (x <= -7.2e+15) {
tmp = t_1;
} else if (x <= -8e-73) {
tmp = fabs((x * (z / y_m)));
} else if (x <= 4.8e-124) {
tmp = fabs((4.0 / y_m));
} 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((z / (y_m / x)))
t_1 = abs((x / y_m))
if (x <= (-1.05d+207)) then
tmp = t_0
else if (x <= (-5.2d+129)) then
tmp = t_1
else if (x <= (-2.6d+72)) then
tmp = abs((z * (x / y_m)))
else if (x <= (-7.2d+15)) then
tmp = t_1
else if (x <= (-8d-73)) then
tmp = abs((x * (z / y_m)))
else if (x <= 4.8d-124) then
tmp = abs((4.0d0 / y_m))
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((z / (y_m / x)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.05e+207) {
tmp = t_0;
} else if (x <= -5.2e+129) {
tmp = t_1;
} else if (x <= -2.6e+72) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= -7.2e+15) {
tmp = t_1;
} else if (x <= -8e-73) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= 4.8e-124) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z / (y_m / x))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -1.05e+207: tmp = t_0 elif x <= -5.2e+129: tmp = t_1 elif x <= -2.6e+72: tmp = math.fabs((z * (x / y_m))) elif x <= -7.2e+15: tmp = t_1 elif x <= -8e-73: tmp = math.fabs((x * (z / y_m))) elif x <= 4.8e-124: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z / Float64(y_m / x))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.05e+207) tmp = t_0; elseif (x <= -5.2e+129) tmp = t_1; elseif (x <= -2.6e+72) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= -7.2e+15) tmp = t_1; elseif (x <= -8e-73) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= 4.8e-124) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z / (y_m / x))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.05e+207) tmp = t_0; elseif (x <= -5.2e+129) tmp = t_1; elseif (x <= -2.6e+72) tmp = abs((z * (x / y_m))); elseif (x <= -7.2e+15) tmp = t_1; elseif (x <= -8e-73) tmp = abs((x * (z / y_m))); elseif (x <= 4.8e-124) tmp = abs((4.0 / y_m)); 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[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.05e+207], t$95$0, If[LessEqual[x, -5.2e+129], t$95$1, If[LessEqual[x, -2.6e+72], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -7.2e+15], t$95$1, If[LessEqual[x, -8e-73], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.8e-124], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{z}{\frac{y_m}{x}}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -5.2 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.6 \cdot 10^{+72}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-73}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.05e207 or 4.79999999999999985e-124 < x Initial program 91.0%
Taylor expanded in z around inf 60.8%
mul-1-neg60.8%
associate-*l/66.5%
distribute-rgt-neg-out66.5%
Simplified66.5%
clear-num66.5%
associate-*l/66.6%
*-un-lft-identity66.6%
add-sqr-sqrt33.2%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod33.3%
add-sqr-sqrt66.6%
Applied egg-rr66.6%
if -1.05e207 < x < -5.20000000000000024e129 or -2.59999999999999981e72 < x < -7.2e15Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -5.20000000000000024e129 < x < -2.59999999999999981e72Initial program 100.0%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
associate-*l/88.1%
distribute-rgt-neg-out88.1%
Simplified88.1%
add-sqr-sqrt25.4%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod62.0%
add-sqr-sqrt88.1%
expm1-log1p-u48.4%
expm1-udef24.3%
associate-*l/13.5%
Applied egg-rr13.5%
expm1-def37.3%
expm1-log1p64.3%
associate-*l/88.1%
Simplified88.1%
if -7.2e15 < x < -7.99999999999999998e-73Initial program 95.0%
Taylor expanded in z around inf 68.6%
mul-1-neg68.6%
associate-*l/64.0%
distribute-rgt-neg-out64.0%
Simplified64.0%
add-sqr-sqrt21.1%
sqrt-unprod40.4%
sqr-neg40.4%
sqrt-unprod42.6%
add-sqr-sqrt64.0%
associate-*l/68.6%
associate-/l*68.6%
Applied egg-rr68.6%
clear-num68.6%
associate-/r/68.8%
clear-num68.8%
Applied egg-rr68.8%
if -7.99999999999999998e-73 < x < 4.79999999999999985e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ z (/ y_m x)))) (t_1 (fabs (/ x y_m))))
(if (<= x -1.15e+207)
t_0
(if (<= x -1.7e+129)
t_1
(if (<= x -8.2e+72)
(fabs (* z (/ x y_m)))
(if (<= x -8.2e+15)
t_1
(if (<= x -6e-123)
(fabs (/ (* x z) y_m))
(if (<= x 5.1e-124) (fabs (/ 4.0 y_m)) t_0))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z / (y_m / x)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -1.15e+207) {
tmp = t_0;
} else if (x <= -1.7e+129) {
tmp = t_1;
} else if (x <= -8.2e+72) {
tmp = fabs((z * (x / y_m)));
} else if (x <= -8.2e+15) {
tmp = t_1;
} else if (x <= -6e-123) {
tmp = fabs(((x * z) / y_m));
} else if (x <= 5.1e-124) {
tmp = fabs((4.0 / y_m));
} 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((z / (y_m / x)))
t_1 = abs((x / y_m))
if (x <= (-1.15d+207)) then
tmp = t_0
else if (x <= (-1.7d+129)) then
tmp = t_1
else if (x <= (-8.2d+72)) then
tmp = abs((z * (x / y_m)))
else if (x <= (-8.2d+15)) then
tmp = t_1
else if (x <= (-6d-123)) then
tmp = abs(((x * z) / y_m))
else if (x <= 5.1d-124) then
tmp = abs((4.0d0 / y_m))
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((z / (y_m / x)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.15e+207) {
tmp = t_0;
} else if (x <= -1.7e+129) {
tmp = t_1;
} else if (x <= -8.2e+72) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= -8.2e+15) {
tmp = t_1;
} else if (x <= -6e-123) {
tmp = Math.abs(((x * z) / y_m));
} else if (x <= 5.1e-124) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z / (y_m / x))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -1.15e+207: tmp = t_0 elif x <= -1.7e+129: tmp = t_1 elif x <= -8.2e+72: tmp = math.fabs((z * (x / y_m))) elif x <= -8.2e+15: tmp = t_1 elif x <= -6e-123: tmp = math.fabs(((x * z) / y_m)) elif x <= 5.1e-124: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z / Float64(y_m / x))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.15e+207) tmp = t_0; elseif (x <= -1.7e+129) tmp = t_1; elseif (x <= -8.2e+72) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= -8.2e+15) tmp = t_1; elseif (x <= -6e-123) tmp = abs(Float64(Float64(x * z) / y_m)); elseif (x <= 5.1e-124) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z / (y_m / x))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.15e+207) tmp = t_0; elseif (x <= -1.7e+129) tmp = t_1; elseif (x <= -8.2e+72) tmp = abs((z * (x / y_m))); elseif (x <= -8.2e+15) tmp = t_1; elseif (x <= -6e-123) tmp = abs(((x * z) / y_m)); elseif (x <= 5.1e-124) tmp = abs((4.0 / y_m)); 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[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.15e+207], t$95$0, If[LessEqual[x, -1.7e+129], t$95$1, If[LessEqual[x, -8.2e+72], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -8.2e+15], t$95$1, If[LessEqual[x, -6e-123], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.1e-124], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{z}{\frac{y_m}{x}}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{+72}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-123}:\\
\;\;\;\;\left|\frac{x \cdot z}{y_m}\right|\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.14999999999999997e207 or 5.1000000000000001e-124 < x Initial program 91.0%
Taylor expanded in z around inf 60.8%
mul-1-neg60.8%
associate-*l/66.5%
distribute-rgt-neg-out66.5%
Simplified66.5%
clear-num66.5%
associate-*l/66.6%
*-un-lft-identity66.6%
add-sqr-sqrt33.2%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod33.3%
add-sqr-sqrt66.6%
Applied egg-rr66.6%
if -1.14999999999999997e207 < x < -1.70000000000000009e129 or -8.19999999999999926e72 < x < -8.2e15Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -1.70000000000000009e129 < x < -8.19999999999999926e72Initial program 100.0%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
associate-*l/88.1%
distribute-rgt-neg-out88.1%
Simplified88.1%
add-sqr-sqrt25.4%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod62.0%
add-sqr-sqrt88.1%
expm1-log1p-u48.4%
expm1-udef24.3%
associate-*l/13.5%
Applied egg-rr13.5%
expm1-def37.3%
expm1-log1p64.3%
associate-*l/88.1%
Simplified88.1%
if -8.2e15 < x < -5.99999999999999968e-123Initial program 96.8%
Taylor expanded in z around inf 64.5%
mul-1-neg64.5%
associate-*l/61.5%
distribute-rgt-neg-out61.5%
Simplified61.5%
add-sqr-sqrt23.8%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod37.4%
add-sqr-sqrt61.5%
associate-*l/64.5%
Applied egg-rr64.5%
if -5.99999999999999968e-123 < x < 5.1000000000000001e-124Initial program 97.6%
Taylor expanded in x around 0 90.3%
Final simplification75.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 2.65e-45) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (- (/ (+ 4.0 x) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 2.65e-45) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs((((4.0 + x) / 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 <= 2.65d-45) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs((((4.0d0 + x) / 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 <= 2.65e-45) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs((((4.0 + x) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 2.65e-45: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs((((4.0 + x) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 2.65e-45) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(4.0 + x) / 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 <= 2.65e-45) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs((((4.0 + x) / 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, 2.65e-45], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $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 2.65 \cdot 10^{-45}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y_m} - \frac{x}{\frac{y_m}{z}}\right|\\
\end{array}
\end{array}
if y < 2.6499999999999999e-45Initial program 91.9%
Taylor expanded in y around 0 96.3%
if 2.6499999999999999e-45 < y Initial program 98.6%
associate-/r/99.8%
Applied egg-rr99.8%
Final simplification97.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.2e+38) (fabs (* x (+ (/ z y_m) (/ -1.0 y_m)))) (fabs (/ (- (+ 4.0 x) (* x z)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.2e+38) {
tmp = fabs((x * ((z / y_m) + (-1.0 / y_m))));
} else {
tmp = fabs((((4.0 + x) - (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 (x <= (-1.2d+38)) then
tmp = abs((x * ((z / y_m) + ((-1.0d0) / y_m))))
else
tmp = abs((((4.0d0 + x) - (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 (x <= -1.2e+38) {
tmp = Math.abs((x * ((z / y_m) + (-1.0 / y_m))));
} else {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.2e+38: tmp = math.fabs((x * ((z / y_m) + (-1.0 / y_m)))) else: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.2e+38) tmp = abs(Float64(x * Float64(Float64(z / y_m) + Float64(-1.0 / y_m)))); else tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / 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+38) tmp = abs((x * ((z / y_m) + (-1.0 / y_m)))); else tmp = abs((((4.0 + x) - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.2e+38], N[Abs[N[(x * N[(N[(z / y$95$m), $MachinePrecision] + N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+38}:\\
\;\;\;\;\left|x \cdot \left(\frac{z}{y_m} + \frac{-1}{y_m}\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\end{array}
\end{array}
if x < -1.20000000000000009e38Initial program 89.4%
Simplified92.9%
Taylor expanded in x around inf 99.8%
if -1.20000000000000009e38 < x Initial program 95.0%
Taylor expanded in y around 0 98.9%
Final simplification99.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -2.2e+37)
(fabs (/ z (/ y_m x)))
(if (<= z 2500000000000.0)
(fabs (/ (- -4.0 x) y_m))
(fabs (* x (/ z y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -2.2e+37) {
tmp = fabs((z / (y_m / x)));
} else if (z <= 2500000000000.0) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-2.2d+37)) then
tmp = abs((z / (y_m / x)))
else if (z <= 2500000000000.0d0) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -2.2e+37) {
tmp = Math.abs((z / (y_m / x)));
} else if (z <= 2500000000000.0) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x * (z / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -2.2e+37: tmp = math.fabs((z / (y_m / x))) elif z <= 2500000000000.0: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x * (z / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -2.2e+37) tmp = abs(Float64(z / Float64(y_m / x))); elseif (z <= 2500000000000.0) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(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 (z <= -2.2e+37) tmp = abs((z / (y_m / x))); elseif (z <= 2500000000000.0) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x * (z / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -2.2e+37], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2500000000000.0], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+37}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;z \leq 2500000000000:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\end{array}
\end{array}
if z < -2.2000000000000001e37Initial program 98.1%
Taylor expanded in z around inf 69.8%
mul-1-neg69.8%
associate-*l/78.2%
distribute-rgt-neg-out78.2%
Simplified78.2%
clear-num78.1%
associate-*l/78.3%
*-un-lft-identity78.3%
add-sqr-sqrt78.0%
sqrt-unprod54.5%
sqr-neg54.5%
sqrt-unprod0.0%
add-sqr-sqrt78.3%
Applied egg-rr78.3%
if -2.2000000000000001e37 < z < 2.5e12Initial program 96.9%
Simplified100.0%
Taylor expanded in z around 0 96.8%
associate-*r/96.8%
distribute-lft-in96.8%
metadata-eval96.8%
neg-mul-196.8%
sub-neg96.8%
Simplified96.8%
if 2.5e12 < z Initial program 84.7%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
associate-*l/80.6%
distribute-rgt-neg-out80.6%
Simplified80.6%
add-sqr-sqrt0.0%
sqrt-unprod57.7%
sqr-neg57.7%
sqrt-unprod80.4%
add-sqr-sqrt80.6%
associate-*l/79.3%
associate-/l*83.2%
Applied egg-rr83.2%
clear-num83.2%
associate-/r/83.2%
clear-num83.2%
Applied egg-rr83.2%
Final simplification88.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -10.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 <= -10.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 <= (-10.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 <= -10.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 <= -10.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 <= -10.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 <= -10.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, -10.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 -10.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 < -10.5 or 4 < x Initial program 89.5%
Taylor expanded in z around 0 58.8%
associate-*r/58.8%
metadata-eval58.8%
Simplified58.8%
Taylor expanded in x around inf 58.2%
if -10.5 < x < 4Initial program 97.8%
Taylor expanded in x around 0 70.3%
Final simplification64.3%
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.7%
Taylor expanded in x around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023332
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))