
(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 17 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 4e-94) (fabs (/ (- (* x z) (+ x 4.0)) 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 <= 4e-94) {
tmp = fabs((((x * z) - (x + 4.0)) / 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 <= 4e-94) tmp = abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / 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, 4e-94], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $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 4 \cdot 10^{-94}:\\
\;\;\;\;\left|\frac{x \cdot z - \left(x + 4\right)}{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 < 3.9999999999999998e-94Initial program 89.9%
associate-*l/93.9%
sub-div98.9%
Applied egg-rr98.9%
if 3.9999999999999998e-94 < y Initial program 96.2%
fabs-sub96.2%
associate-*l/91.2%
associate-*r/99.9%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.7e-37) (not (<= x 1.2e-26))) (fabs (* (/ x y_m) (- 1.0 z))) (/ (- 4.0 (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.7e-37) || !(x <= 1.2e-26)) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else {
tmp = (4.0 - (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.7d-37)) .or. (.not. (x <= 1.2d-26))) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else
tmp = (4.0d0 - (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.7e-37) || !(x <= 1.2e-26)) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else {
tmp = (4.0 - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.7e-37) or not (x <= 1.2e-26): tmp = math.fabs(((x / y_m) * (1.0 - z))) else: tmp = (4.0 - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.7e-37) || !(x <= 1.2e-26)) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); else tmp = Float64(Float64(4.0 - 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.7e-37) || ~((x <= 1.2e-26))) tmp = abs(((x / y_m) * (1.0 - z))); else tmp = (4.0 - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.7e-37], N[Not[LessEqual[x, 1.2e-26]], $MachinePrecision]], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37} \lor \neg \left(x \leq 1.2 \cdot 10^{-26}\right):\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37 or 1.2e-26 < x Initial program 88.8%
Simplified93.9%
Taylor expanded in x around inf 91.1%
mul-1-neg91.1%
associate-/l*96.9%
distribute-rgt-neg-in96.9%
mul-1-neg96.9%
associate-*r/96.9%
sub-neg96.9%
metadata-eval96.9%
distribute-lft-in96.9%
neg-mul-196.9%
metadata-eval96.9%
+-commutative96.9%
neg-mul-196.9%
associate-/l*91.1%
*-commutative91.1%
associate-/l*97.0%
neg-mul-197.0%
unsub-neg97.0%
Simplified97.0%
if -1.70000000000000009e-37 < x < 1.2e-26Initial program 95.7%
add-sqr-sqrt46.3%
fabs-sqr46.3%
add-sqr-sqrt47.6%
sub-neg47.6%
+-commutative47.6%
associate-*l/50.1%
associate-*r/45.8%
frac-2neg45.8%
+-commutative45.8%
distribute-neg-in45.8%
metadata-eval45.8%
sub-neg45.8%
distribute-frac-neg245.8%
distribute-neg-in45.8%
fma-undefine45.8%
neg-sub045.8%
fma-undefine45.8%
associate-*r/50.1%
associate-*l/47.6%
Applied egg-rr50.1%
Taylor expanded in x around 0 50.1%
Final simplification76.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1e-52) (fabs (/ (- (* x z) (+ x 4.0)) 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 <= 1e-52) {
tmp = fabs((((x * z) - (x + 4.0)) / 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 <= 1d-52) then
tmp = abs((((x * z) - (x + 4.0d0)) / 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 <= 1e-52) {
tmp = Math.abs((((x * z) - (x + 4.0)) / 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 <= 1e-52: tmp = math.fabs((((x * z) - (x + 4.0)) / 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 <= 1e-52) tmp = abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / 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 <= 1e-52) tmp = abs((((x * z) - (x + 4.0)) / 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, 1e-52], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $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 10^{-52}:\\
\;\;\;\;\left|\frac{x \cdot z - \left(x + 4\right)}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 1e-52Initial program 90.3%
associate-*l/94.1%
sub-div99.0%
Applied egg-rr99.0%
if 1e-52 < y Initial program 95.8%
associate-*l/90.5%
associate-*r/99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification99.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -16.0) (not (<= z 950.0))) (fabs (* z (/ x y_m))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((z <= -16.0) || !(z <= 950.0)) {
tmp = fabs((z * (x / y_m)));
} 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 ((z <= (-16.0d0)) .or. (.not. (z <= 950.0d0))) then
tmp = abs((z * (x / y_m)))
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 ((z <= -16.0) || !(z <= 950.0)) {
tmp = Math.abs((z * (x / y_m)));
} 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 (z <= -16.0) or not (z <= 950.0): tmp = math.fabs((z * (x / y_m))) 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 ((z <= -16.0) || !(z <= 950.0)) tmp = abs(Float64(z * Float64(x / y_m))); 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 ((z <= -16.0) || ~((z <= 950.0))) tmp = abs((z * (x / y_m))); 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[z, -16.0], N[Not[LessEqual[z, 950.0]], $MachinePrecision]], N[Abs[N[(z * N[(x / y$95$m), $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}\;z \leq -16 \lor \neg \left(z \leq 950\right):\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -16 or 950 < z Initial program 90.7%
Simplified92.6%
Taylor expanded in z around inf 68.4%
mul-1-neg68.4%
distribute-frac-neg268.4%
*-commutative68.4%
associate-*r/71.5%
Simplified71.5%
if -16 < z < 950Initial program 92.7%
fabs-sub92.7%
associate-*l/97.8%
associate-*r/97.8%
fmm-def100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 98.5%
associate-*r/98.5%
distribute-lft-in98.5%
metadata-eval98.5%
neg-mul-198.5%
sub-neg98.5%
Simplified98.5%
Final simplification86.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -16.0) (fabs (/ (* x z) y_m)) (if (<= z 950.0) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -16.0) {
tmp = fabs(((x * z) / y_m));
} else if (z <= 950.0) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-16.0d0)) then
tmp = abs(((x * z) / y_m))
else if (z <= 950.0d0) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -16.0) {
tmp = Math.abs(((x * z) / y_m));
} else if (z <= 950.0) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -16.0: tmp = math.fabs(((x * z) / y_m)) elif z <= 950.0: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -16.0) tmp = abs(Float64(Float64(x * z) / y_m)); elseif (z <= 950.0) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(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 (z <= -16.0) tmp = abs(((x * z) / y_m)); elseif (z <= 950.0) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -16.0], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 950.0], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -16:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{elif}\;z \leq 950:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -16Initial program 91.7%
Simplified91.6%
Taylor expanded in z around inf 67.2%
associate-*r/67.2%
neg-mul-167.2%
distribute-rgt-neg-in67.2%
Simplified67.2%
if -16 < z < 950Initial program 92.7%
fabs-sub92.7%
associate-*l/97.8%
associate-*r/97.8%
fmm-def100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 98.5%
associate-*r/98.5%
distribute-lft-in98.5%
metadata-eval98.5%
neg-mul-198.5%
sub-neg98.5%
Simplified98.5%
if 950 < z Initial program 89.8%
Simplified93.5%
Taylor expanded in z around inf 69.6%
mul-1-neg69.6%
distribute-frac-neg269.6%
*-commutative69.6%
associate-*r/75.8%
Simplified75.8%
Final simplification86.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 1000000000000.0) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (* (/ x y_m) (- 1.0 z)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 1000000000000.0) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(((x / y_m) * (1.0 - 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 (x <= 1000000000000.0d0) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs(((x / y_m) * (1.0d0 - 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 (x <= 1000000000000.0) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 1000000000000.0: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs(((x / y_m) * (1.0 - z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 1000000000000.0) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 1000000000000.0) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs(((x / y_m) * (1.0 - z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 1000000000000.0], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1000000000000:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\end{array}
\end{array}
if x < 1e12Initial program 93.8%
associate-*l/96.4%
sub-div98.0%
Applied egg-rr98.0%
if 1e12 < x Initial program 86.2%
Simplified92.6%
Taylor expanded in x around inf 92.7%
mul-1-neg92.7%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
mul-1-neg99.8%
associate-*r/99.8%
sub-neg99.8%
metadata-eval99.8%
distribute-lft-in99.8%
neg-mul-199.8%
metadata-eval99.8%
+-commutative99.8%
neg-mul-199.8%
associate-/l*92.7%
*-commutative92.7%
associate-/l*99.8%
neg-mul-199.8%
unsub-neg99.8%
Simplified99.8%
Final simplification98.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1.7e-37)
(* x (/ (+ z -1.0) y_m))
(if (or (<= x 1.4e-18) (not (<= x 6.8e+157)))
(/ (+ x 4.0) y_m)
(/ (* x (- 1.0 z)) y_m))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if ((x <= 1.4e-18) || !(x <= 6.8e+157)) {
tmp = (x + 4.0) / y_m;
} else {
tmp = (x * (1.0 - 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.7d-37)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if ((x <= 1.4d-18) .or. (.not. (x <= 6.8d+157))) then
tmp = (x + 4.0d0) / y_m
else
tmp = (x * (1.0d0 - 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.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if ((x <= 1.4e-18) || !(x <= 6.8e+157)) {
tmp = (x + 4.0) / y_m;
} else {
tmp = (x * (1.0 - z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * ((z + -1.0) / y_m) elif (x <= 1.4e-18) or not (x <= 6.8e+157): tmp = (x + 4.0) / y_m else: tmp = (x * (1.0 - z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif ((x <= 1.4e-18) || !(x <= 6.8e+157)) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(Float64(x * Float64(1.0 - 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.7e-37) tmp = x * ((z + -1.0) / y_m); elseif ((x <= 1.4e-18) || ~((x <= 6.8e+157))) tmp = (x + 4.0) / y_m; else tmp = (x * (1.0 - z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 1.4e-18], N[Not[LessEqual[x, 6.8e+157]], $MachinePrecision]], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-18} \lor \neg \left(x \leq 6.8 \cdot 10^{+157}\right):\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(1 - z\right)}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
associate-*r/51.3%
sub-div54.4%
Applied egg-rr54.4%
Taylor expanded in x around inf 53.8%
associate-/l*58.1%
sub-neg58.1%
metadata-eval58.1%
Simplified58.1%
if -1.70000000000000009e-37 < x < 1.40000000000000006e-18 or 6.79999999999999958e157 < x Initial program 91.3%
fabs-sub91.3%
associate-*l/94.6%
associate-*r/89.0%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around 0 80.9%
associate-*r/80.9%
distribute-lft-in80.9%
metadata-eval80.9%
neg-mul-180.9%
sub-neg80.9%
Simplified80.9%
add-sqr-sqrt80.4%
sqrt-unprod53.5%
neg-fabs53.5%
neg-fabs53.5%
sqr-abs53.5%
distribute-frac-neg253.5%
sub-neg53.5%
metadata-eval53.5%
distribute-neg-in53.5%
+-commutative53.5%
frac-2neg53.5%
distribute-frac-neg253.5%
sub-neg53.5%
metadata-eval53.5%
distribute-neg-in53.5%
+-commutative53.5%
frac-2neg53.5%
sqrt-unprod37.6%
add-sqr-sqrt38.8%
Applied egg-rr38.8%
if 1.40000000000000006e-18 < x < 6.79999999999999958e157Initial program 97.5%
add-sqr-sqrt37.1%
fabs-sqr37.1%
add-sqr-sqrt37.8%
sub-neg37.8%
+-commutative37.8%
associate-*l/37.9%
associate-*r/40.1%
frac-2neg40.1%
+-commutative40.1%
distribute-neg-in40.1%
metadata-eval40.1%
sub-neg40.1%
distribute-frac-neg240.1%
distribute-neg-in40.1%
fma-undefine40.1%
neg-sub040.1%
fma-undefine40.1%
associate-*r/37.9%
associate-*l/37.8%
Applied egg-rr38.0%
Taylor expanded in x around inf 37.0%
Final simplification43.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1.7e-37)
(* x (/ (+ z -1.0) y_m))
(if (<= x 1460000.0)
(/ (- 4.0 (* x z)) y_m)
(if (<= x 1.32e+154) (/ (* x (- 1.0 z)) y_m) (/ (+ x 4.0) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 1460000.0) {
tmp = (4.0 - (x * z)) / y_m;
} else if (x <= 1.32e+154) {
tmp = (x * (1.0 - z)) / y_m;
} else {
tmp = (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 (x <= (-1.7d-37)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if (x <= 1460000.0d0) then
tmp = (4.0d0 - (x * z)) / y_m
else if (x <= 1.32d+154) then
tmp = (x * (1.0d0 - z)) / y_m
else
tmp = (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 (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 1460000.0) {
tmp = (4.0 - (x * z)) / y_m;
} else if (x <= 1.32e+154) {
tmp = (x * (1.0 - z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * ((z + -1.0) / y_m) elif x <= 1460000.0: tmp = (4.0 - (x * z)) / y_m elif x <= 1.32e+154: tmp = (x * (1.0 - z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif (x <= 1460000.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); elseif (x <= 1.32e+154) tmp = Float64(Float64(x * Float64(1.0 - z)) / y_m); else tmp = 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 (x <= -1.7e-37) tmp = x * ((z + -1.0) / y_m); elseif (x <= 1460000.0) tmp = (4.0 - (x * z)) / y_m; elseif (x <= 1.32e+154) tmp = (x * (1.0 - z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1460000.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 1.32e+154], N[(N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 1460000:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \left(1 - z\right)}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
associate-*r/51.3%
sub-div54.4%
Applied egg-rr54.4%
Taylor expanded in x around inf 53.8%
associate-/l*58.1%
sub-neg58.1%
metadata-eval58.1%
Simplified58.1%
if -1.70000000000000009e-37 < x < 1.46e6Initial program 96.1%
add-sqr-sqrt45.0%
fabs-sqr45.0%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/48.6%
associate-*r/44.7%
frac-2neg44.7%
+-commutative44.7%
distribute-neg-in44.7%
metadata-eval44.7%
sub-neg44.7%
distribute-frac-neg244.7%
distribute-neg-in44.7%
fma-undefine44.7%
neg-sub044.7%
fma-undefine44.7%
associate-*r/48.6%
associate-*l/46.4%
Applied egg-rr48.6%
Taylor expanded in x around 0 48.4%
if 1.46e6 < x < 1.31999999999999998e154Initial program 96.8%
add-sqr-sqrt38.1%
fabs-sqr38.1%
add-sqr-sqrt38.8%
sub-neg38.8%
+-commutative38.8%
associate-*l/39.0%
associate-*r/41.7%
frac-2neg41.7%
+-commutative41.7%
distribute-neg-in41.7%
metadata-eval41.7%
sub-neg41.7%
distribute-frac-neg241.7%
distribute-neg-in41.7%
fma-undefine41.7%
neg-sub041.7%
fma-undefine41.7%
associate-*r/39.0%
associate-*l/38.8%
Applied egg-rr39.0%
Taylor expanded in x around inf 38.4%
if 1.31999999999999998e154 < x Initial program 75.7%
fabs-sub75.7%
associate-*l/75.9%
associate-*r/81.8%
fmm-def93.9%
distribute-neg-frac93.9%
+-commutative93.9%
distribute-neg-in93.9%
unsub-neg93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in z around 0 73.9%
associate-*r/73.9%
distribute-lft-in73.9%
metadata-eval73.9%
neg-mul-173.9%
sub-neg73.9%
Simplified73.9%
add-sqr-sqrt73.6%
sqrt-unprod74.7%
neg-fabs74.7%
neg-fabs74.7%
sqr-abs74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
sqrt-unprod38.0%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
Final simplification48.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)))
(if (<= x -1.7e-37)
(- (* x (/ z y_m)) t_0)
(if (<= x 980.0) (/ (- 4.0 (* x z)) y_m) (+ t_0 (/ x (/ y_m z)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double tmp;
if (x <= -1.7e-37) {
tmp = (x * (z / y_m)) - t_0;
} else if (x <= 980.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
if (x <= (-1.7d-37)) then
tmp = (x * (z / y_m)) - t_0
else if (x <= 980.0d0) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = t_0 + (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 t_0 = (x + 4.0) / y_m;
double tmp;
if (x <= -1.7e-37) {
tmp = (x * (z / y_m)) - t_0;
} else if (x <= 980.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = t_0 + (x / (y_m / z));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m tmp = 0 if x <= -1.7e-37: tmp = (x * (z / y_m)) - t_0 elif x <= 980.0: tmp = (4.0 - (x * z)) / y_m else: tmp = t_0 + (x / (y_m / z)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (x <= 980.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(t_0 + Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; tmp = 0.0; if (x <= -1.7e-37) tmp = (x * (z / y_m)) - t_0; elseif (x <= 980.0) tmp = (4.0 - (x * z)) / y_m; else tmp = t_0 + (x / (y_m / z)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[x, -1.7e-37], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 980.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(t$95$0 + N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;x \leq 980:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{x}{\frac{y\_m}{z}}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
if -1.70000000000000009e-37 < x < 980Initial program 96.1%
add-sqr-sqrt44.9%
fabs-sqr44.9%
add-sqr-sqrt46.3%
sub-neg46.3%
+-commutative46.3%
associate-*l/48.6%
associate-*r/44.6%
frac-2neg44.6%
+-commutative44.6%
distribute-neg-in44.6%
metadata-eval44.6%
sub-neg44.6%
distribute-frac-neg244.6%
distribute-neg-in44.6%
fma-undefine44.6%
neg-sub044.6%
fma-undefine44.6%
associate-*r/48.6%
associate-*l/46.3%
Applied egg-rr48.6%
Taylor expanded in x around 0 48.4%
if 980 < x Initial program 86.8%
add-sqr-sqrt31.7%
fabs-sqr31.7%
add-sqr-sqrt32.3%
associate-*l/32.5%
associate-*r/35.2%
Applied egg-rr35.2%
add-sqr-sqrt13.3%
sqrt-unprod32.5%
sqr-neg32.5%
sqrt-unprod20.4%
add-sqr-sqrt56.3%
distribute-frac-neg56.3%
distribute-rgt-neg-in56.3%
distribute-lft-neg-in56.3%
clear-num56.3%
un-div-inv56.2%
Applied egg-rr56.2%
Final simplification52.3%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)))
(if (<= x -1.7e-37)
(- (* x (/ z y_m)) t_0)
(if (<= x 5.05e+157) (/ (- (+ x 4.0) (* x z)) y_m) t_0))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double tmp;
if (x <= -1.7e-37) {
tmp = (x * (z / y_m)) - t_0;
} else if (x <= 5.05e+157) {
tmp = ((x + 4.0) - (x * z)) / 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) :: tmp
t_0 = (x + 4.0d0) / y_m
if (x <= (-1.7d-37)) then
tmp = (x * (z / y_m)) - t_0
else if (x <= 5.05d+157) then
tmp = ((x + 4.0d0) - (x * z)) / 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 = (x + 4.0) / y_m;
double tmp;
if (x <= -1.7e-37) {
tmp = (x * (z / y_m)) - t_0;
} else if (x <= 5.05e+157) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m tmp = 0 if x <= -1.7e-37: tmp = (x * (z / y_m)) - t_0 elif x <= 5.05e+157: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (x <= 5.05e+157) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; tmp = 0.0; if (x <= -1.7e-37) tmp = (x * (z / y_m)) - t_0; elseif (x <= 5.05e+157) tmp = ((x + 4.0) - (x * z)) / 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[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[x, -1.7e-37], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 5.05e+157], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], t$95$0]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;x \leq 5.05 \cdot 10^{+157}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
if -1.70000000000000009e-37 < x < 5.04999999999999988e157Initial program 96.3%
add-sqr-sqrt43.5%
fabs-sqr43.5%
add-sqr-sqrt44.7%
sub-neg44.7%
+-commutative44.7%
associate-*l/46.5%
associate-*r/44.1%
frac-2neg44.1%
+-commutative44.1%
distribute-neg-in44.1%
metadata-eval44.1%
sub-neg44.1%
distribute-frac-neg244.1%
distribute-neg-in44.1%
fma-undefine44.1%
neg-sub044.1%
fma-undefine44.1%
associate-*r/46.5%
associate-*l/44.7%
Applied egg-rr46.6%
if 5.04999999999999988e157 < x Initial program 75.7%
fabs-sub75.7%
associate-*l/75.9%
associate-*r/81.8%
fmm-def93.9%
distribute-neg-frac93.9%
+-commutative93.9%
distribute-neg-in93.9%
unsub-neg93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in z around 0 73.9%
associate-*r/73.9%
distribute-lft-in73.9%
metadata-eval73.9%
neg-mul-173.9%
sub-neg73.9%
Simplified73.9%
add-sqr-sqrt73.6%
sqrt-unprod74.7%
neg-fabs74.7%
neg-fabs74.7%
sqr-abs74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
sqrt-unprod38.0%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
Final simplification47.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.7e-37) (* x (/ (+ z -1.0) y_m)) (if (<= x 8e+156) (/ (- (+ x 4.0) (* x z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 8e+156) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = (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 (x <= (-1.7d-37)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if (x <= 8d+156) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else
tmp = (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 (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 8e+156) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * ((z + -1.0) / y_m) elif x <= 8e+156: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif (x <= 8e+156) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = 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 (x <= -1.7e-37) tmp = x * ((z + -1.0) / y_m); elseif (x <= 8e+156) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+156], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+156}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
associate-*r/51.3%
sub-div54.4%
Applied egg-rr54.4%
Taylor expanded in x around inf 53.8%
associate-/l*58.1%
sub-neg58.1%
metadata-eval58.1%
Simplified58.1%
if -1.70000000000000009e-37 < x < 7.9999999999999999e156Initial program 96.3%
add-sqr-sqrt43.5%
fabs-sqr43.5%
add-sqr-sqrt44.7%
sub-neg44.7%
+-commutative44.7%
associate-*l/46.5%
associate-*r/44.1%
frac-2neg44.1%
+-commutative44.1%
distribute-neg-in44.1%
metadata-eval44.1%
sub-neg44.1%
distribute-frac-neg244.1%
distribute-neg-in44.1%
fma-undefine44.1%
neg-sub044.1%
fma-undefine44.1%
associate-*r/46.5%
associate-*l/44.7%
Applied egg-rr46.6%
if 7.9999999999999999e156 < x Initial program 75.7%
fabs-sub75.7%
associate-*l/75.9%
associate-*r/81.8%
fmm-def93.9%
distribute-neg-frac93.9%
+-commutative93.9%
distribute-neg-in93.9%
unsub-neg93.9%
metadata-eval93.9%
Simplified93.9%
Taylor expanded in z around 0 73.9%
associate-*r/73.9%
distribute-lft-in73.9%
metadata-eval73.9%
neg-mul-173.9%
sub-neg73.9%
Simplified73.9%
add-sqr-sqrt73.6%
sqrt-unprod74.7%
neg-fabs74.7%
neg-fabs74.7%
sqr-abs74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
distribute-frac-neg274.7%
sub-neg74.7%
metadata-eval74.7%
distribute-neg-in74.7%
+-commutative74.7%
frac-2neg74.7%
sqrt-unprod38.0%
add-sqr-sqrt38.4%
Applied egg-rr38.4%
Final simplification48.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.7e-37) (* x (/ z y_m)) (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * (z / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = 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 <= (-1.7d-37)) then
tmp = x * (z / y_m)
else if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = 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 <= -1.7e-37) {
tmp = x * (z / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * (z / y_m) elif x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(z / y_m)); elseif (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -1.7e-37) tmp = x * (z / y_m); elseif (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
add-sqr-sqrt36.7%
fabs-sqr36.7%
add-sqr-sqrt37.6%
associate-*l/39.2%
associate-*r/40.6%
Applied egg-rr40.6%
add-sqr-sqrt18.7%
sqrt-unprod41.1%
sqr-neg41.1%
sqrt-unprod25.3%
add-sqr-sqrt50.1%
distribute-frac-neg50.1%
distribute-rgt-neg-in50.1%
distribute-lft-neg-in50.1%
clear-num50.0%
un-div-inv50.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 25.7%
associate-*r/30.0%
Simplified30.0%
if -1.70000000000000009e-37 < x < 4Initial program 96.0%
add-sqr-sqrt44.4%
fabs-sqr44.4%
add-sqr-sqrt45.8%
associate-*l/48.1%
associate-*r/44.0%
Applied egg-rr44.0%
add-sqr-sqrt20.7%
sqrt-unprod38.3%
sqr-neg38.3%
sqrt-unprod22.5%
add-sqr-sqrt42.2%
distribute-frac-neg42.2%
distribute-rgt-neg-in42.2%
distribute-lft-neg-in42.2%
clear-num42.2%
un-div-inv42.6%
Applied egg-rr42.6%
Taylor expanded in x around 0 37.7%
if 4 < x Initial program 87.3%
fabs-sub87.3%
associate-*l/84.9%
associate-*r/91.5%
fmm-def97.1%
distribute-neg-frac97.1%
+-commutative97.1%
distribute-neg-in97.1%
unsub-neg97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in z around 0 58.6%
associate-*r/58.6%
distribute-lft-in58.6%
metadata-eval58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
add-sqr-sqrt58.3%
sqrt-unprod66.7%
neg-fabs66.7%
neg-fabs66.7%
sqr-abs66.7%
distribute-frac-neg266.7%
sub-neg66.7%
metadata-eval66.7%
distribute-neg-in66.7%
+-commutative66.7%
frac-2neg66.7%
distribute-frac-neg266.7%
sub-neg66.7%
metadata-eval66.7%
distribute-neg-in66.7%
+-commutative66.7%
frac-2neg66.7%
sqrt-unprod30.8%
add-sqr-sqrt31.4%
clear-num31.3%
Applied egg-rr31.3%
Taylor expanded in x around inf 31.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.7e-37) (* x (/ (+ z -1.0) y_m)) (/ (+ x 4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else {
tmp = (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 (x <= (-1.7d-37)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else
tmp = (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 (x <= -1.7e-37) {
tmp = x * ((z + -1.0) / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * ((z + -1.0) / y_m) else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); else tmp = 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 (x <= -1.7e-37) tmp = x * ((z + -1.0) / y_m); else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
fabs-sub89.2%
div-inv89.0%
cancel-sign-sub-inv89.0%
associate-*l/89.4%
associate-*r/95.1%
+-commutative95.1%
distribute-neg-in95.1%
metadata-eval95.1%
sub-neg95.1%
div-inv95.3%
fma-undefine96.8%
add-sqr-sqrt56.6%
fabs-sqr56.6%
add-sqr-sqrt57.2%
fma-undefine55.6%
associate-*r/51.3%
associate-*l/52.6%
div-inv52.5%
Applied egg-rr55.6%
associate-*r/51.3%
sub-div54.4%
Applied egg-rr54.4%
Taylor expanded in x around inf 53.8%
associate-/l*58.1%
sub-neg58.1%
metadata-eval58.1%
Simplified58.1%
if -1.70000000000000009e-37 < x Initial program 92.7%
fabs-sub92.7%
associate-*l/94.3%
associate-*r/91.4%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around 0 72.2%
associate-*r/72.2%
distribute-lft-in72.2%
metadata-eval72.2%
neg-mul-172.2%
sub-neg72.2%
Simplified72.2%
add-sqr-sqrt71.7%
sqrt-unprod54.8%
neg-fabs54.8%
neg-fabs54.8%
sqr-abs54.8%
distribute-frac-neg254.8%
sub-neg54.8%
metadata-eval54.8%
distribute-neg-in54.8%
+-commutative54.8%
frac-2neg54.8%
distribute-frac-neg254.8%
sub-neg54.8%
metadata-eval54.8%
distribute-neg-in54.8%
+-commutative54.8%
frac-2neg54.8%
sqrt-unprod34.2%
add-sqr-sqrt35.3%
Applied egg-rr35.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y_m) (/ (+ x 4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else {
tmp = (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 (x <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else
tmp = (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 (x <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = (-4.0 - x) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-4.0 - x) / y_m); else tmp = 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 (x <= -4.0) tmp = (-4.0 - x) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 88.3%
fabs-sub88.3%
div-inv88.1%
cancel-sign-sub-inv88.1%
associate-*l/88.5%
associate-*r/94.7%
+-commutative94.7%
distribute-neg-in94.7%
metadata-eval94.7%
sub-neg94.7%
div-inv94.9%
fma-undefine96.6%
add-sqr-sqrt58.0%
fabs-sqr58.0%
add-sqr-sqrt58.6%
fma-undefine56.9%
associate-*r/52.3%
associate-*l/53.6%
div-inv53.5%
Applied egg-rr56.9%
Taylor expanded in z around 0 36.4%
mul-1-neg36.4%
*-lft-identity36.4%
associate-*l/36.4%
*-commutative36.4%
distribute-rgt-in36.4%
+-commutative36.4%
associate-*l/36.5%
*-lft-identity36.5%
distribute-frac-neg36.5%
+-commutative36.5%
mul-1-neg36.5%
distribute-lft-in36.5%
metadata-eval36.5%
mul-1-neg36.5%
unsub-neg36.5%
Simplified36.5%
if -4 < x Initial program 92.9%
fabs-sub92.9%
associate-*l/94.4%
associate-*r/91.6%
fmm-def93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in z around 0 70.9%
associate-*r/70.9%
distribute-lft-in70.9%
metadata-eval70.9%
neg-mul-170.9%
sub-neg70.9%
Simplified70.9%
add-sqr-sqrt70.4%
sqrt-unprod54.5%
neg-fabs54.5%
neg-fabs54.5%
sqr-abs54.5%
distribute-frac-neg254.5%
sub-neg54.5%
metadata-eval54.5%
distribute-neg-in54.5%
+-commutative54.5%
frac-2neg54.5%
distribute-frac-neg254.5%
sub-neg54.5%
metadata-eval54.5%
distribute-neg-in54.5%
+-commutative54.5%
frac-2neg54.5%
sqrt-unprod33.9%
add-sqr-sqrt35.0%
Applied egg-rr35.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.7e-37) (* x (/ z y_m)) (/ (+ x 4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.7e-37) {
tmp = x * (z / y_m);
} else {
tmp = (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 (x <= (-1.7d-37)) then
tmp = x * (z / y_m)
else
tmp = (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 (x <= -1.7e-37) {
tmp = x * (z / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.7e-37: tmp = x * (z / y_m) else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.7e-37) tmp = Float64(x * Float64(z / y_m)); else tmp = 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 (x <= -1.7e-37) tmp = x * (z / y_m); else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.7e-37], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-37}:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.70000000000000009e-37Initial program 89.2%
add-sqr-sqrt36.7%
fabs-sqr36.7%
add-sqr-sqrt37.6%
associate-*l/39.2%
associate-*r/40.6%
Applied egg-rr40.6%
add-sqr-sqrt18.7%
sqrt-unprod41.1%
sqr-neg41.1%
sqrt-unprod25.3%
add-sqr-sqrt50.1%
distribute-frac-neg50.1%
distribute-rgt-neg-in50.1%
distribute-lft-neg-in50.1%
clear-num50.0%
un-div-inv50.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 25.7%
associate-*r/30.0%
Simplified30.0%
if -1.70000000000000009e-37 < x Initial program 92.7%
fabs-sub92.7%
associate-*l/94.3%
associate-*r/91.4%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
Taylor expanded in z around 0 72.2%
associate-*r/72.2%
distribute-lft-in72.2%
metadata-eval72.2%
neg-mul-172.2%
sub-neg72.2%
Simplified72.2%
add-sqr-sqrt71.7%
sqrt-unprod54.8%
neg-fabs54.8%
neg-fabs54.8%
sqr-abs54.8%
distribute-frac-neg254.8%
sub-neg54.8%
metadata-eval54.8%
distribute-neg-in54.8%
+-commutative54.8%
frac-2neg54.8%
distribute-frac-neg254.8%
sub-neg54.8%
metadata-eval54.8%
distribute-neg-in54.8%
+-commutative54.8%
frac-2neg54.8%
sqrt-unprod34.2%
add-sqr-sqrt35.3%
Applied egg-rr35.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = 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 <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = 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 <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < 4Initial program 93.6%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt42.9%
associate-*l/45.0%
associate-*r/42.8%
Applied egg-rr42.8%
add-sqr-sqrt20.0%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod23.5%
add-sqr-sqrt45.0%
distribute-frac-neg45.0%
distribute-rgt-neg-in45.0%
distribute-lft-neg-in45.0%
clear-num45.0%
un-div-inv45.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 26.2%
if 4 < x Initial program 87.3%
fabs-sub87.3%
associate-*l/84.9%
associate-*r/91.5%
fmm-def97.1%
distribute-neg-frac97.1%
+-commutative97.1%
distribute-neg-in97.1%
unsub-neg97.1%
metadata-eval97.1%
Simplified97.1%
Taylor expanded in z around 0 58.6%
associate-*r/58.6%
distribute-lft-in58.6%
metadata-eval58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
add-sqr-sqrt58.3%
sqrt-unprod66.7%
neg-fabs66.7%
neg-fabs66.7%
sqr-abs66.7%
distribute-frac-neg266.7%
sub-neg66.7%
metadata-eval66.7%
distribute-neg-in66.7%
+-commutative66.7%
frac-2neg66.7%
distribute-frac-neg266.7%
sub-neg66.7%
metadata-eval66.7%
distribute-neg-in66.7%
+-commutative66.7%
frac-2neg66.7%
sqrt-unprod30.8%
add-sqr-sqrt31.4%
clear-num31.3%
Applied egg-rr31.3%
Taylor expanded in x around inf 31.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (/ 4.0 y_m))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return 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 = 4.0d0 / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return 4.0 / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z): return 4.0 / y_m
y_m = abs(y) function code(x, y_m, z) return Float64(4.0 / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = 4.0 / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[(4.0 / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{4}{y\_m}
\end{array}
Initial program 91.8%
add-sqr-sqrt39.3%
fabs-sqr39.3%
add-sqr-sqrt40.3%
associate-*l/41.8%
associate-*r/41.1%
Applied egg-rr41.1%
add-sqr-sqrt18.4%
sqrt-unprod37.8%
sqr-neg37.8%
sqrt-unprod22.8%
add-sqr-sqrt47.9%
distribute-frac-neg47.9%
distribute-rgt-neg-in47.9%
distribute-lft-neg-in47.9%
clear-num47.9%
un-div-inv48.1%
Applied egg-rr48.1%
Taylor expanded in x around 0 19.8%
herbie shell --seed 2024139
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))