
(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 16 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 8.2e-167) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (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 <= 8.2e-167) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} 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 <= 8.2e-167) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); 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, 8.2e-167], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 8.2 \cdot 10^{-167}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 8.20000000000000036e-167Initial program 92.3%
Simplified97.5%
if 8.20000000000000036e-167 < y Initial program 95.2%
fabs-sub95.2%
associate-*l/90.4%
associate-*r/98.9%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 9.8e-50) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (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 <= 9.8e-50) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = 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 <= 9.8e-50) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x / Float64(y_m / z)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 9.8e-50], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 9.8 \cdot 10^{-50}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 9.7999999999999997e-50Initial program 92.7%
Simplified97.7%
if 9.7999999999999997e-50 < y Initial program 95.1%
associate-*l/88.9%
associate-*r/99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))) (if (<= t_0 INFINITY) (fabs t_0) (fabs (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = fabs(t_0);
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)) tmp = 0 if t_0 <= math.inf: tmp = math.fabs(t_0) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= Inf) tmp = abs(t_0); 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) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= Inf) tmp = abs(t_0); 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_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[Abs[t$95$0], $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}
t_0 := \frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.4%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
fabs-sub0.0%
associate-*l/46.2%
associate-*r/46.2%
fmm-def92.3%
distribute-neg-frac92.3%
+-commutative92.3%
distribute-neg-in92.3%
unsub-neg92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification98.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))))
(if (<= z -1.75e+66)
t_0
(if (<= z 2.7e-7)
(fabs (/ (- -4.0 x) y_m))
(if (<= z 1.66e+263) (/ (- (+ 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 = fabs((z * (x / y_m)));
double tmp;
if (z <= -1.75e+66) {
tmp = t_0;
} else if (z <= 2.7e-7) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (z <= 1.66e+263) {
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 = abs((z * (x / y_m)))
if (z <= (-1.75d+66)) then
tmp = t_0
else if (z <= 2.7d-7) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (z <= 1.66d+263) 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 = Math.abs((z * (x / y_m)));
double tmp;
if (z <= -1.75e+66) {
tmp = t_0;
} else if (z <= 2.7e-7) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (z <= 1.66e+263) {
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 = math.fabs((z * (x / y_m))) tmp = 0 if z <= -1.75e+66: tmp = t_0 elif z <= 2.7e-7: tmp = math.fabs(((-4.0 - x) / y_m)) elif z <= 1.66e+263: 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 = abs(Float64(z * Float64(x / y_m))) tmp = 0.0 if (z <= -1.75e+66) tmp = t_0; elseif (z <= 2.7e-7) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (z <= 1.66e+263) 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 = abs((z * (x / y_m))); tmp = 0.0; if (z <= -1.75e+66) tmp = t_0; elseif (z <= 2.7e-7) tmp = abs(((-4.0 - x) / y_m)); elseif (z <= 1.66e+263) 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[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.75e+66], t$95$0, If[LessEqual[z, 2.7e-7], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.66e+263], 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 := \left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+66}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-7}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{+263}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.7499999999999999e66 or 1.66e263 < z Initial program 95.3%
Simplified87.7%
Taylor expanded in z around inf 72.9%
mul-1-neg72.9%
distribute-frac-neg272.9%
*-commutative72.9%
associate-*r/82.0%
Simplified82.0%
if -1.7499999999999999e66 < z < 2.70000000000000009e-7Initial program 93.4%
fabs-sub93.4%
associate-*l/96.8%
associate-*r/97.3%
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 96.4%
associate-*r/96.4%
distribute-lft-in96.4%
metadata-eval96.4%
neg-mul-196.4%
sub-neg96.4%
Simplified96.4%
if 2.70000000000000009e-7 < z < 1.66e263Initial program 90.7%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt48.8%
sub-neg48.8%
+-commutative48.8%
associate-*l/44.1%
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/44.1%
associate-*l/48.8%
Applied egg-rr48.9%
Final simplification85.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -80000000.0) (not (<= z 5.2e-5))) (fabs (- (/ 4.0 y_m) (* 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 <= -80000000.0) || !(z <= 5.2e-5)) {
tmp = fabs(((4.0 / y_m) - (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 <= (-80000000.0d0)) .or. (.not. (z <= 5.2d-5))) then
tmp = abs(((4.0d0 / y_m) - (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 <= -80000000.0) || !(z <= 5.2e-5)) {
tmp = Math.abs(((4.0 / y_m) - (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 <= -80000000.0) or not (z <= 5.2e-5): tmp = math.fabs(((4.0 / y_m) - (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 <= -80000000.0) || !(z <= 5.2e-5)) tmp = abs(Float64(Float64(4.0 / y_m) - 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 <= -80000000.0) || ~((z <= 5.2e-5))) tmp = abs(((4.0 / y_m) - (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, -80000000.0], N[Not[LessEqual[z, 5.2e-5]], $MachinePrecision]], N[Abs[N[(N[(4.0 / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $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 -80000000 \lor \neg \left(z \leq 5.2 \cdot 10^{-5}\right):\\
\;\;\;\;\left|\frac{4}{y\_m} - z \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -8e7 or 5.19999999999999968e-5 < z Initial program 94.2%
Taylor expanded in x around 0 96.0%
if -8e7 < z < 5.19999999999999968e-5Initial program 92.8%
fabs-sub92.8%
associate-*l/97.1%
associate-*r/97.1%
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 99.7%
associate-*r/99.7%
distribute-lft-in99.7%
metadata-eval99.7%
neg-mul-199.7%
sub-neg99.7%
Simplified99.7%
Final simplification98.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -5.8e-46) (not (<= x 660000000.0))) (fabs (* (/ x y_m) (- 1.0 z))) (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -5.8e-46) || !(x <= 660000000.0)) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else {
tmp = ((x + 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 <= (-5.8d-46)) .or. (.not. (x <= 660000000.0d0))) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else
tmp = ((x + 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 <= -5.8e-46) || !(x <= 660000000.0)) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -5.8e-46) or not (x <= 660000000.0): tmp = math.fabs(((x / y_m) * (1.0 - z))) else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -5.8e-46) || !(x <= 660000000.0)) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); else tmp = Float64(Float64(Float64(x + 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 <= -5.8e-46) || ~((x <= 660000000.0))) tmp = abs(((x / y_m) * (1.0 - z))); else tmp = ((x + 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, -5.8e-46], N[Not[LessEqual[x, 660000000.0]], $MachinePrecision]], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-46} \lor \neg \left(x \leq 660000000\right):\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -5.80000000000000009e-46 or 6.6e8 < x Initial program 90.2%
Simplified90.8%
Taylor expanded in x around inf 87.5%
mul-1-neg87.5%
associate-/l*96.3%
distribute-rgt-neg-in96.3%
mul-1-neg96.3%
associate-*r/96.3%
sub-neg96.3%
metadata-eval96.3%
distribute-lft-in96.3%
neg-mul-196.3%
metadata-eval96.3%
+-commutative96.3%
neg-mul-196.3%
associate-/l*87.5%
*-commutative87.5%
associate-/l*96.4%
neg-mul-196.4%
unsub-neg96.4%
Simplified96.4%
if -5.80000000000000009e-46 < x < 6.6e8Initial program 97.0%
add-sqr-sqrt47.0%
fabs-sqr47.0%
add-sqr-sqrt48.4%
sub-neg48.4%
+-commutative48.4%
associate-*l/50.5%
associate-*r/47.5%
frac-2neg47.5%
+-commutative47.5%
distribute-neg-in47.5%
metadata-eval47.5%
sub-neg47.5%
distribute-frac-neg247.5%
distribute-neg-in47.5%
fma-undefine47.5%
neg-sub047.5%
fma-undefine47.5%
associate-*r/50.5%
associate-*l/48.4%
Applied egg-rr50.5%
Final simplification74.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.15e-45) (/ (- (* x z) (+ x 4.0)) y_m) (if (<= x 4.2) (/ (- 4.0 (* x z)) 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.15e-45) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 4.2) {
tmp = (4.0 - (x * z)) / 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.15d-45)) then
tmp = ((x * z) - (x + 4.0d0)) / y_m
else if (x <= 4.2d0) then
tmp = (4.0d0 - (x * z)) / 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.15e-45) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 4.2) {
tmp = (4.0 - (x * z)) / 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.15e-45: tmp = ((x * z) - (x + 4.0)) / y_m elif x <= 4.2: tmp = (4.0 - (x * z)) / 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.15e-45) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); elseif (x <= 4.2) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(x * Float64(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.15e-45) tmp = ((x * z) - (x + 4.0)) / y_m; elseif (x <= 4.2) tmp = (4.0 - (x * z)) / 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.15e-45], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4.2], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-45}:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{elif}\;x \leq 4.2:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45Initial program 90.3%
associate-*l/88.2%
associate-*r/95.8%
clear-num95.8%
un-div-inv95.8%
Applied egg-rr95.8%
fabs-sub95.8%
div-inv95.8%
clear-num95.8%
associate-*r/88.2%
div-sub92.4%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt48.7%
div-sub48.7%
associate-*r/53.7%
clear-num53.7%
div-inv53.7%
associate-/r/51.0%
Applied egg-rr51.0%
associate-*l/48.7%
sub-div48.7%
Applied egg-rr48.7%
if -1.14999999999999996e-45 < x < 4.20000000000000018Initial program 97.0%
add-sqr-sqrt47.0%
fabs-sqr47.0%
add-sqr-sqrt48.4%
sub-neg48.4%
+-commutative48.4%
associate-*l/50.5%
associate-*r/47.5%
frac-2neg47.5%
+-commutative47.5%
distribute-neg-in47.5%
metadata-eval47.5%
sub-neg47.5%
distribute-frac-neg247.5%
distribute-neg-in47.5%
fma-undefine47.5%
neg-sub047.5%
fma-undefine47.5%
associate-*r/50.5%
associate-*l/48.4%
Applied egg-rr50.5%
Taylor expanded in x around 0 50.5%
Taylor expanded in y around 0 50.5%
if 4.20000000000000018 < x Initial program 90.1%
add-sqr-sqrt38.4%
fabs-sqr38.4%
add-sqr-sqrt39.1%
sub-neg39.1%
+-commutative39.1%
associate-*l/36.2%
associate-*r/40.7%
frac-2neg40.7%
+-commutative40.7%
distribute-neg-in40.7%
metadata-eval40.7%
sub-neg40.7%
distribute-frac-neg240.7%
distribute-neg-in40.7%
fma-undefine42.4%
neg-sub042.4%
fma-undefine40.7%
associate-*r/36.2%
associate-*l/39.1%
Applied egg-rr37.8%
Taylor expanded in x around 0 42.3%
sub-neg42.3%
distribute-neg-frac42.3%
metadata-eval42.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
Taylor expanded in x around inf 42.3%
sub-neg42.3%
+-commutative42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
distribute-neg-in42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
sub-neg42.3%
div-sub42.3%
distribute-neg-frac242.3%
sub-neg42.3%
metadata-eval42.3%
Simplified42.3%
Final simplification48.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.15e-45) (- (* z (/ x y_m)) (/ x y_m)) (if (<= x 4.0) (/ (- 4.0 (* x z)) 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.15e-45) {
tmp = (z * (x / y_m)) - (x / y_m);
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / 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.15d-45)) then
tmp = (z * (x / y_m)) - (x / y_m)
else if (x <= 4.0d0) then
tmp = (4.0d0 - (x * z)) / 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.15e-45) {
tmp = (z * (x / y_m)) - (x / y_m);
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / 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.15e-45: tmp = (z * (x / y_m)) - (x / y_m) elif x <= 4.0: tmp = (4.0 - (x * z)) / 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.15e-45) tmp = Float64(Float64(z * Float64(x / y_m)) - Float64(x / y_m)); elseif (x <= 4.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(x * Float64(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.15e-45) tmp = (z * (x / y_m)) - (x / y_m); elseif (x <= 4.0) tmp = (4.0 - (x * z)) / 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.15e-45], N[(N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision] - N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-45}:\\
\;\;\;\;z \cdot \frac{x}{y\_m} - \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45Initial program 90.3%
associate-*l/88.2%
associate-*r/95.8%
clear-num95.8%
un-div-inv95.8%
Applied egg-rr95.8%
fabs-sub95.8%
div-inv95.8%
clear-num95.8%
associate-*r/88.2%
div-sub92.4%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt48.7%
div-sub48.7%
associate-*r/53.7%
clear-num53.7%
div-inv53.7%
associate-/r/51.0%
Applied egg-rr51.0%
Taylor expanded in x around inf 48.6%
if -1.14999999999999996e-45 < x < 4Initial program 97.0%
add-sqr-sqrt47.0%
fabs-sqr47.0%
add-sqr-sqrt48.4%
sub-neg48.4%
+-commutative48.4%
associate-*l/50.5%
associate-*r/47.5%
frac-2neg47.5%
+-commutative47.5%
distribute-neg-in47.5%
metadata-eval47.5%
sub-neg47.5%
distribute-frac-neg247.5%
distribute-neg-in47.5%
fma-undefine47.5%
neg-sub047.5%
fma-undefine47.5%
associate-*r/50.5%
associate-*l/48.4%
Applied egg-rr50.5%
Taylor expanded in x around 0 50.5%
Taylor expanded in y around 0 50.5%
if 4 < x Initial program 90.1%
add-sqr-sqrt38.4%
fabs-sqr38.4%
add-sqr-sqrt39.1%
sub-neg39.1%
+-commutative39.1%
associate-*l/36.2%
associate-*r/40.7%
frac-2neg40.7%
+-commutative40.7%
distribute-neg-in40.7%
metadata-eval40.7%
sub-neg40.7%
distribute-frac-neg240.7%
distribute-neg-in40.7%
fma-undefine42.4%
neg-sub042.4%
fma-undefine40.7%
associate-*r/36.2%
associate-*l/39.1%
Applied egg-rr37.8%
Taylor expanded in x around 0 42.3%
sub-neg42.3%
distribute-neg-frac42.3%
metadata-eval42.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
Taylor expanded in x around inf 42.3%
sub-neg42.3%
+-commutative42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
distribute-neg-in42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
sub-neg42.3%
div-sub42.3%
distribute-neg-frac242.3%
sub-neg42.3%
metadata-eval42.3%
Simplified42.3%
Final simplification48.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y_m) (if (<= x 4.4) (/ (- 4.0 (* x z)) 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 <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 4.4) {
tmp = (4.0 - (x * z)) / 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 <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 4.4d0) then
tmp = (4.0d0 - (x * z)) / 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 <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 4.4) {
tmp = (4.0 - (x * z)) / 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 <= -4.0: tmp = (-4.0 - x) / y_m elif x <= 4.4: tmp = (4.0 - (x * z)) / 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 <= -4.0) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 4.4) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(x * Float64(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 <= -4.0) tmp = (-4.0 - x) / y_m; elseif (x <= 4.4) tmp = (4.0 - (x * z)) / 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, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4.4], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 4.4:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 89.5%
fabs-sub89.5%
associate-*l/87.2%
associate-*r/95.5%
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 72.6%
associate-*r/72.6%
distribute-lft-in72.6%
metadata-eval72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
add-sqr-sqrt43.3%
fabs-sqr43.3%
add-sqr-sqrt43.8%
div-inv43.6%
Applied egg-rr43.6%
Taylor expanded in y around 0 43.8%
associate-*r/43.8%
distribute-lft-in43.8%
metadata-eval43.8%
mul-1-neg43.8%
unsub-neg43.8%
Simplified43.8%
if -4 < x < 4.4000000000000004Initial program 97.1%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt50.0%
sub-neg50.0%
+-commutative50.0%
associate-*l/52.1%
associate-*r/49.2%
frac-2neg49.2%
+-commutative49.2%
distribute-neg-in49.2%
metadata-eval49.2%
sub-neg49.2%
distribute-frac-neg249.2%
distribute-neg-in49.2%
fma-undefine49.2%
neg-sub049.2%
fma-undefine49.2%
associate-*r/52.1%
associate-*l/50.0%
Applied egg-rr52.1%
Taylor expanded in x around 0 51.6%
Taylor expanded in y around 0 51.6%
if 4.4000000000000004 < x Initial program 90.1%
add-sqr-sqrt38.4%
fabs-sqr38.4%
add-sqr-sqrt39.1%
sub-neg39.1%
+-commutative39.1%
associate-*l/36.2%
associate-*r/40.7%
frac-2neg40.7%
+-commutative40.7%
distribute-neg-in40.7%
metadata-eval40.7%
sub-neg40.7%
distribute-frac-neg240.7%
distribute-neg-in40.7%
fma-undefine42.4%
neg-sub042.4%
fma-undefine40.7%
associate-*r/36.2%
associate-*l/39.1%
Applied egg-rr37.8%
Taylor expanded in x around 0 42.3%
sub-neg42.3%
distribute-neg-frac42.3%
metadata-eval42.3%
associate-*r/42.3%
metadata-eval42.3%
Simplified42.3%
Taylor expanded in x around inf 42.3%
sub-neg42.3%
+-commutative42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
distribute-neg-in42.3%
metadata-eval42.3%
distribute-neg-frac42.3%
sub-neg42.3%
div-sub42.3%
distribute-neg-frac242.3%
sub-neg42.3%
metadata-eval42.3%
Simplified42.3%
Final simplification47.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y_m) (if (<= x 3.85e-25) (/ (- 4.0 (* x z)) y_m) (+ (/ x y_m) (/ 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 if (x <= 3.85e-25) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x / y_m) + (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 if (x <= 3.85d-25) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x / y_m) + (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 if (x <= 3.85e-25) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x / y_m) + (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 elif x <= 3.85e-25: tmp = (4.0 - (x * z)) / y_m else: tmp = (x / y_m) + (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); elseif (x <= 3.85e-25) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x / y_m) + 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 <= -4.0) tmp = (-4.0 - x) / y_m; elseif (x <= 3.85e-25) tmp = (4.0 - (x * z)) / y_m; else tmp = (x / y_m) + (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], If[LessEqual[x, 3.85e-25], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x / y$95$m), $MachinePrecision] + N[(4.0 / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 3.85 \cdot 10^{-25}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} + \frac{4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 89.5%
fabs-sub89.5%
associate-*l/87.2%
associate-*r/95.5%
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 72.6%
associate-*r/72.6%
distribute-lft-in72.6%
metadata-eval72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
add-sqr-sqrt43.3%
fabs-sqr43.3%
add-sqr-sqrt43.8%
div-inv43.6%
Applied egg-rr43.6%
Taylor expanded in y around 0 43.8%
associate-*r/43.8%
distribute-lft-in43.8%
metadata-eval43.8%
mul-1-neg43.8%
unsub-neg43.8%
Simplified43.8%
if -4 < x < 3.8500000000000001e-25Initial program 97.1%
add-sqr-sqrt49.5%
fabs-sqr49.5%
add-sqr-sqrt50.8%
sub-neg50.8%
+-commutative50.8%
associate-*l/52.9%
associate-*r/50.0%
frac-2neg50.0%
+-commutative50.0%
distribute-neg-in50.0%
metadata-eval50.0%
sub-neg50.0%
distribute-frac-neg250.0%
distribute-neg-in50.0%
fma-undefine50.0%
neg-sub050.0%
fma-undefine50.0%
associate-*r/52.9%
associate-*l/50.8%
Applied egg-rr52.9%
Taylor expanded in x around 0 52.4%
Taylor expanded in y around 0 52.4%
if 3.8500000000000001e-25 < x Initial program 90.7%
add-sqr-sqrt37.6%
fabs-sqr37.6%
add-sqr-sqrt38.3%
associate-*l/35.6%
associate-*r/39.9%
Applied egg-rr39.9%
clear-num39.8%
div-inv39.8%
frac-2neg39.8%
frac-2neg39.8%
distribute-neg-frac239.8%
distribute-frac-neg39.8%
frac-2neg39.8%
Applied egg-rr39.8%
Taylor expanded in z around 0 25.7%
associate-*r/25.7%
metadata-eval25.7%
Simplified25.7%
Final simplification43.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.15e-45) (- (* x (/ z y_m)) (/ (+ x 4.0) y_m)) (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.15e-45) {
tmp = (x * (z / y_m)) - ((x + 4.0) / y_m);
} else {
tmp = ((x + 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.15d-45)) then
tmp = (x * (z / y_m)) - ((x + 4.0d0) / y_m)
else
tmp = ((x + 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.15e-45) {
tmp = (x * (z / y_m)) - ((x + 4.0) / y_m);
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.15e-45: tmp = (x * (z / y_m)) - ((x + 4.0) / y_m) else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.15e-45) tmp = Float64(Float64(x * Float64(z / y_m)) - Float64(Float64(x + 4.0) / y_m)); else tmp = Float64(Float64(Float64(x + 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.15e-45) tmp = (x * (z / y_m)) - ((x + 4.0) / y_m); else tmp = ((x + 4.0) - (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.15e-45], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - 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.15 \cdot 10^{-45}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - \frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45Initial program 90.3%
fabs-sub90.3%
div-inv90.1%
cancel-sign-sub-inv90.1%
associate-*l/88.0%
associate-*r/95.6%
+-commutative95.6%
distribute-neg-in95.6%
metadata-eval95.6%
sub-neg95.6%
div-inv95.8%
fma-undefine100.0%
add-sqr-sqrt55.8%
fabs-sqr55.8%
add-sqr-sqrt56.5%
fma-undefine53.7%
associate-*r/48.7%
associate-*l/51.0%
div-inv50.8%
Applied egg-rr53.7%
if -1.14999999999999996e-45 < x Initial program 94.7%
add-sqr-sqrt44.1%
fabs-sqr44.1%
add-sqr-sqrt45.2%
sub-neg45.2%
+-commutative45.2%
associate-*l/45.6%
associate-*r/45.2%
frac-2neg45.2%
+-commutative45.2%
distribute-neg-in45.2%
metadata-eval45.2%
sub-neg45.2%
distribute-frac-neg245.2%
distribute-neg-in45.2%
fma-undefine45.8%
neg-sub045.8%
fma-undefine45.2%
associate-*r/45.6%
associate-*l/45.2%
Applied egg-rr46.2%
Final simplification48.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.15e-45) (/ (- (* x z) (+ x 4.0)) y_m) (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.15e-45) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else {
tmp = ((x + 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.15d-45)) then
tmp = ((x * z) - (x + 4.0d0)) / y_m
else
tmp = ((x + 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.15e-45) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.15e-45: tmp = ((x * z) - (x + 4.0)) / y_m else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.15e-45) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); else tmp = Float64(Float64(Float64(x + 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.15e-45) tmp = ((x * z) - (x + 4.0)) / y_m; else tmp = ((x + 4.0) - (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.15e-45], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - 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.15 \cdot 10^{-45}:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45Initial program 90.3%
associate-*l/88.2%
associate-*r/95.8%
clear-num95.8%
un-div-inv95.8%
Applied egg-rr95.8%
fabs-sub95.8%
div-inv95.8%
clear-num95.8%
associate-*r/88.2%
div-sub92.4%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt48.7%
div-sub48.7%
associate-*r/53.7%
clear-num53.7%
div-inv53.7%
associate-/r/51.0%
Applied egg-rr51.0%
associate-*l/48.7%
sub-div48.7%
Applied egg-rr48.7%
if -1.14999999999999996e-45 < x Initial program 94.7%
add-sqr-sqrt44.1%
fabs-sqr44.1%
add-sqr-sqrt45.2%
sub-neg45.2%
+-commutative45.2%
associate-*l/45.6%
associate-*r/45.2%
frac-2neg45.2%
+-commutative45.2%
distribute-neg-in45.2%
metadata-eval45.2%
sub-neg45.2%
distribute-frac-neg245.2%
distribute-neg-in45.2%
fma-undefine45.8%
neg-sub045.8%
fma-undefine45.2%
associate-*r/45.6%
associate-*l/45.2%
Applied egg-rr46.2%
Final simplification46.9%
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 89.5%
fabs-sub89.5%
associate-*l/87.2%
associate-*r/95.5%
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 72.6%
associate-*r/72.6%
distribute-lft-in72.6%
metadata-eval72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
add-sqr-sqrt43.3%
fabs-sqr43.3%
add-sqr-sqrt43.8%
div-inv43.6%
Applied egg-rr43.6%
Taylor expanded in y around 0 43.8%
associate-*r/43.8%
distribute-lft-in43.8%
metadata-eval43.8%
mul-1-neg43.8%
unsub-neg43.8%
Simplified43.8%
if -4 < x Initial program 94.8%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/46.8%
associate-*r/46.4%
frac-2neg46.4%
+-commutative46.4%
distribute-neg-in46.4%
metadata-eval46.4%
sub-neg46.4%
distribute-frac-neg246.4%
distribute-neg-in46.4%
fma-undefine47.0%
neg-sub047.0%
fma-undefine46.4%
associate-*r/46.8%
associate-*l/46.4%
Applied egg-rr47.4%
Taylor expanded in x around 0 46.9%
sub-neg46.9%
distribute-neg-frac46.9%
metadata-eval46.9%
associate-*r/46.9%
metadata-eval46.9%
Simplified46.9%
Taylor expanded in z around 0 34.2%
sub-neg34.2%
associate-*r/34.2%
associate-*l/34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
distribute-neg-frac34.2%
metadata-eval34.2%
distribute-rgt-in34.2%
+-commutative34.2%
associate-*l/34.2%
*-lft-identity34.2%
Simplified34.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -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 = 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 = 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 = 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 = 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(x / Float64(-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 = 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[(x / (-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{x}{-y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 89.5%
fabs-sub89.5%
associate-*l/87.2%
associate-*r/95.5%
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 72.6%
associate-*r/72.6%
distribute-lft-in72.6%
metadata-eval72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
add-sqr-sqrt43.3%
fabs-sqr43.3%
add-sqr-sqrt43.8%
div-inv43.6%
Applied egg-rr43.6%
Taylor expanded in x around inf 42.4%
associate-*r/42.4%
mul-1-neg42.4%
Simplified42.4%
if -4 < x Initial program 94.8%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/46.8%
associate-*r/46.4%
frac-2neg46.4%
+-commutative46.4%
distribute-neg-in46.4%
metadata-eval46.4%
sub-neg46.4%
distribute-frac-neg246.4%
distribute-neg-in46.4%
fma-undefine47.0%
neg-sub047.0%
fma-undefine46.4%
associate-*r/46.8%
associate-*l/46.4%
Applied egg-rr47.4%
Taylor expanded in x around 0 46.9%
sub-neg46.9%
distribute-neg-frac46.9%
metadata-eval46.9%
associate-*r/46.9%
metadata-eval46.9%
Simplified46.9%
Taylor expanded in z around 0 34.2%
sub-neg34.2%
associate-*r/34.2%
associate-*l/34.2%
*-commutative34.2%
distribute-rgt-neg-in34.2%
distribute-neg-frac34.2%
metadata-eval34.2%
distribute-rgt-in34.2%
+-commutative34.2%
associate-*l/34.2%
*-lft-identity34.2%
Simplified34.2%
Final simplification36.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -10.5) (/ x (- y_m)) (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -10.5) {
tmp = x / -y_m;
} else {
tmp = 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)) then
tmp = x / -y_m
else
tmp = 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) {
tmp = x / -y_m;
} else {
tmp = 4.0 / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -10.5: tmp = x / -y_m else: tmp = 4.0 / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -10.5) tmp = Float64(x / Float64(-y_m)); else tmp = 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) tmp = x / -y_m; else tmp = 4.0 / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -10.5], N[(x / (-y$95$m)), $MachinePrecision], N[(4.0 / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{4}{y\_m}\\
\end{array}
\end{array}
if x < -10.5Initial program 89.5%
fabs-sub89.5%
associate-*l/87.2%
associate-*r/95.5%
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 72.6%
associate-*r/72.6%
distribute-lft-in72.6%
metadata-eval72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
add-sqr-sqrt43.3%
fabs-sqr43.3%
add-sqr-sqrt43.8%
div-inv43.6%
Applied egg-rr43.6%
Taylor expanded in x around inf 42.4%
associate-*r/42.4%
mul-1-neg42.4%
Simplified42.4%
if -10.5 < x Initial program 94.8%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/46.8%
associate-*r/46.4%
frac-2neg46.4%
+-commutative46.4%
distribute-neg-in46.4%
metadata-eval46.4%
sub-neg46.4%
distribute-frac-neg246.4%
distribute-neg-in46.4%
fma-undefine47.0%
neg-sub047.0%
fma-undefine46.4%
associate-*r/46.8%
associate-*l/46.4%
Applied egg-rr47.4%
Taylor expanded in x around 0 46.9%
sub-neg46.9%
distribute-neg-frac46.9%
metadata-eval46.9%
associate-*r/46.9%
metadata-eval46.9%
Simplified46.9%
Taylor expanded in x around 0 26.4%
Final simplification30.6%
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 93.4%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt43.7%
sub-neg43.7%
+-commutative43.7%
associate-*l/44.1%
associate-*r/44.5%
frac-2neg44.5%
+-commutative44.5%
distribute-neg-in44.5%
metadata-eval44.5%
sub-neg44.5%
distribute-frac-neg244.5%
distribute-neg-in44.5%
fma-undefine45.3%
neg-sub045.3%
fma-undefine44.5%
associate-*r/44.1%
associate-*l/43.7%
Applied egg-rr45.7%
Taylor expanded in x around 0 46.1%
sub-neg46.1%
distribute-neg-frac46.1%
metadata-eval46.1%
associate-*r/46.1%
metadata-eval46.1%
Simplified46.1%
Taylor expanded in x around 0 20.5%
herbie shell --seed 2024131
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))