
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))
double code(double x, double y, double z) {
return fabs((((x + 4.0) / y) - ((x / y) * z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = abs((((x + 4.0d0) / y) - ((x / y) * z)))
end function
public static double code(double x, double y, double z) {
return Math.abs((((x + 4.0) / y) - ((x / y) * z)));
}
def code(x, y, z): return math.fabs((((x + 4.0) / y) - ((x / y) * z)))
function code(x, y, z) return abs(Float64(Float64(Float64(x + 4.0) / y) - Float64(Float64(x / y) * z))) end
function tmp = code(x, y, z) tmp = abs((((x + 4.0) / y) - ((x / y) * z))); end
code[x_, y_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\left|\frac{x + 4}{y} - \frac{x}{y} \cdot z\right|
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= y_m 5e-39) (fabs (/ (- (+ x 4.0) (* x z)) y_m)) (fabs (fma x (/ z y_m) (/ (- -4.0 x) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (y_m <= 5e-39) {
tmp = fabs((((x + 4.0) - (x * z)) / y_m));
} else {
tmp = fabs(fma(x, (z / y_m), ((-4.0 - x) / y_m)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (y_m <= 5e-39) tmp = abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)); else tmp = abs(fma(x, Float64(z / y_m), Float64(Float64(-4.0 - x) / y_m))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[y$95$m, 5e-39], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[Abs[N[(x * N[(z / y$95$m), $MachinePrecision] + N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 5 \cdot 10^{-39}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\mathsf{fma}\left(x, \frac{z}{y\_m}, \frac{-4 - x}{y\_m}\right)\right|\\
\end{array}
\end{array}
if y < 4.9999999999999998e-39Initial program 86.4%
fabs-sub86.4%
associate-*l/89.7%
associate-*r/87.7%
fma-neg89.4%
distribute-neg-frac89.4%
+-commutative89.4%
distribute-neg-in89.4%
unsub-neg89.4%
metadata-eval89.4%
Simplified89.4%
add-sqr-sqrt50.6%
sqrt-unprod62.0%
sqr-abs62.0%
neg-fabs62.0%
neg-fabs62.0%
sqr-abs62.0%
Applied egg-rr98.4%
if 4.9999999999999998e-39 < y Initial program 97.3%
fabs-sub97.3%
associate-*l/96.0%
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 (fabs (/ (* x z) y_m))))
(if (<= z -1.65e+220)
t_0
(if (<= z -7.5e+87)
(/ (- (+ x 4.0) (* x z)) y_m)
(if (<= z -2.6e+14)
t_0
(if (<= z 5.8e-6)
(fabs (/ (- -4.0 x) y_m))
(if (<= z 3.1e+174)
(+ (* (- -4.0 x) (/ -1.0 y_m)) (* x (/ z y_m)))
t_0)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs(((x * z) / y_m));
double tmp;
if (z <= -1.65e+220) {
tmp = t_0;
} else if (z <= -7.5e+87) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (z <= -2.6e+14) {
tmp = t_0;
} else if (z <= 5.8e-6) {
tmp = fabs(((-4.0 - x) / y_m));
} else if (z <= 3.1e+174) {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = abs(((x * z) / y_m))
if (z <= (-1.65d+220)) then
tmp = t_0
else if (z <= (-7.5d+87)) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else if (z <= (-2.6d+14)) then
tmp = t_0
else if (z <= 5.8d-6) then
tmp = abs((((-4.0d0) - x) / y_m))
else if (z <= 3.1d+174) then
tmp = (((-4.0d0) - x) * ((-1.0d0) / y_m)) + (x * (z / y_m))
else
tmp = t_0
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double t_0 = Math.abs(((x * z) / y_m));
double tmp;
if (z <= -1.65e+220) {
tmp = t_0;
} else if (z <= -7.5e+87) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (z <= -2.6e+14) {
tmp = t_0;
} else if (z <= 5.8e-6) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else if (z <= 3.1e+174) {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m));
} else {
tmp = t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = math.fabs(((x * z) / y_m)) tmp = 0 if z <= -1.65e+220: tmp = t_0 elif z <= -7.5e+87: tmp = ((x + 4.0) - (x * z)) / y_m elif z <= -2.6e+14: tmp = t_0 elif z <= 5.8e-6: tmp = math.fabs(((-4.0 - x) / y_m)) elif z <= 3.1e+174: tmp = ((-4.0 - x) * (-1.0 / y_m)) + (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(x * z) / y_m)) tmp = 0.0 if (z <= -1.65e+220) tmp = t_0; elseif (z <= -7.5e+87) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); elseif (z <= -2.6e+14) tmp = t_0; elseif (z <= 5.8e-6) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); elseif (z <= 3.1e+174) tmp = Float64(Float64(Float64(-4.0 - x) * Float64(-1.0 / y_m)) + Float64(x * Float64(z / y_m))); else tmp = t_0; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = abs(((x * z) / y_m)); tmp = 0.0; if (z <= -1.65e+220) tmp = t_0; elseif (z <= -7.5e+87) tmp = ((x + 4.0) - (x * z)) / y_m; elseif (z <= -2.6e+14) tmp = t_0; elseif (z <= 5.8e-6) tmp = abs(((-4.0 - x) / y_m)); elseif (z <= 3.1e+174) tmp = ((-4.0 - x) * (-1.0 / y_m)) + (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[(x * z), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -1.65e+220], t$95$0, If[LessEqual[z, -7.5e+87], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[z, -2.6e+14], t$95$0, If[LessEqual[z, 5.8e-6], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 3.1e+174], N[(N[(N[(-4.0 - x), $MachinePrecision] * N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|\frac{x \cdot z}{y\_m}\right|\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+220}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+87}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{+14}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-6}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+174}:\\
\;\;\;\;\left(-4 - x\right) \cdot \frac{-1}{y\_m} + x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.65000000000000011e220 or -7.50000000000000014e87 < z < -2.6e14 or 3.1e174 < z Initial program 78.4%
Taylor expanded in z around inf 86.2%
if -1.65000000000000011e220 < z < -7.50000000000000014e87Initial program 96.2%
Simplified96.2%
add-sqr-sqrt68.9%
fabs-sqr68.9%
add-sqr-sqrt69.4%
*-commutative69.4%
Applied egg-rr69.4%
Taylor expanded in y around 0 69.5%
if -2.6e14 < z < 5.8000000000000004e-6Initial program 94.9%
fabs-sub94.9%
associate-*l/99.2%
associate-*r/99.2%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 98.2%
associate-*r/98.2%
distribute-lft-in98.2%
metadata-eval98.2%
neg-mul-198.2%
sub-neg98.2%
Simplified98.2%
if 5.8000000000000004e-6 < z < 3.1e174Initial program 82.0%
Simplified94.0%
add-sqr-sqrt45.4%
fabs-sqr45.4%
add-sqr-sqrt46.2%
*-commutative46.2%
Applied egg-rr46.2%
*-commutative46.2%
fma-undefine46.2%
distribute-rgt-in43.2%
div-inv43.2%
mul-1-neg43.2%
distribute-rgt-neg-in43.2%
div-inv43.3%
mul-1-neg43.3%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt73.2%
mul-1-neg73.2%
associate-*r/76.5%
neg-fabs76.5%
add-sqr-sqrt42.3%
fabs-sqr42.3%
add-sqr-sqrt55.0%
Applied egg-rr55.0%
Final simplification86.9%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (fabs (* x (/ (+ z -1.0) y_m)))))
(if (<= x -1.7e-7)
t_0
(if (<= x 1e-207)
(/ (- (+ x 4.0) (* x z)) y_m)
(if (<= x 6.3e-121)
(+ (* (- -4.0 x) (/ -1.0 y_m)) (* x (/ z y_m)))
(if (<= x 7.8e+15)
(+ (/ (+ x 4.0) y_m) (* (* x z) (/ -1.0 y_m)))
t_0))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = fabs((x * ((z + -1.0) / y_m)));
double tmp;
if (x <= -1.7e-7) {
tmp = t_0;
} else if (x <= 1e-207) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (x <= 6.3e-121) {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m));
} else if (x <= 7.8e+15) {
tmp = ((x + 4.0) / y_m) + ((x * z) * (-1.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 * ((z + (-1.0d0)) / y_m)))
if (x <= (-1.7d-7)) then
tmp = t_0
else if (x <= 1d-207) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else if (x <= 6.3d-121) then
tmp = (((-4.0d0) - x) * ((-1.0d0) / y_m)) + (x * (z / y_m))
else if (x <= 7.8d+15) then
tmp = ((x + 4.0d0) / y_m) + ((x * z) * ((-1.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 * ((z + -1.0) / y_m)));
double tmp;
if (x <= -1.7e-7) {
tmp = t_0;
} else if (x <= 1e-207) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else if (x <= 6.3e-121) {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m));
} else if (x <= 7.8e+15) {
tmp = ((x + 4.0) / y_m) + ((x * z) * (-1.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 * ((z + -1.0) / y_m))) tmp = 0 if x <= -1.7e-7: tmp = t_0 elif x <= 1e-207: tmp = ((x + 4.0) - (x * z)) / y_m elif x <= 6.3e-121: tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m)) elif x <= 7.8e+15: tmp = ((x + 4.0) / y_m) + ((x * z) * (-1.0 / y_m)) else: tmp = t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = abs(Float64(x * Float64(Float64(z + -1.0) / y_m))) tmp = 0.0 if (x <= -1.7e-7) tmp = t_0; elseif (x <= 1e-207) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); elseif (x <= 6.3e-121) tmp = Float64(Float64(Float64(-4.0 - x) * Float64(-1.0 / y_m)) + Float64(x * Float64(z / y_m))); elseif (x <= 7.8e+15) tmp = Float64(Float64(Float64(x + 4.0) / y_m) + Float64(Float64(x * z) * Float64(-1.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 * ((z + -1.0) / y_m))); tmp = 0.0; if (x <= -1.7e-7) tmp = t_0; elseif (x <= 1e-207) tmp = ((x + 4.0) - (x * z)) / y_m; elseif (x <= 6.3e-121) tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m)); elseif (x <= 7.8e+15) tmp = ((x + 4.0) / y_m) + ((x * z) * (-1.0 / y_m)); else tmp = t_0; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[Abs[N[(x * N[(N[(z + -1.0), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -1.7e-7], t$95$0, If[LessEqual[x, 1e-207], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 6.3e-121], N[(N[(N[(-4.0 - x), $MachinePrecision] * N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.8e+15], N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] * N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \left|x \cdot \frac{z + -1}{y\_m}\right|\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 10^{-207}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{-121}:\\
\;\;\;\;\left(-4 - x\right) \cdot \frac{-1}{y\_m} + x \cdot \frac{z}{y\_m}\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{x + 4}{y\_m} + \left(x \cdot z\right) \cdot \frac{-1}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999987e-7 or 7.8e15 < x Initial program 82.3%
fabs-sub82.3%
associate-*l/82.6%
associate-*r/87.1%
fma-neg89.5%
distribute-neg-frac89.5%
+-commutative89.5%
distribute-neg-in89.5%
unsub-neg89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in x around inf 99.4%
div-sub99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
if -1.69999999999999987e-7 < x < 9.99999999999999925e-208Initial program 96.6%
Simplified99.9%
add-sqr-sqrt41.7%
fabs-sqr41.7%
add-sqr-sqrt43.1%
*-commutative43.1%
Applied egg-rr43.1%
Taylor expanded in y around 0 43.1%
if 9.99999999999999925e-208 < x < 6.29999999999999961e-121Initial program 95.3%
Simplified99.9%
add-sqr-sqrt54.7%
fabs-sqr54.7%
add-sqr-sqrt56.0%
*-commutative56.0%
Applied egg-rr56.0%
*-commutative56.0%
fma-undefine56.0%
distribute-rgt-in56.0%
div-inv56.0%
mul-1-neg56.0%
distribute-rgt-neg-in56.0%
div-inv56.0%
mul-1-neg56.0%
add-sqr-sqrt50.7%
fabs-sqr50.7%
add-sqr-sqrt65.7%
mul-1-neg65.7%
associate-*r/65.7%
neg-fabs65.7%
add-sqr-sqrt25.5%
fabs-sqr25.5%
add-sqr-sqrt50.8%
Applied egg-rr50.8%
if 6.29999999999999961e-121 < x < 7.8e15Initial program 96.4%
Simplified99.8%
add-sqr-sqrt49.5%
fabs-sqr49.5%
add-sqr-sqrt51.2%
*-commutative51.2%
Applied egg-rr51.2%
*-commutative51.2%
fma-undefine51.2%
distribute-lft-in51.3%
frac-2neg51.3%
metadata-eval51.3%
associate-/r/51.2%
sub-neg51.2%
metadata-eval51.2%
distribute-neg-in51.2%
+-commutative51.2%
frac-2neg51.2%
clear-num51.3%
Applied egg-rr51.3%
Final simplification72.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (/ (+ x 4.0) y_m)))
(if (<= (- t_0 (* z (/ x y_m))) -5e-242)
(fabs (- t_0 (/ z (/ y_m x))))
(fabs (/ (- (+ x 4.0) (* x z)) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = (x + 4.0) / y_m;
double tmp;
if ((t_0 - (z * (x / y_m))) <= -5e-242) {
tmp = fabs((t_0 - (z / (y_m / x))));
} else {
tmp = fabs((((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) :: t_0
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
if ((t_0 - (z * (x / y_m))) <= (-5d-242)) then
tmp = abs((t_0 - (z / (y_m / x))))
else
tmp = abs((((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 t_0 = (x + 4.0) / y_m;
double tmp;
if ((t_0 - (z * (x / y_m))) <= -5e-242) {
tmp = Math.abs((t_0 - (z / (y_m / x))));
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = (x + 4.0) / y_m tmp = 0 if (t_0 - (z * (x / y_m))) <= -5e-242: tmp = math.fabs((t_0 - (z / (y_m / x)))) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(x + 4.0) / y_m) tmp = 0.0 if (Float64(t_0 - Float64(z * Float64(x / y_m))) <= -5e-242) tmp = abs(Float64(t_0 - Float64(z / Float64(y_m / x)))); else tmp = abs(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) t_0 = (x + 4.0) / y_m; tmp = 0.0; if ((t_0 - (z * (x / y_m))) <= -5e-242) tmp = abs((t_0 - (z / (y_m / x)))); else tmp = abs((((x + 4.0) - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-242], N[Abs[N[(t$95$0 - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m}\\
\mathbf{if}\;t\_0 - z \cdot \frac{x}{y\_m} \leq -5 \cdot 10^{-242}:\\
\;\;\;\;\left|t\_0 - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -4.9999999999999998e-242Initial program 98.2%
*-commutative98.2%
clear-num98.2%
un-div-inv98.2%
Applied egg-rr98.2%
if -4.9999999999999998e-242 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 83.0%
fabs-sub83.0%
associate-*l/86.5%
associate-*r/87.1%
fma-neg89.2%
distribute-neg-frac89.2%
+-commutative89.2%
distribute-neg-in89.2%
unsub-neg89.2%
metadata-eval89.2%
Simplified89.2%
add-sqr-sqrt6.1%
sqrt-unprod63.3%
sqr-abs63.3%
neg-fabs63.3%
neg-fabs63.3%
sqr-abs63.3%
Applied egg-rr97.4%
Final simplification97.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (let* ((t_0 (- (/ (+ x 4.0) y_m) (* z (/ x y_m))))) (if (<= t_0 -5e-242) (fabs t_0) (fabs (/ (- (+ x 4.0) (* x z)) y_m)))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= -5e-242) {
tmp = fabs(t_0);
} else {
tmp = fabs((((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) :: t_0
real(8) :: tmp
t_0 = ((x + 4.0d0) / y_m) - (z * (x / y_m))
if (t_0 <= (-5d-242)) then
tmp = abs(t_0)
else
tmp = abs((((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 t_0 = ((x + 4.0) / y_m) - (z * (x / y_m));
double tmp;
if (t_0 <= -5e-242) {
tmp = Math.abs(t_0);
} else {
tmp = Math.abs((((x + 4.0) - (x * z)) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)) tmp = 0 if t_0 <= -5e-242: tmp = math.fabs(t_0) else: tmp = math.fabs((((x + 4.0) - (x * z)) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(Float64(Float64(x + 4.0) / y_m) - Float64(z * Float64(x / y_m))) tmp = 0.0 if (t_0 <= -5e-242) tmp = abs(t_0); else tmp = abs(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) t_0 = ((x + 4.0) / y_m) - (z * (x / y_m)); tmp = 0.0; if (t_0 <= -5e-242) tmp = abs(t_0); else tmp = abs((((x + 4.0) - (x * z)) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_] := Block[{t$95$0 = N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-242], N[Abs[t$95$0], $MachinePrecision], N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := \frac{x + 4}{y\_m} - z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-242}:\\
\;\;\;\;\left|t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -4.9999999999999998e-242Initial program 98.2%
if -4.9999999999999998e-242 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 83.0%
fabs-sub83.0%
associate-*l/86.5%
associate-*r/87.1%
fma-neg89.2%
distribute-neg-frac89.2%
+-commutative89.2%
distribute-neg-in89.2%
unsub-neg89.2%
metadata-eval89.2%
Simplified89.2%
add-sqr-sqrt6.1%
sqrt-unprod63.3%
sqr-abs63.3%
neg-fabs63.3%
neg-fabs63.3%
sqr-abs63.3%
Applied egg-rr97.4%
Final simplification97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* x (/ z y_m))) (t_1 (/ (- (+ x 4.0) (* x z)) y_m)))
(if (<= z -1.3e+67)
t_1
(if (<= z -8.5e+55)
t_0
(if (<= z -0.00142)
t_1
(if (<= z 5.8e-6)
(fabs (/ (- -4.0 x) y_m))
(+ (* (- -4.0 x) (/ -1.0 y_m)) t_0)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double t_0 = x * (z / y_m);
double t_1 = ((x + 4.0) - (x * z)) / y_m;
double tmp;
if (z <= -1.3e+67) {
tmp = t_1;
} else if (z <= -8.5e+55) {
tmp = t_0;
} else if (z <= -0.00142) {
tmp = t_1;
} else if (z <= 5.8e-6) {
tmp = fabs(((-4.0 - x) / y_m));
} else {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + 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 = x * (z / y_m)
t_1 = ((x + 4.0d0) - (x * z)) / y_m
if (z <= (-1.3d+67)) then
tmp = t_1
else if (z <= (-8.5d+55)) then
tmp = t_0
else if (z <= (-0.00142d0)) then
tmp = t_1
else if (z <= 5.8d-6) then
tmp = abs((((-4.0d0) - x) / y_m))
else
tmp = (((-4.0d0) - x) * ((-1.0d0) / y_m)) + 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 = x * (z / y_m);
double t_1 = ((x + 4.0) - (x * z)) / y_m;
double tmp;
if (z <= -1.3e+67) {
tmp = t_1;
} else if (z <= -8.5e+55) {
tmp = t_0;
} else if (z <= -0.00142) {
tmp = t_1;
} else if (z <= 5.8e-6) {
tmp = Math.abs(((-4.0 - x) / y_m));
} else {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + t_0;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): t_0 = x * (z / y_m) t_1 = ((x + 4.0) - (x * z)) / y_m tmp = 0 if z <= -1.3e+67: tmp = t_1 elif z <= -8.5e+55: tmp = t_0 elif z <= -0.00142: tmp = t_1 elif z <= 5.8e-6: tmp = math.fabs(((-4.0 - x) / y_m)) else: tmp = ((-4.0 - x) * (-1.0 / y_m)) + t_0 return tmp
y_m = abs(y) function code(x, y_m, z) t_0 = Float64(x * Float64(z / y_m)) t_1 = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m) tmp = 0.0 if (z <= -1.3e+67) tmp = t_1; elseif (z <= -8.5e+55) tmp = t_0; elseif (z <= -0.00142) tmp = t_1; elseif (z <= 5.8e-6) tmp = abs(Float64(Float64(-4.0 - x) / y_m)); else tmp = Float64(Float64(Float64(-4.0 - x) * Float64(-1.0 / y_m)) + t_0); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) t_0 = x * (z / y_m); t_1 = ((x + 4.0) - (x * z)) / y_m; tmp = 0.0; if (z <= -1.3e+67) tmp = t_1; elseif (z <= -8.5e+55) tmp = t_0; elseif (z <= -0.00142) tmp = t_1; elseif (z <= 5.8e-6) tmp = abs(((-4.0 - x) / y_m)); else tmp = ((-4.0 - x) * (-1.0 / y_m)) + t_0; 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]}, Block[{t$95$1 = N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]}, If[LessEqual[z, -1.3e+67], t$95$1, If[LessEqual[z, -8.5e+55], t$95$0, If[LessEqual[z, -0.00142], t$95$1, If[LessEqual[z, 5.8e-6], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision], N[(N[(N[(-4.0 - x), $MachinePrecision] * N[(-1.0 / y$95$m), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_0 := x \cdot \frac{z}{y\_m}\\
t_1 := \frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.00142:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-6}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\mathbf{else}:\\
\;\;\;\;\left(-4 - x\right) \cdot \frac{-1}{y\_m} + t\_0\\
\end{array}
\end{array}
if z < -1.3e67 or -8.50000000000000002e55 < z < -0.00142000000000000004Initial program 96.5%
Simplified96.6%
add-sqr-sqrt61.1%
fabs-sqr61.1%
add-sqr-sqrt61.7%
*-commutative61.7%
Applied egg-rr61.7%
Taylor expanded in y around 0 61.7%
if -1.3e67 < z < -8.50000000000000002e55Initial program 99.6%
Simplified87.1%
add-sqr-sqrt29.8%
fabs-sqr29.8%
add-sqr-sqrt30.6%
*-commutative30.6%
Applied egg-rr30.6%
Taylor expanded in z around inf 30.6%
clear-num30.3%
un-div-inv30.3%
associate-/r*43.2%
metadata-eval43.2%
distribute-neg-frac43.2%
clear-num43.2%
distribute-neg-frac43.2%
Applied egg-rr43.2%
add-sqr-sqrt43.2%
sqrt-unprod43.2%
sqr-neg43.2%
sqrt-unprod0.0%
add-sqr-sqrt57.3%
associate-/r/57.3%
Applied egg-rr57.3%
if -0.00142000000000000004 < z < 5.8000000000000004e-6Initial program 94.7%
fabs-sub94.7%
associate-*l/99.2%
associate-*r/99.2%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 99.9%
associate-*r/99.9%
distribute-lft-in99.9%
metadata-eval99.9%
neg-mul-199.9%
sub-neg99.9%
Simplified99.9%
if 5.8000000000000004e-6 < z Initial program 70.3%
Simplified95.1%
add-sqr-sqrt39.9%
fabs-sqr39.9%
add-sqr-sqrt40.6%
*-commutative40.6%
Applied egg-rr40.6%
*-commutative40.6%
fma-undefine40.6%
distribute-rgt-in35.6%
div-inv35.6%
mul-1-neg35.6%
distribute-rgt-neg-in35.6%
div-inv35.7%
mul-1-neg35.7%
add-sqr-sqrt35.3%
fabs-sqr35.3%
add-sqr-sqrt78.4%
mul-1-neg78.4%
associate-*r/80.7%
neg-fabs80.7%
add-sqr-sqrt50.2%
fabs-sqr50.2%
add-sqr-sqrt57.2%
Applied egg-rr57.2%
Final simplification80.3%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -1.0) (not (<= z 5.8e-6))) (fabs (- (/ 4.0 y_m) (/ z (/ y_m x)))) (fabs (/ (- -4.0 x) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 5.8e-6)) {
tmp = fabs(((4.0 / y_m) - (z / (y_m / x))));
} else {
tmp = fabs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-1.0d0)) .or. (.not. (z <= 5.8d-6))) then
tmp = abs(((4.0d0 / y_m) - (z / (y_m / x))))
else
tmp = abs((((-4.0d0) - x) / y_m))
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 5.8e-6)) {
tmp = Math.abs(((4.0 / y_m) - (z / (y_m / x))));
} else {
tmp = Math.abs(((-4.0 - x) / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (z <= -1.0) or not (z <= 5.8e-6): tmp = math.fabs(((4.0 / y_m) - (z / (y_m / x)))) else: tmp = math.fabs(((-4.0 - x) / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 5.8e-6)) tmp = abs(Float64(Float64(4.0 / y_m) - Float64(z / Float64(y_m / x)))); else tmp = abs(Float64(Float64(-4.0 - x) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 5.8e-6))) tmp = abs(((4.0 / y_m) - (z / (y_m / x)))); else tmp = abs(((-4.0 - x) / y_m)); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 5.8e-6]], $MachinePrecision]], N[Abs[N[(N[(4.0 / y$95$m), $MachinePrecision] - N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 5.8 \cdot 10^{-6}\right):\\
\;\;\;\;\left|\frac{4}{y\_m} - \frac{z}{\frac{y\_m}{x}}\right|\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-4 - x}{y\_m}\right|\\
\end{array}
\end{array}
if z < -1 or 5.8000000000000004e-6 < z Initial program 83.6%
*-commutative83.6%
clear-num83.5%
un-div-inv83.6%
Applied egg-rr83.6%
Taylor expanded in x around 0 95.4%
if -1 < z < 5.8000000000000004e-6Initial program 94.8%
fabs-sub94.8%
associate-*l/99.2%
associate-*r/99.2%
fma-neg100.0%
distribute-neg-frac100.0%
+-commutative100.0%
distribute-neg-in100.0%
unsub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 98.9%
associate-*r/98.9%
distribute-lft-in98.9%
metadata-eval98.9%
neg-mul-198.9%
sub-neg98.9%
Simplified98.9%
Final simplification97.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (fabs (/ (- (+ x 4.0) (* x z)) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return fabs((((x + 4.0) - (x * z)) / 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((((x + 4.0d0) - (x * z)) / y_m))
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return Math.abs((((x + 4.0) - (x * z)) / y_m));
}
y_m = math.fabs(y) def code(x, y_m, z): return math.fabs((((x + 4.0) - (x * z)) / y_m))
y_m = abs(y) function code(x, y_m, z) return abs(Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = abs((((x + 4.0) - (x * z)) / y_m)); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[Abs[N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\left|\frac{\left(x + 4\right) - x \cdot z}{y\_m}\right|
\end{array}
Initial program 89.5%
fabs-sub89.5%
associate-*l/91.5%
associate-*r/91.2%
fma-neg92.4%
distribute-neg-frac92.4%
+-commutative92.4%
distribute-neg-in92.4%
unsub-neg92.4%
metadata-eval92.4%
Simplified92.4%
add-sqr-sqrt43.9%
sqrt-unprod65.8%
sqr-abs65.8%
neg-fabs65.8%
neg-fabs65.8%
sqr-abs65.8%
Applied egg-rr97.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -1.35e+249)
(/ z (/ y_m x))
(if (<= x -2.55e+178)
(* z (/ x (- y_m)))
(if (<= x -3e+26)
(* z (/ x y_m))
(if (<= x 1.3e+227)
(/ (- (+ x 4.0) (* x z)) y_m)
(+ (* (- -4.0 x) (/ -1.0 y_m)) (* x (/ z y_m))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -1.35e+249) {
tmp = z / (y_m / x);
} else if (x <= -2.55e+178) {
tmp = z * (x / -y_m);
} else if (x <= -3e+26) {
tmp = z * (x / y_m);
} else if (x <= 1.3e+227) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((-4.0 - x) * (-1.0 / 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.35d+249)) then
tmp = z / (y_m / x)
else if (x <= (-2.55d+178)) then
tmp = z * (x / -y_m)
else if (x <= (-3d+26)) then
tmp = z * (x / y_m)
else if (x <= 1.3d+227) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else
tmp = (((-4.0d0) - x) * ((-1.0d0) / 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.35e+249) {
tmp = z / (y_m / x);
} else if (x <= -2.55e+178) {
tmp = z * (x / -y_m);
} else if (x <= -3e+26) {
tmp = z * (x / y_m);
} else if (x <= 1.3e+227) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -1.35e+249: tmp = z / (y_m / x) elif x <= -2.55e+178: tmp = z * (x / -y_m) elif x <= -3e+26: tmp = z * (x / y_m) elif x <= 1.3e+227: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = ((-4.0 - x) * (-1.0 / y_m)) + (x * (z / y_m)) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -1.35e+249) tmp = Float64(z / Float64(y_m / x)); elseif (x <= -2.55e+178) tmp = Float64(z * Float64(x / Float64(-y_m))); elseif (x <= -3e+26) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 1.3e+227) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(Float64(Float64(-4.0 - x) * Float64(-1.0 / 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.35e+249) tmp = z / (y_m / x); elseif (x <= -2.55e+178) tmp = z * (x / -y_m); elseif (x <= -3e+26) tmp = z * (x / y_m); elseif (x <= 1.3e+227) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = ((-4.0 - x) * (-1.0 / 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.35e+249], N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.55e+178], N[(z * N[(x / (-y$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e+26], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+227], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(N[(-4.0 - x), $MachinePrecision] * N[(-1.0 / y$95$m), $MachinePrecision]), $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.35 \cdot 10^{+249}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{+178}:\\
\;\;\;\;z \cdot \frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{+26}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+227}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\left(-4 - x\right) \cdot \frac{-1}{y\_m} + x \cdot \frac{z}{y\_m}\\
\end{array}
\end{array}
if x < -1.35000000000000009e249Initial program 86.5%
Simplified93.9%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt33.9%
*-commutative33.9%
Applied egg-rr33.9%
Taylor expanded in z around inf 34.2%
add-sqr-sqrt34.1%
sqrt-unprod80.7%
mul-1-neg80.7%
mul-1-neg80.7%
sqr-neg80.7%
sqrt-unprod34.3%
add-sqr-sqrt34.5%
clear-num34.5%
associate-/r*40.5%
clear-num40.5%
Applied egg-rr40.5%
if -1.35000000000000009e249 < x < -2.5499999999999998e178Initial program 25.0%
Simplified100.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in z around inf 14.8%
add-sqr-sqrt14.8%
sqrt-unprod88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqr-neg88.1%
sqrt-unprod26.5%
add-sqr-sqrt26.8%
clear-num26.8%
associate-/r*50.3%
clear-num50.3%
Applied egg-rr50.3%
associate-/r/26.9%
associate-*l/26.8%
*-commutative26.8%
add-sqr-sqrt26.5%
sqrt-unprod88.1%
sqr-neg88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqrt-unprod14.8%
add-sqr-sqrt14.8%
mul-1-neg14.8%
div-inv14.8%
*-commutative14.8%
associate-*l*38.1%
div-inv38.1%
distribute-lft-neg-in38.1%
Applied egg-rr38.1%
if -2.5499999999999998e178 < x < -2.99999999999999997e26Initial program 89.2%
Simplified96.6%
add-sqr-sqrt46.5%
fabs-sqr46.5%
add-sqr-sqrt47.0%
*-commutative47.0%
Applied egg-rr47.0%
Taylor expanded in z around inf 23.7%
clear-num23.7%
un-div-inv23.7%
associate-/r*26.9%
metadata-eval26.9%
distribute-neg-frac26.9%
clear-num26.9%
distribute-neg-frac26.9%
Applied egg-rr26.9%
clear-num26.9%
associate-/r/30.3%
clear-num30.3%
add-sqr-sqrt22.5%
sqrt-unprod34.1%
sqr-neg34.1%
sqrt-unprod14.7%
add-sqr-sqrt33.9%
Applied egg-rr33.9%
if -2.99999999999999997e26 < x < 1.29999999999999991e227Initial program 95.1%
Simplified99.3%
add-sqr-sqrt48.2%
fabs-sqr48.2%
add-sqr-sqrt49.4%
*-commutative49.4%
Applied egg-rr49.4%
Taylor expanded in y around 0 49.4%
if 1.29999999999999991e227 < x Initial program 70.8%
Simplified88.0%
add-sqr-sqrt54.4%
fabs-sqr54.4%
add-sqr-sqrt54.6%
*-commutative54.6%
Applied egg-rr54.6%
*-commutative54.6%
fma-undefine54.6%
distribute-rgt-in46.3%
div-inv46.3%
mul-1-neg46.3%
distribute-rgt-neg-in46.3%
div-inv46.3%
mul-1-neg46.3%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt71.4%
mul-1-neg71.4%
associate-*r/83.3%
neg-fabs83.3%
add-sqr-sqrt45.9%
fabs-sqr45.9%
add-sqr-sqrt58.5%
Applied egg-rr58.5%
Final simplification47.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -5.8e+249)
(/ z (/ y_m x))
(if (<= x -1.08e+178)
(* z (/ x (- y_m)))
(if (<= x -2.1e+24)
(* z (/ x y_m))
(if (<= x 5.5e+213)
(/ (- (+ x 4.0) (* x z)) y_m)
(/ 1.0 (/ y_m (* x (+ z 1.0)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -5.8e+249) {
tmp = z / (y_m / x);
} else if (x <= -1.08e+178) {
tmp = z * (x / -y_m);
} else if (x <= -2.1e+24) {
tmp = z * (x / y_m);
} else if (x <= 5.5e+213) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = 1.0 / (y_m / (x * (z + 1.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) :: tmp
if (x <= (-5.8d+249)) then
tmp = z / (y_m / x)
else if (x <= (-1.08d+178)) then
tmp = z * (x / -y_m)
else if (x <= (-2.1d+24)) then
tmp = z * (x / y_m)
else if (x <= 5.5d+213) then
tmp = ((x + 4.0d0) - (x * z)) / y_m
else
tmp = 1.0d0 / (y_m / (x * (z + 1.0d0)))
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 <= -5.8e+249) {
tmp = z / (y_m / x);
} else if (x <= -1.08e+178) {
tmp = z * (x / -y_m);
} else if (x <= -2.1e+24) {
tmp = z * (x / y_m);
} else if (x <= 5.5e+213) {
tmp = ((x + 4.0) - (x * z)) / y_m;
} else {
tmp = 1.0 / (y_m / (x * (z + 1.0)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -5.8e+249: tmp = z / (y_m / x) elif x <= -1.08e+178: tmp = z * (x / -y_m) elif x <= -2.1e+24: tmp = z * (x / y_m) elif x <= 5.5e+213: tmp = ((x + 4.0) - (x * z)) / y_m else: tmp = 1.0 / (y_m / (x * (z + 1.0))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -5.8e+249) tmp = Float64(z / Float64(y_m / x)); elseif (x <= -1.08e+178) tmp = Float64(z * Float64(x / Float64(-y_m))); elseif (x <= -2.1e+24) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 5.5e+213) tmp = Float64(Float64(Float64(x + 4.0) - Float64(x * z)) / y_m); else tmp = Float64(1.0 / Float64(y_m / Float64(x * Float64(z + 1.0)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -5.8e+249) tmp = z / (y_m / x); elseif (x <= -1.08e+178) tmp = z * (x / -y_m); elseif (x <= -2.1e+24) tmp = z * (x / y_m); elseif (x <= 5.5e+213) tmp = ((x + 4.0) - (x * z)) / y_m; else tmp = 1.0 / (y_m / (x * (z + 1.0))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -5.8e+249], N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.08e+178], N[(z * N[(x / (-y$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e+24], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e+213], N[(N[(N[(x + 4.0), $MachinePrecision] - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(1.0 / N[(y$95$m / N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+249}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{+178}:\\
\;\;\;\;z \cdot \frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{+24}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+213}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y\_m}{x \cdot \left(z + 1\right)}}\\
\end{array}
\end{array}
if x < -5.80000000000000034e249Initial program 86.5%
Simplified93.9%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt33.9%
*-commutative33.9%
Applied egg-rr33.9%
Taylor expanded in z around inf 34.2%
add-sqr-sqrt34.1%
sqrt-unprod80.7%
mul-1-neg80.7%
mul-1-neg80.7%
sqr-neg80.7%
sqrt-unprod34.3%
add-sqr-sqrt34.5%
clear-num34.5%
associate-/r*40.5%
clear-num40.5%
Applied egg-rr40.5%
if -5.80000000000000034e249 < x < -1.07999999999999996e178Initial program 25.0%
Simplified100.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in z around inf 14.8%
add-sqr-sqrt14.8%
sqrt-unprod88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqr-neg88.1%
sqrt-unprod26.5%
add-sqr-sqrt26.8%
clear-num26.8%
associate-/r*50.3%
clear-num50.3%
Applied egg-rr50.3%
associate-/r/26.9%
associate-*l/26.8%
*-commutative26.8%
add-sqr-sqrt26.5%
sqrt-unprod88.1%
sqr-neg88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqrt-unprod14.8%
add-sqr-sqrt14.8%
mul-1-neg14.8%
div-inv14.8%
*-commutative14.8%
associate-*l*38.1%
div-inv38.1%
distribute-lft-neg-in38.1%
Applied egg-rr38.1%
if -1.07999999999999996e178 < x < -2.1000000000000001e24Initial program 89.2%
Simplified96.6%
add-sqr-sqrt46.5%
fabs-sqr46.5%
add-sqr-sqrt47.0%
*-commutative47.0%
Applied egg-rr47.0%
Taylor expanded in z around inf 23.7%
clear-num23.7%
un-div-inv23.7%
associate-/r*26.9%
metadata-eval26.9%
distribute-neg-frac26.9%
clear-num26.9%
distribute-neg-frac26.9%
Applied egg-rr26.9%
clear-num26.9%
associate-/r/30.3%
clear-num30.3%
add-sqr-sqrt22.5%
sqrt-unprod34.1%
sqr-neg34.1%
sqrt-unprod14.7%
add-sqr-sqrt33.9%
Applied egg-rr33.9%
if -2.1000000000000001e24 < x < 5.50000000000000059e213Initial program 96.1%
Simplified99.3%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in y around 0 50.3%
if 5.50000000000000059e213 < x Initial program 68.9%
Simplified90.0%
add-sqr-sqrt48.5%
fabs-sqr48.5%
add-sqr-sqrt48.7%
*-commutative48.7%
Applied egg-rr48.7%
Taylor expanded in x around inf 48.7%
mul-1-neg48.7%
associate-/l*55.3%
distribute-rgt-neg-in55.3%
mul-1-neg55.3%
associate-*r/55.3%
sub-neg55.3%
metadata-eval55.3%
distribute-lft-in55.3%
neg-mul-155.3%
metadata-eval55.3%
+-commutative55.3%
unsub-neg55.3%
Simplified55.3%
associate-*r/48.7%
clear-num48.7%
*-un-lft-identity48.7%
*-un-lft-identity48.7%
sub-neg48.7%
add-sqr-sqrt27.7%
sqrt-unprod65.9%
sqr-neg65.9%
sqrt-unprod38.1%
add-sqr-sqrt55.5%
+-commutative55.5%
Applied egg-rr55.5%
Final simplification48.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -7.5e+248)
(/ z (/ y_m x))
(if (<= x -2.2e+178)
(* z (/ x (- y_m)))
(if (<= x -8.5e-6)
(* z (/ x y_m))
(if (<= x 1.45e+16)
(/ (+ x 4.0) y_m)
(/ 1.0 (/ y_m (* x (+ z 1.0)))))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -7.5e+248) {
tmp = z / (y_m / x);
} else if (x <= -2.2e+178) {
tmp = z * (x / -y_m);
} else if (x <= -8.5e-6) {
tmp = z * (x / y_m);
} else if (x <= 1.45e+16) {
tmp = (x + 4.0) / y_m;
} else {
tmp = 1.0 / (y_m / (x * (z + 1.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) :: tmp
if (x <= (-7.5d+248)) then
tmp = z / (y_m / x)
else if (x <= (-2.2d+178)) then
tmp = z * (x / -y_m)
else if (x <= (-8.5d-6)) then
tmp = z * (x / y_m)
else if (x <= 1.45d+16) then
tmp = (x + 4.0d0) / y_m
else
tmp = 1.0d0 / (y_m / (x * (z + 1.0d0)))
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 <= -7.5e+248) {
tmp = z / (y_m / x);
} else if (x <= -2.2e+178) {
tmp = z * (x / -y_m);
} else if (x <= -8.5e-6) {
tmp = z * (x / y_m);
} else if (x <= 1.45e+16) {
tmp = (x + 4.0) / y_m;
} else {
tmp = 1.0 / (y_m / (x * (z + 1.0)));
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -7.5e+248: tmp = z / (y_m / x) elif x <= -2.2e+178: tmp = z * (x / -y_m) elif x <= -8.5e-6: tmp = z * (x / y_m) elif x <= 1.45e+16: tmp = (x + 4.0) / y_m else: tmp = 1.0 / (y_m / (x * (z + 1.0))) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -7.5e+248) tmp = Float64(z / Float64(y_m / x)); elseif (x <= -2.2e+178) tmp = Float64(z * Float64(x / Float64(-y_m))); elseif (x <= -8.5e-6) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 1.45e+16) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(1.0 / Float64(y_m / Float64(x * Float64(z + 1.0)))); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -7.5e+248) tmp = z / (y_m / x); elseif (x <= -2.2e+178) tmp = z * (x / -y_m); elseif (x <= -8.5e-6) tmp = z * (x / y_m); elseif (x <= 1.45e+16) tmp = (x + 4.0) / y_m; else tmp = 1.0 / (y_m / (x * (z + 1.0))); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -7.5e+248], N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.2e+178], N[(z * N[(x / (-y$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-6], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e+16], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(1.0 / N[(y$95$m / N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+248}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+178}:\\
\;\;\;\;z \cdot \frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+16}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y\_m}{x \cdot \left(z + 1\right)}}\\
\end{array}
\end{array}
if x < -7.5000000000000004e248Initial program 86.5%
Simplified93.9%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt33.9%
*-commutative33.9%
Applied egg-rr33.9%
Taylor expanded in z around inf 34.2%
add-sqr-sqrt34.1%
sqrt-unprod80.7%
mul-1-neg80.7%
mul-1-neg80.7%
sqr-neg80.7%
sqrt-unprod34.3%
add-sqr-sqrt34.5%
clear-num34.5%
associate-/r*40.5%
clear-num40.5%
Applied egg-rr40.5%
if -7.5000000000000004e248 < x < -2.19999999999999997e178Initial program 25.0%
Simplified100.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in z around inf 14.8%
add-sqr-sqrt14.8%
sqrt-unprod88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqr-neg88.1%
sqrt-unprod26.5%
add-sqr-sqrt26.8%
clear-num26.8%
associate-/r*50.3%
clear-num50.3%
Applied egg-rr50.3%
associate-/r/26.9%
associate-*l/26.8%
*-commutative26.8%
add-sqr-sqrt26.5%
sqrt-unprod88.1%
sqr-neg88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqrt-unprod14.8%
add-sqr-sqrt14.8%
mul-1-neg14.8%
div-inv14.8%
*-commutative14.8%
associate-*l*38.1%
div-inv38.1%
distribute-lft-neg-in38.1%
Applied egg-rr38.1%
if -2.19999999999999997e178 < x < -8.4999999999999999e-6Initial program 90.6%
Simplified96.9%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
*-commutative50.6%
Applied egg-rr50.6%
Taylor expanded in z around inf 30.3%
clear-num30.3%
un-div-inv30.3%
associate-/r*33.1%
metadata-eval33.1%
distribute-neg-frac33.1%
clear-num33.1%
distribute-neg-frac33.1%
Applied egg-rr33.1%
clear-num33.1%
associate-/r/36.1%
clear-num36.2%
add-sqr-sqrt22.7%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod13.2%
add-sqr-sqrt30.0%
Applied egg-rr30.0%
if -8.4999999999999999e-6 < x < 1.45e16Initial program 96.3%
Simplified99.9%
add-sqr-sqrt45.4%
fabs-sqr45.4%
add-sqr-sqrt46.8%
*-commutative46.8%
Applied egg-rr46.8%
Taylor expanded in z around 0 40.8%
if 1.45e16 < x Initial program 84.2%
Simplified94.4%
add-sqr-sqrt54.1%
fabs-sqr54.1%
add-sqr-sqrt54.5%
*-commutative54.5%
Applied egg-rr54.5%
Taylor expanded in x around inf 54.6%
mul-1-neg54.6%
associate-/l*57.2%
distribute-rgt-neg-in57.2%
mul-1-neg57.2%
associate-*r/57.2%
sub-neg57.2%
metadata-eval57.2%
distribute-lft-in57.2%
neg-mul-157.2%
metadata-eval57.2%
+-commutative57.2%
unsub-neg57.2%
Simplified57.2%
associate-*r/54.6%
clear-num54.5%
*-un-lft-identity54.5%
*-un-lft-identity54.5%
sub-neg54.5%
add-sqr-sqrt30.0%
sqrt-unprod58.9%
sqr-neg58.9%
sqrt-unprod28.8%
add-sqr-sqrt50.8%
+-commutative50.8%
Applied egg-rr50.8%
Final simplification42.1%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -9e+249)
(/ z (/ y_m x))
(if (<= x -9.8e+177)
(* z (/ x (- y_m)))
(if (<= x -6.9e-6)
(* z (/ x y_m))
(if (<= x 3.1e+35) (/ (+ x 4.0) y_m) (* x (/ (- 1.0 z) y_m)))))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -9e+249) {
tmp = z / (y_m / x);
} else if (x <= -9.8e+177) {
tmp = z * (x / -y_m);
} else if (x <= -6.9e-6) {
tmp = z * (x / y_m);
} else if (x <= 3.1e+35) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9d+249)) then
tmp = z / (y_m / x)
else if (x <= (-9.8d+177)) then
tmp = z * (x / -y_m)
else if (x <= (-6.9d-6)) then
tmp = z * (x / y_m)
else if (x <= 3.1d+35) then
tmp = (x + 4.0d0) / y_m
else
tmp = x * ((1.0d0 - z) / y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -9e+249) {
tmp = z / (y_m / x);
} else if (x <= -9.8e+177) {
tmp = z * (x / -y_m);
} else if (x <= -6.9e-6) {
tmp = z * (x / y_m);
} else if (x <= 3.1e+35) {
tmp = (x + 4.0) / y_m;
} else {
tmp = x * ((1.0 - z) / y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -9e+249: tmp = z / (y_m / x) elif x <= -9.8e+177: tmp = z * (x / -y_m) elif x <= -6.9e-6: tmp = z * (x / y_m) elif x <= 3.1e+35: tmp = (x + 4.0) / y_m else: tmp = x * ((1.0 - z) / y_m) return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -9e+249) tmp = Float64(z / Float64(y_m / x)); elseif (x <= -9.8e+177) tmp = Float64(z * Float64(x / Float64(-y_m))); elseif (x <= -6.9e-6) tmp = Float64(z * Float64(x / y_m)); elseif (x <= 3.1e+35) tmp = Float64(Float64(x + 4.0) / y_m); else tmp = Float64(x * Float64(Float64(1.0 - z) / y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -9e+249) tmp = z / (y_m / x); elseif (x <= -9.8e+177) tmp = z * (x / -y_m); elseif (x <= -6.9e-6) tmp = z * (x / y_m); elseif (x <= 3.1e+35) tmp = (x + 4.0) / y_m; else tmp = x * ((1.0 - z) / y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -9e+249], N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -9.8e+177], N[(z * N[(x / (-y$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.9e-6], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+35], N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision], N[(x * N[(N[(1.0 - z), $MachinePrecision] / y$95$m), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+249}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;x \leq -9.8 \cdot 10^{+177}:\\
\;\;\;\;z \cdot \frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -6.9 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+35}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1 - z}{y\_m}\\
\end{array}
\end{array}
if x < -8.9999999999999993e249Initial program 86.5%
Simplified93.9%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt33.9%
*-commutative33.9%
Applied egg-rr33.9%
Taylor expanded in z around inf 34.2%
add-sqr-sqrt34.1%
sqrt-unprod80.7%
mul-1-neg80.7%
mul-1-neg80.7%
sqr-neg80.7%
sqrt-unprod34.3%
add-sqr-sqrt34.5%
clear-num34.5%
associate-/r*40.5%
clear-num40.5%
Applied egg-rr40.5%
if -8.9999999999999993e249 < x < -9.8000000000000003e177Initial program 25.0%
Simplified100.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in z around inf 14.8%
add-sqr-sqrt14.8%
sqrt-unprod88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqr-neg88.1%
sqrt-unprod26.5%
add-sqr-sqrt26.8%
clear-num26.8%
associate-/r*50.3%
clear-num50.3%
Applied egg-rr50.3%
associate-/r/26.9%
associate-*l/26.8%
*-commutative26.8%
add-sqr-sqrt26.5%
sqrt-unprod88.1%
sqr-neg88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqrt-unprod14.8%
add-sqr-sqrt14.8%
mul-1-neg14.8%
div-inv14.8%
*-commutative14.8%
associate-*l*38.1%
div-inv38.1%
distribute-lft-neg-in38.1%
Applied egg-rr38.1%
if -9.8000000000000003e177 < x < -6.9e-6Initial program 90.6%
Simplified96.9%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
*-commutative50.6%
Applied egg-rr50.6%
Taylor expanded in z around inf 30.3%
clear-num30.3%
un-div-inv30.3%
associate-/r*33.1%
metadata-eval33.1%
distribute-neg-frac33.1%
clear-num33.1%
distribute-neg-frac33.1%
Applied egg-rr33.1%
clear-num33.1%
associate-/r/36.1%
clear-num36.2%
add-sqr-sqrt22.7%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod13.2%
add-sqr-sqrt30.0%
Applied egg-rr30.0%
if -6.9e-6 < x < 3.09999999999999987e35Initial program 96.5%
Simplified99.9%
add-sqr-sqrt46.2%
fabs-sqr46.2%
add-sqr-sqrt47.6%
*-commutative47.6%
Applied egg-rr47.6%
Taylor expanded in z around 0 41.1%
if 3.09999999999999987e35 < x Initial program 83.2%
Simplified94.1%
add-sqr-sqrt52.9%
fabs-sqr52.9%
add-sqr-sqrt53.3%
*-commutative53.3%
Applied egg-rr53.3%
Taylor expanded in x around inf 53.3%
mul-1-neg53.3%
associate-/l*56.1%
distribute-rgt-neg-in56.1%
mul-1-neg56.1%
associate-*r/56.1%
sub-neg56.1%
metadata-eval56.1%
distribute-lft-in56.1%
neg-mul-156.1%
metadata-eval56.1%
+-commutative56.1%
unsub-neg56.1%
Simplified56.1%
Final simplification43.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -6.7e+249)
(/ z (/ y_m x))
(if (<= x -3e+178)
(* z (/ x (- y_m)))
(if (<= x -7.5e-6) (* z (/ x y_m)) (/ (+ x 4.0) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -6.7e+249) {
tmp = z / (y_m / x);
} else if (x <= -3e+178) {
tmp = z * (x / -y_m);
} else if (x <= -7.5e-6) {
tmp = z * (x / 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 <= (-6.7d+249)) then
tmp = z / (y_m / x)
else if (x <= (-3d+178)) then
tmp = z * (x / -y_m)
else if (x <= (-7.5d-6)) then
tmp = z * (x / 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 <= -6.7e+249) {
tmp = z / (y_m / x);
} else if (x <= -3e+178) {
tmp = z * (x / -y_m);
} else if (x <= -7.5e-6) {
tmp = z * (x / 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 <= -6.7e+249: tmp = z / (y_m / x) elif x <= -3e+178: tmp = z * (x / -y_m) elif x <= -7.5e-6: tmp = z * (x / 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 <= -6.7e+249) tmp = Float64(z / Float64(y_m / x)); elseif (x <= -3e+178) tmp = Float64(z * Float64(x / Float64(-y_m))); elseif (x <= -7.5e-6) tmp = Float64(z * Float64(x / 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 <= -6.7e+249) tmp = z / (y_m / x); elseif (x <= -3e+178) tmp = z * (x / -y_m); elseif (x <= -7.5e-6) tmp = z * (x / 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, -6.7e+249], N[(z / N[(y$95$m / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3e+178], N[(z * N[(x / (-y$95$m)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-6], N[(z * N[(x / 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 -6.7 \cdot 10^{+249}:\\
\;\;\;\;\frac{z}{\frac{y\_m}{x}}\\
\mathbf{elif}\;x \leq -3 \cdot 10^{+178}:\\
\;\;\;\;z \cdot \frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -6.70000000000000027e249Initial program 86.5%
Simplified93.9%
add-sqr-sqrt33.8%
fabs-sqr33.8%
add-sqr-sqrt33.9%
*-commutative33.9%
Applied egg-rr33.9%
Taylor expanded in z around inf 34.2%
add-sqr-sqrt34.1%
sqrt-unprod80.7%
mul-1-neg80.7%
mul-1-neg80.7%
sqr-neg80.7%
sqrt-unprod34.3%
add-sqr-sqrt34.5%
clear-num34.5%
associate-/r*40.5%
clear-num40.5%
Applied egg-rr40.5%
if -6.70000000000000027e249 < x < -3.00000000000000016e178Initial program 25.0%
Simplified100.0%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.2%
*-commutative50.2%
Applied egg-rr50.2%
Taylor expanded in z around inf 14.8%
add-sqr-sqrt14.8%
sqrt-unprod88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqr-neg88.1%
sqrt-unprod26.5%
add-sqr-sqrt26.8%
clear-num26.8%
associate-/r*50.3%
clear-num50.3%
Applied egg-rr50.3%
associate-/r/26.9%
associate-*l/26.8%
*-commutative26.8%
add-sqr-sqrt26.5%
sqrt-unprod88.1%
sqr-neg88.1%
mul-1-neg88.1%
mul-1-neg88.1%
sqrt-unprod14.8%
add-sqr-sqrt14.8%
mul-1-neg14.8%
div-inv14.8%
*-commutative14.8%
associate-*l*38.1%
div-inv38.1%
distribute-lft-neg-in38.1%
Applied egg-rr38.1%
if -3.00000000000000016e178 < x < -7.50000000000000019e-6Initial program 90.6%
Simplified96.9%
add-sqr-sqrt50.0%
fabs-sqr50.0%
add-sqr-sqrt50.6%
*-commutative50.6%
Applied egg-rr50.6%
Taylor expanded in z around inf 30.3%
clear-num30.3%
un-div-inv30.3%
associate-/r*33.1%
metadata-eval33.1%
distribute-neg-frac33.1%
clear-num33.1%
distribute-neg-frac33.1%
Applied egg-rr33.1%
clear-num33.1%
associate-/r/36.1%
clear-num36.2%
add-sqr-sqrt22.7%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod13.2%
add-sqr-sqrt30.0%
Applied egg-rr30.0%
if -7.50000000000000019e-6 < x Initial program 92.1%
Simplified98.0%
add-sqr-sqrt48.4%
fabs-sqr48.4%
add-sqr-sqrt49.5%
*-commutative49.5%
Applied egg-rr49.5%
Taylor expanded in z around 0 41.2%
Final simplification39.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (or (<= z -0.17) (not (<= z 6.6e+18))) (* x (/ z y_m)) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if ((z <= -0.17) || !(z <= 6.6e+18)) {
tmp = x * (z / 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 ((z <= (-0.17d0)) .or. (.not. (z <= 6.6d+18))) then
tmp = x * (z / 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 ((z <= -0.17) || !(z <= 6.6e+18)) {
tmp = x * (z / y_m);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if (z <= -0.17) or not (z <= 6.6e+18): tmp = x * (z / y_m) else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if ((z <= -0.17) || !(z <= 6.6e+18)) tmp = Float64(x * Float64(z / 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 ((z <= -0.17) || ~((z <= 6.6e+18))) tmp = x * (z / 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[Or[LessEqual[z, -0.17], N[Not[LessEqual[z, 6.6e+18]], $MachinePrecision]], N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.17 \lor \neg \left(z \leq 6.6 \cdot 10^{+18}\right):\\
\;\;\;\;x \cdot \frac{z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if z < -0.170000000000000012 or 6.6e18 < z Initial program 83.6%
Simplified95.2%
add-sqr-sqrt47.9%
fabs-sqr47.9%
add-sqr-sqrt48.5%
*-commutative48.5%
Applied egg-rr48.5%
Taylor expanded in z around inf 33.9%
clear-num33.8%
un-div-inv33.8%
associate-/r*35.3%
metadata-eval35.3%
distribute-neg-frac35.3%
clear-num35.3%
distribute-neg-frac35.3%
Applied egg-rr35.3%
add-sqr-sqrt20.4%
sqrt-unprod34.3%
sqr-neg34.3%
sqrt-unprod21.0%
add-sqr-sqrt35.4%
associate-/r/36.4%
Applied egg-rr36.4%
if -0.170000000000000012 < z < 6.6e18Initial program 94.8%
Simplified99.9%
add-sqr-sqrt47.8%
fabs-sqr47.8%
add-sqr-sqrt48.9%
*-commutative48.9%
Applied egg-rr48.9%
Taylor expanded in x around inf 26.8%
mul-1-neg26.8%
associate-/l*26.7%
distribute-rgt-neg-in26.7%
mul-1-neg26.7%
associate-*r/26.7%
sub-neg26.7%
metadata-eval26.7%
distribute-lft-in26.7%
neg-mul-126.7%
metadata-eval26.7%
+-commutative26.7%
unsub-neg26.7%
Simplified26.7%
Taylor expanded in z around 0 26.2%
Final simplification31.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -8.5e-6) (* z (/ x 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-6) {
tmp = z * (x / 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-6)) then
tmp = z * (x / 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-6) {
tmp = z * (x / 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-6: tmp = z * (x / 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-6) tmp = Float64(z * Float64(x / 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-6) tmp = z * (x / 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-6], N[(z * N[(x / 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^{-6}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -8.4999999999999999e-6Initial program 79.9%
Simplified96.5%
add-sqr-sqrt45.6%
fabs-sqr45.6%
add-sqr-sqrt46.0%
*-commutative46.0%
Applied egg-rr46.0%
Taylor expanded in z around inf 29.1%
clear-num29.1%
un-div-inv29.1%
associate-/r*37.5%
metadata-eval37.5%
distribute-neg-frac37.5%
clear-num37.5%
distribute-neg-frac37.5%
Applied egg-rr37.5%
clear-num37.5%
associate-/r/39.2%
clear-num39.2%
add-sqr-sqrt24.0%
sqrt-unprod32.1%
sqr-neg32.1%
sqrt-unprod16.8%
add-sqr-sqrt35.8%
Applied egg-rr35.8%
if -8.4999999999999999e-6 < x Initial program 92.1%
Simplified98.0%
add-sqr-sqrt48.4%
fabs-sqr48.4%
add-sqr-sqrt49.5%
*-commutative49.5%
Applied egg-rr49.5%
Taylor expanded in z around 0 41.2%
Final simplification40.0%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x 2.4e-46) (* z (/ x y_m)) (/ x y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= 2.4e-46) {
tmp = z * (x / 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 <= 2.4d-46) then
tmp = z * (x / 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 <= 2.4e-46) {
tmp = z * (x / y_m);
} else {
tmp = x / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= 2.4e-46: tmp = z * (x / y_m) else: tmp = x / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= 2.4e-46) tmp = Float64(z * Float64(x / 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 <= 2.4e-46) tmp = z * (x / 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, 2.4e-46], N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision], N[(x / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{-46}:\\
\;\;\;\;z \cdot \frac{x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m}\\
\end{array}
\end{array}
if x < 2.40000000000000013e-46Initial program 90.9%
Simplified98.8%
add-sqr-sqrt45.1%
fabs-sqr45.1%
add-sqr-sqrt46.2%
*-commutative46.2%
Applied egg-rr46.2%
Taylor expanded in z around inf 16.0%
clear-num15.9%
un-div-inv15.9%
associate-/r*17.5%
metadata-eval17.5%
distribute-neg-frac17.5%
clear-num17.5%
distribute-neg-frac17.5%
Applied egg-rr17.5%
clear-num17.5%
associate-/r/18.0%
clear-num18.0%
add-sqr-sqrt10.2%
sqrt-unprod14.4%
sqr-neg14.4%
sqrt-unprod9.9%
add-sqr-sqrt17.8%
Applied egg-rr17.8%
if 2.40000000000000013e-46 < x Initial program 86.4%
Simplified95.1%
add-sqr-sqrt53.5%
fabs-sqr53.5%
add-sqr-sqrt54.1%
*-commutative54.1%
Applied egg-rr54.1%
Taylor expanded in x around inf 50.2%
mul-1-neg50.2%
associate-/l*52.4%
distribute-rgt-neg-in52.4%
mul-1-neg52.4%
associate-*r/52.4%
sub-neg52.4%
metadata-eval52.4%
distribute-lft-in52.4%
neg-mul-152.4%
metadata-eval52.4%
+-commutative52.4%
unsub-neg52.4%
Simplified52.4%
Taylor expanded in z around 0 39.4%
Final simplification24.7%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (/ x y_m))
y_m = fabs(y);
double code(double x, double y_m, double z) {
return x / 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 = x / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
return x / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z): return x / y_m
y_m = abs(y) function code(x, y_m, z) return Float64(x / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z) tmp = x / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := N[(x / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{x}{y\_m}
\end{array}
Initial program 89.5%
Simplified97.7%
add-sqr-sqrt47.8%
fabs-sqr47.8%
add-sqr-sqrt48.7%
*-commutative48.7%
Applied egg-rr48.7%
Taylor expanded in x around inf 30.7%
mul-1-neg30.7%
associate-/l*32.1%
distribute-rgt-neg-in32.1%
mul-1-neg32.1%
associate-*r/32.1%
sub-neg32.1%
metadata-eval32.1%
distribute-lft-in32.1%
neg-mul-132.1%
metadata-eval32.1%
+-commutative32.1%
unsub-neg32.1%
Simplified32.1%
Taylor expanded in z around 0 21.6%
herbie shell --seed 2024111
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))