
(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 11 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 400000.0) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 400000.0) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 400000.0) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 400000.0], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 400000:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 4e5Initial program 90.7%
associate-*l/90.4%
sub-div96.9%
Applied egg-rr96.9%
if 4e5 < y Initial program 98.6%
fabs-sub98.6%
associate-*l/90.7%
associate-*r/99.8%
fma-neg99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* z (/ x y_m)))))
(if (<= x -1.65e+78)
t_0
(if (<= x -1.5e-64)
t_1
(if (<= x 2.7e-40) (fabs (/ 4.0 y_m)) (if (<= x 7.2e+30) t_1 t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((z * (x / y_m)));
double tmp;
if (x <= -1.65e+78) {
tmp = t_0;
} else if (x <= -1.5e-64) {
tmp = t_1;
} else if (x <= 2.7e-40) {
tmp = fabs((4.0 / y_m));
} else if (x <= 7.2e+30) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y_m))
t_1 = abs((z * (x / y_m)))
if (x <= (-1.65d+78)) then
tmp = t_0
else if (x <= (-1.5d-64)) then
tmp = t_1
else if (x <= 2.7d-40) then
tmp = abs((4.0d0 / y_m))
else if (x <= 7.2d+30) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double t_1 = Math.abs((z * (x / y_m)));
double tmp;
if (x <= -1.65e+78) {
tmp = t_0;
} else if (x <= -1.5e-64) {
tmp = t_1;
} else if (x <= 2.7e-40) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 7.2e+30) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((z * (x / y_m))) tmp = 0 if x <= -1.65e+78: tmp = t_0 elif x <= -1.5e-64: tmp = t_1 elif x <= 2.7e-40: tmp = math.fabs((4.0 / y_m)) elif x <= 7.2e+30: tmp = t_1 else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(z * Float64(x / y_m))) tmp = 0.0 if (x <= -1.65e+78) tmp = t_0; elseif (x <= -1.5e-64) tmp = t_1; elseif (x <= 2.7e-40) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 7.2e+30) tmp = t_1; else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); t_1 = abs((z * (x / y_m))); tmp = 0.0; if (x <= -1.65e+78) tmp = t_0; elseif (x <= -1.5e-64) tmp = t_1; elseif (x <= 2.7e-40) tmp = abs((4.0 / y_m)); elseif (x <= 7.2e+30) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.65e+78], t$95$0, If[LessEqual[x, -1.5e-64], t$95$1, If[LessEqual[x, 2.7e-40], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 7.2e+30], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
t_1 := \left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-40}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65e78 or 7.2000000000000004e30 < x Initial program 86.3%
Simplified90.3%
Taylor expanded in x around inf 90.4%
associate-/l*99.8%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 67.6%
if -1.65e78 < x < -1.5e-64 or 2.7e-40 < x < 7.2000000000000004e30Initial program 97.6%
associate-*l/97.8%
sub-div97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 51.8%
mul-1-neg51.8%
distribute-rgt-neg-in51.8%
Simplified51.8%
distribute-rgt-neg-out51.8%
distribute-lft-neg-in51.8%
associate-*l/57.8%
add-sqr-sqrt40.0%
sqrt-unprod57.8%
sqr-neg57.8%
sqrt-unprod17.6%
add-sqr-sqrt57.8%
Applied egg-rr57.8%
if -1.5e-64 < x < 2.7e-40Initial program 98.9%
Simplified99.9%
Taylor expanded in x around 0 85.8%
Final simplification72.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -1.65e+78)
t_0
(if (<= x -1.8e-64)
(fabs (* z (/ x y_m)))
(if (<= x 3.05e-40)
(fabs (/ 4.0 y_m))
(if (<= x 2.45e+30) (fabs (/ z (/ y_m x))) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -1.65e+78) {
tmp = t_0;
} else if (x <= -1.8e-64) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 3.05e-40) {
tmp = fabs((4.0 / y_m));
} else if (x <= 2.45e+30) {
tmp = fabs((z / (y_m / x)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-1.65d+78)) then
tmp = t_0
else if (x <= (-1.8d-64)) then
tmp = abs((z * (x / y_m)))
else if (x <= 3.05d-40) then
tmp = abs((4.0d0 / y_m))
else if (x <= 2.45d+30) then
tmp = abs((z / (y_m / x)))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -1.65e+78) {
tmp = t_0;
} else if (x <= -1.8e-64) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 3.05e-40) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 2.45e+30) {
tmp = Math.abs((z / (y_m / x)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -1.65e+78: tmp = t_0 elif x <= -1.8e-64: tmp = math.fabs((z * (x / y_m))) elif x <= 3.05e-40: tmp = math.fabs((4.0 / y_m)) elif x <= 2.45e+30: tmp = math.fabs((z / (y_m / x))) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.65e+78) tmp = t_0; elseif (x <= -1.8e-64) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 3.05e-40) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 2.45e+30) tmp = abs(Float64(z / Float64(y_m / x))); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -1.65e+78) tmp = t_0; elseif (x <= -1.8e-64) tmp = abs((z * (x / y_m))); elseif (x <= 3.05e-40) tmp = abs((4.0 / y_m)); elseif (x <= 2.45e+30) tmp = abs((z / (y_m / x))); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.65e+78], t$95$0, If[LessEqual[x, -1.8e-64], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.05e-40], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.45e+30], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-64}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;x \leq 3.05 \cdot 10^{-40}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2.45 \cdot 10^{+30}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.65e78 or 2.44999999999999992e30 < x Initial program 86.3%
Simplified90.3%
Taylor expanded in x around inf 90.4%
associate-/l*99.8%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 67.6%
if -1.65e78 < x < -1.7999999999999999e-64Initial program 96.9%
associate-*l/97.1%
sub-div97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
distribute-rgt-neg-out46.1%
distribute-lft-neg-in46.1%
associate-*l/54.2%
add-sqr-sqrt54.1%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-unprod0.0%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
if -1.7999999999999999e-64 < x < 3.0500000000000002e-40Initial program 98.9%
Simplified99.9%
Taylor expanded in x around 0 85.8%
if 3.0500000000000002e-40 < x < 2.44999999999999992e30Initial program 99.7%
Simplified99.3%
Taylor expanded in z around inf 68.0%
associate-*r/68.0%
neg-mul-168.0%
distribute-lft-neg-in68.0%
*-commutative68.0%
associate-*r/67.9%
Simplified67.9%
clear-num67.9%
un-div-inv68.0%
add-sqr-sqrt0.0%
sqrt-unprod68.0%
sqr-neg68.0%
sqrt-unprod67.4%
add-sqr-sqrt68.0%
Applied egg-rr68.0%
Final simplification72.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -2.4e+78)
t_0
(if (<= x -1.8e-64)
(fabs (* z (/ x y_m)))
(if (<= x 9.2e-48)
(fabs (/ 4.0 y_m))
(if (<= x 2.7e+30) (fabs (/ (* x z) y_m)) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -2.4e+78) {
tmp = t_0;
} else if (x <= -1.8e-64) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 9.2e-48) {
tmp = fabs((4.0 / y_m));
} else if (x <= 2.7e+30) {
tmp = fabs(((x * z) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-2.4d+78)) then
tmp = t_0
else if (x <= (-1.8d-64)) then
tmp = abs((z * (x / y_m)))
else if (x <= 9.2d-48) then
tmp = abs((4.0d0 / y_m))
else if (x <= 2.7d+30) then
tmp = abs(((x * z) / y_m))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -2.4e+78) {
tmp = t_0;
} else if (x <= -1.8e-64) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 9.2e-48) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 2.7e+30) {
tmp = Math.abs(((x * z) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -2.4e+78: tmp = t_0 elif x <= -1.8e-64: tmp = math.fabs((z * (x / y_m))) elif x <= 9.2e-48: tmp = math.fabs((4.0 / y_m)) elif x <= 2.7e+30: tmp = math.fabs(((x * z) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -2.4e+78) tmp = t_0; elseif (x <= -1.8e-64) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 9.2e-48) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 2.7e+30) tmp = abs(Float64(Float64(x * z) / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -2.4e+78) tmp = t_0; elseif (x <= -1.8e-64) tmp = abs((z * (x / y_m))); elseif (x <= 9.2e-48) tmp = abs((4.0 / y_m)); elseif (x <= 2.7e+30) tmp = abs(((x * z) / y_m)); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.4e+78], t$95$0, If[LessEqual[x, -1.8e-64], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.2e-48], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.7e+30], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-64}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-48}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+30}:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.3999999999999999e78 or 2.6999999999999999e30 < x Initial program 86.3%
Simplified90.3%
Taylor expanded in x around inf 90.4%
associate-/l*99.8%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 67.6%
if -2.3999999999999999e78 < x < -1.7999999999999999e-64Initial program 96.9%
associate-*l/97.1%
sub-div97.1%
Applied egg-rr97.1%
Taylor expanded in z around inf 46.1%
mul-1-neg46.1%
distribute-rgt-neg-in46.1%
Simplified46.1%
distribute-rgt-neg-out46.1%
distribute-lft-neg-in46.1%
associate-*l/54.2%
add-sqr-sqrt54.1%
sqrt-unprod54.2%
sqr-neg54.2%
sqrt-unprod0.0%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
if -1.7999999999999999e-64 < x < 9.2000000000000003e-48Initial program 98.9%
Simplified99.9%
Taylor expanded in x around 0 85.8%
if 9.2000000000000003e-48 < x < 2.6999999999999999e30Initial program 99.7%
Simplified99.3%
Taylor expanded in z around inf 68.0%
associate-*r/68.0%
neg-mul-168.0%
distribute-lft-neg-in68.0%
*-commutative68.0%
associate-*r/67.9%
Simplified67.9%
associate-*r/68.0%
distribute-rgt-neg-out68.0%
distribute-lft-neg-out68.0%
add-sqr-sqrt17.2%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod50.0%
add-sqr-sqrt68.0%
Applied egg-rr68.0%
Final simplification72.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1.5e-58) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1.5e-58) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (z * (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 (y_m <= 1.5d-58) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (z * (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 (y_m <= 1.5e-58) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (z * (x / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 1.5e-58: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (z * (x / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1.5e-58) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 1.5e-58) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (z * (x / y_m)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1.5e-58], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 1.5 \cdot 10^{-58}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if y < 1.50000000000000004e-58Initial program 90.0%
associate-*l/89.7%
sub-div96.7%
Applied egg-rr96.7%
if 1.50000000000000004e-58 < y Initial program 98.8%
Final simplification97.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 5e-142) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (/ z (/ y_m x))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-142) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (z / (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) :: tmp
if (y_m <= 5d-142) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (z / (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 tmp;
if (y_m <= 5e-142) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (z / (y_m / x))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 5e-142: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (z / (y_m / x)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 5e-142) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z / Float64(y_m / x)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 5e-142) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (z / (y_m / x)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 5e-142], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-142}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if y < 5.0000000000000002e-142Initial program 88.3%
associate-*l/88.0%
sub-div96.2%
Applied egg-rr96.2%
if 5.0000000000000002e-142 < y Initial program 99.1%
*-commutative99.1%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
Final simplification97.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -20000000.0) (fabs (* z (/ x y_m))) (if (<= z 1.1e+23) (fabs (/ (- -4.0 x) y_m)) (fabs (/ z (/ y_m x))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -20000000.0) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1.1e+23) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((z / (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) :: tmp
if (z <= (-20000000.0d0)) then
tmp = abs((z * (x / y_m)))
else if (z <= 1.1d+23) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((z / (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 tmp;
if (z <= -20000000.0) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1.1e+23) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -20000000.0: tmp = math.fabs((z * (x / y_m))) elif z <= 1.1e+23: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -20000000.0) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1.1e+23) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(z / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -20000000.0) tmp = abs((z * (x / y_m))); elseif (z <= 1.1e+23) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -20000000.0], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.1e+23], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -20000000:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+23}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if z < -2e7Initial program 98.2%
associate-*l/85.9%
sub-div86.0%
Applied egg-rr86.0%
Taylor expanded in z around inf 60.8%
mul-1-neg60.8%
distribute-rgt-neg-in60.8%
Simplified60.8%
distribute-rgt-neg-out60.8%
distribute-lft-neg-in60.8%
associate-*l/72.9%
add-sqr-sqrt48.1%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod24.7%
add-sqr-sqrt72.9%
Applied egg-rr72.9%
if -2e7 < z < 1.10000000000000004e23Initial program 93.7%
fabs-sub93.7%
associate-*l/97.2%
associate-*r/97.2%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 98.0%
associate-*r/98.0%
distribute-lft-in98.0%
metadata-eval98.0%
neg-mul-198.0%
sub-neg98.0%
Simplified98.0%
if 1.10000000000000004e23 < z Initial program 86.2%
Simplified91.9%
Taylor expanded in z around inf 70.1%
associate-*r/70.1%
neg-mul-170.1%
distribute-lft-neg-in70.1%
*-commutative70.1%
associate-*r/77.8%
Simplified77.8%
clear-num77.7%
un-div-inv77.8%
add-sqr-sqrt43.4%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-unprod34.2%
add-sqr-sqrt77.8%
Applied egg-rr77.8%
Final simplification88.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -0.0045) (fabs (* (/ x y_m) (- 1.0 z))) (if (<= z 1.15e+23) (fabs (/ (- -4.0 x) y_m)) (fabs (/ z (/ y_m x))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -0.0045) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else if (z <= 1.15e+23) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((z / (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) :: tmp
if (z <= (-0.0045d0)) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else if (z <= 1.15d+23) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((z / (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 tmp;
if (z <= -0.0045) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else if (z <= 1.15e+23) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -0.0045: tmp = math.fabs(((x / y_m) * (1.0 - z))) elif z <= 1.15e+23: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -0.0045) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); elseif (z <= 1.15e+23) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(z / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -0.0045) tmp = abs(((x / y_m) * (1.0 - z))); elseif (z <= 1.15e+23) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -0.0045], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.15e+23], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0045:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+23}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if z < -0.00449999999999999966Initial program 98.2%
Simplified86.3%
Taylor expanded in x around -inf 63.8%
*-commutative63.8%
associate-/l*75.4%
neg-mul-175.4%
unsub-neg75.4%
Simplified75.4%
if -0.00449999999999999966 < z < 1.15e23Initial program 93.6%
fabs-sub93.6%
associate-*l/97.1%
associate-*r/97.1%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 99.0%
associate-*r/99.0%
distribute-lft-in99.0%
metadata-eval99.0%
neg-mul-199.0%
sub-neg99.0%
Simplified99.0%
if 1.15e23 < z Initial program 86.2%
Simplified91.9%
Taylor expanded in z around inf 70.1%
associate-*r/70.1%
neg-mul-170.1%
distribute-lft-neg-in70.1%
*-commutative70.1%
associate-*r/77.8%
Simplified77.8%
clear-num77.7%
un-div-inv77.8%
add-sqr-sqrt43.4%
sqrt-unprod66.1%
sqr-neg66.1%
sqrt-unprod34.2%
add-sqr-sqrt77.8%
Applied egg-rr77.8%
Final simplification88.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4e+45) (fabs (* (/ x y_m) (- 1.0 z))) (fabs (/ (- (+ x 4.0) (* x z)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4e+45) {
tmp = fabs(((x / y_m) * (1.0 - z)));
} else {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4d+45)) then
tmp = abs(((x / y_m) * (1.0d0 - z)))
else
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4e+45) {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4e+45: tmp = math.fabs(((x / y_m) * (1.0 - z))) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4e+45) tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); else tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4e+45) tmp = abs(((x / y_m) * (1.0 - z))); else tmp = abs((((x + 4.0) - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4e+45], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+45}:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(1 - z\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if x < -3.9999999999999997e45Initial program 83.2%
Simplified85.6%
Taylor expanded in x around -inf 85.8%
*-commutative85.8%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -3.9999999999999997e45 < x Initial program 96.3%
associate-*l/96.3%
sub-div98.4%
Applied egg-rr98.4%
Final simplification98.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.52) (not (<= x 4.0))) (fabs (/ x y_m)) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.52) || !(x <= 4.0)) {
tmp = fabs((x / y_m));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.52d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y_m))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.52) || !(x <= 4.0)) {
tmp = Math.abs((x / y_m));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.52) or not (x <= 4.0): tmp = math.fabs((x / y_m)) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.52) || !(x <= 4.0)) tmp = abs(Float64(x / y_m)); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.52) || ~((x <= 4.0))) tmp = abs((x / y_m)); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.52], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.52 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.52 or 4 < x Initial program 88.0%
Simplified91.2%
Taylor expanded in x around inf 89.0%
associate-/l*97.4%
div-sub97.4%
associate-*r*97.4%
neg-mul-197.4%
*-commutative97.4%
div-sub97.4%
sub-neg97.4%
metadata-eval97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in z around 0 63.3%
if -1.52 < x < 4Initial program 99.1%
Simplified99.9%
Taylor expanded in x around 0 76.0%
Final simplification69.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y\_m}\right|
\end{array}
Initial program 92.9%
Simplified95.0%
Taylor expanded in x around 0 36.8%
Final simplification36.8%
herbie shell --seed 2024041
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))