
(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}
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 8e-82) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (fma x (/ z y) (/ (- -4.0 x) y)))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 8e-82) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(fma(x, (z / y), ((-4.0 - x) / y)));
}
return tmp;
}
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 8e-82) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(fma(x, Float64(z / y), Float64(Float64(-4.0 - x) / y))); end return tmp end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 8e-82], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{-82}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\end{array}
\end{array}
if y < 8e-82Initial program 88.5%
associate-*l/89.2%
sub-div96.7%
Applied egg-rr96.7%
if 8e-82 < y Initial program 95.1%
fabs-sub95.1%
associate-*l/96.5%
*-commutative96.5%
associate-*l/99.9%
*-commutative99.9%
fma-neg99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification97.7%
NOTE: y should be positive before calling this function
(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 3.25e-37)
t_0
(if (<= x 4.0)
t_2
(if (<= x 9.5e+48)
t_1
(if (<= x 9e+81)
(fabs (* x (/ z y)))
(if (<= x 1.5e+163) t_1 t_0)))))))))y = abs(y);
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 <= 3.25e-37) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = t_2;
} else if (x <= 9.5e+48) {
tmp = t_1;
} else if (x <= 9e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 1.5e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 3.25d-37) then
tmp = t_0
else if (x <= 4.0d0) then
tmp = t_2
else if (x <= 9.5d+48) then
tmp = t_1
else if (x <= 9d+81) then
tmp = abs((x * (z / y)))
else if (x <= 1.5d+163) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
y = Math.abs(y);
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 <= 3.25e-37) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = t_2;
} else if (x <= 9.5e+48) {
tmp = t_1;
} else if (x <= 9e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 1.5e+163) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y = abs(y) 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 <= 3.25e-37: tmp = t_0 elif x <= 4.0: tmp = t_2 elif x <= 9.5e+48: tmp = t_1 elif x <= 9e+81: tmp = math.fabs((x * (z / y))) elif x <= 1.5e+163: tmp = t_1 else: tmp = t_0 return tmp
y = abs(y) 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 <= 3.25e-37) tmp = t_0; elseif (x <= 4.0) tmp = t_2; elseif (x <= 9.5e+48) tmp = t_1; elseif (x <= 9e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 1.5e+163) tmp = t_1; else tmp = t_0; end return tmp end
y = abs(y) 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 <= 3.25e-37) tmp = t_0; elseif (x <= 4.0) tmp = t_2; elseif (x <= 9.5e+48) tmp = t_1; elseif (x <= 9e+81) tmp = abs((x * (z / y))); elseif (x <= 1.5e+163) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
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, 3.25e-37], t$95$0, If[LessEqual[x, 4.0], t$95$2, If[LessEqual[x, 9.5e+48], t$95$1, If[LessEqual[x, 9e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.5e+163], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}
y = |y|\\
\\
\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 3.25 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+48}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -10.5 or 4 < x < 9.4999999999999997e48 or 9.00000000000000034e81 < x < 1.50000000000000007e163Initial 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 3.2500000000000001e-37 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.4999999999999996e-90 < x < 3.2500000000000001e-37 or 1.50000000000000007e163 < 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 9.4999999999999997e48 < x < 9.00000000000000034e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
Final simplification78.2%
NOTE: y should be positive before calling this function
(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 4.2e-33)
(fabs (* z (/ x y)))
(if (<= x 4.0)
t_1
(if (<= x 5.3e+48)
t_0
(if (<= x 2.2e+81)
(fabs (* x (/ z y)))
(if (<= x 5.2e+155) t_0 (fabs (/ z (/ y x))))))))))))y = abs(y);
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 <= 4.2e-33) {
tmp = fabs((z * (x / y)));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 5.3e+48) {
tmp = t_0;
} else if (x <= 2.2e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 5.2e+155) {
tmp = t_0;
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 4.2d-33) then
tmp = abs((z * (x / y)))
else if (x <= 4.0d0) then
tmp = t_1
else if (x <= 5.3d+48) then
tmp = t_0
else if (x <= 2.2d+81) then
tmp = abs((x * (z / y)))
else if (x <= 5.2d+155) then
tmp = t_0
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
y = Math.abs(y);
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 <= 4.2e-33) {
tmp = Math.abs((z * (x / y)));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 5.3e+48) {
tmp = t_0;
} else if (x <= 2.2e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 5.2e+155) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
y = abs(y) 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 <= 4.2e-33: tmp = math.fabs((z * (x / y))) elif x <= 4.0: tmp = t_1 elif x <= 5.3e+48: tmp = t_0 elif x <= 2.2e+81: tmp = math.fabs((x * (z / y))) elif x <= 5.2e+155: tmp = t_0 else: tmp = math.fabs((z / (y / x))) return tmp
y = abs(y) 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 <= 4.2e-33) tmp = abs(Float64(z * Float64(x / y))); elseif (x <= 4.0) tmp = t_1; elseif (x <= 5.3e+48) tmp = t_0; elseif (x <= 2.2e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 5.2e+155) tmp = t_0; else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
y = abs(y) 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 <= 4.2e-33) tmp = abs((z * (x / y))); elseif (x <= 4.0) tmp = t_1; elseif (x <= 5.3e+48) tmp = t_0; elseif (x <= 2.2e+81) tmp = abs((x * (z / y))); elseif (x <= 5.2e+155) tmp = t_0; else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
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, 4.2e-33], N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.0], t$95$1, If[LessEqual[x, 5.3e+48], t$95$0, If[LessEqual[x, 2.2e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.2e+155], t$95$0, N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
y = |y|\\
\\
\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 4.2 \cdot 10^{-33}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{+48}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 5.2 \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 < 5.3e48 or 2.19999999999999987e81 < x < 5.2000000000000004e155Initial 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 4.2e-33 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.4999999999999996e-90 < x < 4.2e-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 5.3e48 < x < 2.19999999999999987e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
if 5.2000000000000004e155 < 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%
NOTE: y should be positive before calling this function
(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 6e-90)
t_1
(if (<= x 7.2e-30)
(fabs (/ (* x z) y))
(if (<= x 4.0)
t_1
(if (<= x 5.3e+48)
t_0
(if (<= x 2.2e+81)
(fabs (* x (/ z y)))
(if (<= x 1.32e+156) t_0 (fabs (/ z (/ y x))))))))))))y = abs(y);
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 <= 6e-90) {
tmp = t_1;
} else if (x <= 7.2e-30) {
tmp = fabs(((x * z) / y));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 5.3e+48) {
tmp = t_0;
} else if (x <= 2.2e+81) {
tmp = fabs((x * (z / y)));
} else if (x <= 1.32e+156) {
tmp = t_0;
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 6d-90) then
tmp = t_1
else if (x <= 7.2d-30) then
tmp = abs(((x * z) / y))
else if (x <= 4.0d0) then
tmp = t_1
else if (x <= 5.3d+48) then
tmp = t_0
else if (x <= 2.2d+81) then
tmp = abs((x * (z / y)))
else if (x <= 1.32d+156) then
tmp = t_0
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
y = Math.abs(y);
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 <= 6e-90) {
tmp = t_1;
} else if (x <= 7.2e-30) {
tmp = Math.abs(((x * z) / y));
} else if (x <= 4.0) {
tmp = t_1;
} else if (x <= 5.3e+48) {
tmp = t_0;
} else if (x <= 2.2e+81) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 1.32e+156) {
tmp = t_0;
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
y = abs(y) 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 <= 6e-90: tmp = t_1 elif x <= 7.2e-30: tmp = math.fabs(((x * z) / y)) elif x <= 4.0: tmp = t_1 elif x <= 5.3e+48: tmp = t_0 elif x <= 2.2e+81: tmp = math.fabs((x * (z / y))) elif x <= 1.32e+156: tmp = t_0 else: tmp = math.fabs((z / (y / x))) return tmp
y = abs(y) 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 <= 6e-90) tmp = t_1; elseif (x <= 7.2e-30) tmp = abs(Float64(Float64(x * z) / y)); elseif (x <= 4.0) tmp = t_1; elseif (x <= 5.3e+48) tmp = t_0; elseif (x <= 2.2e+81) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 1.32e+156) tmp = t_0; else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
y = abs(y) 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 <= 6e-90) tmp = t_1; elseif (x <= 7.2e-30) tmp = abs(((x * z) / y)); elseif (x <= 4.0) tmp = t_1; elseif (x <= 5.3e+48) tmp = t_0; elseif (x <= 2.2e+81) tmp = abs((x * (z / y))); elseif (x <= 1.32e+156) tmp = t_0; else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
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, 6e-90], t$95$1, If[LessEqual[x, 7.2e-30], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.0], t$95$1, If[LessEqual[x, 5.3e+48], t$95$0, If[LessEqual[x, 2.2e+81], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.32e+156], t$95$0, N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]]
\begin{array}{l}
y = |y|\\
\\
\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 \cdot 10^{-90}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-30}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 5.3 \cdot 10^{+48}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+81}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 1.32 \cdot 10^{+156}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if x < -10.5 or 4 < x < 5.3e48 or 2.19999999999999987e81 < x < 1.3199999999999999e156Initial 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.00000000000000041e-90 or 7.2000000000000006e-30 < x < 4Initial program 96.3%
Taylor expanded in x around 0 80.6%
if 6.00000000000000041e-90 < x < 7.2000000000000006e-30Initial program 99.4%
Simplified99.4%
Taylor expanded in z around inf 97.3%
if 5.3e48 < x < 2.19999999999999987e81Initial program 99.7%
Simplified100.0%
Taylor expanded in z around inf 99.4%
associate-*l/99.7%
*-commutative99.7%
Simplified99.7%
if 1.3199999999999999e156 < 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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -1.15e+24) (not (<= x 3.7))) (fabs (* (+ z -1.0) (/ x y))) (fabs (/ 1.0 (/ y (- (* x z) 4.0))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.15e+24) || !(x <= 3.7)) {
tmp = fabs(((z + -1.0) * (x / y)));
} else {
tmp = fabs((1.0 / (y / ((x * z) - 4.0))));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 3.7d0))) then
tmp = abs(((z + (-1.0d0)) * (x / y)))
else
tmp = abs((1.0d0 / (y / ((x * z) - 4.0d0))))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.15e+24) || !(x <= 3.7)) {
tmp = Math.abs(((z + -1.0) * (x / y)));
} else {
tmp = Math.abs((1.0 / (y / ((x * z) - 4.0))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (x <= -1.15e+24) or not (x <= 3.7): tmp = math.fabs(((z + -1.0) * (x / y))) else: tmp = math.fabs((1.0 / (y / ((x * z) - 4.0)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((x <= -1.15e+24) || !(x <= 3.7)) 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
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.15e+24) || ~((x <= 3.7))) tmp = abs(((z + -1.0) * (x / y))); else tmp = abs((1.0 / (y / ((x * z) - 4.0)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[x, -1.15e+24], N[Not[LessEqual[x, 3.7]], $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}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+24} \lor \neg \left(x \leq 3.7\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 3.7000000000000002 < 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 < 3.7000000000000002Initial 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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 20000000.0) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (- (/ (+ x 4.0) y) (/ x (/ y z))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 20000000.0) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs((((x + 4.0) / y) - (x / (y / z))));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 (y <= 20000000.0d0) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs((((x + 4.0d0) / y) - (x / (y / z))))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (y <= 20000000.0) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs((((x + 4.0) / y) - (x / (y / z))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if y <= 20000000.0: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs((((x + 4.0) / y) - (x / (y / z)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 20000000.0) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(x / Float64(y / z)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 20000000.0) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs((((x + 4.0) / y) - (x / (y / z)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 20000000.0], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 20000000:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y} - \frac{x}{\frac{y}{z}}\right|\\
\end{array}
\end{array}
if y < 2e7Initial program 89.2%
associate-*l/90.3%
sub-div97.0%
Applied egg-rr97.0%
if 2e7 < y Initial program 95.0%
associate-*l/95.3%
associate-/l*99.8%
Applied egg-rr99.8%
Final simplification97.7%
NOTE: y should be positive before calling this function
(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 5.6e+253) (fabs (* x (/ z y))) t_0)))))y = abs(y);
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 <= 5.6e+253) {
tmp = fabs((x * (z / y)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 5.6d+253) then
tmp = abs((x * (z / y)))
else
tmp = t_0
end if
code = tmp
end function
y = Math.abs(y);
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 <= 5.6e+253) {
tmp = Math.abs((x * (z / y)));
} else {
tmp = t_0;
}
return tmp;
}
y = abs(y) 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 <= 5.6e+253: tmp = math.fabs((x * (z / y))) else: tmp = t_0 return tmp
y = abs(y) 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 <= 5.6e+253) tmp = abs(Float64(x * Float64(z / y))); else tmp = t_0; end return tmp end
y = abs(y) 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 <= 5.6e+253) tmp = abs((x * (z / y))); else tmp = t_0; end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
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, 5.6e+253], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]
\begin{array}{l}
y = |y|\\
\\
\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 5.6 \cdot 10^{+253}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -10.5 or 5.5999999999999999e253 < 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 < 5.5999999999999999e253Initial program 90.0%
Simplified88.6%
Taylor expanded in z around inf 52.0%
associate-*l/63.0%
*-commutative63.0%
Simplified63.0%
Final simplification74.2%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= z -3.6e+127) (fabs (/ (* x z) y)) (if (<= z 1.9e+32) (fabs (+ (/ x y) (/ 4.0 y))) (fabs (/ z (/ y x))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+127) {
tmp = fabs(((x * z) / y));
} else if (z <= 1.9e+32) {
tmp = fabs(((x / y) + (4.0 / y)));
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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.6d+127)) then
tmp = abs(((x * z) / y))
else if (z <= 1.9d+32) then
tmp = abs(((x / y) + (4.0d0 / y)))
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.6e+127) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 1.9e+32) {
tmp = Math.abs(((x / y) + (4.0 / y)));
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -3.6e+127: tmp = math.fabs(((x * z) / y)) elif z <= 1.9e+32: tmp = math.fabs(((x / y) + (4.0 / y))) else: tmp = math.fabs((z / (y / x))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -3.6e+127) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 1.9e+32) tmp = abs(Float64(Float64(x / y) + Float64(4.0 / y))); else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.6e+127) tmp = abs(((x * z) / y)); elseif (z <= 1.9e+32) tmp = abs(((x / y) + (4.0 / y))); else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -3.6e+127], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.9e+32], 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}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+127}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+32}:\\
\;\;\;\;\left|\frac{x}{y} + \frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -3.59999999999999979e127Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -3.59999999999999979e127 < z < 1.9000000000000002e32Initial program 94.3%
Taylor expanded in z around 0 95.0%
associate-*r/95.0%
metadata-eval95.0%
Simplified95.0%
if 1.9000000000000002e32 < 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%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(if (<= z -2.1e+130)
(fabs (/ (* x z) y))
(if (<= z 3e+33)
(fabs (+ (/ x y) (/ 4.0 y)))
(fabs (/ (+ z -1.0) (/ y x))))))y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+130) {
tmp = fabs(((x * z) / y));
} else if (z <= 3e+33) {
tmp = fabs(((x / y) + (4.0 / y)));
} else {
tmp = fabs(((z + -1.0) / (y / x)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= (-2.1d+130)) then
tmp = abs(((x * z) / y))
else if (z <= 3d+33) then
tmp = abs(((x / y) + (4.0d0 / y)))
else
tmp = abs(((z + (-1.0d0)) / (y / x)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.1e+130) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 3e+33) {
tmp = Math.abs(((x / y) + (4.0 / y)));
} else {
tmp = Math.abs(((z + -1.0) / (y / x)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -2.1e+130: tmp = math.fabs(((x * z) / y)) elif z <= 3e+33: tmp = math.fabs(((x / y) + (4.0 / y))) else: tmp = math.fabs(((z + -1.0) / (y / x))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -2.1e+130) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 3e+33) 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
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.1e+130) tmp = abs(((x * z) / y)); elseif (z <= 3e+33) tmp = abs(((x / y) + (4.0 / y))); else tmp = abs(((z + -1.0) / (y / x))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -2.1e+130], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3e+33], 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}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+130}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+33}:\\
\;\;\;\;\left|\frac{x}{y} + \frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z + -1}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -2.0999999999999999e130Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -2.0999999999999999e130 < z < 2.99999999999999984e33Initial program 94.3%
Taylor expanded in z around 0 95.0%
associate-*r/95.0%
metadata-eval95.0%
Simplified95.0%
if 2.99999999999999984e33 < 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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= x 4.4e+15) (fabs (/ (- (+ x 4.0) (* x z)) y)) (fabs (* (+ z -1.0) (/ x y)))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (x <= 4.4e+15) {
tmp = fabs((((x + 4.0) - (x * z)) / y));
} else {
tmp = fabs(((z + -1.0) * (x / y)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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 <= 4.4d+15) then
tmp = abs((((x + 4.0d0) - (x * z)) / y))
else
tmp = abs(((z + (-1.0d0)) * (x / y)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4.4e+15) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
} else {
tmp = Math.abs(((z + -1.0) * (x / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if x <= 4.4e+15: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) else: tmp = math.fabs(((z + -1.0) * (x / y))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (x <= 4.4e+15) 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
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4.4e+15) tmp = abs((((x + 4.0) - (x * z)) / y)); else tmp = abs(((z + -1.0) * (x / y))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[x, 4.4e+15], 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}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.4 \cdot 10^{+15}:\\
\;\;\;\;\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 < 4.4e15Initial program 92.1%
associate-*l/95.2%
sub-div98.9%
Applied egg-rr98.9%
if 4.4e15 < 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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= z -3.5e+127) (fabs (/ (* x z) y)) (if (<= z 1e+30) (fabs (/ (- -4.0 x) y)) (fabs (/ z (/ y x))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+127) {
tmp = fabs(((x * z) / y));
} else if (z <= 1e+30) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = fabs((z / (y / x)));
}
return tmp;
}
NOTE: y should be positive before calling this function
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.5d+127)) then
tmp = abs(((x * z) / y))
else if (z <= 1d+30) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = abs((z / (y / x)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3.5e+127) {
tmp = Math.abs(((x * z) / y));
} else if (z <= 1e+30) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = Math.abs((z / (y / x)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -3.5e+127: tmp = math.fabs(((x * z) / y)) elif z <= 1e+30: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = math.fabs((z / (y / x))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -3.5e+127) tmp = abs(Float64(Float64(x * z) / y)); elseif (z <= 1e+30) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = abs(Float64(z / Float64(y / x))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3.5e+127) tmp = abs(((x * z) / y)); elseif (z <= 1e+30) tmp = abs(((-4.0 - x) / y)); else tmp = abs((z / (y / x))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -3.5e+127], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1e+30], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+127}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;z \leq 10^{+30}:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y}{x}}\right|\\
\end{array}
\end{array}
if z < -3.49999999999999978e127Initial program 93.3%
Simplified95.4%
Taylor expanded in z around inf 81.8%
if -3.49999999999999978e127 < z < 1e30Initial 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 1e30 < 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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -10.5) (not (<= x 4.0))) (fabs (/ x y)) (fabs (/ 4.0 y))))
y = abs(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;
}
NOTE: y should be positive before calling this function
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
y = Math.abs(y);
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;
}
y = abs(y) 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
y = abs(y) 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
y = abs(y) 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
NOTE: y should be positive before calling this function 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}
y = |y|\\
\\
\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%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (fabs (/ 4.0 y)))
y = abs(y);
double code(double x, double y, double z) {
return fabs((4.0 / y));
}
NOTE: y should be positive before calling this function
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
y = Math.abs(y);
public static double code(double x, double y, double z) {
return Math.abs((4.0 / y));
}
y = abs(y) def code(x, y, z): return math.fabs((4.0 / y))
y = abs(y) function code(x, y, z) return abs(Float64(4.0 / y)) end
y = abs(y) function tmp = code(x, y, z) tmp = abs((4.0 / y)); end
NOTE: y should be positive before calling this function code[x_, y_, z_] := N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\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))))