
(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 14 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 5e-29) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (- (/ (+ 4.0 x) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-29) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs((((4.0 + x) / y_m) - (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 (y_m <= 5d-29) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs((((4.0d0 + x) / y_m) - (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 (y_m <= 5e-29) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs((((4.0 + x) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 5e-29: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs((((4.0 + x) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 5e-29) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(4.0 + x) / y_m) - 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 (y_m <= 5e-29) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs((((4.0 + x) / y_m) - (x / (y_m / z)))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 5e-29], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 5 \cdot 10^{-29}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y_m} - \frac{x}{\frac{y_m}{z}}\right|\\
\end{array}
\end{array}
if y < 4.99999999999999986e-29Initial program 92.0%
Taylor expanded in y around 0 96.4%
if 4.99999999999999986e-29 < y Initial program 96.8%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification97.3%
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.95e+139)
t_0
(if (<= x -0.047)
t_1
(if (<= x -2e-44)
t_0
(if (<= x 7.5e-50)
(fabs (/ 4.0 y_m))
(if (or (<= x 4e+100) (not (<= x 8.2e+236))) t_0 t_1)))))))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.95e+139) {
tmp = t_0;
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -2e-44) {
tmp = t_0;
} else if (x <= 7.5e-50) {
tmp = fabs((4.0 / y_m));
} else if ((x <= 4e+100) || !(x <= 8.2e+236)) {
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((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-1.95d+139)) then
tmp = t_0
else if (x <= (-0.047d0)) then
tmp = t_1
else if (x <= (-2d-44)) then
tmp = t_0
else if (x <= 7.5d-50) then
tmp = abs((4.0d0 / y_m))
else if ((x <= 4d+100) .or. (.not. (x <= 8.2d+236))) 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((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -1.95e+139) {
tmp = t_0;
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -2e-44) {
tmp = t_0;
} else if (x <= 7.5e-50) {
tmp = Math.abs((4.0 / y_m));
} else if ((x <= 4e+100) || !(x <= 8.2e+236)) {
tmp = t_0;
} else {
tmp = t_1;
}
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.95e+139: tmp = t_0 elif x <= -0.047: tmp = t_1 elif x <= -2e-44: tmp = t_0 elif x <= 7.5e-50: tmp = math.fabs((4.0 / y_m)) elif (x <= 4e+100) or not (x <= 8.2e+236): tmp = t_0 else: tmp = t_1 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.95e+139) tmp = t_0; elseif (x <= -0.047) tmp = t_1; elseif (x <= -2e-44) tmp = t_0; elseif (x <= 7.5e-50) tmp = abs(Float64(4.0 / y_m)); elseif ((x <= 4e+100) || !(x <= 8.2e+236)) 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((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -1.95e+139) tmp = t_0; elseif (x <= -0.047) tmp = t_1; elseif (x <= -2e-44) tmp = t_0; elseif (x <= 7.5e-50) tmp = abs((4.0 / y_m)); elseif ((x <= 4e+100) || ~((x <= 8.2e+236))) 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[(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.95e+139], t$95$0, If[LessEqual[x, -0.047], t$95$1, If[LessEqual[x, -2e-44], t$95$0, If[LessEqual[x, 7.5e-50], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 4e+100], N[Not[LessEqual[x, 8.2e+236]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]
\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.95 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -0.047:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-44}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-50}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+100} \lor \neg \left(x \leq 8.2 \cdot 10^{+236}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.95000000000000003e139 or -0.047 < x < -1.99999999999999991e-44 or 7.5e-50 < x < 4.00000000000000006e100 or 8.2000000000000008e236 < x Initial program 85.8%
Taylor expanded in z around inf 57.2%
mul-1-neg57.2%
associate-*l/73.3%
distribute-rgt-neg-out73.3%
Simplified73.3%
add-sqr-sqrt39.7%
sqrt-unprod53.9%
sqr-neg53.9%
sqrt-unprod33.4%
add-sqr-sqrt73.3%
expm1-log1p-u34.4%
expm1-udef28.1%
associate-*l/23.7%
Applied egg-rr23.7%
expm1-def31.3%
expm1-log1p57.2%
associate-*l/73.3%
Simplified73.3%
if -1.95000000000000003e139 < x < -0.047 or 4.00000000000000006e100 < x < 8.2000000000000008e236Initial program 91.6%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in x around inf 67.0%
if -1.99999999999999991e-44 < x < 7.5e-50Initial program 98.5%
Taylor expanded in x around 0 86.0%
Final simplification78.5%
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 -3.1e+132)
t_0
(if (<= x -0.047)
t_1
(if (<= x -1.1e-43)
t_0
(if (<= x 2.9e-60)
(fabs (/ 4.0 y_m))
(if (<= x 8.5e+100)
(fabs (/ x (/ y_m z)))
(if (<= x 1.45e+238) t_1 t_0))))))))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 <= -3.1e+132) {
tmp = t_0;
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.1e-43) {
tmp = t_0;
} else if (x <= 2.9e-60) {
tmp = fabs((4.0 / y_m));
} else if (x <= 8.5e+100) {
tmp = fabs((x / (y_m / z)));
} else if (x <= 1.45e+238) {
tmp = t_1;
} else {
tmp = t_0;
}
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 <= (-3.1d+132)) then
tmp = t_0
else if (x <= (-0.047d0)) then
tmp = t_1
else if (x <= (-1.1d-43)) then
tmp = t_0
else if (x <= 2.9d-60) then
tmp = abs((4.0d0 / y_m))
else if (x <= 8.5d+100) then
tmp = abs((x / (y_m / z)))
else if (x <= 1.45d+238) then
tmp = t_1
else
tmp = t_0
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 <= -3.1e+132) {
tmp = t_0;
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.1e-43) {
tmp = t_0;
} else if (x <= 2.9e-60) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 8.5e+100) {
tmp = Math.abs((x / (y_m / z)));
} else if (x <= 1.45e+238) {
tmp = t_1;
} else {
tmp = t_0;
}
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 <= -3.1e+132: tmp = t_0 elif x <= -0.047: tmp = t_1 elif x <= -1.1e-43: tmp = t_0 elif x <= 2.9e-60: tmp = math.fabs((4.0 / y_m)) elif x <= 8.5e+100: tmp = math.fabs((x / (y_m / z))) elif x <= 1.45e+238: tmp = t_1 else: tmp = t_0 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 <= -3.1e+132) tmp = t_0; elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.1e-43) tmp = t_0; elseif (x <= 2.9e-60) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 8.5e+100) tmp = abs(Float64(x / Float64(y_m / z))); elseif (x <= 1.45e+238) tmp = t_1; else tmp = t_0; 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 <= -3.1e+132) tmp = t_0; elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.1e-43) tmp = t_0; elseif (x <= 2.9e-60) tmp = abs((4.0 / y_m)); elseif (x <= 8.5e+100) tmp = abs((x / (y_m / z))); elseif (x <= 1.45e+238) tmp = t_1; else tmp = t_0; 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, -3.1e+132], t$95$0, If[LessEqual[x, -0.047], t$95$1, If[LessEqual[x, -1.1e-43], t$95$0, If[LessEqual[x, 2.9e-60], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 8.5e+100], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.45e+238], t$95$1, t$95$0]]]]]]]]
\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 -3.1 \cdot 10^{+132}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -0.047:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-60}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+100}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+238}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.0999999999999998e132 or -0.047 < x < -1.09999999999999999e-43 or 1.4500000000000001e238 < x Initial program 81.0%
Taylor expanded in z around inf 50.8%
mul-1-neg50.8%
associate-*l/77.0%
distribute-rgt-neg-out77.0%
Simplified77.0%
add-sqr-sqrt38.4%
sqrt-unprod56.7%
sqr-neg56.7%
sqrt-unprod38.4%
add-sqr-sqrt77.0%
expm1-log1p-u32.7%
expm1-udef26.0%
associate-*l/19.4%
Applied egg-rr19.4%
expm1-def26.1%
expm1-log1p50.8%
associate-*l/77.0%
Simplified77.0%
if -3.0999999999999998e132 < x < -0.047 or 8.50000000000000043e100 < x < 1.4500000000000001e238Initial program 91.6%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in x around inf 67.0%
if -1.09999999999999999e-43 < x < 2.8999999999999999e-60Initial program 98.5%
Taylor expanded in x around 0 86.0%
if 2.8999999999999999e-60 < x < 8.50000000000000043e100Initial program 95.6%
Taylor expanded in z around inf 70.2%
mul-1-neg70.2%
associate-*l/65.9%
distribute-rgt-neg-out65.9%
Simplified65.9%
associate-*l/70.2%
associate-/l*70.0%
add-sqr-sqrt42.2%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod27.6%
add-sqr-sqrt70.0%
Applied egg-rr70.0%
Final simplification78.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 -6.6e+132)
(fabs (/ z (/ y_m x)))
(if (<= x -0.047)
t_1
(if (<= x -1.45e-43)
t_0
(if (<= x 1.5e-53)
(fabs (/ 4.0 y_m))
(if (<= x 4.5e+101)
(fabs (/ x (/ y_m z)))
(if (<= x 1.9e+234) t_1 t_0))))))))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 <= -6.6e+132) {
tmp = fabs((z / (y_m / x)));
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.45e-43) {
tmp = t_0;
} else if (x <= 1.5e-53) {
tmp = fabs((4.0 / y_m));
} else if (x <= 4.5e+101) {
tmp = fabs((x / (y_m / z)));
} else if (x <= 1.9e+234) {
tmp = t_1;
} else {
tmp = t_0;
}
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 <= (-6.6d+132)) then
tmp = abs((z / (y_m / x)))
else if (x <= (-0.047d0)) then
tmp = t_1
else if (x <= (-1.45d-43)) then
tmp = t_0
else if (x <= 1.5d-53) then
tmp = abs((4.0d0 / y_m))
else if (x <= 4.5d+101) then
tmp = abs((x / (y_m / z)))
else if (x <= 1.9d+234) then
tmp = t_1
else
tmp = t_0
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 <= -6.6e+132) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.45e-43) {
tmp = t_0;
} else if (x <= 1.5e-53) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 4.5e+101) {
tmp = Math.abs((x / (y_m / z)));
} else if (x <= 1.9e+234) {
tmp = t_1;
} else {
tmp = t_0;
}
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 <= -6.6e+132: tmp = math.fabs((z / (y_m / x))) elif x <= -0.047: tmp = t_1 elif x <= -1.45e-43: tmp = t_0 elif x <= 1.5e-53: tmp = math.fabs((4.0 / y_m)) elif x <= 4.5e+101: tmp = math.fabs((x / (y_m / z))) elif x <= 1.9e+234: tmp = t_1 else: tmp = t_0 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 <= -6.6e+132) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.45e-43) tmp = t_0; elseif (x <= 1.5e-53) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 4.5e+101) tmp = abs(Float64(x / Float64(y_m / z))); elseif (x <= 1.9e+234) tmp = t_1; else tmp = t_0; 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 <= -6.6e+132) tmp = abs((z / (y_m / x))); elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.45e-43) tmp = t_0; elseif (x <= 1.5e-53) tmp = abs((4.0 / y_m)); elseif (x <= 4.5e+101) tmp = abs((x / (y_m / z))); elseif (x <= 1.9e+234) tmp = t_1; else tmp = t_0; 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, -6.6e+132], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -0.047], t$95$1, If[LessEqual[x, -1.45e-43], t$95$0, If[LessEqual[x, 1.5e-53], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.5e+101], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.9e+234], t$95$1, t$95$0]]]]]]]]
\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 -6.6 \cdot 10^{+132}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;x \leq -0.047:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-53}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+101}:\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{z}}\right|\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+234}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -6.6000000000000006e132Initial program 76.3%
Taylor expanded in z around inf 50.1%
mul-1-neg50.1%
associate-*l/80.2%
distribute-rgt-neg-out80.2%
Simplified80.2%
add-sqr-sqrt41.7%
clear-num41.7%
sqrt-unprod62.9%
sqr-neg62.9%
sqrt-unprod38.4%
add-sqr-sqrt80.2%
associate-*l/80.3%
*-un-lft-identity80.3%
Applied egg-rr80.3%
if -6.6000000000000006e132 < x < -0.047 or 4.5000000000000002e101 < x < 1.9e234Initial program 91.6%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in x around inf 67.0%
if -0.047 < x < -1.4500000000000001e-43 or 1.9e234 < x Initial program 89.4%
Taylor expanded in z around inf 52.0%
mul-1-neg52.0%
associate-*l/71.1%
distribute-rgt-neg-out71.1%
Simplified71.1%
add-sqr-sqrt32.5%
sqrt-unprod45.6%
sqr-neg45.6%
sqrt-unprod38.4%
add-sqr-sqrt71.1%
expm1-log1p-u32.9%
expm1-udef24.9%
associate-*l/15.8%
Applied egg-rr15.8%
expm1-def23.6%
expm1-log1p52.0%
associate-*l/71.1%
Simplified71.1%
if -1.4500000000000001e-43 < x < 1.5000000000000001e-53Initial program 98.5%
Taylor expanded in x around 0 86.0%
if 1.5000000000000001e-53 < x < 4.5000000000000002e101Initial program 95.6%
Taylor expanded in z around inf 70.2%
mul-1-neg70.2%
associate-*l/65.9%
distribute-rgt-neg-out65.9%
Simplified65.9%
associate-*l/70.2%
associate-/l*70.0%
add-sqr-sqrt42.2%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod27.6%
add-sqr-sqrt70.0%
Applied egg-rr70.0%
Final simplification78.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.9e+140)
(fabs (/ z (/ y_m x)))
(if (<= x -0.047)
t_1
(if (<= x -1.25e-43)
t_0
(if (<= x 7e-50)
(fabs (/ 4.0 y_m))
(if (<= x 5.6e+101)
(fabs (/ (* x z) y_m))
(if (<= x 4.2e+234) t_1 t_0))))))))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.9e+140) {
tmp = fabs((z / (y_m / x)));
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.25e-43) {
tmp = t_0;
} else if (x <= 7e-50) {
tmp = fabs((4.0 / y_m));
} else if (x <= 5.6e+101) {
tmp = fabs(((x * z) / y_m));
} else if (x <= 4.2e+234) {
tmp = t_1;
} else {
tmp = t_0;
}
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.9d+140)) then
tmp = abs((z / (y_m / x)))
else if (x <= (-0.047d0)) then
tmp = t_1
else if (x <= (-1.25d-43)) then
tmp = t_0
else if (x <= 7d-50) then
tmp = abs((4.0d0 / y_m))
else if (x <= 5.6d+101) then
tmp = abs(((x * z) / y_m))
else if (x <= 4.2d+234) then
tmp = t_1
else
tmp = t_0
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.9e+140) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= -0.047) {
tmp = t_1;
} else if (x <= -1.25e-43) {
tmp = t_0;
} else if (x <= 7e-50) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 5.6e+101) {
tmp = Math.abs(((x * z) / y_m));
} else if (x <= 4.2e+234) {
tmp = t_1;
} else {
tmp = t_0;
}
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.9e+140: tmp = math.fabs((z / (y_m / x))) elif x <= -0.047: tmp = t_1 elif x <= -1.25e-43: tmp = t_0 elif x <= 7e-50: tmp = math.fabs((4.0 / y_m)) elif x <= 5.6e+101: tmp = math.fabs(((x * z) / y_m)) elif x <= 4.2e+234: tmp = t_1 else: tmp = t_0 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.9e+140) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.25e-43) tmp = t_0; elseif (x <= 7e-50) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 5.6e+101) tmp = abs(Float64(Float64(x * z) / y_m)); elseif (x <= 4.2e+234) tmp = t_1; else tmp = t_0; 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.9e+140) tmp = abs((z / (y_m / x))); elseif (x <= -0.047) tmp = t_1; elseif (x <= -1.25e-43) tmp = t_0; elseif (x <= 7e-50) tmp = abs((4.0 / y_m)); elseif (x <= 5.6e+101) tmp = abs(((x * z) / y_m)); elseif (x <= 4.2e+234) tmp = t_1; else tmp = t_0; 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.9e+140], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -0.047], t$95$1, If[LessEqual[x, -1.25e-43], t$95$0, If[LessEqual[x, 7e-50], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.6e+101], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.2e+234], t$95$1, t$95$0]]]]]]]]
\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.9 \cdot 10^{+140}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;x \leq -0.047:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-43}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-50}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+101}:\\
\;\;\;\;\left|\frac{x \cdot z}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+234}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -2.8999999999999999e140Initial program 76.3%
Taylor expanded in z around inf 50.1%
mul-1-neg50.1%
associate-*l/80.2%
distribute-rgt-neg-out80.2%
Simplified80.2%
add-sqr-sqrt41.7%
clear-num41.7%
sqrt-unprod62.9%
sqr-neg62.9%
sqrt-unprod38.4%
add-sqr-sqrt80.2%
associate-*l/80.3%
*-un-lft-identity80.3%
Applied egg-rr80.3%
if -2.8999999999999999e140 < x < -0.047 or 5.59999999999999962e101 < x < 4.2e234Initial program 91.6%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in x around inf 67.0%
if -0.047 < x < -1.25000000000000005e-43 or 4.2e234 < x Initial program 89.4%
Taylor expanded in z around inf 52.0%
mul-1-neg52.0%
associate-*l/71.1%
distribute-rgt-neg-out71.1%
Simplified71.1%
add-sqr-sqrt32.5%
sqrt-unprod45.6%
sqr-neg45.6%
sqrt-unprod38.4%
add-sqr-sqrt71.1%
expm1-log1p-u32.9%
expm1-udef24.9%
associate-*l/15.8%
Applied egg-rr15.8%
expm1-def23.6%
expm1-log1p52.0%
associate-*l/71.1%
Simplified71.1%
if -1.25000000000000005e-43 < x < 6.99999999999999993e-50Initial program 98.5%
Taylor expanded in x around 0 86.0%
if 6.99999999999999993e-50 < x < 5.59999999999999962e101Initial program 95.6%
Taylor expanded in z around inf 70.2%
mul-1-neg70.2%
associate-*l/65.9%
distribute-rgt-neg-out65.9%
Simplified65.9%
add-sqr-sqrt42.5%
sqrt-unprod48.2%
sqr-neg48.2%
sqrt-unprod23.2%
add-sqr-sqrt65.9%
associate-*l/70.2%
Applied egg-rr70.2%
Final simplification78.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* x (/ (- 1.0 z) y_m)))))
(if (<= x -8.3e+15)
t_0
(if (<= x -9.6e-31)
(fabs (/ (- -4.0 x) y_m))
(if (<= x -1.3e-43)
(fabs (* z (/ x y_m)))
(if (<= x 4e-54) (fabs (/ 4.0 y_m)) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x * ((1.0 - z) / y_m)));
double tmp;
if (x <= -8.3e+15) {
tmp = t_0;
} else if (x <= -9.6e-31) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (x <= -1.3e-43) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 4e-54) {
tmp = fabs((4.0 / y_m));
} else {
tmp = t_0;
}
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 * ((1.0d0 - z) / y_m)))
if (x <= (-8.3d+15)) then
tmp = t_0
else if (x <= (-9.6d-31)) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (x <= (-1.3d-43)) then
tmp = abs((z * (x / y_m)))
else if (x <= 4d-54) then
tmp = abs((4.0d0 / y_m))
else
tmp = t_0
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 * ((1.0 - z) / y_m)));
double tmp;
if (x <= -8.3e+15) {
tmp = t_0;
} else if (x <= -9.6e-31) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (x <= -1.3e-43) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 4e-54) {
tmp = Math.abs((4.0 / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x * ((1.0 - z) / y_m))) tmp = 0 if x <= -8.3e+15: tmp = t_0 elif x <= -9.6e-31: tmp = math.fabs(((-4.0 - x) / y_m)) elif x <= -1.3e-43: tmp = math.fabs((z * (x / y_m))) elif x <= 4e-54: tmp = math.fabs((4.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x * Float64(Float64(1.0 - z) / y_m))) tmp = 0.0 if (x <= -8.3e+15) tmp = t_0; elseif (x <= -9.6e-31) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (x <= -1.3e-43) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 4e-54) tmp = abs(Float64(4.0 / y_m)); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((x * ((1.0 - z) / y_m))); tmp = 0.0; if (x <= -8.3e+15) tmp = t_0; elseif (x <= -9.6e-31) tmp = abs(((-4.0 - x) / y_m)); elseif (x <= -1.3e-43) tmp = abs((z * (x / y_m))); elseif (x <= 4e-54) tmp = abs((4.0 / y_m)); else tmp = t_0; 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 * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -8.3e+15], t$95$0, If[LessEqual[x, -9.6e-31], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -1.3e-43], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4e-54], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{1 - z}{y_m}\right|\\
\mathbf{if}\;x \leq -8.3 \cdot 10^{+15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{-31}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{-43}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-54}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -8.3e15 or 4.0000000000000001e-54 < x Initial program 86.4%
associate-/r/92.7%
Applied egg-rr92.7%
clear-num92.7%
associate-/r/91.9%
clear-num91.9%
Applied egg-rr91.9%
Taylor expanded in x around inf 96.4%
div-sub96.4%
Simplified96.4%
if -8.3e15 < x < -9.6000000000000001e-31Initial program 99.8%
Simplified99.8%
Taylor expanded in z around 0 89.9%
associate-*r/89.9%
distribute-lft-in89.9%
metadata-eval89.9%
neg-mul-189.9%
sub-neg89.9%
Simplified89.9%
if -9.6000000000000001e-31 < x < -1.3e-43Initial program 100.0%
Taylor expanded in z around inf 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
add-sqr-sqrt79.4%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod20.0%
add-sqr-sqrt100.0%
expm1-log1p-u77.8%
expm1-udef51.6%
associate-*l/51.6%
Applied egg-rr51.6%
expm1-def77.5%
expm1-log1p99.7%
associate-*l/100.0%
Simplified100.0%
if -1.3e-43 < x < 4.0000000000000001e-54Initial program 98.5%
Taylor expanded in x around 0 86.0%
Final simplification91.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -8.3e+15)
(fabs (* (/ x y_m) (+ z 1.0)))
(if (<= x -7.7e-31)
(fabs (/ (- -4.0 x) y_m))
(if (<= x -4.1e-44)
(fabs (* z (/ x y_m)))
(if (<= x 4.1e-50)
(fabs (/ 4.0 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 <= -8.3e+15) {
tmp = fabs(((x / y_m) * (z + 1.0)));
} else if (x <= -7.7e-31) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (x <= -4.1e-44) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 4.1e-50) {
tmp = fabs((4.0 / 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 <= (-8.3d+15)) then
tmp = abs(((x / y_m) * (z + 1.0d0)))
else if (x <= (-7.7d-31)) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (x <= (-4.1d-44)) then
tmp = abs((z * (x / y_m)))
else if (x <= 4.1d-50) then
tmp = abs((4.0d0 / 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 <= -8.3e+15) {
tmp = Math.abs(((x / y_m) * (z + 1.0)));
} else if (x <= -7.7e-31) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (x <= -4.1e-44) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 4.1e-50) {
tmp = Math.abs((4.0 / 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 <= -8.3e+15: tmp = math.fabs(((x / y_m) * (z + 1.0))) elif x <= -7.7e-31: tmp = math.fabs(((-4.0 - x) / y_m)) elif x <= -4.1e-44: tmp = math.fabs((z * (x / y_m))) elif x <= 4.1e-50: tmp = math.fabs((4.0 / 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 <= -8.3e+15) tmp = abs(Float64(Float64(x / y_m) * Float64(z + 1.0))); elseif (x <= -7.7e-31) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (x <= -4.1e-44) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 4.1e-50) tmp = abs(Float64(4.0 / 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 <= -8.3e+15) tmp = abs(((x / y_m) * (z + 1.0))); elseif (x <= -7.7e-31) tmp = abs(((-4.0 - x) / y_m)); elseif (x <= -4.1e-44) tmp = abs((z * (x / y_m))); elseif (x <= 4.1e-50) tmp = abs((4.0 / 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, -8.3e+15], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -7.7e-31], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -4.1e-44], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.1e-50], N[Abs[N[(4.0 / 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 -8.3 \cdot 10^{+15}:\\
\;\;\;\;\left|\frac{x}{y_m} \cdot \left(z + 1\right)\right|\\
\mathbf{elif}\;x \leq -7.7 \cdot 10^{-31}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-44}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-50}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y_m}\right|\\
\end{array}
\end{array}
if x < -8.3e15Initial program 82.1%
Taylor expanded in x around inf 82.1%
sub-neg82.1%
distribute-rgt-neg-out82.1%
add-sqr-sqrt52.8%
sqrt-unprod86.5%
sqr-neg86.5%
sqrt-unprod46.9%
add-sqr-sqrt91.9%
associate-*l/83.1%
Applied egg-rr83.1%
*-rgt-identity83.1%
associate-*l/91.9%
distribute-lft-in99.8%
Simplified99.8%
if -8.3e15 < x < -7.70000000000000012e-31Initial program 99.8%
Simplified99.8%
Taylor expanded in z around 0 89.9%
associate-*r/89.9%
distribute-lft-in89.9%
metadata-eval89.9%
neg-mul-189.9%
sub-neg89.9%
Simplified89.9%
if -7.70000000000000012e-31 < x < -4.09999999999999992e-44Initial program 100.0%
Taylor expanded in z around inf 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
add-sqr-sqrt79.4%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod20.0%
add-sqr-sqrt100.0%
expm1-log1p-u77.8%
expm1-udef51.6%
associate-*l/51.6%
Applied egg-rr51.6%
expm1-def77.5%
expm1-log1p99.7%
associate-*l/100.0%
Simplified100.0%
if -4.09999999999999992e-44 < x < 4.09999999999999985e-50Initial program 98.5%
Taylor expanded in x around 0 86.0%
if 4.09999999999999985e-50 < x Initial program 90.0%
associate-/r/95.0%
Applied egg-rr95.0%
clear-num94.8%
associate-/r/93.5%
clear-num93.5%
Applied egg-rr93.5%
Taylor expanded in x around inf 93.7%
div-sub93.7%
Simplified93.7%
Final simplification91.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -8.3e+15)
(fabs (* (/ x y_m) (+ z 1.0)))
(if (<= x -8.2e-31)
(fabs (+ (/ x y_m) (/ 4.0 y_m)))
(if (<= x -5.4e-45)
(fabs (* z (/ x y_m)))
(if (<= x 8.5e-52)
(fabs (/ 4.0 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 <= -8.3e+15) {
tmp = fabs(((x / y_m) * (z + 1.0)));
} else if (x <= -8.2e-31) {
tmp = fabs(((x / y_m) + (4.0 / y_m)));
} else if (x <= -5.4e-45) {
tmp = fabs((z * (x / y_m)));
} else if (x <= 8.5e-52) {
tmp = fabs((4.0 / 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 <= (-8.3d+15)) then
tmp = abs(((x / y_m) * (z + 1.0d0)))
else if (x <= (-8.2d-31)) then
tmp = abs(((x / y_m) + (4.0d0 / y_m)))
else if (x <= (-5.4d-45)) then
tmp = abs((z * (x / y_m)))
else if (x <= 8.5d-52) then
tmp = abs((4.0d0 / 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 <= -8.3e+15) {
tmp = Math.abs(((x / y_m) * (z + 1.0)));
} else if (x <= -8.2e-31) {
tmp = Math.abs(((x / y_m) + (4.0 / y_m)));
} else if (x <= -5.4e-45) {
tmp = Math.abs((z * (x / y_m)));
} else if (x <= 8.5e-52) {
tmp = Math.abs((4.0 / 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 <= -8.3e+15: tmp = math.fabs(((x / y_m) * (z + 1.0))) elif x <= -8.2e-31: tmp = math.fabs(((x / y_m) + (4.0 / y_m))) elif x <= -5.4e-45: tmp = math.fabs((z * (x / y_m))) elif x <= 8.5e-52: tmp = math.fabs((4.0 / 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 <= -8.3e+15) tmp = abs(Float64(Float64(x / y_m) * Float64(z + 1.0))); elseif (x <= -8.2e-31) tmp = abs(Float64(Float64(x / y_m) + Float64(4.0 / y_m))); elseif (x <= -5.4e-45) tmp = abs(Float64(z * Float64(x / y_m))); elseif (x <= 8.5e-52) tmp = abs(Float64(4.0 / 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 <= -8.3e+15) tmp = abs(((x / y_m) * (z + 1.0))); elseif (x <= -8.2e-31) tmp = abs(((x / y_m) + (4.0 / y_m))); elseif (x <= -5.4e-45) tmp = abs((z * (x / y_m))); elseif (x <= 8.5e-52) tmp = abs((4.0 / 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, -8.3e+15], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -8.2e-31], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] + N[(4.0 / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -5.4e-45], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 8.5e-52], N[Abs[N[(4.0 / 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 -8.3 \cdot 10^{+15}:\\
\;\;\;\;\left|\frac{x}{y_m} \cdot \left(z + 1\right)\right|\\
\mathbf{elif}\;x \leq -8.2 \cdot 10^{-31}:\\
\;\;\;\;\left|\frac{x}{y_m} + \frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq -5.4 \cdot 10^{-45}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-52}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{1 - z}{y_m}\right|\\
\end{array}
\end{array}
if x < -8.3e15Initial program 82.1%
Taylor expanded in x around inf 82.1%
sub-neg82.1%
distribute-rgt-neg-out82.1%
add-sqr-sqrt52.8%
sqrt-unprod86.5%
sqr-neg86.5%
sqrt-unprod46.9%
add-sqr-sqrt91.9%
associate-*l/83.1%
Applied egg-rr83.1%
*-rgt-identity83.1%
associate-*l/91.9%
distribute-lft-in99.8%
Simplified99.8%
if -8.3e15 < x < -8.1999999999999993e-31Initial program 99.8%
Taylor expanded in z around 0 90.0%
associate-*r/90.0%
metadata-eval90.0%
Simplified90.0%
if -8.1999999999999993e-31 < x < -5.3999999999999997e-45Initial program 100.0%
Taylor expanded in z around inf 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
add-sqr-sqrt79.4%
sqrt-unprod61.1%
sqr-neg61.1%
sqrt-unprod20.0%
add-sqr-sqrt100.0%
expm1-log1p-u77.8%
expm1-udef51.6%
associate-*l/51.6%
Applied egg-rr51.6%
expm1-def77.5%
expm1-log1p99.7%
associate-*l/100.0%
Simplified100.0%
if -5.3999999999999997e-45 < x < 8.50000000000000006e-52Initial program 98.5%
Taylor expanded in x around 0 86.0%
if 8.50000000000000006e-52 < x Initial program 90.0%
associate-/r/95.0%
Applied egg-rr95.0%
clear-num94.8%
associate-/r/93.5%
clear-num93.5%
Applied egg-rr93.5%
Taylor expanded in x around inf 93.7%
div-sub93.7%
Simplified93.7%
Final simplification91.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ 4.0 x) y_m)) (t_1 (* z (/ x y_m))))
(if (<= (- t_0 t_1) -5e+106)
(fabs (- t_1 t_0))
(fabs (/ (- (+ 4.0 x) (* x z)) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (4.0 + x) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= -5e+106) {
tmp = fabs((t_1 - t_0));
} else {
tmp = fabs((((4.0 + x) - (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (4.0d0 + x) / y_m
t_1 = z * (x / y_m)
if ((t_0 - t_1) <= (-5d+106)) then
tmp = abs((t_1 - t_0))
else
tmp = abs((((4.0d0 + x) - (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 t_0 = (4.0 + x) / y_m;
double t_1 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= -5e+106) {
tmp = Math.abs((t_1 - t_0));
} else {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (4.0 + x) / y_m t_1 = z * (x / y_m) tmp = 0 if (t_0 - t_1) <= -5e+106: tmp = math.fabs((t_1 - t_0)) else: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(4.0 + x) / y_m) t_1 = Float64(z * Float64(x / y_m)) tmp = 0.0 if (Float64(t_0 - t_1) <= -5e+106) tmp = abs(Float64(t_1 - t_0)); else tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (4.0 + x) / y_m; t_1 = z * (x / y_m); tmp = 0.0; if ((t_0 - t_1) <= -5e+106) tmp = abs((t_1 - t_0)); else tmp = abs((((4.0 + x) - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - t$95$1), $MachinePrecision], -5e+106], N[Abs[N[(t$95$1 - t$95$0), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{4 + x}{y_m}\\
t_1 := z \cdot \frac{x}{y_m}\\
\mathbf{if}\;t_0 - t_1 \leq -5 \cdot 10^{+106}:\\
\;\;\;\;\left|t_1 - t_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) < -4.9999999999999998e106Initial program 99.9%
if -4.9999999999999998e106 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) Initial program 91.4%
Taylor expanded in y around 0 95.7%
Final simplification96.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1e+163)
(fabs (* (/ x y_m) (+ z 1.0)))
(if (<= x 6e+17)
(fabs (/ (- (+ 4.0 x) (* x z)) y_m))
(fabs (* (/ x y_m) (- 1.0 z))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1e+163) {
tmp = fabs(((x / y_m) * (z + 1.0)));
} else if (x <= 6e+17) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs(((x / y_m) * (1.0 - 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 (x <= (-1d+163)) then
tmp = abs(((x / y_m) * (z + 1.0d0)))
else if (x <= 6d+17) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs(((x / y_m) * (1.0d0 - 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 (x <= -1e+163) {
tmp = Math.abs(((x / y_m) * (z + 1.0)));
} else if (x <= 6e+17) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs(((x / y_m) * (1.0 - z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1e+163: tmp = math.fabs(((x / y_m) * (z + 1.0))) elif x <= 6e+17: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs(((x / y_m) * (1.0 - z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1e+163) tmp = abs(Float64(Float64(x / y_m) * Float64(z + 1.0))); elseif (x <= 6e+17) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(x / y_m) * Float64(1.0 - z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -1e+163) tmp = abs(((x / y_m) * (z + 1.0))); elseif (x <= 6e+17) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs(((x / y_m) * (1.0 - z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -1e+163], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6e+17], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(x / y$95$m), $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+163}:\\
\;\;\;\;\left|\frac{x}{y_m} \cdot \left(z + 1\right)\right|\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+17}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{y_m} \cdot \left(1 - z\right)\right|\\
\end{array}
\end{array}
if x < -9.9999999999999994e162Initial program 74.8%
Taylor expanded in x around inf 74.8%
sub-neg74.8%
distribute-rgt-neg-out74.8%
add-sqr-sqrt60.5%
sqrt-unprod79.0%
sqr-neg79.0%
sqrt-unprod39.2%
add-sqr-sqrt85.5%
associate-*l/69.3%
Applied egg-rr69.3%
*-rgt-identity69.3%
associate-*l/85.5%
distribute-lft-in99.8%
Simplified99.8%
if -9.9999999999999994e162 < x < 6e17Initial program 97.2%
Taylor expanded in y around 0 99.9%
if 6e17 < x Initial program 89.5%
Taylor expanded in x around inf 89.5%
*-un-lft-identity89.5%
*-commutative89.5%
distribute-rgt-out--99.8%
Applied egg-rr99.8%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 6e-30) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (- (/ (+ 4.0 x) y_m) (* x (/ z y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 6e-30) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs((((4.0 + x) / 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 <= 6d-30) then
tmp = abs((((4.0d0 + x) - (x * z)) / y_m))
else
tmp = abs((((4.0d0 + x) / 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 <= 6e-30) {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = Math.abs((((4.0 + x) / y_m) - (x * (z / y_m))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 6e-30: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) else: tmp = math.fabs((((4.0 + x) / y_m) - (x * (z / y_m)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 6e-30) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(Float64(4.0 + x) / 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 <= 6e-30) tmp = abs((((4.0 + x) - (x * z)) / y_m)); else tmp = abs((((4.0 + x) / 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, 6e-30], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(4.0 + x), $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 6 \cdot 10^{-30}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y_m} - x \cdot \frac{z}{y_m}\right|\\
\end{array}
\end{array}
if y < 5.9999999999999998e-30Initial program 92.0%
Taylor expanded in y around 0 96.4%
if 5.9999999999999998e-30 < y Initial program 96.8%
associate-/r/99.9%
Applied egg-rr99.9%
clear-num99.8%
associate-/r/99.8%
clear-num99.9%
Applied egg-rr99.9%
Final simplification97.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -1.45e+101) (fabs (/ z (/ y_m x))) (if (<= z 2.25e+92) (fabs (/ (- -4.0 x) y_m)) (fabs (* z (/ x y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -1.45e+101) {
tmp = fabs((z / (y_m / x)));
} else if (z <= 2.25e+92) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-1.45d+101)) then
tmp = abs((z / (y_m / x)))
else if (z <= 2.25d+92) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -1.45e+101) {
tmp = Math.abs((z / (y_m / x)));
} else if (z <= 2.25e+92) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((z * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -1.45e+101: tmp = math.fabs((z / (y_m / x))) elif z <= 2.25e+92: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((z * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -1.45e+101) tmp = abs(Float64(z / Float64(y_m / x))); elseif (z <= 2.25e+92) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(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 (z <= -1.45e+101) tmp = abs((z / (y_m / x))); elseif (z <= 2.25e+92) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((z * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -1.45e+101], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+92], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+101}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+92}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\end{array}
\end{array}
if z < -1.44999999999999994e101Initial program 96.9%
Taylor expanded in z around inf 69.2%
mul-1-neg69.2%
associate-*l/77.2%
distribute-rgt-neg-out77.2%
Simplified77.2%
add-sqr-sqrt77.0%
clear-num77.0%
sqrt-unprod51.2%
sqr-neg51.2%
sqrt-unprod0.0%
add-sqr-sqrt77.1%
associate-*l/77.2%
*-un-lft-identity77.2%
Applied egg-rr77.2%
if -1.44999999999999994e101 < z < 2.25e92Initial program 94.4%
Simplified96.6%
Taylor expanded in z around 0 88.9%
associate-*r/88.9%
distribute-lft-in88.9%
metadata-eval88.9%
neg-mul-188.9%
sub-neg88.9%
Simplified88.9%
if 2.25e92 < z Initial program 84.5%
Taylor expanded in z around inf 66.7%
mul-1-neg66.7%
associate-*l/73.2%
distribute-rgt-neg-out73.2%
Simplified73.2%
add-sqr-sqrt0.0%
sqrt-unprod47.0%
sqr-neg47.0%
sqrt-unprod72.9%
add-sqr-sqrt73.2%
expm1-log1p-u32.1%
expm1-udef21.5%
associate-*l/19.5%
Applied egg-rr19.5%
expm1-def33.0%
expm1-log1p66.7%
associate-*l/73.2%
Simplified73.2%
Final simplification84.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.5) (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.5) || !(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.5d0)) .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.5) || !(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.5) 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.5) || !(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.5) || ~((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.5], 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.5 \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.5 or 4 < x Initial program 86.9%
Taylor expanded in z around 0 60.7%
associate-*r/60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in x around inf 59.2%
if -1.5 < x < 4Initial program 97.9%
Taylor expanded in x around 0 78.9%
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 93.3%
Taylor expanded in x around 0 47.9%
Final simplification47.9%
herbie shell --seed 2024020
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))