
(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 1.05e-78) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1.05e-78) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 1.05d-78) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (x / (y_m / z))))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1.05e-78) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 1.05e-78: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1.05e-78) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x / Float64(y_m / z)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 1.05e-78) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1.05e-78], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 1.05 \cdot 10^{-78}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 1.05e-78Initial program 89.3%
associate-*l/91.7%
sub-div97.1%
Applied egg-rr97.1%
if 1.05e-78 < y Initial program 97.6%
associate-*l/95.7%
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 (if (or (<= x -4.0) (not (<= x 4e-15))) (fabs (* (/ x y_m) (- 1.0 z))) (/ 1.0 (/ y_m (+ x (+ 4.0 (* x z)))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -4.0) || !(x <= 4e-15)) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else {
tmp = 1.0 / (y_m / (x + (4.0 + (x * 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 <= (-4.0d0)) .or. (.not. (x <= 4d-15))) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else
tmp = 1.0d0 / (y_m / (x + (4.0d0 + (x * 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 <= -4.0) || !(x <= 4e-15)) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else {
tmp = 1.0 / (y_m / (x + (4.0 + (x * z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -4.0) or not (x <= 4e-15): tmp = math.fabs(((x / y_m) * (1.0 - z))) else: tmp = 1.0 / (y_m / (x + (4.0 + (x * z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -4.0) || !(x <= 4e-15)) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); else tmp = Float64(1.0 / Float64(y_m / Float64(x + Float64(4.0 + Float64(x * z))))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -4.0) || ~((x <= 4e-15))) tmp = abs(((x / y_m) * (1.0 - z))); else tmp = 1.0 / (y_m / (x + (4.0 + (x * z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -4.0], N[Not[LessEqual[x, 4e-15]], $MachinePrecision]], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(1.0 / N[(y$95$m / N[(x + N[(4.0 + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \lor \neg \left(x \leq 4 \cdot 10^{-15}\right):\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y\_m}{x + \left(4 + x \cdot z\right)}}\\
\end{array}
\end{array}
if x < -4 or 4.0000000000000003e-15 < x Initial program 88.2%
Simplified92.7%
Taylor expanded in x around inf 90.7%
mul-1-neg90.7%
associate-/l*97.6%
distribute-rgt-neg-in97.6%
mul-1-neg97.6%
associate-*r/97.6%
sub-neg97.6%
metadata-eval97.6%
distribute-lft-in97.6%
neg-mul-197.6%
metadata-eval97.6%
+-commutative97.6%
neg-mul-197.6%
associate-/l*90.7%
*-commutative90.7%
associate-/l*97.8%
neg-mul-197.8%
unsub-neg97.8%
Simplified97.8%
if -4 < x < 4.0000000000000003e-15Initial program 95.7%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
add-sqr-sqrt49.9%
fabs-sqr49.9%
add-sqr-sqrt51.3%
clear-num51.3%
*-commutative51.3%
cancel-sign-sub-inv51.3%
*-commutative51.3%
add-sqr-sqrt30.4%
sqrt-unprod43.1%
sqr-neg43.1%
sqrt-unprod21.1%
add-sqr-sqrt54.1%
associate-+l+54.1%
Applied egg-rr54.1%
Final simplification74.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -1.65e+97) (not (<= z 3.9e+15))) (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 <= -1.65e+97) || !(z <= 3.9e+15)) {
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 <= (-1.65d+97)) .or. (.not. (z <= 3.9d+15))) 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 <= -1.65e+97) || !(z <= 3.9e+15)) {
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 <= -1.65e+97) or not (z <= 3.9e+15): 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 <= -1.65e+97) || !(z <= 3.9e+15)) 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 <= -1.65e+97) || ~((z <= 3.9e+15))) 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, -1.65e+97], N[Not[LessEqual[z, 3.9e+15]], $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 -1.65 \cdot 10^{+97} \lor \neg \left(z \leq 3.9 \cdot 10^{+15}\right):\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -1.6500000000000001e97 or 3.9e15 < z Initial program 88.6%
Simplified91.0%
Taylor expanded in z around inf 74.4%
mul-1-neg74.4%
distribute-frac-neg274.4%
associate-*l/78.1%
*-commutative78.1%
Simplified78.1%
if -1.6500000000000001e97 < z < 3.9e15Initial program 94.3%
fabs-sub94.3%
associate-*l/97.5%
associate-*r/97.5%
fma-neg100.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.5%
associate-*r/96.5%
distribute-lft-in96.5%
metadata-eval96.5%
neg-mul-196.5%
sub-neg96.5%
Simplified96.5%
Final simplification89.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -1.65e+97) (fabs (* z (/ x y_m))) (if (<= z 1.9e+15) (fabs (/ (- -4.0 x) y_m)) (fabs (/ (* x z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.65e+97) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1.9e+15) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs(((x * z) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.65d+97)) then
tmp = abs((z * (x / y_m)))
else if (z <= 1.9d+15) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs(((x * z) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.65e+97) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1.9e+15) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs(((x * z) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.65e+97: tmp = math.fabs((z * (x / y_m))) elif z <= 1.9e+15: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs(((x * z) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.65e+97) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1.9e+15) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(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 (z <= -1.65e+97) tmp = abs((z * (x / y_m))); elseif (z <= 1.9e+15) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs(((x * z) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.65e+97], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.9e+15], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+97}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+15}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if z < -1.6500000000000001e97Initial program 92.6%
Simplified85.8%
Taylor expanded in z around inf 70.0%
mul-1-neg70.0%
distribute-frac-neg270.0%
associate-*l/77.7%
*-commutative77.7%
Simplified77.7%
if -1.6500000000000001e97 < z < 1.9e15Initial program 94.3%
fabs-sub94.3%
associate-*l/97.5%
associate-*r/97.5%
fma-neg100.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.5%
associate-*r/96.5%
distribute-lft-in96.5%
metadata-eval96.5%
neg-mul-196.5%
sub-neg96.5%
Simplified96.5%
if 1.9e15 < z Initial program 84.7%
Simplified96.0%
Taylor expanded in z around inf 78.7%
associate-*r/78.7%
neg-mul-178.7%
distribute-rgt-neg-in78.7%
Simplified78.7%
Final simplification89.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.55e+45) (fabs (* (/ x y_m) (- 1.0 z))) (fabs (/ (- (+ 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.55e+45) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else {
tmp = fabs((((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.55d+45)) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else
tmp = abs((((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.55e+45) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else {
tmp = Math.abs((((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.55e+45: tmp = math.fabs(((x / y_m) * (1.0 - z))) else: tmp = math.fabs((((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.55e+45) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); else tmp = abs(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.55e+45) tmp = abs(((x / y_m) * (1.0 - z))); else tmp = abs((((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.55e+45], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+45}:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.54999999999999994e45Initial program 80.7%
Simplified88.3%
Taylor expanded in x around inf 88.4%
mul-1-neg88.4%
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*88.4%
*-commutative88.4%
associate-/l*100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
if -1.54999999999999994e45 < x Initial program 95.5%
associate-*l/98.0%
sub-div99.0%
Applied egg-rr99.0%
Final simplification99.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -8.2e-8) (/ x (/ y_m (+ z -1.0))) (if (<= x 10.2) (/ (- (- -4.0) (* x z)) y_m) (/ x (/ y_m (+ z 1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.2e-8) {
tmp = x / (y_m / (z + -1.0));
} else if (x <= 10.2) {
tmp = (-(-4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.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) :: tmp
if (x <= (-8.2d-8)) then
tmp = x / (y_m / (z + (-1.0d0)))
else if (x <= 10.2d0) then
tmp = (-(-4.0d0) - (x * z)) / y_m
else
tmp = x / (y_m / (z + 1.0d0))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.2e-8) {
tmp = x / (y_m / (z + -1.0));
} else if (x <= 10.2) {
tmp = (-(-4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -8.2e-8: tmp = x / (y_m / (z + -1.0)) elif x <= 10.2: tmp = (-(-4.0) - (x * z)) / y_m else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -8.2e-8) tmp = Float64(x / Float64(y_m / Float64(z + -1.0))); elseif (x <= 10.2) tmp = Float64(Float64(Float64(-(-4.0)) - Float64(x * z)) / y_m); else tmp = Float64(x / Float64(y_m / Float64(z + 1.0))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -8.2e-8) tmp = x / (y_m / (z + -1.0)); elseif (x <= 10.2) tmp = (-(-4.0) - (x * z)) / y_m; else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -8.2e-8], N[(x / N[(y$95$m / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 10.2], N[(N[((--4.0) - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-8}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + -1}}\\
\mathbf{elif}\;x \leq 10.2:\\
\;\;\;\;\frac{\left(--4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -8.20000000000000063e-8Initial program 84.0%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.7%
sub-neg46.7%
+-commutative46.7%
associate-*l/48.4%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine59.7%
neg-sub059.7%
fma-undefine52.5%
associate-*r/48.4%
associate-*l/46.7%
Applied egg-rr55.6%
Taylor expanded in x around inf 51.7%
associate-/l*55.7%
sub-neg55.7%
metadata-eval55.7%
Simplified55.7%
add-sqr-sqrt0.4%
sqrt-unprod0.9%
sqr-neg0.9%
sub0-neg0.9%
sub0-neg0.9%
sqrt-unprod0.4%
add-sqr-sqrt40.4%
cancel-sign-sub-inv40.4%
+-lft-identity40.4%
clear-num40.4%
un-div-inv40.4%
Applied egg-rr40.4%
if -8.20000000000000063e-8 < x < 10.199999999999999Initial program 95.6%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
add-sqr-sqrt51.1%
fabs-sqr51.1%
add-sqr-sqrt52.4%
frac-2neg52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
distribute-neg-in52.4%
+-commutative52.4%
distribute-neg-in52.4%
metadata-eval52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
remove-double-neg52.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 52.1%
if 10.199999999999999 < x Initial program 94.0%
associate-*l/92.3%
sub-div96.2%
Applied egg-rr96.2%
add-sqr-sqrt54.9%
fabs-sqr54.9%
add-sqr-sqrt55.4%
frac-2neg55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
distribute-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
remove-double-neg55.4%
Applied egg-rr55.4%
Taylor expanded in x around inf 55.4%
associate-*r/55.4%
sub-neg55.4%
metadata-eval55.4%
neg-mul-155.4%
distribute-rgt-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
neg-mul-155.4%
associate-/l*59.0%
neg-mul-159.0%
sub-neg59.0%
Simplified59.0%
clear-num59.0%
un-div-inv59.1%
*-un-lft-identity59.1%
*-un-lft-identity59.1%
sub-neg59.1%
+-commutative59.1%
add-sqr-sqrt29.3%
sqrt-unprod53.4%
sqr-neg53.4%
sqrt-unprod31.4%
add-sqr-sqrt49.5%
Applied egg-rr49.5%
Final simplification48.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -8.2e-8) (* x (/ (+ z -1.0) y_m)) (if (<= x 23000.0) (/ (- (- -4.0) (* x z)) y_m) (/ x (/ y_m (+ z 1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.2e-8) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 23000.0) {
tmp = (-(-4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.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) :: tmp
if (x <= (-8.2d-8)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if (x <= 23000.0d0) then
tmp = (-(-4.0d0) - (x * z)) / y_m
else
tmp = x / (y_m / (z + 1.0d0))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.2e-8) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 23000.0) {
tmp = (-(-4.0) - (x * z)) / y_m;
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -8.2e-8: tmp = x * ((z + -1.0) / y_m) elif x <= 23000.0: tmp = (-(-4.0) - (x * z)) / y_m else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -8.2e-8) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif (x <= 23000.0) tmp = Float64(Float64(Float64(-(-4.0)) - Float64(x * z)) / y_m); else tmp = Float64(x / Float64(y_m / Float64(z + 1.0))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -8.2e-8) tmp = x * ((z + -1.0) / y_m); elseif (x <= 23000.0) tmp = (-(-4.0) - (x * z)) / y_m; else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -8.2e-8], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 23000.0], N[(N[((--4.0) - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 23000:\\
\;\;\;\;\frac{\left(--4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -8.20000000000000063e-8Initial program 84.0%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.7%
sub-neg46.7%
+-commutative46.7%
associate-*l/48.4%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine59.7%
neg-sub059.7%
fma-undefine52.5%
associate-*r/48.4%
associate-*l/46.7%
Applied egg-rr55.6%
Taylor expanded in x around inf 51.7%
associate-/l*55.7%
sub-neg55.7%
metadata-eval55.7%
Simplified55.7%
add-sqr-sqrt55.2%
sqrt-unprod69.0%
sub0-neg69.0%
sub0-neg69.0%
sqr-neg69.0%
sqrt-unprod39.8%
add-sqr-sqrt40.4%
*-commutative40.4%
Applied egg-rr40.4%
if -8.20000000000000063e-8 < x < 23000Initial program 95.6%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
add-sqr-sqrt51.1%
fabs-sqr51.1%
add-sqr-sqrt52.4%
frac-2neg52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
distribute-neg-in52.4%
+-commutative52.4%
distribute-neg-in52.4%
metadata-eval52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
remove-double-neg52.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 52.1%
if 23000 < x Initial program 94.0%
associate-*l/92.3%
sub-div96.2%
Applied egg-rr96.2%
add-sqr-sqrt54.9%
fabs-sqr54.9%
add-sqr-sqrt55.4%
frac-2neg55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
distribute-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
remove-double-neg55.4%
Applied egg-rr55.4%
Taylor expanded in x around inf 55.4%
associate-*r/55.4%
sub-neg55.4%
metadata-eval55.4%
neg-mul-155.4%
distribute-rgt-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
neg-mul-155.4%
associate-/l*59.0%
neg-mul-159.0%
sub-neg59.0%
Simplified59.0%
clear-num59.0%
un-div-inv59.1%
*-un-lft-identity59.1%
*-un-lft-identity59.1%
sub-neg59.1%
+-commutative59.1%
add-sqr-sqrt29.3%
sqrt-unprod53.4%
sqr-neg53.4%
sqrt-unprod31.4%
add-sqr-sqrt49.5%
Applied egg-rr49.5%
Final simplification48.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -2.0)
(* x (/ (+ z -1.0) y_m))
(if (<= x 620000000000.0)
(/ -1.0 (/ y_m (- -4.0 x)))
(/ x (/ y_m (+ z 1.0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.0) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 620000000000.0) {
tmp = -1.0 / (y_m / (-4.0 - x));
} else {
tmp = x / (y_m / (z + 1.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) :: tmp
if (x <= (-2.0d0)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if (x <= 620000000000.0d0) then
tmp = (-1.0d0) / (y_m / ((-4.0d0) - x))
else
tmp = x / (y_m / (z + 1.0d0))
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 <= -2.0) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 620000000000.0) {
tmp = -1.0 / (y_m / (-4.0 - x));
} else {
tmp = x / (y_m / (z + 1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.0: tmp = x * ((z + -1.0) / y_m) elif x <= 620000000000.0: tmp = -1.0 / (y_m / (-4.0 - x)) else: tmp = x / (y_m / (z + 1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.0) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif (x <= 620000000000.0) tmp = Float64(-1.0 / Float64(y_m / Float64(-4.0 - x))); else tmp = Float64(x / Float64(y_m / Float64(z + 1.0))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.0) tmp = x * ((z + -1.0) / y_m); elseif (x <= 620000000000.0) tmp = -1.0 / (y_m / (-4.0 - x)); else tmp = x / (y_m / (z + 1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.0], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 620000000000.0], N[(-1.0 / N[(y$95$m / N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y$95$m / N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 620000000000:\\
\;\;\;\;\frac{-1}{\frac{y\_m}{-4 - x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + 1}}\\
\end{array}
\end{array}
if x < -2Initial program 83.1%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/48.2%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine60.2%
neg-sub060.2%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/46.4%
Applied egg-rr55.9%
Taylor expanded in x around inf 54.7%
associate-/l*59.0%
sub-neg59.0%
metadata-eval59.0%
Simplified59.0%
add-sqr-sqrt58.5%
sqrt-unprod72.6%
sub0-neg72.6%
sub0-neg72.6%
sqr-neg72.6%
sqrt-unprod39.7%
add-sqr-sqrt40.3%
*-commutative40.3%
Applied egg-rr40.3%
if -2 < x < 6.2e11Initial program 95.8%
fabs-sub95.8%
associate-*l/99.9%
associate-*r/95.3%
fma-neg95.3%
distribute-neg-frac95.3%
+-commutative95.3%
distribute-neg-in95.3%
unsub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 76.7%
associate-*r/76.7%
distribute-lft-in76.7%
metadata-eval76.7%
neg-mul-176.7%
sub-neg76.7%
Simplified76.7%
add-sqr-sqrt76.1%
sqrt-unprod49.6%
neg-fabs49.6%
neg-fabs49.6%
sqr-abs49.6%
distribute-frac-neg249.6%
sub-neg49.6%
metadata-eval49.6%
distribute-neg-in49.6%
+-commutative49.6%
frac-2neg49.6%
distribute-frac-neg249.6%
sub-neg49.6%
metadata-eval49.6%
distribute-neg-in49.6%
+-commutative49.6%
frac-2neg49.6%
sqrt-unprod40.3%
Applied egg-rr41.7%
if 6.2e11 < x Initial program 94.0%
associate-*l/92.3%
sub-div96.2%
Applied egg-rr96.2%
add-sqr-sqrt54.9%
fabs-sqr54.9%
add-sqr-sqrt55.4%
frac-2neg55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
distribute-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
sub-neg55.4%
distribute-rgt-neg-out55.4%
remove-double-neg55.4%
Applied egg-rr55.4%
Taylor expanded in x around inf 55.4%
associate-*r/55.4%
sub-neg55.4%
metadata-eval55.4%
neg-mul-155.4%
distribute-rgt-neg-in55.4%
+-commutative55.4%
distribute-neg-in55.4%
metadata-eval55.4%
neg-mul-155.4%
associate-/l*59.0%
neg-mul-159.0%
sub-neg59.0%
Simplified59.0%
clear-num59.0%
un-div-inv59.1%
*-un-lft-identity59.1%
*-un-lft-identity59.1%
sub-neg59.1%
+-commutative59.1%
add-sqr-sqrt29.3%
sqrt-unprod53.4%
sqr-neg53.4%
sqrt-unprod31.4%
add-sqr-sqrt49.5%
Applied egg-rr49.5%
Final simplification42.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.8) (* x (/ (+ z -1.0) y_m)) (if (<= x 4e-15) (/ (+ 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 <= -2.8) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 4e-15) {
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 <= (-2.8d0)) then
tmp = x * ((z + (-1.0d0)) / y_m)
else if (x <= 4d-15) 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 <= -2.8) {
tmp = x * ((z + -1.0) / y_m);
} else if (x <= 4e-15) {
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 <= -2.8: tmp = x * ((z + -1.0) / y_m) elif x <= 4e-15: 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 <= -2.8) tmp = Float64(x * Float64(Float64(z + -1.0) / y_m)); elseif (x <= 4e-15) tmp = Float64(Float64(x + 4.0) / 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 <= -2.8) tmp = x * ((z + -1.0) / y_m); elseif (x <= 4e-15) 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, -2.8], N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-15], N[(N[(x + 4.0), $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 -2.8:\\
\;\;\;\;x \cdot \frac{z + -1}{y\_m}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-15}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -2.7999999999999998Initial program 83.1%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/48.2%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine60.2%
neg-sub060.2%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/46.4%
Applied egg-rr55.9%
Taylor expanded in x around inf 54.7%
associate-/l*59.0%
sub-neg59.0%
metadata-eval59.0%
Simplified59.0%
add-sqr-sqrt58.5%
sqrt-unprod72.6%
sub0-neg72.6%
sub0-neg72.6%
sqr-neg72.6%
sqrt-unprod39.7%
add-sqr-sqrt40.3%
*-commutative40.3%
Applied egg-rr40.3%
if -2.7999999999999998 < x < 4.0000000000000003e-15Initial program 95.6%
fabs-sub95.6%
associate-*l/99.9%
associate-*r/95.1%
fma-neg95.1%
distribute-neg-frac95.1%
+-commutative95.1%
distribute-neg-in95.1%
unsub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in z around 0 77.4%
associate-*r/77.4%
distribute-lft-in77.4%
metadata-eval77.4%
neg-mul-177.4%
sub-neg77.4%
Simplified77.4%
add-sqr-sqrt76.9%
sqrt-unprod49.5%
neg-fabs49.5%
neg-fabs49.5%
sqr-abs49.5%
distribute-frac-neg249.5%
sub-neg49.5%
metadata-eval49.5%
distribute-neg-in49.5%
+-commutative49.5%
frac-2neg49.5%
distribute-frac-neg249.5%
sub-neg49.5%
metadata-eval49.5%
distribute-neg-in49.5%
+-commutative49.5%
frac-2neg49.5%
sqrt-unprod40.7%
add-sqr-sqrt42.1%
Applied egg-rr42.1%
if 4.0000000000000003e-15 < x Initial program 94.4%
associate-*l/92.8%
sub-div96.4%
Applied egg-rr96.4%
add-sqr-sqrt56.3%
fabs-sqr56.3%
add-sqr-sqrt56.8%
frac-2neg56.8%
sub-neg56.8%
distribute-rgt-neg-out56.8%
distribute-neg-in56.8%
+-commutative56.8%
distribute-neg-in56.8%
metadata-eval56.8%
sub-neg56.8%
distribute-rgt-neg-out56.8%
remove-double-neg56.8%
Applied egg-rr56.8%
Taylor expanded in x around inf 55.2%
associate-*r/55.2%
sub-neg55.2%
metadata-eval55.2%
neg-mul-155.2%
distribute-rgt-neg-in55.2%
+-commutative55.2%
distribute-neg-in55.2%
metadata-eval55.2%
neg-mul-155.2%
associate-/l*58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
Final simplification45.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y_m) (if (<= x 4e-15) (/ (+ 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 <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 4e-15) {
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 <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 4d-15) 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 <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 4e-15) {
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 <= -4.0: tmp = (-4.0 - x) / y_m elif x <= 4e-15: 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 <= -4.0) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 4e-15) tmp = Float64(Float64(x + 4.0) / 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 <= 4e-15) 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, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4e-15], N[(N[(x + 4.0), $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 \cdot 10^{-15}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 82.8%
fabs-sub82.8%
div-inv82.7%
cancel-sign-sub-inv82.7%
associate-*l/78.7%
associate-*r/88.9%
+-commutative88.9%
distribute-neg-in88.9%
metadata-eval88.9%
sub-neg88.9%
div-inv89.0%
fma-undefine98.4%
add-sqr-sqrt37.3%
fabs-sqr37.3%
add-sqr-sqrt37.9%
fma-undefine36.4%
associate-*r/30.5%
associate-*l/36.4%
div-inv36.3%
Applied egg-rr36.4%
Taylor expanded in z around 0 21.8%
mul-1-neg21.8%
distribute-neg-in21.8%
distribute-lft-neg-in21.8%
metadata-eval21.8%
associate-*r/21.8%
metadata-eval21.8%
sub-neg21.8%
div-sub21.8%
Simplified21.8%
if -4 < x < 4.0000000000000003e-15Initial program 95.7%
fabs-sub95.7%
associate-*l/99.9%
associate-*r/95.2%
fma-neg95.2%
distribute-neg-frac95.2%
+-commutative95.2%
distribute-neg-in95.2%
unsub-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in z around 0 76.9%
associate-*r/76.9%
distribute-lft-in76.9%
metadata-eval76.9%
neg-mul-176.9%
sub-neg76.9%
Simplified76.9%
add-sqr-sqrt76.3%
sqrt-unprod49.1%
neg-fabs49.1%
neg-fabs49.1%
sqr-abs49.1%
distribute-frac-neg249.1%
sub-neg49.1%
metadata-eval49.1%
distribute-neg-in49.1%
+-commutative49.1%
frac-2neg49.1%
distribute-frac-neg249.1%
sub-neg49.1%
metadata-eval49.1%
distribute-neg-in49.1%
+-commutative49.1%
frac-2neg49.1%
sqrt-unprod40.5%
add-sqr-sqrt41.8%
Applied egg-rr41.8%
if 4.0000000000000003e-15 < x Initial program 94.4%
associate-*l/92.8%
sub-div96.4%
Applied egg-rr96.4%
add-sqr-sqrt56.3%
fabs-sqr56.3%
add-sqr-sqrt56.8%
frac-2neg56.8%
sub-neg56.8%
distribute-rgt-neg-out56.8%
distribute-neg-in56.8%
+-commutative56.8%
distribute-neg-in56.8%
metadata-eval56.8%
sub-neg56.8%
distribute-rgt-neg-out56.8%
remove-double-neg56.8%
Applied egg-rr56.8%
Taylor expanded in x around inf 55.2%
associate-*r/55.2%
sub-neg55.2%
metadata-eval55.2%
neg-mul-155.2%
distribute-rgt-neg-in55.2%
+-commutative55.2%
distribute-neg-in55.2%
metadata-eval55.2%
neg-mul-155.2%
associate-/l*58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (/ y_m (+ x (+ 4.0 (* x z)))))) (if (<= x -4.0) (/ -1.0 t_0) (/ 1.0 t_0))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = y_m / (x + (4.0 + (x * z)));
double tmp;
if (x <= -4.0) {
tmp = -1.0 / t_0;
} else {
tmp = 1.0 / 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 = y_m / (x + (4.0d0 + (x * z)))
if (x <= (-4.0d0)) then
tmp = (-1.0d0) / t_0
else
tmp = 1.0d0 / 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 = y_m / (x + (4.0 + (x * z)));
double tmp;
if (x <= -4.0) {
tmp = -1.0 / t_0;
} else {
tmp = 1.0 / t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = y_m / (x + (4.0 + (x * z))) tmp = 0 if x <= -4.0: tmp = -1.0 / t_0 else: tmp = 1.0 / t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(y_m / Float64(x + Float64(4.0 + Float64(x * z)))) tmp = 0.0 if (x <= -4.0) tmp = Float64(-1.0 / t_0); else tmp = Float64(1.0 / t_0); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = y_m / (x + (4.0 + (x * z))); tmp = 0.0; if (x <= -4.0) tmp = -1.0 / t_0; else tmp = 1.0 / t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(y$95$m / N[(x + N[(4.0 + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.0], N[(-1.0 / t$95$0), $MachinePrecision], N[(1.0 / t$95$0), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{y\_m}{x + \left(4 + x \cdot z\right)}\\
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-1}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_0}\\
\end{array}
\end{array}
if x < -4Initial program 82.8%
associate-*l/78.8%
sub-div89.7%
Applied egg-rr89.7%
Applied egg-rr36.5%
if -4 < x Initial program 95.3%
associate-*l/97.9%
sub-div98.9%
Applied egg-rr98.9%
add-sqr-sqrt51.8%
fabs-sqr51.8%
add-sqr-sqrt52.9%
clear-num52.8%
*-commutative52.8%
cancel-sign-sub-inv52.8%
*-commutative52.8%
add-sqr-sqrt30.0%
sqrt-unprod46.5%
sqr-neg46.5%
sqrt-unprod24.0%
add-sqr-sqrt52.3%
associate-+l+52.3%
Applied egg-rr52.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.7) (/ x (/ y_m (+ z -1.0))) (/ (- (- x -4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.7) {
tmp = x / (y_m / (z + -1.0));
} 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 <= (-2.7d0)) then
tmp = x / (y_m / (z + (-1.0d0)))
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 <= -2.7) {
tmp = x / (y_m / (z + -1.0));
} 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 <= -2.7: tmp = x / (y_m / (z + -1.0)) 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 <= -2.7) tmp = Float64(x / Float64(y_m / Float64(z + -1.0))); 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 <= -2.7) tmp = x / (y_m / (z + -1.0)); 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, -2.7], N[(x / N[(y$95$m / N[(z + -1.0), $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 -2.7:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z + -1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - -4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -2.7000000000000002Initial program 83.1%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/48.2%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine60.2%
neg-sub060.2%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/46.4%
Applied egg-rr55.9%
Taylor expanded in x around inf 54.7%
associate-/l*59.0%
sub-neg59.0%
metadata-eval59.0%
Simplified59.0%
add-sqr-sqrt0.3%
sqrt-unprod0.8%
sqr-neg0.8%
sub0-neg0.8%
sub0-neg0.8%
sqrt-unprod0.4%
add-sqr-sqrt40.3%
cancel-sign-sub-inv40.3%
+-lft-identity40.3%
clear-num40.3%
un-div-inv40.3%
Applied egg-rr40.3%
if -2.7000000000000002 < x Initial program 95.3%
associate-*l/97.9%
sub-div98.9%
Applied egg-rr98.9%
add-sqr-sqrt52.0%
fabs-sqr52.0%
add-sqr-sqrt53.2%
frac-2neg53.2%
sub-neg53.2%
distribute-rgt-neg-out53.2%
distribute-neg-in53.2%
+-commutative53.2%
distribute-neg-in53.2%
metadata-eval53.2%
sub-neg53.2%
distribute-rgt-neg-out53.2%
remove-double-neg53.2%
Applied egg-rr53.2%
Final simplification49.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -8e-8) (* z (/ x 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 <= -8e-8) {
tmp = z * (x / 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 <= (-8d-8)) then
tmp = z * (x / 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 <= -8e-8) {
tmp = z * (x / 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 <= -8e-8: tmp = z * (x / 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 <= -8e-8) tmp = Float64(z * Float64(x / 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 <= -8e-8) tmp = z * (x / 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, -8e-8], N[(z * N[(x / 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 -8 \cdot 10^{-8}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -8.0000000000000002e-8Initial program 84.0%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.7%
sub-neg46.7%
+-commutative46.7%
associate-*l/48.4%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine59.7%
neg-sub059.7%
fma-undefine52.5%
associate-*r/48.4%
associate-*l/46.7%
Applied egg-rr55.6%
Taylor expanded in z around inf 20.7%
*-commutative20.7%
associate-*r/27.5%
Simplified27.5%
sub0-neg27.5%
*-commutative27.5%
distribute-lft-neg-in27.5%
add-sqr-sqrt10.7%
sqrt-unprod30.5%
sqr-neg30.5%
sqrt-unprod24.0%
add-sqr-sqrt39.8%
distribute-frac-neg39.8%
frac-2neg39.8%
Applied egg-rr39.8%
if -8.0000000000000002e-8 < x < 4Initial program 95.6%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
add-sqr-sqrt51.1%
fabs-sqr51.1%
add-sqr-sqrt52.4%
frac-2neg52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
distribute-neg-in52.4%
+-commutative52.4%
distribute-neg-in52.4%
metadata-eval52.4%
sub-neg52.4%
distribute-rgt-neg-out52.4%
remove-double-neg52.4%
Applied egg-rr52.4%
Taylor expanded in x around 0 41.0%
if 4 < x Initial program 94.0%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt55.2%
sub-neg55.2%
+-commutative55.2%
associate-*l/51.4%
associate-*r/55.1%
frac-2neg55.1%
+-commutative55.1%
distribute-neg-in55.1%
metadata-eval55.1%
sub-neg55.1%
distribute-frac-neg255.1%
distribute-neg-in55.1%
fma-undefine57.1%
neg-sub057.1%
fma-undefine55.1%
associate-*r/51.4%
associate-*l/55.2%
Applied egg-rr55.4%
Taylor expanded in x around inf 55.4%
associate-/l*59.0%
sub-neg59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in z around 0 37.1%
Final simplification39.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 82.8%
fabs-sub82.8%
div-inv82.7%
cancel-sign-sub-inv82.7%
associate-*l/78.7%
associate-*r/88.9%
+-commutative88.9%
distribute-neg-in88.9%
metadata-eval88.9%
sub-neg88.9%
div-inv89.0%
fma-undefine98.4%
add-sqr-sqrt37.3%
fabs-sqr37.3%
add-sqr-sqrt37.9%
fma-undefine36.4%
associate-*r/30.5%
associate-*l/36.4%
div-inv36.3%
Applied egg-rr36.4%
Taylor expanded in z around 0 21.8%
mul-1-neg21.8%
distribute-neg-in21.8%
distribute-lft-neg-in21.8%
metadata-eval21.8%
associate-*r/21.8%
metadata-eval21.8%
sub-neg21.8%
div-sub21.8%
Simplified21.8%
if -4 < x Initial program 95.3%
fabs-sub95.3%
associate-*l/97.9%
associate-*r/95.5%
fma-neg96.0%
distribute-neg-frac96.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around 0 73.8%
associate-*r/73.8%
distribute-lft-in73.8%
metadata-eval73.8%
neg-mul-173.8%
sub-neg73.8%
Simplified73.8%
add-sqr-sqrt73.2%
sqrt-unprod50.0%
neg-fabs50.0%
neg-fabs50.0%
sqr-abs50.0%
distribute-frac-neg250.0%
sub-neg50.0%
metadata-eval50.0%
distribute-neg-in50.0%
+-commutative50.0%
frac-2neg50.0%
distribute-frac-neg250.0%
sub-neg50.0%
metadata-eval50.0%
distribute-neg-in50.0%
+-commutative50.0%
frac-2neg50.0%
sqrt-unprod39.2%
add-sqr-sqrt40.3%
Applied egg-rr40.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -0.88) (* z (/ 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 <= -0.88) {
tmp = z * (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 <= (-0.88d0)) then
tmp = z * (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 <= -0.88) {
tmp = z * (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 <= -0.88: tmp = z * (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 <= -0.88) tmp = Float64(z * Float64(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 <= -0.88) tmp = z * (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, -0.88], N[(z * N[(x / 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 -0.88:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -0.880000000000000004Initial program 83.1%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/48.2%
associate-*r/52.5%
frac-2neg52.5%
+-commutative52.5%
distribute-neg-in52.5%
metadata-eval52.5%
sub-neg52.5%
distribute-frac-neg252.5%
distribute-neg-in52.5%
fma-undefine60.2%
neg-sub060.2%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/46.4%
Applied egg-rr55.9%
Taylor expanded in z around inf 21.7%
*-commutative21.7%
associate-*r/28.9%
Simplified28.9%
sub0-neg28.9%
*-commutative28.9%
distribute-lft-neg-in28.9%
add-sqr-sqrt11.1%
sqrt-unprod32.1%
sqr-neg32.1%
sqrt-unprod25.5%
add-sqr-sqrt39.9%
distribute-frac-neg39.9%
frac-2neg39.9%
Applied egg-rr39.9%
if -0.880000000000000004 < x Initial program 95.3%
fabs-sub95.3%
associate-*l/97.9%
associate-*r/95.4%
fma-neg96.0%
distribute-neg-frac96.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around 0 74.1%
associate-*r/74.1%
distribute-lft-in74.1%
metadata-eval74.1%
neg-mul-174.1%
sub-neg74.1%
Simplified74.1%
add-sqr-sqrt73.6%
sqrt-unprod50.3%
neg-fabs50.3%
neg-fabs50.3%
sqr-abs50.3%
distribute-frac-neg250.3%
sub-neg50.3%
metadata-eval50.3%
distribute-neg-in50.3%
+-commutative50.3%
frac-2neg50.3%
distribute-frac-neg250.3%
sub-neg50.3%
metadata-eval50.3%
distribute-neg-in50.3%
+-commutative50.3%
frac-2neg50.3%
sqrt-unprod39.4%
add-sqr-sqrt40.5%
Applied egg-rr40.5%
Final simplification40.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 91.7%
associate-*l/93.3%
sub-div96.7%
Applied egg-rr96.7%
add-sqr-sqrt52.4%
fabs-sqr52.4%
add-sqr-sqrt53.5%
frac-2neg53.5%
sub-neg53.5%
distribute-rgt-neg-out53.5%
distribute-neg-in53.5%
+-commutative53.5%
distribute-neg-in53.5%
metadata-eval53.5%
sub-neg53.5%
distribute-rgt-neg-out53.5%
remove-double-neg53.5%
Applied egg-rr53.5%
Taylor expanded in x around 0 28.5%
if 4 < x Initial program 94.0%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt55.2%
sub-neg55.2%
+-commutative55.2%
associate-*l/51.4%
associate-*r/55.1%
frac-2neg55.1%
+-commutative55.1%
distribute-neg-in55.1%
metadata-eval55.1%
sub-neg55.1%
distribute-frac-neg255.1%
distribute-neg-in55.1%
fma-undefine57.1%
neg-sub057.1%
fma-undefine55.1%
associate-*r/51.4%
associate-*l/55.2%
Applied egg-rr55.4%
Taylor expanded in x around inf 55.4%
associate-/l*59.0%
sub-neg59.0%
metadata-eval59.0%
Simplified59.0%
Taylor expanded in z around 0 37.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 92.2%
associate-*l/93.1%
sub-div96.6%
Applied egg-rr96.6%
add-sqr-sqrt52.9%
fabs-sqr52.9%
add-sqr-sqrt53.9%
frac-2neg53.9%
sub-neg53.9%
distribute-rgt-neg-out53.9%
distribute-neg-in53.9%
+-commutative53.9%
distribute-neg-in53.9%
metadata-eval53.9%
sub-neg53.9%
distribute-rgt-neg-out53.9%
remove-double-neg53.9%
Applied egg-rr53.9%
Taylor expanded in x around 0 23.5%
herbie shell --seed 2024116
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))