
(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 4e-16) (fabs (/ (- (* x z) (+ x 4.0)) 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 <= 4e-16) {
tmp = fabs((((x * z) - (x + 4.0)) / 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 <= 4e-16) tmp = abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / 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, 4e-16], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $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 4 \cdot 10^{-16}:\\
\;\;\;\;\left|\frac{x \cdot z - \left(x + 4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y}, \frac{-4 - x}{y}\right)\right|\\
\end{array}
\end{array}
if y < 3.9999999999999999e-16Initial program 92.3%
associate-*l/95.0%
associate-*r/92.5%
Simplified92.5%
Taylor expanded in x around 0 96.3%
sub-neg96.3%
+-commutative96.3%
distribute-lft-in92.4%
associate-+r+92.4%
distribute-rgt-in92.4%
associate-*l/92.5%
*-lft-identity92.5%
+-commutative92.5%
distribute-rgt-neg-out92.5%
sub-neg92.5%
associate-*r/95.0%
div-sub98.9%
Simplified98.9%
if 3.9999999999999999e-16 < y Initial program 93.0%
Simplified99.9%
Final simplification99.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 (/ x (/ y z)))))
(if (<= x -1.35e+32)
t_0
(if (<= x -1.95e-94)
t_1
(if (<= x 1.35e-10)
(fabs (/ 4.0 y))
(if (<= x 3.3e+107)
(fabs (* z (/ x y)))
(if (or (<= x 3.4e+127) (not (<= x 6.2e+178))) t_0 t_1)))))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double t_1 = fabs((x / (y / z)));
double tmp;
if (x <= -1.35e+32) {
tmp = t_0;
} else if (x <= -1.95e-94) {
tmp = t_1;
} else if (x <= 1.35e-10) {
tmp = fabs((4.0 / y));
} else if (x <= 3.3e+107) {
tmp = fabs((z * (x / y)));
} else if ((x <= 3.4e+127) || !(x <= 6.2e+178)) {
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 / y))
t_1 = abs((x / (y / z)))
if (x <= (-1.35d+32)) then
tmp = t_0
else if (x <= (-1.95d-94)) then
tmp = t_1
else if (x <= 1.35d-10) then
tmp = abs((4.0d0 / y))
else if (x <= 3.3d+107) then
tmp = abs((z * (x / y)))
else if ((x <= 3.4d+127) .or. (.not. (x <= 6.2d+178))) 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 / y));
double t_1 = Math.abs((x / (y / z)));
double tmp;
if (x <= -1.35e+32) {
tmp = t_0;
} else if (x <= -1.95e-94) {
tmp = t_1;
} else if (x <= 1.35e-10) {
tmp = Math.abs((4.0 / y));
} else if (x <= 3.3e+107) {
tmp = Math.abs((z * (x / y)));
} else if ((x <= 3.4e+127) || !(x <= 6.2e+178)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
y = abs(y) def code(x, y, z): t_0 = math.fabs((x / y)) t_1 = math.fabs((x / (y / z))) tmp = 0 if x <= -1.35e+32: tmp = t_0 elif x <= -1.95e-94: tmp = t_1 elif x <= 1.35e-10: tmp = math.fabs((4.0 / y)) elif x <= 3.3e+107: tmp = math.fabs((z * (x / y))) elif (x <= 3.4e+127) or not (x <= 6.2e+178): tmp = t_0 else: tmp = t_1 return tmp
y = abs(y) function code(x, y, z) t_0 = abs(Float64(x / y)) t_1 = abs(Float64(x / Float64(y / z))) tmp = 0.0 if (x <= -1.35e+32) tmp = t_0; elseif (x <= -1.95e-94) tmp = t_1; elseif (x <= 1.35e-10) tmp = abs(Float64(4.0 / y)); elseif (x <= 3.3e+107) tmp = abs(Float64(z * Float64(x / y))); elseif ((x <= 3.4e+127) || !(x <= 6.2e+178)) 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 / y)); t_1 = abs((x / (y / z))); tmp = 0.0; if (x <= -1.35e+32) tmp = t_0; elseif (x <= -1.95e-94) tmp = t_1; elseif (x <= 1.35e-10) tmp = abs((4.0 / y)); elseif (x <= 3.3e+107) tmp = abs((z * (x / y))); elseif ((x <= 3.4e+127) || ~((x <= 6.2e+178))) 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 / y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.35e+32], t$95$0, If[LessEqual[x, -1.95e-94], t$95$1, If[LessEqual[x, 1.35e-10], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.3e+107], N[Abs[N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 3.4e+127], N[Not[LessEqual[x, 6.2e+178]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y}\right|\\
t_1 := \left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+32}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-94}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-10}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+107}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+127} \lor \neg \left(x \leq 6.2 \cdot 10^{+178}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.35000000000000006e32 or 3.30000000000000032e107 < x < 3.39999999999999977e127 or 6.19999999999999982e178 < x Initial program 91.6%
associate-*l/88.9%
associate-*r/94.7%
Simplified94.7%
Taylor expanded in z around 0 74.0%
associate-*r/74.0%
metadata-eval74.0%
Simplified74.0%
Taylor expanded in x around inf 74.0%
if -1.35000000000000006e32 < x < -1.9500000000000001e-94 or 3.39999999999999977e127 < x < 6.19999999999999982e178Initial program 91.0%
associate-*l/95.0%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around inf 65.1%
mul-1-neg65.1%
associate-*r/67.4%
*-commutative67.4%
distribute-rgt-neg-in67.4%
associate-*l/65.1%
Simplified65.1%
expm1-log1p-u48.5%
expm1-udef22.9%
associate-/l*22.9%
add-sqr-sqrt5.4%
sqrt-unprod7.9%
sqr-neg7.9%
sqrt-unprod4.5%
add-sqr-sqrt20.7%
Applied egg-rr20.7%
expm1-def36.8%
expm1-log1p57.9%
associate-/l*65.1%
*-commutative65.1%
associate-/l*67.3%
Simplified67.3%
if -1.9500000000000001e-94 < x < 1.35e-10Initial program 93.5%
associate-*l/99.9%
associate-*r/93.4%
Simplified93.4%
Taylor expanded in x around 0 82.4%
if 1.35e-10 < x < 3.30000000000000032e107Initial program 94.8%
associate-*l/90.1%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in z around inf 56.9%
mul-1-neg56.9%
associate-*r/61.4%
*-commutative61.4%
distribute-rgt-neg-in61.4%
associate-*l/56.9%
Simplified56.9%
expm1-log1p-u23.3%
expm1-udef16.0%
associate-/l*16.0%
add-sqr-sqrt0.0%
sqrt-unprod37.7%
sqr-neg37.7%
sqrt-unprod37.7%
add-sqr-sqrt37.7%
Applied egg-rr37.7%
expm1-def45.0%
expm1-log1p61.5%
associate-/l*56.9%
associate-*r/61.5%
Simplified61.5%
Final simplification75.3%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fabs (/ x y))))
(if (<= x -1.5)
t_0
(if (<= x 1.4e-10)
(fabs (/ 4.0 y))
(if (or (<= x 4.6e+107) (and (not (<= x 2.15e+130)) (<= x 5.2e+188)))
(fabs (* z (/ x y)))
t_0)))))y = abs(y);
double code(double x, double y, double z) {
double t_0 = fabs((x / y));
double tmp;
if (x <= -1.5) {
tmp = t_0;
} else if (x <= 1.4e-10) {
tmp = fabs((4.0 / y));
} else if ((x <= 4.6e+107) || (!(x <= 2.15e+130) && (x <= 5.2e+188))) {
tmp = fabs((z * (x / 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 <= (-1.5d0)) then
tmp = t_0
else if (x <= 1.4d-10) then
tmp = abs((4.0d0 / y))
else if ((x <= 4.6d+107) .or. (.not. (x <= 2.15d+130)) .and. (x <= 5.2d+188)) then
tmp = abs((z * (x / 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 <= -1.5) {
tmp = t_0;
} else if (x <= 1.4e-10) {
tmp = Math.abs((4.0 / y));
} else if ((x <= 4.6e+107) || (!(x <= 2.15e+130) && (x <= 5.2e+188))) {
tmp = Math.abs((z * (x / 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 <= -1.5: tmp = t_0 elif x <= 1.4e-10: tmp = math.fabs((4.0 / y)) elif (x <= 4.6e+107) or (not (x <= 2.15e+130) and (x <= 5.2e+188)): tmp = math.fabs((z * (x / 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 <= -1.5) tmp = t_0; elseif (x <= 1.4e-10) tmp = abs(Float64(4.0 / y)); elseif ((x <= 4.6e+107) || (!(x <= 2.15e+130) && (x <= 5.2e+188))) tmp = abs(Float64(z * Float64(x / 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 <= -1.5) tmp = t_0; elseif (x <= 1.4e-10) tmp = abs((4.0 / y)); elseif ((x <= 4.6e+107) || (~((x <= 2.15e+130)) && (x <= 5.2e+188))) tmp = abs((z * (x / 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, -1.5], t$95$0, If[LessEqual[x, 1.4e-10], N[Abs[N[(4.0 / y), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 4.6e+107], And[N[Not[LessEqual[x, 2.15e+130]], $MachinePrecision], LessEqual[x, 5.2e+188]]], N[Abs[N[(z * N[(x / 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 -1.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-10}:\\
\;\;\;\;\left|\frac{4}{y}\right|\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+107} \lor \neg \left(x \leq 2.15 \cdot 10^{+130}\right) \land x \leq 5.2 \cdot 10^{+188}:\\
\;\;\;\;\left|z \cdot \frac{x}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.5 or 4.6000000000000001e107 < x < 2.14999999999999992e130 or 5.19999999999999975e188 < x Initial program 91.7%
associate-*l/90.1%
associate-*r/94.9%
Simplified94.9%
Taylor expanded in z around 0 73.6%
associate-*r/73.6%
metadata-eval73.6%
Simplified73.6%
Taylor expanded in x around inf 72.2%
if -1.5 < x < 1.40000000000000008e-10Initial program 92.8%
associate-*l/99.9%
associate-*r/94.8%
Simplified94.8%
Taylor expanded in x around 0 74.4%
if 1.40000000000000008e-10 < x < 4.6000000000000001e107 or 2.14999999999999992e130 < x < 5.19999999999999975e188Initial program 93.5%
associate-*l/84.9%
associate-*r/93.3%
Simplified93.3%
Taylor expanded in z around inf 64.3%
mul-1-neg64.3%
associate-*r/72.7%
*-commutative72.7%
distribute-rgt-neg-in72.7%
associate-*l/64.3%
Simplified64.3%
expm1-log1p-u39.8%
expm1-udef32.2%
associate-/l*34.8%
add-sqr-sqrt0.0%
sqrt-unprod26.8%
sqr-neg26.8%
sqrt-unprod29.4%
add-sqr-sqrt29.4%
Applied egg-rr29.4%
expm1-def37.0%
expm1-log1p72.9%
associate-/l*64.3%
associate-*r/72.9%
Simplified72.9%
Final simplification73.3%
NOTE: y should be positive before calling this function
(FPCore (x y z)
:precision binary64
(if (<= z -2.5e+59)
(fabs (/ x (/ y z)))
(if (<= z 6.5e-15)
(fabs (/ (+ x 4.0) y))
(fabs (* x (+ (/ z y) (/ -1.0 y)))))))y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+59) {
tmp = fabs((x / (y / z)));
} else if (z <= 6.5e-15) {
tmp = fabs(((x + 4.0) / y));
} else {
tmp = fabs((x * ((z / y) + (-1.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 (z <= (-2.5d+59)) then
tmp = abs((x / (y / z)))
else if (z <= 6.5d-15) then
tmp = abs(((x + 4.0d0) / y))
else
tmp = abs((x * ((z / y) + ((-1.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 (z <= -2.5e+59) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 6.5e-15) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = Math.abs((x * ((z / y) + (-1.0 / y))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -2.5e+59: tmp = math.fabs((x / (y / z))) elif z <= 6.5e-15: tmp = math.fabs(((x + 4.0) / y)) else: tmp = math.fabs((x * ((z / y) + (-1.0 / y)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -2.5e+59) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 6.5e-15) tmp = abs(Float64(Float64(x + 4.0) / y)); else tmp = abs(Float64(x * Float64(Float64(z / y) + Float64(-1.0 / y)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.5e+59) tmp = abs((x / (y / z))); elseif (z <= 6.5e-15) tmp = abs(((x + 4.0) / y)); else tmp = abs((x * ((z / y) + (-1.0 / y)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -2.5e+59], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 6.5e-15], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(N[(z / y), $MachinePrecision] + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+59}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-15}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \left(\frac{z}{y} + \frac{-1}{y}\right)\right|\\
\end{array}
\end{array}
if z < -2.4999999999999999e59Initial program 94.5%
associate-*l/92.0%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around inf 74.8%
mul-1-neg74.8%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt-neg-in76.7%
associate-*l/74.8%
Simplified74.8%
expm1-log1p-u46.7%
expm1-udef26.0%
associate-/l*29.5%
add-sqr-sqrt14.2%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod16.9%
add-sqr-sqrt32.8%
Applied egg-rr32.8%
expm1-def47.1%
expm1-log1p76.4%
associate-/l*74.8%
*-commutative74.8%
associate-/l*78.1%
Simplified78.1%
if -2.4999999999999999e59 < z < 6.49999999999999991e-15Initial program 95.9%
associate-*l/97.9%
associate-*r/97.9%
Simplified97.9%
Taylor expanded in z around 0 98.0%
+-commutative98.0%
*-rgt-identity98.0%
associate-*r/97.9%
distribute-rgt-in97.9%
associate-*l/98.1%
*-lft-identity98.1%
Simplified98.1%
if 6.49999999999999991e-15 < z Initial program 82.7%
Simplified91.9%
Taylor expanded in x around inf 81.9%
Final simplification90.5%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= y 4.2e-16) (fabs (/ (- (* x z) (+ x 4.0)) y)) (fabs (- (/ (+ x 4.0) y) (* x (/ z y))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (y <= 4.2e-16) {
tmp = fabs((((x * z) - (x + 4.0)) / y));
} else {
tmp = fabs((((x + 4.0) / y) - (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 (y <= 4.2d-16) then
tmp = abs((((x * z) - (x + 4.0d0)) / y))
else
tmp = abs((((x + 4.0d0) / y) - (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 (y <= 4.2e-16) {
tmp = Math.abs((((x * z) - (x + 4.0)) / y));
} else {
tmp = Math.abs((((x + 4.0) / y) - (x * (z / y))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if y <= 4.2e-16: tmp = math.fabs((((x * z) - (x + 4.0)) / y)) else: tmp = math.fabs((((x + 4.0) / y) - (x * (z / y)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (y <= 4.2e-16) tmp = abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(x * Float64(z / y)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= 4.2e-16) tmp = abs((((x * z) - (x + 4.0)) / y)); else tmp = abs((((x + 4.0) / y) - (x * (z / y)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[y, 4.2e-16], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(x * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-16}:\\
\;\;\;\;\left|\frac{x \cdot z - \left(x + 4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y} - x \cdot \frac{z}{y}\right|\\
\end{array}
\end{array}
if y < 4.2000000000000002e-16Initial program 92.3%
associate-*l/95.0%
associate-*r/92.5%
Simplified92.5%
Taylor expanded in x around 0 96.3%
sub-neg96.3%
+-commutative96.3%
distribute-lft-in92.4%
associate-+r+92.4%
distribute-rgt-in92.4%
associate-*l/92.5%
*-lft-identity92.5%
+-commutative92.5%
distribute-rgt-neg-out92.5%
sub-neg92.5%
associate-*r/95.0%
div-sub98.9%
Simplified98.9%
if 4.2000000000000002e-16 < y Initial program 93.0%
associate-*l/92.4%
associate-*r/99.8%
Simplified99.8%
Final simplification99.2%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= z -1.2e+58) (fabs (/ x (/ y z))) (if (<= z 6.5e-15) (fabs (/ (+ x 4.0) y)) (fabs (/ x (/ y (- 1.0 z)))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -1.2e+58) {
tmp = fabs((x / (y / z)));
} else if (z <= 6.5e-15) {
tmp = fabs(((x + 4.0) / y));
} else {
tmp = fabs((x / (y / (1.0 - 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 (z <= (-1.2d+58)) then
tmp = abs((x / (y / z)))
else if (z <= 6.5d-15) then
tmp = abs(((x + 4.0d0) / y))
else
tmp = abs((x / (y / (1.0d0 - z))))
end if
code = tmp
end function
y = Math.abs(y);
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.2e+58) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 6.5e-15) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = Math.abs((x / (y / (1.0 - z))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -1.2e+58: tmp = math.fabs((x / (y / z))) elif z <= 6.5e-15: tmp = math.fabs(((x + 4.0) / y)) else: tmp = math.fabs((x / (y / (1.0 - z)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -1.2e+58) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 6.5e-15) tmp = abs(Float64(Float64(x + 4.0) / y)); else tmp = abs(Float64(x / Float64(y / Float64(1.0 - z)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.2e+58) tmp = abs((x / (y / z))); elseif (z <= 6.5e-15) tmp = abs(((x + 4.0) / y)); else tmp = abs((x / (y / (1.0 - z)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[z, -1.2e+58], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 6.5e-15], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+58}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-15}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{1 - z}}\right|\\
\end{array}
\end{array}
if z < -1.2e58Initial program 94.5%
associate-*l/92.0%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around inf 74.8%
mul-1-neg74.8%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt-neg-in76.7%
associate-*l/74.8%
Simplified74.8%
expm1-log1p-u46.7%
expm1-udef26.0%
associate-/l*29.5%
add-sqr-sqrt14.2%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod16.9%
add-sqr-sqrt32.8%
Applied egg-rr32.8%
expm1-def47.1%
expm1-log1p76.4%
associate-/l*74.8%
*-commutative74.8%
associate-/l*78.1%
Simplified78.1%
if -1.2e58 < z < 6.49999999999999991e-15Initial program 95.9%
associate-*l/97.9%
associate-*r/97.9%
Simplified97.9%
Taylor expanded in z around 0 98.0%
+-commutative98.0%
*-rgt-identity98.0%
associate-*r/97.9%
distribute-rgt-in97.9%
associate-*l/98.1%
*-lft-identity98.1%
Simplified98.1%
if 6.49999999999999991e-15 < z Initial program 82.7%
associate-*l/87.2%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in x around 0 96.8%
sub-neg96.8%
+-commutative96.8%
distribute-lft-in90.2%
associate-+r+90.2%
distribute-rgt-in90.2%
associate-*l/90.2%
*-lft-identity90.2%
+-commutative90.2%
distribute-rgt-neg-out90.2%
sub-neg90.2%
associate-*r/87.2%
div-sub93.7%
Simplified93.7%
Taylor expanded in x around inf 77.4%
associate-/l*81.8%
Simplified81.8%
Final simplification90.4%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= x 1.4e+95) (fabs (/ (- (* x z) (+ x 4.0)) y)) (fabs (/ x (/ y (- 1.0 z))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (x <= 1.4e+95) {
tmp = fabs((((x * z) - (x + 4.0)) / y));
} else {
tmp = fabs((x / (y / (1.0 - 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 (x <= 1.4d+95) then
tmp = abs((((x * z) - (x + 4.0d0)) / y))
else
tmp = abs((x / (y / (1.0d0 - z))))
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.4e+95) {
tmp = Math.abs((((x * z) - (x + 4.0)) / y));
} else {
tmp = Math.abs((x / (y / (1.0 - z))));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if x <= 1.4e+95: tmp = math.fabs((((x * z) - (x + 4.0)) / y)) else: tmp = math.fabs((x / (y / (1.0 - z)))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (x <= 1.4e+95) tmp = abs(Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y)); else tmp = abs(Float64(x / Float64(y / Float64(1.0 - z)))); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 1.4e+95) tmp = abs((((x * z) - (x + 4.0)) / y)); else tmp = abs((x / (y / (1.0 - z)))); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[LessEqual[x, 1.4e+95], N[Abs[N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{+95}:\\
\;\;\;\;\left|\frac{x \cdot z - \left(x + 4\right)}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{1 - z}}\right|\\
\end{array}
\end{array}
if x < 1.3999999999999999e95Initial program 92.0%
associate-*l/96.7%
associate-*r/94.5%
Simplified94.5%
Taylor expanded in x around 0 96.8%
sub-neg96.8%
+-commutative96.8%
distribute-lft-in94.5%
associate-+r+94.5%
distribute-rgt-in94.4%
associate-*l/94.5%
*-lft-identity94.5%
+-commutative94.5%
distribute-rgt-neg-out94.5%
sub-neg94.5%
associate-*r/96.7%
div-sub99.0%
Simplified99.0%
if 1.3999999999999999e95 < x Initial program 95.0%
associate-*l/81.9%
associate-*r/95.1%
Simplified95.1%
Taylor expanded in x around 0 99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in94.8%
associate-+r+94.8%
distribute-rgt-in94.8%
associate-*l/95.1%
*-lft-identity95.1%
+-commutative95.1%
distribute-rgt-neg-out95.1%
sub-neg95.1%
associate-*r/81.9%
div-sub86.6%
Simplified86.6%
Taylor expanded in x around inf 86.6%
associate-/l*99.9%
Simplified99.9%
Final simplification99.2%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= z -6.6e+57) (not (<= z 1e+21))) (fabs (/ x (/ y z))) (fabs (/ (+ x 4.0) y))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if ((z <= -6.6e+57) || !(z <= 1e+21)) {
tmp = fabs((x / (y / z)));
} else {
tmp = fabs(((x + 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 ((z <= (-6.6d+57)) .or. (.not. (z <= 1d+21))) then
tmp = abs((x / (y / z)))
else
tmp = abs(((x + 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 ((z <= -6.6e+57) || !(z <= 1e+21)) {
tmp = Math.abs((x / (y / z)));
} else {
tmp = Math.abs(((x + 4.0) / y));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if (z <= -6.6e+57) or not (z <= 1e+21): tmp = math.fabs((x / (y / z))) else: tmp = math.fabs(((x + 4.0) / y)) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if ((z <= -6.6e+57) || !(z <= 1e+21)) tmp = abs(Float64(x / Float64(y / z))); else tmp = abs(Float64(Float64(x + 4.0) / y)); end return tmp end
y = abs(y) function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -6.6e+57) || ~((z <= 1e+21))) tmp = abs((x / (y / z))); else tmp = abs(((x + 4.0) / y)); end tmp_2 = tmp; end
NOTE: y should be positive before calling this function code[x_, y_, z_] := If[Or[LessEqual[z, -6.6e+57], N[Not[LessEqual[z, 1e+21]], $MachinePrecision]], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y = |y|\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+57} \lor \neg \left(z \leq 10^{+21}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\end{array}
\end{array}
if z < -6.6000000000000002e57 or 1e21 < z Initial program 86.6%
associate-*l/89.2%
associate-*r/90.1%
Simplified90.1%
Taylor expanded in z around inf 77.5%
mul-1-neg77.5%
associate-*r/80.2%
*-commutative80.2%
distribute-rgt-neg-in80.2%
associate-*l/77.5%
Simplified77.5%
expm1-log1p-u47.3%
expm1-udef26.4%
associate-/l*28.9%
add-sqr-sqrt14.4%
sqrt-unprod21.7%
sqr-neg21.7%
sqrt-unprod15.2%
add-sqr-sqrt34.2%
Applied egg-rr34.2%
expm1-def45.1%
expm1-log1p74.2%
associate-/l*77.5%
*-commutative77.5%
associate-/l*80.9%
Simplified80.9%
if -6.6000000000000002e57 < z < 1e21Initial program 96.2%
associate-*l/97.4%
associate-*r/97.5%
Simplified97.5%
Taylor expanded in z around 0 95.0%
+-commutative95.0%
*-rgt-identity95.0%
associate-*r/94.9%
distribute-rgt-in94.8%
associate-*l/95.0%
*-lft-identity95.0%
Simplified95.0%
Final simplification89.6%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (<= z -5.8e+57) (fabs (/ x (/ y z))) (if (<= z 9.5e+20) (fabs (/ (+ x 4.0) y)) (fabs (* x (/ z y))))))
y = abs(y);
double code(double x, double y, double z) {
double tmp;
if (z <= -5.8e+57) {
tmp = fabs((x / (y / z)));
} else if (z <= 9.5e+20) {
tmp = fabs(((x + 4.0) / 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 <= (-5.8d+57)) then
tmp = abs((x / (y / z)))
else if (z <= 9.5d+20) then
tmp = abs(((x + 4.0d0) / 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 <= -5.8e+57) {
tmp = Math.abs((x / (y / z)));
} else if (z <= 9.5e+20) {
tmp = Math.abs(((x + 4.0) / y));
} else {
tmp = Math.abs((x * (z / y)));
}
return tmp;
}
y = abs(y) def code(x, y, z): tmp = 0 if z <= -5.8e+57: tmp = math.fabs((x / (y / z))) elif z <= 9.5e+20: tmp = math.fabs(((x + 4.0) / y)) else: tmp = math.fabs((x * (z / y))) return tmp
y = abs(y) function code(x, y, z) tmp = 0.0 if (z <= -5.8e+57) tmp = abs(Float64(x / Float64(y / z))); elseif (z <= 9.5e+20) tmp = abs(Float64(Float64(x + 4.0) / 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 <= -5.8e+57) tmp = abs((x / (y / z))); elseif (z <= 9.5e+20) tmp = abs(((x + 4.0) / 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, -5.8e+57], N[Abs[N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 9.5e+20], N[Abs[N[(N[(x + 4.0), $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 -5.8 \cdot 10^{+57}:\\
\;\;\;\;\left|\frac{x}{\frac{y}{z}}\right|\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+20}:\\
\;\;\;\;\left|\frac{x + 4}{y}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y}\right|\\
\end{array}
\end{array}
if z < -5.8000000000000003e57Initial program 94.5%
associate-*l/92.0%
associate-*r/90.2%
Simplified90.2%
Taylor expanded in z around inf 74.8%
mul-1-neg74.8%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt-neg-in76.7%
associate-*l/74.8%
Simplified74.8%
expm1-log1p-u46.7%
expm1-udef26.0%
associate-/l*29.5%
add-sqr-sqrt14.2%
sqrt-unprod23.8%
sqr-neg23.8%
sqrt-unprod16.9%
add-sqr-sqrt32.8%
Applied egg-rr32.8%
expm1-def47.1%
expm1-log1p76.4%
associate-/l*74.8%
*-commutative74.8%
associate-/l*78.1%
Simplified78.1%
if -5.8000000000000003e57 < z < 9.5e20Initial program 96.2%
associate-*l/97.4%
associate-*r/97.5%
Simplified97.5%
Taylor expanded in z around 0 95.0%
+-commutative95.0%
*-rgt-identity95.0%
associate-*r/94.9%
distribute-rgt-in94.8%
associate-*l/95.0%
*-lft-identity95.0%
Simplified95.0%
if 9.5e20 < z Initial program 79.0%
associate-*l/86.4%
associate-*r/90.0%
Simplified90.0%
Taylor expanded in x around 0 98.0%
sub-neg98.0%
+-commutative98.0%
distribute-lft-in90.0%
associate-+r+90.0%
distribute-rgt-in90.0%
associate-*l/90.0%
*-lft-identity90.0%
+-commutative90.0%
distribute-rgt-neg-out90.0%
sub-neg90.0%
associate-*r/86.4%
div-sub94.4%
Simplified94.4%
Taylor expanded in z around inf 80.1%
associate-*r/80.1%
mul-1-neg80.1%
distribute-rgt-neg-out80.1%
associate-*r/83.6%
Simplified83.6%
Final simplification89.6%
NOTE: y should be positive before calling this function (FPCore (x y z) :precision binary64 (if (or (<= x -1.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 <= -1.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 <= (-1.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 <= -1.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 <= -1.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 <= -1.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 <= -1.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, -1.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 -1.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 < -1.5 or 4 < x Initial program 92.1%
associate-*l/88.7%
associate-*r/94.4%
Simplified94.4%
Taylor expanded in z around 0 65.3%
associate-*r/65.3%
metadata-eval65.3%
Simplified65.3%
Taylor expanded in x around inf 64.0%
if -1.5 < x < 4Initial program 92.9%
associate-*l/99.9%
associate-*r/94.9%
Simplified94.9%
Taylor expanded in x around 0 73.4%
Final simplification68.7%
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 92.5%
associate-*l/94.3%
associate-*r/94.6%
Simplified94.6%
Taylor expanded in x around 0 39.2%
Final simplification39.2%
herbie shell --seed 2023290
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))