
(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 18 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.9e-20) (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 <= 3.9e-20) {
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 <= 3.9e-20) 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, 3.9e-20], 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 3.9 \cdot 10^{-20}:\\
\;\;\;\;\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 < 3.90000000000000007e-20Initial program 94.7%
Simplified95.8%
if 3.90000000000000007e-20 < y Initial program 97.1%
fabs-sub97.1%
associate-*l/97.0%
associate-*r/99.9%
fma-neg99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 2.05e+95) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (fabs (* x (- (/ (+ -1.0 z) y_m) (/ 4.0 (* y_m x)))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 2.05e+95) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x)))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 2.05e+95) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(x * Float64(Float64(Float64(-1.0 + z) / y_m) - Float64(4.0 / Float64(y_m * x))))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 2.05e+95], 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[(N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(4.0 / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 2.05 \cdot 10^{+95}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \left(\frac{-1 + z}{y\_m} - \frac{4}{y\_m \cdot x}\right)\right|\\
\end{array}
\end{array}
if y < 2.04999999999999993e95Initial program 95.3%
Simplified96.3%
if 2.04999999999999993e95 < y Initial program 95.3%
fabs-sub95.3%
associate-*l/95.3%
associate-*r/100.0%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 99.6%
associate--r+99.6%
div-sub99.6%
sub-neg99.6%
remove-double-neg99.6%
neg-mul-199.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-in99.6%
+-commutative99.6%
neg-mul-199.6%
associate-*r/99.6%
Simplified99.6%
Final simplification96.8%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* z (/ x y_m))))
(if (<= (- (/ (+ x 4.0) y_m) t_0) 2e+307)
(fabs (- (/ (+ -1.0 (+ x 5.0)) y_m) t_0))
(fabs (* x (- (/ (+ -1.0 z) y_m) (/ 4.0 (* y_m x))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double tmp;
if ((((x + 4.0) / y_m) - t_0) <= 2e+307) {
tmp = fabs((((-1.0 + (x + 5.0)) / y_m) - t_0));
} else {
tmp = fabs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * 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 = z * (x / y_m)
if ((((x + 4.0d0) / y_m) - t_0) <= 2d+307) then
tmp = abs(((((-1.0d0) + (x + 5.0d0)) / y_m) - t_0))
else
tmp = abs((x * ((((-1.0d0) + z) / y_m) - (4.0d0 / (y_m * 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 = z * (x / y_m);
double tmp;
if ((((x + 4.0) / y_m) - t_0) <= 2e+307) {
tmp = Math.abs((((-1.0 + (x + 5.0)) / y_m) - t_0));
} else {
tmp = Math.abs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x)))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = z * (x / y_m) tmp = 0 if (((x + 4.0) / y_m) - t_0) <= 2e+307: tmp = math.fabs((((-1.0 + (x + 5.0)) / y_m) - t_0)) else: tmp = math.fabs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x))))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(z * Float64(x / y_m)) tmp = 0.0 if (Float64(Float64(Float64(x + 4.0) / y_m) - t_0) <= 2e+307) tmp = abs(Float64(Float64(Float64(-1.0 + Float64(x + 5.0)) / y_m) - t_0)); else tmp = abs(Float64(x * Float64(Float64(Float64(-1.0 + z) / y_m) - Float64(4.0 / Float64(y_m * x))))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = z * (x / y_m); tmp = 0.0; if ((((x + 4.0) / y_m) - t_0) <= 2e+307) tmp = abs((((-1.0 + (x + 5.0)) / y_m) - t_0)); else tmp = abs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x))))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision], 2e+307], N[Abs[N[(N[(N[(-1.0 + N[(x + 5.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(4.0 / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;\frac{x + 4}{y\_m} - t\_0 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\left|\frac{-1 + \left(x + 5\right)}{y\_m} - t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \left(\frac{-1 + z}{y\_m} - \frac{4}{y\_m \cdot x}\right)\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 1.99999999999999997e307Initial program 98.7%
expm1-log1p-u76.8%
expm1-undefine76.5%
Applied egg-rr76.5%
sub-neg76.5%
log1p-undefine76.5%
rem-exp-log98.7%
+-commutative98.7%
associate-+r+98.7%
metadata-eval98.7%
metadata-eval98.7%
Simplified98.7%
if 1.99999999999999997e307 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 64.0%
fabs-sub64.0%
associate-*l/80.0%
associate-*r/80.0%
fma-neg92.0%
distribute-neg-frac92.0%
+-commutative92.0%
distribute-neg-in92.0%
unsub-neg92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in x around inf 88.0%
associate--r+88.0%
div-sub88.0%
sub-neg88.0%
remove-double-neg88.0%
neg-mul-188.0%
metadata-eval88.0%
metadata-eval88.0%
distribute-lft-in88.0%
+-commutative88.0%
neg-mul-188.0%
associate-*r/88.0%
Simplified88.0%
Final simplification97.7%
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+307)
(fabs t_0)
(fabs (* x (- (/ (+ -1.0 z) y_m) (/ 4.0 (* y_m x))))))))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+307) {
tmp = fabs(t_0);
} else {
tmp = fabs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * 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 = ((x + 4.0d0) / y_m) - (z * (x / y_m))
if (t_0 <= 2d+307) then
tmp = abs(t_0)
else
tmp = abs((x * ((((-1.0d0) + z) / y_m) - (4.0d0 / (y_m * 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 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= 2e+307) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x)))));
}
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+307: tmp = math.fabs(t_0) else: tmp = math.fabs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x))))) 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+307) tmp = abs(t_0); else tmp = abs(Float64(x * Float64(Float64(Float64(-1.0 + z) / y_m) - Float64(4.0 / Float64(y_m * x))))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= 2e+307) tmp = abs(t_0); else tmp = abs((x * (((-1.0 + z) / y_m) - (4.0 / (y_m * x))))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(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+307], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(x * N[(N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(4.0 / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision]), $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 2 \cdot 10^{+307}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \left(\frac{-1 + z}{y\_m} - \frac{4}{y\_m \cdot x}\right)\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 1.99999999999999997e307Initial program 98.7%
if 1.99999999999999997e307 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 64.0%
fabs-sub64.0%
associate-*l/80.0%
associate-*r/80.0%
fma-neg92.0%
distribute-neg-frac92.0%
+-commutative92.0%
distribute-neg-in92.0%
unsub-neg92.0%
metadata-eval92.0%
Simplified92.0%
Taylor expanded in x around inf 88.0%
associate--r+88.0%
div-sub88.0%
sub-neg88.0%
remove-double-neg88.0%
neg-mul-188.0%
metadata-eval88.0%
metadata-eval88.0%
distribute-lft-in88.0%
+-commutative88.0%
neg-mul-188.0%
associate-*r/88.0%
Simplified88.0%
Final simplification97.7%
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) (/ 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 = 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 = 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 = 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 = Float64(x / Float64(-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 = 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[(x / (-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 \infty:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 98.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/44.4%
associate-*r/44.4%
fma-neg77.8%
distribute-neg-frac77.8%
+-commutative77.8%
distribute-neg-in77.8%
unsub-neg77.8%
metadata-eval77.8%
Simplified77.8%
add-sqr-sqrt44.4%
fabs-sqr44.4%
add-sqr-sqrt44.4%
fma-undefine33.3%
associate-*r/33.3%
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/33.3%
sub-div55.6%
Applied egg-rr55.6%
Taylor expanded in z around 0 66.7%
associate-*r/66.7%
distribute-lft-in66.7%
metadata-eval66.7%
neg-mul-166.7%
sub-neg66.7%
Simplified66.7%
Taylor expanded in x around inf 66.7%
neg-mul-166.7%
Simplified66.7%
Final simplification97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.0)
(* x (/ (+ -1.0 z) y_m))
(if (<= x 5e-10)
(+ (/ (+ x 4.0) y_m) (* z (/ x y_m)))
(* x (+ (/ 4.0 (* y_m x)) (/ (- 1.0 z) y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 5e-10) {
tmp = ((x + 4.0) / y_m) + (z * (x / y_m));
} else {
tmp = x * ((4.0 / (y_m * x)) + ((1.0 - z) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 5d-10) then
tmp = ((x + 4.0d0) / y_m) + (z * (x / y_m))
else
tmp = x * ((4.0d0 / (y_m * x)) + ((1.0d0 - z) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 5e-10) {
tmp = ((x + 4.0) / y_m) + (z * (x / y_m));
} else {
tmp = x * ((4.0 / (y_m * x)) + ((1.0 - z) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = x * ((-1.0 + z) / y_m) elif x <= 5e-10: tmp = ((x + 4.0) / y_m) + (z * (x / y_m)) else: tmp = x * ((4.0 / (y_m * x)) + ((1.0 - z) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 5e-10) tmp = Float64(Float64(Float64(x + 4.0) / y_m) + Float64(z * Float64(x / y_m))); else tmp = Float64(x * Float64(Float64(4.0 / Float64(y_m * x)) + Float64(Float64(1.0 - z) / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.0) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 5e-10) tmp = ((x + 4.0) / y_m) + (z * (x / y_m)); else tmp = x * ((4.0 / (y_m * x)) + ((1.0 - z) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-10], N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(4.0 / N[(y$95$m * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-10}:\\
\;\;\;\;\frac{x + 4}{y\_m} + z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{4}{y\_m \cdot x} + \frac{1 - z}{y\_m}\right)\\
\end{array}
\end{array}
if x < -4Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -4 < x < 5.00000000000000031e-10Initial program 97.7%
fabs-sub97.7%
associate-*l/99.9%
associate-*r/89.6%
fma-neg89.6%
distribute-neg-frac89.6%
+-commutative89.6%
distribute-neg-in89.6%
unsub-neg89.6%
metadata-eval89.6%
Simplified89.6%
fma-undefine89.6%
associate-*r/99.9%
associate-*l/97.7%
div-inv97.7%
sub-neg97.7%
metadata-eval97.7%
distribute-neg-in97.7%
+-commutative97.7%
cancel-sign-sub-inv97.7%
div-inv97.7%
fabs-sub97.7%
add-sqr-sqrt39.0%
fabs-sqr39.0%
add-sqr-sqrt40.2%
sub-neg40.2%
distribute-rgt-neg-in40.2%
Applied egg-rr40.2%
add-sqr-sqrt18.2%
sqrt-unprod31.3%
sqr-neg31.3%
sqrt-unprod24.3%
add-sqr-sqrt40.3%
*-un-lft-identity40.3%
Applied egg-rr40.3%
*-lft-identity40.3%
Simplified40.3%
if 5.00000000000000031e-10 < x Initial program 97.1%
Simplified94.5%
add-sqr-sqrt38.7%
fabs-sqr38.7%
add-sqr-sqrt39.3%
associate-*l/39.4%
clear-num39.3%
mul-1-neg39.3%
Applied egg-rr39.3%
Taylor expanded in x around inf 40.6%
sub-neg40.6%
+-commutative40.6%
associate-+r+40.6%
+-commutative40.6%
sub-neg40.6%
div-sub40.6%
associate-*r/40.6%
metadata-eval40.6%
*-commutative40.6%
Simplified40.6%
Final simplification42.8%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.0)
(* x (/ (+ -1.0 z) y_m))
(if (<= x 2.05e-148)
(+ (/ (+ x 4.0) y_m) (* z (/ x y_m)))
(/ (- (+ x 4.0) (* x z)) y_m))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2.05e-148) {
tmp = ((x + 4.0) / y_m) + (z * (x / y_m));
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 2.05d-148) then
tmp = ((x + 4.0d0) / y_m) + (z * (x / y_m))
else
tmp = ((x + 4.0d0) - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2.05e-148) {
tmp = ((x + 4.0) / y_m) + (z * (x / y_m));
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = x * ((-1.0 + z) / y_m) elif x <= 2.05e-148: tmp = ((x + 4.0) / y_m) + (z * (x / y_m)) else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 2.05e-148) tmp = Float64(Float64(Float64(x + 4.0) / y_m) + Float64(z * Float64(x / y_m))); else tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.0) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 2.05e-148) tmp = ((x + 4.0) / y_m) + (z * (x / y_m)); else tmp = ((x + 4.0) - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.05e-148], N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(z * N[(x / y$95$m), $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 -4:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-148}:\\
\;\;\;\;\frac{x + 4}{y\_m} + z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -4 < x < 2.0500000000000001e-148Initial program 97.9%
fabs-sub97.9%
associate-*l/99.9%
associate-*r/86.9%
fma-neg86.9%
distribute-neg-frac86.9%
+-commutative86.9%
distribute-neg-in86.9%
unsub-neg86.9%
metadata-eval86.9%
Simplified86.9%
fma-undefine86.9%
associate-*r/99.9%
associate-*l/97.9%
div-inv97.9%
sub-neg97.9%
metadata-eval97.9%
distribute-neg-in97.9%
+-commutative97.9%
cancel-sign-sub-inv97.9%
div-inv97.9%
fabs-sub97.9%
add-sqr-sqrt33.7%
fabs-sqr33.7%
add-sqr-sqrt34.7%
sub-neg34.7%
distribute-rgt-neg-in34.7%
Applied egg-rr34.7%
add-sqr-sqrt19.1%
sqrt-unprod26.8%
sqr-neg26.8%
sqrt-unprod21.0%
add-sqr-sqrt37.0%
*-un-lft-identity37.0%
Applied egg-rr37.0%
*-lft-identity37.0%
Simplified37.0%
if 2.0500000000000001e-148 < x Initial program 97.1%
fabs-sub97.1%
associate-*l/95.3%
associate-*r/98.0%
fma-neg98.9%
distribute-neg-frac98.9%
+-commutative98.9%
distribute-neg-in98.9%
unsub-neg98.9%
metadata-eval98.9%
Simplified98.9%
fma-undefine98.0%
associate-*r/95.3%
associate-*l/97.1%
div-inv97.0%
sub-neg97.0%
metadata-eval97.0%
distribute-neg-in97.0%
+-commutative97.0%
cancel-sign-sub-inv97.0%
div-inv97.1%
fabs-sub97.1%
add-sqr-sqrt43.5%
fabs-sqr43.5%
add-sqr-sqrt44.3%
associate-*l/43.4%
sub-div44.4%
Applied egg-rr44.4%
Final simplification43.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -9.5e-61) (* x (/ (+ -1.0 z) y_m)) (if (<= x 3.9) (/ (- 4.0 (* x z)) y_m) (* x (/ (- 1.0 z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -9.5e-61) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 3.9) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.5d-61)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 3.9d0) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = x * ((1.0d0 - z) / y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -9.5e-61) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 3.9) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -9.5e-61: tmp = x * ((-1.0 + z) / y_m) elif x <= 3.9: tmp = (4.0 - (x * z)) / y_m else: tmp = x * ((1.0 - z) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -9.5e-61) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 3.9) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(x * Float64(Float64(1.0 - z) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -9.5e-61) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 3.9) tmp = (4.0 - (x * z)) / y_m; else tmp = x * ((1.0 - z) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -9.5e-61], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 3.9:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -9.49999999999999986e-61Initial program 90.1%
fabs-sub90.1%
associate-*l/86.3%
associate-*r/94.3%
fma-neg97.1%
distribute-neg-frac97.1%
+-commutative97.1%
distribute-neg-in97.1%
unsub-neg97.1%
metadata-eval97.1%
Simplified97.1%
add-sqr-sqrt49.1%
fabs-sqr49.1%
add-sqr-sqrt49.6%
fma-undefine48.2%
associate-*r/45.5%
associate-*l/45.4%
div-inv45.3%
sub-neg45.3%
metadata-eval45.3%
distribute-neg-in45.3%
+-commutative45.3%
cancel-sign-sub-inv45.3%
div-inv45.4%
associate-*l/45.5%
sub-div48.3%
Applied egg-rr48.3%
Taylor expanded in x around inf 43.0%
associate-/l*45.6%
sub-neg45.6%
metadata-eval45.6%
Simplified45.6%
if -9.49999999999999986e-61 < x < 3.89999999999999991Initial program 97.5%
fabs-sub97.5%
associate-*l/99.9%
associate-*r/88.7%
fma-neg88.7%
distribute-neg-frac88.7%
+-commutative88.7%
distribute-neg-in88.7%
unsub-neg88.7%
metadata-eval88.7%
Simplified88.7%
fma-undefine88.7%
associate-*r/99.9%
associate-*l/97.5%
div-inv97.5%
sub-neg97.5%
metadata-eval97.5%
distribute-neg-in97.5%
+-commutative97.5%
cancel-sign-sub-inv97.5%
div-inv97.5%
fabs-sub97.5%
add-sqr-sqrt37.3%
fabs-sqr37.3%
add-sqr-sqrt38.4%
associate-*l/39.2%
sub-div39.2%
Applied egg-rr39.2%
Taylor expanded in x around 0 39.2%
if 3.89999999999999991 < x Initial program 97.1%
Simplified94.4%
add-sqr-sqrt39.8%
fabs-sqr39.8%
add-sqr-sqrt40.4%
associate-*l/40.5%
clear-num40.4%
mul-1-neg40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 40.5%
associate-/l*41.7%
Simplified41.7%
Final simplification41.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (* x (/ (+ -1.0 z) y_m)) (if (<= x 2500000000.0) (+ (/ x y_m) (/ 4.0 y_m)) (* x (/ (- 1.0 z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2500000000.0) {
tmp = (x / y_m) + (4.0 / y_m);
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 2500000000.0d0) then
tmp = (x / y_m) + (4.0d0 / y_m)
else
tmp = x * ((1.0d0 - z) / y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 2500000000.0) {
tmp = (x / y_m) + (4.0 / y_m);
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = x * ((-1.0 + z) / y_m) elif x <= 2500000000.0: tmp = (x / y_m) + (4.0 / y_m) else: tmp = x * ((1.0 - z) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 2500000000.0) tmp = Float64(Float64(x / y_m) + Float64(4.0 / y_m)); else tmp = Float64(x * Float64(Float64(1.0 - z) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.0) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 2500000000.0) tmp = (x / y_m) + (4.0 / y_m); else tmp = x * ((1.0 - z) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2500000000.0], N[(N[(x / y$95$m), $MachinePrecision] + N[(4.0 / y$95$m), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 2500000000:\\
\;\;\;\;\frac{x}{y\_m} + \frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -4 < x < 2.5e9Initial program 97.8%
fabs-sub97.8%
associate-*l/99.9%
associate-*r/90.0%
fma-neg90.0%
distribute-neg-frac90.0%
+-commutative90.0%
distribute-neg-in90.0%
unsub-neg90.0%
metadata-eval90.0%
Simplified90.0%
fma-undefine90.0%
associate-*r/99.9%
associate-*l/97.8%
div-inv97.8%
sub-neg97.8%
metadata-eval97.8%
distribute-neg-in97.8%
+-commutative97.8%
cancel-sign-sub-inv97.8%
div-inv97.8%
fabs-sub97.8%
add-sqr-sqrt37.5%
fabs-sqr37.5%
add-sqr-sqrt38.7%
sub-neg38.7%
distribute-rgt-neg-in38.7%
Applied egg-rr38.7%
add-sqr-sqrt17.5%
sqrt-unprod30.1%
sqr-neg30.1%
sqrt-unprod23.4%
add-sqr-sqrt39.5%
*-un-lft-identity39.5%
Applied egg-rr39.5%
*-lft-identity39.5%
Simplified39.5%
Taylor expanded in z around 0 28.0%
associate-*r/28.0%
metadata-eval28.0%
Simplified28.0%
if 2.5e9 < x Initial program 96.9%
Simplified94.2%
add-sqr-sqrt41.6%
fabs-sqr41.6%
add-sqr-sqrt42.2%
associate-*l/42.3%
clear-num42.1%
mul-1-neg42.1%
Applied egg-rr42.1%
Taylor expanded in x around inf 42.2%
associate-/l*43.5%
Simplified43.5%
Final simplification37.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (* x (/ (+ -1.0 z) y_m)) (if (<= x 510000000000.0) (/ (+ x 4.0) y_m) (* x (/ (- 1.0 z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 510000000000.0) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = x * (((-1.0d0) + z) / y_m)
else if (x <= 510000000000.0d0) then
tmp = (x + 4.0d0) / y_m
else
tmp = x * ((1.0d0 - z) / y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = x * ((-1.0 + z) / y_m);
} else if (x <= 510000000000.0) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = x * ((-1.0 + z) / y_m) elif x <= 510000000000.0: tmp = (x + 4.0) / y_m else: tmp = x * ((1.0 - z) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); elseif (x <= 510000000000.0) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(x * Float64(Float64(1.0 - z) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.0) tmp = x * ((-1.0 + z) / y_m); elseif (x <= 510000000000.0) tmp = (x + 4.0) / y_m; else tmp = x * ((1.0 - z) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 510000000000.0], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{elif}\;x \leq 510000000000:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -4 < x < 5.1e11Initial program 97.8%
fabs-sub97.8%
associate-*l/99.9%
associate-*r/90.0%
fma-neg90.0%
distribute-neg-frac90.0%
+-commutative90.0%
distribute-neg-in90.0%
unsub-neg90.0%
metadata-eval90.0%
Simplified90.0%
fma-undefine90.0%
associate-*r/99.9%
associate-*l/97.8%
div-inv97.8%
sub-neg97.8%
metadata-eval97.8%
distribute-neg-in97.8%
+-commutative97.8%
cancel-sign-sub-inv97.8%
div-inv97.8%
fabs-sub97.8%
add-sqr-sqrt37.5%
fabs-sqr37.5%
add-sqr-sqrt38.7%
associate-*l/39.3%
sub-div39.3%
Applied egg-rr39.3%
Taylor expanded in z around 0 28.0%
if 5.1e11 < x Initial program 96.9%
Simplified94.2%
add-sqr-sqrt41.6%
fabs-sqr41.6%
add-sqr-sqrt42.2%
associate-*l/42.3%
clear-num42.1%
mul-1-neg42.1%
Applied egg-rr42.1%
Taylor expanded in x around inf 42.2%
associate-/l*43.5%
Simplified43.5%
Final simplification37.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.5) (* 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 <= -4.5) {
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 <= (-4.5d0)) 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 <= -4.5) {
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 <= -4.5: 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 <= -4.5) 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 <= -4.5) 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, -4.5], 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 -4.5:\\
\;\;\;\;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 < -4.5Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -4.5 < x Initial program 97.5%
fabs-sub97.5%
associate-*l/97.5%
associate-*r/92.8%
fma-neg93.3%
distribute-neg-frac93.3%
+-commutative93.3%
distribute-neg-in93.3%
unsub-neg93.3%
metadata-eval93.3%
Simplified93.3%
fma-undefine92.8%
associate-*r/97.5%
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-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.9%
associate-*l/39.8%
sub-div40.3%
Applied egg-rr40.3%
Final simplification42.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -10.2) (/ 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 <= -10.2) {
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 <= (-10.2d0)) 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 <= -10.2) {
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 <= -10.2: 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 <= -10.2) 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 <= -10.2) 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, -10.2], 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 -10.2:\\
\;\;\;\;\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 < -10.199999999999999Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in z around 0 41.8%
associate-*r/41.8%
distribute-lft-in41.8%
metadata-eval41.8%
neg-mul-141.8%
sub-neg41.8%
Simplified41.8%
Taylor expanded in x around inf 41.8%
neg-mul-141.8%
Simplified41.8%
if -10.199999999999999 < x < 4Initial program 97.7%
fabs-sub97.7%
associate-*l/99.9%
associate-*r/89.8%
fma-neg89.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/97.7%
div-inv97.7%
sub-neg97.7%
metadata-eval97.7%
distribute-neg-in97.7%
+-commutative97.7%
cancel-sign-sub-inv97.7%
div-inv97.7%
fabs-sub97.7%
add-sqr-sqrt38.4%
fabs-sqr38.4%
add-sqr-sqrt39.6%
associate-*l/40.2%
sub-div40.2%
Applied egg-rr40.2%
Taylor expanded in x around 0 28.2%
if 4 < x Initial program 97.1%
Simplified94.4%
add-sqr-sqrt39.8%
fabs-sqr39.8%
add-sqr-sqrt40.4%
associate-*l/40.5%
clear-num40.4%
mul-1-neg40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 40.5%
Taylor expanded in z around 0 30.9%
Final simplification32.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -0.31) (* 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 <= -0.31) {
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 <= (-0.31d0)) 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 <= -0.31) {
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 <= -0.31: 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 <= -0.31) 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 <= -0.31) 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, -0.31], 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 -0.31:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -0.309999999999999998Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in x around inf 47.9%
associate-/l*51.1%
sub-neg51.1%
metadata-eval51.1%
Simplified51.1%
if -0.309999999999999998 < x Initial program 97.5%
fabs-sub97.5%
associate-*l/97.5%
associate-*r/92.8%
fma-neg93.3%
distribute-neg-frac93.3%
+-commutative93.3%
distribute-neg-in93.3%
unsub-neg93.3%
metadata-eval93.3%
Simplified93.3%
fma-undefine92.8%
associate-*r/97.5%
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-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.9%
associate-*l/39.8%
sub-div40.3%
Applied egg-rr40.3%
Taylor expanded in z around 0 29.4%
Final simplification34.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 x) y_m) (/ (+ x 4.0) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else
tmp = (x + 4.0d0) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.0) {
tmp = (-4.0 - x) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.0: tmp = (-4.0 - x) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.0) tmp = Float64(Float64(-4.0 - x) / y_m); else tmp = Float64(Float64(x + 4.0) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.0) tmp = (-4.0 - x) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in z around 0 41.8%
associate-*r/41.8%
distribute-lft-in41.8%
metadata-eval41.8%
neg-mul-141.8%
sub-neg41.8%
Simplified41.8%
if -4 < x Initial program 97.5%
fabs-sub97.5%
associate-*l/97.5%
associate-*r/92.8%
fma-neg93.3%
distribute-neg-frac93.3%
+-commutative93.3%
distribute-neg-in93.3%
unsub-neg93.3%
metadata-eval93.3%
Simplified93.3%
fma-undefine92.8%
associate-*r/97.5%
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-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.9%
associate-*l/39.8%
sub-div40.3%
Applied egg-rr40.3%
Taylor expanded in z around 0 29.4%
Final simplification32.3%
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(x / Float64(-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 88.1%
fabs-sub88.1%
associate-*l/83.6%
associate-*r/93.2%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.5%
fma-undefine47.8%
associate-*r/44.6%
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/44.6%
sub-div47.9%
Applied egg-rr47.9%
Taylor expanded in z around 0 41.8%
associate-*r/41.8%
distribute-lft-in41.8%
metadata-eval41.8%
neg-mul-141.8%
sub-neg41.8%
Simplified41.8%
Taylor expanded in x around inf 41.8%
neg-mul-141.8%
Simplified41.8%
if -4 < x Initial program 97.5%
fabs-sub97.5%
associate-*l/97.5%
associate-*r/92.8%
fma-neg93.3%
distribute-neg-frac93.3%
+-commutative93.3%
distribute-neg-in93.3%
unsub-neg93.3%
metadata-eval93.3%
Simplified93.3%
fma-undefine92.8%
associate-*r/97.5%
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-sqrt38.9%
fabs-sqr38.9%
add-sqr-sqrt39.9%
associate-*l/39.8%
sub-div40.3%
Applied egg-rr40.3%
Taylor expanded in z around 0 29.4%
Final simplification32.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = x / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < 4Initial program 94.7%
fabs-sub94.7%
associate-*l/94.7%
associate-*r/90.8%
fma-neg91.9%
distribute-neg-frac91.9%
+-commutative91.9%
distribute-neg-in91.9%
unsub-neg91.9%
metadata-eval91.9%
Simplified91.9%
fma-undefine90.8%
associate-*r/94.7%
associate-*l/94.7%
div-inv94.6%
sub-neg94.6%
metadata-eval94.6%
distribute-neg-in94.6%
+-commutative94.6%
cancel-sign-sub-inv94.6%
div-inv94.7%
fabs-sub94.7%
add-sqr-sqrt40.1%
fabs-sqr40.1%
add-sqr-sqrt41.1%
associate-*l/40.1%
sub-div41.2%
Applied egg-rr41.2%
Taylor expanded in x around 0 20.4%
if 4 < x Initial program 97.1%
Simplified94.4%
add-sqr-sqrt39.8%
fabs-sqr39.8%
add-sqr-sqrt40.4%
associate-*l/40.5%
clear-num40.4%
mul-1-neg40.4%
Applied egg-rr40.4%
Taylor expanded in x around inf 40.5%
Taylor expanded in z around 0 30.9%
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 95.3%
fabs-sub95.3%
associate-*l/94.3%
associate-*r/92.9%
fma-neg94.1%
distribute-neg-frac94.1%
+-commutative94.1%
distribute-neg-in94.1%
unsub-neg94.1%
metadata-eval94.1%
Simplified94.1%
fma-undefine92.9%
associate-*r/94.3%
associate-*l/95.3%
div-inv95.2%
sub-neg95.2%
metadata-eval95.2%
distribute-neg-in95.2%
+-commutative95.2%
cancel-sign-sub-inv95.2%
div-inv95.3%
fabs-sub95.3%
add-sqr-sqrt40.0%
fabs-sqr40.0%
add-sqr-sqrt40.9%
associate-*l/39.8%
sub-div41.0%
Applied egg-rr41.0%
Taylor expanded in x around 0 15.6%
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 95.3%
fabs-sub95.3%
associate-*l/94.3%
associate-*r/92.9%
fma-neg94.1%
distribute-neg-frac94.1%
+-commutative94.1%
distribute-neg-in94.1%
unsub-neg94.1%
metadata-eval94.1%
Simplified94.1%
add-sqr-sqrt52.7%
fabs-sqr52.7%
add-sqr-sqrt53.5%
fma-undefine53.1%
associate-*r/55.7%
associate-*l/55.6%
div-inv55.6%
sub-neg55.6%
metadata-eval55.6%
distribute-neg-in55.6%
+-commutative55.6%
cancel-sign-sub-inv55.6%
div-inv55.6%
associate-*l/55.7%
sub-div56.5%
Applied egg-rr56.5%
Taylor expanded in x around 0 23.9%
herbie shell --seed 2024145
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))