
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 1.5e-70) (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 <= 1.5e-70) {
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 <= 1.5e-70) 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, 1.5e-70], 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 1.5 \cdot 10^{-70}:\\
\;\;\;\;\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 < 1.5000000000000001e-70Initial program 91.5%
associate-*l/89.9%
sub-div96.1%
Applied egg-rr96.1%
if 1.5000000000000001e-70 < y Initial program 98.7%
Simplified99.8%
Final simplification97.3%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y) (* z (/ x y))))) (if (<= t_0 5e+249) (fabs t_0) (fabs (/ (- (+ x 4.0) (* x z)) y)))))
y = abs(y);
double code(double x, double y, double z) {
double t_0 = ((x + 4.0) / y) - (z * (x / y));
double tmp;
if (t_0 <= 5e+249) {
tmp = fabs(t_0);
} else {
tmp = fabs((((x + 4.0) - (x * z)) / 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) :: t_0
real(8) :: tmp
t_0 = ((x + 4.0d0) / y) - (z * (x / y))
if (t_0 <= 5d+249) then
tmp = abs(t_0)
else
tmp = abs((((x + 4.0d0) - (x * z)) / y))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double t_0 = ((x + 4.0) / y) - (z * (x / y));
double tmp;
if (t_0 <= 5e+249) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = ((x + 4.0) / y) - (z * (x / y)) tmp = 0 if t_0 <= 5e+249: tmp = math.fabs(t_0) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y)) return tmp
y = abs(y) function code(x, y, z) t_0 = Float64(Float64(Float64(x + 4.0) / y) - Float64(z * Float64(x / y))) tmp = 0.0 if (t_0 <= 5e+249) tmp = abs(t_0); else tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = ((x + 4.0) / y) - (z * (x / y)); tmp = 0.0; if (t_0 <= 5e+249) tmp = abs(t_0); else tmp = abs((((x + 4.0) - (x * z)) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+249], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y} - z \cdot \frac{x}{y}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{+249}:\\
\;\;\;\;\left|t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) < 4.9999999999999996e249Initial program 98.6%
if 4.9999999999999996e249 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) Initial program 67.4%
associate-*l/70.2%
sub-div97.7%
Applied egg-rr97.7%
Final simplification98.4%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (* x (/ z y)))) (t_1 (fabs (/ x y))))
(if (<= x -1.3e+207)
t_0
(if (<= x -3.1e+129)
t_1
(if (<= x -4.5e+78)
t_0
(if (<= x -110000000000.0)
t_1
(if (<= x -3.9e-72)
t_0
(if (<= x 5.1e-124)
(fabs (/ 4.0 y))
(if (<= x 1.22e+141) t_0 t_1)))))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x * (z / y)));
double t_1 = fabs((x / y));
double tmp;
if (x <= -1.3e+207) {
tmp = t_0;
} else if (x <= -3.1e+129) {
tmp = t_1;
} else if (x <= -4.5e+78) {
tmp = t_0;
} else if (x <= -110000000000.0) {
tmp = t_1;
} else if (x <= -3.9e-72) {
tmp = t_0;
} else if (x <= 5.1e-124) {
tmp = fabs((4.0 / y));
} else if (x <= 1.22e+141) {
tmp = t_0;
} else {
tmp = t_1;
}
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 * (z / y)))
t_1 = abs((x / y))
if (x <= (-1.3d+207)) then
tmp = t_0
else if (x <= (-3.1d+129)) then
tmp = t_1
else if (x <= (-4.5d+78)) then
tmp = t_0
else if (x <= (-110000000000.0d0)) then
tmp = t_1
else if (x <= (-3.9d-72)) then
tmp = t_0
else if (x <= 5.1d-124) then
tmp = abs((4.0d0 / y))
else if (x <= 1.22d+141) then
tmp = t_0
else
tmp = t_1
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 * (z / y)));
double t_1 = Math.abs((x / y));
double tmp;
if (x <= -1.3e+207) {
tmp = t_0;
} else if (x <= -3.1e+129) {
tmp = t_1;
} else if (x <= -4.5e+78) {
tmp = t_0;
} else if (x <= -110000000000.0) {
tmp = t_1;
} else if (x <= -3.9e-72) {
tmp = t_0;
} else if (x <= 5.1e-124) {
tmp = Math.abs((4.0 / y));
} else if (x <= 1.22e+141) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((x * (z / y))) t_1 = math.fabs((x / y)) tmp = 0 if x <= -1.3e+207: tmp = t_0 elif x <= -3.1e+129: tmp = t_1 elif x <= -4.5e+78: tmp = t_0 elif x <= -110000000000.0: tmp = t_1 elif x <= -3.9e-72: tmp = t_0 elif x <= 5.1e-124: tmp = math.fabs((4.0 / y)) elif x <= 1.22e+141: tmp = t_0 else: tmp = t_1 return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(x * Float64(z / y))) t_1 = abs(Float64(x / y)) tmp = 0.0 if (x <= -1.3e+207) tmp = t_0; elseif (x <= -3.1e+129) tmp = t_1; elseif (x <= -4.5e+78) tmp = t_0; elseif (x <= -110000000000.0) tmp = t_1; elseif (x <= -3.9e-72) tmp = t_0; elseif (x <= 5.1e-124) tmp = abs(Float64(4.0 / y)); elseif (x <= 1.22e+141) tmp = t_0; else tmp = t_1; end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) t_0 = abs((x * (z / y))); t_1 = abs((x / y)); tmp = 0.0; if (x <= -1.3e+207) tmp = t_0; elseif (x <= -3.1e+129) tmp = t_1; elseif (x <= -4.5e+78) tmp = t_0; elseif (x <= -110000000000.0) tmp = t_1; elseif (x <= -3.9e-72) tmp = t_0; elseif (x <= 5.1e-124) tmp = abs((4.0 / y)); elseif (x <= 1.22e+141) tmp = t_0; else tmp = t_1; 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 * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.3e+207], t$95$0, If[LessEqual[x, -3.1e+129], t$95$1, If[LessEqual[x, -4.5e+78], t$95$0, If[LessEqual[x, -110000000000.0], t$95$1, If[LessEqual[x, -3.9e-72], t$95$0, If[LessEqual[x, 5.1e-124], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.22e+141], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{z}{y}\right|\\
t_1 := \left|\frac{x}{y}\right|\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -110000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.9 \cdot 10^{-72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+141}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.2999999999999999e207 or -3.1e129 < x < -4.4999999999999999e78 or -1.1e11 < x < -3.9e-72 or 5.1000000000000001e-124 < x < 1.2199999999999999e141Initial program 96.1%
Taylor expanded in z around inf 62.1%
mul-1-neg62.1%
associate-*r/67.5%
distribute-rgt-neg-out67.5%
distribute-neg-frac67.5%
Simplified67.5%
add-sqr-sqrt30.7%
sqrt-unprod49.6%
sqr-neg49.6%
sqrt-unprod36.7%
add-sqr-sqrt67.5%
clear-num67.4%
expm1-log1p-u40.4%
div-inv40.4%
expm1-udef28.6%
associate-/r/28.6%
associate-/r/28.6%
div-inv28.6%
clear-num28.6%
Applied egg-rr28.6%
expm1-def40.4%
expm1-log1p67.5%
Simplified67.5%
if -1.2999999999999999e207 < x < -3.1e129 or -4.4999999999999999e78 < x < -1.1e11 or 1.2199999999999999e141 < x Initial program 83.5%
Taylor expanded in z around 0 79.0%
associate-*r/79.0%
metadata-eval79.0%
Simplified79.0%
Taylor expanded in x around inf 79.0%
if -3.9e-72 < x < 5.1000000000000001e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification76.3%
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))))
(if (<= x -1.4e+207)
t_0
(if (<= x -4.4e+129)
t_1
(if (<= x -2.8e+72)
t_0
(if (<= x -3e+16)
t_1
(if (<= x -3.8e-72)
(fabs (* x (/ z y)))
(if (<= x 2.55e-124) (fabs (/ 4.0 y)) 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 tmp;
if (x <= -1.4e+207) {
tmp = t_0;
} else if (x <= -4.4e+129) {
tmp = t_1;
} else if (x <= -2.8e+72) {
tmp = t_0;
} else if (x <= -3e+16) {
tmp = t_1;
} else if (x <= -3.8e-72) {
tmp = fabs((x * (z / y)));
} else if (x <= 2.55e-124) {
tmp = fabs((4.0 / 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) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y)))
t_1 = abs((x / y))
if (x <= (-1.4d+207)) then
tmp = t_0
else if (x <= (-4.4d+129)) then
tmp = t_1
else if (x <= (-2.8d+72)) then
tmp = t_0
else if (x <= (-3d+16)) then
tmp = t_1
else if (x <= (-3.8d-72)) then
tmp = abs((x * (z / y)))
else if (x <= 2.55d-124) then
tmp = abs((4.0d0 / 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((z * (x / y)));
double t_1 = Math.abs((x / y));
double tmp;
if (x <= -1.4e+207) {
tmp = t_0;
} else if (x <= -4.4e+129) {
tmp = t_1;
} else if (x <= -2.8e+72) {
tmp = t_0;
} else if (x <= -3e+16) {
tmp = t_1;
} else if (x <= -3.8e-72) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 2.55e-124) {
tmp = Math.abs((4.0 / y));
} 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)) tmp = 0 if x <= -1.4e+207: tmp = t_0 elif x <= -4.4e+129: tmp = t_1 elif x <= -2.8e+72: tmp = t_0 elif x <= -3e+16: tmp = t_1 elif x <= -3.8e-72: tmp = math.fabs((x * (z / y))) elif x <= 2.55e-124: tmp = math.fabs((4.0 / y)) 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)) tmp = 0.0 if (x <= -1.4e+207) tmp = t_0; elseif (x <= -4.4e+129) tmp = t_1; elseif (x <= -2.8e+72) tmp = t_0; elseif (x <= -3e+16) tmp = t_1; elseif (x <= -3.8e-72) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 2.55e-124) tmp = abs(Float64(4.0 / y)); 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)); tmp = 0.0; if (x <= -1.4e+207) tmp = t_0; elseif (x <= -4.4e+129) tmp = t_1; elseif (x <= -2.8e+72) tmp = t_0; elseif (x <= -3e+16) tmp = t_1; elseif (x <= -3.8e-72) tmp = abs((x * (z / y))); elseif (x <= 2.55e-124) tmp = abs((4.0 / 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[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.4e+207], t$95$0, If[LessEqual[x, -4.4e+129], t$95$1, If[LessEqual[x, -2.8e+72], t$95$0, If[LessEqual[x, -3e+16], t$95$1, If[LessEqual[x, -3.8e-72], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.55e-124], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], 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|\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+207}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-72}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.40000000000000005e207 or -4.3999999999999999e129 < x < -2.7999999999999999e72 or 2.5500000000000001e-124 < x Initial program 91.6%
Taylor expanded in z around inf 61.0%
mul-1-neg61.0%
associate-*r/66.4%
distribute-rgt-neg-out66.4%
distribute-neg-frac66.4%
Simplified66.4%
add-sqr-sqrt31.9%
sqrt-unprod53.0%
sqr-neg53.0%
sqrt-unprod34.4%
add-sqr-sqrt66.4%
clear-num66.3%
expm1-log1p-u36.0%
div-inv36.0%
expm1-udef28.3%
associate-/r/29.1%
associate-/r/28.3%
div-inv28.3%
clear-num28.3%
Applied egg-rr28.3%
expm1-def36.1%
expm1-log1p66.4%
associate-*r/61.0%
associate-*l/67.9%
*-commutative67.9%
Simplified67.9%
if -1.40000000000000005e207 < x < -4.3999999999999999e129 or -2.7999999999999999e72 < x < -3e16Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -3e16 < x < -3.80000000000000002e-72Initial program 95.0%
Taylor expanded in z around inf 68.6%
mul-1-neg68.6%
associate-*r/68.8%
distribute-rgt-neg-out68.8%
distribute-neg-frac68.8%
Simplified68.8%
add-sqr-sqrt25.8%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod42.7%
add-sqr-sqrt68.8%
clear-num68.8%
expm1-log1p-u38.3%
div-inv38.1%
expm1-udef21.9%
associate-/r/21.9%
associate-/r/21.9%
div-inv21.9%
clear-num21.9%
Applied egg-rr21.9%
expm1-def38.3%
expm1-log1p68.8%
Simplified68.8%
if -3.80000000000000002e-72 < x < 2.5500000000000001e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification75.5%
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))))
(if (<= x -2e+207)
(fabs (/ x (/ y z)))
(if (<= x -4.9e+129)
t_1
(if (<= x -4.8e+72)
t_0
(if (<= x -1.06e+15)
t_1
(if (<= x -2e-72)
(fabs (* x (/ z y)))
(if (<= x 4.6e-124) (fabs (/ 4.0 y)) 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 tmp;
if (x <= -2e+207) {
tmp = fabs((x / (y / z)));
} else if (x <= -4.9e+129) {
tmp = t_1;
} else if (x <= -4.8e+72) {
tmp = t_0;
} else if (x <= -1.06e+15) {
tmp = t_1;
} else if (x <= -2e-72) {
tmp = fabs((x * (z / y)));
} else if (x <= 4.6e-124) {
tmp = fabs((4.0 / 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) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y)))
t_1 = abs((x / y))
if (x <= (-2d+207)) then
tmp = abs((x / (y / z)))
else if (x <= (-4.9d+129)) then
tmp = t_1
else if (x <= (-4.8d+72)) then
tmp = t_0
else if (x <= (-1.06d+15)) then
tmp = t_1
else if (x <= (-2d-72)) then
tmp = abs((x * (z / y)))
else if (x <= 4.6d-124) then
tmp = abs((4.0d0 / 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((z * (x / y)));
double t_1 = Math.abs((x / y));
double tmp;
if (x <= -2e+207) {
tmp = Math.abs((x / (y / z)));
} else if (x <= -4.9e+129) {
tmp = t_1;
} else if (x <= -4.8e+72) {
tmp = t_0;
} else if (x <= -1.06e+15) {
tmp = t_1;
} else if (x <= -2e-72) {
tmp = Math.abs((x * (z / y)));
} else if (x <= 4.6e-124) {
tmp = Math.abs((4.0 / y));
} 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)) tmp = 0 if x <= -2e+207: tmp = math.fabs((x / (y / z))) elif x <= -4.9e+129: tmp = t_1 elif x <= -4.8e+72: tmp = t_0 elif x <= -1.06e+15: tmp = t_1 elif x <= -2e-72: tmp = math.fabs((x * (z / y))) elif x <= 4.6e-124: tmp = math.fabs((4.0 / y)) 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)) tmp = 0.0 if (x <= -2e+207) tmp = abs(Float64(x / Float64(y / z))); elseif (x <= -4.9e+129) tmp = t_1; elseif (x <= -4.8e+72) tmp = t_0; elseif (x <= -1.06e+15) tmp = t_1; elseif (x <= -2e-72) tmp = abs(Float64(x * Float64(z / y))); elseif (x <= 4.6e-124) tmp = abs(Float64(4.0 / y)); 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)); tmp = 0.0; if (x <= -2e+207) tmp = abs((x / (y / z))); elseif (x <= -4.9e+129) tmp = t_1; elseif (x <= -4.8e+72) tmp = t_0; elseif (x <= -1.06e+15) tmp = t_1; elseif (x <= -2e-72) tmp = abs((x * (z / y))); elseif (x <= 4.6e-124) tmp = abs((4.0 / 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[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2e+207], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -4.9e+129], t$95$1, If[LessEqual[x, -4.8e+72], t$95$0, If[LessEqual[x, -1.06e+15], t$95$1, If[LessEqual[x, -2e-72], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.6e-124], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], 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|\\
\mathbf{if}\;x \leq -2 \cdot 10^{+207}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-72}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.0000000000000001e207Initial program 87.8%
Taylor expanded in z around inf 62.2%
mul-1-neg62.2%
associate-*r/77.2%
distribute-rgt-neg-out77.2%
distribute-neg-frac77.2%
Simplified77.2%
add-sqr-sqrt36.8%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod40.4%
add-sqr-sqrt77.2%
clear-num77.2%
div-inv77.4%
Applied egg-rr77.4%
if -2.0000000000000001e207 < x < -4.9e129 or -4.8000000000000002e72 < x < -1.06e15Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -4.9e129 < x < -4.8000000000000002e72 or 4.60000000000000024e-124 < x Initial program 92.6%
Taylor expanded in z around inf 60.7%
mul-1-neg60.7%
associate-*r/63.6%
distribute-rgt-neg-out63.6%
distribute-neg-frac63.6%
Simplified63.6%
add-sqr-sqrt30.7%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod32.8%
add-sqr-sqrt63.6%
clear-num63.5%
expm1-log1p-u35.2%
div-inv35.2%
expm1-udef25.5%
associate-/r/26.5%
associate-/r/25.5%
div-inv25.5%
clear-num25.5%
Applied egg-rr25.5%
expm1-def35.2%
expm1-log1p63.6%
associate-*r/60.7%
associate-*l/65.5%
*-commutative65.5%
Simplified65.5%
if -1.06e15 < x < -1.9999999999999999e-72Initial program 95.0%
Taylor expanded in z around inf 68.6%
mul-1-neg68.6%
associate-*r/68.8%
distribute-rgt-neg-out68.8%
distribute-neg-frac68.8%
Simplified68.8%
add-sqr-sqrt25.8%
sqrt-unprod45.1%
sqr-neg45.1%
sqrt-unprod42.7%
add-sqr-sqrt68.8%
clear-num68.8%
expm1-log1p-u38.3%
div-inv38.1%
expm1-udef21.9%
associate-/r/21.9%
associate-/r/21.9%
div-inv21.9%
clear-num21.9%
Applied egg-rr21.9%
expm1-def38.3%
expm1-log1p68.8%
Simplified68.8%
if -1.9999999999999999e-72 < x < 4.60000000000000024e-124Initial program 97.9%
Taylor expanded in x around 0 85.2%
Final simplification75.5%
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))))
(if (<= x -1.65e+207)
(fabs (/ x (/ y z)))
(if (<= x -1.3e+129)
t_1
(if (<= x -6.6e+72)
t_0
(if (<= x -1.25e+16)
t_1
(if (<= x -6e-123)
(fabs (/ (* x z) y))
(if (<= x 5.1e-124) (fabs (/ 4.0 y)) 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 tmp;
if (x <= -1.65e+207) {
tmp = fabs((x / (y / z)));
} else if (x <= -1.3e+129) {
tmp = t_1;
} else if (x <= -6.6e+72) {
tmp = t_0;
} else if (x <= -1.25e+16) {
tmp = t_1;
} else if (x <= -6e-123) {
tmp = fabs(((x * z) / y));
} else if (x <= 5.1e-124) {
tmp = fabs((4.0 / 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) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y)))
t_1 = abs((x / y))
if (x <= (-1.65d+207)) then
tmp = abs((x / (y / z)))
else if (x <= (-1.3d+129)) then
tmp = t_1
else if (x <= (-6.6d+72)) then
tmp = t_0
else if (x <= (-1.25d+16)) then
tmp = t_1
else if (x <= (-6d-123)) then
tmp = abs(((x * z) / y))
else if (x <= 5.1d-124) then
tmp = abs((4.0d0 / 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((z * (x / y)));
double t_1 = Math.abs((x / y));
double tmp;
if (x <= -1.65e+207) {
tmp = Math.abs((x / (y / z)));
} else if (x <= -1.3e+129) {
tmp = t_1;
} else if (x <= -6.6e+72) {
tmp = t_0;
} else if (x <= -1.25e+16) {
tmp = t_1;
} else if (x <= -6e-123) {
tmp = Math.abs(((x * z) / y));
} else if (x <= 5.1e-124) {
tmp = Math.abs((4.0 / y));
} 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)) tmp = 0 if x <= -1.65e+207: tmp = math.fabs((x / (y / z))) elif x <= -1.3e+129: tmp = t_1 elif x <= -6.6e+72: tmp = t_0 elif x <= -1.25e+16: tmp = t_1 elif x <= -6e-123: tmp = math.fabs(((x * z) / y)) elif x <= 5.1e-124: tmp = math.fabs((4.0 / y)) 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)) tmp = 0.0 if (x <= -1.65e+207) tmp = abs(Float64(x / Float64(y / z))); elseif (x <= -1.3e+129) tmp = t_1; elseif (x <= -6.6e+72) tmp = t_0; elseif (x <= -1.25e+16) tmp = t_1; elseif (x <= -6e-123) tmp = abs(Float64(Float64(x * z) / y)); elseif (x <= 5.1e-124) tmp = abs(Float64(4.0 / y)); 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)); tmp = 0.0; if (x <= -1.65e+207) tmp = abs((x / (y / z))); elseif (x <= -1.3e+129) tmp = t_1; elseif (x <= -6.6e+72) tmp = t_0; elseif (x <= -1.25e+16) tmp = t_1; elseif (x <= -6e-123) tmp = abs(((x * z) / y)); elseif (x <= 5.1e-124) tmp = abs((4.0 / 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[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.65e+207], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -1.3e+129], t$95$1, If[LessEqual[x, -6.6e+72], t$95$0, If[LessEqual[x, -1.25e+16], t$95$1, If[LessEqual[x, -6e-123], N[Abs[N[(N[(x * z), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.1e-124], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], 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|\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+207}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+129}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{+72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-123}:\\
\;\;\;\;\left|\frac{x \cdot z}{y}\right|\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-124}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.65e207Initial program 87.8%
Taylor expanded in z around inf 62.2%
mul-1-neg62.2%
associate-*r/77.2%
distribute-rgt-neg-out77.2%
distribute-neg-frac77.2%
Simplified77.2%
add-sqr-sqrt36.8%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod40.4%
add-sqr-sqrt77.2%
clear-num77.2%
div-inv77.4%
Applied egg-rr77.4%
if -1.65e207 < x < -1.30000000000000006e129 or -6.6e72 < x < -1.25e16Initial program 88.3%
Taylor expanded in z around 0 83.1%
associate-*r/83.1%
metadata-eval83.1%
Simplified83.1%
Taylor expanded in x around inf 83.1%
if -1.30000000000000006e129 < x < -6.6e72 or 5.1000000000000001e-124 < x Initial program 92.6%
Taylor expanded in z around inf 60.7%
mul-1-neg60.7%
associate-*r/63.6%
distribute-rgt-neg-out63.6%
distribute-neg-frac63.6%
Simplified63.6%
add-sqr-sqrt30.7%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod32.8%
add-sqr-sqrt63.6%
clear-num63.5%
expm1-log1p-u35.2%
div-inv35.2%
expm1-udef25.5%
associate-/r/26.5%
associate-/r/25.5%
div-inv25.5%
clear-num25.5%
Applied egg-rr25.5%
expm1-def35.2%
expm1-log1p63.6%
associate-*r/60.7%
associate-*l/65.5%
*-commutative65.5%
Simplified65.5%
if -1.25e16 < x < -5.99999999999999968e-123Initial program 96.8%
Taylor expanded in z around inf 64.5%
mul-1-neg64.5%
associate-*r/61.7%
distribute-rgt-neg-out61.7%
distribute-neg-frac61.7%
Simplified61.7%
associate-*r/64.5%
add-sqr-sqrt20.3%
times-frac20.3%
add-sqr-sqrt7.1%
sqrt-unprod8.3%
sqr-neg8.3%
sqrt-unprod13.2%
add-sqr-sqrt20.3%
times-frac20.3%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
if -5.99999999999999968e-123 < x < 5.1000000000000001e-124Initial program 97.6%
Taylor expanded in x around 0 90.3%
Final simplification75.8%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 2.65e-45) (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 <= 2.65e-45) {
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 <= 2.65d-45) 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 <= 2.65e-45) {
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 <= 2.65e-45: 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 <= 2.65e-45) 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 <= 2.65e-45) 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, 2.65e-45], 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 2.65 \cdot 10^{-45}:\\
\;\;\;\;\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 < 2.6499999999999999e-45Initial program 91.9%
associate-*l/90.4%
sub-div96.3%
Applied egg-rr96.3%
if 2.6499999999999999e-45 < y Initial program 98.6%
Simplified99.8%
Final simplification97.3%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= z -4.5e+40) (fabs (* z (/ x y))) (if (<= z 37000000000.0) (fabs (/ (- -4.0 x) y)) (fabs (* x (/ z y))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+40) {
tmp = fabs((z * (x / y)));
} else if (z <= 37000000000.0) {
tmp = fabs(((-4.0 - x) / y));
} else {
tmp = fabs((x * (z / 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 (z <= (-4.5d+40)) then
tmp = abs((z * (x / y)))
else if (z <= 37000000000.0d0) then
tmp = abs((((-4.0d0) - x) / y))
else
tmp = abs((x * (z / y)))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.5e+40) {
tmp = Math.abs((z * (x / y)));
} else if (z <= 37000000000.0) {
tmp = Math.abs(((-4.0 - x) / y));
} else {
tmp = Math.abs((x * (z / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -4.5e+40: tmp = math.fabs((z * (x / y))) elif z <= 37000000000.0: tmp = math.fabs(((-4.0 - x) / y)) else: tmp = math.fabs((x * (z / y))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -4.5e+40) tmp = abs(Float64(z * Float64(x / y))); elseif (z <= 37000000000.0) tmp = abs(Float64(Float64(-4.0 - x) / y)); else tmp = abs(Float64(x * Float64(z / y))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.5e+40) tmp = abs((z * (x / y))); elseif (z <= 37000000000.0) tmp = abs(((-4.0 - x) / y)); else tmp = abs((x * (z / y))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -4.5e+40], N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 37000000000.0], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+40}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{elif}\;z \leq 37000000000:\\
\;\;\;\;\left|\frac{-4 - x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\end{array}
\end{array}
if z < -4.50000000000000032e40Initial program 98.1%
Taylor expanded in z around inf 69.8%
mul-1-neg69.8%
associate-*r/73.3%
distribute-rgt-neg-out73.3%
distribute-neg-frac73.3%
Simplified73.3%
add-sqr-sqrt73.1%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod0.0%
add-sqr-sqrt73.3%
clear-num73.2%
expm1-log1p-u42.6%
div-inv42.6%
expm1-udef31.1%
associate-/r/34.1%
associate-/r/31.1%
div-inv31.1%
clear-num31.1%
Applied egg-rr31.1%
expm1-def42.7%
expm1-log1p73.3%
associate-*r/69.8%
associate-*l/78.2%
*-commutative78.2%
Simplified78.2%
if -4.50000000000000032e40 < z < 3.7e10Initial program 96.9%
Simplified100.0%
Taylor expanded in z around 0 96.8%
associate-*r/96.8%
distribute-lft-in96.8%
metadata-eval96.8%
neg-mul-196.8%
sub-neg96.8%
Simplified96.8%
if 3.7e10 < z Initial program 84.7%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
associate-*r/83.2%
distribute-rgt-neg-out83.2%
distribute-neg-frac83.2%
Simplified83.2%
add-sqr-sqrt0.0%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod83.0%
add-sqr-sqrt83.2%
clear-num83.2%
expm1-log1p-u45.6%
div-inv45.7%
expm1-udef33.2%
associate-/r/33.2%
associate-/r/33.2%
div-inv33.1%
clear-num33.1%
Applied egg-rr33.1%
expm1-def45.6%
expm1-log1p83.2%
Simplified83.2%
Final simplification88.9%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (fabs (/ (- (+ x 4.0) (* x z)) y)))
y = abs(y);
double code(double x, double y, double z) {
return fabs((((x + 4.0) - (x * z)) / 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((((x + 4.0d0) - (x * z)) / y))
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) - (x * z)) / y));
}
y = abs(y) def code(x, y, z): return math.fabs((((x + 4.0) - (x * z)) / y))
y = abs(y) function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y)) end
y = abs(y) function tmp = code(x, y, z) tmp = abs((((x + 4.0) - (x * z)) / y)); end
NOTE: y should be positive before calling this function code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y = |y|\\
\\
\left|\frac{\left(x + 4\right) - x \cdot z}{y}\right|
\end{array}
Initial program 93.7%
associate-*l/92.3%
sub-div96.5%
Applied egg-rr96.5%
Final simplification96.5%
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 89.5%
Taylor expanded in z around 0 58.8%
associate-*r/58.8%
metadata-eval58.8%
Simplified58.8%
Taylor expanded in x around inf 58.2%
if -10.5 < x < 4Initial program 97.8%
Taylor expanded in x around 0 70.3%
Final simplification64.3%
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 93.7%
Taylor expanded in x around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023332
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))