
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1.08e-47) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1.08e-47) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1.08e-47) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1.08e-47], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 1.08 \cdot 10^{-47}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 1.08000000000000005e-47Initial program 88.5%
Simplified98.4%
if 1.08000000000000005e-47 < y Initial program 93.9%
fabs-sub93.9%
associate-*l/95.2%
associate-*r/98.3%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
}
y_m = abs(y) function code(x, y_m, z) return abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := 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|
\\
\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|
\end{array}
Initial program 89.8%
Simplified98.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* z (/ x y_m))) (t_1 (- (/ (+ x 4.0) y_m) t_0)))
(if (<= t_1 -2e-275)
(+ (/ (- -4.0 x) y_m) t_0)
(if (<= t_1 INFINITY)
(/ (- (+ x 4.0) (* x z)) y_m)
(fabs (* (/ -1.0 y_m) (* x z)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double t_1 = ((x + 4.0) / y_m) - t_0;
double tmp;
if (t_1 <= -2e-275) {
tmp = ((-4.0 - x) / y_m) + t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = fabs(((-1.0 / y_m) * (x * z)));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double t_1 = ((x + 4.0) / y_m) - t_0;
double tmp;
if (t_1 <= -2e-275) {
tmp = ((-4.0 - x) / y_m) + t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = Math.abs(((-1.0 / y_m) * (x * z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = z * (x / y_m) t_1 = ((x + 4.0) / y_m) - t_0 tmp = 0 if t_1 <= -2e-275: tmp = ((-4.0 - x) / y_m) + t_0 elif t_1 <= math.inf: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = math.fabs(((-1.0 / y_m) * (x * z))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(z * Float64(x / y_m)) t_1 = Float64(Float64(Float64(x + 4.0) / y_m) - t_0) tmp = 0.0 if (t_1 <= -2e-275) tmp = Float64(Float64(Float64(-4.0 - x) / y_m) + t_0); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = abs(Float64(Float64(-1.0 / y_m) * Float64(x * z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = z * (x / y_m); t_1 = ((x + 4.0) / y_m) - t_0; tmp = 0.0; if (t_1 <= -2e-275) tmp = ((-4.0 - x) / y_m) + t_0; elseif (t_1 <= Inf) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = abs(((-1.0 / y_m) * (x * z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-275], N[(N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := z \cdot \frac{x}{y\_m}\\
t_1 := \frac{x + 4}{y\_m} - t\_0\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{-4 - x}{y\_m} + t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \left(x \cdot z\right)\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999987e-275Initial program 96.5%
fabs-sub96.5%
associate-*l/98.4%
associate-*r/94.6%
fmm-def94.6%
distribute-neg-frac94.6%
+-commutative94.6%
distribute-neg-in94.6%
unsub-neg94.6%
metadata-eval94.6%
Simplified94.6%
Applied egg-rr96.5%
if -1.99999999999999987e-275 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 97.5%
fabs-sub97.5%
associate-*l/97.4%
associate-*r/94.2%
fmm-def94.2%
distribute-neg-frac94.2%
+-commutative94.2%
distribute-neg-in94.2%
unsub-neg94.2%
metadata-eval94.2%
Simplified94.2%
fma-undefine94.2%
associate-*r/97.4%
associate-*l/97.5%
div-inv97.4%
sub-neg97.4%
metadata-eval97.4%
distribute-neg-in97.4%
+-commutative97.4%
cancel-sign-sub-inv97.4%
div-inv97.5%
fabs-sub97.5%
add-sqr-sqrt94.4%
fabs-sqr94.4%
add-sqr-sqrt95.2%
associate-*l/94.1%
sub-div94.1%
Applied egg-rr94.1%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
Simplified100.0%
Taylor expanded in z around inf 65.2%
Final simplification93.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))) (if (<= t_0 INFINITY) (fabs t_0) (fabs (* (/ -1.0 y_m) (* x z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = fabs(t_0);
} else {
tmp = fabs(((-1.0 / y_m) * (x * z)));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs(((-1.0 / y_m) * (x * z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)) tmp = 0 if t_0 <= math.inf: tmp = math.fabs(t_0) else: tmp = math.fabs(((-1.0 / y_m) * (x * z))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= Inf) tmp = abs(t_0); else tmp = abs(Float64(Float64(-1.0 / y_m) * Float64(x * z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= Inf) tmp = abs(t_0); else tmp = abs(((-1.0 / y_m) * (x * z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \left(x \cdot z\right)\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 97.0%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
Simplified100.0%
Taylor expanded in z around inf 65.2%
Final simplification94.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* z (/ x y_m))) (t_1 (- (/ (+ x 4.0) y_m) t_0)))
(if (<= t_1 -2e-275)
(+ (/ (- -4.0 x) y_m) t_0)
(if (<= t_1 INFINITY)
(/ (- (+ x 4.0) (* x z)) y_m)
(/ (- (* x z) x) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double t_1 = ((x + 4.0) / y_m) - t_0;
double tmp;
if (t_1 <= -2e-275) {
tmp = ((-4.0 - x) / y_m) + t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((x * z) - x) / y_m;
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double t_1 = ((x + 4.0) / y_m) - t_0;
double tmp;
if (t_1 <= -2e-275) {
tmp = ((-4.0 - x) / y_m) + t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((x * z) - x) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = z * (x / y_m) t_1 = ((x + 4.0) / y_m) - t_0 tmp = 0 if t_1 <= -2e-275: tmp = ((-4.0 - x) / y_m) + t_0 elif t_1 <= math.inf: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = ((x * z) - x) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(z * Float64(x / y_m)) t_1 = Float64(Float64(Float64(x + 4.0) / y_m) - t_0) tmp = 0.0 if (t_1 <= -2e-275) tmp = Float64(Float64(Float64(-4.0 - x) / y_m) + t_0); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(Float64(Float64(x * z) - x) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = z * (x / y_m); t_1 = ((x + 4.0) / y_m) - t_0; tmp = 0.0; if (t_1 <= -2e-275) tmp = ((-4.0 - x) / y_m) + t_0; elseif (t_1 <= Inf) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = ((x * z) - 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[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-275], N[(N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y$95$m), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := z \cdot \frac{x}{y\_m}\\
t_1 := \frac{x + 4}{y\_m} - t\_0\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{-4 - x}{y\_m} + t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot z - x}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999987e-275Initial program 96.5%
fabs-sub96.5%
associate-*l/98.4%
associate-*r/94.6%
fmm-def94.6%
distribute-neg-frac94.6%
+-commutative94.6%
distribute-neg-in94.6%
unsub-neg94.6%
metadata-eval94.6%
Simplified94.6%
Applied egg-rr96.5%
if -1.99999999999999987e-275 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 97.5%
fabs-sub97.5%
associate-*l/97.4%
associate-*r/94.2%
fmm-def94.2%
distribute-neg-frac94.2%
+-commutative94.2%
distribute-neg-in94.2%
unsub-neg94.2%
metadata-eval94.2%
Simplified94.2%
fma-undefine94.2%
associate-*r/97.4%
associate-*l/97.5%
div-inv97.4%
sub-neg97.4%
metadata-eval97.4%
distribute-neg-in97.4%
+-commutative97.4%
cancel-sign-sub-inv97.4%
div-inv97.5%
fabs-sub97.5%
add-sqr-sqrt94.4%
fabs-sqr94.4%
add-sqr-sqrt95.2%
associate-*l/94.1%
sub-div94.1%
Applied egg-rr94.1%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
fabs-sub0.0%
associate-*l/36.8%
associate-*r/36.8%
fmm-def73.7%
distribute-neg-frac73.7%
+-commutative73.7%
distribute-neg-in73.7%
unsub-neg73.7%
metadata-eval73.7%
Simplified73.7%
add-sqr-sqrt36.8%
fabs-sqr36.8%
add-sqr-sqrt36.8%
fma-undefine21.1%
associate-*r/21.1%
associate-*l/0.0%
div-inv0.0%
sub-neg0.0%
metadata-eval0.0%
distribute-neg-in0.0%
+-commutative0.0%
cancel-sign-sub-inv0.0%
div-inv0.0%
associate-*l/21.1%
sub-div68.4%
Applied egg-rr68.4%
Taylor expanded in x around inf 68.4%
Final simplification93.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (- (/ (+ x 4.0) y_m) (* z (/ x y_m)))))
(if (<= t_0 -2e-275)
(/ (- (* x z) (+ x 4.0)) y_m)
(if (<= t_0 INFINITY)
(/ (- (+ x 4.0) (* x z)) y_m)
(/ (- (* x z) x) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= -2e-275) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((x * z) - x) / y_m;
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= -2e-275) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((x * z) - x) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)) tmp = 0 if t_0 <= -2e-275: tmp = ((x * z) - (x + 4.0)) / y_m elif t_0 <= math.inf: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = ((x * z) - x) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= -2e-275) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(Float64(Float64(x * z) - x) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= -2e-275) tmp = ((x * z) - (x + 4.0)) / y_m; elseif (t_0 <= Inf) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = ((x * z) - x) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-275], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-275}:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot z - x}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999987e-275Initial program 96.5%
fabs-sub96.5%
associate-*l/98.4%
associate-*r/94.6%
fmm-def94.6%
distribute-neg-frac94.6%
+-commutative94.6%
distribute-neg-in94.6%
unsub-neg94.6%
metadata-eval94.6%
Simplified94.6%
add-sqr-sqrt92.2%
fabs-sqr92.2%
add-sqr-sqrt92.9%
fma-undefine92.9%
associate-*r/96.8%
associate-*l/96.5%
div-inv96.4%
sub-neg96.4%
metadata-eval96.4%
distribute-neg-in96.4%
+-commutative96.4%
cancel-sign-sub-inv96.4%
div-inv96.5%
associate-*l/96.8%
sub-div96.8%
Applied egg-rr96.8%
if -1.99999999999999987e-275 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 97.5%
fabs-sub97.5%
associate-*l/97.4%
associate-*r/94.2%
fmm-def94.2%
distribute-neg-frac94.2%
+-commutative94.2%
distribute-neg-in94.2%
unsub-neg94.2%
metadata-eval94.2%
Simplified94.2%
fma-undefine94.2%
associate-*r/97.4%
associate-*l/97.5%
div-inv97.4%
sub-neg97.4%
metadata-eval97.4%
distribute-neg-in97.4%
+-commutative97.4%
cancel-sign-sub-inv97.4%
div-inv97.5%
fabs-sub97.5%
add-sqr-sqrt94.4%
fabs-sqr94.4%
add-sqr-sqrt95.2%
associate-*l/94.1%
sub-div94.1%
Applied egg-rr94.1%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
fabs-sub0.0%
associate-*l/36.8%
associate-*r/36.8%
fmm-def73.7%
distribute-neg-frac73.7%
+-commutative73.7%
distribute-neg-in73.7%
unsub-neg73.7%
metadata-eval73.7%
Simplified73.7%
add-sqr-sqrt36.8%
fabs-sqr36.8%
add-sqr-sqrt36.8%
fma-undefine21.1%
associate-*r/21.1%
associate-*l/0.0%
div-inv0.0%
sub-neg0.0%
metadata-eval0.0%
distribute-neg-in0.0%
+-commutative0.0%
cancel-sign-sub-inv0.0%
div-inv0.0%
associate-*l/21.1%
sub-div68.4%
Applied egg-rr68.4%
Taylor expanded in x around inf 68.4%
Final simplification93.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.7e+101)
(/ x (- y_m))
(if (<= x -3.2e-11)
(* z (/ x y_m))
(if (<= x 4.2e-6) (/ (- 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.7e+101) {
tmp = x / -y_m;
} else if (x <= -3.2e-11) {
tmp = z * (x / y_m);
} else if (x <= 4.2e-6) {
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.7d+101)) then
tmp = x / -y_m
else if (x <= (-3.2d-11)) then
tmp = z * (x / y_m)
else if (x <= 4.2d-6) 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.7e+101) {
tmp = x / -y_m;
} else if (x <= -3.2e-11) {
tmp = z * (x / y_m);
} else if (x <= 4.2e-6) {
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.7e+101: tmp = x / -y_m elif x <= -3.2e-11: tmp = z * (x / y_m) elif x <= 4.2e-6: 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.7e+101) tmp = Float64(x / Float64(-y_m)); elseif (x <= -3.2e-11) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 4.2e-6) 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.7e+101) tmp = x / -y_m; elseif (x <= -3.2e-11) tmp = z * (x / y_m); elseif (x <= 4.2e-6) 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.7e+101], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -3.2e-11], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-6], 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.7 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4.69999999999999971e101Initial program 78.9%
fabs-sub78.9%
associate-*l/81.9%
associate-*r/86.8%
fmm-def97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt49.8%
fabs-sqr49.8%
add-sqr-sqrt50.2%
fma-undefine44.9%
associate-*r/44.9%
associate-*l/39.7%
div-inv39.5%
sub-neg39.5%
metadata-eval39.5%
distribute-neg-in39.5%
+-commutative39.5%
cancel-sign-sub-inv39.5%
div-inv39.7%
associate-*l/44.9%
sub-div52.8%
Applied egg-rr52.8%
Taylor expanded in z around 0 40.9%
associate-*r/40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
sub-neg40.9%
Simplified40.9%
Taylor expanded in x around inf 40.9%
neg-mul-140.9%
Simplified40.9%
if -4.69999999999999971e101 < x < -3.19999999999999994e-11Initial program 99.8%
fabs-sub99.8%
associate-*l/99.6%
associate-*r/99.8%
fmm-def99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
fma-undefine99.8%
associate-*r/99.6%
associate-*l/99.8%
div-inv99.6%
sub-neg99.6%
metadata-eval99.6%
distribute-neg-in99.6%
+-commutative99.6%
cancel-sign-sub-inv99.6%
div-inv99.8%
fabs-sub99.8%
add-sqr-sqrt47.8%
fabs-sqr47.8%
add-sqr-sqrt48.5%
associate-*l/48.4%
sub-div48.4%
Applied egg-rr48.4%
div-inv48.4%
associate--l+48.4%
*-commutative48.4%
cancel-sign-sub-inv48.4%
add-sqr-sqrt32.3%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod28.1%
add-sqr-sqrt42.4%
*-commutative42.4%
Applied egg-rr42.4%
Taylor expanded in z around inf 31.8%
associate-*l/35.6%
*-commutative35.6%
Simplified35.6%
if -3.19999999999999994e-11 < x < 4.1999999999999996e-6Initial program 94.6%
fabs-sub94.6%
associate-*l/99.9%
associate-*r/89.8%
fmm-def89.8%
distribute-neg-frac89.8%
+-commutative89.8%
distribute-neg-in89.8%
unsub-neg89.8%
metadata-eval89.8%
Simplified89.8%
fma-undefine89.8%
associate-*r/99.9%
associate-*l/94.6%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.6%
fabs-sub94.6%
add-sqr-sqrt41.8%
fabs-sqr41.8%
add-sqr-sqrt43.2%
associate-*l/46.0%
sub-div46.0%
Applied egg-rr46.0%
Taylor expanded in x around 0 45.9%
if 4.1999999999999996e-6 < x Initial program 82.8%
fabs-sub82.8%
associate-*l/84.6%
associate-*r/89.0%
fmm-def93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine89.0%
associate-*r/84.6%
associate-*l/82.8%
div-inv82.6%
sub-neg82.6%
metadata-eval82.6%
distribute-neg-in82.6%
+-commutative82.6%
cancel-sign-sub-inv82.6%
div-inv82.8%
fabs-sub82.8%
add-sqr-sqrt43.4%
fabs-sqr43.4%
add-sqr-sqrt44.0%
associate-*l/45.6%
sub-div47.1%
Applied egg-rr47.1%
Taylor expanded in z around 0 40.2%
Final simplification42.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.7e+101)
(/ x (- y_m))
(if (<= x -1.55e-12)
(* z (/ x y_m))
(if (<= x 4.0) (/ 4.0 y_m) (/ x y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.7e+101) {
tmp = x / -y_m;
} else if (x <= -1.55e-12) {
tmp = z * (x / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.7d+101)) then
tmp = x / -y_m
else if (x <= (-1.55d-12)) then
tmp = z * (x / y_m)
else if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = x / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.7e+101) {
tmp = x / -y_m;
} else if (x <= -1.55e-12) {
tmp = z * (x / y_m);
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.7e+101: tmp = x / -y_m elif x <= -1.55e-12: tmp = z * (x / y_m) elif x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.7e+101) tmp = Float64(x / Float64(-y_m)); elseif (x <= -1.55e-12) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.7e+101) tmp = x / -y_m; elseif (x <= -1.55e-12) tmp = z * (x / y_m); elseif (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.7e+101], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -1.55e-12], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-12}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -4.69999999999999971e101Initial program 78.9%
fabs-sub78.9%
associate-*l/81.9%
associate-*r/86.8%
fmm-def97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt49.8%
fabs-sqr49.8%
add-sqr-sqrt50.2%
fma-undefine44.9%
associate-*r/44.9%
associate-*l/39.7%
div-inv39.5%
sub-neg39.5%
metadata-eval39.5%
distribute-neg-in39.5%
+-commutative39.5%
cancel-sign-sub-inv39.5%
div-inv39.7%
associate-*l/44.9%
sub-div52.8%
Applied egg-rr52.8%
Taylor expanded in z around 0 40.9%
associate-*r/40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
sub-neg40.9%
Simplified40.9%
Taylor expanded in x around inf 40.9%
neg-mul-140.9%
Simplified40.9%
if -4.69999999999999971e101 < x < -1.5500000000000001e-12Initial program 99.8%
fabs-sub99.8%
associate-*l/99.6%
associate-*r/99.8%
fmm-def99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
fma-undefine99.8%
associate-*r/99.6%
associate-*l/99.8%
div-inv99.6%
sub-neg99.6%
metadata-eval99.6%
distribute-neg-in99.6%
+-commutative99.6%
cancel-sign-sub-inv99.6%
div-inv99.8%
fabs-sub99.8%
add-sqr-sqrt47.8%
fabs-sqr47.8%
add-sqr-sqrt48.5%
associate-*l/48.4%
sub-div48.4%
Applied egg-rr48.4%
div-inv48.4%
associate--l+48.4%
*-commutative48.4%
cancel-sign-sub-inv48.4%
add-sqr-sqrt32.3%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod28.1%
add-sqr-sqrt42.4%
*-commutative42.4%
Applied egg-rr42.4%
Taylor expanded in z around inf 31.8%
associate-*l/35.6%
*-commutative35.6%
Simplified35.6%
if -1.5500000000000001e-12 < x < 4Initial program 94.6%
fabs-sub94.6%
associate-*l/99.9%
associate-*r/89.9%
fmm-def90.0%
distribute-neg-frac90.0%
+-commutative90.0%
distribute-neg-in90.0%
unsub-neg90.0%
metadata-eval90.0%
Simplified90.0%
fma-undefine89.9%
associate-*r/99.9%
associate-*l/94.6%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.6%
fabs-sub94.6%
add-sqr-sqrt42.6%
fabs-sqr42.6%
add-sqr-sqrt44.0%
associate-*l/46.8%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in x around 0 34.3%
if 4 < x Initial program 82.3%
fabs-sub82.3%
associate-*l/84.1%
associate-*r/88.7%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
fma-undefine88.7%
associate-*r/84.1%
associate-*l/82.3%
div-inv82.0%
sub-neg82.0%
metadata-eval82.0%
distribute-neg-in82.0%
+-commutative82.0%
cancel-sign-sub-inv82.0%
div-inv82.3%
fabs-sub82.3%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt42.2%
associate-*l/43.8%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in z around 0 39.7%
Taylor expanded in x around inf 38.8%
Final simplification36.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -5e+19) (/ x (- y_m)) (if (<= x -6.1e-12) (* 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 <= -5e+19) {
tmp = x / -y_m;
} else if (x <= -6.1e-12) {
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 <= (-5d+19)) then
tmp = x / -y_m
else if (x <= (-6.1d-12)) 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 <= -5e+19) {
tmp = x / -y_m;
} else if (x <= -6.1e-12) {
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 <= -5e+19: tmp = x / -y_m elif x <= -6.1e-12: 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 <= -5e+19) tmp = Float64(x / Float64(-y_m)); elseif (x <= -6.1e-12) 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 <= -5e+19) tmp = x / -y_m; elseif (x <= -6.1e-12) 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, -5e+19], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -6.1e-12], 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 -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -6.1 \cdot 10^{-12}:\\
\;\;\;\;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 < -5e19Initial program 84.5%
fabs-sub84.5%
associate-*l/86.6%
associate-*r/90.3%
fmm-def98.0%
distribute-neg-frac98.0%
+-commutative98.0%
distribute-neg-in98.0%
unsub-neg98.0%
metadata-eval98.0%
Simplified98.0%
add-sqr-sqrt51.6%
fabs-sqr51.6%
add-sqr-sqrt52.1%
fma-undefine48.3%
associate-*r/48.2%
associate-*l/44.4%
div-inv44.3%
sub-neg44.3%
metadata-eval44.3%
distribute-neg-in44.3%
+-commutative44.3%
cancel-sign-sub-inv44.3%
div-inv44.4%
associate-*l/48.2%
sub-div54.0%
Applied egg-rr54.0%
Taylor expanded in z around 0 34.4%
associate-*r/34.4%
distribute-lft-in34.4%
metadata-eval34.4%
neg-mul-134.4%
sub-neg34.4%
Simplified34.4%
Taylor expanded in x around inf 34.4%
neg-mul-134.4%
Simplified34.4%
if -5e19 < x < -6.1000000000000003e-12Initial program 99.9%
fabs-sub99.9%
associate-*l/99.7%
associate-*r/99.9%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt46.6%
fma-undefine46.6%
associate-*r/46.6%
associate-*l/46.6%
div-inv46.2%
sub-neg46.2%
metadata-eval46.2%
distribute-neg-in46.2%
+-commutative46.2%
cancel-sign-sub-inv46.2%
div-inv46.6%
associate-*l/46.6%
sub-div46.6%
Applied egg-rr46.6%
Taylor expanded in z around inf 21.2%
associate-*r/21.2%
Simplified21.2%
if -6.1000000000000003e-12 < x < 4Initial program 94.6%
fabs-sub94.6%
associate-*l/99.9%
associate-*r/89.9%
fmm-def90.0%
distribute-neg-frac90.0%
+-commutative90.0%
distribute-neg-in90.0%
unsub-neg90.0%
metadata-eval90.0%
Simplified90.0%
fma-undefine89.9%
associate-*r/99.9%
associate-*l/94.6%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.6%
fabs-sub94.6%
add-sqr-sqrt42.6%
fabs-sqr42.6%
add-sqr-sqrt44.0%
associate-*l/46.8%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in x around 0 34.3%
if 4 < x Initial program 82.3%
fabs-sub82.3%
associate-*l/84.1%
associate-*r/88.7%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
fma-undefine88.7%
associate-*r/84.1%
associate-*l/82.3%
div-inv82.0%
sub-neg82.0%
metadata-eval82.0%
distribute-neg-in82.0%
+-commutative82.0%
cancel-sign-sub-inv82.0%
div-inv82.3%
fabs-sub82.3%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt42.2%
associate-*l/43.8%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in z around 0 39.7%
Taylor expanded in x around inf 38.8%
Final simplification34.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -3.2e-11) (/ (- (* x z) (+ x 4.0)) y_m) (if (<= x 5.5e-6) (/ (- 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.2e-11) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 5.5e-6) {
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.2d-11)) then
tmp = ((x * z) - (x + 4.0d0)) / y_m
else if (x <= 5.5d-6) 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.2e-11) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 5.5e-6) {
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.2e-11: tmp = ((x * z) - (x + 4.0)) / y_m elif x <= 5.5e-6: 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.2e-11) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); elseif (x <= 5.5e-6) 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.2e-11) tmp = ((x * z) - (x + 4.0)) / y_m; elseif (x <= 5.5e-6) 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.2e-11], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 5.5e-6], 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.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -3.19999999999999994e-11Initial program 87.2%
fabs-sub87.2%
associate-*l/88.9%
associate-*r/92.0%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
add-sqr-sqrt50.5%
fabs-sqr50.5%
add-sqr-sqrt51.1%
fma-undefine48.0%
associate-*r/47.9%
associate-*l/44.8%
div-inv44.6%
sub-neg44.6%
metadata-eval44.6%
distribute-neg-in44.6%
+-commutative44.6%
cancel-sign-sub-inv44.6%
div-inv44.8%
associate-*l/47.9%
sub-div52.7%
Applied egg-rr52.7%
if -3.19999999999999994e-11 < x < 5.4999999999999999e-6Initial program 94.6%
fabs-sub94.6%
associate-*l/99.9%
associate-*r/89.8%
fmm-def89.8%
distribute-neg-frac89.8%
+-commutative89.8%
distribute-neg-in89.8%
unsub-neg89.8%
metadata-eval89.8%
Simplified89.8%
fma-undefine89.8%
associate-*r/99.9%
associate-*l/94.6%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.6%
fabs-sub94.6%
add-sqr-sqrt41.8%
fabs-sqr41.8%
add-sqr-sqrt43.2%
associate-*l/46.0%
sub-div46.0%
Applied egg-rr46.0%
Taylor expanded in x around 0 45.9%
if 5.4999999999999999e-6 < x Initial program 82.8%
fabs-sub82.8%
associate-*l/84.6%
associate-*r/89.0%
fmm-def93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine89.0%
associate-*r/84.6%
associate-*l/82.8%
div-inv82.6%
sub-neg82.6%
metadata-eval82.6%
distribute-neg-in82.6%
+-commutative82.6%
cancel-sign-sub-inv82.6%
div-inv82.8%
fabs-sub82.8%
add-sqr-sqrt43.4%
fabs-sqr43.4%
add-sqr-sqrt44.0%
associate-*l/45.6%
sub-div47.1%
Applied egg-rr47.1%
Taylor expanded in z around 0 40.2%
Final simplification46.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.65e-12) (/ (- (* x z) x) y_m) (if (<= x 5e-6) (/ (- 4.0 (* x z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.65e-12) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 5e-6) {
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 <= (-1.65d-12)) then
tmp = ((x * z) - x) / y_m
else if (x <= 5d-6) 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 <= -1.65e-12) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 5e-6) {
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 <= -1.65e-12: tmp = ((x * z) - x) / y_m elif x <= 5e-6: 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 <= -1.65e-12) tmp = Float64(Float64(Float64(x * z) - x) / y_m); elseif (x <= 5e-6) 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 <= -1.65e-12) tmp = ((x * z) - x) / y_m; elseif (x <= 5e-6) 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, -1.65e-12], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 5e-6], 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 -1.65 \cdot 10^{-12}:\\
\;\;\;\;\frac{x \cdot z - x}{y\_m}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -1.65e-12Initial program 87.2%
fabs-sub87.2%
associate-*l/88.9%
associate-*r/92.0%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
add-sqr-sqrt50.5%
fabs-sqr50.5%
add-sqr-sqrt51.1%
fma-undefine48.0%
associate-*r/47.9%
associate-*l/44.8%
div-inv44.6%
sub-neg44.6%
metadata-eval44.6%
distribute-neg-in44.6%
+-commutative44.6%
cancel-sign-sub-inv44.6%
div-inv44.8%
associate-*l/47.9%
sub-div52.7%
Applied egg-rr52.7%
Taylor expanded in x around inf 49.0%
if -1.65e-12 < x < 5.00000000000000041e-6Initial program 94.6%
fabs-sub94.6%
associate-*l/99.9%
associate-*r/89.8%
fmm-def89.8%
distribute-neg-frac89.8%
+-commutative89.8%
distribute-neg-in89.8%
unsub-neg89.8%
metadata-eval89.8%
Simplified89.8%
fma-undefine89.8%
associate-*r/99.9%
associate-*l/94.6%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.6%
fabs-sub94.6%
add-sqr-sqrt41.8%
fabs-sqr41.8%
add-sqr-sqrt43.2%
associate-*l/46.0%
sub-div46.0%
Applied egg-rr46.0%
Taylor expanded in x around 0 45.9%
if 5.00000000000000041e-6 < x Initial program 82.8%
fabs-sub82.8%
associate-*l/84.6%
associate-*r/89.0%
fmm-def93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine89.0%
associate-*r/84.6%
associate-*l/82.8%
div-inv82.6%
sub-neg82.6%
metadata-eval82.6%
distribute-neg-in82.6%
+-commutative82.6%
cancel-sign-sub-inv82.6%
div-inv82.8%
fabs-sub82.8%
add-sqr-sqrt43.4%
fabs-sqr43.4%
add-sqr-sqrt44.0%
associate-*l/45.6%
sub-div47.1%
Applied egg-rr47.1%
Taylor expanded in z around 0 40.2%
Final simplification45.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.3e+102) (/ x (- y_m)) (if (<= x -0.000155) (* z (/ x y_m)) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.3e+102) {
tmp = x / -y_m;
} else if (x <= -0.000155) {
tmp = z * (x / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.3d+102)) then
tmp = x / -y_m
else if (x <= (-0.000155d0)) then
tmp = z * (x / y_m)
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.3e+102) {
tmp = x / -y_m;
} else if (x <= -0.000155) {
tmp = z * (x / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.3e+102: tmp = x / -y_m elif x <= -0.000155: tmp = z * (x / y_m) else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.3e+102) tmp = Float64(x / Float64(-y_m)); elseif (x <= -0.000155) tmp = Float64(z * Float64(x / y_m)); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.3e+102) tmp = x / -y_m; elseif (x <= -0.000155) tmp = z * (x / y_m); else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.3e+102], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -0.000155], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+102}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -0.000155:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -2.2999999999999999e102Initial program 78.9%
fabs-sub78.9%
associate-*l/81.9%
associate-*r/86.8%
fmm-def97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt49.8%
fabs-sqr49.8%
add-sqr-sqrt50.2%
fma-undefine44.9%
associate-*r/44.9%
associate-*l/39.7%
div-inv39.5%
sub-neg39.5%
metadata-eval39.5%
distribute-neg-in39.5%
+-commutative39.5%
cancel-sign-sub-inv39.5%
div-inv39.7%
associate-*l/44.9%
sub-div52.8%
Applied egg-rr52.8%
Taylor expanded in z around 0 40.9%
associate-*r/40.9%
distribute-lft-in40.9%
metadata-eval40.9%
neg-mul-140.9%
sub-neg40.9%
Simplified40.9%
Taylor expanded in x around inf 40.9%
neg-mul-140.9%
Simplified40.9%
if -2.2999999999999999e102 < x < -1.55e-4Initial program 99.8%
fabs-sub99.8%
associate-*l/99.6%
associate-*r/99.8%
fmm-def99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
fma-undefine99.8%
associate-*r/99.6%
associate-*l/99.8%
div-inv99.7%
sub-neg99.7%
metadata-eval99.7%
distribute-neg-in99.7%
+-commutative99.7%
cancel-sign-sub-inv99.7%
div-inv99.8%
fabs-sub99.8%
add-sqr-sqrt49.8%
fabs-sqr49.8%
add-sqr-sqrt50.6%
associate-*l/50.4%
sub-div50.4%
Applied egg-rr50.4%
div-inv50.3%
associate--l+50.3%
*-commutative50.3%
cancel-sign-sub-inv50.3%
add-sqr-sqrt35.2%
sqrt-unprod51.1%
sqr-neg51.1%
sqrt-unprod30.1%
add-sqr-sqrt42.7%
*-commutative42.7%
Applied egg-rr42.7%
Taylor expanded in z around inf 33.7%
associate-*l/38.4%
*-commutative38.4%
Simplified38.4%
if -1.55e-4 < x Initial program 90.9%
fabs-sub90.9%
associate-*l/94.9%
associate-*r/89.8%
fmm-def91.3%
distribute-neg-frac91.3%
+-commutative91.3%
distribute-neg-in91.3%
unsub-neg91.3%
metadata-eval91.3%
Simplified91.3%
fma-undefine89.8%
associate-*r/94.9%
associate-*l/90.9%
div-inv90.8%
sub-neg90.8%
metadata-eval90.8%
distribute-neg-in90.8%
+-commutative90.8%
cancel-sign-sub-inv90.8%
div-inv90.9%
fabs-sub90.9%
add-sqr-sqrt42.3%
fabs-sqr42.3%
add-sqr-sqrt43.4%
associate-*l/45.7%
sub-div46.2%
Applied egg-rr46.2%
Taylor expanded in z around 0 36.0%
Final simplification36.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.5) (/ x (- y_m)) (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.5) {
tmp = x / -y_m;
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1.5d0)) then
tmp = x / -y_m
else if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = x / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.5) {
tmp = x / -y_m;
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.5: tmp = x / -y_m elif x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.5) tmp = Float64(x / Float64(-y_m)); elseif (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -1.5) tmp = x / -y_m; elseif (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1.5], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -1.5Initial program 85.9%
fabs-sub85.9%
associate-*l/87.8%
associate-*r/91.1%
fmm-def98.2%
distribute-neg-frac98.2%
+-commutative98.2%
distribute-neg-in98.2%
unsub-neg98.2%
metadata-eval98.2%
Simplified98.2%
add-sqr-sqrt50.6%
fabs-sqr50.6%
add-sqr-sqrt51.1%
fma-undefine47.6%
associate-*r/47.6%
associate-*l/44.1%
div-inv43.9%
sub-neg43.9%
metadata-eval43.9%
distribute-neg-in43.9%
+-commutative43.9%
cancel-sign-sub-inv43.9%
div-inv44.1%
associate-*l/47.6%
sub-div52.8%
Applied egg-rr52.8%
Taylor expanded in z around 0 33.2%
associate-*r/33.2%
distribute-lft-in33.2%
metadata-eval33.2%
neg-mul-133.2%
sub-neg33.2%
Simplified33.2%
Taylor expanded in x around inf 32.5%
neg-mul-132.5%
Simplified32.5%
if -1.5 < x < 4Initial program 94.9%
fabs-sub94.9%
associate-*l/99.9%
associate-*r/90.4%
fmm-def90.4%
distribute-neg-frac90.4%
+-commutative90.4%
distribute-neg-in90.4%
unsub-neg90.4%
metadata-eval90.4%
Simplified90.4%
fma-undefine90.4%
associate-*r/99.9%
associate-*l/94.9%
div-inv94.8%
sub-neg94.8%
metadata-eval94.8%
distribute-neg-in94.8%
+-commutative94.8%
cancel-sign-sub-inv94.8%
div-inv94.9%
fabs-sub94.9%
add-sqr-sqrt42.9%
fabs-sqr42.9%
add-sqr-sqrt44.3%
associate-*l/47.0%
sub-div47.0%
Applied egg-rr47.0%
Taylor expanded in x around 0 33.3%
if 4 < x Initial program 82.3%
fabs-sub82.3%
associate-*l/84.1%
associate-*r/88.7%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
fma-undefine88.7%
associate-*r/84.1%
associate-*l/82.3%
div-inv82.0%
sub-neg82.0%
metadata-eval82.0%
distribute-neg-in82.0%
+-commutative82.0%
cancel-sign-sub-inv82.0%
div-inv82.3%
fabs-sub82.3%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt42.2%
associate-*l/43.8%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in z around 0 39.7%
Taylor expanded in x around inf 38.8%
Final simplification34.5%
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 92.2%
fabs-sub92.2%
associate-*l/96.3%
associate-*r/90.6%
fmm-def92.7%
distribute-neg-frac92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
metadata-eval92.7%
Simplified92.7%
fma-undefine90.6%
associate-*r/96.3%
associate-*l/92.2%
div-inv92.2%
sub-neg92.2%
metadata-eval92.2%
distribute-neg-in92.2%
+-commutative92.2%
cancel-sign-sub-inv92.2%
div-inv92.2%
fabs-sub92.2%
add-sqr-sqrt42.6%
fabs-sqr42.6%
add-sqr-sqrt43.7%
associate-*l/45.2%
sub-div46.2%
Applied egg-rr46.2%
Taylor expanded in x around 0 24.4%
if 4 < x Initial program 82.3%
fabs-sub82.3%
associate-*l/84.1%
associate-*r/88.7%
fmm-def93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
fma-undefine88.7%
associate-*r/84.1%
associate-*l/82.3%
div-inv82.0%
sub-neg82.0%
metadata-eval82.0%
distribute-neg-in82.0%
+-commutative82.0%
cancel-sign-sub-inv82.0%
div-inv82.3%
fabs-sub82.3%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt42.2%
associate-*l/43.8%
sub-div45.4%
Applied egg-rr45.4%
Taylor expanded in z around 0 39.7%
Taylor expanded in x around inf 38.8%
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 89.8%
fabs-sub89.8%
associate-*l/93.4%
associate-*r/90.1%
fmm-def92.9%
distribute-neg-frac92.9%
+-commutative92.9%
distribute-neg-in92.9%
unsub-neg92.9%
metadata-eval92.9%
Simplified92.9%
fma-undefine90.1%
associate-*r/93.4%
associate-*l/89.8%
div-inv89.7%
sub-neg89.7%
metadata-eval89.7%
distribute-neg-in89.7%
+-commutative89.7%
cancel-sign-sub-inv89.7%
div-inv89.8%
fabs-sub89.8%
add-sqr-sqrt42.4%
fabs-sqr42.4%
add-sqr-sqrt43.4%
associate-*l/44.8%
sub-div46.0%
Applied egg-rr46.0%
Taylor expanded in x around 0 19.3%
herbie shell --seed 2024156
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))