
(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 14 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 8.4e-67) (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 <= 8.4e-67) {
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 <= 8.4e-67) 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, 8.4e-67], 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 8.4 \cdot 10^{-67}:\\
\;\;\;\;\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 < 8.4000000000000006e-67Initial program 85.7%
Simplified98.2%
if 8.4000000000000006e-67 < y Initial program 94.7%
fabs-sub94.7%
associate-*l/94.6%
associate-*r/99.8%
fma-neg99.8%
distribute-neg-frac99.8%
+-commutative99.8%
distribute-neg-in99.8%
unsub-neg99.8%
metadata-eval99.8%
Simplified99.8%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(let* ((t_0 (* z (/ x y_m))))
(if (<= (- (/ (+ x 4.0) y_m) t_0) -2e-265)
(+ (/ (- -4.0 x) y_m) t_0)
(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 = z * (x / y_m);
double tmp;
if ((((x + 4.0) / y_m) - t_0) <= -2e-265) {
tmp = ((-4.0 - x) / y_m) + t_0;
} 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(z * Float64(x / y_m)) tmp = 0.0 if (Float64(Float64(Float64(x + 4.0) / y_m) - t_0) <= -2e-265) tmp = Float64(Float64(Float64(-4.0 - x) / y_m) + t_0); 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[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision] - t$95$0), $MachinePrecision], -2e-265], N[(N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision] + t$95$0), $MachinePrecision], 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 := z \cdot \frac{x}{y\_m}\\
\mathbf{if}\;\frac{x + 4}{y\_m} - t\_0 \leq -2 \cdot 10^{-265}:\\
\;\;\;\;\frac{-4 - x}{y\_m} + t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{y\_m} \cdot \mathsf{fma}\left(x, z, -4 - x\right)\right|\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < -1.99999999999999997e-265Initial program 98.1%
fabs-sub98.1%
associate-*l/94.9%
associate-*r/95.8%
fma-neg95.8%
distribute-neg-frac95.8%
+-commutative95.8%
distribute-neg-in95.8%
unsub-neg95.8%
metadata-eval95.8%
Simplified95.8%
Applied egg-rr98.1%
if -1.99999999999999997e-265 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 81.4%
Simplified98.5%
Final simplification98.3%
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)))) (if (<= (- t_0 t_1) INFINITY) (fabs (- t_1 t_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 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= ((double) INFINITY)) {
tmp = fabs((t_1 - t_0));
} else {
tmp = 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 = z * (x / y_m);
double tmp;
if ((t_0 - t_1) <= Double.POSITIVE_INFINITY) {
tmp = Math.abs((t_1 - t_0));
} else {
tmp = 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 = z * (x / y_m) tmp = 0 if (t_0 - t_1) <= math.inf: tmp = math.fabs((t_1 - t_0)) else: tmp = 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(z * Float64(x / y_m)) tmp = 0.0 if (Float64(t_0 - t_1) <= Inf) tmp = abs(Float64(t_1 - t_0)); else tmp = Float64(x / Float64(-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 = z * (x / y_m); tmp = 0.0; if ((t_0 - t_1) <= Inf) tmp = abs((t_1 - 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[(N[(x + 4.0), $MachinePrecision] / y$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 - t$95$1), $MachinePrecision], Infinity], N[Abs[N[(t$95$1 - t$95$0), $MachinePrecision]], $MachinePrecision], N[(x / (-y$95$m)), $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}\\
\mathbf{if}\;t\_0 - t\_1 \leq \infty:\\
\;\;\;\;\left|t\_1 - t\_0\right|\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < +inf.0Initial program 96.7%
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/28.6%
associate-*r/28.6%
fma-neg57.1%
distribute-neg-frac57.1%
+-commutative57.1%
distribute-neg-in57.1%
unsub-neg57.1%
metadata-eval57.1%
Simplified57.1%
add-sqr-sqrt23.8%
fabs-sqr23.8%
add-sqr-sqrt23.8%
fma-undefine9.5%
associate-*r/9.5%
associate-*l/0.0%
div-inv0.0%
sub-neg0.0%
metadata-eval0.0%
distribute-neg-in0.0%
+-commutative0.0%
cancel-sign-sub-inv0.0%
div-inv0.0%
associate-*l/9.5%
sub-div42.9%
Applied egg-rr42.9%
Taylor expanded in z around 0 42.9%
associate-*r/42.9%
distribute-lft-in42.9%
metadata-eval42.9%
neg-mul-142.9%
unsub-neg42.9%
Simplified42.9%
Taylor expanded in x around inf 42.9%
neg-mul-142.9%
Simplified42.9%
Final simplification92.3%
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-295)
(- (* x (/ z y_m)) t_0)
(/ (- (+ 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-295) {
tmp = (x * (z / y_m)) - t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (x + 4.0d0) / y_m
if ((t_0 - (z * (x / y_m))) <= 5d-295) then
tmp = (x * (z / y_m)) - t_0
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 t_0 = (x + 4.0) / y_m;
double tmp;
if ((t_0 - (z * (x / y_m))) <= 5e-295) {
tmp = (x * (z / y_m)) - t_0;
} else {
tmp = ((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-295: tmp = (x * (z / y_m)) - t_0 else: tmp = ((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-295) tmp = Float64(Float64(x * Float64(z / y_m)) - t_0); 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) t_0 = (x + 4.0) / y_m; tmp = 0.0; if ((t_0 - (z * (x / y_m))) <= 5e-295) tmp = (x * (z / y_m)) - t_0; 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_] := 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-295], N[(N[(x * N[(z / y$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $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}
t_0 := \frac{x + 4}{y\_m}\\
\mathbf{if}\;t\_0 - z \cdot \frac{x}{y\_m} \leq 5 \cdot 10^{-295}:\\
\;\;\;\;x \cdot \frac{z}{y\_m} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) < 5.00000000000000008e-295Initial program 96.7%
fabs-sub96.7%
associate-*l/95.4%
associate-*r/96.1%
fma-neg96.1%
distribute-neg-frac96.1%
+-commutative96.1%
distribute-neg-in96.1%
unsub-neg96.1%
metadata-eval96.1%
Simplified96.1%
add-sqr-sqrt92.3%
fabs-sqr92.3%
add-sqr-sqrt93.0%
fma-undefine93.0%
associate-*r/92.3%
associate-*l/96.0%
div-inv95.9%
sub-neg95.9%
metadata-eval95.9%
distribute-neg-in95.9%
+-commutative95.9%
cancel-sign-sub-inv95.9%
associate-*l/92.3%
associate-*r/93.0%
div-inv93.0%
Applied egg-rr93.0%
if 5.00000000000000008e-295 < (-.f64 (/.f64 (+.f64 x #s(literal 4 binary64)) y) (*.f64 (/.f64 x y) z)) Initial program 81.3%
fabs-sub81.3%
associate-*l/87.2%
associate-*r/85.8%
fma-neg90.3%
distribute-neg-frac90.3%
+-commutative90.3%
distribute-neg-in90.3%
unsub-neg90.3%
metadata-eval90.3%
Simplified90.3%
fma-undefine85.8%
associate-*r/87.2%
associate-*l/81.3%
div-inv81.2%
sub-neg81.2%
metadata-eval81.2%
distribute-neg-in81.2%
+-commutative81.2%
cancel-sign-sub-inv81.2%
div-inv81.3%
fabs-sub81.3%
add-sqr-sqrt80.7%
fabs-sqr80.7%
add-sqr-sqrt81.3%
associate-*l/84.2%
sub-div90.3%
Applied egg-rr90.3%
Final simplification91.6%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -9.5e+215)
(/ x (- y_m))
(if (<= x -240000000.0)
(/ (- (* x z) (+ x 4.0)) y_m)
(if (<= x 3.8e-6) (/ (- 4.0 (* x z)) y_m) (/ (- x (* x z)) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -9.5e+215) {
tmp = x / -y_m;
} else if (x <= -240000000.0) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9.5d+215)) then
tmp = x / -y_m
else if (x <= (-240000000.0d0)) then
tmp = ((x * z) - (x + 4.0d0)) / y_m
else if (x <= 3.8d-6) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -9.5e+215) {
tmp = x / -y_m;
} else if (x <= -240000000.0) {
tmp = ((x * z) - (x + 4.0)) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -9.5e+215: tmp = x / -y_m elif x <= -240000000.0: tmp = ((x * z) - (x + 4.0)) / y_m elif x <= 3.8e-6: tmp = (4.0 - (x * z)) / y_m else: tmp = (x - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -9.5e+215) tmp = Float64(x / Float64(-y_m)); elseif (x <= -240000000.0) tmp = Float64(Float64(Float64(x * z) - Float64(x + 4.0)) / y_m); elseif (x <= 3.8e-6) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -9.5e+215) tmp = x / -y_m; elseif (x <= -240000000.0) tmp = ((x * z) - (x + 4.0)) / y_m; elseif (x <= 3.8e-6) tmp = (4.0 - (x * z)) / y_m; else tmp = (x - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -9.5e+215], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -240000000.0], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 3.8e-6], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -240000000:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -9.50000000000000036e215Initial program 59.0%
fabs-sub59.0%
associate-*l/72.7%
associate-*r/72.7%
fma-neg86.3%
distribute-neg-frac86.3%
+-commutative86.3%
distribute-neg-in86.3%
unsub-neg86.3%
metadata-eval86.3%
Simplified86.3%
add-sqr-sqrt49.9%
fabs-sqr49.9%
add-sqr-sqrt50.2%
fma-undefine41.1%
associate-*r/41.1%
associate-*l/36.5%
div-inv36.4%
sub-neg36.4%
metadata-eval36.4%
distribute-neg-in36.4%
+-commutative36.4%
cancel-sign-sub-inv36.4%
div-inv36.5%
associate-*l/41.1%
sub-div50.2%
Applied egg-rr50.2%
Taylor expanded in z around 0 45.9%
associate-*r/45.9%
distribute-lft-in45.9%
metadata-eval45.9%
neg-mul-145.9%
unsub-neg45.9%
Simplified45.9%
Taylor expanded in x around inf 45.9%
neg-mul-145.9%
Simplified45.9%
if -9.50000000000000036e215 < x < -2.4e8Initial program 90.2%
fabs-sub90.2%
associate-*l/83.3%
associate-*r/90.1%
fma-neg97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.8%
fma-undefine44.3%
associate-*r/39.8%
associate-*l/44.4%
div-inv44.4%
sub-neg44.4%
metadata-eval44.4%
distribute-neg-in44.4%
+-commutative44.4%
cancel-sign-sub-inv44.4%
div-inv44.4%
associate-*l/39.8%
sub-div42.4%
Applied egg-rr42.4%
if -2.4e8 < x < 3.8e-6Initial program 94.2%
fabs-sub94.2%
associate-*l/99.9%
associate-*r/93.7%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine93.7%
associate-*r/99.9%
associate-*l/94.2%
div-inv94.2%
sub-neg94.2%
metadata-eval94.2%
distribute-neg-in94.2%
+-commutative94.2%
cancel-sign-sub-inv94.2%
div-inv94.2%
fabs-sub94.2%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt44.3%
associate-*l/47.7%
sub-div47.7%
Applied egg-rr47.7%
Taylor expanded in x around 0 47.3%
if 3.8e-6 < x Initial program 86.6%
fabs-sub86.6%
associate-*l/83.8%
associate-*r/91.5%
fma-neg91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
fma-undefine91.5%
associate-*r/83.8%
associate-*l/86.6%
div-inv86.5%
sub-neg86.5%
metadata-eval86.5%
distribute-neg-in86.5%
+-commutative86.5%
cancel-sign-sub-inv86.5%
div-inv86.6%
fabs-sub86.6%
add-sqr-sqrt44.7%
fabs-sqr44.7%
add-sqr-sqrt45.2%
associate-*l/47.0%
sub-div48.6%
Applied egg-rr48.6%
Taylor expanded in x around inf 48.4%
Final simplification46.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -9e+215)
(/ x (- y_m))
(if (<= x -240000000.0)
(/ (- (* x z) x) y_m)
(if (<= x 3.8e-6) (/ (- 4.0 (* x z)) y_m) (/ (- x (* x z)) y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -9e+215) {
tmp = x / -y_m;
} else if (x <= -240000000.0) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-9d+215)) then
tmp = x / -y_m
else if (x <= (-240000000.0d0)) then
tmp = ((x * z) - x) / y_m
else if (x <= 3.8d-6) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -9e+215) {
tmp = x / -y_m;
} else if (x <= -240000000.0) {
tmp = ((x * z) - x) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -9e+215: tmp = x / -y_m elif x <= -240000000.0: tmp = ((x * z) - x) / y_m elif x <= 3.8e-6: tmp = (4.0 - (x * z)) / y_m else: tmp = (x - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -9e+215) tmp = Float64(x / Float64(-y_m)); elseif (x <= -240000000.0) tmp = Float64(Float64(Float64(x * z) - x) / y_m); elseif (x <= 3.8e-6) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -9e+215) tmp = x / -y_m; elseif (x <= -240000000.0) tmp = ((x * z) - x) / y_m; elseif (x <= 3.8e-6) tmp = (4.0 - (x * z)) / y_m; else tmp = (x - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -9e+215], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -240000000.0], N[(N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 3.8e-6], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -240000000:\\
\;\;\;\;\frac{x \cdot z - x}{y\_m}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -9.0000000000000005e215Initial program 59.0%
fabs-sub59.0%
associate-*l/72.7%
associate-*r/72.7%
fma-neg86.3%
distribute-neg-frac86.3%
+-commutative86.3%
distribute-neg-in86.3%
unsub-neg86.3%
metadata-eval86.3%
Simplified86.3%
add-sqr-sqrt49.9%
fabs-sqr49.9%
add-sqr-sqrt50.2%
fma-undefine41.1%
associate-*r/41.1%
associate-*l/36.5%
div-inv36.4%
sub-neg36.4%
metadata-eval36.4%
distribute-neg-in36.4%
+-commutative36.4%
cancel-sign-sub-inv36.4%
div-inv36.5%
associate-*l/41.1%
sub-div50.2%
Applied egg-rr50.2%
Taylor expanded in z around 0 45.9%
associate-*r/45.9%
distribute-lft-in45.9%
metadata-eval45.9%
neg-mul-145.9%
unsub-neg45.9%
Simplified45.9%
Taylor expanded in x around inf 45.9%
neg-mul-145.9%
Simplified45.9%
if -9.0000000000000005e215 < x < -2.4e8Initial program 90.2%
fabs-sub90.2%
associate-*l/83.3%
associate-*r/90.1%
fma-neg97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.8%
fma-undefine44.3%
associate-*r/39.8%
associate-*l/44.4%
div-inv44.4%
sub-neg44.4%
metadata-eval44.4%
distribute-neg-in44.4%
+-commutative44.4%
cancel-sign-sub-inv44.4%
div-inv44.4%
associate-*l/39.8%
sub-div42.4%
Applied egg-rr42.4%
Taylor expanded in x around inf 41.4%
if -2.4e8 < x < 3.8e-6Initial program 94.2%
fabs-sub94.2%
associate-*l/99.9%
associate-*r/93.7%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine93.7%
associate-*r/99.9%
associate-*l/94.2%
div-inv94.2%
sub-neg94.2%
metadata-eval94.2%
distribute-neg-in94.2%
+-commutative94.2%
cancel-sign-sub-inv94.2%
div-inv94.2%
fabs-sub94.2%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt44.3%
associate-*l/47.7%
sub-div47.7%
Applied egg-rr47.7%
Taylor expanded in x around 0 47.3%
if 3.8e-6 < x Initial program 86.6%
fabs-sub86.6%
associate-*l/83.8%
associate-*r/91.5%
fma-neg91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
fma-undefine91.5%
associate-*r/83.8%
associate-*l/86.6%
div-inv86.5%
sub-neg86.5%
metadata-eval86.5%
distribute-neg-in86.5%
+-commutative86.5%
cancel-sign-sub-inv86.5%
div-inv86.6%
fabs-sub86.6%
add-sqr-sqrt44.7%
fabs-sqr44.7%
add-sqr-sqrt45.2%
associate-*l/47.0%
sub-div48.6%
Applied egg-rr48.6%
Taylor expanded in x around inf 48.4%
Final simplification46.5%
y_m = (fabs.f64 y)
(FPCore (x y_m z)
:precision binary64
(if (<= x -9.5e+215)
(/ x (- y_m))
(if (<= x -260000000.0)
(/ (- (* x z) (+ x 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 <= -9.5e+215) {
tmp = x / -y_m;
} else if (x <= -260000000.0) {
tmp = ((x * z) - (x + 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 <= (-9.5d+215)) then
tmp = x / -y_m
else if (x <= (-260000000.0d0)) then
tmp = ((x * z) - (x + 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 <= -9.5e+215) {
tmp = x / -y_m;
} else if (x <= -260000000.0) {
tmp = ((x * z) - (x + 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 <= -9.5e+215: tmp = x / -y_m elif x <= -260000000.0: tmp = ((x * z) - (x + 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 <= -9.5e+215) tmp = Float64(x / Float64(-y_m)); elseif (x <= -260000000.0) tmp = Float64(Float64(Float64(x * z) - Float64(x + 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 <= -9.5e+215) tmp = x / -y_m; elseif (x <= -260000000.0) tmp = ((x * z) - (x + 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, -9.5e+215], N[(x / (-y$95$m)), $MachinePrecision], If[LessEqual[x, -260000000.0], N[(N[(N[(x * z), $MachinePrecision] - N[(x + 4.0), $MachinePrecision]), $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 -9.5 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{elif}\;x \leq -260000000:\\
\;\;\;\;\frac{x \cdot z - \left(x + 4\right)}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 4\right) - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -9.50000000000000036e215Initial program 59.0%
fabs-sub59.0%
associate-*l/72.7%
associate-*r/72.7%
fma-neg86.3%
distribute-neg-frac86.3%
+-commutative86.3%
distribute-neg-in86.3%
unsub-neg86.3%
metadata-eval86.3%
Simplified86.3%
add-sqr-sqrt49.9%
fabs-sqr49.9%
add-sqr-sqrt50.2%
fma-undefine41.1%
associate-*r/41.1%
associate-*l/36.5%
div-inv36.4%
sub-neg36.4%
metadata-eval36.4%
distribute-neg-in36.4%
+-commutative36.4%
cancel-sign-sub-inv36.4%
div-inv36.5%
associate-*l/41.1%
sub-div50.2%
Applied egg-rr50.2%
Taylor expanded in z around 0 45.9%
associate-*r/45.9%
distribute-lft-in45.9%
metadata-eval45.9%
neg-mul-145.9%
unsub-neg45.9%
Simplified45.9%
Taylor expanded in x around inf 45.9%
neg-mul-145.9%
Simplified45.9%
if -9.50000000000000036e215 < x < -2.6e8Initial program 90.2%
fabs-sub90.2%
associate-*l/83.3%
associate-*r/90.1%
fma-neg97.4%
distribute-neg-frac97.4%
+-commutative97.4%
distribute-neg-in97.4%
unsub-neg97.4%
metadata-eval97.4%
Simplified97.4%
add-sqr-sqrt46.1%
fabs-sqr46.1%
add-sqr-sqrt46.8%
fma-undefine44.3%
associate-*r/39.8%
associate-*l/44.4%
div-inv44.4%
sub-neg44.4%
metadata-eval44.4%
distribute-neg-in44.4%
+-commutative44.4%
cancel-sign-sub-inv44.4%
div-inv44.4%
associate-*l/39.8%
sub-div42.4%
Applied egg-rr42.4%
if -2.6e8 < x Initial program 91.8%
fabs-sub91.8%
associate-*l/94.9%
associate-*r/93.0%
fma-neg93.0%
distribute-neg-frac93.0%
+-commutative93.0%
distribute-neg-in93.0%
unsub-neg93.0%
metadata-eval93.0%
Simplified93.0%
fma-undefine93.0%
associate-*r/94.9%
associate-*l/91.8%
div-inv91.8%
sub-neg91.8%
metadata-eval91.8%
distribute-neg-in91.8%
+-commutative91.8%
cancel-sign-sub-inv91.8%
div-inv91.8%
fabs-sub91.8%
add-sqr-sqrt43.4%
fabs-sqr43.4%
add-sqr-sqrt44.6%
associate-*l/47.5%
sub-div48.0%
Applied egg-rr48.0%
Final simplification46.9%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -240000000.0) (/ (- -4.0 x) y_m) (if (<= x 3.8e-6) (/ (- 4.0 (* x z)) y_m) (/ (- x (* x z)) y_m))))
y_m = fabs(y);
double code(double x, double y_m, double z) {
double tmp;
if (x <= -240000000.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-240000000.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 3.8d-6) then
tmp = (4.0d0 - (x * z)) / y_m
else
tmp = (x - (x * z)) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z) {
double tmp;
if (x <= -240000000.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 3.8e-6) {
tmp = (4.0 - (x * z)) / y_m;
} else {
tmp = (x - (x * z)) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z): tmp = 0 if x <= -240000000.0: tmp = (-4.0 - x) / y_m elif x <= 3.8e-6: tmp = (4.0 - (x * z)) / y_m else: tmp = (x - (x * z)) / y_m return tmp
y_m = abs(y) function code(x, y_m, z) tmp = 0.0 if (x <= -240000000.0) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 3.8e-6) tmp = Float64(Float64(4.0 - Float64(x * z)) / y_m); else tmp = Float64(Float64(x - Float64(x * z)) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z) tmp = 0.0; if (x <= -240000000.0) tmp = (-4.0 - x) / y_m; elseif (x <= 3.8e-6) tmp = (4.0 - (x * z)) / y_m; else tmp = (x - (x * z)) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_] := If[LessEqual[x, -240000000.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 3.8e-6], N[(N[(4.0 - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision], N[(N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision] / y$95$m), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq -240000000:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - x \cdot z}{y\_m}\\
\end{array}
\end{array}
if x < -2.4e8Initial program 79.3%
fabs-sub79.3%
associate-*l/79.6%
associate-*r/84.0%
fma-neg93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt47.4%
fabs-sqr47.4%
add-sqr-sqrt48.0%
fma-undefine43.2%
associate-*r/40.3%
associate-*l/41.6%
div-inv41.6%
sub-neg41.6%
metadata-eval41.6%
distribute-neg-in41.6%
+-commutative41.6%
cancel-sign-sub-inv41.6%
div-inv41.6%
associate-*l/40.3%
sub-div45.1%
Applied egg-rr45.1%
Taylor expanded in z around 0 33.9%
associate-*r/33.9%
distribute-lft-in33.9%
metadata-eval33.9%
neg-mul-133.9%
unsub-neg33.9%
Simplified33.9%
if -2.4e8 < x < 3.8e-6Initial program 94.2%
fabs-sub94.2%
associate-*l/99.9%
associate-*r/93.7%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine93.7%
associate-*r/99.9%
associate-*l/94.2%
div-inv94.2%
sub-neg94.2%
metadata-eval94.2%
distribute-neg-in94.2%
+-commutative94.2%
cancel-sign-sub-inv94.2%
div-inv94.2%
fabs-sub94.2%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt44.3%
associate-*l/47.7%
sub-div47.7%
Applied egg-rr47.7%
Taylor expanded in x around 0 47.3%
if 3.8e-6 < x Initial program 86.6%
fabs-sub86.6%
associate-*l/83.8%
associate-*r/91.5%
fma-neg91.5%
distribute-neg-frac91.5%
+-commutative91.5%
distribute-neg-in91.5%
unsub-neg91.5%
metadata-eval91.5%
Simplified91.5%
fma-undefine91.5%
associate-*r/83.8%
associate-*l/86.6%
div-inv86.5%
sub-neg86.5%
metadata-eval86.5%
distribute-neg-in86.5%
+-commutative86.5%
cancel-sign-sub-inv86.5%
div-inv86.6%
fabs-sub86.6%
add-sqr-sqrt44.7%
fabs-sqr44.7%
add-sqr-sqrt45.2%
associate-*l/47.0%
sub-div48.6%
Applied egg-rr48.6%
Taylor expanded in x around inf 48.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -240000000.0) (/ (- -4.0 x) y_m) (if (<= x 10500000000000.0) (/ (- 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 <= -240000000.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 10500000000000.0) {
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 <= (-240000000.0d0)) then
tmp = ((-4.0d0) - x) / y_m
else if (x <= 10500000000000.0d0) 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 <= -240000000.0) {
tmp = (-4.0 - x) / y_m;
} else if (x <= 10500000000000.0) {
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 <= -240000000.0: tmp = (-4.0 - x) / y_m elif x <= 10500000000000.0: 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 <= -240000000.0) tmp = Float64(Float64(-4.0 - x) / y_m); elseif (x <= 10500000000000.0) 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 <= -240000000.0) tmp = (-4.0 - x) / y_m; elseif (x <= 10500000000000.0) 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, -240000000.0], N[(N[(-4.0 - x), $MachinePrecision] / y$95$m), $MachinePrecision], If[LessEqual[x, 10500000000000.0], 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 -240000000:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{elif}\;x \leq 10500000000000:\\
\;\;\;\;\frac{4 - x \cdot z}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -2.4e8Initial program 79.3%
fabs-sub79.3%
associate-*l/79.6%
associate-*r/84.0%
fma-neg93.5%
distribute-neg-frac93.5%
+-commutative93.5%
distribute-neg-in93.5%
unsub-neg93.5%
metadata-eval93.5%
Simplified93.5%
add-sqr-sqrt47.4%
fabs-sqr47.4%
add-sqr-sqrt48.0%
fma-undefine43.2%
associate-*r/40.3%
associate-*l/41.6%
div-inv41.6%
sub-neg41.6%
metadata-eval41.6%
distribute-neg-in41.6%
+-commutative41.6%
cancel-sign-sub-inv41.6%
div-inv41.6%
associate-*l/40.3%
sub-div45.1%
Applied egg-rr45.1%
Taylor expanded in z around 0 33.9%
associate-*r/33.9%
distribute-lft-in33.9%
metadata-eval33.9%
neg-mul-133.9%
unsub-neg33.9%
Simplified33.9%
if -2.4e8 < x < 1.05e13Initial program 94.3%
fabs-sub94.3%
associate-*l/99.9%
associate-*r/93.8%
fma-neg93.8%
distribute-neg-frac93.8%
+-commutative93.8%
distribute-neg-in93.8%
unsub-neg93.8%
metadata-eval93.8%
Simplified93.8%
fma-undefine93.8%
associate-*r/99.9%
associate-*l/94.3%
div-inv94.3%
sub-neg94.3%
metadata-eval94.3%
distribute-neg-in94.3%
+-commutative94.3%
cancel-sign-sub-inv94.3%
div-inv94.3%
fabs-sub94.3%
add-sqr-sqrt44.1%
fabs-sqr44.1%
add-sqr-sqrt45.5%
associate-*l/48.9%
sub-div48.9%
Applied egg-rr48.9%
Taylor expanded in x around 0 48.5%
if 1.05e13 < x Initial program 85.9%
fabs-sub85.9%
associate-*l/83.0%
associate-*r/91.1%
fma-neg91.1%
distribute-neg-frac91.1%
+-commutative91.1%
distribute-neg-in91.1%
unsub-neg91.1%
metadata-eval91.1%
Simplified91.1%
fma-undefine91.1%
associate-*r/83.0%
associate-*l/85.9%
div-inv85.8%
sub-neg85.8%
metadata-eval85.8%
distribute-neg-in85.8%
+-commutative85.8%
cancel-sign-sub-inv85.8%
div-inv85.9%
fabs-sub85.9%
add-sqr-sqrt41.8%
fabs-sqr41.8%
add-sqr-sqrt42.4%
associate-*l/44.2%
sub-div45.9%
Applied egg-rr45.9%
Taylor expanded in z around 0 40.3%
Final simplification43.1%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -10.0) (/ 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.0) {
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.0d0)) 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.0) {
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.0: 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.0) tmp = Float64(x / Float64(-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.0) 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.0], 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:\\
\;\;\;\;\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 < -10Initial program 79.9%
fabs-sub79.9%
associate-*l/80.2%
associate-*r/84.5%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.6%
fma-undefine44.9%
associate-*r/42.1%
associate-*l/43.4%
div-inv43.4%
sub-neg43.4%
metadata-eval43.4%
distribute-neg-in43.4%
+-commutative43.4%
cancel-sign-sub-inv43.4%
div-inv43.4%
associate-*l/42.1%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in z around 0 32.9%
associate-*r/32.9%
distribute-lft-in32.9%
metadata-eval32.9%
neg-mul-132.9%
unsub-neg32.9%
Simplified32.9%
Taylor expanded in x around inf 32.2%
neg-mul-132.2%
Simplified32.2%
if -10 < x < 4Initial program 94.2%
fabs-sub94.2%
associate-*l/99.9%
associate-*r/93.7%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine93.7%
associate-*r/99.9%
associate-*l/94.2%
div-inv94.2%
sub-neg94.2%
metadata-eval94.2%
distribute-neg-in94.2%
+-commutative94.2%
cancel-sign-sub-inv94.2%
div-inv94.2%
fabs-sub94.2%
add-sqr-sqrt44.3%
fabs-sqr44.3%
add-sqr-sqrt45.8%
associate-*l/49.2%
sub-div49.2%
Applied egg-rr49.2%
Taylor expanded in x around 0 38.7%
if 4 < x Initial program 86.2%
fabs-sub86.2%
associate-*l/83.2%
associate-*r/91.3%
fma-neg91.3%
distribute-neg-frac91.3%
+-commutative91.3%
distribute-neg-in91.3%
unsub-neg91.3%
metadata-eval91.3%
Simplified91.3%
fma-undefine91.3%
associate-*r/83.2%
associate-*l/86.2%
div-inv86.0%
sub-neg86.0%
metadata-eval86.0%
distribute-neg-in86.0%
+-commutative86.0%
cancel-sign-sub-inv86.0%
div-inv86.2%
fabs-sub86.2%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt43.4%
associate-*l/45.2%
sub-div46.9%
Applied egg-rr46.9%
Taylor expanded in x around inf 46.7%
Taylor expanded in z around 0 39.5%
Final simplification37.2%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ (- -4.0 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 <= -4.0) {
tmp = (-4.0 - 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 <= (-4.0d0)) then
tmp = ((-4.0d0) - 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 <= -4.0) {
tmp = (-4.0 - 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 <= -4.0: tmp = (-4.0 - 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 <= -4.0) tmp = Float64(Float64(-4.0 - 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 <= -4.0) tmp = (-4.0 - 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, -4.0], N[(N[(-4.0 - x), $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 -4:\\
\;\;\;\;\frac{-4 - x}{y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 79.9%
fabs-sub79.9%
associate-*l/80.2%
associate-*r/84.5%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.6%
fma-undefine44.9%
associate-*r/42.1%
associate-*l/43.4%
div-inv43.4%
sub-neg43.4%
metadata-eval43.4%
distribute-neg-in43.4%
+-commutative43.4%
cancel-sign-sub-inv43.4%
div-inv43.4%
associate-*l/42.1%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in z around 0 32.9%
associate-*r/32.9%
distribute-lft-in32.9%
metadata-eval32.9%
neg-mul-132.9%
unsub-neg32.9%
Simplified32.9%
if -4 < x Initial program 91.8%
fabs-sub91.8%
associate-*l/94.8%
associate-*r/92.9%
fma-neg92.9%
distribute-neg-frac92.9%
+-commutative92.9%
distribute-neg-in92.9%
unsub-neg92.9%
metadata-eval92.9%
Simplified92.9%
fma-undefine92.9%
associate-*r/94.8%
associate-*l/91.8%
div-inv91.7%
sub-neg91.7%
metadata-eval91.7%
distribute-neg-in91.7%
+-commutative91.7%
cancel-sign-sub-inv91.7%
div-inv91.8%
fabs-sub91.8%
add-sqr-sqrt43.9%
fabs-sqr43.9%
add-sqr-sqrt45.0%
associate-*l/48.0%
sub-div48.5%
Applied egg-rr48.5%
Taylor expanded in z around 0 39.0%
Final simplification37.4%
y_m = (fabs.f64 y) (FPCore (x y_m z) :precision binary64 (if (<= x -4.0) (/ 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 <= -4.0) {
tmp = 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 <= (-4.0d0)) then
tmp = 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 <= -4.0) {
tmp = 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 <= -4.0: tmp = 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 <= -4.0) tmp = Float64(x / Float64(-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 <= -4.0) tmp = 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, -4.0], N[(x / (-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 -4:\\
\;\;\;\;\frac{x}{-y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 4}{y\_m}\\
\end{array}
\end{array}
if x < -4Initial program 79.9%
fabs-sub79.9%
associate-*l/80.2%
associate-*r/84.5%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
add-sqr-sqrt49.0%
fabs-sqr49.0%
add-sqr-sqrt49.6%
fma-undefine44.9%
associate-*r/42.1%
associate-*l/43.4%
div-inv43.4%
sub-neg43.4%
metadata-eval43.4%
distribute-neg-in43.4%
+-commutative43.4%
cancel-sign-sub-inv43.4%
div-inv43.4%
associate-*l/42.1%
sub-div46.8%
Applied egg-rr46.8%
Taylor expanded in z around 0 32.9%
associate-*r/32.9%
distribute-lft-in32.9%
metadata-eval32.9%
neg-mul-132.9%
unsub-neg32.9%
Simplified32.9%
Taylor expanded in x around inf 32.2%
neg-mul-132.2%
Simplified32.2%
if -4 < x Initial program 91.8%
fabs-sub91.8%
associate-*l/94.8%
associate-*r/92.9%
fma-neg92.9%
distribute-neg-frac92.9%
+-commutative92.9%
distribute-neg-in92.9%
unsub-neg92.9%
metadata-eval92.9%
Simplified92.9%
fma-undefine92.9%
associate-*r/94.8%
associate-*l/91.8%
div-inv91.7%
sub-neg91.7%
metadata-eval91.7%
distribute-neg-in91.7%
+-commutative91.7%
cancel-sign-sub-inv91.7%
div-inv91.8%
fabs-sub91.8%
add-sqr-sqrt43.9%
fabs-sqr43.9%
add-sqr-sqrt45.0%
associate-*l/48.0%
sub-div48.5%
Applied egg-rr48.5%
Taylor expanded in z around 0 39.0%
Final simplification37.3%
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.5%
fabs-sub89.5%
associate-*l/93.4%
associate-*r/90.6%
fma-neg93.7%
distribute-neg-frac93.7%
+-commutative93.7%
distribute-neg-in93.7%
unsub-neg93.7%
metadata-eval93.7%
Simplified93.7%
fma-undefine90.6%
associate-*r/93.4%
associate-*l/89.5%
div-inv89.5%
sub-neg89.5%
metadata-eval89.5%
distribute-neg-in89.5%
+-commutative89.5%
cancel-sign-sub-inv89.5%
div-inv89.5%
fabs-sub89.5%
add-sqr-sqrt41.8%
fabs-sqr41.8%
add-sqr-sqrt43.0%
associate-*l/45.8%
sub-div49.3%
Applied egg-rr49.3%
Taylor expanded in x around 0 27.0%
if 4 < x Initial program 86.2%
fabs-sub86.2%
associate-*l/83.2%
associate-*r/91.3%
fma-neg91.3%
distribute-neg-frac91.3%
+-commutative91.3%
distribute-neg-in91.3%
unsub-neg91.3%
metadata-eval91.3%
Simplified91.3%
fma-undefine91.3%
associate-*r/83.2%
associate-*l/86.2%
div-inv86.0%
sub-neg86.0%
metadata-eval86.0%
distribute-neg-in86.0%
+-commutative86.0%
cancel-sign-sub-inv86.0%
div-inv86.2%
fabs-sub86.2%
add-sqr-sqrt42.8%
fabs-sqr42.8%
add-sqr-sqrt43.4%
associate-*l/45.2%
sub-div46.9%
Applied egg-rr46.9%
Taylor expanded in x around inf 46.7%
Taylor expanded in z around 0 39.5%
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 88.8%
fabs-sub88.8%
associate-*l/91.1%
associate-*r/90.8%
fma-neg93.1%
distribute-neg-frac93.1%
+-commutative93.1%
distribute-neg-in93.1%
unsub-neg93.1%
metadata-eval93.1%
Simplified93.1%
fma-undefine90.8%
associate-*r/91.1%
associate-*l/88.8%
div-inv88.7%
sub-neg88.7%
metadata-eval88.7%
distribute-neg-in88.7%
+-commutative88.7%
cancel-sign-sub-inv88.7%
div-inv88.8%
fabs-sub88.8%
add-sqr-sqrt42.0%
fabs-sqr42.0%
add-sqr-sqrt43.1%
associate-*l/45.6%
sub-div48.8%
Applied egg-rr48.8%
Taylor expanded in x around 0 21.7%
herbie shell --seed 2024136
(FPCore (x y z)
:name "fabs fraction 1"
:precision binary64
(fabs (- (/ (+ x 4.0) y) (* (/ x y) z))))