
(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}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 1e-87) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 1e-87) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 1e-87) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 1e-87], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 10^{-87}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 1.00000000000000002e-87Initial program 90.7%
associate-*l/92.7%
sub-div97.3%
Applied egg-rr97.3%
if 1.00000000000000002e-87 < y Initial program 93.1%
fabs-sub93.1%
associate-*l/94.2%
associate-*r/99.8%
fma-neg99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification98.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (/ z (/ y_m x)))))
(if (<= x -2.95e+60)
t_0
(if (<= x -2.2e+38)
t_1
(if (<= x -1.55)
t_0
(if (<= x 4.0)
(fabs (/ 4.0 y_m))
(if (or (<= x 7.8e+74) (not (<= x 2.9e+113))) t_0 t_1)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((z / (y_m / x)));
double tmp;
if (x <= -2.95e+60) {
tmp = t_0;
} else if (x <= -2.2e+38) {
tmp = t_1;
} else if (x <= -1.55) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = fabs((4.0 / y_m));
} else if ((x <= 7.8e+74) || !(x <= 2.9e+113)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((x / y_m))
t_1 = abs((z / (y_m / x)))
if (x <= (-2.95d+60)) then
tmp = t_0
else if (x <= (-2.2d+38)) then
tmp = t_1
else if (x <= (-1.55d0)) then
tmp = t_0
else if (x <= 4.0d0) then
tmp = abs((4.0d0 / y_m))
else if ((x <= 7.8d+74) .or. (.not. (x <= 2.9d+113))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double t_1 = Math.abs((z / (y_m / x)));
double tmp;
if (x <= -2.95e+60) {
tmp = t_0;
} else if (x <= -2.2e+38) {
tmp = t_1;
} else if (x <= -1.55) {
tmp = t_0;
} else if (x <= 4.0) {
tmp = Math.abs((4.0 / y_m));
} else if ((x <= 7.8e+74) || !(x <= 2.9e+113)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((z / (y_m / x))) tmp = 0 if x <= -2.95e+60: tmp = t_0 elif x <= -2.2e+38: tmp = t_1 elif x <= -1.55: tmp = t_0 elif x <= 4.0: tmp = math.fabs((4.0 / y_m)) elif (x <= 7.8e+74) or not (x <= 2.9e+113): tmp = t_0 else: tmp = t_1 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(z / Float64(y_m / x))) tmp = 0.0 if (x <= -2.95e+60) tmp = t_0; elseif (x <= -2.2e+38) tmp = t_1; elseif (x <= -1.55) tmp = t_0; elseif (x <= 4.0) tmp = abs(Float64(4.0 / y_m)); elseif ((x <= 7.8e+74) || !(x <= 2.9e+113)) tmp = t_0; else tmp = t_1; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); t_1 = abs((z / (y_m / x))); tmp = 0.0; if (x <= -2.95e+60) tmp = t_0; elseif (x <= -2.2e+38) tmp = t_1; elseif (x <= -1.55) tmp = t_0; elseif (x <= 4.0) tmp = abs((4.0 / y_m)); elseif ((x <= 7.8e+74) || ~((x <= 2.9e+113))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.95e+60], t$95$0, If[LessEqual[x, -2.2e+38], t$95$1, If[LessEqual[x, -1.55], t$95$0, If[LessEqual[x, 4.0], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 7.8e+74], N[Not[LessEqual[x, 2.9e+113]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
t_1 := \left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{if}\;x \leq -2.95 \cdot 10^{+60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.55:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+74} \lor \neg \left(x \leq 2.9 \cdot 10^{+113}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.9500000000000001e60 or -2.20000000000000006e38 < x < -1.55000000000000004 or 4 < x < 7.80000000000000015e74 or 2.89999999999999984e113 < x Initial program 86.3%
Simplified94.6%
Taylor expanded in z around 0 74.9%
distribute-lft-in74.9%
metadata-eval74.9%
neg-mul-174.9%
sub-neg74.9%
Simplified74.9%
Taylor expanded in x around inf 74.3%
if -2.9500000000000001e60 < x < -2.20000000000000006e38 or 7.80000000000000015e74 < x < 2.89999999999999984e113Initial program 99.8%
Simplified74.0%
Taylor expanded in z around inf 60.7%
associate-*r/60.7%
neg-mul-160.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
distribute-rgt-neg-out60.7%
*-commutative60.7%
distribute-rgt-neg-in60.7%
associate-*l/86.4%
add-sqr-sqrt42.9%
sqrt-unprod86.4%
sqr-neg86.4%
sqrt-unprod43.4%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
Taylor expanded in z around 0 60.7%
associate-*r/86.4%
*-commutative86.4%
associate-/r/93.0%
Simplified93.0%
if -1.55000000000000004 < x < 4Initial program 94.9%
Simplified99.9%
Taylor expanded in x around 0 74.7%
Final simplification75.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -2.75e+70)
(fabs (* x (/ z y_m)))
(if (<= z -1.42e+60)
(fabs (/ 4.0 y_m))
(if (<= z -30500000000.0)
(fabs (/ z (/ y_m x)))
(if (<= z 4.1e+135)
(fabs (/ (- -4.0 x) y_m))
(fabs (/ x (/ y_m z))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -2.75e+70) {
tmp = fabs((x * (z / y_m)));
} else if (z <= -1.42e+60) {
tmp = fabs((4.0 / y_m));
} else if (z <= -30500000000.0) {
tmp = fabs((z / (y_m / x)));
} else if (z <= 4.1e+135) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x / (y_m / z)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-2.75d+70)) then
tmp = abs((x * (z / y_m)))
else if (z <= (-1.42d+60)) then
tmp = abs((4.0d0 / y_m))
else if (z <= (-30500000000.0d0)) then
tmp = abs((z / (y_m / x)))
else if (z <= 4.1d+135) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x / (y_m / z)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -2.75e+70) {
tmp = Math.abs((x * (z / y_m)));
} else if (z <= -1.42e+60) {
tmp = Math.abs((4.0 / y_m));
} else if (z <= -30500000000.0) {
tmp = Math.abs((z / (y_m / x)));
} else if (z <= 4.1e+135) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x / (y_m / z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -2.75e+70: tmp = math.fabs((x * (z / y_m))) elif z <= -1.42e+60: tmp = math.fabs((4.0 / y_m)) elif z <= -30500000000.0: tmp = math.fabs((z / (y_m / x))) elif z <= 4.1e+135: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x / (y_m / z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -2.75e+70) tmp = abs(Float64(x * Float64(z / y_m))); elseif (z <= -1.42e+60) tmp = abs(Float64(4.0 / y_m)); elseif (z <= -30500000000.0) tmp = abs(Float64(z / Float64(y_m / x))); elseif (z <= 4.1e+135) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -2.75e+70) tmp = abs((x * (z / y_m))); elseif (z <= -1.42e+60) tmp = abs((4.0 / y_m)); elseif (z <= -30500000000.0) tmp = abs((z / (y_m / x))); elseif (z <= 4.1e+135) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x / (y_m / z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -2.75e+70], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -1.42e+60], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -30500000000.0], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.1e+135], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.75 \cdot 10^{+70}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{+60}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;z \leq -30500000000:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+135}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if z < -2.74999999999999993e70Initial program 94.0%
Simplified93.9%
Taylor expanded in z around inf 76.8%
associate-*r/76.8%
neg-mul-176.8%
distribute-rgt-neg-in76.8%
Simplified76.8%
distribute-rgt-neg-out76.8%
*-commutative76.8%
distribute-rgt-neg-in76.8%
associate-*l/80.6%
add-sqr-sqrt52.5%
sqrt-unprod75.3%
sqr-neg75.3%
sqrt-unprod27.9%
add-sqr-sqrt80.6%
Applied egg-rr80.6%
if -2.74999999999999993e70 < z < -1.42000000000000001e60Initial program 99.7%
Simplified99.7%
Taylor expanded in x around 0 89.0%
if -1.42000000000000001e60 < z < -3.05e10Initial program 99.5%
Simplified99.5%
Taylor expanded in z around inf 78.2%
associate-*r/78.2%
neg-mul-178.2%
distribute-rgt-neg-in78.2%
Simplified78.2%
distribute-rgt-neg-out78.2%
*-commutative78.2%
distribute-rgt-neg-in78.2%
associate-*l/78.1%
add-sqr-sqrt30.2%
sqrt-unprod61.6%
sqr-neg61.6%
sqrt-unprod47.7%
add-sqr-sqrt78.1%
Applied egg-rr78.1%
Taylor expanded in z around 0 78.2%
associate-*r/78.1%
*-commutative78.1%
associate-/r/78.2%
Simplified78.2%
if -3.05e10 < z < 4.1e135Initial program 91.4%
Simplified99.8%
Taylor expanded in z around 0 94.7%
+-commutative94.7%
rem-square-sqrt40.1%
fabs-sqr40.1%
rem-square-sqrt94.7%
fabs-neg94.7%
distribute-neg-frac94.7%
distribute-neg-in94.7%
metadata-eval94.7%
+-commutative94.7%
sub-neg94.7%
rem-square-sqrt54.0%
fabs-sqr54.0%
rem-square-sqrt94.7%
Simplified94.7%
if 4.1e135 < z Initial program 83.6%
Simplified78.1%
Taylor expanded in z around inf 72.1%
mul-1-neg72.1%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt-neg-in84.3%
Simplified84.3%
*-commutative84.3%
clear-num84.3%
un-div-inv84.9%
add-sqr-sqrt48.0%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod36.6%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
Final simplification90.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -8.5e+70)
(fabs (* x (/ z y_m)))
(if (<= z -3.2e+49)
(fabs (/ 4.0 y_m))
(if (<= z -27.0)
(fabs (* (- 1.0 z) (/ x y_m)))
(if (<= z 4.1e+135)
(fabs (/ (- -4.0 x) y_m))
(fabs (/ x (/ y_m z))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -8.5e+70) {
tmp = fabs((x * (z / y_m)));
} else if (z <= -3.2e+49) {
tmp = fabs((4.0 / y_m));
} else if (z <= -27.0) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else if (z <= 4.1e+135) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x / (y_m / z)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-8.5d+70)) then
tmp = abs((x * (z / y_m)))
else if (z <= (-3.2d+49)) then
tmp = abs((4.0d0 / y_m))
else if (z <= (-27.0d0)) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else if (z <= 4.1d+135) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x / (y_m / z)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -8.5e+70) {
tmp = Math.abs((x * (z / y_m)));
} else if (z <= -3.2e+49) {
tmp = Math.abs((4.0 / y_m));
} else if (z <= -27.0) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else if (z <= 4.1e+135) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x / (y_m / z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -8.5e+70: tmp = math.fabs((x * (z / y_m))) elif z <= -3.2e+49: tmp = math.fabs((4.0 / y_m)) elif z <= -27.0: tmp = math.fabs(((1.0 - z) * (x / y_m))) elif z <= 4.1e+135: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x / (y_m / z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -8.5e+70) tmp = abs(Float64(x * Float64(z / y_m))); elseif (z <= -3.2e+49) tmp = abs(Float64(4.0 / y_m)); elseif (z <= -27.0) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); elseif (z <= 4.1e+135) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -8.5e+70) tmp = abs((x * (z / y_m))); elseif (z <= -3.2e+49) tmp = abs((4.0 / y_m)); elseif (z <= -27.0) tmp = abs(((1.0 - z) * (x / y_m))); elseif (z <= 4.1e+135) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x / (y_m / z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -8.5e+70], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -3.2e+49], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -27.0], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.1e+135], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+70}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+49}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;z \leq -27:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+135}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if z < -8.4999999999999996e70Initial program 94.0%
Simplified93.9%
Taylor expanded in z around inf 76.8%
associate-*r/76.8%
neg-mul-176.8%
distribute-rgt-neg-in76.8%
Simplified76.8%
distribute-rgt-neg-out76.8%
*-commutative76.8%
distribute-rgt-neg-in76.8%
associate-*l/80.6%
add-sqr-sqrt52.5%
sqrt-unprod75.3%
sqr-neg75.3%
sqrt-unprod27.9%
add-sqr-sqrt80.6%
Applied egg-rr80.6%
if -8.4999999999999996e70 < z < -3.20000000000000014e49Initial program 99.7%
Simplified99.7%
Taylor expanded in x around 0 89.0%
if -3.20000000000000014e49 < z < -27Initial program 99.7%
Simplified99.7%
Taylor expanded in x around inf 79.6%
associate-*r/79.6%
*-commutative79.6%
associate-*r*79.6%
sub-neg79.6%
metadata-eval79.6%
distribute-lft-in79.6%
neg-mul-179.6%
metadata-eval79.6%
+-commutative79.6%
neg-mul-179.6%
associate-/l*79.4%
neg-mul-179.4%
unsub-neg79.4%
Simplified79.4%
if -27 < z < 4.1e135Initial program 91.2%
Simplified99.8%
Taylor expanded in z around 0 96.2%
+-commutative96.2%
rem-square-sqrt40.4%
fabs-sqr40.4%
rem-square-sqrt96.2%
fabs-neg96.2%
distribute-neg-frac96.2%
distribute-neg-in96.2%
metadata-eval96.2%
+-commutative96.2%
sub-neg96.2%
rem-square-sqrt55.2%
fabs-sqr55.2%
rem-square-sqrt96.2%
Simplified96.2%
if 4.1e135 < z Initial program 83.6%
Simplified78.1%
Taylor expanded in z around inf 72.1%
mul-1-neg72.1%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt-neg-in84.3%
Simplified84.3%
*-commutative84.3%
clear-num84.3%
un-div-inv84.9%
add-sqr-sqrt48.0%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod36.6%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
Final simplification91.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -1.05e+72)
(fabs (* x (/ z y_m)))
(if (<= z -4e+60)
(fabs (/ 4.0 y_m))
(if (<= z -39.0)
(fabs (/ (- 1.0 z) (/ y_m x)))
(if (<= z 4.1e+135)
(fabs (/ (- -4.0 x) y_m))
(fabs (/ x (/ y_m z))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.05e+72) {
tmp = fabs((x * (z / y_m)));
} else if (z <= -4e+60) {
tmp = fabs((4.0 / y_m));
} else if (z <= -39.0) {
tmp = fabs(((1.0 - z) / (y_m / x)));
} else if (z <= 4.1e+135) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x / (y_m / z)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.05d+72)) then
tmp = abs((x * (z / y_m)))
else if (z <= (-4d+60)) then
tmp = abs((4.0d0 / y_m))
else if (z <= (-39.0d0)) then
tmp = abs(((1.0d0 - z) / (y_m / x)))
else if (z <= 4.1d+135) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x / (y_m / z)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.05e+72) {
tmp = Math.abs((x * (z / y_m)));
} else if (z <= -4e+60) {
tmp = Math.abs((4.0 / y_m));
} else if (z <= -39.0) {
tmp = Math.abs(((1.0 - z) / (y_m / x)));
} else if (z <= 4.1e+135) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x / (y_m / z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.05e+72: tmp = math.fabs((x * (z / y_m))) elif z <= -4e+60: tmp = math.fabs((4.0 / y_m)) elif z <= -39.0: tmp = math.fabs(((1.0 - z) / (y_m / x))) elif z <= 4.1e+135: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x / (y_m / z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.05e+72) tmp = abs(Float64(x * Float64(z / y_m))); elseif (z <= -4e+60) tmp = abs(Float64(4.0 / y_m)); elseif (z <= -39.0) tmp = abs(Float64(Float64(1.0 - z) / Float64(y_m / x))); elseif (z <= 4.1e+135) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -1.05e+72) tmp = abs((x * (z / y_m))); elseif (z <= -4e+60) tmp = abs((4.0 / y_m)); elseif (z <= -39.0) tmp = abs(((1.0 - z) / (y_m / x))); elseif (z <= 4.1e+135) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x / (y_m / z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.05e+72], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -4e+60], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, -39.0], N[Abs[N[(N[(1.0 - z), $MachinePrecision] / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 4.1e+135], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+72}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+60}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;z \leq -39:\\
\;\;\;\;\left|\frac{1 - z}{\frac{y\_m}{x}}\right|\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+135}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if z < -1.0500000000000001e72Initial program 94.0%
Simplified93.9%
Taylor expanded in z around inf 76.8%
associate-*r/76.8%
neg-mul-176.8%
distribute-rgt-neg-in76.8%
Simplified76.8%
distribute-rgt-neg-out76.8%
*-commutative76.8%
distribute-rgt-neg-in76.8%
associate-*l/80.6%
add-sqr-sqrt52.5%
sqrt-unprod75.3%
sqr-neg75.3%
sqrt-unprod27.9%
add-sqr-sqrt80.6%
Applied egg-rr80.6%
if -1.0500000000000001e72 < z < -3.9999999999999998e60Initial program 99.7%
Simplified99.7%
Taylor expanded in x around 0 89.0%
if -3.9999999999999998e60 < z < -39Initial program 99.7%
Simplified99.7%
Taylor expanded in x around inf 79.6%
associate-*r/79.6%
*-commutative79.6%
associate-*r*79.6%
sub-neg79.6%
metadata-eval79.6%
distribute-lft-in79.6%
neg-mul-179.6%
metadata-eval79.6%
+-commutative79.6%
neg-mul-179.6%
associate-/l*79.4%
neg-mul-179.4%
unsub-neg79.4%
Simplified79.4%
clear-num79.2%
un-div-inv79.7%
Applied egg-rr79.7%
if -39 < z < 4.1e135Initial program 91.2%
Simplified99.8%
Taylor expanded in z around 0 96.2%
+-commutative96.2%
rem-square-sqrt40.4%
fabs-sqr40.4%
rem-square-sqrt96.2%
fabs-neg96.2%
distribute-neg-frac96.2%
distribute-neg-in96.2%
metadata-eval96.2%
+-commutative96.2%
sub-neg96.2%
rem-square-sqrt55.2%
fabs-sqr55.2%
rem-square-sqrt96.2%
Simplified96.2%
if 4.1e135 < z Initial program 83.6%
Simplified78.1%
Taylor expanded in z around inf 72.1%
mul-1-neg72.1%
associate-*r/84.3%
*-commutative84.3%
distribute-rgt-neg-in84.3%
Simplified84.3%
*-commutative84.3%
clear-num84.3%
un-div-inv84.9%
add-sqr-sqrt48.0%
sqrt-unprod71.8%
sqr-neg71.8%
sqrt-unprod36.6%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
Final simplification91.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -1.5e+58)
t_0
(if (<= x -1.1e+36)
(fabs (* x (/ z y_m)))
(if (or (<= x -1.55) (not (<= x 4.0))) t_0 (fabs (/ 4.0 y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -1.5e+58) {
tmp = t_0;
} else if (x <= -1.1e+36) {
tmp = fabs((x * (z / y_m)));
} else if ((x <= -1.55) || !(x <= 4.0)) {
tmp = t_0;
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-1.5d+58)) then
tmp = t_0
else if (x <= (-1.1d+36)) then
tmp = abs((x * (z / y_m)))
else if ((x <= (-1.55d0)) .or. (.not. (x <= 4.0d0))) then
tmp = t_0
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -1.5e+58) {
tmp = t_0;
} else if (x <= -1.1e+36) {
tmp = Math.abs((x * (z / y_m)));
} else if ((x <= -1.55) || !(x <= 4.0)) {
tmp = t_0;
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -1.5e+58: tmp = t_0 elif x <= -1.1e+36: tmp = math.fabs((x * (z / y_m))) elif (x <= -1.55) or not (x <= 4.0): tmp = t_0 else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.5e+58) tmp = t_0; elseif (x <= -1.1e+36) tmp = abs(Float64(x * Float64(z / y_m))); elseif ((x <= -1.55) || !(x <= 4.0)) tmp = t_0; else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -1.5e+58) tmp = t_0; elseif (x <= -1.1e+36) tmp = abs((x * (z / y_m))); elseif ((x <= -1.55) || ~((x <= 4.0))) tmp = t_0; else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.5e+58], t$95$0, If[LessEqual[x, -1.1e+36], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, -1.55], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], t$95$0, N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.5 \cdot 10^{+58}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{+36}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;x \leq -1.55 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.5000000000000001e58 or -1.1e36 < x < -1.55000000000000004 or 4 < x Initial program 87.2%
Simplified92.6%
Taylor expanded in z around 0 71.8%
distribute-lft-in71.8%
metadata-eval71.8%
neg-mul-171.8%
sub-neg71.8%
Simplified71.8%
Taylor expanded in x around inf 71.2%
if -1.5000000000000001e58 < x < -1.1e36Initial program 99.7%
Simplified85.0%
Taylor expanded in z around inf 85.0%
associate-*r/85.0%
neg-mul-185.0%
distribute-rgt-neg-in85.0%
Simplified85.0%
distribute-rgt-neg-out85.0%
*-commutative85.0%
distribute-rgt-neg-in85.0%
associate-*l/99.7%
add-sqr-sqrt100.0%
sqrt-unprod99.7%
sqr-neg99.7%
sqrt-unprod0.0%
add-sqr-sqrt99.7%
Applied egg-rr99.7%
if -1.55000000000000004 < x < 4Initial program 94.9%
Simplified99.9%
Taylor expanded in x around 0 74.7%
Final simplification73.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -6.5e+56)
t_0
(if (<= x -3.4e+28)
(fabs (/ x (/ y_m z)))
(if (or (<= x -1.55) (not (<= x 4.0))) t_0 (fabs (/ 4.0 y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -6.5e+56) {
tmp = t_0;
} else if (x <= -3.4e+28) {
tmp = fabs((x / (y_m / z)));
} else if ((x <= -1.55) || !(x <= 4.0)) {
tmp = t_0;
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs((x / y_m))
if (x <= (-6.5d+56)) then
tmp = t_0
else if (x <= (-3.4d+28)) then
tmp = abs((x / (y_m / z)))
else if ((x <= (-1.55d0)) .or. (.not. (x <= 4.0d0))) then
tmp = t_0
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((x / y_m));
double tmp;
if (x <= -6.5e+56) {
tmp = t_0;
} else if (x <= -3.4e+28) {
tmp = Math.abs((x / (y_m / z)));
} else if ((x <= -1.55) || !(x <= 4.0)) {
tmp = t_0;
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -6.5e+56: tmp = t_0 elif x <= -3.4e+28: tmp = math.fabs((x / (y_m / z))) elif (x <= -1.55) or not (x <= 4.0): tmp = t_0 else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -6.5e+56) tmp = t_0; elseif (x <= -3.4e+28) tmp = abs(Float64(x / Float64(y_m / z))); elseif ((x <= -1.55) || !(x <= 4.0)) tmp = t_0; else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x / y_m)); tmp = 0.0; if (x <= -6.5e+56) tmp = t_0; elseif (x <= -3.4e+28) tmp = abs((x / (y_m / z))); elseif ((x <= -1.55) || ~((x <= 4.0))) tmp = t_0; else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -6.5e+56], t$95$0, If[LessEqual[x, -3.4e+28], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, -1.55], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], t$95$0, N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{+56}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{+28}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{elif}\;x \leq -1.55 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -6.5000000000000001e56 or -3.4e28 < x < -1.55000000000000004 or 4 < x Initial program 87.0%
Simplified92.5%
Taylor expanded in z around 0 72.1%
distribute-lft-in72.1%
metadata-eval72.1%
neg-mul-172.1%
sub-neg72.1%
Simplified72.1%
Taylor expanded in x around inf 71.6%
if -6.5000000000000001e56 < x < -3.4e28Initial program 99.8%
Simplified88.5%
Taylor expanded in z around inf 76.8%
mul-1-neg76.8%
associate-*r/87.8%
*-commutative87.8%
distribute-rgt-neg-in87.8%
Simplified87.8%
*-commutative87.8%
clear-num87.8%
un-div-inv88.0%
add-sqr-sqrt88.0%
sqrt-unprod88.0%
sqr-neg88.0%
sqrt-unprod0.0%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
if -1.55000000000000004 < x < 4Initial program 94.9%
Simplified99.9%
Taylor expanded in x around 0 74.7%
Final simplification73.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.5) (not (<= x 3.9))) (fabs (* (- 1.0 z) (/ x y_m))) (fabs (/ (* z (- (/ 4.0 z) x)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.5) || !(x <= 3.9)) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = fabs(((z * ((4.0 / z) - x)) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.5d0)) .or. (.not. (x <= 3.9d0))) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = abs(((z * ((4.0d0 / z) - x)) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.5) || !(x <= 3.9)) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = Math.abs(((z * ((4.0 / z) - x)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.5) or not (x <= 3.9): tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = math.fabs(((z * ((4.0 / z) - x)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.5) || !(x <= 3.9)) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = abs(Float64(Float64(z * Float64(Float64(4.0 / z) - x)) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.5) || ~((x <= 3.9))) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = abs(((z * ((4.0 / z) - x)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.5], N[Not[LessEqual[x, 3.9]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(z * N[(N[(4.0 / z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \lor \neg \left(x \leq 3.9\right):\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z \cdot \left(\frac{4}{z} - x\right)}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.5 or 3.89999999999999991 < x Initial program 87.8%
Simplified92.3%
Taylor expanded in x around inf 91.8%
associate-*r/91.8%
*-commutative91.8%
associate-*r*91.8%
sub-neg91.8%
metadata-eval91.8%
distribute-lft-in91.8%
neg-mul-191.8%
metadata-eval91.8%
+-commutative91.8%
neg-mul-191.8%
associate-/l*99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
if -1.5 < x < 3.89999999999999991Initial program 94.9%
associate-*l/99.9%
sub-div99.9%
Applied egg-rr99.9%
Taylor expanded in z around -inf 99.8%
mul-1-neg99.8%
distribute-rgt-neg-in99.8%
distribute-lft-out--99.8%
mul-1-neg99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 99.0%
Final simplification99.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 1.15e+14) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (* (- 1.0 z) (/ x y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 1.15e+14) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1.15d+14) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs(((1.0d0 - z) * (x / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= 1.15e+14) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 1.15e+14: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs(((1.0 - z) * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 1.15e+14) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 1.15e+14) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs(((1.0 - z) * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 1.15e+14], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15 \cdot 10^{+14}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if x < 1.15e14Initial program 93.2%
associate-*l/96.6%
sub-div98.0%
Applied egg-rr98.0%
if 1.15e14 < x Initial program 85.1%
Simplified89.5%
Taylor expanded in x around inf 89.7%
associate-*r/89.7%
*-commutative89.7%
associate-*r*89.7%
sub-neg89.7%
metadata-eval89.7%
distribute-lft-in89.7%
neg-mul-189.7%
metadata-eval89.7%
+-commutative89.7%
neg-mul-189.7%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
Final simplification98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.55) (not (<= x 4.0))) (fabs (/ x y_m)) (fabs (/ 4.0 y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 4.0)) {
tmp = fabs((x / y_m));
} else {
tmp = fabs((4.0 / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.55d0)) .or. (.not. (x <= 4.0d0))) then
tmp = abs((x / y_m))
else
tmp = abs((4.0d0 / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((x <= -1.55) || !(x <= 4.0)) {
tmp = Math.abs((x / y_m));
} else {
tmp = Math.abs((4.0 / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -1.55) or not (x <= 4.0): tmp = math.fabs((x / y_m)) else: tmp = math.fabs((4.0 / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -1.55) || !(x <= 4.0)) tmp = abs(Float64(x / y_m)); else tmp = abs(Float64(4.0 / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -1.55) || ~((x <= 4.0))) tmp = abs((x / y_m)); else tmp = abs((4.0 / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -1.55], N[Not[LessEqual[x, 4.0]], $MachinePrecision]], N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \lor \neg \left(x \leq 4\right):\\
\;\;\;\;\left|\frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.55000000000000004 or 4 < x Initial program 87.8%
Simplified92.3%
Taylor expanded in z around 0 68.5%
distribute-lft-in68.5%
metadata-eval68.5%
neg-mul-168.5%
sub-neg68.5%
Simplified68.5%
Taylor expanded in x around inf 68.0%
if -1.55000000000000004 < x < 4Initial program 94.9%
Simplified99.9%
Taylor expanded in x around 0 74.7%
Final simplification71.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y\_m}\right|
\end{array}
Initial program 91.5%
Simplified96.2%
Taylor expanded in x around 0 41.1%
Final simplification41.1%
herbie shell --seed 2024067
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))