
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 100000.0) (fabs (/ (- 4.0 (* x (+ z -1.0))) 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 <= 100000.0) {
tmp = fabs(((4.0 - (x * (z + -1.0))) / 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 <= 100000.0d0) then
tmp = abs(((4.0d0 - (x * (z + (-1.0d0)))) / 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 <= 100000.0) {
tmp = Math.abs(((4.0 - (x * (z + -1.0))) / 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 <= 100000.0: tmp = math.fabs(((4.0 - (x * (z + -1.0))) / 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 <= 100000.0) tmp = abs(Float64(Float64(4.0 - Float64(x * Float64(z + -1.0))) / 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 <= 100000.0) tmp = abs(((4.0 - (x * (z + -1.0))) / 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, 100000.0], N[Abs[N[(N[(4.0 - N[(x * N[(z + -1.0), $MachinePrecision]), $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 100000:\\
\;\;\;\;\left|\frac{4 - x \cdot \left(z + -1\right)}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 + x}{y\_m} - x \cdot \frac{z}{y\_m}\right|\\
\end{array}
\end{array}
if y < 1e5Initial program 90.7%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
div-subN/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
sub-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6497.1%
Simplified97.1%
if 1e5 < y Initial program 97.2%
associate-*l/N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Final simplification97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (/ x y_m))))
(if (<= x -1.55e+140)
t_0
(if (<= x -7.8e-112)
(fabs (* x (/ z y_m)))
(if (<= x 2e-47)
(fabs (/ 4.0 y_m))
(if (<= x 6e+99) (fabs (/ x (/ y_m z))) 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.55e+140) {
tmp = t_0;
} else if (x <= -7.8e-112) {
tmp = fabs((x * (z / y_m)));
} else if (x <= 2e-47) {
tmp = fabs((4.0 / y_m));
} else if (x <= 6e+99) {
tmp = fabs((x / (y_m / z)));
} 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.55d+140)) then
tmp = t_0
else if (x <= (-7.8d-112)) then
tmp = abs((x * (z / y_m)))
else if (x <= 2d-47) then
tmp = abs((4.0d0 / y_m))
else if (x <= 6d+99) then
tmp = abs((x / (y_m / z)))
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.55e+140) {
tmp = t_0;
} else if (x <= -7.8e-112) {
tmp = Math.abs((x * (z / y_m)));
} else if (x <= 2e-47) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 6e+99) {
tmp = Math.abs((x / (y_m / z)));
} 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.55e+140: tmp = t_0 elif x <= -7.8e-112: tmp = math.fabs((x * (z / y_m))) elif x <= 2e-47: tmp = math.fabs((4.0 / y_m)) elif x <= 6e+99: tmp = math.fabs((x / (y_m / z))) 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.55e+140) tmp = t_0; elseif (x <= -7.8e-112) tmp = abs(Float64(x * Float64(z / y_m))); elseif (x <= 2e-47) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 6e+99) tmp = abs(Float64(x / Float64(y_m / z))); 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.55e+140) tmp = t_0; elseif (x <= -7.8e-112) tmp = abs((x * (z / y_m))); elseif (x <= 2e-47) tmp = abs((4.0 / y_m)); elseif (x <= 6e+99) tmp = abs((x / (y_m / z))); 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.55e+140], t$95$0, If[LessEqual[x, -7.8e-112], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2e-47], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 6e+99], N[Abs[N[(x / N[(y$95$m / z), $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.55 \cdot 10^{+140}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{-112}:\\
\;\;\;\;\left|x \cdot \frac{z}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-47}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+99}:\\
\;\;\;\;\left|\frac{x}{\frac{y\_m}{z}}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.55e140 or 6.00000000000000029e99 < x Initial program 80.4%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6489.8%
Simplified89.8%
Taylor expanded in z around 0
/-lowering-/.f6473.4%
Simplified73.4%
if -1.55e140 < x < -7.8000000000000002e-112Initial program 99.7%
Taylor expanded in x around inf
/-lowering-/.f6487.8%
Simplified87.8%
fabs-subN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6487.7%
Applied egg-rr87.7%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6468.5%
Simplified68.5%
if -7.8000000000000002e-112 < x < 1.9999999999999999e-47Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f6484.5%
Simplified84.5%
if 1.9999999999999999e-47 < x < 6.00000000000000029e99Initial program 96.5%
Taylor expanded in x around inf
/-lowering-/.f6493.4%
Simplified93.4%
fabs-subN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.7%
Applied egg-rr96.7%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.7%
Simplified78.7%
fabs-lowering-fabs.f64N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6478.7%
Applied egg-rr78.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 -6.6e+140)
t_0
(if (<= x -7.8e-112)
t_1
(if (<= x 2.5e-46) (fabs (/ 4.0 y_m)) (if (<= x 2.25e+98) 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 <= -6.6e+140) {
tmp = t_0;
} else if (x <= -7.8e-112) {
tmp = t_1;
} else if (x <= 2.5e-46) {
tmp = fabs((4.0 / y_m));
} else if (x <= 2.25e+98) {
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 <= (-6.6d+140)) then
tmp = t_0
else if (x <= (-7.8d-112)) then
tmp = t_1
else if (x <= 2.5d-46) then
tmp = abs((4.0d0 / y_m))
else if (x <= 2.25d+98) 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 <= -6.6e+140) {
tmp = t_0;
} else if (x <= -7.8e-112) {
tmp = t_1;
} else if (x <= 2.5e-46) {
tmp = Math.abs((4.0 / y_m));
} else if (x <= 2.25e+98) {
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 <= -6.6e+140: tmp = t_0 elif x <= -7.8e-112: tmp = t_1 elif x <= 2.5e-46: tmp = math.fabs((4.0 / y_m)) elif x <= 2.25e+98: 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 <= -6.6e+140) tmp = t_0; elseif (x <= -7.8e-112) tmp = t_1; elseif (x <= 2.5e-46) tmp = abs(Float64(4.0 / y_m)); elseif (x <= 2.25e+98) 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 <= -6.6e+140) tmp = t_0; elseif (x <= -7.8e-112) tmp = t_1; elseif (x <= 2.5e-46) tmp = abs((4.0 / y_m)); elseif (x <= 2.25e+98) 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, -6.6e+140], t$95$0, If[LessEqual[x, -7.8e-112], t$95$1, If[LessEqual[x, 2.5e-46], N[Abs[N[(4.0 / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.25e+98], 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 -6.6 \cdot 10^{+140}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -7.8 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.6000000000000003e140 or 2.2500000000000001e98 < x Initial program 80.4%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6489.8%
Simplified89.8%
Taylor expanded in z around 0
/-lowering-/.f6473.4%
Simplified73.4%
if -6.6000000000000003e140 < x < -7.8000000000000002e-112 or 2.49999999999999996e-46 < x < 2.2500000000000001e98Initial program 98.5%
Taylor expanded in x around inf
/-lowering-/.f6489.9%
Simplified89.9%
fabs-subN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6491.2%
Applied egg-rr91.2%
Taylor expanded in z around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6472.4%
Simplified72.4%
if -7.8000000000000002e-112 < x < 2.49999999999999996e-46Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f6484.5%
Simplified84.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* (- 1.0 z) (/ x y_m)))))
(if (<= x -27.5)
t_0
(if (<= x 46000000.0) (fabs (/ (- 4.0 (* x z)) y_m)) t_0))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs(((1.0 - z) * (x / y_m)));
double tmp;
if (x <= -27.5) {
tmp = t_0;
} else if (x <= 46000000.0) {
tmp = fabs(((4.0 - (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(((1.0d0 - z) * (x / y_m)))
if (x <= (-27.5d0)) then
tmp = t_0
else if (x <= 46000000.0d0) then
tmp = abs(((4.0d0 - (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(((1.0 - z) * (x / y_m)));
double tmp;
if (x <= -27.5) {
tmp = t_0;
} else if (x <= 46000000.0) {
tmp = Math.abs(((4.0 - (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(((1.0 - z) * (x / y_m))) tmp = 0 if x <= -27.5: tmp = t_0 elif x <= 46000000.0: tmp = math.fabs(((4.0 - (x * z)) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))) tmp = 0.0 if (x <= -27.5) tmp = t_0; elseif (x <= 46000000.0) tmp = abs(Float64(Float64(4.0 - 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(((1.0 - z) * (x / y_m))); tmp = 0.0; if (x <= -27.5) tmp = t_0; elseif (x <= 46000000.0) tmp = abs(((4.0 - (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[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -27.5], t$95$0, If[LessEqual[x, 46000000.0], N[Abs[N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -27.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 46000000:\\
\;\;\;\;\left|\frac{4 - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -27.5 or 4.6e7 < x Initial program 86.3%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6490.1%
Simplified90.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.7%
Applied egg-rr99.7%
if -27.5 < x < 4.6e7Initial program 98.0%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
div-subN/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
sub-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in z around inf
*-lowering-*.f6499.9%
Simplified99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* (- 1.0 z) (/ x y_m)))))
(if (<= x -7.8e-112)
t_0
(if (<= x 1.45e-46) (fabs (/ (+ 4.0 x) y_m)) t_0))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs(((1.0 - z) * (x / y_m)));
double tmp;
if (x <= -7.8e-112) {
tmp = t_0;
} else if (x <= 1.45e-46) {
tmp = fabs(((4.0 + x) / 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(((1.0d0 - z) * (x / y_m)))
if (x <= (-7.8d-112)) then
tmp = t_0
else if (x <= 1.45d-46) then
tmp = abs(((4.0d0 + x) / 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(((1.0 - z) * (x / y_m)));
double tmp;
if (x <= -7.8e-112) {
tmp = t_0;
} else if (x <= 1.45e-46) {
tmp = Math.abs(((4.0 + x) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs(((1.0 - z) * (x / y_m))) tmp = 0 if x <= -7.8e-112: tmp = t_0 elif x <= 1.45e-46: tmp = math.fabs(((4.0 + x) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))) tmp = 0.0 if (x <= -7.8e-112) tmp = t_0; elseif (x <= 1.45e-46) tmp = abs(Float64(Float64(4.0 + x) / 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(((1.0 - z) * (x / y_m))); tmp = 0.0; if (x <= -7.8e-112) tmp = t_0; elseif (x <= 1.45e-46) tmp = abs(((4.0 + x) / 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[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -7.8e-112], t$95$0, If[LessEqual[x, 1.45e-46], N[Abs[N[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-46}:\\
\;\;\;\;\left|\frac{4 + x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -7.8000000000000002e-112 or 1.45000000000000002e-46 < x Initial program 89.2%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6488.2%
Simplified88.2%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6495.7%
Applied egg-rr95.7%
if -7.8000000000000002e-112 < x < 1.45000000000000002e-46Initial program 97.3%
Taylor expanded in z around 0
remove-double-negN/A
mul-1-negN/A
sub-negN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-subN/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
+-lowering-+.f6484.5%
Simplified84.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (fabs (/ z (/ y_m x))))) (if (<= z -8.2e+76) t_0 (if (<= z 4.7e+27) (fabs (/ (+ 4.0 x) y_m)) t_0))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z / (y_m / x)));
double tmp;
if (z <= -8.2e+76) {
tmp = t_0;
} else if (z <= 4.7e+27) {
tmp = fabs(((4.0 + x) / 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((z / (y_m / x)))
if (z <= (-8.2d+76)) then
tmp = t_0
else if (z <= 4.7d+27) then
tmp = abs(((4.0d0 + x) / 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((z / (y_m / x)));
double tmp;
if (z <= -8.2e+76) {
tmp = t_0;
} else if (z <= 4.7e+27) {
tmp = Math.abs(((4.0 + x) / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs((z / (y_m / x))) tmp = 0 if z <= -8.2e+76: tmp = t_0 elif z <= 4.7e+27: tmp = math.fabs(((4.0 + x) / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(z / Float64(y_m / x))) tmp = 0.0 if (z <= -8.2e+76) tmp = t_0; elseif (z <= 4.7e+27) tmp = abs(Float64(Float64(4.0 + x) / 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((z / (y_m / x))); tmp = 0.0; if (z <= -8.2e+76) tmp = t_0; elseif (z <= 4.7e+27) tmp = abs(((4.0 + x) / 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[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -8.2e+76], t$95$0, If[LessEqual[z, 4.7e+27], N[Abs[N[(N[(4.0 + x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+27}:\\
\;\;\;\;\left|\frac{4 + x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.1999999999999997e76 or 4.69999999999999976e27 < z Initial program 92.0%
Taylor expanded in x around inf
/-lowering-/.f6475.0%
Simplified75.0%
fabs-subN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6480.5%
Applied egg-rr80.5%
Taylor expanded in z around inf
Simplified80.5%
if -8.1999999999999997e76 < z < 4.69999999999999976e27Initial program 92.5%
Taylor expanded in z around 0
remove-double-negN/A
mul-1-negN/A
sub-negN/A
associate-*r/N/A
metadata-evalN/A
associate-*r/N/A
div-subN/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
/-lowering-/.f64N/A
+-lowering-+.f6495.2%
Simplified95.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (fabs (/ z (/ y_m x))))) (if (<= x -7.8e-112) t_0 (if (<= x 1.2e-46) (fabs (/ 4.0 y_m)) t_0))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((z / (y_m / x)));
double tmp;
if (x <= -7.8e-112) {
tmp = t_0;
} else if (x <= 1.2e-46) {
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((z / (y_m / x)))
if (x <= (-7.8d-112)) then
tmp = t_0
else if (x <= 1.2d-46) 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((z / (y_m / x)));
double tmp;
if (x <= -7.8e-112) {
tmp = t_0;
} else if (x <= 1.2e-46) {
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((z / (y_m / x))) tmp = 0 if x <= -7.8e-112: tmp = t_0 elif x <= 1.2e-46: 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(z / Float64(y_m / x))) tmp = 0.0 if (x <= -7.8e-112) tmp = t_0; elseif (x <= 1.2e-46) 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((z / (y_m / x))); tmp = 0.0; if (x <= -7.8e-112) tmp = t_0; elseif (x <= 1.2e-46) 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[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -7.8e-112], t$95$0, If[LessEqual[x, 1.2e-46], 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|\frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{-112}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-46}:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -7.8000000000000002e-112 or 1.20000000000000007e-46 < x Initial program 89.2%
Taylor expanded in x around inf
/-lowering-/.f6485.1%
Simplified85.1%
fabs-subN/A
fabs-lowering-fabs.f64N/A
*-commutativeN/A
clear-numN/A
div-invN/A
clear-numN/A
sub-divN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6495.6%
Applied egg-rr95.6%
Taylor expanded in z around inf
Simplified70.0%
if -7.8000000000000002e-112 < x < 1.20000000000000007e-46Initial program 97.3%
Taylor expanded in x around 0
/-lowering-/.f6484.5%
Simplified84.5%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -2e+20) (fabs (* (- 1.0 z) (/ x y_m))) (fabs (/ (- 4.0 (* x (+ z -1.0))) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -2e+20) {
tmp = fabs(((1.0 - z) * (x / y_m)));
} else {
tmp = fabs(((4.0 - (x * (z + -1.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 <= (-2d+20)) then
tmp = abs(((1.0d0 - z) * (x / y_m)))
else
tmp = abs(((4.0d0 - (x * (z + (-1.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 <= -2e+20) {
tmp = Math.abs(((1.0 - z) * (x / y_m)));
} else {
tmp = Math.abs(((4.0 - (x * (z + -1.0))) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -2e+20: tmp = math.fabs(((1.0 - z) * (x / y_m))) else: tmp = math.fabs(((4.0 - (x * (z + -1.0))) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -2e+20) tmp = abs(Float64(Float64(1.0 - z) * Float64(x / y_m))); else tmp = abs(Float64(Float64(4.0 - Float64(x * Float64(z + -1.0))) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -2e+20) tmp = abs(((1.0 - z) * (x / y_m))); else tmp = abs(((4.0 - (x * (z + -1.0))) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -2e+20], N[Abs[N[(N[(1.0 - z), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(4.0 - N[(x * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+20}:\\
\;\;\;\;\left|\left(1 - z\right) \cdot \frac{x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{4 - x \cdot \left(z + -1\right)}{y\_m}\right|\\
\end{array}
\end{array}
if x < -2e20Initial program 85.2%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6487.6%
Simplified87.6%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.9%
Applied egg-rr99.9%
if -2e20 < x Initial program 94.8%
fabs-lowering-fabs.f64N/A
associate-*l/N/A
div-subN/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
remove-double-negN/A
unsub-negN/A
associate-+l-N/A
--lowering--.f64N/A
neg-mul-1N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-out--N/A
*-lowering-*.f64N/A
sub-negN/A
remove-double-negN/A
+-commutativeN/A
+-lowering-+.f6498.0%
Simplified98.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (fabs (/ x y_m)))) (if (<= x -1.55) t_0 (if (<= x 4.0) (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 / y_m));
double tmp;
if (x <= -1.55) {
tmp = t_0;
} else if (x <= 4.0) {
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 / y_m))
if (x <= (-1.55d0)) then
tmp = t_0
else if (x <= 4.0d0) 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 / y_m));
double tmp;
if (x <= -1.55) {
tmp = t_0;
} else if (x <= 4.0) {
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 / y_m)) tmp = 0 if x <= -1.55: tmp = t_0 elif x <= 4.0: 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 / y_m)) tmp = 0.0 if (x <= -1.55) tmp = t_0; elseif (x <= 4.0) 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 / y_m)); tmp = 0.0; if (x <= -1.55) tmp = t_0; elseif (x <= 4.0) 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 / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.55], t$95$0, If[LessEqual[x, 4.0], 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|\frac{x}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.55:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\left|\frac{4}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.55000000000000004 or 4 < x Initial program 86.5%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
sub-negN/A
mul-1-negN/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
*-lowering-*.f64N/A
--lowering--.f6490.3%
Simplified90.3%
Taylor expanded in z around 0
/-lowering-/.f6461.1%
Simplified61.1%
if -1.55000000000000004 < x < 4Initial program 97.9%
Taylor expanded in x around 0
/-lowering-/.f6469.5%
Simplified69.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 92.3%
Taylor expanded in x around 0
/-lowering-/.f6437.4%
Simplified37.4%
herbie shell --seed 2024191
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))