
(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 13 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 8e+80) (fabs (/ (- (+ 4.0 x) (* 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 <= 8e+80) {
tmp = fabs((((4.0 + x) - (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 <= 8e+80) tmp = abs(Float64(Float64(Float64(4.0 + x) - 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, 8e+80], N[Abs[N[(N[(N[(4.0 + x), $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 8 \cdot 10^{+80}:\\
\;\;\;\;\left|\frac{\left(4 + x\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 < 8e80Initial program 92.3%
Taylor expanded in y around 0 98.1%
if 8e80 < y Initial program 96.3%
Simplified99.9%
Final simplification98.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* x (/ z y_m)))))
(if (<= x -1.85e+99)
t_0
(if (<= x -4.8e-24)
t_1
(if (<= x 1.86e-16) (fabs (/ 4.0 y_m)) (if (<= x 1.7e+164) 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((x * (z / y_m)));
double tmp;
if (x <= -1.85e+99) {
tmp = t_0;
} else if (x <= -4.8e-24) {
tmp = t_1;
} else if (x <= 1.86e-16) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.7e+164) {
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((x * (z / y_m)))
if (x <= (-1.85d+99)) then
tmp = t_0
else if (x <= (-4.8d-24)) then
tmp = t_1
else if (x <= 1.86d-16) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.7d+164) 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((x * (z / y_m)));
double tmp;
if (x <= -1.85e+99) {
tmp = t_0;
} else if (x <= -4.8e-24) {
tmp = t_1;
} else if (x <= 1.86e-16) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.7e+164) {
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((x * (z / y_m))) tmp = 0 if x <= -1.85e+99: tmp = t_0 elif x <= -4.8e-24: tmp = t_1 elif x <= 1.86e-16: tmp = math.fabs((4.0 / y_m)) elif x <= 1.7e+164: 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(x * Float64(z / y_m))) tmp = 0.0 if (x <= -1.85e+99) tmp = t_0; elseif (x <= -4.8e-24) tmp = t_1; elseif (x <= 1.86e-16) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.7e+164) 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((x * (z / y_m))); tmp = 0.0; if (x <= -1.85e+99) tmp = t_0; elseif (x <= -4.8e-24) tmp = t_1; elseif (x <= 1.86e-16) tmp = abs((4.0 / y_m)); elseif (x <= 1.7e+164) 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[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.85e+99], t$95$0, If[LessEqual[x, -4.8e-24], t$95$1, If[LessEqual[x, 1.86e-16], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.7e+164], 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|x \cdot \frac{z}{y_m}\right|\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.86 \cdot 10^{-16}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+164}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.85000000000000005e99 or 1.7000000000000001e164 < x Initial program 82.7%
Taylor expanded in y around 0 98.5%
Taylor expanded in x around inf 98.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.4%
if -1.85000000000000005e99 < x < -4.7999999999999996e-24 or 1.8599999999999999e-16 < x < 1.7000000000000001e164Initial program 97.0%
Simplified96.8%
Taylor expanded in x around inf 94.6%
Taylor expanded in z around inf 64.3%
if -4.7999999999999996e-24 < x < 1.8599999999999999e-16Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification75.4%
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 -4.2e+99)
t_0
(if (<= x -1.06e-89)
t_1
(if (<= x 3.8e-12) (fabs (/ 4.0 y_m)) (if (<= x 1e+164) 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 <= -4.2e+99) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = t_1;
} else if (x <= 3.8e-12) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1e+164) {
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 <= (-4.2d+99)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = t_1
else if (x <= 3.8d-12) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1d+164) 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 <= -4.2e+99) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = t_1;
} else if (x <= 3.8e-12) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1e+164) {
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 <= -4.2e+99: tmp = t_0 elif x <= -1.06e-89: tmp = t_1 elif x <= 3.8e-12: tmp = math.fabs((4.0 / y_m)) elif x <= 1e+164: 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 <= -4.2e+99) tmp = t_0; elseif (x <= -1.06e-89) tmp = t_1; elseif (x <= 3.8e-12) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1e+164) 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 <= -4.2e+99) tmp = t_0; elseif (x <= -1.06e-89) tmp = t_1; elseif (x <= 3.8e-12) tmp = abs((4.0 / y_m)); elseif (x <= 1e+164) 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, -4.2e+99], t$95$0, If[LessEqual[x, -1.06e-89], t$95$1, If[LessEqual[x, 3.8e-12], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1e+164], 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 -4.2 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 10^{+164}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -4.2000000000000002e99 or 1e164 < x Initial program 82.7%
Taylor expanded in y around 0 98.5%
Taylor expanded in x around inf 98.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.4%
if -4.2000000000000002e99 < x < -1.0600000000000001e-89 or 3.79999999999999996e-12 < x < 1e164Initial program 97.4%
Simplified93.9%
Taylor expanded in x around inf 84.4%
Taylor expanded in z around inf 54.1%
associate-/l*58.8%
associate-/r/62.2%
Simplified62.2%
if -1.0600000000000001e-89 < x < 3.79999999999999996e-12Initial program 96.5%
Taylor expanded in x around 0 84.0%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -5.4e+103)
t_0
(if (<= x -1.06e-89)
(fabs (* z (/ x y_m)))
(if (<= x 4.3e-13)
(fabs (/ 4.0 y_m))
(if (<= x 3.4e+164) (fabs (/ x (/ y_m z))) 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 <= -5.4e+103) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 4.3e-13) {
tmp = fabs((4.0 / y_m));
} else if (x <= 3.4e+164) {
tmp = fabs((x / (y_m / z)));
} 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 <= (-5.4d+103)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = abs((z * (x / y_m)))
else if (x <= 4.3d-13) then
tmp = abs((4.0d0 / y_m))
else if (x <= 3.4d+164) then
tmp = abs((x / (y_m / z)))
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 <= -5.4e+103) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 4.3e-13) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 3.4e+164) {
tmp = Math.abs((x / (y_m / z)));
} 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 <= -5.4e+103: tmp = t_0 elif x <= -1.06e-89: tmp = math.fabs((z * (x / y_m))) elif x <= 4.3e-13: tmp = math.fabs((4.0 / y_m)) elif x <= 3.4e+164: tmp = math.fabs((x / (y_m / z))) 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 <= -5.4e+103) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 4.3e-13) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 3.4e+164) tmp = abs(Float64(x / Float64(y_m / z))); 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 <= -5.4e+103) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs((z * (x / y_m))); elseif (x <= 4.3e-13) tmp = abs((4.0 / y_m)); elseif (x <= 3.4e+164) tmp = abs((x / (y_m / z))); 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, -5.4e+103], t$95$0, If[LessEqual[x, -1.06e-89], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.3e-13], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.4e+164], N[Abs[N[(x / N[(y$95$m / z), $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 -5.4 \cdot 10^{+103}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-13}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+164}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -5.39999999999999985e103 or 3.4000000000000001e164 < x Initial program 82.7%
Taylor expanded in y around 0 98.5%
Taylor expanded in x around inf 98.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.4%
if -5.39999999999999985e103 < x < -1.0600000000000001e-89Initial program 95.7%
Simplified89.8%
Taylor expanded in x around inf 75.8%
Taylor expanded in z around inf 58.9%
associate-/l*58.9%
associate-/r/64.7%
Simplified64.7%
if -1.0600000000000001e-89 < x < 4.2999999999999999e-13Initial program 96.5%
Taylor expanded in x around 0 84.0%
if 4.2999999999999999e-13 < x < 3.4000000000000001e164Initial program 99.9%
Taylor expanded in z around inf 47.4%
mul-1-neg47.4%
associate-*l/58.6%
distribute-rgt-neg-out58.6%
Simplified58.6%
associate-*l/47.4%
add-cube-cbrt46.8%
times-frac57.7%
add-sqr-sqrt30.1%
sqrt-unprod41.2%
sqr-neg41.2%
sqrt-unprod27.5%
add-sqr-sqrt57.7%
times-frac46.8%
add-cube-cbrt47.4%
clear-num47.3%
associate-/l/58.6%
clear-num58.7%
Applied egg-rr58.7%
Final simplification75.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -2.35e+101)
t_0
(if (<= x -1.06e-89)
(fabs (/ z (/ y_m x)))
(if (<= x 3.3e-12)
(fabs (/ 4.0 y_m))
(if (<= x 1.75e+164) (fabs (/ x (/ y_m z))) 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.35e+101) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = fabs((z / (y_m / x)));
} else if (x <= 3.3e-12) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.75e+164) {
tmp = fabs((x / (y_m / z)));
} 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.35d+101)) then
tmp = t_0
else if (x <= (-1.06d-89)) then
tmp = abs((z / (y_m / x)))
else if (x <= 3.3d-12) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.75d+164) then
tmp = abs((x / (y_m / z)))
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.35e+101) {
tmp = t_0;
} else if (x <= -1.06e-89) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= 3.3e-12) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.75e+164) {
tmp = Math.abs((x / (y_m / z)));
} 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.35e+101: tmp = t_0 elif x <= -1.06e-89: tmp = math.fabs((z / (y_m / x))) elif x <= 3.3e-12: tmp = math.fabs((4.0 / y_m)) elif x <= 1.75e+164: tmp = math.fabs((x / (y_m / z))) 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.35e+101) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= 3.3e-12) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.75e+164) tmp = abs(Float64(x / Float64(y_m / z))); 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.35e+101) tmp = t_0; elseif (x <= -1.06e-89) tmp = abs((z / (y_m / x))); elseif (x <= 3.3e-12) tmp = abs((4.0 / y_m)); elseif (x <= 1.75e+164) tmp = abs((x / (y_m / z))); 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.35e+101], t$95$0, If[LessEqual[x, -1.06e-89], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.3e-12], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.75e+164], N[Abs[N[(x / N[(y$95$m / z), $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 -2.35 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-89}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-12}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+164}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.34999999999999985e101 or 1.7499999999999999e164 < x Initial program 82.7%
Taylor expanded in y around 0 98.5%
Taylor expanded in x around inf 98.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 78.4%
if -2.34999999999999985e101 < x < -1.0600000000000001e-89Initial program 95.7%
Taylor expanded in z around inf 58.9%
mul-1-neg58.9%
associate-*l/64.7%
distribute-rgt-neg-out64.7%
Simplified64.7%
*-commutative64.7%
clear-num64.7%
un-div-inv64.7%
add-sqr-sqrt32.2%
sqrt-unprod45.0%
sqr-neg45.0%
sqrt-unprod32.3%
add-sqr-sqrt64.7%
Applied egg-rr64.7%
if -1.0600000000000001e-89 < x < 3.3000000000000001e-12Initial program 96.5%
Taylor expanded in x around 0 84.0%
if 3.3000000000000001e-12 < x < 1.7499999999999999e164Initial program 99.9%
Taylor expanded in z around inf 47.4%
mul-1-neg47.4%
associate-*l/58.6%
distribute-rgt-neg-out58.6%
Simplified58.6%
associate-*l/47.4%
add-cube-cbrt46.8%
times-frac57.7%
add-sqr-sqrt30.1%
sqrt-unprod41.2%
sqr-neg41.2%
sqrt-unprod27.5%
add-sqr-sqrt57.7%
times-frac46.8%
add-cube-cbrt47.4%
clear-num47.3%
associate-/l/58.6%
clear-num58.7%
Applied egg-rr58.7%
Final simplification75.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 8.2e+146) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (- (/ (+ 4.0 x) y_m) (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 8.2e+146) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs((((4.0 + x) / 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 <= 8.2d+146) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs((((4.0d0 + x) / 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 <= 8.2e+146) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs((((4.0 + x) / y_m) - (z * (x / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 8.2e+146: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs((((4.0 + x) / y_m) - (z * (x / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 8.2e+146) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(4.0 + x) / 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 <= 8.2e+146) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs((((4.0 + x) / 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, 8.2e+146], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $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 8.2 \cdot 10^{+146}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y_m} - z \cdot \frac{x}{y_m}\right|\\
\end{array}
\end{array}
if y < 8.2000000000000007e146Initial program 92.3%
Taylor expanded in y around 0 98.2%
if 8.2000000000000007e146 < y Initial program 97.4%
Final simplification98.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 2.5e+81) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (- (/ (+ 4.0 x) y_m) (* x (/ z y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 2.5e+81) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs((((4.0 + x) / y_m) - (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 (y_m <= 2.5d+81) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs((((4.0d0 + x) / y_m) - (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 (y_m <= 2.5e+81) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs((((4.0 + x) / y_m) - (x * (z / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 2.5e+81: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs((((4.0 + x) / y_m) - (x * (z / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 2.5e+81) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(4.0 + x) / y_m) - Float64(x * Float64(z / y_m)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 2.5e+81) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs((((4.0 + x) / y_m) - (x * (z / y_m)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 2.5e+81], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 2.5 \cdot 10^{+81}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y_m} - x \cdot \frac{z}{y_m}\right|\\
\end{array}
\end{array}
if y < 2.4999999999999999e81Initial program 92.3%
Taylor expanded in y around 0 98.1%
if 2.4999999999999999e81 < y Initial program 96.3%
Simplified92.1%
associate-*r/99.8%
*-commutative99.8%
Applied egg-rr99.8%
Final simplification98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -2.85e-24) (not (<= x 3.5e-12))) (fabs (* x (/ (+ z -1.0) y_m))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -2.85e-24) || !(x <= 3.5e-12)) {
tmp = fabs((x * ((z + -1.0) / 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 <= (-2.85d-24)) .or. (.not. (x <= 3.5d-12))) then
tmp = abs((x * ((z + (-1.0d0)) / 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 <= -2.85e-24) || !(x <= 3.5e-12)) {
tmp = Math.abs((x * ((z + -1.0) / 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 <= -2.85e-24) or not (x <= 3.5e-12): tmp = math.fabs((x * ((z + -1.0) / 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 <= -2.85e-24) || !(x <= 3.5e-12)) tmp = abs(Float64(x * Float64(Float64(z + -1.0) / 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 <= -2.85e-24) || ~((x <= 3.5e-12))) tmp = abs((x * ((z + -1.0) / 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, -2.85e-24], N[Not[LessEqual[x, 3.5e-12]], $MachinePrecision]], N[Abs[N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $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 -2.85 \cdot 10^{-24} \lor \neg \left(x \leq 3.5 \cdot 10^{-12}\right):\\
\;\;\;\;\left|x \cdot \frac{z + -1}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -2.85000000000000001e-24 or 3.5e-12 < x Initial program 89.8%
Simplified95.5%
Taylor expanded in x around inf 97.1%
Taylor expanded in y around 0 97.1%
if -2.85000000000000001e-24 < x < 3.5e-12Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification89.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -3.6e-24) (not (<= x 3.1e-14))) (fabs (/ x (/ y_m (- 1.0 z)))) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -3.6e-24) || !(x <= 3.1e-14)) {
tmp = fabs((x / (y_m / (1.0 - z))));
} 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 <= (-3.6d-24)) .or. (.not. (x <= 3.1d-14))) then
tmp = abs((x / (y_m / (1.0d0 - z))))
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 <= -3.6e-24) || !(x <= 3.1e-14)) {
tmp = Math.abs((x / (y_m / (1.0 - z))));
} 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 <= -3.6e-24) or not (x <= 3.1e-14): tmp = math.fabs((x / (y_m / (1.0 - z)))) 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 <= -3.6e-24) || !(x <= 3.1e-14)) tmp = abs(Float64(x / Float64(y_m / Float64(1.0 - z)))); 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 <= -3.6e-24) || ~((x <= 3.1e-14))) tmp = abs((x / (y_m / (1.0 - z)))); 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, -3.6e-24], N[Not[LessEqual[x, 3.1e-14]], $MachinePrecision]], N[Abs[N[(x / N[(y$95$m / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $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 -3.6 \cdot 10^{-24} \lor \neg \left(x \leq 3.1 \cdot 10^{-14}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{1 - z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\end{array}
\end{array}
if x < -3.6000000000000001e-24 or 3.10000000000000004e-14 < x Initial program 89.8%
Taylor expanded in y around 0 94.4%
Taylor expanded in x around inf 91.9%
associate-/l*97.4%
Simplified97.4%
if -3.6000000000000001e-24 < x < 3.10000000000000004e-14Initial program 96.8%
Taylor expanded in x around 0 80.2%
Final simplification89.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -2e+17) (fabs (* z (/ x y_m))) (if (<= z 2.5e+33) (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 <= -2e+17) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 2.5e+33) {
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 <= (-2d+17)) then
tmp = abs((z * (x / y_m)))
else if (z <= 2.5d+33) 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 <= -2e+17) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 2.5e+33) {
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 <= -2e+17: tmp = math.fabs((z * (x / y_m))) elif z <= 2.5e+33: 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 <= -2e+17) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 2.5e+33) 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 <= -2e+17) tmp = abs((z * (x / y_m))); elseif (z <= 2.5e+33) 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, -2e+17], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.5e+33], 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 -2 \cdot 10^{+17}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+33}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if z < -2e17Initial program 98.2%
Simplified94.6%
Taylor expanded in x around inf 79.1%
Taylor expanded in z around inf 73.8%
associate-/l*79.2%
associate-/r/80.9%
Simplified80.9%
if -2e17 < z < 2.49999999999999986e33Initial program 95.9%
Simplified100.0%
Taylor expanded in z around 0 94.6%
associate-*r/94.6%
distribute-lft-in94.6%
metadata-eval94.6%
neg-mul-194.6%
sub-neg94.6%
Simplified94.6%
if 2.49999999999999986e33 < z Initial program 80.3%
Taylor expanded in z around inf 71.1%
mul-1-neg71.1%
associate-*l/72.5%
distribute-rgt-neg-out72.5%
Simplified72.5%
*-commutative72.5%
clear-num72.4%
un-div-inv72.5%
add-sqr-sqrt0.0%
sqrt-unprod52.8%
sqr-neg52.8%
sqrt-unprod72.3%
add-sqr-sqrt72.5%
Applied egg-rr72.5%
Final simplification87.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ (- (+ 4.0 x) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((((4.0 + x) - (x * z)) / 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 + x) - (x * z)) / 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 + x) - (x * z)) / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((((4.0 + x) - (x * z)) / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((((4.0 + x) - (x * z)) / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|
\end{array}
Initial program 93.0%
Taylor expanded in y around 0 96.9%
Final simplification96.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.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 <= -1.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 <= (-1.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 <= -1.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 <= -1.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 <= -1.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 <= -1.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, -1.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 -1.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 < -1.5 or 4 < x Initial program 89.2%
Taylor expanded in y around 0 94.1%
Taylor expanded in x around inf 93.5%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in z around 0 63.2%
if -1.5 < x < 4Initial program 97.0%
Taylor expanded in x around 0 76.6%
Final simplification69.7%
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 93.0%
Taylor expanded in x around 0 40.0%
Final simplification40.0%
herbie shell --seed 2023336
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))