
(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 19 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 1e-38) (fabs (* (/ -1.0 y_m) (- (+ (* 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 <= 1e-38) {
tmp = fabs(((-1.0 / y_m) * (((x * z) + -4.0) - x)));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (y_m <= 1d-38) then
tmp = abs((((-1.0d0) / y_m) * (((x * z) + (-4.0d0)) - x)))
else
tmp = abs((((x + 4.0d0) / y_m) - (x / (y_m / z))))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1e-38) {
tmp = Math.abs(((-1.0 / y_m) * (((x * z) + -4.0) - x)));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 1e-38: tmp = math.fabs(((-1.0 / y_m) * (((x * z) + -4.0) - x))) else: tmp = math.fabs((((x + 4.0) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1e-38) tmp = abs(Float64(Float64(-1.0 / y_m) * Float64(Float64(Float64(x * z) + -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 = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 1e-38) tmp = abs(((-1.0 / y_m) * (((x * z) + -4.0) - x))); else tmp = abs((((x + 4.0) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1e-38], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(N[(N[(x * z), $MachinePrecision] + -4.0), $MachinePrecision] - x), $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 10^{-38}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \left(\left(x \cdot z + -4\right) - 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.9999999999999996e-39Initial program 92.6%
Simplified97.3%
fma-undefine97.3%
associate-+r-97.3%
Applied egg-rr97.3%
if 9.9999999999999996e-39 < y Initial program 97.1%
associate-*l/95.9%
associate-*r/99.8%
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 7.8e-57))) (fabs (* (- 1.0 z) (/ x y_m))) (+ (/ (+ x 4.0) y_m) (/ -1.0 (/ y_m (* x z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -4.0) || !(x <= 7.8e-57)) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (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 <= 7.8d-57))) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = ((x + 4.0d0) / y_m) + ((-1.0d0) / (y_m / (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 <= 7.8e-57)) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -4.0) or not (x <= 7.8e-57): tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -4.0) || !(x <= 7.8e-57)) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = Float64(Float64(Float64(x + 4.0) / y_m) + Float64(-1.0 / Float64(y_m / 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 <= 7.8e-57))) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (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, 7.8e-57]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(-1.0 / N[(y$95$m / N[(x * z), $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 7.8 \cdot 10^{-57}\right):\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m} + \frac{-1}{\frac{y\_m}{x \cdot z}}\\
\end{array}
\end{array}
if x < -4 or 7.80000000000000013e-57 < x Initial program 91.2%
Simplified94.3%
Taylor expanded in x around inf 91.4%
mul-1-neg91.4%
associate-/l*96.0%
distribute-rgt-neg-in96.0%
mul-1-neg96.0%
associate-*r/96.0%
sub-neg96.0%
metadata-eval96.0%
distribute-lft-in96.0%
neg-mul-196.0%
metadata-eval96.0%
+-commutative96.0%
neg-mul-196.0%
associate-/l*91.4%
*-commutative91.4%
associate-/l*96.8%
neg-mul-196.8%
unsub-neg96.8%
Simplified96.8%
if -4 < x < 7.80000000000000013e-57Initial program 96.9%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt51.1%
associate-*l/52.0%
associate-*r/49.6%
Applied egg-rr49.6%
associate-*r/52.0%
clear-num52.0%
Applied egg-rr52.0%
Final simplification76.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2e+20) (fabs (* (- 1.0 z) (/ x y_m))) (fabs (* (/ -1.0 y_m) (- (+ (* x z) -4.0) x)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2e+20) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = fabs(((-1.0 / y_m) * (((x * z) + -4.0) - x)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2d+20)) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = abs((((-1.0d0) / y_m) * (((x * z) + (-4.0d0)) - x)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2e+20) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = Math.abs(((-1.0 / y_m) * (((x * z) + -4.0) - x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2e+20: tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = math.fabs(((-1.0 / y_m) * (((x * z) + -4.0) - x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2e+20) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = abs(Float64(Float64(-1.0 / y_m) * Float64(Float64(Float64(x * z) + -4.0) - x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2e+20) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = abs(((-1.0 / y_m) * (((x * z) + -4.0) - x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2e+20], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(N[(N[(x * z), $MachinePrecision] + -4.0), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \left(\left(x \cdot z + -4\right) - x\right)\right|\\
\end{array}
\end{array}
if x < -2e20Initial program 93.0%
Simplified91.7%
Taylor expanded in x around inf 91.9%
mul-1-neg91.9%
associate-/l*99.7%
distribute-rgt-neg-in99.7%
mul-1-neg99.7%
associate-*r/99.7%
sub-neg99.7%
metadata-eval99.7%
distribute-lft-in99.7%
neg-mul-199.7%
metadata-eval99.7%
+-commutative99.7%
neg-mul-199.7%
associate-/l*91.9%
*-commutative91.9%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -2e20 < x Initial program 94.1%
Simplified98.4%
fma-undefine98.4%
associate-+r-98.4%
Applied egg-rr98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -1.4e+23) (not (<= z 9e+62))) (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.4e+23) || !(z <= 9e+62)) {
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.4d+23)) .or. (.not. (z <= 9d+62))) 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.4e+23) || !(z <= 9e+62)) {
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.4e+23) or not (z <= 9e+62): 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.4e+23) || !(z <= 9e+62)) 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.4e+23) || ~((z <= 9e+62))) 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.4e+23], N[Not[LessEqual[z, 9e+62]], $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.4 \cdot 10^{+23} \lor \neg \left(z \leq 9 \cdot 10^{+62}\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.4e23 or 8.99999999999999997e62 < z Initial program 90.9%
Simplified93.6%
Taylor expanded in z around inf 73.0%
mul-1-neg73.0%
distribute-frac-neg273.0%
associate-*l/76.6%
*-commutative76.6%
Simplified76.6%
if -1.4e23 < z < 8.99999999999999997e62Initial program 95.9%
fabs-sub95.9%
associate-*l/98.6%
associate-*r/99.3%
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 95.8%
associate-*r/95.8%
distribute-lft-in95.8%
metadata-eval95.8%
neg-mul-195.8%
sub-neg95.8%
Simplified95.8%
Final simplification87.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -9.2e+22) (fabs (/ (* x z) y_m)) (if (<= z 2.4e+68) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -9.2e+22) {
tmp = fabs(((x * z) / y_m));
} else if (z <= 2.4e+68) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((z * (x / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-9.2d+22)) then
tmp = abs(((x * z) / y_m))
else if (z <= 2.4d+68) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((z * (x / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -9.2e+22) {
tmp = Math.abs(((x * z) / y_m));
} else if (z <= 2.4e+68) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -9.2e+22: tmp = math.fabs(((x * z) / y_m)) elif z <= 2.4e+68: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -9.2e+22) tmp = abs(Float64(Float64(x * z) / y_m)); elseif (z <= 2.4e+68) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(z * Float64(x / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -9.2e+22) tmp = abs(((x * z) / y_m)); elseif (z <= 2.4e+68) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -9.2e+22], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.4e+68], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+22}:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+68}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -9.2000000000000008e22Initial program 96.3%
Simplified97.9%
Taylor expanded in z around inf 74.2%
associate-*r/74.2%
neg-mul-174.2%
distribute-rgt-neg-in74.2%
Simplified74.2%
if -9.2000000000000008e22 < z < 2.40000000000000008e68Initial program 95.9%
fabs-sub95.9%
associate-*l/98.6%
associate-*r/99.3%
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 95.8%
associate-*r/95.8%
distribute-lft-in95.8%
metadata-eval95.8%
neg-mul-195.8%
sub-neg95.8%
Simplified95.8%
if 2.40000000000000008e68 < z Initial program 85.9%
Simplified89.7%
Taylor expanded in z around inf 72.0%
mul-1-neg72.0%
distribute-frac-neg272.0%
associate-*l/79.9%
*-commutative79.9%
Simplified79.9%
Final simplification88.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -4.3e+24)
(+ (/ (+ x 4.0) y_m) (/ -1.0 (/ y_m (* x z))))
(if (<= z 4.1e+21)
(fabs (/ (- -4.0 x) y_m))
(if (<= z 3.5e+182)
(- (/ 4.0 y_m) (* x (/ z y_m)))
(/ (/ z y_m) (/ 1.0 x))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -4.3e+24) {
tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z)));
} else if (z <= 4.1e+21) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (z <= 3.5e+182) {
tmp = (4.0 / y_m) - (x * (z / y_m));
} else {
tmp = (z / y_m) / (1.0 / x);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-4.3d+24)) then
tmp = ((x + 4.0d0) / y_m) + ((-1.0d0) / (y_m / (x * z)))
else if (z <= 4.1d+21) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (z <= 3.5d+182) then
tmp = (4.0d0 / y_m) - (x * (z / y_m))
else
tmp = (z / y_m) / (1.0d0 / x)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -4.3e+24) {
tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z)));
} else if (z <= 4.1e+21) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (z <= 3.5e+182) {
tmp = (4.0 / y_m) - (x * (z / y_m));
} else {
tmp = (z / y_m) / (1.0 / x);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -4.3e+24: tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z))) elif z <= 4.1e+21: tmp = math.fabs(((-4.0 - x) / y_m)) elif z <= 3.5e+182: tmp = (4.0 / y_m) - (x * (z / y_m)) else: tmp = (z / y_m) / (1.0 / x) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -4.3e+24) tmp = Float64(Float64(Float64(x + 4.0) / y_m) + Float64(-1.0 / Float64(y_m / Float64(x * z)))); elseif (z <= 4.1e+21) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (z <= 3.5e+182) tmp = Float64(Float64(4.0 / y_m) - Float64(x * Float64(z / y_m))); else tmp = Float64(Float64(z / y_m) / Float64(1.0 / x)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -4.3e+24) tmp = ((x + 4.0) / y_m) + (-1.0 / (y_m / (x * z))); elseif (z <= 4.1e+21) tmp = abs(((-4.0 - x) / y_m)); elseif (z <= 3.5e+182) tmp = (4.0 / y_m) - (x * (z / y_m)); else tmp = (z / y_m) / (1.0 / x); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -4.3e+24], N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(-1.0 / N[(y$95$m / N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+21], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3.5e+182], N[(N[(4.0 / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / y$95$m), $MachinePrecision] / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+24}:\\
\;\;\;\;\frac{x + 4}{y\_m} + \frac{-1}{\frac{y\_m}{x \cdot z}}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+21}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+182}:\\
\;\;\;\;\frac{4}{y\_m} - x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{z}{y\_m}}{\frac{1}{x}}\\
\end{array}
\end{array}
if z < -4.29999999999999987e24Initial program 96.2%
add-sqr-sqrt57.4%
fabs-sqr57.4%
add-sqr-sqrt58.0%
associate-*l/58.4%
associate-*r/54.5%
Applied egg-rr54.5%
associate-*r/58.4%
clear-num58.4%
Applied egg-rr58.4%
if -4.29999999999999987e24 < z < 4.1e21Initial program 95.7%
fabs-sub95.7%
associate-*l/99.2%
associate-*r/99.3%
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.2%
associate-*r/96.2%
distribute-lft-in96.2%
metadata-eval96.2%
neg-mul-196.2%
sub-neg96.2%
Simplified96.2%
if 4.1e21 < z < 3.50000000000000023e182Initial program 94.2%
add-sqr-sqrt30.5%
fabs-sqr30.5%
add-sqr-sqrt31.4%
associate-*l/31.2%
associate-*r/31.2%
Applied egg-rr31.2%
Taylor expanded in x around 0 34.2%
if 3.50000000000000023e182 < z Initial program 81.2%
add-sqr-sqrt49.9%
fabs-sqr49.9%
add-sqr-sqrt50.2%
sub-neg50.2%
+-commutative50.2%
associate-*l/38.4%
associate-*r/50.3%
frac-2neg50.3%
+-commutative50.3%
distribute-neg-in50.3%
metadata-eval50.3%
sub-neg50.3%
distribute-frac-neg250.3%
distribute-neg-in50.3%
fma-undefine50.3%
neg-sub050.3%
fma-undefine50.3%
associate-*r/38.4%
associate-*l/50.2%
Applied egg-rr54.0%
Taylor expanded in z around inf 54.2%
add-sqr-sqrt53.9%
sqrt-unprod76.4%
associate-*r/76.3%
neg-sub076.3%
associate-*r/82.2%
neg-sub082.2%
sqr-neg82.2%
sqrt-unprod28.2%
add-sqr-sqrt28.5%
*-commutative28.5%
associate-/r/25.7%
div-inv25.6%
associate-/r*28.5%
Applied egg-rr28.5%
Final simplification72.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ z (/ y_m x))))
(if (<= x -0.66)
t_0
(if (<= x 6.8e-18) (/ 4.0 y_m) (if (<= x 2.95e+32) t_0 (/ x y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = z / (y_m / x);
double tmp;
if (x <= -0.66) {
tmp = t_0;
} else if (x <= 6.8e-18) {
tmp = 4.0 / y_m;
} else if (x <= 2.95e+32) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = z / (y_m / x)
if (x <= (-0.66d0)) then
tmp = t_0
else if (x <= 6.8d-18) then
tmp = 4.0d0 / y_m
else if (x <= 2.95d+32) then
tmp = t_0
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 t_0 = z / (y_m / x);
double tmp;
if (x <= -0.66) {
tmp = t_0;
} else if (x <= 6.8e-18) {
tmp = 4.0 / y_m;
} else if (x <= 2.95e+32) {
tmp = t_0;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = z / (y_m / x) tmp = 0 if x <= -0.66: tmp = t_0 elif x <= 6.8e-18: tmp = 4.0 / y_m elif x <= 2.95e+32: tmp = t_0 else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(z / Float64(y_m / x)) tmp = 0.0 if (x <= -0.66) tmp = t_0; elseif (x <= 6.8e-18) tmp = Float64(4.0 / y_m); elseif (x <= 2.95e+32) tmp = t_0; else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = z / (y_m / x); tmp = 0.0; if (x <= -0.66) tmp = t_0; elseif (x <= 6.8e-18) tmp = 4.0 / y_m; elseif (x <= 2.95e+32) tmp = t_0; else tmp = 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[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.66], t$95$0, If[LessEqual[x, 6.8e-18], N[(4.0 / y$95$m), $MachinePrecision], If[LessEqual[x, 2.95e+32], t$95$0, N[(x / y$95$m), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{z}{\frac{y\_m}{x}}\\
\mathbf{if}\;x \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-18}:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -0.660000000000000031 or 6.80000000000000002e-18 < x < 2.94999999999999983e32Initial program 94.5%
add-sqr-sqrt38.4%
fabs-sqr38.4%
add-sqr-sqrt39.0%
sub-neg39.0%
+-commutative39.0%
associate-*l/36.5%
associate-*r/39.0%
frac-2neg39.0%
+-commutative39.0%
distribute-neg-in39.0%
metadata-eval39.0%
sub-neg39.0%
distribute-frac-neg239.0%
distribute-neg-in39.0%
fma-undefine39.0%
neg-sub039.0%
fma-undefine39.0%
associate-*r/36.5%
associate-*l/39.0%
Applied egg-rr40.5%
Taylor expanded in z around inf 25.3%
add-sqr-sqrt24.8%
sqrt-unprod42.5%
associate-*r/42.5%
neg-sub042.5%
associate-*r/46.4%
neg-sub046.4%
sqr-neg46.4%
sqrt-unprod28.0%
add-sqr-sqrt28.4%
*-commutative28.4%
associate-/r/32.1%
Applied egg-rr32.1%
if -0.660000000000000031 < x < 6.80000000000000002e-18Initial program 97.0%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt49.1%
associate-*l/50.0%
associate-*r/47.7%
Applied egg-rr47.7%
associate-*r/50.0%
clear-num50.0%
Applied egg-rr50.0%
div-inv50.0%
*-commutative50.0%
Applied egg-rr50.0%
*-commutative50.0%
associate-*l/50.0%
times-frac49.1%
associate-*l/49.1%
*-lft-identity49.1%
Simplified49.1%
Taylor expanded in x around 0 42.3%
if 2.94999999999999983e32 < x Initial program 86.1%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt50.2%
sub-neg50.2%
+-commutative50.2%
associate-*l/48.8%
associate-*r/53.6%
frac-2neg53.6%
+-commutative53.6%
distribute-neg-in53.6%
metadata-eval53.6%
sub-neg53.6%
distribute-frac-neg253.6%
distribute-neg-in53.6%
fma-undefine55.3%
neg-sub055.3%
fma-undefine53.6%
associate-*r/48.8%
associate-*l/50.2%
Applied egg-rr55.7%
Taylor expanded in z around 0 30.0%
associate-*r/30.0%
distribute-lft-in30.0%
metadata-eval30.0%
neg-mul-130.0%
sub-neg30.0%
Simplified30.0%
Taylor expanded in x around inf 30.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -0.66)
(* x (/ z y_m))
(if (<= x 6e-19)
(/ 4.0 y_m)
(if (<= x 7.4e+31) (/ x (/ y_m z)) (/ x y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -0.66) {
tmp = x * (z / y_m);
} else if (x <= 6e-19) {
tmp = 4.0 / y_m;
} else if (x <= 7.4e+31) {
tmp = x / (y_m / z);
} 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 <= (-0.66d0)) then
tmp = x * (z / y_m)
else if (x <= 6d-19) then
tmp = 4.0d0 / y_m
else if (x <= 7.4d+31) then
tmp = x / (y_m / z)
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 <= -0.66) {
tmp = x * (z / y_m);
} else if (x <= 6e-19) {
tmp = 4.0 / y_m;
} else if (x <= 7.4e+31) {
tmp = x / (y_m / z);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -0.66: tmp = x * (z / y_m) elif x <= 6e-19: tmp = 4.0 / y_m elif x <= 7.4e+31: tmp = x / (y_m / z) else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -0.66) tmp = Float64(x * Float64(z / y_m)); elseif (x <= 6e-19) tmp = Float64(4.0 / y_m); elseif (x <= 7.4e+31) tmp = Float64(x / Float64(y_m / z)); 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 <= -0.66) tmp = x * (z / y_m); elseif (x <= 6e-19) tmp = 4.0 / y_m; elseif (x <= 7.4e+31) tmp = x / (y_m / z); 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, -0.66], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-19], N[(4.0 / y$95$m), $MachinePrecision], If[LessEqual[x, 7.4e+31], N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.66:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-19}:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{elif}\;x \leq 7.4 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -0.660000000000000031Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
Taylor expanded in z around inf 22.7%
associate-*r/27.1%
Simplified27.1%
if -0.660000000000000031 < x < 5.99999999999999985e-19Initial program 97.0%
add-sqr-sqrt47.7%
fabs-sqr47.7%
add-sqr-sqrt49.1%
associate-*l/50.0%
associate-*r/47.7%
Applied egg-rr47.7%
associate-*r/50.0%
clear-num50.0%
Applied egg-rr50.0%
div-inv50.0%
*-commutative50.0%
Applied egg-rr50.0%
*-commutative50.0%
associate-*l/50.0%
times-frac49.1%
associate-*l/49.1%
*-lft-identity49.1%
Simplified49.1%
Taylor expanded in x around 0 42.3%
if 5.99999999999999985e-19 < x < 7.3999999999999996e31Initial program 99.5%
add-sqr-sqrt41.3%
fabs-sqr41.3%
add-sqr-sqrt42.1%
sub-neg42.1%
+-commutative42.1%
associate-*l/42.3%
associate-*r/42.3%
frac-2neg42.3%
+-commutative42.3%
distribute-neg-in42.3%
metadata-eval42.3%
sub-neg42.3%
distribute-frac-neg242.3%
distribute-neg-in42.3%
fma-undefine42.3%
neg-sub042.3%
fma-undefine42.3%
associate-*r/42.3%
associate-*l/42.1%
Applied egg-rr42.3%
Taylor expanded in z around inf 42.4%
add-sqr-sqrt41.3%
sqrt-unprod53.6%
associate-*r/53.6%
neg-sub053.6%
associate-*r/53.6%
neg-sub053.6%
sqr-neg53.6%
sqrt-unprod34.8%
add-sqr-sqrt35.5%
clear-num35.5%
un-div-inv42.6%
Applied egg-rr42.6%
if 7.3999999999999996e31 < x Initial program 86.1%
add-sqr-sqrt49.7%
fabs-sqr49.7%
add-sqr-sqrt50.2%
sub-neg50.2%
+-commutative50.2%
associate-*l/48.8%
associate-*r/53.6%
frac-2neg53.6%
+-commutative53.6%
distribute-neg-in53.6%
metadata-eval53.6%
sub-neg53.6%
distribute-frac-neg253.6%
distribute-neg-in53.6%
fma-undefine55.3%
neg-sub055.3%
fma-undefine53.6%
associate-*r/48.8%
associate-*l/50.2%
Applied egg-rr55.7%
Taylor expanded in z around 0 30.0%
associate-*r/30.0%
distribute-lft-in30.0%
metadata-eval30.0%
neg-mul-130.0%
sub-neg30.0%
Simplified30.0%
Taylor expanded in x around inf 30.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -3.7) (/ (- (* x z) (+ x 4.0)) y_m) (if (<= x 2.3e+23) (/ (- 4.0 (* x z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -3.7) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-3.7d0)) then
tmp = ((x * z) - (x + 4.0d0)) / y_m
else if (x <= 2.3d+23) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -3.7) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -3.7: tmp = ((x * z) - (x + 4.0)) / y_m elif x <= 2.3e+23: tmp = (4.0 - (x * z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -3.7) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); elseif (x <= 2.3e+23) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -3.7) tmp = ((x * z) - (x + 4.0)) / y_m; elseif (x <= 2.3e+23) tmp = (4.0 - (x * z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -3.7], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 2.3e+23], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -3.7000000000000002Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
if -3.7000000000000002 < x < 2.3e23Initial program 97.2%
add-sqr-sqrt47.5%
fabs-sqr47.5%
add-sqr-sqrt48.9%
associate-*l/49.7%
associate-*r/47.6%
Applied egg-rr47.6%
Taylor expanded in x around 0 46.5%
Taylor expanded in y around 0 48.6%
if 2.3e23 < x Initial program 86.3%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.4%
sub-neg49.4%
+-commutative49.4%
associate-*l/48.0%
associate-*r/52.7%
frac-2neg52.7%
+-commutative52.7%
distribute-neg-in52.7%
metadata-eval52.7%
sub-neg52.7%
distribute-frac-neg252.7%
distribute-neg-in52.7%
fma-undefine54.4%
neg-sub054.4%
fma-undefine52.7%
associate-*r/48.0%
associate-*l/49.4%
Applied egg-rr54.7%
Taylor expanded in z around 0 29.6%
associate-*r/29.6%
distribute-lft-in29.6%
metadata-eval29.6%
neg-mul-129.6%
sub-neg29.6%
Simplified29.6%
Taylor expanded in y around 0 29.6%
Final simplification45.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -0.8) (/ (- (* x z) x) y_m) (if (<= x 2.3e+23) (/ (- 4.0 (* x z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -0.8) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-0.8d0)) then
tmp = ((x * z) - x) / y_m
else if (x <= 2.3d+23) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -0.8) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -0.8: tmp = ((x * z) - x) / y_m elif x <= 2.3e+23: tmp = (4.0 - (x * z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -0.8) tmp = Float64(Float64(Float64(x * z) - x) / y_m); elseif (x <= 2.3e+23) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -0.8) tmp = ((x * z) - x) / y_m; elseif (x <= 2.3e+23) tmp = (4.0 - (x * z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -0.8], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 2.3e+23], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.8:\\
\;\;\;\;\frac{x \cdot z - x}{y\_m}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -0.80000000000000004Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
Taylor expanded in x around inf 52.8%
if -0.80000000000000004 < x < 2.3e23Initial program 97.2%
add-sqr-sqrt47.5%
fabs-sqr47.5%
add-sqr-sqrt48.9%
associate-*l/49.7%
associate-*r/47.6%
Applied egg-rr47.6%
Taylor expanded in x around 0 46.5%
Taylor expanded in y around 0 48.6%
if 2.3e23 < x Initial program 86.3%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.4%
sub-neg49.4%
+-commutative49.4%
associate-*l/48.0%
associate-*r/52.7%
frac-2neg52.7%
+-commutative52.7%
distribute-neg-in52.7%
metadata-eval52.7%
sub-neg52.7%
distribute-frac-neg252.7%
distribute-neg-in52.7%
fma-undefine54.4%
neg-sub054.4%
fma-undefine52.7%
associate-*r/48.0%
associate-*l/49.4%
Applied egg-rr54.7%
Taylor expanded in z around 0 29.6%
associate-*r/29.6%
distribute-lft-in29.6%
metadata-eval29.6%
neg-mul-129.6%
sub-neg29.6%
Simplified29.6%
Taylor expanded in y around 0 29.6%
Final simplification45.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.8) (/ (- -4.0 x) y_m) (if (<= x 2.3e+23) (/ (- 4.0 (* x z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.8) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.8d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 2.3d+23) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.8) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 2.3e+23) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.8: tmp = (-4.0 - x) / y_m elif x <= 2.3e+23: tmp = (4.0 - (x * z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.8) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 2.3e+23) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.8) tmp = (-4.0 - x) / y_m; elseif (x <= 2.3e+23) tmp = (4.0 - (x * z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.8], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 2.3e+23], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4.79999999999999982Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
Taylor expanded in z around 0 40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
sub-neg40.9%
Simplified40.9%
if -4.79999999999999982 < x < 2.3e23Initial program 97.2%
add-sqr-sqrt47.5%
fabs-sqr47.5%
add-sqr-sqrt48.9%
associate-*l/49.7%
associate-*r/47.6%
Applied egg-rr47.6%
Taylor expanded in x around 0 46.5%
Taylor expanded in y around 0 48.6%
if 2.3e23 < x Initial program 86.3%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.4%
sub-neg49.4%
+-commutative49.4%
associate-*l/48.0%
associate-*r/52.7%
frac-2neg52.7%
+-commutative52.7%
distribute-neg-in52.7%
metadata-eval52.7%
sub-neg52.7%
distribute-frac-neg252.7%
distribute-neg-in52.7%
fma-undefine54.4%
neg-sub054.4%
fma-undefine52.7%
associate-*r/48.0%
associate-*l/49.4%
Applied egg-rr54.7%
Taylor expanded in z around 0 29.6%
associate-*r/29.6%
distribute-lft-in29.6%
metadata-eval29.6%
neg-mul-129.6%
sub-neg29.6%
Simplified29.6%
Taylor expanded in y around 0 29.6%
Final simplification42.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (- (* 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 <= -4.0) {
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 <= (-4.0d0)) 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 <= -4.0) {
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 <= -4.0: 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 <= -4.0) 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 <= -4.0) 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, -4.0], 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 -4:\\
\;\;\;\;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 < -4Initial program 93.5%
fabs-sub93.5%
div-inv93.4%
cancel-sign-sub-inv93.4%
associate-*l/87.5%
associate-*r/95.0%
+-commutative95.0%
distribute-neg-in95.0%
metadata-eval95.0%
sub-neg95.0%
div-inv95.1%
fma-undefine96.7%
add-sqr-sqrt58.4%
fabs-sqr58.4%
add-sqr-sqrt59.1%
fma-undefine57.5%
associate-*r/53.0%
associate-*l/55.8%
div-inv55.7%
Applied egg-rr57.5%
if -4 < x Initial program 93.9%
add-sqr-sqrt47.9%
fabs-sqr47.9%
add-sqr-sqrt49.0%
sub-neg49.0%
+-commutative49.0%
associate-*l/49.1%
associate-*r/49.1%
frac-2neg49.1%
+-commutative49.1%
distribute-neg-in49.1%
metadata-eval49.1%
sub-neg49.1%
distribute-frac-neg249.1%
distribute-neg-in49.1%
fma-undefine49.6%
neg-sub049.6%
fma-undefine49.1%
associate-*r/49.1%
associate-*l/49.0%
Applied egg-rr51.2%
Final simplification52.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- (* 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 <= -4.0) {
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 <= (-4.0d0)) 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 <= -4.0) {
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 <= -4.0: 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 <= -4.0) 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 <= -4.0) 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, -4.0], 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 -4:\\
\;\;\;\;\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 < -4Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
if -4 < x Initial program 93.9%
add-sqr-sqrt47.9%
fabs-sqr47.9%
add-sqr-sqrt49.0%
sub-neg49.0%
+-commutative49.0%
associate-*l/49.1%
associate-*r/49.1%
frac-2neg49.1%
+-commutative49.1%
distribute-neg-in49.1%
metadata-eval49.1%
sub-neg49.1%
distribute-frac-neg249.1%
distribute-neg-in49.1%
fma-undefine49.6%
neg-sub049.6%
fma-undefine49.1%
associate-*r/49.1%
associate-*l/49.0%
Applied egg-rr51.2%
Final simplification51.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -0.62) (* x (/ z y_m)) (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -0.62) {
tmp = x * (z / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-0.62d0)) then
tmp = x * (z / y_m)
else if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = x / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -0.62) {
tmp = x * (z / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -0.62: tmp = x * (z / y_m) elif x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -0.62) tmp = Float64(x * Float64(z / y_m)); elseif (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -0.62) tmp = x * (z / y_m); elseif (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -0.62], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.62:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -0.619999999999999996Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
Taylor expanded in z around inf 22.7%
associate-*r/27.1%
Simplified27.1%
if -0.619999999999999996 < x < 4Initial program 97.1%
add-sqr-sqrt47.4%
fabs-sqr47.4%
add-sqr-sqrt48.8%
associate-*l/49.6%
associate-*r/47.4%
Applied egg-rr47.4%
associate-*r/49.6%
clear-num49.6%
Applied egg-rr49.6%
div-inv49.6%
*-commutative49.6%
Applied egg-rr49.6%
*-commutative49.6%
associate-*l/49.6%
times-frac48.8%
associate-*l/48.8%
*-lft-identity48.8%
Simplified48.8%
Taylor expanded in x around 0 40.7%
if 4 < x Initial program 87.5%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.5%
sub-neg49.5%
+-commutative49.5%
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-undefine54.0%
neg-sub054.0%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/49.5%
Applied egg-rr54.4%
Taylor expanded in z around 0 27.1%
associate-*r/27.1%
distribute-lft-in27.1%
metadata-eval27.1%
neg-mul-127.1%
sub-neg27.1%
Simplified27.1%
Taylor expanded in x around inf 27.1%
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 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
add-sqr-sqrt39.7%
sqrt-unprod66.0%
sub0-neg66.0%
sub0-neg66.0%
sqr-neg66.0%
sqrt-unprod52.4%
add-sqr-sqrt53.0%
Applied egg-rr53.0%
Taylor expanded in z around 0 40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
sub-neg40.9%
Simplified40.9%
if -4 < x Initial program 93.9%
add-sqr-sqrt47.9%
fabs-sqr47.9%
add-sqr-sqrt49.0%
sub-neg49.0%
+-commutative49.0%
associate-*l/49.1%
associate-*r/49.1%
frac-2neg49.1%
+-commutative49.1%
distribute-neg-in49.1%
metadata-eval49.1%
sub-neg49.1%
distribute-frac-neg249.1%
distribute-neg-in49.1%
fma-undefine49.6%
neg-sub049.6%
fma-undefine49.1%
associate-*r/49.1%
associate-*l/49.0%
Applied egg-rr51.2%
Taylor expanded in z around 0 36.9%
associate-*r/36.9%
distribute-lft-in36.9%
metadata-eval36.9%
neg-mul-136.9%
sub-neg36.9%
Simplified36.9%
Taylor expanded in y around 0 36.9%
Final simplification37.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ z (/ y_m x)) (/ (+ 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 = z / (y_m / x);
} 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 = z / (y_m / x)
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 = z / (y_m / x);
} 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 = z / (y_m / x) 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(z / Float64(y_m / x)); 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 = z / (y_m / x); 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[(z / N[(y$95$m / x), $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 -4:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 93.5%
add-sqr-sqrt37.9%
fabs-sqr37.9%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/35.3%
associate-*r/38.3%
frac-2neg38.3%
+-commutative38.3%
distribute-neg-in38.3%
metadata-eval38.3%
sub-neg38.3%
distribute-frac-neg238.3%
distribute-neg-in38.3%
fma-undefine38.3%
neg-sub038.3%
fma-undefine38.3%
associate-*r/35.3%
associate-*l/38.4%
Applied egg-rr40.1%
Taylor expanded in z around inf 22.1%
add-sqr-sqrt21.7%
sqrt-unprod40.4%
associate-*r/40.4%
neg-sub040.4%
associate-*r/45.0%
neg-sub045.0%
sqr-neg45.0%
sqrt-unprod26.7%
add-sqr-sqrt27.1%
*-commutative27.1%
associate-/r/30.1%
Applied egg-rr30.1%
if -4 < x Initial program 93.9%
add-sqr-sqrt47.9%
fabs-sqr47.9%
add-sqr-sqrt49.0%
sub-neg49.0%
+-commutative49.0%
associate-*l/49.1%
associate-*r/49.1%
frac-2neg49.1%
+-commutative49.1%
distribute-neg-in49.1%
metadata-eval49.1%
sub-neg49.1%
distribute-frac-neg249.1%
distribute-neg-in49.1%
fma-undefine49.6%
neg-sub049.6%
fma-undefine49.1%
associate-*r/49.1%
associate-*l/49.0%
Applied egg-rr51.2%
Taylor expanded in z around 0 36.9%
associate-*r/36.9%
distribute-lft-in36.9%
metadata-eval36.9%
neg-mul-136.9%
sub-neg36.9%
Simplified36.9%
Taylor expanded in y around 0 36.9%
Final simplification35.2%
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 95.9%
add-sqr-sqrt44.2%
fabs-sqr44.2%
add-sqr-sqrt45.4%
associate-*l/44.9%
associate-*r/44.4%
Applied egg-rr44.4%
associate-*r/44.9%
clear-num44.9%
Applied egg-rr44.9%
div-inv44.9%
*-commutative44.9%
Applied egg-rr44.9%
*-commutative44.9%
associate-*l/44.9%
times-frac45.3%
associate-*l/45.4%
*-lft-identity45.4%
Simplified45.4%
Taylor expanded in x around 0 28.5%
if 4 < x Initial program 87.5%
add-sqr-sqrt48.9%
fabs-sqr48.9%
add-sqr-sqrt49.5%
sub-neg49.5%
+-commutative49.5%
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-undefine54.0%
neg-sub054.0%
fma-undefine52.5%
associate-*r/48.2%
associate-*l/49.5%
Applied egg-rr54.4%
Taylor expanded in z around 0 27.1%
associate-*r/27.1%
distribute-lft-in27.1%
metadata-eval27.1%
neg-mul-127.1%
sub-neg27.1%
Simplified27.1%
Taylor expanded in x around inf 27.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 93.8%
add-sqr-sqrt45.4%
fabs-sqr45.4%
add-sqr-sqrt46.4%
associate-*l/45.7%
associate-*r/46.5%
Applied egg-rr46.5%
associate-*r/45.7%
clear-num45.7%
Applied egg-rr45.7%
div-inv45.7%
*-commutative45.7%
Applied egg-rr45.7%
*-commutative45.7%
associate-*l/45.7%
times-frac46.4%
associate-*l/46.4%
*-lft-identity46.4%
Simplified46.4%
Taylor expanded in x around 0 22.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 93.8%
add-sqr-sqrt45.4%
fabs-sqr45.4%
add-sqr-sqrt46.4%
sub-neg46.4%
+-commutative46.4%
associate-*l/45.7%
associate-*r/46.5%
frac-2neg46.5%
+-commutative46.5%
distribute-neg-in46.5%
metadata-eval46.5%
sub-neg46.5%
distribute-frac-neg246.5%
distribute-neg-in46.5%
fma-undefine46.9%
neg-sub046.9%
fma-undefine46.5%
associate-*r/45.7%
associate-*l/46.4%
Applied egg-rr48.5%
add-sqr-sqrt47.5%
sqrt-unprod65.3%
sub0-neg65.3%
sub0-neg65.3%
sqr-neg65.3%
sqrt-unprod49.0%
add-sqr-sqrt49.9%
Applied egg-rr49.9%
Taylor expanded in x around 0 22.6%
herbie shell --seed 2024114
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))