
(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 10 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 2e-26) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (* x (/ z y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 2e-26) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / y_m) - (x * (z / 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 (y_m <= 2d-26) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / y_m) - (x * (z / 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 (y_m <= 2e-26) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x * (z / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 2e-26: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (x * (z / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 2e-26) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(x + 4.0) / y_m) - Float64(x * Float64(z / y_m)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (y_m <= 2e-26) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / y_m) - (x * (z / y_m)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 2e-26], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 2 \cdot 10^{-26}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if y < 2.0000000000000001e-26Initial program 88.7%
associate-*l/90.7%
sub-div96.4%
Applied egg-rr96.4%
if 2.0000000000000001e-26 < y Initial program 95.7%
Taylor expanded in x around 0 94.1%
associate-*r/99.9%
Simplified99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -2.3e+240)
t_0
(if (<= x -7.8e+198)
t_1
(if (<= x -4.5e+117)
(fabs (* x (/ z y_m)))
(if (<= x -6.8e+75)
t_1
(if (or (<= x -4.5e-37) (not (<= x 6.5e-28)))
t_0
(fabs (/ 4.0 y_m)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -2.3e+240) {
tmp = t_0;
} else if (x <= -7.8e+198) {
tmp = t_1;
} else if (x <= -4.5e+117) {
tmp = fabs((x * (z / y_m)));
} else if (x <= -6.8e+75) {
tmp = t_1;
} else if ((x <= -4.5e-37) || !(x <= 6.5e-28)) {
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) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-2.3d+240)) then
tmp = t_0
else if (x <= (-7.8d+198)) then
tmp = t_1
else if (x <= (-4.5d+117)) then
tmp = abs((x * (z / y_m)))
else if (x <= (-6.8d+75)) then
tmp = t_1
else if ((x <= (-4.5d-37)) .or. (.not. (x <= 6.5d-28))) 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((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -2.3e+240) {
tmp = t_0;
} else if (x <= -7.8e+198) {
tmp = t_1;
} else if (x <= -4.5e+117) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= -6.8e+75) {
tmp = t_1;
} else if ((x <= -4.5e-37) || !(x <= 6.5e-28)) {
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((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -2.3e+240: tmp = t_0 elif x <= -7.8e+198: tmp = t_1 elif x <= -4.5e+117: tmp = math.fabs((x * (z / y_m))) elif x <= -6.8e+75: tmp = t_1 elif (x <= -4.5e-37) or not (x <= 6.5e-28): 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(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -2.3e+240) tmp = t_0; elseif (x <= -7.8e+198) tmp = t_1; elseif (x <= -4.5e+117) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= -6.8e+75) tmp = t_1; elseif ((x <= -4.5e-37) || !(x <= 6.5e-28)) 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((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -2.3e+240) tmp = t_0; elseif (x <= -7.8e+198) tmp = t_1; elseif (x <= -4.5e+117) tmp = abs((x * (z / y_m))); elseif (x <= -6.8e+75) tmp = t_1; elseif ((x <= -4.5e-37) || ~((x <= 6.5e-28))) 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[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -2.3e+240], t$95$0, If[LessEqual[x, -7.8e+198], t$95$1, If[LessEqual[x, -4.5e+117], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -6.8e+75], t$95$1, If[Or[LessEqual[x, -4.5e-37], N[Not[LessEqual[x, 6.5e-28]], $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|z \cdot \frac{x}{y\_m}\right|\\
t_1 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+240}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+117}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-37} \lor \neg \left(x \leq 6.5 \cdot 10^{-28}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -2.30000000000000001e240 or -6.80000000000000022e75 < x < -4.5000000000000004e-37 or 6.50000000000000043e-28 < x Initial program 84.9%
Simplified91.1%
Taylor expanded in z around inf 54.5%
mul-1-neg54.5%
associate-*r/63.2%
*-commutative63.2%
distribute-rgt-neg-in63.2%
Simplified63.2%
*-commutative63.2%
clear-num63.1%
un-div-inv63.2%
add-sqr-sqrt22.2%
sqrt-unprod60.2%
sqr-neg60.2%
sqrt-unprod40.9%
add-sqr-sqrt63.2%
Applied egg-rr63.2%
associate-/r/69.7%
*-commutative69.7%
Simplified69.7%
if -2.30000000000000001e240 < x < -7.8e198 or -4.5e117 < x < -6.80000000000000022e75Initial program 95.8%
Simplified95.6%
Taylor expanded in x around inf 96.1%
associate-*r/96.1%
*-commutative96.1%
associate-*r*96.1%
sub-neg96.1%
metadata-eval96.1%
distribute-lft-in96.1%
neg-mul-196.1%
metadata-eval96.1%
+-commutative96.1%
neg-mul-196.1%
associate-/l*100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 88.4%
if -7.8e198 < x < -4.5e117Initial program 74.6%
Simplified75.9%
Taylor expanded in z around inf 75.9%
associate-*r/75.9%
neg-mul-175.9%
distribute-rgt-neg-in75.9%
Simplified75.9%
distribute-rgt-neg-out75.9%
distribute-lft-neg-in75.9%
associate-*r/99.8%
*-commutative99.8%
add-sqr-sqrt99.4%
sqrt-unprod88.0%
sqr-neg88.0%
sqrt-unprod0.0%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
if -4.5000000000000004e-37 < x < 6.50000000000000043e-28Initial program 94.1%
Simplified99.9%
Taylor expanded in x around 0 79.9%
Final simplification77.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* z (/ x y_m)))) (t_1 (fabs (/ x y_m))))
(if (<= x -1.6e+245)
t_0
(if (<= x -1.05e+199)
t_1
(if (<= x -6.2e+117)
t_0
(if (<= x -1.45e+76)
t_1
(if (or (<= x -4.9e-35) (not (<= x 3e-26)))
t_0
(fabs (/ 4.0 y_m)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z * (x / y_m)));
double t_1 = fabs((x / y_m));
double tmp;
if (x <= -1.6e+245) {
tmp = t_0;
} else if (x <= -1.05e+199) {
tmp = t_1;
} else if (x <= -6.2e+117) {
tmp = t_0;
} else if (x <= -1.45e+76) {
tmp = t_1;
} else if ((x <= -4.9e-35) || !(x <= 3e-26)) {
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) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-1.6d+245)) then
tmp = t_0
else if (x <= (-1.05d+199)) then
tmp = t_1
else if (x <= (-6.2d+117)) then
tmp = t_0
else if (x <= (-1.45d+76)) then
tmp = t_1
else if ((x <= (-4.9d-35)) .or. (.not. (x <= 3d-26))) 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((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.6e+245) {
tmp = t_0;
} else if (x <= -1.05e+199) {
tmp = t_1;
} else if (x <= -6.2e+117) {
tmp = t_0;
} else if (x <= -1.45e+76) {
tmp = t_1;
} else if ((x <= -4.9e-35) || !(x <= 3e-26)) {
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((z * (x / y_m))) t_1 = math.fabs((x / y_m)) tmp = 0 if x <= -1.6e+245: tmp = t_0 elif x <= -1.05e+199: tmp = t_1 elif x <= -6.2e+117: tmp = t_0 elif x <= -1.45e+76: tmp = t_1 elif (x <= -4.9e-35) or not (x <= 3e-26): 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(z * Float64(x / y_m))) t_1 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.6e+245) tmp = t_0; elseif (x <= -1.05e+199) tmp = t_1; elseif (x <= -6.2e+117) tmp = t_0; elseif (x <= -1.45e+76) tmp = t_1; elseif ((x <= -4.9e-35) || !(x <= 3e-26)) 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((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.6e+245) tmp = t_0; elseif (x <= -1.05e+199) tmp = t_1; elseif (x <= -6.2e+117) tmp = t_0; elseif (x <= -1.45e+76) tmp = t_1; elseif ((x <= -4.9e-35) || ~((x <= 3e-26))) 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[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.6e+245], t$95$0, If[LessEqual[x, -1.05e+199], t$95$1, If[LessEqual[x, -6.2e+117], t$95$0, If[LessEqual[x, -1.45e+76], t$95$1, If[Or[LessEqual[x, -4.9e-35], N[Not[LessEqual[x, 3e-26]], $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|z \cdot \frac{x}{y\_m}\right|\\
t_1 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+245}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{+199}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{+117}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-35} \lor \neg \left(x \leq 3 \cdot 10^{-26}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\end{array}
\end{array}
if x < -1.60000000000000012e245 or -1.05e199 < x < -6.1999999999999995e117 or -1.4500000000000001e76 < x < -4.9000000000000005e-35 or 3.00000000000000012e-26 < x Initial program 84.0%
Simplified89.8%
Taylor expanded in z around inf 56.3%
mul-1-neg56.3%
associate-*r/66.3%
*-commutative66.3%
distribute-rgt-neg-in66.3%
Simplified66.3%
*-commutative66.3%
clear-num66.1%
un-div-inv66.3%
add-sqr-sqrt28.8%
sqrt-unprod62.5%
sqr-neg62.5%
sqrt-unprod37.4%
add-sqr-sqrt66.3%
Applied egg-rr66.3%
associate-/r/72.2%
*-commutative72.2%
Simplified72.2%
if -1.60000000000000012e245 < x < -1.05e199 or -6.1999999999999995e117 < x < -1.4500000000000001e76Initial program 95.8%
Simplified95.6%
Taylor expanded in x around inf 96.1%
associate-*r/96.1%
*-commutative96.1%
associate-*r*96.1%
sub-neg96.1%
metadata-eval96.1%
distribute-lft-in96.1%
neg-mul-196.1%
metadata-eval96.1%
+-commutative96.1%
neg-mul-196.1%
associate-/l*100.0%
neg-mul-1100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 88.4%
if -4.9000000000000005e-35 < x < 3.00000000000000012e-26Initial program 94.1%
Simplified99.9%
Taylor expanded in x around 0 79.9%
Final simplification77.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= z -1.2e+52)
(fabs (* x (/ z y_m)))
(if (<= z 1.42e+75)
(fabs (/ (- -4.0 x) y_m))
(if (<= z 3.9e+175)
(fabs (* z (/ x y_m)))
(if (<= z 1e+192)
(fabs (/ 4.0 y_m))
(if (<= z 1.7e+288)
(fabs (/ (* x z) y_m))
(fabs (/ z (/ y_m x)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.2e+52) {
tmp = fabs((x * (z / y_m)));
} else if (z <= 1.42e+75) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (z <= 3.9e+175) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1e+192) {
tmp = fabs((4.0 / y_m));
} else if (z <= 1.7e+288) {
tmp = fabs(((x * z) / y_m));
} else {
tmp = fabs((z / (y_m / x)));
}
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.2d+52)) then
tmp = abs((x * (z / y_m)))
else if (z <= 1.42d+75) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (z <= 3.9d+175) then
tmp = abs((z * (x / y_m)))
else if (z <= 1d+192) then
tmp = abs((4.0d0 / y_m))
else if (z <= 1.7d+288) then
tmp = abs(((x * z) / y_m))
else
tmp = abs((z / (y_m / x)))
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.2e+52) {
tmp = Math.abs((x * (z / y_m)));
} else if (z <= 1.42e+75) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (z <= 3.9e+175) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1e+192) {
tmp = Math.abs((4.0 / y_m));
} else if (z <= 1.7e+288) {
tmp = Math.abs(((x * z) / y_m));
} else {
tmp = Math.abs((z / (y_m / x)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.2e+52: tmp = math.fabs((x * (z / y_m))) elif z <= 1.42e+75: tmp = math.fabs(((-4.0 - x) / y_m)) elif z <= 3.9e+175: tmp = math.fabs((z * (x / y_m))) elif z <= 1e+192: tmp = math.fabs((4.0 / y_m)) elif z <= 1.7e+288: tmp = math.fabs(((x * z) / y_m)) else: tmp = math.fabs((z / (y_m / x))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.2e+52) tmp = abs(Float64(x * Float64(z / y_m))); elseif (z <= 1.42e+75) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (z <= 3.9e+175) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1e+192) tmp = abs(Float64(4.0 / y_m)); elseif (z <= 1.7e+288) tmp = abs(Float64(Float64(x * z) / y_m)); else tmp = abs(Float64(z / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -1.2e+52) tmp = abs((x * (z / y_m))); elseif (z <= 1.42e+75) tmp = abs(((-4.0 - x) / y_m)); elseif (z <= 3.9e+175) tmp = abs((z * (x / y_m))); elseif (z <= 1e+192) tmp = abs((4.0 / y_m)); elseif (z <= 1.7e+288) tmp = abs(((x * z) / y_m)); else tmp = abs((z / (y_m / x))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.2e+52], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.42e+75], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3.9e+175], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1e+192], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.7e+288], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+52}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{+75}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+175}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 10^{+192}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+288}:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\end{array}
\end{array}
if z < -1.2e52Initial program 90.3%
Simplified86.6%
Taylor expanded in z around inf 67.4%
associate-*r/67.4%
neg-mul-167.4%
distribute-rgt-neg-in67.4%
Simplified67.4%
distribute-rgt-neg-out67.4%
distribute-lft-neg-in67.4%
associate-*r/77.7%
*-commutative77.7%
add-sqr-sqrt35.5%
sqrt-unprod60.1%
sqr-neg60.1%
sqrt-unprod42.0%
add-sqr-sqrt77.7%
Applied egg-rr77.7%
if -1.2e52 < z < 1.42e75Initial program 93.3%
Simplified99.8%
Taylor expanded in z around 0 93.9%
+-commutative93.9%
rem-square-sqrt42.3%
fabs-sqr42.3%
rem-square-sqrt93.9%
fabs-neg93.9%
distribute-neg-frac93.9%
distribute-neg-in93.9%
metadata-eval93.9%
+-commutative93.9%
sub-neg93.9%
rem-square-sqrt51.1%
fabs-sqr51.1%
rem-square-sqrt93.9%
Simplified93.9%
if 1.42e75 < z < 3.89999999999999972e175Initial program 79.9%
Simplified89.6%
Taylor expanded in z around inf 65.6%
mul-1-neg65.6%
associate-*r/71.1%
*-commutative71.1%
distribute-rgt-neg-in71.1%
Simplified71.1%
*-commutative71.1%
clear-num71.0%
un-div-inv71.3%
add-sqr-sqrt12.2%
sqrt-unprod55.4%
sqr-neg55.4%
sqrt-unprod58.8%
add-sqr-sqrt71.3%
Applied egg-rr71.3%
associate-/r/75.6%
*-commutative75.6%
Simplified75.6%
if 3.89999999999999972e175 < z < 1.00000000000000004e192Initial program 100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
if 1.00000000000000004e192 < z < 1.70000000000000009e288Initial program 71.2%
Simplified99.7%
Taylor expanded in z around inf 76.7%
mul-1-neg76.7%
associate-*r/72.7%
*-commutative72.7%
distribute-rgt-neg-in72.7%
Simplified72.7%
*-commutative72.7%
add-sqr-sqrt47.7%
sqrt-unprod67.9%
sqr-neg67.9%
sqrt-unprod24.9%
add-sqr-sqrt72.7%
associate-/l*76.7%
Applied egg-rr76.7%
if 1.70000000000000009e288 < z Initial program 99.5%
Simplified89.2%
Taylor expanded in z around inf 89.2%
mul-1-neg89.2%
associate-*r/89.4%
*-commutative89.4%
distribute-rgt-neg-in89.4%
Simplified89.4%
*-commutative89.4%
clear-num89.1%
un-div-inv89.1%
add-sqr-sqrt55.8%
sqrt-unprod67.3%
sqr-neg67.3%
sqrt-unprod33.2%
add-sqr-sqrt89.1%
Applied egg-rr89.1%
associate-/r/99.5%
*-commutative99.5%
Simplified99.5%
clear-num99.5%
div-inv100.0%
Applied egg-rr100.0%
Final simplification88.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -530000000.0) (not (<= x 1.75e-26))) (fabs (* x (/ (- 1.0 z) y_m))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -530000000.0) || !(x <= 1.75e-26)) {
tmp = fabs((x * ((1.0 - z) / y_m)));
} else {
tmp = fabs(((-4.0 - 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 <= (-530000000.0d0)) .or. (.not. (x <= 1.75d-26))) then
tmp = abs((x * ((1.0d0 - z) / y_m)))
else
tmp = abs((((-4.0d0) - 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 <= -530000000.0) || !(x <= 1.75e-26)) {
tmp = Math.abs((x * ((1.0 - z) / y_m)));
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -530000000.0) or not (x <= 1.75e-26): tmp = math.fabs((x * ((1.0 - z) / y_m))) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -530000000.0) || !(x <= 1.75e-26)) tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((x <= -530000000.0) || ~((x <= 1.75e-26))) tmp = abs((x * ((1.0 - z) / y_m))); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[x, -530000000.0], N[Not[LessEqual[x, 1.75e-26]], $MachinePrecision]], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -530000000 \lor \neg \left(x \leq 1.75 \cdot 10^{-26}\right):\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if x < -5.3e8 or 1.74999999999999992e-26 < x Initial program 85.6%
Simplified90.5%
Taylor expanded in x around inf 89.1%
mul-1-neg89.1%
associate-/l*98.3%
distribute-rgt-neg-in98.3%
mul-1-neg98.3%
associate-*r/98.3%
sub-neg98.3%
metadata-eval98.3%
distribute-lft-in98.3%
neg-mul-198.3%
metadata-eval98.3%
+-commutative98.3%
unsub-neg98.3%
Simplified98.3%
if -5.3e8 < x < 1.74999999999999992e-26Initial program 94.3%
Simplified99.8%
Taylor expanded in z around 0 78.9%
+-commutative78.9%
rem-square-sqrt36.6%
fabs-sqr36.6%
rem-square-sqrt78.9%
fabs-neg78.9%
distribute-neg-frac78.9%
distribute-neg-in78.9%
metadata-eval78.9%
+-commutative78.9%
sub-neg78.9%
rem-square-sqrt41.8%
fabs-sqr41.8%
rem-square-sqrt78.9%
Simplified78.9%
Final simplification87.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -530000000.0)
(fabs (* (- 1.0 z) (/ x y_m)))
(if (<= x 2.6e-24)
(fabs (- (/ -4.0 y_m) (/ x y_m)))
(fabs (* x (/ (- 1.0 z) y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -530000000.0) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else if (x <= 2.6e-24) {
tmp = fabs(((-4.0 / y_m) - (x / y_m)));
} else {
tmp = fabs((x * ((1.0 - z) / 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 <= (-530000000.0d0)) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else if (x <= 2.6d-24) then
tmp = abs((((-4.0d0) / y_m) - (x / y_m)))
else
tmp = abs((x * ((1.0d0 - z) / 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 <= -530000000.0) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else if (x <= 2.6e-24) {
tmp = Math.abs(((-4.0 / y_m) - (x / y_m)));
} else {
tmp = Math.abs((x * ((1.0 - z) / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -530000000.0: tmp = math.fabs(((1.0 - z) * (x / y_m))) elif x <= 2.6e-24: tmp = math.fabs(((-4.0 / y_m) - (x / y_m))) else: tmp = math.fabs((x * ((1.0 - z) / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -530000000.0) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); elseif (x <= 2.6e-24) tmp = abs(Float64(Float64(-4.0 / y_m) - Float64(x / y_m))); else tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -530000000.0) tmp = abs(((1.0 - z) * (x / y_m))); elseif (x <= 2.6e-24) tmp = abs(((-4.0 / y_m) - (x / y_m))); else tmp = abs((x * ((1.0 - z) / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -530000000.0], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.6e-24], N[Abs[N[(N[(-4.0 / y$95$m), $MachinePrecision] - N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -530000000:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-24}:\\
\;\;\;\;\left|\frac{-4}{y\_m} - \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y\_m}\right|\\
\end{array}
\end{array}
if x < -5.3e8Initial program 84.8%
Simplified92.6%
Taylor expanded in x around inf 92.8%
associate-*r/92.8%
*-commutative92.8%
associate-*r*92.8%
sub-neg92.8%
metadata-eval92.8%
distribute-lft-in92.8%
neg-mul-192.8%
metadata-eval92.8%
+-commutative92.8%
neg-mul-192.8%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -5.3e8 < x < 2.6e-24Initial program 94.3%
Simplified99.8%
Taylor expanded in z around 0 78.9%
+-commutative78.9%
rem-square-sqrt36.6%
fabs-sqr36.6%
rem-square-sqrt78.9%
fabs-neg78.9%
distribute-neg-frac78.9%
distribute-neg-in78.9%
metadata-eval78.9%
+-commutative78.9%
sub-neg78.9%
rem-square-sqrt41.8%
fabs-sqr41.8%
rem-square-sqrt78.9%
Simplified78.9%
div-sub78.9%
Applied egg-rr78.9%
if 2.6e-24 < x Initial program 86.2%
Simplified88.6%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
associate-/l*96.9%
distribute-rgt-neg-in96.9%
mul-1-neg96.9%
associate-*r/96.9%
sub-neg96.9%
metadata-eval96.9%
distribute-lft-in96.9%
neg-mul-196.9%
metadata-eval96.9%
+-commutative96.9%
unsub-neg96.9%
Simplified96.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -530000000.0)
(fabs (* (- 1.0 z) (/ x y_m)))
(if (<= x 4.3e-26)
(fabs (/ (- -4.0 x) y_m))
(fabs (* x (/ (- 1.0 z) y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -530000000.0) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else if (x <= 4.3e-26) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x * ((1.0 - z) / 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 <= (-530000000.0d0)) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else if (x <= 4.3d-26) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x * ((1.0d0 - z) / 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 <= -530000000.0) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else if (x <= 4.3e-26) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x * ((1.0 - z) / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -530000000.0: tmp = math.fabs(((1.0 - z) * (x / y_m))) elif x <= 4.3e-26: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x * ((1.0 - z) / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -530000000.0) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); elseif (x <= 4.3e-26) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -530000000.0) tmp = abs(((1.0 - z) * (x / y_m))); elseif (x <= 4.3e-26) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x * ((1.0 - z) / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -530000000.0], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.3e-26], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -530000000:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-26}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y\_m}\right|\\
\end{array}
\end{array}
if x < -5.3e8Initial program 84.8%
Simplified92.6%
Taylor expanded in x around inf 92.8%
associate-*r/92.8%
*-commutative92.8%
associate-*r*92.8%
sub-neg92.8%
metadata-eval92.8%
distribute-lft-in92.8%
neg-mul-192.8%
metadata-eval92.8%
+-commutative92.8%
neg-mul-192.8%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -5.3e8 < x < 4.29999999999999988e-26Initial program 94.3%
Simplified99.8%
Taylor expanded in z around 0 78.9%
+-commutative78.9%
rem-square-sqrt36.6%
fabs-sqr36.6%
rem-square-sqrt78.9%
fabs-neg78.9%
distribute-neg-frac78.9%
distribute-neg-in78.9%
metadata-eval78.9%
+-commutative78.9%
sub-neg78.9%
rem-square-sqrt41.8%
fabs-sqr41.8%
rem-square-sqrt78.9%
Simplified78.9%
if 4.29999999999999988e-26 < x Initial program 86.2%
Simplified88.6%
Taylor expanded in x around inf 85.8%
mul-1-neg85.8%
associate-/l*96.9%
distribute-rgt-neg-in96.9%
mul-1-neg96.9%
associate-*r/96.9%
sub-neg96.9%
metadata-eval96.9%
distribute-lft-in96.9%
neg-mul-196.9%
metadata-eval96.9%
+-commutative96.9%
unsub-neg96.9%
Simplified96.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 3.7e+39) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (* x (/ (- 1.0 z) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 3.7e+39) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((x * ((1.0 - z) / 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 <= 3.7d+39) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((x * ((1.0d0 - z) / 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 <= 3.7e+39) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((x * ((1.0 - z) / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 3.7e+39: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((x * ((1.0 - z) / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 3.7e+39) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 3.7e+39) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((x * ((1.0 - z) / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 3.7e+39], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.7 \cdot 10^{+39}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y\_m}\right|\\
\end{array}
\end{array}
if x < 3.70000000000000012e39Initial program 92.0%
associate-*l/95.6%
sub-div98.0%
Applied egg-rr98.0%
if 3.70000000000000012e39 < x Initial program 84.4%
Simplified87.1%
Taylor expanded in x around inf 87.2%
mul-1-neg87.2%
associate-/l*99.8%
distribute-rgt-neg-in99.8%
mul-1-neg99.8%
associate-*r/99.8%
sub-neg99.8%
metadata-eval99.8%
distribute-lft-in99.8%
neg-mul-199.8%
metadata-eval99.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
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 85.4%
Simplified90.4%
Taylor expanded in x around inf 88.8%
associate-*r/88.8%
*-commutative88.8%
associate-*r*88.8%
sub-neg88.8%
metadata-eval88.8%
distribute-lft-in88.8%
neg-mul-188.8%
metadata-eval88.8%
+-commutative88.8%
neg-mul-188.8%
associate-/l*98.0%
neg-mul-198.0%
unsub-neg98.0%
Simplified98.0%
Taylor expanded in z around 0 61.7%
if -1.55000000000000004 < x < 4Initial program 94.4%
Simplified99.9%
Taylor expanded in x around 0 77.3%
Final simplification70.6%
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 90.5%
Simplified95.8%
Taylor expanded in x around 0 46.1%
herbie shell --seed 2024106
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))