
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 5e-50) (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 <= 5e-50) {
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 <= 5e-50) 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, 5e-50], 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 5 \cdot 10^{-50}:\\
\;\;\;\;\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 < 4.99999999999999968e-50Initial program 92.7%
Simplified97.1%
if 4.99999999999999968e-50 < y Initial program 96.4%
fabs-sub96.4%
associate-*l/90.3%
associate-*r/98.8%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1e-28) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1e-28) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1e-28) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x / Float64(y_m / z)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1e-28], 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[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 10^{-28}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 9.99999999999999971e-29Initial program 92.5%
Simplified97.2%
if 9.99999999999999971e-29 < y Initial program 97.2%
associate-*l/90.5%
associate-*r/99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (* z (/ x y_m))))
(if (<= (- t_0 t_1) 5e+307)
(fabs (- t_1 t_0))
(* (/ 1.0 y_m) (- x (* x z))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= 5e+307) {
tmp = fabs((t_1 - t_0));
} else {
tmp = (1.0 / y_m) * (x - (x * z));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = z * (x / y_m)
if ((t_0 - t_1) <= 5d+307) then
tmp = abs((t_1 - t_0))
else
tmp = (1.0d0 / y_m) * (x - (x * z))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= 5e+307) {
tmp = Math.abs((t_1 - t_0));
} else {
tmp = (1.0 / y_m) * (x - (x * z));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = z * (x / y_m) tmp = 0 if (t_0 - t_1) <= 5e+307: tmp = math.fabs((t_1 - t_0)) else: tmp = (1.0 / y_m) * (x - (x * z)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(z * Float64(x / y_m)) tmp = 0.0 if (Float64(t_0 - t_1) <= 5e+307) tmp = abs(Float64(t_1 - t_0)); else tmp = Float64(Float64(1.0 / y_m) * Float64(x - Float64(x * z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = z * (x / y_m); tmp = 0.0; if ((t_0 - t_1) <= 5e+307) tmp = abs((t_1 - t_0)); else tmp = (1.0 / y_m) * (x - (x * z)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - t$95$1), $MachinePrecision], 5e+307], N[Abs[N[(t$95$1 - t$95$0), $MachinePrecision]], $MachinePrecision], N[(N[(1.0 / y$95$m), $MachinePrecision] * N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 - t\_1 \leq 5 \cdot 10^{+307}:\\
\;\;\;\;\left|t\_1 - t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y\_m} \cdot \left(x - x \cdot z\right)\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 5e307Initial program 98.9%
if 5e307 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 61.8%
fabs-sub61.8%
associate-*l/73.5%
associate-*r/73.5%
fmm-def88.2%
distribute-neg-frac88.2%
+-commutative88.2%
distribute-neg-in88.2%
unsub-neg88.2%
metadata-eval88.2%
Simplified88.2%
fma-undefine73.5%
associate-*r/73.5%
associate-*l/61.8%
div-inv61.8%
sub-neg61.8%
metadata-eval61.8%
distribute-neg-in61.8%
+-commutative61.8%
cancel-sign-sub-inv61.8%
div-inv61.8%
fabs-sub61.8%
add-sqr-sqrt61.8%
fabs-sqr61.8%
add-sqr-sqrt61.8%
associate-*l/61.8%
associate-*r/61.8%
Applied egg-rr61.8%
Taylor expanded in x around inf 61.8%
div-inv61.8%
associate-*r/61.8%
div-inv61.8%
distribute-rgt-out--76.5%
*-commutative76.5%
Applied egg-rr76.5%
Final simplification96.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (fabs (- (/ x y_m) (/ z (/ y_m x)))) (/ (- (+ 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 = fabs(((x / y_m) - (z / (y_m / x))));
} 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 = abs(((x / y_m) - (z / (y_m / x))))
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 = Math.abs(((x / y_m) - (z / (y_m / x))));
} 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 = math.fabs(((x / y_m) - (z / (y_m / x)))) 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 = abs(Float64(Float64(x / y_m) - Float64(z / Float64(y_m / x)))); 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 = abs(((x / y_m) - (z / (y_m / x)))); 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[Abs[N[(N[(x / y$95$m), $MachinePrecision] - N[(z / N[(y$95$m / x), $MachinePrecision]), $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:\\
\;\;\;\;\left|\frac{x}{y\_m} - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 92.2%
*-commutative92.2%
clear-num92.2%
un-div-inv92.2%
Applied egg-rr92.2%
Taylor expanded in x around inf 92.0%
if -4 < x Initial program 94.8%
fabs-sub94.8%
associate-*l/96.1%
associate-*r/94.5%
fmm-def95.7%
distribute-neg-frac95.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
metadata-eval95.7%
Simplified95.7%
fma-undefine94.5%
associate-*r/96.1%
associate-*l/94.8%
div-inv94.7%
sub-neg94.7%
metadata-eval94.7%
distribute-neg-in94.7%
+-commutative94.7%
cancel-sign-sub-inv94.7%
div-inv94.8%
fabs-sub94.8%
add-sqr-sqrt51.3%
fabs-sqr51.3%
add-sqr-sqrt52.4%
associate-*l/50.5%
sub-div51.0%
Applied egg-rr51.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -1.9) (* (/ x y_m) (+ -1.0 z)) (if (<= x 4.0) (- (/ 4.0 y_m) (/ x (/ y_m z))) (* x (/ (- 1.0 z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.9) {
tmp = (x / y_m) * (-1.0 + z);
} else if (x <= 4.0) {
tmp = (4.0 / y_m) - (x / (y_m / z));
} 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 <= (-1.9d0)) then
tmp = (x / y_m) * ((-1.0d0) + z)
else if (x <= 4.0d0) then
tmp = (4.0d0 / y_m) - (x / (y_m / z))
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 <= -1.9) {
tmp = (x / y_m) * (-1.0 + z);
} else if (x <= 4.0) {
tmp = (4.0 / y_m) - (x / (y_m / z));
} 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 <= -1.9: tmp = (x / y_m) * (-1.0 + z) elif x <= 4.0: tmp = (4.0 / y_m) - (x / (y_m / z)) 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 <= -1.9) tmp = Float64(Float64(x / y_m) * Float64(-1.0 + z)); elseif (x <= 4.0) tmp = Float64(Float64(4.0 / y_m) - Float64(x / Float64(y_m / z))); 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 <= -1.9) tmp = (x / y_m) * (-1.0 + z); elseif (x <= 4.0) tmp = (4.0 / y_m) - (x / (y_m / z)); 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, -1.9], N[(N[(x / y$95$m), $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $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 -1.9:\\
\;\;\;\;\frac{x}{y\_m} \cdot \left(-1 + z\right)\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -1.8999999999999999Initial program 92.2%
fabs-sub92.2%
associate-*l/81.4%
associate-*r/92.2%
fmm-def96.1%
distribute-neg-frac96.1%
+-commutative96.1%
distribute-neg-in96.1%
unsub-neg96.1%
metadata-eval96.1%
Simplified96.1%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.2%
fma-undefine45.2%
associate-*r/40.4%
associate-*l/45.2%
div-inv45.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
cancel-sign-sub-inv45.2%
div-inv45.2%
associate-*l/40.4%
sub-div42.9%
Applied egg-rr42.9%
Taylor expanded in x around inf 42.7%
associate-/l*47.5%
div-sub47.5%
sub-neg47.5%
distribute-neg-frac47.5%
metadata-eval47.5%
distribute-rgt-in44.9%
associate-*l/40.1%
associate-*r/44.9%
associate-*l/45.0%
associate-*r/45.0%
distribute-rgt-out47.5%
Simplified47.5%
if -1.8999999999999999 < x < 4Initial program 98.1%
fabs-sub98.1%
associate-*l/99.9%
associate-*r/94.4%
fmm-def94.4%
distribute-neg-frac94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
metadata-eval94.4%
Simplified94.4%
fma-undefine94.4%
associate-*r/99.9%
associate-*l/98.1%
div-inv98.1%
sub-neg98.1%
metadata-eval98.1%
distribute-neg-in98.1%
+-commutative98.1%
cancel-sign-sub-inv98.1%
div-inv98.1%
fabs-sub98.1%
add-sqr-sqrt50.8%
fabs-sqr50.8%
add-sqr-sqrt52.1%
associate-*l/52.3%
associate-*r/49.0%
Applied egg-rr49.0%
clear-num49.0%
div-inv49.8%
Applied egg-rr49.8%
Taylor expanded in x around 0 49.7%
if 4 < x Initial program 87.7%
fabs-sub87.7%
associate-*l/88.2%
associate-*r/94.7%
fmm-def98.2%
distribute-neg-frac98.2%
+-commutative98.2%
distribute-neg-in98.2%
unsub-neg98.2%
metadata-eval98.2%
Simplified98.2%
fma-undefine94.7%
associate-*r/88.2%
associate-*l/87.7%
div-inv87.5%
sub-neg87.5%
metadata-eval87.5%
distribute-neg-in87.5%
+-commutative87.5%
cancel-sign-sub-inv87.5%
div-inv87.7%
fabs-sub87.7%
add-sqr-sqrt52.3%
fabs-sqr52.3%
add-sqr-sqrt53.1%
associate-*l/46.5%
associate-*r/53.1%
Applied egg-rr53.1%
clear-num53.0%
div-inv53.1%
Applied egg-rr53.1%
Taylor expanded in x around inf 54.0%
Simplified54.0%
Final simplification50.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -68.0) (/ (- -4.0 x) y_m) (if (<= x 0.00175) (/ (* x z) y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -68.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 0.00175) {
tmp = (x * z) / 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 <= (-68.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 0.00175d0) then
tmp = (x * z) / 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 <= -68.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 0.00175) {
tmp = (x * z) / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -68.0: tmp = (-4.0 - x) / y_m elif x <= 0.00175: tmp = (x * z) / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -68.0) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 0.00175) tmp = Float64(Float64(x * z) / 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 <= -68.0) tmp = (-4.0 - x) / y_m; elseif (x <= 0.00175) tmp = (x * z) / 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, -68.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 0.00175], N[(N[(x * z), $MachinePrecision] / 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 -68:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 0.00175:\\
\;\;\;\;\frac{x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -68Initial program 92.1%
fabs-sub92.1%
associate-*l/81.1%
associate-*r/92.1%
fmm-def96.0%
distribute-neg-frac96.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
metadata-eval96.0%
Simplified96.0%
add-sqr-sqrt45.1%
fabs-sqr45.1%
add-sqr-sqrt45.8%
fma-undefine45.7%
associate-*r/40.9%
associate-*l/45.8%
div-inv45.8%
sub-neg45.8%
metadata-eval45.8%
distribute-neg-in45.8%
+-commutative45.8%
cancel-sign-sub-inv45.8%
div-inv45.8%
associate-*l/40.9%
sub-div43.5%
Applied egg-rr43.5%
Taylor expanded in z around 0 27.4%
associate-*r/27.4%
distribute-lft-in27.4%
metadata-eval27.4%
neg-mul-127.4%
sub-neg27.4%
Simplified27.4%
if -68 < x < 0.00175000000000000004Initial program 98.1%
fabs-sub98.1%
associate-*l/99.9%
associate-*r/94.4%
fmm-def94.4%
distribute-neg-frac94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
metadata-eval94.4%
Simplified94.4%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.6%
fma-undefine46.6%
associate-*r/48.8%
associate-*l/47.2%
div-inv47.2%
sub-neg47.2%
metadata-eval47.2%
distribute-neg-in47.2%
+-commutative47.2%
cancel-sign-sub-inv47.2%
div-inv47.2%
associate-*l/48.8%
sub-div48.8%
Applied egg-rr48.8%
Taylor expanded in z around inf 15.4%
if 0.00175000000000000004 < x Initial program 87.9%
fabs-sub87.9%
associate-*l/88.4%
associate-*r/94.8%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
fma-undefine94.8%
associate-*r/88.4%
associate-*l/87.9%
div-inv87.7%
sub-neg87.7%
metadata-eval87.7%
distribute-neg-in87.7%
+-commutative87.7%
cancel-sign-sub-inv87.7%
div-inv87.9%
fabs-sub87.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.3%
associate-*l/45.8%
associate-*r/52.3%
Applied egg-rr52.3%
Taylor expanded in x around inf 51.5%
Taylor expanded in z around 0 31.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -105.0) (/ (- x) y_m) (if (<= x 0.0035) (/ (* x z) y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -105.0) {
tmp = -x / y_m;
} else if (x <= 0.0035) {
tmp = (x * z) / 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 <= (-105.0d0)) then
tmp = -x / y_m
else if (x <= 0.0035d0) then
tmp = (x * z) / 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 <= -105.0) {
tmp = -x / y_m;
} else if (x <= 0.0035) {
tmp = (x * z) / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -105.0: tmp = -x / y_m elif x <= 0.0035: tmp = (x * z) / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -105.0) tmp = Float64(Float64(-x) / y_m); elseif (x <= 0.0035) tmp = Float64(Float64(x * z) / 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 <= -105.0) tmp = -x / y_m; elseif (x <= 0.0035) tmp = (x * z) / 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, -105.0], N[((-x) / y$95$m), $MachinePrecision], If[LessEqual[x, 0.0035], N[(N[(x * z), $MachinePrecision] / 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 -105:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq 0.0035:\\
\;\;\;\;\frac{x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -105Initial program 92.1%
fabs-sub92.1%
associate-*l/81.1%
associate-*r/92.1%
fmm-def96.0%
distribute-neg-frac96.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
metadata-eval96.0%
Simplified96.0%
add-sqr-sqrt45.1%
fabs-sqr45.1%
add-sqr-sqrt45.8%
fma-undefine45.7%
associate-*r/40.9%
associate-*l/45.8%
div-inv45.8%
sub-neg45.8%
metadata-eval45.8%
distribute-neg-in45.8%
+-commutative45.8%
cancel-sign-sub-inv45.8%
div-inv45.8%
associate-*l/40.9%
sub-div43.5%
Applied egg-rr43.5%
Taylor expanded in x around inf 43.3%
Taylor expanded in z around 0 27.4%
neg-mul-127.4%
Simplified27.4%
if -105 < x < 0.00350000000000000007Initial program 98.1%
fabs-sub98.1%
associate-*l/99.9%
associate-*r/94.4%
fmm-def94.4%
distribute-neg-frac94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
metadata-eval94.4%
Simplified94.4%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.6%
fma-undefine46.6%
associate-*r/48.8%
associate-*l/47.2%
div-inv47.2%
sub-neg47.2%
metadata-eval47.2%
distribute-neg-in47.2%
+-commutative47.2%
cancel-sign-sub-inv47.2%
div-inv47.2%
associate-*l/48.8%
sub-div48.8%
Applied egg-rr48.8%
Taylor expanded in z around inf 15.4%
if 0.00350000000000000007 < x Initial program 87.9%
fabs-sub87.9%
associate-*l/88.4%
associate-*r/94.8%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
fma-undefine94.8%
associate-*r/88.4%
associate-*l/87.9%
div-inv87.7%
sub-neg87.7%
metadata-eval87.7%
distribute-neg-in87.7%
+-commutative87.7%
cancel-sign-sub-inv87.7%
div-inv87.9%
fabs-sub87.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.3%
associate-*l/45.8%
associate-*r/52.3%
Applied egg-rr52.3%
Taylor expanded in x around inf 51.5%
Taylor expanded in z around 0 31.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2200.0) (/ (- x) y_m) (if (<= x 0.0038) (* x (/ z y_m)) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2200.0) {
tmp = -x / y_m;
} else if (x <= 0.0038) {
tmp = x * (z / 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 <= (-2200.0d0)) then
tmp = -x / y_m
else if (x <= 0.0038d0) then
tmp = x * (z / 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 <= -2200.0) {
tmp = -x / y_m;
} else if (x <= 0.0038) {
tmp = x * (z / y_m);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2200.0: tmp = -x / y_m elif x <= 0.0038: tmp = x * (z / y_m) else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2200.0) tmp = Float64(Float64(-x) / y_m); elseif (x <= 0.0038) tmp = Float64(x * Float64(z / 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 <= -2200.0) tmp = -x / y_m; elseif (x <= 0.0038) tmp = x * (z / 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, -2200.0], N[((-x) / y$95$m), $MachinePrecision], If[LessEqual[x, 0.0038], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2200:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq 0.0038:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -2200Initial program 92.1%
fabs-sub92.1%
associate-*l/81.1%
associate-*r/92.1%
fmm-def96.0%
distribute-neg-frac96.0%
+-commutative96.0%
distribute-neg-in96.0%
unsub-neg96.0%
metadata-eval96.0%
Simplified96.0%
add-sqr-sqrt45.1%
fabs-sqr45.1%
add-sqr-sqrt45.8%
fma-undefine45.7%
associate-*r/40.9%
associate-*l/45.8%
div-inv45.8%
sub-neg45.8%
metadata-eval45.8%
distribute-neg-in45.8%
+-commutative45.8%
cancel-sign-sub-inv45.8%
div-inv45.8%
associate-*l/40.9%
sub-div43.5%
Applied egg-rr43.5%
Taylor expanded in x around inf 43.3%
Taylor expanded in z around 0 27.4%
neg-mul-127.4%
Simplified27.4%
if -2200 < x < 0.00379999999999999999Initial program 98.1%
fabs-sub98.1%
associate-*l/99.9%
associate-*r/94.4%
fmm-def94.4%
distribute-neg-frac94.4%
+-commutative94.4%
distribute-neg-in94.4%
unsub-neg94.4%
metadata-eval94.4%
Simplified94.4%
add-sqr-sqrt45.3%
fabs-sqr45.3%
add-sqr-sqrt46.6%
fma-undefine46.6%
associate-*r/48.8%
associate-*l/47.2%
div-inv47.2%
sub-neg47.2%
metadata-eval47.2%
distribute-neg-in47.2%
+-commutative47.2%
cancel-sign-sub-inv47.2%
div-inv47.2%
associate-*l/48.8%
sub-div48.8%
Applied egg-rr48.8%
Taylor expanded in x around inf 15.5%
associate-/l*13.2%
sub-neg13.2%
metadata-eval13.2%
Simplified13.2%
Taylor expanded in z around inf 13.1%
if 0.00379999999999999999 < x Initial program 87.9%
fabs-sub87.9%
associate-*l/88.4%
associate-*r/94.8%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
fma-undefine94.8%
associate-*r/88.4%
associate-*l/87.9%
div-inv87.7%
sub-neg87.7%
metadata-eval87.7%
distribute-neg-in87.7%
+-commutative87.7%
cancel-sign-sub-inv87.7%
div-inv87.9%
fabs-sub87.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.3%
associate-*l/45.8%
associate-*r/52.3%
Applied egg-rr52.3%
Taylor expanded in x around inf 51.5%
Taylor expanded in z around 0 31.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -7.5) (* (/ 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 <= -7.5) {
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 <= (-7.5d0)) 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 <= -7.5) {
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 <= -7.5: 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 <= -7.5) tmp = Float64(Float64(x / 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 <= -7.5) 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, -7.5], N[(N[(x / y$95$m), $MachinePrecision] * N[(-1.0 + z), $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 -7.5:\\
\;\;\;\;\frac{x}{y\_m} \cdot \left(-1 + z\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -7.5Initial program 92.2%
fabs-sub92.2%
associate-*l/81.4%
associate-*r/92.2%
fmm-def96.1%
distribute-neg-frac96.1%
+-commutative96.1%
distribute-neg-in96.1%
unsub-neg96.1%
metadata-eval96.1%
Simplified96.1%
add-sqr-sqrt44.6%
fabs-sqr44.6%
add-sqr-sqrt45.2%
fma-undefine45.2%
associate-*r/40.4%
associate-*l/45.2%
div-inv45.2%
sub-neg45.2%
metadata-eval45.2%
distribute-neg-in45.2%
+-commutative45.2%
cancel-sign-sub-inv45.2%
div-inv45.2%
associate-*l/40.4%
sub-div42.9%
Applied egg-rr42.9%
Taylor expanded in x around inf 42.7%
associate-/l*47.5%
div-sub47.5%
sub-neg47.5%
distribute-neg-frac47.5%
metadata-eval47.5%
distribute-rgt-in44.9%
associate-*l/40.1%
associate-*r/44.9%
associate-*l/45.0%
associate-*r/45.0%
distribute-rgt-out47.5%
Simplified47.5%
if -7.5 < x Initial program 94.8%
fabs-sub94.8%
associate-*l/96.1%
associate-*r/94.5%
fmm-def95.7%
distribute-neg-frac95.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
metadata-eval95.7%
Simplified95.7%
fma-undefine94.5%
associate-*r/96.1%
associate-*l/94.8%
div-inv94.7%
sub-neg94.7%
metadata-eval94.7%
distribute-neg-in94.7%
+-commutative94.7%
cancel-sign-sub-inv94.7%
div-inv94.8%
fabs-sub94.8%
add-sqr-sqrt51.3%
fabs-sqr51.3%
add-sqr-sqrt52.4%
associate-*l/50.5%
sub-div51.0%
Applied egg-rr51.0%
Final simplification49.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 0.00255) (* x (/ (+ -1.0 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 <= 0.00255) {
tmp = x * ((-1.0 + 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 <= 0.00255d0) then
tmp = x * (((-1.0d0) + 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 <= 0.00255) {
tmp = x * ((-1.0 + 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 <= 0.00255: tmp = x * ((-1.0 + 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 <= 0.00255) tmp = Float64(x * Float64(Float64(-1.0 + 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 <= 0.00255) tmp = x * ((-1.0 + 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, 0.00255], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / 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 0.00255:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < 0.0025500000000000002Initial program 95.8%
fabs-sub95.8%
associate-*l/92.6%
associate-*r/93.5%
fmm-def95.0%
distribute-neg-frac95.0%
+-commutative95.0%
distribute-neg-in95.0%
unsub-neg95.0%
metadata-eval95.0%
Simplified95.0%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt46.3%
fma-undefine46.3%
associate-*r/45.7%
associate-*l/46.7%
div-inv46.7%
sub-neg46.7%
metadata-eval46.7%
distribute-neg-in46.7%
+-commutative46.7%
cancel-sign-sub-inv46.7%
div-inv46.7%
associate-*l/45.7%
sub-div46.7%
Applied egg-rr46.7%
Taylor expanded in x around inf 26.3%
associate-/l*26.8%
sub-neg26.8%
metadata-eval26.8%
Simplified26.8%
if 0.0025500000000000002 < x Initial program 87.9%
fabs-sub87.9%
associate-*l/88.4%
associate-*r/94.8%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
fma-undefine94.8%
associate-*r/88.4%
associate-*l/87.9%
div-inv87.7%
sub-neg87.7%
metadata-eval87.7%
distribute-neg-in87.7%
+-commutative87.7%
cancel-sign-sub-inv87.7%
div-inv87.9%
fabs-sub87.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.3%
associate-*l/45.8%
associate-*r/52.3%
Applied egg-rr52.3%
clear-num52.2%
div-inv52.2%
Applied egg-rr52.2%
Taylor expanded in x around inf 53.1%
Simplified53.1%
Final simplification32.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 0.0038) (* x (/ (+ -1.0 z) y_m)) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 0.0038) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 0.0038d0) then
tmp = x * (((-1.0d0) + z) / y_m)
else
tmp = x / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= 0.0038) {
tmp = x * ((-1.0 + z) / y_m);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 0.0038: tmp = x * ((-1.0 + z) / y_m) else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 0.0038) tmp = Float64(x * Float64(Float64(-1.0 + z) / y_m)); else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 0.0038) tmp = x * ((-1.0 + z) / y_m); else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 0.0038], N[(x * N[(N[(-1.0 + z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0038:\\
\;\;\;\;x \cdot \frac{-1 + z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < 0.00379999999999999999Initial program 95.8%
fabs-sub95.8%
associate-*l/92.6%
associate-*r/93.5%
fmm-def95.0%
distribute-neg-frac95.0%
+-commutative95.0%
distribute-neg-in95.0%
unsub-neg95.0%
metadata-eval95.0%
Simplified95.0%
add-sqr-sqrt45.2%
fabs-sqr45.2%
add-sqr-sqrt46.3%
fma-undefine46.3%
associate-*r/45.7%
associate-*l/46.7%
div-inv46.7%
sub-neg46.7%
metadata-eval46.7%
distribute-neg-in46.7%
+-commutative46.7%
cancel-sign-sub-inv46.7%
div-inv46.7%
associate-*l/45.7%
sub-div46.7%
Applied egg-rr46.7%
Taylor expanded in x around inf 26.3%
associate-/l*26.8%
sub-neg26.8%
metadata-eval26.8%
Simplified26.8%
if 0.00379999999999999999 < x Initial program 87.9%
fabs-sub87.9%
associate-*l/88.4%
associate-*r/94.8%
fmm-def98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
fma-undefine94.8%
associate-*r/88.4%
associate-*l/87.9%
div-inv87.7%
sub-neg87.7%
metadata-eval87.7%
distribute-neg-in87.7%
+-commutative87.7%
cancel-sign-sub-inv87.7%
div-inv87.9%
fabs-sub87.9%
add-sqr-sqrt51.4%
fabs-sqr51.4%
add-sqr-sqrt52.3%
associate-*l/45.8%
associate-*r/52.3%
Applied egg-rr52.3%
Taylor expanded in x around inf 51.5%
Taylor expanded in z around 0 31.8%
Final simplification27.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2.2e-294) (/ (- x) y_m) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2.2e-294) {
tmp = -x / 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 <= (-2.2d-294)) then
tmp = -x / 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 <= -2.2e-294) {
tmp = -x / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2.2e-294: tmp = -x / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2.2e-294) tmp = Float64(Float64(-x) / 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 <= -2.2e-294) tmp = -x / 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, -2.2e-294], N[((-x) / 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 -2.2 \cdot 10^{-294}:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -2.2e-294Initial program 95.7%
fabs-sub95.7%
associate-*l/89.6%
associate-*r/93.6%
fmm-def95.8%
distribute-neg-frac95.8%
+-commutative95.8%
distribute-neg-in95.8%
unsub-neg95.8%
metadata-eval95.8%
Simplified95.8%
add-sqr-sqrt47.2%
fabs-sqr47.2%
add-sqr-sqrt48.1%
fma-undefine48.1%
associate-*r/46.7%
associate-*l/49.4%
div-inv49.4%
sub-neg49.4%
metadata-eval49.4%
distribute-neg-in49.4%
+-commutative49.4%
cancel-sign-sub-inv49.4%
div-inv49.4%
associate-*l/46.7%
sub-div48.1%
Applied egg-rr48.1%
Taylor expanded in x around inf 31.4%
Taylor expanded in z around 0 16.7%
neg-mul-116.7%
Simplified16.7%
if -2.2e-294 < x Initial program 92.0%
fabs-sub92.0%
associate-*l/94.1%
associate-*r/94.0%
fmm-def95.8%
distribute-neg-frac95.8%
+-commutative95.8%
distribute-neg-in95.8%
unsub-neg95.8%
metadata-eval95.8%
Simplified95.8%
fma-undefine94.0%
associate-*r/94.1%
associate-*l/92.0%
div-inv91.9%
sub-neg91.9%
metadata-eval91.9%
distribute-neg-in91.9%
+-commutative91.9%
cancel-sign-sub-inv91.9%
div-inv92.0%
fabs-sub92.0%
add-sqr-sqrt54.3%
fabs-sqr54.3%
add-sqr-sqrt55.4%
associate-*l/52.3%
associate-*r/53.0%
Applied egg-rr53.0%
Taylor expanded in x around inf 31.5%
Taylor expanded in z around 0 18.3%
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 94.0%
fabs-sub94.0%
associate-*l/91.6%
associate-*r/93.8%
fmm-def95.8%
distribute-neg-frac95.8%
+-commutative95.8%
distribute-neg-in95.8%
unsub-neg95.8%
metadata-eval95.8%
Simplified95.8%
fma-undefine93.8%
associate-*r/91.6%
associate-*l/94.0%
div-inv93.9%
sub-neg93.9%
metadata-eval93.9%
distribute-neg-in93.9%
+-commutative93.9%
cancel-sign-sub-inv93.9%
div-inv94.0%
fabs-sub94.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt51.0%
associate-*l/47.8%
associate-*r/49.5%
Applied egg-rr49.5%
Taylor expanded in x around inf 31.6%
Taylor expanded in z around 0 19.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 94.0%
fabs-sub94.0%
associate-*l/91.6%
associate-*r/93.8%
fmm-def95.8%
distribute-neg-frac95.8%
+-commutative95.8%
distribute-neg-in95.8%
unsub-neg95.8%
metadata-eval95.8%
Simplified95.8%
add-sqr-sqrt45.1%
fabs-sqr45.1%
add-sqr-sqrt46.1%
fma-undefine45.7%
associate-*r/45.3%
associate-*l/44.4%
div-inv44.4%
sub-neg44.4%
metadata-eval44.4%
distribute-neg-in44.4%
+-commutative44.4%
cancel-sign-sub-inv44.4%
div-inv44.4%
associate-*l/45.3%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in x around 0 18.9%
herbie shell --seed 2024165
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))