
(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}
(FPCore (x y z) :precision binary64 (if (<= x 5.5e+16) (fabs (/ (- x (fma x z -4.0)) y)) (fabs (* (+ z -1.0) (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5.5e+16) {
tmp = fabs(((x - fma(x, z, -4.0)) / y));
} else {
tmp = fabs(((z + -1.0) * (x / y)));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (x <= 5.5e+16) tmp = abs(Float64(Float64(x - fma(x, z, -4.0)) / y)); else tmp = abs(Float64(Float64(z + -1.0) * Float64(x / y))); end return tmp end
code[x_, y_, z_] := If[LessEqual[x, 5.5e+16], N[Abs[N[(N[(x - N[(x * z + -4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z + -1.0), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.5 \cdot 10^{+16}:\\
\;\;\;\;\left|\frac{x - \mathsf{fma}\left(x, z, -4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(z + -1\right) \cdot \frac{x}{y}\right|\\
\end{array}
\end{array}
if x < 5.5e16Initial program 92.1%
fabs-neg92.1%
sub-neg92.1%
distribute-neg-in92.1%
sub-neg92.1%
distribute-neg-frac92.1%
associate-*l/95.2%
distribute-neg-frac95.2%
neg-mul-195.2%
associate-*l/95.2%
neg-mul-195.2%
associate-*l/95.2%
distribute-lft-out--98.9%
fabs-mul98.9%
fabs-sub98.9%
fabs-mul98.9%
associate-*l/98.9%
Simplified98.9%
if 5.5e16 < x Initial program 86.2%
Simplified89.7%
Taylor expanded in x around inf 89.8%
associate-/l*99.8%
div-inv99.7%
sub-neg99.7%
metadata-eval99.7%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y)))) (t_1 (fabs (/ x y))) (t_2 (fabs (/ 4.0 y))))
(if (<= x -10.5)
t_1
(if (<= x 6.5e-90)
t_2
(if (<= x 2.95e-37)
t_0
(if (<= x 4.0)
t_2
(if (<= x 1.95e+49)
t_1
(if (<= x 3e+81)
(fabs (* x (/ z y)))
(if (<= x 1.45e+162) t_1 t_0)))))))))
double code(double x, double y, double z) {
double t_0 = fabs((z * (x / y)));
double t_1 = fabs((x / y));
double t_2 = fabs((4.0 / y));
double tmp;
if (x <= -10.5) {
tmp = t_1;
} else if (x <= 6.5e-90) {
tmp = t_2;
} else if (x <= 2.95e-37) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = t_2;
} else if (x <= 1.95e+49) {
tmp = t_1;
} else if (x <= 3e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 1.45e+162) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = abs((z * (x / y)))
t_1 = abs((x / y))
t_2 = abs((4.0d0 / y))
if (x <= (-10.5d0)) then
tmp = t_1
else if (x <= 6.5d-90) then
tmp = t_2
else if (x <= 2.95d-37) then
tmp = t_0
else if (x <= 4.0d0) then
tmp = t_2
else if (x <= 1.95d+49) then
tmp = t_1
else if (x <= 3d+81) then
tmp = abs((x * (z / y)))
else if (x <= 1.45d+162) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((z * (x / y)));
double t_1 = Math.abs((x / y));
double t_2 = Math.abs((4.0 / y));
double tmp;
if (x <= -10.5) {
tmp = t_1;
} else if (x <= 6.5e-90) {
tmp = t_2;
} else if (x <= 2.95e-37) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = t_2;
} else if (x <= 1.95e+49) {
tmp = t_1;
} else if (x <= 3e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 1.45e+162) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((z * (x / y))) t_1 = math.fabs((x / y)) t_2 = math.fabs((4.0 / y)) tmp = 0 if x <= -10.5: tmp = t_1 elif x <= 6.5e-90: tmp = t_2 elif x <= 2.95e-37: tmp = t_0 elif x <= 4.0: tmp = t_2 elif x <= 1.95e+49: tmp = t_1 elif x <= 3e+81: tmp = math.fabs((x * (z / y))) elif x <= 1.45e+162: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(z * Float64(x / y))) t_1 = abs(Float64(x / y)) t_2 = abs(Float64(4.0 / y)) tmp = 0.0 if (x <= -10.5) tmp = t_1; elseif (x <= 6.5e-90) tmp = t_2; elseif (x <= 2.95e-37) tmp = t_0; elseif (x <= 4.0) tmp = t_2; elseif (x <= 1.95e+49) tmp = t_1; elseif (x <= 3e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 1.45e+162) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((z * (x / y))); t_1 = abs((x / y)); t_2 = abs((4.0 / y)); tmp = 0.0; if (x <= -10.5) tmp = t_1; elseif (x <= 6.5e-90) tmp = t_2; elseif (x <= 2.95e-37) tmp = t_0; elseif (x <= 4.0) tmp = t_2; elseif (x <= 1.95e+49) tmp = t_1; elseif (x <= 3e+81) tmp = abs((x * (z / y))); elseif (x <= 1.45e+162) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.5], t$95$1, If[LessEqual[x, 6.5e-90], t$95$2, If[LessEqual[x, 2.95e-37], t$95$0, If[LessEqual[x, 4.0], t$95$2, If[LessEqual[x, 1.95e+49], t$95$1, If[LessEqual[x, 3e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.45e+162], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y}\right|\\
t_1 := \left|\frac{x}{y}\right|\\
t_2 := \left|\frac{4}{y}\right|\\
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+162}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -10.5 or 4 < x < 1.95e49 or 2.99999999999999997e81 < x < 1.45000000000000003e162Initial program 84.1%
associate-*l/85.6%
sub-div96.6%
Applied egg-rr96.6%
Taylor expanded in x around inf 95.2%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in z around 0 71.5%
if -10.5 < x < 6.4999999999999996e-90 or 2.9499999999999998e-37 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.4999999999999996e-90 < x < 2.9499999999999998e-37 or 1.45000000000000003e162 < x Initial program 83.6%
Simplified84.4%
Taylor expanded in x around inf 84.2%
Taylor expanded in z around inf 61.4%
associate-*r/81.8%
Simplified81.8%
if 1.95e49 < x < 2.99999999999999997e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Final simplification78.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))) (t_1 (fabs (/ 4.0 y))))
(if (<= x -10.2)
t_0
(if (<= x 6.5e-90)
t_1
(if (<= x 2.85e-33)
(fabs (* z (/ x y)))
(if (<= x 4.0)
t_1
(if (<= x 1.7e+49)
t_0
(if (<= x 2.05e+81)
(fabs (* x (/ z y)))
(if (<= x 7.2e+155) t_0 (fabs (/ z (/ y x))))))))))))
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double t_1 = fabs((4.0 / y));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 6.5e-90) {
tmp = t_1;
} else if (x <= 2.85e-33) {
tmp = fabs((z * (x / y)));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 1.7e+49) {
tmp = t_0;
} else if (x <= 2.05e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 7.2e+155) {
tmp = t_0;
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y))
t_1 = abs((4.0d0 / y))
if (x <= (-10.2d0)) then
tmp = t_0
else if (x <= 6.5d-90) then
tmp = t_1
else if (x <= 2.85d-33) then
tmp = abs((z * (x / y)))
else if (x <= 4.0d0) then
tmp = t_1
else if (x <= 1.7d+49) then
tmp = t_0
else if (x <= 2.05d+81) then
tmp = abs((x * (z / y)))
else if (x <= 7.2d+155) then
tmp = t_0
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x / y));
double t_1 = Math.abs((4.0 / y));
double tmp;
if (x <= -10.2) {
tmp = t_0;
} else if (x <= 6.5e-90) {
tmp = t_1;
} else if (x <= 2.85e-33) {
tmp = Math.abs((z * (x / y)));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 1.7e+49) {
tmp = t_0;
} else if (x <= 2.05e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 7.2e+155) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x / y)) t_1 = math.fabs((4.0 / y)) tmp = 0 if x <= -10.2: tmp = t_0 elif x <= 6.5e-90: tmp = t_1 elif x <= 2.85e-33: tmp = math.fabs((z * (x / y))) elif x <= 4.0: tmp = t_1 elif x <= 1.7e+49: tmp = t_0 elif x <= 2.05e+81: tmp = math.fabs((x * (z / y))) elif x <= 7.2e+155: tmp = t_0 else: tmp = math.fabs((z / (y / x))) return tmp
function code(x, y, z) t_0 = abs(Float64(x / y)) t_1 = abs(Float64(4.0 / y)) tmp = 0.0 if (x <= -10.2) tmp = t_0; elseif (x <= 6.5e-90) tmp = t_1; elseif (x <= 2.85e-33) tmp = abs(Float64(z * Float64(x / y))); elseif (x <= 4.0) tmp = t_1; elseif (x <= 1.7e+49) tmp = t_0; elseif (x <= 2.05e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 7.2e+155) tmp = t_0; else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((x / y)); t_1 = abs((4.0 / y)); tmp = 0.0; if (x <= -10.2) tmp = t_0; elseif (x <= 6.5e-90) tmp = t_1; elseif (x <= 2.85e-33) tmp = abs((z * (x / y))); elseif (x <= 4.0) tmp = t_1; elseif (x <= 1.7e+49) tmp = t_0; elseif (x <= 2.05e+81) tmp = abs((x * (z / y))); elseif (x <= 7.2e+155) tmp = t_0; else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.2], t$95$0, If[LessEqual[x, 6.5e-90], t$95$1, If[LessEqual[x, 2.85e-33], N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.0], t$95$1, If[LessEqual[x, 1.7e+49], t$95$0, If[LessEqual[x, 2.05e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 7.2e+155], t$95$0, N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|\frac{4}{y}\right|\\
\mathbf{if}\;x \leq -10.2:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{-33}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+49}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+155}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if x < -10.199999999999999 or 4 < x < 1.7e49 or 2.05000000000000006e81 < x < 7.20000000000000015e155Initial program 83.5%
associate-*l/86.3%
sub-div97.6%
Applied egg-rr97.6%
Taylor expanded in x around inf 96.2%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 71.7%
if -10.199999999999999 < x < 6.4999999999999996e-90 or 2.85000000000000013e-33 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.4999999999999996e-90 < x < 2.85000000000000013e-33Initial program 99.4%
Simplified99.4%
Taylor expanded in x around inf 97.3%
Taylor expanded in z around inf 97.3%
associate-*r/97.0%
Simplified97.0%
if 1.7e49 < x < 2.05000000000000006e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
if 7.20000000000000015e155 < x Initial program 82.7%
Simplified80.8%
associate-*l/81.0%
associate-/l*80.8%
fma-udef80.8%
associate-+r-80.8%
fma-udef80.8%
Applied egg-rr80.8%
Taylor expanded in z around inf 51.4%
associate-/l*78.5%
Simplified78.5%
Final simplification78.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))) (t_1 (fabs (/ 4.0 y))))
(if (<= x -10.5)
t_0
(if (<= x 6.5e-90)
t_1
(if (<= x 1.6e-26)
(fabs (/ (* x z) y))
(if (<= x 4.0)
t_1
(if (<= x 1.75e+48)
t_0
(if (<= x 2.05e+81)
(fabs (* x (/ z y)))
(if (<= x 1.75e+155) t_0 (fabs (/ z (/ y x))))))))))))
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double t_1 = fabs((4.0 / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 6.5e-90) {
tmp = t_1;
} else if (x <= 1.6e-26) {
tmp = fabs(((x * z) / y));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 1.75e+48) {
tmp = t_0;
} else if (x <= 2.05e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 1.75e+155) {
tmp = t_0;
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y))
t_1 = abs((4.0d0 / y))
if (x <= (-10.5d0)) then
tmp = t_0
else if (x <= 6.5d-90) then
tmp = t_1
else if (x <= 1.6d-26) then
tmp = abs(((x * z) / y))
else if (x <= 4.0d0) then
tmp = t_1
else if (x <= 1.75d+48) then
tmp = t_0
else if (x <= 2.05d+81) then
tmp = abs((x * (z / y)))
else if (x <= 1.75d+155) then
tmp = t_0
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x / y));
double t_1 = Math.abs((4.0 / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 6.5e-90) {
tmp = t_1;
} else if (x <= 1.6e-26) {
tmp = Math.abs(((x * z) / y));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 1.75e+48) {
tmp = t_0;
} else if (x <= 2.05e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 1.75e+155) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x / y)) t_1 = math.fabs((4.0 / y)) tmp = 0 if x <= -10.5: tmp = t_0 elif x <= 6.5e-90: tmp = t_1 elif x <= 1.6e-26: tmp = math.fabs(((x * z) / y)) elif x <= 4.0: tmp = t_1 elif x <= 1.75e+48: tmp = t_0 elif x <= 2.05e+81: tmp = math.fabs((x * (z / y))) elif x <= 1.75e+155: tmp = t_0 else: tmp = math.fabs((z / (y / x))) return tmp
function code(x, y, z) t_0 = abs(Float64(x / y)) t_1 = abs(Float64(4.0 / y)) tmp = 0.0 if (x <= -10.5) tmp = t_0; elseif (x <= 6.5e-90) tmp = t_1; elseif (x <= 1.6e-26) tmp = abs(Float64(Float64(x * z) / y)); elseif (x <= 4.0) tmp = t_1; elseif (x <= 1.75e+48) tmp = t_0; elseif (x <= 2.05e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 1.75e+155) tmp = t_0; else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((x / y)); t_1 = abs((4.0 / y)); tmp = 0.0; if (x <= -10.5) tmp = t_0; elseif (x <= 6.5e-90) tmp = t_1; elseif (x <= 1.6e-26) tmp = abs(((x * z) / y)); elseif (x <= 4.0) tmp = t_1; elseif (x <= 1.75e+48) tmp = t_0; elseif (x <= 2.05e+81) tmp = abs((x * (z / y))); elseif (x <= 1.75e+155) tmp = t_0; else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.5], t$95$0, If[LessEqual[x, 6.5e-90], t$95$1, If[LessEqual[x, 1.6e-26], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.0], t$95$1, If[LessEqual[x, 1.75e+48], t$95$0, If[LessEqual[x, 2.05e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.75e+155], t$95$0, N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|\frac{4}{y}\right|\\
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-26}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+48}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+155}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if x < -10.5 or 4 < x < 1.7499999999999999e48 or 2.05000000000000006e81 < x < 1.74999999999999992e155Initial program 83.5%
associate-*l/86.3%
sub-div97.6%
Applied egg-rr97.6%
Taylor expanded in x around inf 96.2%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 71.7%
if -10.5 < x < 6.4999999999999996e-90 or 1.6000000000000001e-26 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.4999999999999996e-90 < x < 1.6000000000000001e-26Initial program 99.4%
Simplified99.4%
Taylor expanded in z around inf 97.3%
if 1.7499999999999999e48 < x < 2.05000000000000006e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
if 1.74999999999999992e155 < x Initial program 82.7%
Simplified80.8%
associate-*l/81.0%
associate-/l*80.8%
fma-udef80.8%
associate-+r-80.8%
fma-udef80.8%
Applied egg-rr80.8%
Taylor expanded in z around inf 51.4%
associate-/l*78.5%
Simplified78.5%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.15e+24) (not (<= x 4.2))) (fabs (* (+ z -1.0) (/ x y))) (fabs (/ 1.0 (/ y (- (* x z) 4.0))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.15e+24) || !(x <= 4.2)) {
tmp = fabs(((z + -1.0) * (x / y)));
} else {
tmp = fabs((1.0 / (y / ((x * z) - 4.0))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.15d+24)) .or. (.not. (x <= 4.2d0))) then
tmp = abs(((z + (-1.0d0)) * (x / y)))
else
tmp = abs((1.0d0 / (y / ((x * z) - 4.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.15e+24) || !(x <= 4.2)) {
tmp = Math.abs(((z + -1.0) * (x / y)));
} else {
tmp = Math.abs((1.0 / (y / ((x * z) - 4.0))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.15e+24) or not (x <= 4.2): tmp = math.fabs(((z + -1.0) * (x / y))) else: tmp = math.fabs((1.0 / (y / ((x * z) - 4.0)))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.15e+24) || !(x <= 4.2)) tmp = abs(Float64(Float64(z + -1.0) * Float64(x / y))); else tmp = abs(Float64(1.0 / Float64(y / Float64(Float64(x * z) - 4.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.15e+24) || ~((x <= 4.2))) tmp = abs(((z + -1.0) * (x / y))); else tmp = abs((1.0 / (y / ((x * z) - 4.0)))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.15e+24], N[Not[LessEqual[x, 4.2]], $MachinePrecision]], N[Abs[N[(N[(z + -1.0), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(1.0 / N[(y / N[(N[(x * z), $MachinePrecision] - 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+24} \lor \neg \left(x \leq 4.2\right):\\
\;\;\;\;\left|\left(z + -1\right) \cdot \frac{x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{1}{\frac{y}{x \cdot z - 4}}\right|\\
\end{array}
\end{array}
if x < -1.15e24 or 4.20000000000000018 < x Initial program 83.5%
Simplified92.4%
Taylor expanded in x around inf 91.7%
associate-/l*98.8%
div-inv98.7%
sub-neg98.7%
metadata-eval98.7%
clear-num99.0%
Applied egg-rr99.0%
if -1.15e24 < x < 4.20000000000000018Initial program 96.5%
Simplified99.9%
associate-*l/99.9%
associate-/l*99.8%
fma-udef99.8%
associate-+r-99.8%
fma-udef99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in z around inf 98.3%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))))
(if (<= x -10.5)
t_0
(if (<= x 26000000.0)
(fabs (/ 4.0 y))
(if (<= x 2.9e+255) (fabs (* x (/ z y))) t_0)))))
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 26000000.0) {
tmp = fabs((4.0 / y));
} else if (x <= 2.9e+255) {
tmp = fabs((x * (z / y)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y))
if (x <= (-10.5d0)) then
tmp = t_0
else if (x <= 26000000.0d0) then
tmp = abs((4.0d0 / y))
else if (x <= 2.9d+255) then
tmp = abs((x * (z / y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = Math.abs((x / y));
double tmp;
if (x <= -10.5) {
tmp = t_0;
} else if (x <= 26000000.0) {
tmp = Math.abs((4.0 / y));
} else if (x <= 2.9e+255) {
tmp = Math.abs((x * (z / y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = math.fabs((x / y)) tmp = 0 if x <= -10.5: tmp = t_0 elif x <= 26000000.0: tmp = math.fabs((4.0 / y)) elif x <= 2.9e+255: tmp = math.fabs((x * (z / y))) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = abs(Float64(x / y)) tmp = 0.0 if (x <= -10.5) tmp = t_0; elseif (x <= 26000000.0) tmp = abs(Float64(4.0 / y)); elseif (x <= 2.9e+255) tmp = abs(Float64(x * Float64(z / y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = abs((x / y)); tmp = 0.0; if (x <= -10.5) tmp = t_0; elseif (x <= 26000000.0) tmp = abs((4.0 / y)); elseif (x <= 2.9e+255) tmp = abs((x * (z / y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -10.5], t$95$0, If[LessEqual[x, 26000000.0], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.9e+255], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
\mathbf{if}\;x \leq -10.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 26000000:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+255}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -10.5 or 2.9000000000000002e255 < x Initial program 78.8%
associate-*l/80.6%
sub-div95.8%
Applied egg-rr95.8%
Taylor expanded in x around inf 95.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in z around 0 77.1%
if -10.5 < x < 2.6e7Initial program 96.5%
Taylor expanded in x around 0 77.0%
if 2.6e7 < x < 2.9000000000000002e255Initial program 90.0%
Simplified88.6%
Taylor expanded in z around inf 52.0%
associate-*l/63.0%
*-commutative63.0%
Simplified63.0%
Final simplification74.2%
(FPCore (x y z) :precision binary64 (if (<= z -3.2e+127) (fabs (/ (* x z) y)) (if (<= z 2e+34) (fabs (+ (/ x y) (/ 4.0 y))) (fabs (/ z (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.2e+127) {
tmp = fabs(((x * z) / y));
} else if (z <= 2e+34) {
tmp = fabs(((x / y) + (4.0 / y)));
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.2d+127)) then
tmp = abs(((x * z) / y))
else if (z <= 2d+34) then
tmp = abs(((x / y) + (4.0d0 / y)))
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.2e+127) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 2e+34) {
tmp = Math.abs(((x / y) + (4.0 / y)));
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.2e+127: tmp = math.fabs(((x * z) / y)) elif z <= 2e+34: tmp = math.fabs(((x / y) + (4.0 / y))) else: tmp = math.fabs((z / (y / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.2e+127) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 2e+34) tmp = abs(Float64(Float64(x / y) + Float64(4.0 / y))); else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.2e+127) tmp = abs(((x * z) / y)); elseif (z <= 2e+34) tmp = abs(((x / y) + (4.0 / y))); else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.2e+127], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2e+34], N[Abs[N[(N[(x / y), $MachinePrecision] + N[(4.0 / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+127}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+34}:\\
\;\;\;\;\left|\frac{x}{y} + \frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -3.19999999999999976e127Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -3.19999999999999976e127 < z < 1.99999999999999989e34Initial program 94.3%
Taylor expanded in z around 0 95.0%
associate-*r/95.0%
metadata-eval95.0%
Simplified95.0%
if 1.99999999999999989e34 < z Initial program 77.5%
Simplified92.8%
associate-*l/92.8%
associate-/l*92.7%
fma-udef92.7%
associate-+r-92.7%
fma-udef92.7%
Applied egg-rr92.7%
Taylor expanded in z around inf 74.1%
associate-/l*79.1%
Simplified79.1%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(if (<= z -1.08e+129)
(fabs (/ (* x z) y))
(if (<= z 3.9e+20)
(fabs (+ (/ x y) (/ 4.0 y)))
(fabs (/ (+ z -1.0) (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.08e+129) {
tmp = fabs(((x * z) / y));
} else if (z <= 3.9e+20) {
tmp = fabs(((x / y) + (4.0 / y)));
} else {
tmp = fabs(((z + -1.0) / (y / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.08d+129)) then
tmp = abs(((x * z) / y))
else if (z <= 3.9d+20) then
tmp = abs(((x / y) + (4.0d0 / y)))
else
tmp = abs(((z + (-1.0d0)) / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.08e+129) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 3.9e+20) {
tmp = Math.abs(((x / y) + (4.0 / y)));
} else {
tmp = Math.abs(((z + -1.0) / (y / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.08e+129: tmp = math.fabs(((x * z) / y)) elif z <= 3.9e+20: tmp = math.fabs(((x / y) + (4.0 / y))) else: tmp = math.fabs(((z + -1.0) / (y / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.08e+129) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 3.9e+20) tmp = abs(Float64(Float64(x / y) + Float64(4.0 / y))); else tmp = abs(Float64(Float64(z + -1.0) / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.08e+129) tmp = abs(((x * z) / y)); elseif (z <= 3.9e+20) tmp = abs(((x / y) + (4.0 / y))); else tmp = abs(((z + -1.0) / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.08e+129], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3.9e+20], N[Abs[N[(N[(x / y), $MachinePrecision] + N[(4.0 / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z + -1.0), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+129}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+20}:\\
\;\;\;\;\left|\frac{x}{y} + \frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -1.08e129Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -1.08e129 < z < 3.9e20Initial program 94.3%
Taylor expanded in z around 0 95.0%
associate-*r/95.0%
metadata-eval95.0%
Simplified95.0%
if 3.9e20 < z Initial program 77.5%
Simplified92.8%
Taylor expanded in x around inf 74.1%
associate-/l*79.1%
sub-neg79.1%
metadata-eval79.1%
Simplified79.1%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (<= x 3.4e+16) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (* (+ z -1.0) (/ x y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= 3.4e+16) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(((z + -1.0) * (x / y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 3.4d+16) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs(((z + (-1.0d0)) * (x / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 3.4e+16) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((z + -1.0) * (x / y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 3.4e+16: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((z + -1.0) * (x / y))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 3.4e+16) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(z + -1.0) * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 3.4e+16) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((z + -1.0) * (x / y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 3.4e+16], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z + -1.0), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+16}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(z + -1\right) \cdot \frac{x}{y}\right|\\
\end{array}
\end{array}
if x < 3.4e16Initial program 92.1%
associate-*l/95.2%
sub-div98.9%
Applied egg-rr98.9%
if 3.4e16 < x Initial program 86.2%
Simplified89.7%
Taylor expanded in x around inf 89.8%
associate-/l*99.8%
div-inv99.7%
sub-neg99.7%
metadata-eval99.7%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.2%
(FPCore (x y z) :precision binary64 (if (<= z -3.2e+127) (fabs (/ (* x z) y)) (if (<= z 2.1e+24) (fabs (/ (- -4.0 x) y)) (fabs (/ z (/ y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -3.2e+127) {
tmp = fabs(((x * z) / y));
} else if (z <= 2.1e+24) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.2d+127)) then
tmp = abs(((x * z) / y))
else if (z <= 2.1d+24) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.2e+127) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 2.1e+24) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3.2e+127: tmp = math.fabs(((x * z) / y)) elif z <= 2.1e+24: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = math.fabs((z / (y / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3.2e+127) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 2.1e+24) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.2e+127) tmp = abs(((x * z) / y)); elseif (z <= 2.1e+24) tmp = abs(((-4.0 - x) / y)); else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3.2e+127], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.1e+24], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+127}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+24}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -3.19999999999999976e127Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -3.19999999999999976e127 < z < 2.1000000000000001e24Initial program 94.3%
Simplified98.1%
Taylor expanded in z around 0 94.9%
associate-*r/94.9%
distribute-lft-in94.9%
metadata-eval94.9%
neg-mul-194.9%
sub-neg94.9%
Simplified94.9%
if 2.1000000000000001e24 < z Initial program 77.5%
Simplified92.8%
associate-*l/92.8%
associate-/l*92.7%
fma-udef92.7%
associate-+r-92.7%
fma-udef92.7%
Applied egg-rr92.7%
Taylor expanded in z around inf 74.1%
associate-/l*79.1%
Simplified79.1%
Final simplification89.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -10.5) (not (<= x 4.0))) (fabs (/ x y)) (fabs (/ 4.0 y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -10.5) || !(x <= 4.0)) {
tmp = fabs((x / y));
} else {
tmp = fabs((4.0 / y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-10.5d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y))
else
tmp = abs((4.0d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -10.5) || !(x <= 4.0)) {
tmp = Math.abs((x / y));
} else {
tmp = Math.abs((4.0 / y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -10.5) or not (x <= 4.0): tmp = math.fabs((x / y)) else: tmp = math.fabs((4.0 / y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -10.5) || !(x <= 4.0)) tmp = abs(Float64(x / y)); else tmp = abs(Float64(4.0 / y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -10.5) || ~((x <= 4.0))) tmp = abs((x / y)); else tmp = abs((4.0 / y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -10.5], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.5 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\end{array}
\end{array}
if x < -10.5 or 4 < x Initial program 84.0%
associate-*l/81.9%
sub-div92.8%
Applied egg-rr92.8%
Taylor expanded in x around inf 91.9%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in z around 0 65.5%
if -10.5 < x < 4Initial program 96.4%
Taylor expanded in x around 0 77.9%
Final simplification72.2%
(FPCore (x y z) :precision binary64 (fabs (/ 4.0 y)))
double code(double x, double y, double z) {
return fabs((4.0 / y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((4.0d0 / y))
end function
public static double code(double x, double y, double z) {
return Math.abs((4.0 / y));
}
def code(x, y, z): return math.fabs((4.0 / y))
function code(x, y, z) return abs(Float64(4.0 / y)) end
function tmp = code(x, y, z) tmp = abs((4.0 / y)); end
code[x_, y_, z_] := N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{4}{y}\right|
\end{array}
Initial program 90.6%
Taylor expanded in x around 0 44.1%
Final simplification44.1%
herbie shell --seed 2023189
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))