
(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 12 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 3e+24) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (- (/ (+ x 4.0) y_m) (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 3e+24) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs((((x + 4.0) / 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 <= 3d+24) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs((((x + 4.0d0) / 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 <= 3e+24) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs((((x + 4.0) / y_m) - (x / (y_m / z))));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if y_m <= 3e+24: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs((((x + 4.0) / y_m) - (x / (y_m / z)))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 3e+24) 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(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 <= 3e+24) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs((((x + 4.0) / 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, 3e+24], 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[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 3 \cdot 10^{+24}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x + 4}{y\_m} - \frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if y < 2.99999999999999995e24Initial program 90.0%
associate-*l/91.8%
sub-div97.7%
Applied egg-rr97.7%
if 2.99999999999999995e24 < y Initial program 96.6%
associate-*l/92.4%
associate-*r/99.7%
clear-num99.6%
un-div-inv99.8%
Applied egg-rr99.8%
Final simplification98.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))) (t_1 (fabs (* x (/ z y_m)))))
(if (<= x -1.52e+112)
t_0
(if (<= x -5.5e-39)
t_1
(if (<= x 2.95e-30) (fabs (/ 4.0 y_m)) (if (<= x 3.4e+80) t_1 t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double t_1 = fabs((x * (z / y_m)));
double tmp;
if (x <= -1.52e+112) {
tmp = t_0;
} else if (x <= -5.5e-39) {
tmp = t_1;
} else if (x <= 2.95e-30) {
tmp = fabs((4.0 / y_m));
} else if (x <= 3.4e+80) {
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((x / y_m))
t_1 = abs((x * (z / y_m)))
if (x <= (-1.52d+112)) then
tmp = t_0
else if (x <= (-5.5d-39)) then
tmp = t_1
else if (x <= 2.95d-30) then
tmp = abs((4.0d0 / y_m))
else if (x <= 3.4d+80) 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((x / y_m));
double t_1 = Math.abs((x * (z / y_m)));
double tmp;
if (x <= -1.52e+112) {
tmp = t_0;
} else if (x <= -5.5e-39) {
tmp = t_1;
} else if (x <= 2.95e-30) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 3.4e+80) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) t_1 = math.fabs((x * (z / y_m))) tmp = 0 if x <= -1.52e+112: tmp = t_0 elif x <= -5.5e-39: tmp = t_1 elif x <= 2.95e-30: tmp = math.fabs((4.0 / y_m)) elif x <= 3.4e+80: tmp = t_1 else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) t_1 = abs(Float64(x * Float64(z / y_m))) tmp = 0.0 if (x <= -1.52e+112) tmp = t_0; elseif (x <= -5.5e-39) tmp = t_1; elseif (x <= 2.95e-30) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 3.4e+80) 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((x / y_m)); t_1 = abs((x * (z / y_m))); tmp = 0.0; if (x <= -1.52e+112) tmp = t_0; elseif (x <= -5.5e-39) tmp = t_1; elseif (x <= 2.95e-30) tmp = abs((4.0 / y_m)); elseif (x <= 3.4e+80) 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[(x / y$95$m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.52e+112], t$95$0, If[LessEqual[x, -5.5e-39], t$95$1, If[LessEqual[x, 2.95e-30], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 3.4e+80], t$95$1, t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
t_1 := \left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.52 \cdot 10^{+112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.5 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.95 \cdot 10^{-30}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.5199999999999999e112 or 3.39999999999999992e80 < x Initial program 82.3%
Simplified90.9%
Taylor expanded in x around inf 91.2%
associate-/l*99.7%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 73.7%
if -1.5199999999999999e112 < x < -5.50000000000000018e-39 or 2.9499999999999999e-30 < x < 3.39999999999999992e80Initial program 95.5%
Simplified97.8%
Taylor expanded in z around inf 64.6%
associate-*r/64.6%
neg-mul-164.6%
distribute-lft-neg-in64.6%
*-commutative64.6%
associate-*r/67.2%
Simplified67.2%
associate-*r/64.6%
clear-num64.5%
*-commutative64.5%
add-sqr-sqrt33.5%
sqrt-unprod64.5%
sqr-neg64.5%
sqrt-unprod30.8%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
associate-/r/64.4%
associate-*l/64.6%
*-lft-identity64.6%
associate-/l*64.6%
Simplified64.6%
if -5.50000000000000018e-39 < x < 2.9499999999999999e-30Initial program 96.0%
Simplified99.9%
Taylor expanded in x around 0 84.0%
Final simplification76.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -1.75e+113)
t_0
(if (<= x -5.6e-35)
(fabs (/ z (/ y_m x)))
(if (<= x 2.15e-23)
(fabs (/ 4.0 y_m))
(if (<= x 1.06e+80) (fabs (* x (/ z y_m))) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -1.75e+113) {
tmp = t_0;
} else if (x <= -5.6e-35) {
tmp = fabs((z / (y_m / x)));
} else if (x <= 2.15e-23) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.06e+80) {
tmp = fabs((x * (z / 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 / y_m))
if (x <= (-1.75d+113)) then
tmp = t_0
else if (x <= (-5.6d-35)) then
tmp = abs((z / (y_m / x)))
else if (x <= 2.15d-23) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.06d+80) then
tmp = abs((x * (z / 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 / y_m));
double tmp;
if (x <= -1.75e+113) {
tmp = t_0;
} else if (x <= -5.6e-35) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= 2.15e-23) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.06e+80) {
tmp = Math.abs((x * (z / y_m)));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -1.75e+113: tmp = t_0 elif x <= -5.6e-35: tmp = math.fabs((z / (y_m / x))) elif x <= 2.15e-23: tmp = math.fabs((4.0 / y_m)) elif x <= 1.06e+80: tmp = math.fabs((x * (z / y_m))) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.75e+113) tmp = t_0; elseif (x <= -5.6e-35) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= 2.15e-23) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.06e+80) tmp = abs(Float64(x * Float64(z / 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 / y_m)); tmp = 0.0; if (x <= -1.75e+113) tmp = t_0; elseif (x <= -5.6e-35) tmp = abs((z / (y_m / x))); elseif (x <= 2.15e-23) tmp = abs((4.0 / y_m)); elseif (x <= 1.06e+80) tmp = abs((x * (z / 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 / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.75e+113], t$95$0, If[LessEqual[x, -5.6e-35], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.15e-23], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.06e+80], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-35}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-23}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+80}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75e113 or 1.05999999999999996e80 < x Initial program 82.3%
Simplified90.9%
Taylor expanded in x around inf 91.2%
associate-/l*99.7%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 73.7%
if -1.75e113 < x < -5.5999999999999999e-35Initial program 99.8%
Simplified96.7%
Taylor expanded in z around inf 58.2%
associate-*r/58.2%
neg-mul-158.2%
distribute-lft-neg-in58.2%
*-commutative58.2%
associate-*r/63.9%
Simplified63.9%
clear-num63.8%
un-div-inv63.9%
add-sqr-sqrt63.7%
sqrt-unprod63.9%
sqr-neg63.9%
sqrt-unprod0.0%
add-sqr-sqrt63.9%
Applied egg-rr63.9%
if -5.5999999999999999e-35 < x < 2.15000000000000001e-23Initial program 96.0%
Simplified99.9%
Taylor expanded in x around 0 84.0%
if 2.15000000000000001e-23 < x < 1.05999999999999996e80Initial program 89.7%
Simplified99.3%
Taylor expanded in z around inf 73.4%
associate-*r/73.4%
neg-mul-173.4%
distribute-lft-neg-in73.4%
*-commutative73.4%
associate-*r/71.7%
Simplified71.7%
associate-*r/73.4%
clear-num73.3%
*-commutative73.3%
add-sqr-sqrt0.0%
sqrt-unprod73.3%
sqr-neg73.3%
sqrt-unprod73.2%
add-sqr-sqrt73.3%
Applied egg-rr73.3%
associate-/r/73.1%
associate-*l/73.4%
*-lft-identity73.4%
associate-/l*69.6%
Simplified69.6%
Final simplification76.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -1.35e+112)
t_0
(if (<= x -1.05e-34)
(fabs (/ z (/ y_m x)))
(if (<= x 2e-23)
(fabs (/ 4.0 y_m))
(if (<= x 1.12e+80) (fabs (/ (* x z) y_m)) t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x / y_m));
double tmp;
if (x <= -1.35e+112) {
tmp = t_0;
} else if (x <= -1.05e-34) {
tmp = fabs((z / (y_m / x)));
} else if (x <= 2e-23) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.12e+80) {
tmp = fabs(((x * z) / 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 / y_m))
if (x <= (-1.35d+112)) then
tmp = t_0
else if (x <= (-1.05d-34)) then
tmp = abs((z / (y_m / x)))
else if (x <= 2d-23) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.12d+80) then
tmp = abs(((x * z) / 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 / y_m));
double tmp;
if (x <= -1.35e+112) {
tmp = t_0;
} else if (x <= -1.05e-34) {
tmp = Math.abs((z / (y_m / x)));
} else if (x <= 2e-23) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.12e+80) {
tmp = Math.abs(((x * z) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((x / y_m)) tmp = 0 if x <= -1.35e+112: tmp = t_0 elif x <= -1.05e-34: tmp = math.fabs((z / (y_m / x))) elif x <= 2e-23: tmp = math.fabs((4.0 / y_m)) elif x <= 1.12e+80: tmp = math.fabs(((x * z) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x / y_m)) tmp = 0.0 if (x <= -1.35e+112) tmp = t_0; elseif (x <= -1.05e-34) tmp = abs(Float64(z / Float64(y_m / x))); elseif (x <= 2e-23) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.12e+80) tmp = abs(Float64(Float64(x * z) / 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 / y_m)); tmp = 0.0; if (x <= -1.35e+112) tmp = t_0; elseif (x <= -1.05e-34) tmp = abs((z / (y_m / x))); elseif (x <= 2e-23) tmp = abs((4.0 / y_m)); elseif (x <= 1.12e+80) tmp = abs(((x * z) / 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 / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.35e+112], t$95$0, If[LessEqual[x, -1.05e-34], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2e-23], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.12e+80], N[Abs[N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{+112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-34}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-23}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+80}:\\
\;\;\;\;\left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.3500000000000001e112 or 1.12e80 < x Initial program 82.3%
Simplified90.9%
Taylor expanded in x around inf 91.2%
associate-/l*99.7%
div-sub99.7%
associate-*r*99.7%
neg-mul-199.7%
*-commutative99.7%
div-sub99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around 0 73.7%
if -1.3500000000000001e112 < x < -1.05e-34Initial program 99.8%
Simplified96.7%
Taylor expanded in z around inf 58.2%
associate-*r/58.2%
neg-mul-158.2%
distribute-lft-neg-in58.2%
*-commutative58.2%
associate-*r/63.9%
Simplified63.9%
clear-num63.8%
un-div-inv63.9%
add-sqr-sqrt63.7%
sqrt-unprod63.9%
sqr-neg63.9%
sqrt-unprod0.0%
add-sqr-sqrt63.9%
Applied egg-rr63.9%
if -1.05e-34 < x < 1.99999999999999992e-23Initial program 96.0%
Simplified99.9%
Taylor expanded in x around 0 84.0%
if 1.99999999999999992e-23 < x < 1.12e80Initial program 89.7%
Simplified99.3%
Taylor expanded in z around inf 73.4%
associate-*r/73.4%
neg-mul-173.4%
distribute-lft-neg-in73.4%
*-commutative73.4%
associate-*r/71.7%
Simplified71.7%
*-commutative71.7%
associate-*l/73.4%
add-sqr-sqrt0.0%
sqrt-unprod73.4%
sqr-neg73.4%
sqrt-unprod73.1%
add-sqr-sqrt73.4%
Applied egg-rr73.4%
Final simplification77.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.36e-39) (not (<= x 3e-28))) (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 <= -1.36e-39) || !(x <= 3e-28)) {
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 <= (-1.36d-39)) .or. (.not. (x <= 3d-28))) 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 <= -1.36e-39) || !(x <= 3e-28)) {
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 <= -1.36e-39) or not (x <= 3e-28): 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 <= -1.36e-39) || !(x <= 3e-28)) 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 <= -1.36e-39) || ~((x <= 3e-28))) 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, -1.36e-39], N[Not[LessEqual[x, 3e-28]], $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 -1.36 \cdot 10^{-39} \lor \neg \left(x \leq 3 \cdot 10^{-28}\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 < -1.35999999999999994e-39 or 3.00000000000000003e-28 < x Initial program 87.6%
associate-*l/85.5%
sub-div94.0%
Applied egg-rr94.0%
Taylor expanded in x around inf 89.2%
sub-neg89.2%
neg-mul-189.2%
associate-/l*94.3%
neg-mul-194.3%
sub-neg94.3%
Simplified94.3%
if -1.35999999999999994e-39 < x < 3.00000000000000003e-28Initial program 96.0%
fabs-sub96.0%
associate-*l/99.9%
associate-*r/93.4%
fma-neg93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 84.0%
associate-*r/84.0%
distribute-lft-in84.0%
metadata-eval84.0%
neg-mul-184.0%
sub-neg84.0%
Simplified84.0%
Final simplification89.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -3.1e-41) (not (<= x 7.2e-30))) (fabs (* (- 1.0 z) (/ x 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 <= -3.1e-41) || !(x <= 7.2e-30)) {
tmp = fabs(((1.0 - z) * (x / 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 <= (-3.1d-41)) .or. (.not. (x <= 7.2d-30))) then
tmp = abs(((1.0d0 - z) * (x / 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 <= -3.1e-41) || !(x <= 7.2e-30)) {
tmp = Math.abs(((1.0 - z) * (x / 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 <= -3.1e-41) or not (x <= 7.2e-30): tmp = math.fabs(((1.0 - z) * (x / 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 <= -3.1e-41) || !(x <= 7.2e-30)) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / 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 <= -3.1e-41) || ~((x <= 7.2e-30))) tmp = abs(((1.0 - z) * (x / 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, -3.1e-41], N[Not[LessEqual[x, 7.2e-30]], $MachinePrecision]], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / 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 -3.1 \cdot 10^{-41} \lor \neg \left(x \leq 7.2 \cdot 10^{-30}\right):\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if x < -3.10000000000000001e-41 or 7.2000000000000006e-30 < x Initial program 87.6%
Simplified93.7%
Taylor expanded in x around -inf 89.2%
*-commutative89.2%
associate-/l*94.8%
neg-mul-194.8%
unsub-neg94.8%
Simplified94.8%
if -3.10000000000000001e-41 < x < 7.2000000000000006e-30Initial program 96.0%
fabs-sub96.0%
associate-*l/99.9%
associate-*r/93.4%
fma-neg93.4%
distribute-neg-frac93.4%
+-commutative93.4%
distribute-neg-in93.4%
unsub-neg93.4%
metadata-eval93.4%
Simplified93.4%
Taylor expanded in z around 0 84.0%
associate-*r/84.0%
distribute-lft-in84.0%
metadata-eval84.0%
neg-mul-184.0%
sub-neg84.0%
Simplified84.0%
Final simplification90.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -2.3e+46) (not (<= z 2.9e+85))) (fabs (/ x (/ y_m z))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((z <= -2.3e+46) || !(z <= 2.9e+85)) {
tmp = fabs((x / (y_m / z)));
} 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 ((z <= (-2.3d+46)) .or. (.not. (z <= 2.9d+85))) then
tmp = abs((x / (y_m / z)))
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 ((z <= -2.3e+46) || !(z <= 2.9e+85)) {
tmp = Math.abs((x / (y_m / z)));
} 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 (z <= -2.3e+46) or not (z <= 2.9e+85): tmp = math.fabs((x / (y_m / z))) 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 ((z <= -2.3e+46) || !(z <= 2.9e+85)) tmp = abs(Float64(x / Float64(y_m / z))); 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 ((z <= -2.3e+46) || ~((z <= 2.9e+85))) tmp = abs((x / (y_m / z))); 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[z, -2.3e+46], N[Not[LessEqual[z, 2.9e+85]], $MachinePrecision]], N[Abs[N[(x / N[(y$95$m / z), $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}\;z \leq -2.3 \cdot 10^{+46} \lor \neg \left(z \leq 2.9 \cdot 10^{+85}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -2.3000000000000001e46 or 2.89999999999999997e85 < z Initial program 87.6%
Simplified91.3%
Taylor expanded in z around inf 72.4%
mul-1-neg72.4%
associate-*r/77.2%
Simplified77.2%
clear-num77.1%
un-div-inv79.6%
Applied egg-rr79.6%
if -2.3000000000000001e46 < z < 2.89999999999999997e85Initial program 93.3%
fabs-sub93.3%
associate-*l/95.8%
associate-*r/95.3%
fma-neg98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 92.0%
associate-*r/92.0%
distribute-lft-in92.0%
metadata-eval92.0%
neg-mul-192.0%
sub-neg92.0%
Simplified92.0%
Final simplification87.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -4.5e+50) (fabs (/ z (/ y_m x))) (if (<= z 1.95e+99) (fabs (/ (- -4.0 x) y_m)) (fabs (* x (/ z y_m))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -4.5e+50) {
tmp = fabs((z / (y_m / x)));
} else if (z <= 1.95e+99) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((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 (z <= (-4.5d+50)) then
tmp = abs((z / (y_m / x)))
else if (z <= 1.95d+99) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((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 (z <= -4.5e+50) {
tmp = Math.abs((z / (y_m / x)));
} else if (z <= 1.95e+99) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x * (z / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -4.5e+50: tmp = math.fabs((z / (y_m / x))) elif z <= 1.95e+99: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x * (z / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -4.5e+50) tmp = abs(Float64(z / Float64(y_m / x))); elseif (z <= 1.95e+99) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(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 (z <= -4.5e+50) tmp = abs((z / (y_m / x))); elseif (z <= 1.95e+99) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x * (z / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -4.5e+50], N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.95e+99], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;\left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+99}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if z < -4.50000000000000014e50Initial program 97.2%
Simplified95.4%
Taylor expanded in z around inf 74.9%
associate-*r/74.9%
neg-mul-174.9%
distribute-lft-neg-in74.9%
*-commutative74.9%
associate-*r/77.8%
Simplified77.8%
clear-num76.5%
un-div-inv76.6%
add-sqr-sqrt40.9%
sqrt-unprod71.6%
sqr-neg71.6%
sqrt-unprod35.6%
add-sqr-sqrt76.6%
Applied egg-rr76.6%
if -4.50000000000000014e50 < z < 1.94999999999999997e99Initial program 93.4%
fabs-sub93.4%
associate-*l/95.8%
associate-*r/95.3%
fma-neg98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 91.6%
associate-*r/91.6%
distribute-lft-in91.6%
metadata-eval91.6%
neg-mul-191.6%
sub-neg91.6%
Simplified91.6%
if 1.94999999999999997e99 < z Initial program 76.7%
Simplified86.4%
Taylor expanded in z around inf 70.6%
associate-*r/70.6%
neg-mul-170.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
associate-*r/75.4%
Simplified75.4%
associate-*r/70.6%
clear-num70.4%
*-commutative70.4%
add-sqr-sqrt39.3%
sqrt-unprod60.6%
sqr-neg60.6%
sqrt-unprod30.9%
add-sqr-sqrt70.4%
Applied egg-rr70.4%
associate-/r/70.4%
associate-*l/70.6%
*-lft-identity70.6%
associate-/l*81.4%
Simplified81.4%
Final simplification87.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -3.2e+47) (fabs (* z (/ x y_m))) (if (<= z 9.2e+85) (fabs (/ (- -4.0 x) y_m)) (fabs (/ x (/ y_m z))))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (z <= -3.2e+47) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 9.2e+85) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = fabs((x / (y_m / z)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-3.2d+47)) then
tmp = abs((z * (x / y_m)))
else if (z <= 9.2d+85) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = abs((x / (y_m / z)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (z <= -3.2e+47) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 9.2e+85) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = Math.abs((x / (y_m / z)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if z <= -3.2e+47: tmp = math.fabs((z * (x / y_m))) elif z <= 9.2e+85: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = math.fabs((x / (y_m / z))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (z <= -3.2e+47) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 9.2e+85) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = abs(Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (z <= -3.2e+47) tmp = abs((z * (x / y_m))); elseif (z <= 9.2e+85) tmp = abs(((-4.0 - x) / y_m)); else tmp = abs((x / (y_m / z))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[z, -3.2e+47], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 9.2e+85], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+47}:\\
\;\;\;\;\left|z \cdot \frac{x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+85}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\end{array}
\end{array}
if z < -3.2e47Initial program 97.2%
Simplified95.4%
Taylor expanded in z around inf 74.9%
associate-*r/74.9%
neg-mul-174.9%
distribute-lft-neg-in74.9%
*-commutative74.9%
associate-*r/77.8%
Simplified77.8%
if -3.2e47 < z < 9.1999999999999996e85Initial program 93.3%
fabs-sub93.3%
associate-*l/95.8%
associate-*r/95.3%
fma-neg98.3%
distribute-neg-frac98.3%
+-commutative98.3%
distribute-neg-in98.3%
unsub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 92.0%
associate-*r/92.0%
distribute-lft-in92.0%
metadata-eval92.0%
neg-mul-192.0%
sub-neg92.0%
Simplified92.0%
if 9.1999999999999996e85 < z Initial program 77.7%
Simplified87.0%
Taylor expanded in z around inf 69.8%
mul-1-neg69.8%
associate-*r/80.1%
Simplified80.1%
clear-num80.0%
un-div-inv82.1%
Applied egg-rr82.1%
Final simplification87.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 1e+55) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (* (- 1.0 z) (/ x y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 1e+55) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= 1d+55) then
tmp = abs((((x + 4.0d0) - (x * z)) / y_m))
else
tmp = abs(((1.0d0 - z) * (x / y_m)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= 1e+55) {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 1e+55: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) else: tmp = math.fabs(((1.0 - z) * (x / y_m))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 1e+55) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= 1e+55) tmp = abs((((x + 4.0) - (x * z)) / y_m)); else tmp = abs(((1.0 - z) * (x / y_m))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 1e+55], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{+55}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\end{array}
\end{array}
if x < 1.00000000000000001e55Initial program 93.3%
associate-*l/94.8%
sub-div98.1%
Applied egg-rr98.1%
if 1.00000000000000001e55 < x Initial program 82.5%
Simplified89.6%
Taylor expanded in x around -inf 89.8%
*-commutative89.8%
associate-/l*99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
Final simplification98.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.45) (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.45) || !(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.45d0)) .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.45) || !(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.45) 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.45) || !(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.45) || ~((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.45], 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.45 \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.44999999999999996 or 4 < x Initial program 86.3%
Simplified92.9%
Taylor expanded in x around inf 91.4%
associate-/l*97.9%
div-sub97.9%
associate-*r*97.9%
neg-mul-197.9%
*-commutative97.9%
div-sub97.9%
sub-neg97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in z around 0 62.0%
if -1.44999999999999996 < x < 4Initial program 96.2%
Simplified99.8%
Taylor expanded in x around 0 76.6%
Final simplification69.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ 4.0 y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((4.0 / y_m));
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
code = abs((4.0d0 / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((4.0 / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((4.0 / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(4.0 / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((4.0 / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{4}{y\_m}\right|
\end{array}
Initial program 91.3%
Simplified96.4%
Taylor expanded in x around 0 41.8%
Final simplification41.8%
herbie shell --seed 2024050
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))