
(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 19 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 0.002) (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x)))) (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 <= 0.002) {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
} 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 <= 0.002) tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); 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, 0.002], N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $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 0.002:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\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 < 2e-3Initial program 87.9%
Simplified97.3%
if 2e-3 < y Initial program 94.2%
fabs-sub94.2%
associate-*l/92.4%
associate-*r/99.9%
fma-neg99.9%
distribute-neg-frac99.9%
+-commutative99.9%
distribute-neg-in99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (fabs (- t_0 (* z (/ x y_m))))))
(if (<= t_1 2e+30)
(fabs (- t_0 (/ (* x z) y_m)))
(if (<= t_1 2e+296) t_1 (fabs (* (/ -1.0 y_m) (fma x z (- -4.0 x))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = fabs((t_0 - (z * (x / y_m))));
double tmp;
if (t_1 <= 2e+30) {
tmp = fabs((t_0 - ((x * z) / y_m)));
} else if (t_1 <= 2e+296) {
tmp = t_1;
} else {
tmp = fabs(((-1.0 / y_m) * fma(x, z, (-4.0 - x))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = abs(Float64(t_0 - Float64(z * Float64(x / y_m)))) tmp = 0.0 if (t_1 <= 2e+30) tmp = abs(Float64(t_0 - Float64(Float64(x * z) / y_m))); elseif (t_1 <= 2e+296) tmp = t_1; else tmp = abs(Float64(Float64(-1.0 / y_m) * fma(x, z, Float64(-4.0 - x)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 2e+30], N[Abs[N[(t$95$0 - N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$1, 2e+296], t$95$1, N[Abs[N[(N[(-1.0 / y$95$m), $MachinePrecision] * N[(x * z + N[(-4.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := \left|t\_0 - z \cdot \frac{x}{y\_m}\right|\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\left|t\_0 - \frac{x \cdot z}{y\_m}\right|\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+296}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2e30Initial program 92.3%
Taylor expanded in x around 0 99.9%
if 2e30 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 1.99999999999999996e296Initial program 99.9%
if 1.99999999999999996e296 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 66.7%
Simplified100.0%
Final simplification99.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (* z (/ x y_m))) (t_2 (fabs (- t_0 t_1))))
(if (<= t_2 2e+30)
(fabs (- t_0 (/ (* x z) y_m)))
(if (<= t_2 2e+306) t_2 (fabs t_1)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double t_2 = fabs((t_0 - t_1));
double tmp;
if (t_2 <= 2e+30) {
tmp = fabs((t_0 - ((x * z) / y_m)));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = fabs(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) :: t_2
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = z * (x / y_m)
t_2 = abs((t_0 - t_1))
if (t_2 <= 2d+30) then
tmp = abs((t_0 - ((x * z) / y_m)))
else if (t_2 <= 2d+306) then
tmp = t_2
else
tmp = abs(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 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double t_2 = Math.abs((t_0 - t_1));
double tmp;
if (t_2 <= 2e+30) {
tmp = Math.abs((t_0 - ((x * z) / y_m)));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = Math.abs(t_1);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = z * (x / y_m) t_2 = math.fabs((t_0 - t_1)) tmp = 0 if t_2 <= 2e+30: tmp = math.fabs((t_0 - ((x * z) / y_m))) elif t_2 <= 2e+306: tmp = t_2 else: tmp = math.fabs(t_1) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(z * Float64(x / y_m)) t_2 = abs(Float64(t_0 - t_1)) tmp = 0.0 if (t_2 <= 2e+30) tmp = abs(Float64(t_0 - Float64(Float64(x * z) / y_m))); elseif (t_2 <= 2e+306) tmp = t_2; else tmp = abs(t_1); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = z * (x / y_m); t_2 = abs((t_0 - t_1)); tmp = 0.0; if (t_2 <= 2e+30) tmp = abs((t_0 - ((x * z) / y_m))); elseif (t_2 <= 2e+306) tmp = t_2; else tmp = abs(t_1); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(t$95$0 - t$95$1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 2e+30], N[Abs[N[(t$95$0 - N[(N[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$2, 2e+306], t$95$2, N[Abs[t$95$1], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := z \cdot \frac{x}{y\_m}\\
t_2 := \left|t\_0 - t\_1\right|\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\left|t\_0 - \frac{x \cdot z}{y\_m}\right|\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2e30Initial program 92.3%
Taylor expanded in x around 0 99.9%
if 2e30 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2.00000000000000003e306Initial program 99.9%
if 2.00000000000000003e306 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 64.8%
Simplified100.0%
Taylor expanded in z around inf 81.0%
mul-1-neg81.0%
distribute-frac-neg281.0%
*-commutative81.0%
associate-*r/100.0%
Simplified100.0%
Final simplification99.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (* z (/ x y_m))) (t_1 (fabs (- (/ (+ x 4.0) y_m) t_0)))) (if (<= t_1 2e+306) t_1 (fabs t_0))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = z * (x / y_m);
double t_1 = fabs((((x + 4.0) / y_m) - t_0));
double tmp;
if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = fabs(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 = z * (x / y_m)
t_1 = abs((((x + 4.0d0) / y_m) - t_0))
if (t_1 <= 2d+306) then
tmp = t_1
else
tmp = abs(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 = z * (x / y_m);
double t_1 = Math.abs((((x + 4.0) / y_m) - t_0));
double tmp;
if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = Math.abs(t_0);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = z * (x / y_m) t_1 = math.fabs((((x + 4.0) / y_m) - t_0)) tmp = 0 if t_1 <= 2e+306: tmp = t_1 else: tmp = math.fabs(t_0) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(z * Float64(x / y_m)) t_1 = abs(Float64(Float64(Float64(x + 4.0) / y_m) - t_0)) tmp = 0.0 if (t_1 <= 2e+306) tmp = t_1; else tmp = abs(t_0); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = z * (x / y_m); t_1 = abs((((x + 4.0) / y_m) - t_0)); tmp = 0.0; if (t_1 <= 2e+306) tmp = t_1; else tmp = abs(t_0); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 2e+306], t$95$1, N[Abs[t$95$0], $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := z \cdot \frac{x}{y\_m}\\
t_1 := \left|\frac{x + 4}{y\_m} - t\_0\right|\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right|\\
\end{array}
\end{array}
if (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) < 2.00000000000000003e306Initial program 96.4%
if 2.00000000000000003e306 < (fabs.f64 (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z))) Initial program 64.8%
Simplified100.0%
Taylor expanded in z around inf 81.0%
mul-1-neg81.0%
distribute-frac-neg281.0%
*-commutative81.0%
associate-*r/100.0%
Simplified100.0%
Final simplification97.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (* z (/ x y_m))) (t_2 (- t_0 t_1)))
(if (<= t_2 -4e-223)
(- (* x (/ z y_m)) t_0)
(if (<= t_2 1e-33)
(- t_0 (/ x (/ y_m z)))
(if (<= t_2 2e+306) t_2 (fabs t_1))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double t_2 = t_0 - t_1;
double tmp;
if (t_2 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_2 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = fabs(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) :: t_2
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = z * (x / y_m)
t_2 = t_0 - t_1
if (t_2 <= (-4d-223)) then
tmp = (x * (z / y_m)) - t_0
else if (t_2 <= 1d-33) then
tmp = t_0 - (x / (y_m / z))
else if (t_2 <= 2d+306) then
tmp = t_2
else
tmp = abs(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 = (x + 4.0) / y_m;
double t_1 = z * (x / y_m);
double t_2 = t_0 - t_1;
double tmp;
if (t_2 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_2 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = Math.abs(t_1);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = z * (x / y_m) t_2 = t_0 - t_1 tmp = 0 if t_2 <= -4e-223: tmp = (x * (z / y_m)) - t_0 elif t_2 <= 1e-33: tmp = t_0 - (x / (y_m / z)) elif t_2 <= 2e+306: tmp = t_2 else: tmp = math.fabs(t_1) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(z * Float64(x / y_m)) t_2 = Float64(t_0 - t_1) tmp = 0.0 if (t_2 <= -4e-223) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (t_2 <= 1e-33) tmp = Float64(t_0 - Float64(x / Float64(y_m / z))); elseif (t_2 <= 2e+306) tmp = t_2; else tmp = abs(t_1); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = z * (x / y_m); t_2 = t_0 - t_1; tmp = 0.0; if (t_2 <= -4e-223) tmp = (x * (z / y_m)) - t_0; elseif (t_2 <= 1e-33) tmp = t_0 - (x / (y_m / z)); elseif (t_2 <= 2e+306) tmp = t_2; else tmp = abs(t_1); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-223], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$2, 1e-33], N[(t$95$0 - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+306], t$95$2, N[Abs[t$95$1], $MachinePrecision]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := z \cdot \frac{x}{y\_m}\\
t_2 := t\_0 - t\_1\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;t\_2 \leq 10^{-33}:\\
\;\;\;\;t\_0 - \frac{x}{\frac{y\_m}{z}}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left|t\_1\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -3.9999999999999999e-223Initial program 100.0%
fabs-sub100.0%
div-inv99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
sub-neg99.9%
div-inv100.0%
associate-*l/95.4%
associate-*r/95.4%
fma-undefine95.4%
add-sqr-sqrt94.9%
fabs-sqr94.9%
add-sqr-sqrt95.4%
fma-undefine95.4%
associate-*r/95.4%
associate-*l/100.0%
div-inv99.9%
Applied egg-rr95.4%
if -3.9999999999999999e-223 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 1.0000000000000001e-33Initial program 86.7%
add-sqr-sqrt78.2%
fabs-sqr78.2%
add-sqr-sqrt79.4%
associate-*l/85.5%
associate-*r/85.5%
Applied egg-rr85.5%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if 1.0000000000000001e-33 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 2.00000000000000003e306Initial program 99.9%
Taylor expanded in x around 0 91.1%
add-sqr-sqrt90.5%
fabs-sqr90.5%
add-sqr-sqrt91.1%
div-inv91.1%
*-commutative91.1%
associate-*l*99.8%
div-inv99.9%
Applied egg-rr99.9%
if 2.00000000000000003e306 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 47.2%
Simplified100.0%
Taylor expanded in z around inf 79.3%
mul-1-neg79.3%
distribute-frac-neg279.3%
*-commutative79.3%
associate-*r/100.0%
Simplified100.0%
Final simplification95.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (- t_0 (* z (/ x y_m)))))
(if (<= t_1 -4e-223)
(- (* x (/ z y_m)) t_0)
(if (<= t_1 1e-33)
(- t_0 (/ x (/ y_m z)))
(if (<= t_1 INFINITY) t_1 (fabs (/ (- -4.0 x) y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = t_0 - (z * (x / y_m)) tmp = 0 if t_1 <= -4e-223: tmp = (x * (z / y_m)) - t_0 elif t_1 <= 1e-33: tmp = t_0 - (x / (y_m / z)) elif t_1 <= math.inf: tmp = t_1 else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(t_0 - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_1 <= -4e-223) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (t_1 <= 1e-33) tmp = Float64(t_0 - Float64(x / Float64(y_m / z))); elseif (t_1 <= Inf) tmp = t_1; 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) t_0 = (x + 4.0) / y_m; t_1 = t_0 - (z * (x / y_m)); tmp = 0.0; if (t_1 <= -4e-223) tmp = (x * (z / y_m)) - t_0; elseif (t_1 <= 1e-33) tmp = t_0 - (x / (y_m / z)); elseif (t_1 <= Inf) tmp = t_1; 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_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-223], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1e-33], N[(t$95$0 - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$1, N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := t\_0 - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{-33}:\\
\;\;\;\;t\_0 - \frac{x}{\frac{y\_m}{z}}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -3.9999999999999999e-223Initial program 100.0%
fabs-sub100.0%
div-inv99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
sub-neg99.9%
div-inv100.0%
associate-*l/95.4%
associate-*r/95.4%
fma-undefine95.4%
add-sqr-sqrt94.9%
fabs-sqr94.9%
add-sqr-sqrt95.4%
fma-undefine95.4%
associate-*r/95.4%
associate-*l/100.0%
div-inv99.9%
Applied egg-rr95.4%
if -3.9999999999999999e-223 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 1.0000000000000001e-33Initial program 86.7%
add-sqr-sqrt78.2%
fabs-sqr78.2%
add-sqr-sqrt79.4%
associate-*l/85.5%
associate-*r/85.5%
Applied egg-rr85.5%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if 1.0000000000000001e-33 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 99.9%
Taylor expanded in x around 0 93.0%
add-sqr-sqrt92.5%
fabs-sqr92.5%
add-sqr-sqrt93.0%
div-inv93.0%
*-commutative93.0%
associate-*l*99.8%
div-inv99.9%
Applied egg-rr99.9%
if +inf.0 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 0.0%
fabs-sub0.0%
associate-*l/31.6%
associate-*r/31.6%
fma-neg68.4%
distribute-neg-frac68.4%
+-commutative68.4%
distribute-neg-in68.4%
unsub-neg68.4%
metadata-eval68.4%
Simplified68.4%
Taylor expanded in z around 0 100.0%
associate-*r/100.0%
distribute-lft-in100.0%
metadata-eval100.0%
neg-mul-1100.0%
sub-neg100.0%
Simplified100.0%
Final simplification95.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (- t_0 (* z (/ x y_m)))))
(if (<= t_1 -4e-223)
(- (* x (/ z y_m)) t_0)
(if (<= t_1 1e-33)
(- t_0 (/ x (/ y_m z)))
(if (<= t_1 2e+306) t_1 (* z (/ (- x) y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = t_0 - (z * (x / y_m))
if (t_1 <= (-4d-223)) then
tmp = (x * (z / y_m)) - t_0
else if (t_1 <= 1d-33) then
tmp = t_0 - (x / (y_m / z))
else if (t_1 <= 2d+306) then
tmp = t_1
else
tmp = 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 t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 1e-33) {
tmp = t_0 - (x / (y_m / z));
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = z * (-x / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = t_0 - (z * (x / y_m)) tmp = 0 if t_1 <= -4e-223: tmp = (x * (z / y_m)) - t_0 elif t_1 <= 1e-33: tmp = t_0 - (x / (y_m / z)) elif t_1 <= 2e+306: tmp = t_1 else: tmp = z * (-x / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(t_0 - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_1 <= -4e-223) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (t_1 <= 1e-33) tmp = Float64(t_0 - Float64(x / Float64(y_m / z))); elseif (t_1 <= 2e+306) tmp = t_1; else tmp = Float64(z * Float64(Float64(-x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = t_0 - (z * (x / y_m)); tmp = 0.0; if (t_1 <= -4e-223) tmp = (x * (z / y_m)) - t_0; elseif (t_1 <= 1e-33) tmp = t_0 - (x / (y_m / z)); elseif (t_1 <= 2e+306) tmp = t_1; else tmp = z * (-x / 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[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-223], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1e-33], N[(t$95$0 - N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], t$95$1, N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := t\_0 - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{-33}:\\
\;\;\;\;t\_0 - \frac{x}{\frac{y\_m}{z}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -3.9999999999999999e-223Initial program 100.0%
fabs-sub100.0%
div-inv99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
sub-neg99.9%
div-inv100.0%
associate-*l/95.4%
associate-*r/95.4%
fma-undefine95.4%
add-sqr-sqrt94.9%
fabs-sqr94.9%
add-sqr-sqrt95.4%
fma-undefine95.4%
associate-*r/95.4%
associate-*l/100.0%
div-inv99.9%
Applied egg-rr95.4%
if -3.9999999999999999e-223 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 1.0000000000000001e-33Initial program 86.7%
add-sqr-sqrt78.2%
fabs-sqr78.2%
add-sqr-sqrt79.4%
associate-*l/85.5%
associate-*r/85.5%
Applied egg-rr85.5%
clear-num85.6%
un-div-inv85.6%
Applied egg-rr85.6%
if 1.0000000000000001e-33 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 2.00000000000000003e306Initial program 99.9%
Taylor expanded in x around 0 91.1%
add-sqr-sqrt90.5%
fabs-sqr90.5%
add-sqr-sqrt91.1%
div-inv91.1%
*-commutative91.1%
associate-*l*99.8%
div-inv99.9%
Applied egg-rr99.9%
if 2.00000000000000003e306 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 47.2%
add-sqr-sqrt47.2%
fabs-sqr47.2%
add-sqr-sqrt47.2%
sub-neg47.2%
+-commutative47.2%
associate-*l/50.0%
associate-*r/50.0%
frac-2neg50.0%
+-commutative50.0%
distribute-neg-in50.0%
metadata-eval50.0%
sub-neg50.0%
distribute-frac-neg250.0%
distribute-neg-in50.0%
fma-undefine61.1%
neg-sub061.1%
fma-undefine50.0%
associate-*r/50.0%
associate-*l/47.2%
Applied egg-rr72.2%
Taylor expanded in z around inf 59.6%
associate-*r/59.6%
Simplified59.6%
sub0-neg59.6%
*-un-lft-identity59.6%
associate-*l/59.6%
associate-*r*77.8%
distribute-rgt-neg-in77.8%
un-div-inv77.8%
Applied egg-rr77.8%
Final simplification92.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)) (t_1 (- t_0 (* z (/ x y_m)))))
(if (<= t_1 -4e-223)
(- (* x (/ z y_m)) t_0)
(if (<= t_1 5e-89)
(/ (- (+ x 4.0) (* x z)) y_m)
(if (<= t_1 2e+306) t_1 (* z (/ (- x) y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 5e-89) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
t_1 = t_0 - (z * (x / y_m))
if (t_1 <= (-4d-223)) then
tmp = (x * (z / y_m)) - t_0
else if (t_1 <= 5d-89) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else if (t_1 <= 2d+306) then
tmp = t_1
else
tmp = 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 t_0 = (x + 4.0) / y_m;
double t_1 = t_0 - (z * (x / y_m));
double tmp;
if (t_1 <= -4e-223) {
tmp = (x * (z / y_m)) - t_0;
} else if (t_1 <= 5e-89) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = z * (-x / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m t_1 = t_0 - (z * (x / y_m)) tmp = 0 if t_1 <= -4e-223: tmp = (x * (z / y_m)) - t_0 elif t_1 <= 5e-89: tmp = ((x + 4.0) - (x * z)) / y_m elif t_1 <= 2e+306: tmp = t_1 else: tmp = z * (-x / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) t_1 = Float64(t_0 - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_1 <= -4e-223) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); elseif (t_1 <= 5e-89) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); elseif (t_1 <= 2e+306) tmp = t_1; else tmp = Float64(z * Float64(Float64(-x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = (x + 4.0) / y_m; t_1 = t_0 - (z * (x / y_m)); tmp = 0.0; if (t_1 <= -4e-223) tmp = (x * (z / y_m)) - t_0; elseif (t_1 <= 5e-89) tmp = ((x + 4.0) - (x * z)) / y_m; elseif (t_1 <= 2e+306) tmp = t_1; else tmp = z * (-x / 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[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-223], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 5e-89], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], t$95$1, N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
t_1 := t\_0 - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{-223}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-89}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -3.9999999999999999e-223Initial program 100.0%
fabs-sub100.0%
div-inv99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
sub-neg99.9%
div-inv100.0%
associate-*l/95.4%
associate-*r/95.4%
fma-undefine95.4%
add-sqr-sqrt94.9%
fabs-sqr94.9%
add-sqr-sqrt95.4%
fma-undefine95.4%
associate-*r/95.4%
associate-*l/100.0%
div-inv99.9%
Applied egg-rr95.4%
if -3.9999999999999999e-223 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 4.99999999999999967e-89Initial program 83.3%
add-sqr-sqrt72.8%
fabs-sqr72.8%
add-sqr-sqrt74.1%
associate-*l/81.8%
associate-*r/81.8%
Applied egg-rr81.8%
clear-num81.8%
associate-/r/81.8%
Applied egg-rr81.8%
Taylor expanded in y around 0 81.8%
div-sub81.8%
+-commutative81.8%
div-sub81.8%
Simplified81.8%
if 4.99999999999999967e-89 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 2.00000000000000003e306Initial program 99.8%
Taylor expanded in x around 0 92.4%
add-sqr-sqrt91.8%
fabs-sqr91.8%
add-sqr-sqrt92.4%
div-inv92.4%
*-commutative92.4%
associate-*l*99.8%
div-inv99.8%
Applied egg-rr99.8%
if 2.00000000000000003e306 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 47.2%
add-sqr-sqrt47.2%
fabs-sqr47.2%
add-sqr-sqrt47.2%
sub-neg47.2%
+-commutative47.2%
associate-*l/50.0%
associate-*r/50.0%
frac-2neg50.0%
+-commutative50.0%
distribute-neg-in50.0%
metadata-eval50.0%
sub-neg50.0%
distribute-frac-neg250.0%
distribute-neg-in50.0%
fma-undefine61.1%
neg-sub061.1%
fma-undefine50.0%
associate-*r/50.0%
associate-*l/47.2%
Applied egg-rr72.2%
Taylor expanded in z around inf 59.6%
associate-*r/59.6%
Simplified59.6%
sub0-neg59.6%
*-un-lft-identity59.6%
associate-*l/59.6%
associate-*r*77.8%
distribute-rgt-neg-in77.8%
un-div-inv77.8%
Applied egg-rr77.8%
Final simplification92.0%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* x (/ z y_m))))
(if (<= x -1.45e+64)
(/ (- x) y_m)
(if (<= x -6.4e-6)
t_0
(if (<= x 3.6e-16) (/ 4.0 y_m) (if (<= x 1.9e+45) t_0 (/ x y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = x * (z / y_m);
double tmp;
if (x <= -1.45e+64) {
tmp = -x / y_m;
} else if (x <= -6.4e-6) {
tmp = t_0;
} else if (x <= 3.6e-16) {
tmp = 4.0 / y_m;
} else if (x <= 1.9e+45) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = x * (z / y_m)
if (x <= (-1.45d+64)) then
tmp = -x / y_m
else if (x <= (-6.4d-6)) then
tmp = t_0
else if (x <= 3.6d-16) then
tmp = 4.0d0 / y_m
else if (x <= 1.9d+45) then
tmp = t_0
else
tmp = 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 t_0 = x * (z / y_m);
double tmp;
if (x <= -1.45e+64) {
tmp = -x / y_m;
} else if (x <= -6.4e-6) {
tmp = t_0;
} else if (x <= 3.6e-16) {
tmp = 4.0 / y_m;
} else if (x <= 1.9e+45) {
tmp = t_0;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = x * (z / y_m) tmp = 0 if x <= -1.45e+64: tmp = -x / y_m elif x <= -6.4e-6: tmp = t_0 elif x <= 3.6e-16: tmp = 4.0 / y_m elif x <= 1.9e+45: tmp = t_0 else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(x * Float64(z / y_m)) tmp = 0.0 if (x <= -1.45e+64) tmp = Float64(Float64(-x) / y_m); elseif (x <= -6.4e-6) tmp = t_0; elseif (x <= 3.6e-16) tmp = Float64(4.0 / y_m); elseif (x <= 1.9e+45) tmp = t_0; else tmp = Float64(x / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = x * (z / y_m); tmp = 0.0; if (x <= -1.45e+64) tmp = -x / y_m; elseif (x <= -6.4e-6) tmp = t_0; elseif (x <= 3.6e-16) tmp = 4.0 / y_m; elseif (x <= 1.9e+45) tmp = t_0; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+64], N[((-x) / y$95$m), $MachinePrecision], If[LessEqual[x, -6.4e-6], t$95$0, If[LessEqual[x, 3.6e-16], N[(4.0 / y$95$m), $MachinePrecision], If[LessEqual[x, 1.9e+45], t$95$0, N[(x / y$95$m), $MachinePrecision]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{y\_m}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+64}:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -6.4 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -1.44999999999999997e64Initial program 74.4%
fabs-sub74.4%
associate-*l/81.0%
associate-*r/85.0%
fma-neg95.7%
distribute-neg-frac95.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
distribute-lft-in71.5%
metadata-eval71.5%
neg-mul-171.5%
sub-neg71.5%
Simplified71.5%
add-sqr-sqrt39.4%
fabs-sqr39.4%
add-sqr-sqrt39.8%
div-inv39.7%
Applied egg-rr39.7%
Taylor expanded in x around inf 39.8%
associate-*r/39.8%
mul-1-neg39.8%
Simplified39.8%
if -1.44999999999999997e64 < x < -6.3999999999999997e-6 or 3.59999999999999983e-16 < x < 1.9000000000000001e45Initial program 99.7%
add-sqr-sqrt62.0%
fabs-sqr62.0%
add-sqr-sqrt62.8%
associate-*l/62.8%
associate-*r/62.9%
Applied egg-rr62.9%
associate-*r/62.8%
add-sqr-sqrt21.0%
sqrt-unprod14.7%
sqr-neg14.7%
sqrt-unprod17.1%
add-sqr-sqrt38.2%
associate-/l*38.1%
distribute-frac-neg38.1%
distribute-rgt-neg-in38.1%
distribute-lft-neg-in38.1%
clear-num38.2%
un-div-inv38.3%
Applied egg-rr38.3%
Taylor expanded in z around inf 30.4%
associate-*r/30.3%
Simplified30.3%
if -6.3999999999999997e-6 < x < 3.59999999999999983e-16Initial program 94.4%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt49.9%
associate-*l/52.5%
associate-*r/51.0%
Applied egg-rr51.0%
associate-*r/52.5%
add-sqr-sqrt24.2%
sqrt-unprod44.9%
sqr-neg44.9%
sqrt-unprod27.0%
add-sqr-sqrt51.2%
associate-/l*49.1%
distribute-frac-neg49.1%
distribute-rgt-neg-in49.1%
distribute-lft-neg-in49.1%
clear-num49.1%
un-div-inv49.1%
Applied egg-rr49.1%
Taylor expanded in x around 0 44.3%
if 1.9000000000000001e45 < x Initial program 88.1%
fabs-sub88.1%
associate-*l/75.5%
associate-*r/89.7%
fma-neg93.1%
distribute-neg-frac93.1%
+-commutative93.1%
distribute-neg-in93.1%
unsub-neg93.1%
metadata-eval93.1%
Simplified93.1%
Taylor expanded in z around 0 64.8%
associate-*r/64.8%
distribute-lft-in64.8%
metadata-eval64.8%
neg-mul-164.8%
sub-neg64.8%
Simplified64.8%
add-sqr-sqrt64.5%
sqrt-unprod56.8%
neg-fabs56.8%
neg-fabs56.8%
sqr-abs56.8%
distribute-frac-neg256.8%
sub-neg56.8%
metadata-eval56.8%
distribute-neg-in56.8%
+-commutative56.8%
frac-2neg56.8%
distribute-frac-neg256.8%
sub-neg56.8%
metadata-eval56.8%
distribute-neg-in56.8%
+-commutative56.8%
frac-2neg56.8%
sqrt-unprod34.8%
add-sqr-sqrt35.1%
clear-num35.1%
Applied egg-rr35.1%
Taylor expanded in x around inf 35.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.5e+255)
(* z (/ (- x) y_m))
(if (<= x -2.7e-5)
(/ (- (* x (+ -1.0 z)) 4.0) y_m)
(if (<= x 8e+153)
(/ (- (+ x 4.0) (* x z)) y_m)
(+ (/ x y_m) (/ x (/ y_m z)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.5e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else if (x <= 8e+153) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = (x / y_m) + (x / (y_m / z));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-4.5d+255)) then
tmp = z * (-x / y_m)
else if (x <= (-2.7d-5)) then
tmp = ((x * ((-1.0d0) + z)) - 4.0d0) / y_m
else if (x <= 8d+153) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else
tmp = (x / y_m) + (x / (y_m / z))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.5e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else if (x <= 8e+153) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = (x / y_m) + (x / (y_m / z));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.5e+255: tmp = z * (-x / y_m) elif x <= -2.7e-5: tmp = ((x * (-1.0 + z)) - 4.0) / y_m elif x <= 8e+153: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = (x / y_m) + (x / (y_m / z)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.5e+255) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -2.7e-5) tmp = Float64(Float64(Float64(x * Float64(-1.0 + z)) - 4.0) / y_m); elseif (x <= 8e+153) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(Float64(x / y_m) + Float64(x / Float64(y_m / z))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -4.5e+255) tmp = z * (-x / y_m); elseif (x <= -2.7e-5) tmp = ((x * (-1.0 + z)) - 4.0) / y_m; elseif (x <= 8e+153) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = (x / y_m) + (x / (y_m / z)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.5e+255], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e-5], N[(N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 8e+153], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x / y$95$m), $MachinePrecision] + N[(x / N[(y$95$m / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right) - 4}{y\_m}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+153}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} + \frac{x}{\frac{y\_m}{z}}\\
\end{array}
\end{array}
if x < -4.49999999999999964e255Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -4.49999999999999964e255 < x < -2.6999999999999999e-5Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in y around 0 50.6%
if -2.6999999999999999e-5 < x < 8e153Initial program 93.7%
add-sqr-sqrt50.4%
fabs-sqr50.4%
add-sqr-sqrt51.5%
associate-*l/52.4%
associate-*r/52.4%
Applied egg-rr52.4%
clear-num52.4%
associate-/r/52.4%
Applied egg-rr52.4%
Taylor expanded in y around 0 53.0%
div-sub52.4%
+-commutative52.4%
div-sub53.0%
Simplified53.0%
if 8e153 < x Initial program 87.8%
add-sqr-sqrt48.1%
fabs-sqr48.1%
add-sqr-sqrt48.6%
associate-*l/37.3%
associate-*r/48.6%
Applied egg-rr48.6%
associate-*r/37.3%
add-sqr-sqrt18.6%
sqrt-unprod37.1%
sqr-neg37.1%
sqrt-unprod15.4%
add-sqr-sqrt40.2%
associate-/l*48.6%
distribute-frac-neg48.6%
distribute-rgt-neg-in48.6%
distribute-lft-neg-in48.6%
clear-num48.5%
un-div-inv48.4%
Applied egg-rr48.4%
Taylor expanded in x around inf 48.4%
Final simplification52.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1.6e+255)
(* z (/ (- x) y_m))
(if (<= x -5.6e-6)
(/ (- (* x (+ -1.0 z)) 4.0) y_m)
(if (<= x 4.0) (/ (- 4.0 (* x z)) y_m) (- (/ x y_m) (* x (/ z y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.6e+255) {
tmp = z * (-x / y_m);
} else if (x <= -5.6e-6) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (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 (x <= (-1.6d+255)) then
tmp = z * (-x / y_m)
else if (x <= (-5.6d-6)) then
tmp = ((x * ((-1.0d0) + z)) - 4.0d0) / y_m
else if (x <= 4.0d0) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (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 (x <= -1.6e+255) {
tmp = z * (-x / y_m);
} else if (x <= -5.6e-6) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x / y_m) - (x * (z / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.6e+255: tmp = z * (-x / y_m) elif x <= -5.6e-6: tmp = ((x * (-1.0 + z)) - 4.0) / y_m elif x <= 4.0: tmp = (4.0 - (x * z)) / y_m else: tmp = (x / y_m) - (x * (z / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.6e+255) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -5.6e-6) tmp = Float64(Float64(Float64(x * Float64(-1.0 + z)) - 4.0) / y_m); elseif (x <= 4.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(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 (x <= -1.6e+255) tmp = z * (-x / y_m); elseif (x <= -5.6e-6) tmp = ((x * (-1.0 + z)) - 4.0) / y_m; elseif (x <= 4.0) tmp = (4.0 - (x * z)) / y_m; else tmp = (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[x, -1.6e+255], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.6e-6], N[(N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -5.6 \cdot 10^{-6}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right) - 4}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} - x \cdot \frac{z}{y\_m}\\
\end{array}
\end{array}
if x < -1.5999999999999999e255Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -1.5999999999999999e255 < x < -5.59999999999999975e-6Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in y around 0 50.6%
if -5.59999999999999975e-6 < x < 4Initial program 94.5%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt49.9%
sub-neg49.9%
+-commutative49.9%
associate-*l/52.4%
associate-*r/51.0%
frac-2neg51.0%
+-commutative51.0%
distribute-neg-in51.0%
metadata-eval51.0%
sub-neg51.0%
distribute-frac-neg251.0%
distribute-neg-in51.0%
fma-undefine51.0%
neg-sub051.0%
fma-undefine51.0%
associate-*r/52.4%
associate-*l/49.9%
Applied egg-rr52.5%
Taylor expanded in x around 0 51.6%
Taylor expanded in y around 0 51.6%
if 4 < x Initial program 89.3%
add-sqr-sqrt52.7%
fabs-sqr52.7%
add-sqr-sqrt53.2%
associate-*l/44.7%
associate-*r/53.2%
Applied egg-rr53.2%
Taylor expanded in x around inf 53.2%
Final simplification52.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.2e+255)
(* z (/ (- x) y_m))
(if (<= x -2.7e-5)
(/ (* x (+ -1.0 z)) y_m)
(if (<= x 4.0) (/ (- 4.0 (* x z)) y_m) (- (/ x y_m) (* x (/ z y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.2e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (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 (x <= (-4.2d+255)) then
tmp = z * (-x / y_m)
else if (x <= (-2.7d-5)) then
tmp = (x * ((-1.0d0) + z)) / y_m
else if (x <= 4.0d0) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (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 (x <= -4.2e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else if (x <= 4.0) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x / y_m) - (x * (z / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.2e+255: tmp = z * (-x / y_m) elif x <= -2.7e-5: tmp = (x * (-1.0 + z)) / y_m elif x <= 4.0: tmp = (4.0 - (x * z)) / y_m else: tmp = (x / y_m) - (x * (z / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.2e+255) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -2.7e-5) tmp = Float64(Float64(x * Float64(-1.0 + z)) / y_m); elseif (x <= 4.0) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(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 (x <= -4.2e+255) tmp = z * (-x / y_m); elseif (x <= -2.7e-5) tmp = (x * (-1.0 + z)) / y_m; elseif (x <= 4.0) tmp = (4.0 - (x * z)) / y_m; else tmp = (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[x, -4.2e+255], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e-5], N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4.0], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x / y$95$m), $MachinePrecision] - N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right)}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} - x \cdot \frac{z}{y\_m}\\
\end{array}
\end{array}
if x < -4.2e255Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -4.2e255 < x < -2.6999999999999999e-5Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in x around -inf 50.4%
if -2.6999999999999999e-5 < x < 4Initial program 94.5%
add-sqr-sqrt48.7%
fabs-sqr48.7%
add-sqr-sqrt49.9%
sub-neg49.9%
+-commutative49.9%
associate-*l/52.4%
associate-*r/51.0%
frac-2neg51.0%
+-commutative51.0%
distribute-neg-in51.0%
metadata-eval51.0%
sub-neg51.0%
distribute-frac-neg251.0%
distribute-neg-in51.0%
fma-undefine51.0%
neg-sub051.0%
fma-undefine51.0%
associate-*r/52.4%
associate-*l/49.9%
Applied egg-rr52.5%
Taylor expanded in x around 0 51.6%
Taylor expanded in y around 0 51.6%
if 4 < x Initial program 89.3%
add-sqr-sqrt52.7%
fabs-sqr52.7%
add-sqr-sqrt53.2%
associate-*l/44.7%
associate-*r/53.2%
Applied egg-rr53.2%
Taylor expanded in x around inf 53.2%
Final simplification52.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -3.8e+255)
(* z (/ (- x) y_m))
(if (<= x -2.7e-5)
(/ (* x (+ -1.0 z)) y_m)
(if (<= x 4.8e+49) (/ (- 4.0 (* x z)) y_m) (/ (+ x 4.0) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -3.8e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else if (x <= 4.8e+49) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 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 <= (-3.8d+255)) then
tmp = z * (-x / y_m)
else if (x <= (-2.7d-5)) then
tmp = (x * ((-1.0d0) + z)) / y_m
else if (x <= 4.8d+49) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x + 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 <= -3.8e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else if (x <= 4.8e+49) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -3.8e+255: tmp = z * (-x / y_m) elif x <= -2.7e-5: tmp = (x * (-1.0 + z)) / y_m elif x <= 4.8e+49: tmp = (4.0 - (x * z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -3.8e+255) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -2.7e-5) tmp = Float64(Float64(x * Float64(-1.0 + z)) / y_m); elseif (x <= 4.8e+49) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x + 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 <= -3.8e+255) tmp = z * (-x / y_m); elseif (x <= -2.7e-5) tmp = (x * (-1.0 + z)) / y_m; elseif (x <= 4.8e+49) tmp = (4.0 - (x * z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -3.8e+255], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e-5], N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 4.8e+49], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right)}{y\_m}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+49}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -3.7999999999999999e255Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -3.7999999999999999e255 < x < -2.6999999999999999e-5Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in x around -inf 50.4%
if -2.6999999999999999e-5 < x < 4.8e49Initial program 94.9%
add-sqr-sqrt50.2%
fabs-sqr50.2%
add-sqr-sqrt51.4%
sub-neg51.4%
+-commutative51.4%
associate-*l/53.7%
associate-*r/52.4%
frac-2neg52.4%
+-commutative52.4%
distribute-neg-in52.4%
metadata-eval52.4%
sub-neg52.4%
distribute-frac-neg252.4%
distribute-neg-in52.4%
fma-undefine52.4%
neg-sub052.4%
fma-undefine52.4%
associate-*r/53.7%
associate-*l/51.4%
Applied egg-rr53.7%
Taylor expanded in x around 0 52.5%
Taylor expanded in y around 0 52.5%
if 4.8e49 < x Initial program 87.4%
fabs-sub87.4%
associate-*l/74.3%
associate-*r/89.2%
fma-neg92.7%
distribute-neg-frac92.7%
+-commutative92.7%
distribute-neg-in92.7%
unsub-neg92.7%
metadata-eval92.7%
Simplified92.7%
Taylor expanded in z around 0 66.3%
associate-*r/66.3%
distribute-lft-in66.3%
metadata-eval66.3%
neg-mul-166.3%
sub-neg66.3%
Simplified66.3%
add-sqr-sqrt66.0%
sqrt-unprod57.9%
neg-fabs57.9%
neg-fabs57.9%
sqr-abs57.9%
distribute-frac-neg257.9%
sub-neg57.9%
metadata-eval57.9%
distribute-neg-in57.9%
+-commutative57.9%
frac-2neg57.9%
distribute-frac-neg257.9%
sub-neg57.9%
metadata-eval57.9%
distribute-neg-in57.9%
+-commutative57.9%
frac-2neg57.9%
sqrt-unprod36.5%
add-sqr-sqrt36.8%
Applied egg-rr36.8%
Final simplification48.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -4.5e+255)
(* z (/ (- x) y_m))
(if (<= x -2.7e-5)
(/ (- (* x (+ -1.0 z)) 4.0) y_m)
(/ (- (+ x 4.0) (* x z)) y_m))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -4.5e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else {
tmp = ((x + 4.0) - (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 <= (-4.5d+255)) then
tmp = z * (-x / y_m)
else if (x <= (-2.7d-5)) then
tmp = ((x * ((-1.0d0) + z)) - 4.0d0) / y_m
else
tmp = ((x + 4.0d0) - (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 <= -4.5e+255) {
tmp = z * (-x / y_m);
} else if (x <= -2.7e-5) {
tmp = ((x * (-1.0 + z)) - 4.0) / y_m;
} else {
tmp = ((x + 4.0) - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -4.5e+255: tmp = z * (-x / y_m) elif x <= -2.7e-5: tmp = ((x * (-1.0 + z)) - 4.0) / y_m else: tmp = ((x + 4.0) - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -4.5e+255) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -2.7e-5) tmp = Float64(Float64(Float64(x * Float64(-1.0 + z)) - 4.0) / y_m); else tmp = Float64(Float64(Float64(x + 4.0) - 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 <= -4.5e+255) tmp = z * (-x / y_m); elseif (x <= -2.7e-5) tmp = ((x * (-1.0 + z)) - 4.0) / y_m; else tmp = ((x + 4.0) - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -4.5e+255], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.7e-5], N[(N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] - 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+255}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right) - 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -4.49999999999999964e255Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -4.49999999999999964e255 < x < -2.6999999999999999e-5Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in y around 0 50.6%
if -2.6999999999999999e-5 < x Initial program 92.7%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt51.0%
associate-*l/49.8%
associate-*r/51.7%
Applied egg-rr51.7%
clear-num51.7%
associate-/r/51.7%
Applied egg-rr51.7%
Taylor expanded in y around 0 51.9%
div-sub49.8%
+-commutative49.8%
div-sub51.9%
Simplified51.9%
Final simplification51.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -7e+253) (* z (/ (- x) y_m)) (if (<= x -1.55e-5) (/ (* x (+ -1.0 z)) y_m) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -7e+253) {
tmp = z * (-x / y_m);
} else if (x <= -1.55e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else {
tmp = (x + 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 <= (-7d+253)) then
tmp = z * (-x / y_m)
else if (x <= (-1.55d-5)) then
tmp = (x * ((-1.0d0) + z)) / y_m
else
tmp = (x + 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 <= -7e+253) {
tmp = z * (-x / y_m);
} else if (x <= -1.55e-5) {
tmp = (x * (-1.0 + z)) / y_m;
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -7e+253: tmp = z * (-x / y_m) elif x <= -1.55e-5: tmp = (x * (-1.0 + z)) / y_m else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -7e+253) tmp = Float64(z * Float64(Float64(-x) / y_m)); elseif (x <= -1.55e-5) tmp = Float64(Float64(x * Float64(-1.0 + z)) / y_m); else tmp = Float64(Float64(x + 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 <= -7e+253) tmp = z * (-x / y_m); elseif (x <= -1.55e-5) tmp = (x * (-1.0 + z)) / y_m; else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -7e+253], N[(z * N[((-x) / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.55e-5], N[(N[(x * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+253}:\\
\;\;\;\;z \cdot \frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot \left(-1 + z\right)}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -6.99999999999999955e253Initial program 37.5%
add-sqr-sqrt25.0%
fabs-sqr25.0%
add-sqr-sqrt25.1%
sub-neg25.1%
+-commutative25.1%
associate-*l/25.1%
associate-*r/25.1%
frac-2neg25.1%
+-commutative25.1%
distribute-neg-in25.1%
metadata-eval25.1%
sub-neg25.1%
distribute-frac-neg225.1%
distribute-neg-in25.1%
fma-undefine37.6%
neg-sub037.6%
fma-undefine25.1%
associate-*r/25.1%
associate-*l/25.1%
Applied egg-rr50.1%
Taylor expanded in z around inf 39.5%
associate-*r/39.3%
Simplified39.3%
sub0-neg39.3%
*-un-lft-identity39.3%
associate-*l/39.3%
associate-*r*63.2%
distribute-rgt-neg-in63.2%
un-div-inv63.2%
Applied egg-rr63.2%
if -6.99999999999999955e253 < x < -1.55000000000000007e-5Initial program 86.9%
Taylor expanded in x around 0 90.8%
fabs-sub90.8%
div-sub98.2%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
associate--r+50.6%
div-sub50.6%
*-commutative50.6%
*-un-lft-identity50.6%
distribute-rgt-out--50.6%
Applied egg-rr50.6%
Taylor expanded in x around -inf 50.4%
if -1.55000000000000007e-5 < x Initial program 92.7%
fabs-sub92.7%
associate-*l/92.5%
associate-*r/93.5%
fma-neg94.5%
distribute-neg-frac94.5%
+-commutative94.5%
distribute-neg-in94.5%
unsub-neg94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in z around 0 75.7%
associate-*r/75.7%
distribute-lft-in75.7%
metadata-eval75.7%
neg-mul-175.7%
sub-neg75.7%
Simplified75.7%
add-sqr-sqrt75.3%
sqrt-unprod50.7%
neg-fabs50.7%
neg-fabs50.7%
sqr-abs50.7%
distribute-frac-neg250.7%
sub-neg50.7%
metadata-eval50.7%
distribute-neg-in50.7%
+-commutative50.7%
frac-2neg50.7%
distribute-frac-neg250.7%
sub-neg50.7%
metadata-eval50.7%
distribute-neg-in50.7%
+-commutative50.7%
frac-2neg50.7%
sqrt-unprod39.5%
add-sqr-sqrt40.4%
Applied egg-rr40.4%
Final simplification43.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -8.5e+63) (/ (- x) y_m) (if (<= x -1.24e-5) (* x (/ z y_m)) (/ (+ x 4.0) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -8.5e+63) {
tmp = -x / y_m;
} else if (x <= -1.24e-5) {
tmp = x * (z / y_m);
} else {
tmp = (x + 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 <= (-8.5d+63)) then
tmp = -x / y_m
else if (x <= (-1.24d-5)) then
tmp = x * (z / y_m)
else
tmp = (x + 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 <= -8.5e+63) {
tmp = -x / y_m;
} else if (x <= -1.24e-5) {
tmp = x * (z / y_m);
} else {
tmp = (x + 4.0) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -8.5e+63: tmp = -x / y_m elif x <= -1.24e-5: tmp = x * (z / y_m) else: tmp = (x + 4.0) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -8.5e+63) tmp = Float64(Float64(-x) / y_m); elseif (x <= -1.24e-5) tmp = Float64(x * Float64(z / y_m)); else tmp = Float64(Float64(x + 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 <= -8.5e+63) tmp = -x / y_m; elseif (x <= -1.24e-5) tmp = x * (z / y_m); else tmp = (x + 4.0) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -8.5e+63], N[((-x) / y$95$m), $MachinePrecision], If[LessEqual[x, -1.24e-5], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{+63}:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq -1.24 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -8.5000000000000004e63Initial program 74.4%
fabs-sub74.4%
associate-*l/81.0%
associate-*r/85.0%
fma-neg95.7%
distribute-neg-frac95.7%
+-commutative95.7%
distribute-neg-in95.7%
unsub-neg95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around 0 71.5%
associate-*r/71.5%
distribute-lft-in71.5%
metadata-eval71.5%
neg-mul-171.5%
sub-neg71.5%
Simplified71.5%
add-sqr-sqrt39.4%
fabs-sqr39.4%
add-sqr-sqrt39.8%
div-inv39.7%
Applied egg-rr39.7%
Taylor expanded in x around inf 39.8%
associate-*r/39.8%
mul-1-neg39.8%
Simplified39.8%
if -8.5000000000000004e63 < x < -1.24e-5Initial program 99.8%
add-sqr-sqrt59.8%
fabs-sqr59.8%
add-sqr-sqrt60.5%
associate-*l/60.5%
associate-*r/60.5%
Applied egg-rr60.5%
associate-*r/60.5%
add-sqr-sqrt13.8%
sqrt-unprod15.7%
sqr-neg15.7%
sqrt-unprod27.1%
add-sqr-sqrt34.2%
associate-/l*34.1%
distribute-frac-neg34.1%
distribute-rgt-neg-in34.1%
distribute-lft-neg-in34.1%
clear-num34.2%
un-div-inv34.3%
Applied egg-rr34.3%
Taylor expanded in z around inf 28.1%
associate-*r/28.0%
Simplified28.0%
if -1.24e-5 < x Initial program 92.7%
fabs-sub92.7%
associate-*l/92.5%
associate-*r/93.5%
fma-neg94.5%
distribute-neg-frac94.5%
+-commutative94.5%
distribute-neg-in94.5%
unsub-neg94.5%
metadata-eval94.5%
Simplified94.5%
Taylor expanded in z around 0 75.7%
associate-*r/75.7%
distribute-lft-in75.7%
metadata-eval75.7%
neg-mul-175.7%
sub-neg75.7%
Simplified75.7%
add-sqr-sqrt75.3%
sqrt-unprod50.7%
neg-fabs50.7%
neg-fabs50.7%
sqr-abs50.7%
distribute-frac-neg250.7%
sub-neg50.7%
metadata-eval50.7%
distribute-neg-in50.7%
+-commutative50.7%
frac-2neg50.7%
distribute-frac-neg250.7%
sub-neg50.7%
metadata-eval50.7%
distribute-neg-in50.7%
+-commutative50.7%
frac-2neg50.7%
sqrt-unprod39.5%
add-sqr-sqrt40.4%
Applied egg-rr40.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -10.2) (/ (- x) y_m) (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -10.2) {
tmp = -x / y_m;
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = 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 <= (-10.2d0)) then
tmp = -x / y_m
else if (x <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = 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 <= -10.2) {
tmp = -x / y_m;
} else if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -10.2: tmp = -x / y_m elif x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -10.2) tmp = Float64(Float64(-x) / y_m); elseif (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = 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 <= -10.2) tmp = -x / y_m; elseif (x <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -10.2], N[((-x) / y$95$m), $MachinePrecision], If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -10.2:\\
\;\;\;\;\frac{-x}{y\_m}\\
\mathbf{elif}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < -10.199999999999999Initial program 80.2%
fabs-sub80.2%
associate-*l/85.3%
associate-*r/88.4%
fma-neg96.6%
distribute-neg-frac96.6%
+-commutative96.6%
distribute-neg-in96.6%
unsub-neg96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in z around 0 64.0%
associate-*r/64.0%
distribute-lft-in64.0%
metadata-eval64.0%
neg-mul-164.0%
sub-neg64.0%
Simplified64.0%
add-sqr-sqrt35.4%
fabs-sqr35.4%
add-sqr-sqrt36.0%
div-inv35.9%
Applied egg-rr35.9%
Taylor expanded in x around inf 35.8%
associate-*r/35.8%
mul-1-neg35.8%
Simplified35.8%
if -10.199999999999999 < x < 4Initial program 94.5%
add-sqr-sqrt48.3%
fabs-sqr48.3%
add-sqr-sqrt49.5%
associate-*l/52.0%
associate-*r/50.6%
Applied egg-rr50.6%
associate-*r/52.0%
add-sqr-sqrt24.4%
sqrt-unprod44.6%
sqr-neg44.6%
sqrt-unprod27.1%
add-sqr-sqrt52.3%
associate-/l*50.3%
distribute-frac-neg50.3%
distribute-rgt-neg-in50.3%
distribute-lft-neg-in50.3%
clear-num50.3%
un-div-inv50.3%
Applied egg-rr50.3%
Taylor expanded in x around 0 43.6%
if 4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/78.1%
associate-*r/90.8%
fma-neg93.8%
distribute-neg-frac93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around 0 58.6%
associate-*r/58.6%
distribute-lft-in58.6%
metadata-eval58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
add-sqr-sqrt58.4%
sqrt-unprod52.8%
neg-fabs52.8%
neg-fabs52.8%
sqr-abs52.8%
distribute-frac-neg252.8%
sub-neg52.8%
metadata-eval52.8%
distribute-neg-in52.8%
+-commutative52.8%
frac-2neg52.8%
distribute-frac-neg252.8%
sub-neg52.8%
metadata-eval52.8%
distribute-neg-in52.8%
+-commutative52.8%
frac-2neg52.8%
sqrt-unprod31.7%
add-sqr-sqrt32.0%
clear-num32.0%
Applied egg-rr32.0%
Taylor expanded in x around inf 32.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 4.0) (/ 4.0 y_m) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = 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 <= 4.0d0) then
tmp = 4.0d0 / y_m
else
tmp = 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 <= 4.0) {
tmp = 4.0 / y_m;
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 4.0: tmp = 4.0 / y_m else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 4.0) tmp = Float64(4.0 / y_m); else tmp = 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 <= 4.0) tmp = 4.0 / y_m; else tmp = x / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, 4.0], N[(4.0 / y$95$m), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4:\\
\;\;\;\;\frac{4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < 4Initial program 89.9%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt46.8%
associate-*l/49.1%
associate-*r/48.1%
Applied egg-rr48.1%
associate-*r/49.1%
add-sqr-sqrt22.4%
sqrt-unprod41.5%
sqr-neg41.5%
sqrt-unprod25.8%
add-sqr-sqrt48.7%
associate-/l*48.3%
distribute-frac-neg48.3%
distribute-rgt-neg-in48.3%
distribute-lft-neg-in48.3%
clear-num48.3%
un-div-inv48.4%
Applied egg-rr48.4%
Taylor expanded in x around 0 30.7%
if 4 < x Initial program 89.3%
fabs-sub89.3%
associate-*l/78.1%
associate-*r/90.8%
fma-neg93.8%
distribute-neg-frac93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
metadata-eval93.8%
Simplified93.8%
Taylor expanded in z around 0 58.6%
associate-*r/58.6%
distribute-lft-in58.6%
metadata-eval58.6%
neg-mul-158.6%
sub-neg58.6%
Simplified58.6%
add-sqr-sqrt58.4%
sqrt-unprod52.8%
neg-fabs52.8%
neg-fabs52.8%
sqr-abs52.8%
distribute-frac-neg252.8%
sub-neg52.8%
metadata-eval52.8%
distribute-neg-in52.8%
+-commutative52.8%
frac-2neg52.8%
distribute-frac-neg252.8%
sub-neg52.8%
metadata-eval52.8%
distribute-neg-in52.8%
+-commutative52.8%
frac-2neg52.8%
sqrt-unprod31.7%
add-sqr-sqrt32.0%
clear-num32.0%
Applied egg-rr32.0%
Taylor expanded in x around inf 32.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (/ 4.0 y_m))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return 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 = 4.0d0 / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return 4.0 / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z): return 4.0 / y_m
y_m = abs(y) function code(x, y_m, z) return Float64(4.0 / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = 4.0 / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[(4.0 / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{4}{y\_m}
\end{array}
Initial program 89.8%
add-sqr-sqrt47.6%
fabs-sqr47.6%
add-sqr-sqrt48.5%
associate-*l/47.9%
associate-*r/49.4%
Applied egg-rr49.4%
associate-*r/47.9%
add-sqr-sqrt21.4%
sqrt-unprod38.5%
sqr-neg38.5%
sqrt-unprod22.8%
add-sqr-sqrt45.7%
associate-/l*46.5%
distribute-frac-neg46.5%
distribute-rgt-neg-in46.5%
distribute-lft-neg-in46.5%
clear-num46.5%
un-div-inv46.5%
Applied egg-rr46.5%
Taylor expanded in x around 0 23.6%
herbie shell --seed 2024110
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))