
(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 12 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 510000000000.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 <= 510000000000.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 <= 510000000000.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, 510000000000.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 510000000000:\\
\;\;\;\;\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 < 5.1e11Initial program 89.9%
associate-*l/91.4%
sub-div96.0%
Applied egg-rr96.0%
if 5.1e11 < y Initial program 94.1%
fabs-sub94.1%
associate-*l/83.1%
associate-*r/99.9%
fmm-def99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification97.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -10.2)
t_0
(if (<= x 8.8e-31)
(fabs (/ 4.0 y_m))
(if (or (<= x 3.6e+57) (not (<= x 1.02e+167)))
(fabs (* z (/ x 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 <= -10.2) {
tmp = t_0;
} else if (x <= 8.8e-31) {
tmp = fabs((4.0 / y_m));
} else if ((x <= 3.6e+57) || !(x <= 1.02e+167)) {
tmp = fabs((z * (x / 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 <= (-10.2d0)) then
tmp = t_0
else if (x <= 8.8d-31) then
tmp = abs((4.0d0 / y_m))
else if ((x <= 3.6d+57) .or. (.not. (x <= 1.02d+167))) then
tmp = abs((z * (x / 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 <= -10.2) {
tmp = t_0;
} else if (x <= 8.8e-31) {
tmp = Math.abs((4.0 / y_m));
} else if ((x <= 3.6e+57) || !(x <= 1.02e+167)) {
tmp = Math.abs((z * (x / 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 <= -10.2: tmp = t_0 elif x <= 8.8e-31: tmp = math.fabs((4.0 / y_m)) elif (x <= 3.6e+57) or not (x <= 1.02e+167): tmp = math.fabs((z * (x / 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 <= -10.2) tmp = t_0; elseif (x <= 8.8e-31) tmp = abs(Float64(4.0 / y_m)); elseif ((x <= 3.6e+57) || !(x <= 1.02e+167)) tmp = abs(Float64(z * Float64(x / 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 <= -10.2) tmp = t_0; elseif (x <= 8.8e-31) tmp = abs((4.0 / y_m)); elseif ((x <= 3.6e+57) || ~((x <= 1.02e+167))) tmp = abs((z * (x / 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, -10.2], t$95$0, If[LessEqual[x, 8.8e-31], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 3.6e+57], N[Not[LessEqual[x, 1.02e+167]], $MachinePrecision]], N[Abs[N[(z * N[(x / y$95$m), $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 -10.2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.8 \cdot 10^{-31}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+57} \lor \neg \left(x \leq 1.02 \cdot 10^{+167}\right):\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -10.199999999999999 or 3.6000000000000002e57 < x < 1.02e167Initial program 91.7%
Simplified89.7%
Taylor expanded in z around 0 65.9%
+-commutative65.9%
rem-square-sqrt37.4%
fabs-sqr37.4%
rem-square-sqrt65.9%
fabs-neg65.9%
distribute-neg-frac65.9%
distribute-neg-in65.9%
metadata-eval65.9%
+-commutative65.9%
sub-neg65.9%
rem-square-sqrt28.2%
fabs-sqr28.2%
rem-square-sqrt65.9%
Simplified65.9%
Taylor expanded in x around inf 64.8%
associate-*r/64.8%
neg-mul-164.8%
Simplified64.8%
if -10.199999999999999 < x < 8.80000000000000038e-31Initial program 94.5%
Simplified99.8%
Taylor expanded in x around 0 78.0%
if 8.80000000000000038e-31 < x < 3.6000000000000002e57 or 1.02e167 < x Initial program 82.5%
Simplified83.2%
Taylor expanded in z around inf 54.7%
mul-1-neg54.7%
distribute-frac-neg254.7%
associate-/l*69.8%
Simplified69.8%
distribute-frac-neg269.8%
distribute-rgt-neg-in69.8%
clear-num69.7%
div-inv70.9%
distribute-neg-frac70.9%
Applied egg-rr70.9%
add-sqr-sqrt0.0%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod70.6%
add-sqr-sqrt70.9%
associate-/r/76.1%
Applied egg-rr76.1%
Final simplification73.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -10.2)
t_0
(if (<= x 5.1e-32)
(fabs (/ 4.0 y_m))
(if (<= x 7.8e+58)
(fabs (* x (/ z y_m)))
(if (<= x 1.5e+161) t_0 (fabs (* z (/ x y_m)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 5.1e-32) {
tmp = fabs((4.0 / y_m));
} else if (x <= 7.8e+58) {
tmp = fabs((x * (z / y_m)));
} else if (x <= 1.5e+161) {
tmp = t_0;
} else {
tmp = fabs((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) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-10.2d0)) then
tmp = t_0
else if (x <= 5.1d-32) then
tmp = abs((4.0d0 / y_m))
else if (x <= 7.8d+58) then
tmp = abs((x * (z / y_m)))
else if (x <= 1.5d+161) then
tmp = t_0
else
tmp = abs((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 t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 5.1e-32) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 7.8e+58) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= 1.5e+161) {
tmp = t_0;
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -10.2: tmp = t_0 elif x <= 5.1e-32: tmp = math.fabs((4.0 / y_m)) elif x <= 7.8e+58: tmp = math.fabs((x * (z / y_m))) elif x <= 1.5e+161: tmp = t_0 else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -10.2) tmp = t_0; elseif (x <= 5.1e-32) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 7.8e+58) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= 1.5e+161) tmp = t_0; else tmp = abs(Float64(z * Float64(x / y_m))); 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 <= -10.2) tmp = t_0; elseif (x <= 5.1e-32) tmp = abs((4.0 / y_m)); elseif (x <= 7.8e+58) tmp = abs((x * (z / y_m))); elseif (x <= 1.5e+161) tmp = t_0; else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.2], t$95$0, If[LessEqual[x, 5.1e-32], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 7.8e+58], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.5e+161], t$95$0, N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -10.2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-32}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+58}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if x < -10.199999999999999 or 7.8000000000000002e58 < x < 1.50000000000000006e161Initial program 91.7%
Simplified89.7%
Taylor expanded in z around 0 65.9%
+-commutative65.9%
rem-square-sqrt37.4%
fabs-sqr37.4%
rem-square-sqrt65.9%
fabs-neg65.9%
distribute-neg-frac65.9%
distribute-neg-in65.9%
metadata-eval65.9%
+-commutative65.9%
sub-neg65.9%
rem-square-sqrt28.2%
fabs-sqr28.2%
rem-square-sqrt65.9%
Simplified65.9%
Taylor expanded in x around inf 64.8%
associate-*r/64.8%
neg-mul-164.8%
Simplified64.8%
if -10.199999999999999 < x < 5.09999999999999994e-32Initial program 94.5%
Simplified99.8%
Taylor expanded in x around 0 78.0%
if 5.09999999999999994e-32 < x < 7.8000000000000002e58Initial program 91.9%
Simplified95.7%
Taylor expanded in z around inf 68.4%
mul-1-neg68.4%
distribute-frac-neg268.4%
associate-/l*68.8%
Simplified68.8%
distribute-frac-neg268.8%
distribute-rgt-neg-in68.8%
clear-num68.6%
div-inv71.6%
distribute-neg-frac71.6%
Applied egg-rr71.6%
clear-num71.6%
associate-/r/68.6%
clear-num68.8%
add-sqr-sqrt0.0%
sqrt-unprod68.8%
sqr-neg68.8%
sqrt-unprod68.4%
add-sqr-sqrt68.8%
Applied egg-rr68.8%
if 1.50000000000000006e161 < x Initial program 75.6%
Simplified74.1%
Taylor expanded in z around inf 44.8%
mul-1-neg44.8%
distribute-frac-neg244.8%
associate-/l*70.6%
Simplified70.6%
distribute-frac-neg270.6%
distribute-rgt-neg-in70.6%
clear-num70.4%
div-inv70.3%
distribute-neg-frac70.3%
Applied egg-rr70.3%
add-sqr-sqrt0.0%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod70.1%
add-sqr-sqrt70.3%
associate-/r/81.5%
Applied egg-rr81.5%
Final simplification73.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -10.2)
t_0
(if (<= x 2.55e-33)
(fabs (/ 4.0 y_m))
(if (<= x 2.25e+57)
(fabs (/ x (/ y_m z)))
(if (<= x 4.7e+162) t_0 (fabs (* z (/ x y_m)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 2.55e-33) {
tmp = fabs((4.0 / y_m));
} else if (x <= 2.25e+57) {
tmp = fabs((x / (y_m / z)));
} else if (x <= 4.7e+162) {
tmp = t_0;
} else {
tmp = fabs((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) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-10.2d0)) then
tmp = t_0
else if (x <= 2.55d-33) then
tmp = abs((4.0d0 / y_m))
else if (x <= 2.25d+57) then
tmp = abs((x / (y_m / z)))
else if (x <= 4.7d+162) then
tmp = t_0
else
tmp = abs((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 t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 2.55e-33) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 2.25e+57) {
tmp = Math.abs((x / (y_m / z)));
} else if (x <= 4.7e+162) {
tmp = t_0;
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -10.2: tmp = t_0 elif x <= 2.55e-33: tmp = math.fabs((4.0 / y_m)) elif x <= 2.25e+57: tmp = math.fabs((x / (y_m / z))) elif x <= 4.7e+162: tmp = t_0 else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -10.2) tmp = t_0; elseif (x <= 2.55e-33) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 2.25e+57) tmp = abs(Float64(x / Float64(y_m / z))); elseif (x <= 4.7e+162) tmp = t_0; else tmp = abs(Float64(z * Float64(x / y_m))); 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 <= -10.2) tmp = t_0; elseif (x <= 2.55e-33) tmp = abs((4.0 / y_m)); elseif (x <= 2.25e+57) tmp = abs((x / (y_m / z))); elseif (x <= 4.7e+162) tmp = t_0; else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.2], t$95$0, If[LessEqual[x, 2.55e-33], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.25e+57], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.7e+162], t$95$0, N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -10.2:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-33}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+57}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{+162}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if x < -10.199999999999999 or 2.24999999999999998e57 < x < 4.70000000000000003e162Initial program 91.7%
Simplified89.7%
Taylor expanded in z around 0 65.9%
+-commutative65.9%
rem-square-sqrt37.4%
fabs-sqr37.4%
rem-square-sqrt65.9%
fabs-neg65.9%
distribute-neg-frac65.9%
distribute-neg-in65.9%
metadata-eval65.9%
+-commutative65.9%
sub-neg65.9%
rem-square-sqrt28.2%
fabs-sqr28.2%
rem-square-sqrt65.9%
Simplified65.9%
Taylor expanded in x around inf 64.8%
associate-*r/64.8%
neg-mul-164.8%
Simplified64.8%
if -10.199999999999999 < x < 2.55000000000000004e-33Initial program 94.5%
Simplified99.8%
Taylor expanded in x around 0 78.0%
if 2.55000000000000004e-33 < x < 2.24999999999999998e57Initial program 91.9%
Simplified95.7%
Taylor expanded in z around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
distribute-lft-neg-in68.4%
*-commutative68.4%
associate-*r/68.6%
Simplified68.6%
*-commutative68.6%
associate-/r/71.6%
add-sqr-sqrt0.0%
sqrt-unprod71.6%
sqr-neg71.6%
sqrt-unprod71.3%
add-sqr-sqrt71.6%
Applied egg-rr71.6%
if 4.70000000000000003e162 < x Initial program 75.6%
Simplified74.1%
Taylor expanded in z around inf 44.8%
mul-1-neg44.8%
distribute-frac-neg244.8%
associate-/l*70.6%
Simplified70.6%
distribute-frac-neg270.6%
distribute-rgt-neg-in70.6%
clear-num70.4%
div-inv70.3%
distribute-neg-frac70.3%
Applied egg-rr70.3%
add-sqr-sqrt0.0%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod70.1%
add-sqr-sqrt70.3%
associate-/r/81.5%
Applied egg-rr81.5%
Final simplification73.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -10.5)
t_0
(if (<= x 4.8e-31)
(fabs (/ 4.0 y_m))
(if (<= x 1.6e+57)
(fabs (/ x (/ y_m z)))
(if (<= x 1.1e+166) t_0 (fabs (/ z (/ y_m x)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 4.8e-31) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.6e+57) {
tmp = fabs((x / (y_m / z)));
} else if (x <= 1.1e+166) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-10.5d0)) then
tmp = t_0
else if (x <= 4.8d-31) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.6d+57) then
tmp = abs((x / (y_m / z)))
else if (x <= 1.1d+166) then
tmp = t_0
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 t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 4.8e-31) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.6e+57) {
tmp = Math.abs((x / (y_m / z)));
} else if (x <= 1.1e+166) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -10.5: tmp = t_0 elif x <= 4.8e-31: tmp = math.fabs((4.0 / y_m)) elif x <= 1.6e+57: tmp = math.fabs((x / (y_m / z))) elif x <= 1.1e+166: tmp = t_0 else: tmp = math.fabs((z / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -10.5) tmp = t_0; elseif (x <= 4.8e-31) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.6e+57) tmp = abs(Float64(x / Float64(y_m / z))); elseif (x <= 1.1e+166) tmp = t_0; 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) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -10.5) tmp = t_0; elseif (x <= 4.8e-31) tmp = abs((4.0 / y_m)); elseif (x <= 1.6e+57) tmp = abs((x / (y_m / z))); elseif (x <= 1.1e+166) tmp = t_0; else tmp = abs((z / (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[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.5], t$95$0, If[LessEqual[x, 4.8e-31], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.6e+57], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.1e+166], t$95$0, N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-31}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+57}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+166}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if x < -10.5 or 1.60000000000000015e57 < x < 1.1e166Initial program 91.7%
Simplified89.7%
Taylor expanded in z around 0 65.9%
+-commutative65.9%
rem-square-sqrt37.4%
fabs-sqr37.4%
rem-square-sqrt65.9%
fabs-neg65.9%
distribute-neg-frac65.9%
distribute-neg-in65.9%
metadata-eval65.9%
+-commutative65.9%
sub-neg65.9%
rem-square-sqrt28.2%
fabs-sqr28.2%
rem-square-sqrt65.9%
Simplified65.9%
Taylor expanded in x around inf 64.8%
associate-*r/64.8%
neg-mul-164.8%
Simplified64.8%
if -10.5 < x < 4.8e-31Initial program 94.5%
Simplified99.8%
Taylor expanded in x around 0 78.0%
if 4.8e-31 < x < 1.60000000000000015e57Initial program 91.9%
Simplified95.7%
Taylor expanded in z around inf 68.4%
associate-*r/68.4%
neg-mul-168.4%
distribute-lft-neg-in68.4%
*-commutative68.4%
associate-*r/68.6%
Simplified68.6%
*-commutative68.6%
associate-/r/71.6%
add-sqr-sqrt0.0%
sqrt-unprod71.6%
sqr-neg71.6%
sqrt-unprod71.3%
add-sqr-sqrt71.6%
Applied egg-rr71.6%
if 1.1e166 < x Initial program 75.6%
Simplified74.1%
Taylor expanded in z around inf 44.8%
associate-*r/44.8%
neg-mul-144.8%
distribute-lft-neg-in44.8%
*-commutative44.8%
associate-*r/81.5%
Simplified81.5%
*-commutative81.5%
associate-/r/70.3%
add-sqr-sqrt0.0%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-unprod70.1%
add-sqr-sqrt70.3%
associate-/r/81.5%
clear-num81.4%
associate-*l/81.6%
*-un-lft-identity81.6%
Applied egg-rr81.6%
Final simplification73.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -2200000.0) (not (<= z 3.35))) (fabs (* z (/ (- x (/ 4.0 z)) y_m))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((z <= -2200000.0) || !(z <= 3.35)) {
tmp = fabs((z * ((x - (4.0 / z)) / y_m)));
} else {
tmp = fabs(((-4.0 - 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 ((z <= (-2200000.0d0)) .or. (.not. (z <= 3.35d0))) then
tmp = abs((z * ((x - (4.0d0 / z)) / y_m)))
else
tmp = abs((((-4.0d0) - 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 ((z <= -2200000.0) || !(z <= 3.35)) {
tmp = Math.abs((z * ((x - (4.0 / z)) / y_m)));
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (z <= -2200000.0) or not (z <= 3.35): tmp = math.fabs((z * ((x - (4.0 / z)) / y_m))) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((z <= -2200000.0) || !(z <= 3.35)) tmp = abs(Float64(z * Float64(Float64(x - Float64(4.0 / z)) / y_m))); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((z <= -2200000.0) || ~((z <= 3.35))) tmp = abs((z * ((x - (4.0 / z)) / y_m))); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[z, -2200000.0], N[Not[LessEqual[z, 3.35]], $MachinePrecision]], N[Abs[N[(z * N[(N[(x - N[(4.0 / z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2200000 \lor \neg \left(z \leq 3.35\right):\\
\;\;\;\;\left|z \cdot \frac{x - \frac{4}{z}}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -2.2e6 or 3.35000000000000009 < z Initial program 90.3%
fabs-sub90.3%
associate-*l/81.8%
associate-*r/89.4%
fmm-def91.7%
distribute-neg-frac91.7%
+-commutative91.7%
distribute-neg-in91.7%
unsub-neg91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
mul-1-neg89.3%
mul-1-neg89.3%
associate-*r/89.3%
distribute-lft-in89.3%
metadata-eval89.3%
neg-mul-189.3%
sub-neg89.3%
associate-/r*87.8%
Simplified87.8%
Taylor expanded in y around 0 91.6%
mul-1-neg91.6%
unsub-neg91.6%
Simplified91.6%
Taylor expanded in x around 0 90.6%
if -2.2e6 < z < 3.35000000000000009Initial program 91.5%
Simplified99.8%
Taylor expanded in z around 0 99.7%
+-commutative99.7%
rem-square-sqrt51.7%
fabs-sqr51.7%
rem-square-sqrt99.7%
fabs-neg99.7%
distribute-neg-frac99.7%
distribute-neg-in99.7%
metadata-eval99.7%
+-commutative99.7%
sub-neg99.7%
rem-square-sqrt47.4%
fabs-sqr47.4%
rem-square-sqrt99.7%
Simplified99.7%
Final simplification95.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.6e+133) (not (<= x 2.25e+16))) (fabs (* (/ x y_m) (+ z -1.0))) (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 <= -1.6e+133) || !(x <= 2.25e+16)) {
tmp = fabs(((x / y_m) * (z + -1.0)));
} 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 <= (-1.6d+133)) .or. (.not. (x <= 2.25d+16))) then
tmp = abs(((x / y_m) * (z + (-1.0d0))))
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 <= -1.6e+133) || !(x <= 2.25e+16)) {
tmp = Math.abs(((x / y_m) * (z + -1.0)));
} 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 <= -1.6e+133) or not (x <= 2.25e+16): tmp = math.fabs(((x / y_m) * (z + -1.0))) 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 <= -1.6e+133) || !(x <= 2.25e+16)) tmp = abs(Float64(Float64(x / y_m) * Float64(z + -1.0))); 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 <= -1.6e+133) || ~((x <= 2.25e+16))) tmp = abs(((x / y_m) * (z + -1.0))); 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[Or[LessEqual[x, -1.6e+133], N[Not[LessEqual[x, 2.25e+16]], $MachinePrecision]], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(z + -1.0), $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 -1.6 \cdot 10^{+133} \lor \neg \left(x \leq 2.25 \cdot 10^{+16}\right):\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(z + -1\right)\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.59999999999999999e133 or 2.25e16 < x Initial program 83.3%
Simplified81.1%
Taylor expanded in x around inf 81.3%
mul-1-neg81.3%
*-commutative81.3%
associate-/l*99.9%
distribute-lft-neg-in99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
if -1.59999999999999999e133 < x < 2.25e16Initial program 95.5%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 8.2e+37) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (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 <= 8.2e+37) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x / (y_m / 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) :: tmp
if (y_m <= 8.2d+37) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (x / (y_m / z))))
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 <= 8.2e+37) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 8.2e+37: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.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 <= 8.2e+37) 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(x / Float64(y_m / z)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 8.2e+37) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 8.2e+37], 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[(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 8.2 \cdot 10^{+37}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 8.1999999999999996e37Initial program 90.1%
associate-*l/91.6%
sub-div96.1%
Applied egg-rr96.1%
if 8.1999999999999996e37 < y Initial program 93.5%
associate-*l/81.6%
associate-*r/99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification96.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -125000000.0) (fabs (/ x (/ y_m z))) (if (<= z 4.2e+27) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -125000000.0) {
tmp = fabs((x / (y_m / z)));
} else if (z <= 4.2e+27) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-125000000.0d0)) then
tmp = abs((x / (y_m / z)))
else if (z <= 4.2d+27) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -125000000.0) {
tmp = Math.abs((x / (y_m / z)));
} else if (z <= 4.2e+27) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -125000000.0: tmp = math.fabs((x / (y_m / z))) elif z <= 4.2e+27: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -125000000.0) tmp = abs(Float64(x / Float64(y_m / z))); elseif (z <= 4.2e+27) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(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 (z <= -125000000.0) tmp = abs((x / (y_m / z))); elseif (z <= 4.2e+27) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -125000000.0], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.2e+27], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -125000000:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+27}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -1.25e8Initial program 94.2%
Simplified90.8%
Taylor expanded in z around inf 66.4%
associate-*r/66.4%
neg-mul-166.4%
distribute-lft-neg-in66.4%
*-commutative66.4%
associate-*r/70.7%
Simplified70.7%
*-commutative70.7%
associate-/r/72.1%
add-sqr-sqrt34.0%
sqrt-unprod59.5%
sqr-neg59.5%
sqrt-unprod37.9%
add-sqr-sqrt72.1%
Applied egg-rr72.1%
if -1.25e8 < z < 4.19999999999999989e27Initial program 91.2%
Simplified99.8%
Taylor expanded in z around 0 99.0%
+-commutative99.0%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt99.0%
fabs-neg99.0%
distribute-neg-frac99.0%
distribute-neg-in99.0%
metadata-eval99.0%
+-commutative99.0%
sub-neg99.0%
rem-square-sqrt47.3%
fabs-sqr47.3%
rem-square-sqrt99.0%
Simplified99.0%
if 4.19999999999999989e27 < z Initial program 86.6%
Simplified78.2%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
distribute-frac-neg264.3%
associate-/l*80.1%
Simplified80.1%
distribute-frac-neg280.1%
distribute-rgt-neg-in80.1%
clear-num79.9%
div-inv80.1%
distribute-neg-frac80.1%
Applied egg-rr80.1%
add-sqr-sqrt37.5%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod42.0%
add-sqr-sqrt80.1%
associate-/r/80.6%
Applied egg-rr80.6%
Final simplification88.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -11500000.0) (fabs (* (/ x y_m) (+ z -1.0))) (if (<= z 7.2e+27) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -11500000.0) {
tmp = fabs(((x / y_m) * (z + -1.0)));
} else if (z <= 7.2e+27) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-11500000.0d0)) then
tmp = abs(((x / y_m) * (z + (-1.0d0))))
else if (z <= 7.2d+27) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -11500000.0) {
tmp = Math.abs(((x / y_m) * (z + -1.0)));
} else if (z <= 7.2e+27) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -11500000.0: tmp = math.fabs(((x / y_m) * (z + -1.0))) elif z <= 7.2e+27: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -11500000.0) tmp = abs(Float64(Float64(x / y_m) * Float64(z + -1.0))); elseif (z <= 7.2e+27) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(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 (z <= -11500000.0) tmp = abs(((x / y_m) * (z + -1.0))); elseif (z <= 7.2e+27) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -11500000.0], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 7.2e+27], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -11500000:\\
\;\;\;\;\left|\frac{x}{y\_m} \cdot \left(z + -1\right)\right|\\
\mathbf{elif}\;z \leq 7.2 \cdot 10^{+27}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -1.15e7Initial program 94.2%
Simplified90.8%
Taylor expanded in x around inf 67.9%
mul-1-neg67.9%
*-commutative67.9%
associate-/l*72.2%
distribute-lft-neg-in72.2%
neg-sub072.2%
associate-+l-72.2%
neg-sub072.2%
+-commutative72.2%
unsub-neg72.2%
Simplified72.2%
if -1.15e7 < z < 7.19999999999999966e27Initial program 91.2%
Simplified99.8%
Taylor expanded in z around 0 99.0%
+-commutative99.0%
rem-square-sqrt51.2%
fabs-sqr51.2%
rem-square-sqrt99.0%
fabs-neg99.0%
distribute-neg-frac99.0%
distribute-neg-in99.0%
metadata-eval99.0%
+-commutative99.0%
sub-neg99.0%
rem-square-sqrt47.3%
fabs-sqr47.3%
rem-square-sqrt99.0%
Simplified99.0%
if 7.19999999999999966e27 < z Initial program 86.6%
Simplified78.2%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
distribute-frac-neg264.3%
associate-/l*80.1%
Simplified80.1%
distribute-frac-neg280.1%
distribute-rgt-neg-in80.1%
clear-num79.9%
div-inv80.1%
distribute-neg-frac80.1%
Applied egg-rr80.1%
add-sqr-sqrt37.5%
sqrt-unprod52.6%
sqr-neg52.6%
sqrt-unprod42.0%
add-sqr-sqrt80.1%
associate-/r/80.6%
Applied egg-rr80.6%
Final simplification88.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -10.5) (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 <= -10.5) || !(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 <= (-10.5d0)) .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 <= -10.5) || !(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 <= -10.5) 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 <= -10.5) || !(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 <= -10.5) || ~((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, -10.5], 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 -10.5 \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 < -10.5 or 4 < x Initial program 88.1%
Simplified86.5%
Taylor expanded in z around 0 59.7%
+-commutative59.7%
rem-square-sqrt34.9%
fabs-sqr34.9%
rem-square-sqrt59.7%
fabs-neg59.7%
distribute-neg-frac59.7%
distribute-neg-in59.7%
metadata-eval59.7%
+-commutative59.7%
sub-neg59.7%
rem-square-sqrt24.6%
fabs-sqr24.6%
rem-square-sqrt59.7%
Simplified59.7%
Taylor expanded in x around inf 58.1%
associate-*r/58.1%
neg-mul-158.1%
Simplified58.1%
if -10.5 < x < 4Initial program 94.0%
Simplified99.8%
Taylor expanded in x around 0 75.3%
Final simplification66.2%
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 90.9%
Simplified92.7%
Taylor expanded in x around 0 38.1%
Final simplification38.1%
herbie shell --seed 2024130
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))