
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 3.6e-43) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (fabs (- (/ x (/ y_m z)) (/ (+ x 4.0) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 3.6e-43) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs(((x / (y_m / z)) - ((x + 4.0) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 3.6e-43) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(Float64(x / Float64(y_m / z)) - Float64(Float64(x + 4.0) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 3.6e-43], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision] - N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 3.6 \cdot 10^{-43}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}} - \frac{x + 4}{y\_m}\right|\\
\end{array}
\end{array}
if y < 3.5999999999999999e-43Initial program 87.6%
Simplified98.3%
if 3.5999999999999999e-43 < y Initial program 98.6%
associate-*l/90.8%
associate-*r/99.8%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification98.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (- t_0 (* z (/ x y_m)))))
(if (<= t_1 -2e-243)
(- (/ z (/ y_m x)) t_0)
(if (<= t_1 INFINITY) t_1 (fabs (/ (- -4.0 x) y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -2e-243) {
tmp = (z / (y_m / x)) - t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -2e-243) {
tmp = (z / (y_m / x)) - t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = t_0 - (z * (x / y_m)) tmp = 0 if t_1 <= -2e-243: tmp = (z / (y_m / x)) - t_0 elif t_1 <= math.inf: tmp = t_1 else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(t_0 - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_1 <= -2e-243) tmp = Float64(Float64(z / Float64(y_m / x)) - t_0); elseif (t_1 <= Inf) tmp = t_1; else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = t_0 - (z * (x / y_m)); tmp = 0.0; if (t_1 <= -2e-243) tmp = (z / (y_m / x)) - t_0; elseif (t_1 <= Inf) tmp = t_1; else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-243], N[(N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := t\_0 - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-243}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}} - t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999999e-243Initial program 98.3%
associate-*l/95.8%
associate-*r/99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
fabs-sub99.1%
div-inv99.0%
clear-num99.0%
associate-*r/95.8%
div-sub95.8%
add-sqr-sqrt93.5%
fabs-sqr93.5%
add-sqr-sqrt94.1%
div-sub94.1%
associate-*r/97.3%
clear-num97.2%
div-inv97.3%
associate-/r/98.3%
Applied egg-rr98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
if -1.99999999999999999e-243 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.6%
associate-*l/96.0%
associate-*r/96.0%
clear-num96.0%
un-div-inv96.0%
Applied egg-rr96.0%
add-sqr-sqrt93.0%
fabs-sqr93.0%
add-sqr-sqrt93.7%
associate-/r/96.8%
Applied egg-rr96.8%
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/50.0%
associate-*r/50.0%
fma-neg70.0%
distribute-neg-frac70.0%
+-commutative70.0%
distribute-neg-in70.0%
unsub-neg70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)))
(if (<= (- t_0 (* z (/ x y_m))) INFINITY)
(fabs (- t_0 (/ z (/ y_m x))))
(fabs (/ (- -4.0 x) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double tmp;
if ((t_0 - (z * (x / y_m))) <= ((double) INFINITY)) {
tmp = fabs((t_0 - (z / (y_m / x))));
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double tmp;
if ((t_0 - (z * (x / y_m))) <= Double.POSITIVE_INFINITY) {
tmp = Math.abs((t_0 - (z / (y_m / x))));
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m tmp = 0 if (t_0 - (z * (x / y_m))) <= math.inf: tmp = math.fabs((t_0 - (z / (y_m / x)))) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) tmp = 0.0 if (Float64(t_0 - Float64(z * Float64(x / y_m))) <= Inf) tmp = abs(Float64(t_0 - Float64(z / Float64(y_m / x)))); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; tmp = 0.0; if ((t_0 - (z * (x / y_m))) <= Inf) tmp = abs((t_0 - (z / (y_m / x)))); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[Abs[N[(t$95$0 - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
\mathbf{if}\;t\_0 - z \cdot \frac{x}{y\_m} \leq \infty:\\
\;\;\;\;\left|t\_0 - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.5%
*-commutative98.5%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
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/50.0%
associate-*r/50.0%
fma-neg70.0%
distribute-neg-frac70.0%
+-commutative70.0%
distribute-neg-in70.0%
unsub-neg70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification98.6%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))) (if (<= t_0 INFINITY) (fabs t_0) (fabs (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= ((double) INFINITY)) {
tmp = fabs(t_0);
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)) tmp = 0 if t_0 <= math.inf: tmp = math.fabs(t_0) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= Inf) tmp = abs(t_0); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= Inf) tmp = abs(t_0); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 \leq \infty:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.5%
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/50.0%
associate-*r/50.0%
fma-neg70.0%
distribute-neg-frac70.0%
+-commutative70.0%
distribute-neg-in70.0%
unsub-neg70.0%
metadata-eval70.0%
Simplified70.0%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification98.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (- t_0 (* z (/ x y_m)))))
(if (<= t_1 -2e-243)
(- (/ z (/ y_m x)) t_0)
(if (<= t_1 INFINITY) t_1 (* x (/ (+ -1.0 z) y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -2e-243) {
tmp = (z / (y_m / x)) - t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((-1.0 + z) / 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;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -2e-243) {
tmp = (z / (y_m / x)) - t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((-1.0 + z) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = t_0 - (z * (x / y_m)) tmp = 0 if t_1 <= -2e-243: tmp = (z / (y_m / x)) - t_0 elif t_1 <= math.inf: tmp = t_1 else: tmp = x * ((-1.0 + z) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(t_0 - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_1 <= -2e-243) tmp = Float64(Float64(z / Float64(y_m / x)) - t_0); elseif (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = t_0 - (z * (x / y_m)); tmp = 0.0; if (t_1 <= -2e-243) tmp = (z / (y_m / x)) - t_0; elseif (t_1 <= Inf) tmp = t_1; else tmp = x * ((-1.0 + z) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-243], N[(N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := t\_0 - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-243}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}} - t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999999e-243Initial program 98.3%
associate-*l/95.8%
associate-*r/99.0%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
fabs-sub99.1%
div-inv99.0%
clear-num99.0%
associate-*r/95.8%
div-sub95.8%
add-sqr-sqrt93.5%
fabs-sqr93.5%
add-sqr-sqrt94.1%
div-sub94.1%
associate-*r/97.3%
clear-num97.2%
div-inv97.3%
associate-/r/98.3%
Applied egg-rr98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.3%
Applied egg-rr98.3%
if -1.99999999999999999e-243 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.6%
associate-*l/96.0%
associate-*r/96.0%
clear-num96.0%
un-div-inv96.0%
Applied egg-rr96.0%
add-sqr-sqrt93.0%
fabs-sqr93.0%
add-sqr-sqrt93.7%
associate-/r/96.8%
Applied egg-rr96.8%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
add-sqr-sqrt0.0%
fabs-sqr0.0%
add-sqr-sqrt0.0%
sub-neg0.0%
+-commutative0.0%
associate-*l/20.0%
associate-*r/20.0%
frac-2neg20.0%
+-commutative20.0%
distribute-neg-in20.0%
metadata-eval20.0%
sub-neg20.0%
distribute-frac-neg220.0%
distribute-neg-in20.0%
fma-undefine25.0%
neg-sub025.0%
fma-undefine20.0%
associate-*r/20.0%
associate-*l/0.0%
Applied egg-rr45.0%
Taylor expanded in x around inf 45.0%
associate-/l*45.0%
sub-neg45.0%
metadata-eval45.0%
Simplified45.0%
add-sqr-sqrt45.0%
sqrt-unprod100.0%
sub0-neg100.0%
sub0-neg100.0%
sqr-neg100.0%
sqrt-unprod55.0%
add-sqr-sqrt55.0%
*-commutative55.0%
Applied egg-rr55.0%
Final simplification94.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -2.6e-12)
(* x (/ (+ -1.0 z) y_m))
(if (<= x 4.0)
(- (/ 4.0 y_m) (* x (/ z y_m)))
(/ x (/ y_m (- (- z) -1.0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 4.0) {
tmp = (4.0 / y_m) - (x * (z / y_m));
} else {
tmp = x / (y_m / (-z - -1.0));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.6d-12)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 4.0d0) then
tmp = (4.0d0 / y_m) - (x * (z / y_m))
else
tmp = x / (y_m / (-z - (-1.0d0)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 4.0) {
tmp = (4.0 / y_m) - (x * (z / y_m));
} else {
tmp = x / (y_m / (-z - -1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.6e-12: tmp = x * ((-1.0 + z) / y_m) elif x <= 4.0: tmp = (4.0 / y_m) - (x * (z / y_m)) else: tmp = x / (y_m / (-z - -1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.6e-12) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 4.0) tmp = Float64(Float64(4.0 / y_m) - Float64(x * Float64(z / y_m))); else tmp = Float64(x / Float64(y_m / Float64(Float64(-z) - -1.0))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.6e-12) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 4.0) tmp = (4.0 / y_m) - (x * (z / y_m)); else tmp = x / (y_m / (-z - -1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.6e-12], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y$95$m / N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m} - x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{\left(-z\right) - -1}}\\
\end{array}
\end{array}
if x < -2.59999999999999983e-12Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt42.1%
sqrt-unprod72.1%
sub0-neg72.1%
sub0-neg72.1%
sqr-neg72.1%
sqrt-unprod57.6%
add-sqr-sqrt57.9%
*-commutative57.9%
Applied egg-rr57.9%
if -2.59999999999999983e-12 < x < 4Initial program 97.0%
add-sqr-sqrt53.8%
fabs-sqr53.8%
add-sqr-sqrt55.0%
associate-*l/57.5%
associate-*r/53.6%
Applied egg-rr53.6%
Taylor expanded in x around 0 52.9%
if 4 < x Initial program 86.4%
add-sqr-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.5%
sub-neg39.5%
+-commutative39.5%
associate-*l/37.2%
associate-*r/43.6%
frac-2neg43.6%
+-commutative43.6%
distribute-neg-in43.6%
metadata-eval43.6%
sub-neg43.6%
distribute-frac-neg243.6%
distribute-neg-in43.6%
fma-undefine44.9%
neg-sub044.9%
fma-undefine43.6%
associate-*r/37.2%
associate-*l/39.5%
Applied egg-rr41.3%
Taylor expanded in x around inf 39.6%
associate-/l*46.0%
sub-neg46.0%
metadata-eval46.0%
Simplified46.0%
clear-num45.9%
un-div-inv45.9%
Applied egg-rr45.9%
Final simplification52.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.6e-12) (* x (/ (+ -1.0 z) y_m)) (if (<= x 1000000.0) (/ (- x -4.0) y_m) (/ x (/ y_m (- (- z) -1.0))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 1000000.0) {
tmp = (x - -4.0) / y_m;
} else {
tmp = x / (y_m / (-z - -1.0));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.6d-12)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 1000000.0d0) then
tmp = (x - (-4.0d0)) / y_m
else
tmp = x / (y_m / (-z - (-1.0d0)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 1000000.0) {
tmp = (x - -4.0) / y_m;
} else {
tmp = x / (y_m / (-z - -1.0));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.6e-12: tmp = x * ((-1.0 + z) / y_m) elif x <= 1000000.0: tmp = (x - -4.0) / y_m else: tmp = x / (y_m / (-z - -1.0)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.6e-12) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 1000000.0) tmp = Float64(Float64(x - -4.0) / y_m); else tmp = Float64(x / Float64(y_m / Float64(Float64(-z) - -1.0))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.6e-12) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 1000000.0) tmp = (x - -4.0) / y_m; else tmp = x / (y_m / (-z - -1.0)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.6e-12], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1000000.0], N[(N[(x - -4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x / N[(y$95$m / N[((-z) - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 1000000:\\
\;\;\;\;\frac{x - -4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{\left(-z\right) - -1}}\\
\end{array}
\end{array}
if x < -2.59999999999999983e-12Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt42.1%
sqrt-unprod72.1%
sub0-neg72.1%
sub0-neg72.1%
sqr-neg72.1%
sqrt-unprod57.6%
add-sqr-sqrt57.9%
*-commutative57.9%
Applied egg-rr57.9%
if -2.59999999999999983e-12 < x < 1e6Initial program 97.1%
fabs-sub97.1%
associate-*l/99.9%
associate-*r/95.2%
fma-neg95.2%
distribute-neg-frac95.2%
+-commutative95.2%
distribute-neg-in95.2%
unsub-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in z around 0 75.4%
associate-*r/75.4%
distribute-lft-in75.4%
metadata-eval75.4%
neg-mul-175.4%
sub-neg75.4%
Simplified75.4%
add-sqr-sqrt74.8%
sqrt-unprod45.2%
neg-fabs45.2%
neg-fabs45.2%
sqr-abs45.2%
distribute-frac-neg245.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
frac-2neg45.2%
distribute-frac-neg245.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
frac-2neg45.2%
sqrt-unprod41.6%
add-sqr-sqrt42.8%
frac-2neg42.8%
Applied egg-rr42.8%
if 1e6 < x Initial program 85.8%
add-sqr-sqrt37.7%
fabs-sqr37.7%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/36.0%
associate-*r/42.6%
frac-2neg42.6%
+-commutative42.6%
distribute-neg-in42.6%
metadata-eval42.6%
sub-neg42.6%
distribute-frac-neg242.6%
distribute-neg-in42.6%
fma-undefine44.0%
neg-sub044.0%
fma-undefine42.6%
associate-*r/36.0%
associate-*l/38.4%
Applied egg-rr40.2%
Taylor expanded in x around inf 40.1%
associate-/l*46.8%
sub-neg46.8%
metadata-eval46.8%
Simplified46.8%
clear-num46.8%
un-div-inv46.8%
Applied egg-rr46.8%
Final simplification47.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ -1.0 z) y_m)))
(if (<= x -4e-15)
(* x t_0)
(if (<= x 490000.0) (/ (- x -4.0) y_m) (* t_0 (- x))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (-1.0 + z) / y_m;
double tmp;
if (x <= -4e-15) {
tmp = x * t_0;
} else if (x <= 490000.0) {
tmp = (x - -4.0) / y_m;
} else {
tmp = t_0 * -x;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) + z) / y_m
if (x <= (-4d-15)) then
tmp = x * t_0
else if (x <= 490000.0d0) then
tmp = (x - (-4.0d0)) / y_m
else
tmp = t_0 * -x
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 = (-1.0 + z) / y_m;
double tmp;
if (x <= -4e-15) {
tmp = x * t_0;
} else if (x <= 490000.0) {
tmp = (x - -4.0) / y_m;
} else {
tmp = t_0 * -x;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (-1.0 + z) / y_m tmp = 0 if x <= -4e-15: tmp = x * t_0 elif x <= 490000.0: tmp = (x - -4.0) / y_m else: tmp = t_0 * -x return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(-1.0 + z) / y_m) tmp = 0.0 if (x <= -4e-15) tmp = Float64(x * t_0); elseif (x <= 490000.0) tmp = Float64(Float64(x - -4.0) / y_m); else tmp = Float64(t_0 * Float64(-x)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (-1.0 + z) / y_m; tmp = 0.0; if (x <= -4e-15) tmp = x * t_0; elseif (x <= 490000.0) tmp = (x - -4.0) / y_m; else tmp = t_0 * -x; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[x, -4e-15], N[(x * t$95$0), $MachinePrecision], If[LessEqual[x, 490000.0], N[(N[(x - -4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(t$95$0 * (-x)), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{-1 + z}{y\_m}\\
\mathbf{if}\;x \leq -4 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\_0\\
\mathbf{elif}\;x \leq 490000:\\
\;\;\;\;\frac{x - -4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -4.0000000000000003e-15Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt42.1%
sqrt-unprod72.1%
sub0-neg72.1%
sub0-neg72.1%
sqr-neg72.1%
sqrt-unprod57.6%
add-sqr-sqrt57.9%
*-commutative57.9%
Applied egg-rr57.9%
if -4.0000000000000003e-15 < x < 4.9e5Initial program 97.1%
fabs-sub97.1%
associate-*l/99.9%
associate-*r/95.2%
fma-neg95.2%
distribute-neg-frac95.2%
+-commutative95.2%
distribute-neg-in95.2%
unsub-neg95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in z around 0 75.4%
associate-*r/75.4%
distribute-lft-in75.4%
metadata-eval75.4%
neg-mul-175.4%
sub-neg75.4%
Simplified75.4%
add-sqr-sqrt74.8%
sqrt-unprod45.2%
neg-fabs45.2%
neg-fabs45.2%
sqr-abs45.2%
distribute-frac-neg245.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
frac-2neg45.2%
distribute-frac-neg245.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
frac-2neg45.2%
sqrt-unprod41.6%
add-sqr-sqrt42.8%
frac-2neg42.8%
Applied egg-rr42.8%
if 4.9e5 < x Initial program 85.8%
add-sqr-sqrt37.7%
fabs-sqr37.7%
add-sqr-sqrt38.4%
sub-neg38.4%
+-commutative38.4%
associate-*l/36.0%
associate-*r/42.6%
frac-2neg42.6%
+-commutative42.6%
distribute-neg-in42.6%
metadata-eval42.6%
sub-neg42.6%
distribute-frac-neg242.6%
distribute-neg-in42.6%
fma-undefine44.0%
neg-sub044.0%
fma-undefine42.6%
associate-*r/36.0%
associate-*l/38.4%
Applied egg-rr40.2%
Taylor expanded in x around inf 40.1%
associate-/l*46.8%
sub-neg46.8%
metadata-eval46.8%
Simplified46.8%
sub0-neg46.8%
*-commutative46.8%
distribute-rgt-neg-in46.8%
Applied egg-rr46.8%
Final simplification47.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.52) (/ (- 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.52) {
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.52d0)) 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.52) {
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.52: 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.52) tmp = Float64(Float64(-x) / y_m); elseif (x <= 4.0) tmp = Float64(-4.0 / Float64(-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.52) 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.52], 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.52:\\
\;\;\;\;\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.52Initial program 84.0%
fabs-sub84.0%
associate-*l/87.5%
associate-*r/91.9%
fma-neg95.1%
distribute-neg-frac95.1%
+-commutative95.1%
distribute-neg-in95.1%
unsub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in z around 0 66.1%
associate-*r/66.1%
distribute-lft-in66.1%
metadata-eval66.1%
neg-mul-166.1%
sub-neg66.1%
Simplified66.1%
add-sqr-sqrt36.1%
fabs-sqr36.1%
add-sqr-sqrt36.5%
div-inv36.5%
Applied egg-rr36.5%
Taylor expanded in x around inf 36.5%
neg-mul-136.5%
distribute-neg-frac236.5%
Simplified36.5%
if -1.52 < x < 4Initial program 97.0%
add-sqr-sqrt54.2%
fabs-sqr54.2%
add-sqr-sqrt55.4%
sub-neg55.4%
+-commutative55.4%
associate-*l/57.9%
associate-*r/54.0%
frac-2neg54.0%
+-commutative54.0%
distribute-neg-in54.0%
metadata-eval54.0%
sub-neg54.0%
distribute-frac-neg254.0%
distribute-neg-in54.0%
fma-undefine53.9%
neg-sub053.9%
fma-undefine54.0%
associate-*r/57.9%
associate-*l/55.4%
Applied egg-rr57.9%
Taylor expanded in x around 0 41.1%
sub0-neg41.1%
distribute-neg-frac241.1%
Applied egg-rr41.1%
if 4 < x Initial program 86.4%
add-sqr-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.5%
sub-neg39.5%
+-commutative39.5%
associate-*l/37.2%
associate-*r/43.6%
frac-2neg43.6%
+-commutative43.6%
distribute-neg-in43.6%
metadata-eval43.6%
sub-neg43.6%
distribute-frac-neg243.6%
distribute-neg-in43.6%
fma-undefine44.9%
neg-sub044.9%
fma-undefine43.6%
associate-*r/37.2%
associate-*l/39.5%
Applied egg-rr41.3%
Taylor expanded in x around inf 39.6%
associate-/l*46.0%
sub-neg46.0%
metadata-eval46.0%
Simplified46.0%
Taylor expanded in z around 0 22.8%
Final simplification34.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.6e-12) (/ x (/ y_m (+ -1.0 z))) (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x / (y_m / (-1.0 + z));
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.6d-12)) then
tmp = x / (y_m / ((-1.0d0) + z))
else
tmp = ((x + 4.0d0) - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x / (y_m / (-1.0 + z));
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.6e-12: tmp = x / (y_m / (-1.0 + z)) else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.6e-12) tmp = Float64(x / Float64(y_m / Float64(-1.0 + z))); else tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.6e-12) tmp = x / (y_m / (-1.0 + z)); else tmp = ((x + 4.0) - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.6e-12], N[(x / N[(y$95$m / N[(-1.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{\frac{y\_m}{-1 + z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -2.59999999999999983e-12Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt0.5%
sqrt-unprod0.8%
sqr-neg0.8%
sub0-neg0.8%
sub0-neg0.8%
sqrt-unprod0.3%
add-sqr-sqrt57.9%
cancel-sign-sub-inv57.9%
+-lft-identity57.9%
clear-num57.9%
un-div-inv58.0%
Applied egg-rr58.0%
if -2.59999999999999983e-12 < x Initial program 92.9%
associate-*l/93.9%
associate-*r/94.4%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
add-sqr-sqrt48.8%
fabs-sqr48.8%
add-sqr-sqrt49.7%
associate-/r/49.1%
Applied egg-rr49.1%
associate-*l/49.7%
sub-div51.2%
Applied egg-rr51.2%
Final simplification52.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.6e-12) (* x (/ (+ -1.0 z) y_m)) (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-2.6d-12)) then
tmp = x * (((-1.0d0) + z) / y_m)
else
tmp = ((x + 4.0d0) - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.6e-12) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.6e-12: tmp = x * ((-1.0 + z) / y_m) else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.6e-12) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); else tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2.6e-12) tmp = x * ((-1.0 + z) / y_m); else tmp = ((x + 4.0) - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2.6e-12], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -2.59999999999999983e-12Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt42.1%
sqrt-unprod72.1%
sub0-neg72.1%
sub0-neg72.1%
sqr-neg72.1%
sqrt-unprod57.6%
add-sqr-sqrt57.9%
*-commutative57.9%
Applied egg-rr57.9%
if -2.59999999999999983e-12 < x Initial program 92.9%
associate-*l/93.9%
associate-*r/94.4%
clear-num94.3%
un-div-inv94.4%
Applied egg-rr94.4%
add-sqr-sqrt48.8%
fabs-sqr48.8%
add-sqr-sqrt49.7%
associate-/r/49.1%
Applied egg-rr49.1%
associate-*l/49.7%
sub-div51.2%
Applied egg-rr51.2%
Final simplification52.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.7e-14) (* x (/ (+ -1.0 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 <= -2.7e-14) {
tmp = x * ((-1.0 + 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 <= (-2.7d-14)) then
tmp = x * (((-1.0d0) + 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 <= -2.7e-14) {
tmp = x * ((-1.0 + 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 <= -2.7e-14: tmp = x * ((-1.0 + 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 <= -2.7e-14) tmp = Float64(x * Float64(Float64(-1.0 + 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 <= -2.7e-14) tmp = x * ((-1.0 + 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, -2.7e-14], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / 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.7 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - -4}{y\_m}\\
\end{array}
\end{array}
if x < -2.6999999999999999e-14Initial program 84.3%
add-sqr-sqrt37.4%
fabs-sqr37.4%
add-sqr-sqrt38.0%
sub-neg38.0%
+-commutative38.0%
associate-*l/39.5%
associate-*r/39.5%
frac-2neg39.5%
+-commutative39.5%
distribute-neg-in39.5%
metadata-eval39.5%
sub-neg39.5%
distribute-frac-neg239.5%
distribute-neg-in39.5%
fma-undefine39.5%
neg-sub039.5%
fma-undefine39.5%
associate-*r/39.5%
associate-*l/38.0%
Applied egg-rr42.6%
Taylor expanded in x around inf 42.6%
associate-/l*42.6%
sub-neg42.6%
metadata-eval42.6%
Simplified42.6%
add-sqr-sqrt42.1%
sqrt-unprod72.1%
sub0-neg72.1%
sub0-neg72.1%
sqr-neg72.1%
sqrt-unprod57.6%
add-sqr-sqrt57.9%
*-commutative57.9%
Applied egg-rr57.9%
if -2.6999999999999999e-14 < x Initial program 92.9%
fabs-sub92.9%
associate-*l/93.9%
associate-*r/94.4%
fma-neg95.4%
distribute-neg-frac95.4%
+-commutative95.4%
distribute-neg-in95.4%
unsub-neg95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in z around 0 71.3%
associate-*r/71.3%
distribute-lft-in71.3%
metadata-eval71.3%
neg-mul-171.3%
sub-neg71.3%
Simplified71.3%
add-sqr-sqrt70.8%
sqrt-unprod48.5%
neg-fabs48.5%
neg-fabs48.5%
sqr-abs48.5%
distribute-frac-neg248.5%
sub-neg48.5%
metadata-eval48.5%
distribute-neg-in48.5%
+-commutative48.5%
frac-2neg48.5%
distribute-frac-neg248.5%
sub-neg48.5%
metadata-eval48.5%
distribute-neg-in48.5%
+-commutative48.5%
frac-2neg48.5%
sqrt-unprod34.4%
add-sqr-sqrt35.4%
frac-2neg35.4%
Applied egg-rr35.4%
Final simplification41.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- x) y_m) (/ (- x -4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = -x / y_m;
} else {
tmp = (x - -4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = -x / y_m
else
tmp = (x - (-4.0d0)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = -x / y_m;
} else {
tmp = (x - -4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = -x / y_m else: tmp = (x - -4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(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 <= -4.0) tmp = -x / y_m; else tmp = (x - -4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[((-x) / y$95$m), $MachinePrecision], N[(N[(x - -4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - -4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 84.0%
fabs-sub84.0%
associate-*l/87.5%
associate-*r/91.9%
fma-neg95.1%
distribute-neg-frac95.1%
+-commutative95.1%
distribute-neg-in95.1%
unsub-neg95.1%
metadata-eval95.1%
Simplified95.1%
Taylor expanded in z around 0 66.1%
associate-*r/66.1%
distribute-lft-in66.1%
metadata-eval66.1%
neg-mul-166.1%
sub-neg66.1%
Simplified66.1%
add-sqr-sqrt36.1%
fabs-sqr36.1%
add-sqr-sqrt36.5%
div-inv36.5%
Applied egg-rr36.5%
Taylor expanded in x around inf 36.5%
neg-mul-136.5%
distribute-neg-frac236.5%
Simplified36.5%
if -4 < x Initial program 93.0%
fabs-sub93.0%
associate-*l/93.9%
associate-*r/94.4%
fma-neg95.4%
distribute-neg-frac95.4%
+-commutative95.4%
distribute-neg-in95.4%
unsub-neg95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in z around 0 70.9%
associate-*r/70.9%
distribute-lft-in70.9%
metadata-eval70.9%
neg-mul-170.9%
sub-neg70.9%
Simplified70.9%
add-sqr-sqrt70.4%
sqrt-unprod48.2%
neg-fabs48.2%
neg-fabs48.2%
sqr-abs48.2%
distribute-frac-neg248.2%
sub-neg48.2%
metadata-eval48.2%
distribute-neg-in48.2%
+-commutative48.2%
frac-2neg48.2%
distribute-frac-neg248.2%
sub-neg48.2%
metadata-eval48.2%
distribute-neg-in48.2%
+-commutative48.2%
frac-2neg48.2%
sqrt-unprod34.2%
add-sqr-sqrt35.2%
frac-2neg35.2%
Applied egg-rr35.2%
Final simplification35.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 / Float64(-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.5%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt49.0%
sub-neg49.0%
+-commutative49.0%
associate-*l/51.2%
associate-*r/48.6%
frac-2neg48.6%
+-commutative48.6%
distribute-neg-in48.6%
metadata-eval48.6%
sub-neg48.6%
distribute-frac-neg248.6%
distribute-neg-in48.6%
fma-undefine48.6%
neg-sub048.6%
fma-undefine48.6%
associate-*r/51.2%
associate-*l/49.0%
Applied egg-rr52.3%
Taylor expanded in x around 0 28.1%
sub0-neg28.1%
distribute-neg-frac228.1%
Applied egg-rr28.1%
if 4 < x Initial program 86.4%
add-sqr-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.5%
sub-neg39.5%
+-commutative39.5%
associate-*l/37.2%
associate-*r/43.6%
frac-2neg43.6%
+-commutative43.6%
distribute-neg-in43.6%
metadata-eval43.6%
sub-neg43.6%
distribute-frac-neg243.6%
distribute-neg-in43.6%
fma-undefine44.9%
neg-sub044.9%
fma-undefine43.6%
associate-*r/37.2%
associate-*l/39.5%
Applied egg-rr41.3%
Taylor expanded in x around inf 39.6%
associate-/l*46.0%
sub-neg46.0%
metadata-eval46.0%
Simplified46.0%
Taylor expanded in z around 0 22.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (/ x y_m))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return x / 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 = x / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return x / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z): return x / y_m
y_m = abs(y) function code(x, y_m, z) return Float64(x / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = x / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[(x / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{x}{y\_m}
\end{array}
Initial program 90.8%
add-sqr-sqrt45.4%
fabs-sqr45.4%
add-sqr-sqrt46.3%
sub-neg46.3%
+-commutative46.3%
associate-*l/47.1%
associate-*r/47.2%
frac-2neg47.2%
+-commutative47.2%
distribute-neg-in47.2%
metadata-eval47.2%
sub-neg47.2%
distribute-frac-neg247.2%
distribute-neg-in47.2%
fma-undefine47.6%
neg-sub047.6%
fma-undefine47.2%
associate-*r/47.1%
associate-*l/46.3%
Applied egg-rr49.1%
Taylor expanded in x around inf 30.3%
associate-/l*31.1%
sub-neg31.1%
metadata-eval31.1%
Simplified31.1%
Taylor expanded in z around 0 16.0%
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 90.8%
fabs-sub90.8%
associate-*l/92.3%
associate-*r/93.8%
fma-neg95.3%
distribute-neg-frac95.3%
+-commutative95.3%
distribute-neg-in95.3%
unsub-neg95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in z around 0 69.7%
associate-*r/69.7%
distribute-lft-in69.7%
metadata-eval69.7%
neg-mul-169.7%
sub-neg69.7%
Simplified69.7%
add-sqr-sqrt36.2%
fabs-sqr36.2%
add-sqr-sqrt37.1%
div-inv37.1%
Applied egg-rr37.1%
Taylor expanded in x around 0 17.6%
herbie shell --seed 2024137
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))