
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 2e+35) (fabs (/ (- (+ 4.0 x) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 2e+35) {
tmp = fabs((((4.0 + x) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 2e+35) tmp = abs(Float64(Float64(Float64(4.0 + x) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 2e+35], N[Abs[N[(N[(N[(4.0 + x), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y_m \leq 2 \cdot 10^{+35}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y_m}, \frac{-4 - x}{y_m}\right)\right|\\
\end{array}
\end{array}
if y < 1.9999999999999999e35Initial program 91.9%
Taylor expanded in y around 0 96.6%
if 1.9999999999999999e35 < y Initial program 94.5%
Simplified99.8%
Final simplification97.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (- (/ (+ 4.0 x) y_m) (* z (/ x y_m))))) (if (<= t_0 -2e+82) (fabs 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) - (z * (x / y_m));
double tmp;
if (t_0 <= -2e+82) {
tmp = fabs(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) :: tmp
t_0 = ((4.0d0 + x) / y_m) - (z * (x / y_m))
if (t_0 <= (-2d+82)) then
tmp = abs(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) - (z * (x / y_m));
double tmp;
if (t_0 <= -2e+82) {
tmp = Math.abs(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) - (z * (x / y_m)) tmp = 0 if t_0 <= -2e+82: tmp = math.fabs(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(Float64(4.0 + x) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= -2e+82) tmp = abs(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) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= -2e+82) tmp = abs(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[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+82], N[Abs[t$95$0], $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} - z \cdot \frac{x}{y_m}\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{+82}:\\
\;\;\;\;\left|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)) < -1.9999999999999999e82Initial program 99.9%
if -1.9999999999999999e82 < (-.f64 (/.f64 (+.f64 x 4) y) (*.f64 (/.f64 x y) z)) Initial program 89.5%
Taylor expanded in y around 0 96.3%
Final simplification97.4%
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 -8.6e+189)
t_0
(if (<= x -8e+34)
t_1
(if (<= x -5.8e-35)
t_0
(if (<= x 1.75e-25)
(fabs (/ 4.0 y_m))
(if (or (<= x 7.2e+208) (not (<= x 1.9e+295))) 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 <= -8.6e+189) {
tmp = t_0;
} else if (x <= -8e+34) {
tmp = t_1;
} else if (x <= -5.8e-35) {
tmp = t_0;
} else if (x <= 1.75e-25) {
tmp = fabs((4.0 / y_m));
} else if ((x <= 7.2e+208) || !(x <= 1.9e+295)) {
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 <= (-8.6d+189)) then
tmp = t_0
else if (x <= (-8d+34)) then
tmp = t_1
else if (x <= (-5.8d-35)) then
tmp = t_0
else if (x <= 1.75d-25) then
tmp = abs((4.0d0 / y_m))
else if ((x <= 7.2d+208) .or. (.not. (x <= 1.9d+295))) 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 <= -8.6e+189) {
tmp = t_0;
} else if (x <= -8e+34) {
tmp = t_1;
} else if (x <= -5.8e-35) {
tmp = t_0;
} else if (x <= 1.75e-25) {
tmp = Math.abs((4.0 / y_m));
} else if ((x <= 7.2e+208) || !(x <= 1.9e+295)) {
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 <= -8.6e+189: tmp = t_0 elif x <= -8e+34: tmp = t_1 elif x <= -5.8e-35: tmp = t_0 elif x <= 1.75e-25: tmp = math.fabs((4.0 / y_m)) elif (x <= 7.2e+208) or not (x <= 1.9e+295): 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 <= -8.6e+189) tmp = t_0; elseif (x <= -8e+34) tmp = t_1; elseif (x <= -5.8e-35) tmp = t_0; elseif (x <= 1.75e-25) tmp = abs(Float64(4.0 / y_m)); elseif ((x <= 7.2e+208) || !(x <= 1.9e+295)) 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 <= -8.6e+189) tmp = t_0; elseif (x <= -8e+34) tmp = t_1; elseif (x <= -5.8e-35) tmp = t_0; elseif (x <= 1.75e-25) tmp = abs((4.0 / y_m)); elseif ((x <= 7.2e+208) || ~((x <= 1.9e+295))) 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, -8.6e+189], t$95$0, If[LessEqual[x, -8e+34], t$95$1, If[LessEqual[x, -5.8e-35], t$95$0, If[LessEqual[x, 1.75e-25], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 7.2e+208], N[Not[LessEqual[x, 1.9e+295]], $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 -8.6 \cdot 10^{+189}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-25}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+208} \lor \neg \left(x \leq 1.9 \cdot 10^{+295}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -8.59999999999999995e189 or -7.99999999999999956e34 < x < -5.8000000000000004e-35 or 1.7500000000000001e-25 < x < 7.20000000000000005e208 or 1.9000000000000001e295 < x Initial program 92.1%
Taylor expanded in z around inf 47.3%
mul-1-neg47.3%
associate-*l/68.5%
distribute-rgt-neg-out68.5%
Simplified68.5%
add-sqr-sqrt36.4%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod32.0%
add-sqr-sqrt68.5%
associate-/r/61.2%
Applied egg-rr61.2%
associate-/r/68.5%
Applied egg-rr68.5%
if -8.59999999999999995e189 < x < -7.99999999999999956e34 or 7.20000000000000005e208 < x < 1.9000000000000001e295Initial program 85.7%
Taylor expanded in z around 0 77.9%
associate-*r/77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in x around inf 77.9%
if -5.8000000000000004e-35 < x < 1.7500000000000001e-25Initial program 95.8%
Taylor expanded in x around 0 81.4%
Final simplification76.6%
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 -4.4e+191)
t_0
(if (<= x -3e+34)
t_1
(if (<= x -7.8e-36)
t_0
(if (<= x 6.5e-25)
(fabs (/ 4.0 y_m))
(if (<= x 1.55e+209)
t_0
(if (<= x 1.1e+296) t_1 (fabs (/ z (/ y_m x)))))))))))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 <= -4.4e+191) {
tmp = t_0;
} else if (x <= -3e+34) {
tmp = t_1;
} else if (x <= -7.8e-36) {
tmp = t_0;
} else if (x <= 6.5e-25) {
tmp = fabs((4.0 / y_m));
} else if (x <= 1.55e+209) {
tmp = t_0;
} else if (x <= 1.1e+296) {
tmp = t_1;
} else {
tmp = fabs((z / (y_m / x)));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = abs((z * (x / y_m)))
t_1 = abs((x / y_m))
if (x <= (-4.4d+191)) then
tmp = t_0
else if (x <= (-3d+34)) then
tmp = t_1
else if (x <= (-7.8d-36)) then
tmp = t_0
else if (x <= 6.5d-25) then
tmp = abs((4.0d0 / y_m))
else if (x <= 1.55d+209) then
tmp = t_0
else if (x <= 1.1d+296) then
tmp = t_1
else
tmp = abs((z / (y_m / x)))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs((z * (x / y_m)));
double t_1 = Math.abs((x / y_m));
double tmp;
if (x <= -4.4e+191) {
tmp = t_0;
} else if (x <= -3e+34) {
tmp = t_1;
} else if (x <= -7.8e-36) {
tmp = t_0;
} else if (x <= 6.5e-25) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 1.55e+209) {
tmp = t_0;
} else if (x <= 1.1e+296) {
tmp = t_1;
} else {
tmp = Math.abs((z / (y_m / x)));
}
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 <= -4.4e+191: tmp = t_0 elif x <= -3e+34: tmp = t_1 elif x <= -7.8e-36: tmp = t_0 elif x <= 6.5e-25: tmp = math.fabs((4.0 / y_m)) elif x <= 1.55e+209: tmp = t_0 elif x <= 1.1e+296: tmp = t_1 else: tmp = math.fabs((z / (y_m / x))) 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 <= -4.4e+191) tmp = t_0; elseif (x <= -3e+34) tmp = t_1; elseif (x <= -7.8e-36) tmp = t_0; elseif (x <= 6.5e-25) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 1.55e+209) tmp = t_0; elseif (x <= 1.1e+296) tmp = t_1; else tmp = abs(Float64(z / Float64(y_m / x))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs((z * (x / y_m))); t_1 = abs((x / y_m)); tmp = 0.0; if (x <= -4.4e+191) tmp = t_0; elseif (x <= -3e+34) tmp = t_1; elseif (x <= -7.8e-36) tmp = t_0; elseif (x <= 6.5e-25) tmp = abs((4.0 / y_m)); elseif (x <= 1.55e+209) tmp = t_0; elseif (x <= 1.1e+296) tmp = t_1; else tmp = abs((z / (y_m / x))); 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, -4.4e+191], t$95$0, If[LessEqual[x, -3e+34], t$95$1, If[LessEqual[x, -7.8e-36], t$95$0, If[LessEqual[x, 6.5e-25], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.55e+209], t$95$0, If[LessEqual[x, 1.1e+296], t$95$1, N[Abs[N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|z \cdot \frac{x}{y_m}\right|\\
t_1 := \left|\frac{x}{y_m}\right|\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{-36}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-25}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+209}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+296}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{z}{\frac{y_m}{x}}\right|\\
\end{array}
\end{array}
if x < -4.4e191 or -3.00000000000000018e34 < x < -7.8000000000000001e-36 or 6.5e-25 < x < 1.55e209Initial program 92.0%
Taylor expanded in z around inf 48.3%
mul-1-neg48.3%
associate-*l/67.7%
distribute-rgt-neg-out67.7%
Simplified67.7%
add-sqr-sqrt36.0%
sqrt-unprod46.7%
sqr-neg46.7%
sqrt-unprod31.6%
add-sqr-sqrt67.7%
associate-/r/61.5%
Applied egg-rr61.5%
associate-/r/67.7%
Applied egg-rr67.7%
if -4.4e191 < x < -3.00000000000000018e34 or 1.55e209 < x < 1.10000000000000007e296Initial program 85.7%
Taylor expanded in z around 0 77.9%
associate-*r/77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in x around inf 77.9%
if -7.8000000000000001e-36 < x < 6.5e-25Initial program 95.8%
Taylor expanded in x around 0 81.4%
if 1.10000000000000007e296 < x Initial program 99.2%
Taylor expanded in z around inf 9.5%
mul-1-neg9.5%
associate-*l/99.2%
distribute-rgt-neg-out99.2%
Simplified99.2%
add-sqr-sqrt50.0%
sqrt-unprod55.9%
sqr-neg55.9%
sqrt-unprod49.2%
add-sqr-sqrt99.2%
associate-*l/9.5%
expm1-log1p-u0.0%
expm1-udef0.0%
associate-*l/0.0%
clear-num0.0%
associate-*l/0.0%
*-un-lft-identity0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p100.0%
Simplified100.0%
Final simplification76.7%
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 -3.05e+34)
t_0
(if (<= x -4.8e-36)
t_1
(if (<= x 3.1e-25) (fabs (/ 4.0 y_m)) (if (<= x 5.5e+155) 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 <= -3.05e+34) {
tmp = t_0;
} else if (x <= -4.8e-36) {
tmp = t_1;
} else if (x <= 3.1e-25) {
tmp = fabs((4.0 / y_m));
} else if (x <= 5.5e+155) {
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 <= (-3.05d+34)) then
tmp = t_0
else if (x <= (-4.8d-36)) then
tmp = t_1
else if (x <= 3.1d-25) then
tmp = abs((4.0d0 / y_m))
else if (x <= 5.5d+155) 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 <= -3.05e+34) {
tmp = t_0;
} else if (x <= -4.8e-36) {
tmp = t_1;
} else if (x <= 3.1e-25) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 5.5e+155) {
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 <= -3.05e+34: tmp = t_0 elif x <= -4.8e-36: tmp = t_1 elif x <= 3.1e-25: tmp = math.fabs((4.0 / y_m)) elif x <= 5.5e+155: 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 <= -3.05e+34) tmp = t_0; elseif (x <= -4.8e-36) tmp = t_1; elseif (x <= 3.1e-25) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 5.5e+155) 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 <= -3.05e+34) tmp = t_0; elseif (x <= -4.8e-36) tmp = t_1; elseif (x <= 3.1e-25) tmp = abs((4.0 / y_m)); elseif (x <= 5.5e+155) 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, -3.05e+34], t$95$0, If[LessEqual[x, -4.8e-36], t$95$1, If[LessEqual[x, 3.1e-25], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.5e+155], 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 -3.05 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-25}:\\
\;\;\;\;\left|\frac{4}{y_m}\right|\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+155}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -3.04999999999999998e34 or 5.5000000000000001e155 < x Initial program 87.0%
Taylor expanded in z around 0 70.8%
associate-*r/70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around inf 70.8%
if -3.04999999999999998e34 < x < -4.8e-36 or 3.09999999999999995e-25 < x < 5.5000000000000001e155Initial program 95.0%
Taylor expanded in z around inf 53.6%
mul-1-neg53.6%
associate-*l/62.5%
distribute-rgt-neg-out62.5%
Simplified62.5%
add-sqr-sqrt34.1%
sqrt-unprod46.6%
sqr-neg46.6%
sqrt-unprod28.2%
add-sqr-sqrt62.5%
associate-*l/53.6%
expm1-log1p-u22.6%
expm1-udef15.3%
associate-*l/15.3%
clear-num15.3%
associate-*l/15.3%
*-un-lft-identity15.3%
Applied egg-rr15.3%
expm1-def22.5%
expm1-log1p60.1%
associate-/r/60.2%
*-commutative60.2%
Simplified60.2%
if -4.8e-36 < x < 3.09999999999999995e-25Initial program 95.8%
Taylor expanded in x around 0 81.4%
Final simplification74.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -2.4e+16) (not (<= x 7.2e+15))) (fabs (/ x (/ y_m (- 1.0 z)))) (fabs (/ (- (+ 4.0 x) (* x z)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -2.4e+16) || !(x <= 7.2e+15)) {
tmp = fabs((x / (y_m / (1.0 - z))));
} 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) :: tmp
if ((x <= (-2.4d+16)) .or. (.not. (x <= 7.2d+15))) then
tmp = abs((x / (y_m / (1.0d0 - z))))
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 tmp;
if ((x <= -2.4e+16) || !(x <= 7.2e+15)) {
tmp = Math.abs((x / (y_m / (1.0 - z))));
} else {
tmp = Math.abs((((4.0 + x) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (x <= -2.4e+16) or not (x <= 7.2e+15): tmp = math.fabs((x / (y_m / (1.0 - z)))) else: tmp = math.fabs((((4.0 + x) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((x <= -2.4e+16) || !(x <= 7.2e+15)) tmp = abs(Float64(x / Float64(y_m / Float64(1.0 - z)))); 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) tmp = 0.0; if ((x <= -2.4e+16) || ~((x <= 7.2e+15))) tmp = abs((x / (y_m / (1.0 - z)))); 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_] := If[Or[LessEqual[x, -2.4e+16], N[Not[LessEqual[x, 7.2e+15]], $MachinePrecision]], N[Abs[N[(x / N[(y$95$m / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+16} \lor \neg \left(x \leq 7.2 \cdot 10^{+15}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{1 - z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(4 + x\right) - x \cdot z}{y_m}\right|\\
\end{array}
\end{array}
if x < -2.4e16 or 7.2e15 < x Initial program 88.0%
Taylor expanded in y around 0 90.5%
Taylor expanded in x around inf 90.5%
associate-/l*99.8%
Simplified99.8%
if -2.4e16 < x < 7.2e15Initial program 96.3%
Taylor expanded in y around 0 99.9%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -1.5e-35) (not (<= x 6.2e-25))) (fabs (* x (/ (+ z -1.0) 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.5e-35) || !(x <= 6.2e-25)) {
tmp = fabs((x * ((z + -1.0) / 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.5d-35)) .or. (.not. (x <= 6.2d-25))) then
tmp = abs((x * ((z + (-1.0d0)) / 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.5e-35) || !(x <= 6.2e-25)) {
tmp = Math.abs((x * ((z + -1.0) / 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.5e-35) or not (x <= 6.2e-25): tmp = math.fabs((x * ((z + -1.0) / 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.5e-35) || !(x <= 6.2e-25)) tmp = abs(Float64(x * Float64(Float64(z + -1.0) / 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.5e-35) || ~((x <= 6.2e-25))) tmp = abs((x * ((z + -1.0) / 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.5e-35], N[Not[LessEqual[x, 6.2e-25]], $MachinePrecision]], N[Abs[N[(x * N[(N[(z + -1.0), $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.5 \cdot 10^{-35} \lor \neg \left(x \leq 6.2 \cdot 10^{-25}\right):\\
\;\;\;\;\left|x \cdot \frac{z + -1}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\end{array}
\end{array}
if x < -1.49999999999999994e-35 or 6.19999999999999989e-25 < x Initial program 89.5%
Simplified96.9%
Taylor expanded in x around inf 95.4%
Taylor expanded in y around 0 95.4%
if -1.49999999999999994e-35 < x < 6.19999999999999989e-25Initial program 95.8%
Simplified91.5%
Taylor expanded in z around 0 81.4%
associate-*r/81.4%
distribute-lft-in81.4%
metadata-eval81.4%
neg-mul-181.4%
sub-neg81.4%
Simplified81.4%
Final simplification88.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -3.8e-35) (not (<= x 8.5e-26))) (fabs (/ x (/ y_m (- 1.0 z)))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((x <= -3.8e-35) || !(x <= 8.5e-26)) {
tmp = fabs((x / (y_m / (1.0 - 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 ((x <= (-3.8d-35)) .or. (.not. (x <= 8.5d-26))) then
tmp = abs((x / (y_m / (1.0d0 - 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 ((x <= -3.8e-35) || !(x <= 8.5e-26)) {
tmp = Math.abs((x / (y_m / (1.0 - 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 (x <= -3.8e-35) or not (x <= 8.5e-26): tmp = math.fabs((x / (y_m / (1.0 - 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 ((x <= -3.8e-35) || !(x <= 8.5e-26)) tmp = abs(Float64(x / Float64(y_m / Float64(1.0 - 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 ((x <= -3.8e-35) || ~((x <= 8.5e-26))) tmp = abs((x / (y_m / (1.0 - 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[x, -3.8e-35], N[Not[LessEqual[x, 8.5e-26]], $MachinePrecision]], N[Abs[N[(x / N[(y$95$m / N[(1.0 - z), $MachinePrecision]), $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.8 \cdot 10^{-35} \lor \neg \left(x \leq 8.5 \cdot 10^{-26}\right):\\
\;\;\;\;\left|\frac{x}{\frac{y_m}{1 - z}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\end{array}
\end{array}
if x < -3.8000000000000001e-35 or 8.50000000000000004e-26 < x Initial program 89.5%
Taylor expanded in y around 0 91.7%
Taylor expanded in x around inf 87.4%
associate-/l*95.6%
Simplified95.6%
if -3.8000000000000001e-35 < x < 8.50000000000000004e-26Initial program 95.8%
Simplified91.5%
Taylor expanded in z around 0 81.4%
associate-*r/81.4%
distribute-lft-in81.4%
metadata-eval81.4%
neg-mul-181.4%
sub-neg81.4%
Simplified81.4%
Final simplification88.8%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= z -3.9e+66) (fabs (* z (/ x y_m))) (if (<= z 1.45e+155) (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 <= -3.9e+66) {
tmp = fabs((z * (x / y_m)));
} else if (z <= 1.45e+155) {
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 <= (-3.9d+66)) then
tmp = abs((z * (x / y_m)))
else if (z <= 1.45d+155) 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 <= -3.9e+66) {
tmp = Math.abs((z * (x / y_m)));
} else if (z <= 1.45e+155) {
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 <= -3.9e+66: tmp = math.fabs((z * (x / y_m))) elif z <= 1.45e+155: 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 <= -3.9e+66) tmp = abs(Float64(z * Float64(x / y_m))); elseif (z <= 1.45e+155) 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 <= -3.9e+66) tmp = abs((z * (x / y_m))); elseif (z <= 1.45e+155) 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, -3.9e+66], N[Abs[N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 1.45e+155], 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 -3.9 \cdot 10^{+66}:\\
\;\;\;\;\left|z \cdot \frac{x}{y_m}\right|\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+155}:\\
\;\;\;\;\left|\frac{-4 - x}{y_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|x \cdot \frac{z}{y_m}\right|\\
\end{array}
\end{array}
if z < -3.9000000000000004e66Initial program 97.7%
Taylor expanded in z around inf 73.9%
mul-1-neg73.9%
associate-*l/82.6%
distribute-rgt-neg-out82.6%
Simplified82.6%
add-sqr-sqrt82.3%
sqrt-unprod53.8%
sqr-neg53.8%
sqrt-unprod0.0%
add-sqr-sqrt82.6%
associate-/r/82.5%
Applied egg-rr82.5%
associate-/r/82.6%
Applied egg-rr82.6%
if -3.9000000000000004e66 < z < 1.45e155Initial program 92.8%
Simplified97.8%
Taylor expanded in z around 0 89.4%
associate-*r/89.4%
distribute-lft-in89.4%
metadata-eval89.4%
neg-mul-189.4%
sub-neg89.4%
Simplified89.4%
if 1.45e155 < z Initial program 83.8%
Taylor expanded in z around inf 72.2%
mul-1-neg72.2%
associate-*l/79.9%
distribute-rgt-neg-out79.9%
Simplified79.9%
add-sqr-sqrt0.0%
sqrt-unprod33.9%
sqr-neg33.9%
sqrt-unprod79.7%
add-sqr-sqrt79.9%
associate-*l/72.2%
expm1-log1p-u42.9%
expm1-udef30.5%
associate-*l/37.7%
clear-num37.7%
associate-*l/37.7%
*-un-lft-identity37.7%
Applied egg-rr37.7%
expm1-def41.3%
expm1-log1p79.8%
associate-/r/80.5%
*-commutative80.5%
Simplified80.5%
Final simplification87.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= x -10.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 <= -10.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 <= (-10.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 <= -10.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 <= -10.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 <= -10.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 <= -10.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, -10.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 -10.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 < -10.5 or 4 < x Initial program 88.5%
Taylor expanded in z around 0 66.5%
associate-*r/66.5%
metadata-eval66.5%
Simplified66.5%
Taylor expanded in x around inf 64.7%
if -10.5 < x < 4Initial program 96.1%
Taylor expanded in x around 0 76.3%
Final simplification70.7%
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 92.5%
Taylor expanded in x around 0 42.2%
Final simplification42.2%
herbie shell --seed 2023339
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))