
(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 12 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 5e-54) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-54) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 5e-54) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 5e-54], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-54}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 5.00000000000000015e-54Initial program 91.9%
associate-*l/92.5%
sub-div96.8%
Applied egg-rr96.8%
if 5.00000000000000015e-54 < y Initial program 94.8%
fabs-sub94.8%
associate-*l/89.7%
associate-*r/99.8%
fma-neg99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (fabs (- t_0 (* z (/ x y_m))))))
(if (<= t_1 5e+54)
(fabs (/ (- (+ x 4.0) (* x z)) y_m))
(if (<= t_1 INFINITY)
(fabs (- t_0 (/ z (/ y_m x))))
(fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = fabs((t_0 - (z * (x / y_m))));
double tmp;
if (t_1 <= 5e+54) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else if (t_1 <= ((double) INFINITY)) {
tmp = fabs((t_0 - (z / (y_m / x))));
} else {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = abs(Float64(t_0 - Float64(z * Float64(x / y_m)))) tmp = 0.0 if (t_1 <= 5e+54) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); elseif (t_1 <= Inf) tmp = abs(Float64(t_0 - Float64(z / Float64(y_m / x)))); else tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 5e+54], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[Abs[N[(t$95$0 - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := \left|t\_0 - z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+54}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left|t\_0 - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 5.00000000000000005e54Initial program 95.7%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
if 5.00000000000000005e54 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < +inf.0Initial program 99.8%
Taylor expanded in x around 0 90.6%
associate-*r/95.9%
*-commutative95.9%
associate-/r/99.8%
Simplified99.8%
if +inf.0 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 0.0%
Simplified100.0%
Final simplification99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (fabs (- t_0 (* z (/ x y_m))))))
(if (or (<= t_1 5e+54) (not (<= t_1 INFINITY)))
(fabs (/ (- (+ x 4.0) (* x z)) y_m))
(fabs (- t_0 (/ z (/ y_m x)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = fabs((t_0 - (z * (x / y_m))));
double tmp;
if ((t_1 <= 5e+54) || !(t_1 <= ((double) INFINITY))) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((t_0 - (z / (y_m / x))));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = Math.abs((t_0 - (z * (x / y_m))));
double tmp;
if ((t_1 <= 5e+54) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((t_0 - (z / (y_m / x))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = math.fabs((t_0 - (z * (x / y_m)))) tmp = 0 if (t_1 <= 5e+54) or not (t_1 <= math.inf): tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((t_0 - (z / (y_m / x)))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = abs(Float64(t_0 - Float64(z * Float64(x / y_m)))) tmp = 0.0 if ((t_1 <= 5e+54) || !(t_1 <= Inf)) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(t_0 - Float64(z / Float64(y_m / x)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = abs((t_0 - (z * (x / y_m)))); tmp = 0.0; if ((t_1 <= 5e+54) || ~((t_1 <= Inf))) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((t_0 - (z / (y_m / x)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$1, 5e+54], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(t$95$0 - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := \left|t\_0 - z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+54} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0 - \frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 5.00000000000000005e54 or +inf.0 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 84.2%
associate-*l/93.0%
sub-div99.9%
Applied egg-rr99.9%
if 5.00000000000000005e54 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < +inf.0Initial program 99.8%
Taylor expanded in x around 0 90.6%
associate-*r/95.9%
*-commutative95.9%
associate-/r/99.8%
Simplified99.8%
Final simplification99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))))
(if (or (<= t_0 50000.0) (not (<= t_0 INFINITY)))
(fabs (/ (- (+ x 4.0) (* x z)) y_m))
t_0)))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((((x + 4.0) / y_m) - (z * (x / y_m))));
double tmp;
if ((t_0 <= 50000.0) || !(t_0 <= ((double) INFINITY))) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((((x + 4.0) / y_m) - (z * (x / y_m))));
double tmp;
if ((t_0 <= 50000.0) || !(t_0 <= Double.POSITIVE_INFINITY)) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((((x + 4.0) / y_m) - (z * (x / y_m)))) tmp = 0 if (t_0 <= 50000.0) or not (t_0 <= math.inf): tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m)))) tmp = 0.0 if ((t_0 <= 50000.0) || !(t_0 <= Inf)) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((((x + 4.0) / y_m) - (z * (x / y_m)))); tmp = 0.0; if ((t_0 <= 50000.0) || ~((t_0 <= Inf))) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$0, 50000.0], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;t\_0 \leq 50000 \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 5e4 or +inf.0 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 82.5%
associate-*l/92.3%
sub-div99.9%
Applied egg-rr99.9%
if 5e4 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < +inf.0Initial program 99.8%
Final simplification99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -3.05e+172)
t_0
(if (<= x -3.5e+145)
t_1
(if (<= x -1.7e+61)
(fabs (* x (/ z y_m)))
(if (<= x -10.4) t_1 (if (<= x 2.4e-15) (fabs (/ 4.0 y_m)) t_0)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -3.05e+172) {
tmp = t_0;
} else if (x <= -3.5e+145) {
tmp = t_1;
} else if (x <= -1.7e+61) {
tmp = fabs((x * (z / y_m)));
} else if (x <= -10.4) {
tmp = t_1;
} else if (x <= 2.4e-15) {
tmp = fabs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-3.05d+172)) then
tmp = t_0
else if (x <= (-3.5d+145)) then
tmp = t_1
else if (x <= (-1.7d+61)) then
tmp = abs((x * (z / y_m)))
else if (x <= (-10.4d0)) then
tmp = t_1
else if (x <= 2.4d-15) then
tmp = abs((4.0d0 / y_m))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -3.05e+172) {
tmp = t_0;
} else if (x <= -3.5e+145) {
tmp = t_1;
} else if (x <= -1.7e+61) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= -10.4) {
tmp = t_1;
} else if (x <= 2.4e-15) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -3.05e+172: tmp = t_0 elif x <= -3.5e+145: tmp = t_1 elif x <= -1.7e+61: tmp = math.fabs((x * (z / y_m))) elif x <= -10.4: tmp = t_1 elif x <= 2.4e-15: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -3.05e+172) tmp = t_0; elseif (x <= -3.5e+145) tmp = t_1; elseif (x <= -1.7e+61) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= -10.4) tmp = t_1; elseif (x <= 2.4e-15) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -3.05e+172) tmp = t_0; elseif (x <= -3.5e+145) tmp = t_1; elseif (x <= -1.7e+61) tmp = abs((x * (z / y_m))); elseif (x <= -10.4) tmp = t_1; elseif (x <= 2.4e-15) tmp = abs((4.0 / y_m)); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3.05e+172], t$95$0, If[LessEqual[x, -3.5e+145], t$95$1, If[LessEqual[x, -1.7e+61], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -10.4], t$95$1, If[LessEqual[x, 2.4e-15], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y\_m}\right|\\
t_1 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -3.05 \cdot 10^{+172}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.7 \cdot 10^{+61}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;x \leq -10.4:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-15}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.0499999999999999e172 or 2.39999999999999995e-15 < x Initial program 85.2%
Simplified87.3%
Taylor expanded in z around inf 56.3%
associate-*r/56.3%
neg-mul-156.3%
distribute-rgt-neg-in56.3%
Simplified56.3%
*-commutative56.3%
associate-/l*78.2%
add-sqr-sqrt45.1%
sqrt-unprod58.8%
sqr-neg58.8%
sqrt-unprod32.8%
add-sqr-sqrt78.2%
Applied egg-rr78.2%
if -3.0499999999999999e172 < x < -3.5000000000000001e145 or -1.70000000000000013e61 < x < -10.4000000000000004Initial program 94.7%
Taylor expanded in z around 0 90.1%
Taylor expanded in x around inf 86.2%
if -3.5000000000000001e145 < x < -1.70000000000000013e61Initial program 99.6%
Simplified87.1%
Taylor expanded in z around inf 68.7%
associate-*r/68.7%
neg-mul-168.7%
distribute-rgt-neg-in68.7%
Simplified68.7%
distribute-rgt-neg-out68.7%
distribute-frac-neg68.7%
distribute-frac-neg268.7%
associate-*r/81.5%
*-commutative81.5%
add-sqr-sqrt27.6%
sqrt-unprod35.8%
sqr-neg35.8%
sqrt-unprod53.4%
add-sqr-sqrt81.5%
Applied egg-rr81.5%
if -10.4000000000000004 < x < 2.39999999999999995e-15Initial program 96.7%
Simplified99.8%
Taylor expanded in x around 0 75.0%
Final simplification77.3%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -2.15e+170)
t_0
(if (<= x -8.2e+142)
t_1
(if (<= x -7.8e+57)
t_0
(if (<= x -10.4) t_1 (if (<= x 2.4e-15) (fabs (/ 4.0 y_m)) t_0)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -2.15e+170) {
tmp = t_0;
} else if (x <= -8.2e+142) {
tmp = t_1;
} else if (x <= -7.8e+57) {
tmp = t_0;
} else if (x <= -10.4) {
tmp = t_1;
} else if (x <= 2.4e-15) {
tmp = fabs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-2.15d+170)) then
tmp = t_0
else if (x <= (-8.2d+142)) then
tmp = t_1
else if (x <= (-7.8d+57)) then
tmp = t_0
else if (x <= (-10.4d0)) then
tmp = t_1
else if (x <= 2.4d-15) then
tmp = abs((4.0d0 / y_m))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -2.15e+170) {
tmp = t_0;
} else if (x <= -8.2e+142) {
tmp = t_1;
} else if (x <= -7.8e+57) {
tmp = t_0;
} else if (x <= -10.4) {
tmp = t_1;
} else if (x <= 2.4e-15) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -2.15e+170: tmp = t_0 elif x <= -8.2e+142: tmp = t_1 elif x <= -7.8e+57: tmp = t_0 elif x <= -10.4: tmp = t_1 elif x <= 2.4e-15: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -2.15e+170) tmp = t_0; elseif (x <= -8.2e+142) tmp = t_1; elseif (x <= -7.8e+57) tmp = t_0; elseif (x <= -10.4) tmp = t_1; elseif (x <= 2.4e-15) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -2.15e+170) tmp = t_0; elseif (x <= -8.2e+142) tmp = t_1; elseif (x <= -7.8e+57) tmp = t_0; elseif (x <= -10.4) tmp = t_1; elseif (x <= 2.4e-15) tmp = abs((4.0 / y_m)); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.15e+170], t$95$0, If[LessEqual[x, -8.2e+142], t$95$1, If[LessEqual[x, -7.8e+57], t$95$0, If[LessEqual[x, -10.4], t$95$1, If[LessEqual[x, 2.4e-15], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y\_m}\right|\\
t_1 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -10.4:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-15}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.1499999999999999e170 or -8.19999999999999963e142 < x < -7.79999999999999937e57 or 2.39999999999999995e-15 < x Initial program 87.3%
Simplified87.2%
Taylor expanded in z around inf 58.1%
associate-*r/58.1%
neg-mul-158.1%
distribute-rgt-neg-in58.1%
Simplified58.1%
*-commutative58.1%
associate-/l*78.6%
add-sqr-sqrt47.4%
sqrt-unprod58.4%
sqr-neg58.4%
sqrt-unprod31.0%
add-sqr-sqrt78.6%
Applied egg-rr78.6%
if -2.1499999999999999e170 < x < -8.19999999999999963e142 or -7.79999999999999937e57 < x < -10.4000000000000004Initial program 94.7%
Taylor expanded in z around 0 90.1%
Taylor expanded in x around inf 86.2%
if -10.4000000000000004 < x < 2.39999999999999995e-15Initial program 96.7%
Simplified99.8%
Taylor expanded in x around 0 75.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1e+17) (not (<= x 2e+70))) (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 <= -1e+17) || !(x <= 2e+70)) {
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 <= (-1d+17)) .or. (.not. (x <= 2d+70))) 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 <= -1e+17) || !(x <= 2e+70)) {
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 <= -1e+17) or not (x <= 2e+70): 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 <= -1e+17) || !(x <= 2e+70)) 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 <= -1e+17) || ~((x <= 2e+70))) 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[Or[LessEqual[x, -1e+17], N[Not[LessEqual[x, 2e+70]], $MachinePrecision]], 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 \cdot 10^{+17} \lor \neg \left(x \leq 2 \cdot 10^{+70}\right):\\
\;\;\;\;\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 < -1e17 or 2.00000000000000015e70 < x Initial program 87.9%
Simplified87.8%
Taylor expanded in x around inf 88.0%
mul-1-neg88.0%
*-commutative88.0%
associate-/l*99.8%
distribute-lft-neg-in99.8%
neg-sub099.8%
associate-+l-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
if -1e17 < x < 2.00000000000000015e70Initial program 96.3%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -66000000000000.0) (fabs (* (/ x y_m) (- 1.0 z))) (if (<= z 4.2e+56) (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 <= -66000000000000.0) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else if (z <= 4.2e+56) {
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 <= (-66000000000000.0d0)) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else if (z <= 4.2d+56) 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 <= -66000000000000.0) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else if (z <= 4.2e+56) {
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 <= -66000000000000.0: tmp = math.fabs(((x / y_m) * (1.0 - z))) elif z <= 4.2e+56: 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 <= -66000000000000.0) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); elseif (z <= 4.2e+56) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x * Float64(z / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -66000000000000.0) tmp = abs(((x / y_m) * (1.0 - z))); elseif (z <= 4.2e+56) 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, -66000000000000.0], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.2e+56], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -66000000000000:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+56}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if z < -6.6e13Initial program 98.5%
Simplified89.5%
Taylor expanded in x around inf 70.0%
mul-1-neg70.0%
*-commutative70.0%
associate-/l*78.8%
distribute-lft-neg-in78.8%
neg-sub078.8%
associate-+l-78.8%
neg-sub078.8%
+-commutative78.8%
unsub-neg78.8%
Simplified78.8%
if -6.6e13 < z < 4.20000000000000034e56Initial program 92.7%
Simplified99.9%
Taylor expanded in z around 0 96.3%
+-commutative96.3%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt96.3%
fabs-neg96.3%
distribute-neg-frac96.3%
distribute-neg-in96.3%
metadata-eval96.3%
+-commutative96.3%
sub-neg96.3%
rem-square-sqrt48.2%
fabs-sqr48.2%
rem-square-sqrt96.3%
Simplified96.3%
if 4.20000000000000034e56 < z Initial program 83.3%
Simplified87.3%
Taylor expanded in z around inf 72.0%
mul-1-neg72.0%
distribute-frac-neg272.0%
associate-/l*80.4%
Simplified80.4%
Final simplification88.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -31000000000000.0) (fabs (* z (/ x y_m))) (if (<= z 2.25e+54) (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 <= -31000000000000.0) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 2.25e+54) {
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 <= (-31000000000000.0d0)) then
tmp = abs((z * (x / y_m)))
else if (z <= 2.25d+54) 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 <= -31000000000000.0) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 2.25e+54) {
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 <= -31000000000000.0: tmp = math.fabs((z * (x / y_m))) elif z <= 2.25e+54: 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 <= -31000000000000.0) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 2.25e+54) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x * Float64(z / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -31000000000000.0) tmp = abs((z * (x / y_m))); elseif (z <= 2.25e+54) 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, -31000000000000.0], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+54], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -31000000000000:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+54}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if z < -3.1e13Initial program 98.5%
Simplified89.5%
Taylor expanded in z around inf 69.9%
associate-*r/69.9%
neg-mul-169.9%
distribute-rgt-neg-in69.9%
Simplified69.9%
*-commutative69.9%
associate-/l*78.7%
add-sqr-sqrt78.4%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod0.0%
add-sqr-sqrt78.7%
Applied egg-rr78.7%
if -3.1e13 < z < 2.24999999999999992e54Initial program 92.7%
Simplified99.9%
Taylor expanded in z around 0 96.3%
+-commutative96.3%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt96.3%
fabs-neg96.3%
distribute-neg-frac96.3%
distribute-neg-in96.3%
metadata-eval96.3%
+-commutative96.3%
sub-neg96.3%
rem-square-sqrt48.2%
fabs-sqr48.2%
rem-square-sqrt96.3%
Simplified96.3%
if 2.24999999999999992e54 < z Initial program 83.3%
Simplified87.3%
Taylor expanded in z around inf 72.0%
mul-1-neg72.0%
distribute-frac-neg272.0%
associate-/l*80.4%
Simplified80.4%
Final simplification88.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -8200000000000.0) (fabs (* z (/ x y_m))) (if (<= z 1.66e+53) (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 <= -8200000000000.0) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1.66e+53) {
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 <= (-8200000000000.0d0)) then
tmp = abs((z * (x / y_m)))
else if (z <= 1.66d+53) 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 <= -8200000000000.0) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1.66e+53) {
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 <= -8200000000000.0: tmp = math.fabs((z * (x / y_m))) elif z <= 1.66e+53: 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 <= -8200000000000.0) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1.66e+53) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x * Float64(z / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -8200000000000.0) tmp = abs((z * (x / y_m))); elseif (z <= 1.66e+53) 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, -8200000000000.0], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.66e+53], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8200000000000:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.66 \cdot 10^{+53}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if z < -8.2e12Initial program 98.5%
Simplified89.5%
Taylor expanded in z around inf 69.9%
associate-*r/69.9%
neg-mul-169.9%
distribute-rgt-neg-in69.9%
Simplified69.9%
*-commutative69.9%
associate-/l*78.7%
add-sqr-sqrt78.4%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod0.0%
add-sqr-sqrt78.7%
Applied egg-rr78.7%
if -8.2e12 < z < 1.65999999999999999e53Initial program 92.7%
Simplified99.9%
Taylor expanded in z around 0 96.3%
+-commutative96.3%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt96.3%
fabs-neg96.3%
distribute-neg-frac96.3%
distribute-neg-in96.3%
metadata-eval96.3%
+-commutative96.3%
sub-neg96.3%
rem-square-sqrt48.2%
fabs-sqr48.2%
rem-square-sqrt96.3%
Simplified96.3%
if 1.65999999999999999e53 < z Initial program 83.3%
Simplified87.3%
Taylor expanded in z around inf 72.0%
associate-*r/72.0%
neg-mul-172.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
distribute-rgt-neg-out72.0%
distribute-frac-neg72.0%
distribute-frac-neg272.0%
associate-*r/80.4%
*-commutative80.4%
add-sqr-sqrt42.1%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod38.1%
add-sqr-sqrt80.4%
Applied egg-rr80.4%
Final simplification88.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -10.4) (not (<= x 4.0))) (fabs (/ x y_m)) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -10.4) || !(x <= 4.0)) {
tmp = fabs((x / y_m));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-10.4d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y_m))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -10.4) || !(x <= 4.0)) {
tmp = Math.abs((x / y_m));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -10.4) or not (x <= 4.0): tmp = math.fabs((x / y_m)) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -10.4) || !(x <= 4.0)) tmp = abs(Float64(x / y_m)); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -10.4) || ~((x <= 4.0))) tmp = abs((x / y_m)); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -10.4], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.4 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -10.4000000000000004 or 4 < x Initial program 88.3%
Taylor expanded in z around 0 59.1%
Taylor expanded in x around inf 58.2%
if -10.4000000000000004 < x < 4Initial program 96.7%
Simplified99.8%
Taylor expanded in x around 0 73.9%
Final simplification66.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y\_m}\right|
\end{array}
Initial program 92.7%
Simplified94.7%
Taylor expanded in x around 0 41.4%
herbie shell --seed 2024103
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))